Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Practical Graph Structures in SQL

Server and Azure SQL: Enabling Deeper


Insights Using Highly Connected Data
1st Edition Louis Davidson
Visit to download the full and correct content document:
https://ebookmass.com/product/practical-graph-structures-in-sql-server-and-azure-sql
-enabling-deeper-insights-using-highly-connected-data-1st-edition-louis-davidson/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Practical Graph Structures in SQL Server and Azure SQL:


Enabling Deeper Insights Using Highly Connected Data
1st Edition Louis Davidson

https://ebookmass.com/product/practical-graph-structures-in-sql-
server-and-azure-sql-enabling-deeper-insights-using-highly-
connected-data-1st-edition-louis-davidson/

Pro SQL Server 2022 Wait Statistics: A Practical Guide


to Analyzing Performance in SQL Server and Azure SQL
Database, 3rd Edition Thomas Larock

https://ebookmass.com/product/pro-sql-server-2022-wait-
statistics-a-practical-guide-to-analyzing-performance-in-sql-
server-and-azure-sql-database-3rd-edition-thomas-larock/

Pro SQL Server 2022 Wait Statistics: A Practical Guide


to Analyzing Performance in SQL Server and Azure SQL
Database, 3rd Edition Thomas Larock

https://ebookmass.com/product/pro-sql-server-2022-wait-
statistics-a-practical-guide-to-analyzing-performance-in-sql-
server-and-azure-sql-database-3rd-edition-thomas-larock-2/

SQL Server Analytical Toolkit: Using Windowing,


Analytical, Ranking, and Aggregate Functions for Data
and Statistical Analysis 1st Edition Angelo Bobak

https://ebookmass.com/product/sql-server-analytical-toolkit-
using-windowing-analytical-ranking-and-aggregate-functions-for-
data-and-statistical-analysis-1st-edition-angelo-bobak/
Expert Performance Indexing in Azure SQL and SQL Server
2022, Fourth Edition: Toward Faster Results and Lower
Maintenance Both on Premises and in the Cloud Edward
Pollack
https://ebookmass.com/product/expert-performance-indexing-in-
azure-sql-and-sql-server-2022-fourth-edition-toward-faster-
results-and-lower-maintenance-both-on-premises-and-in-the-cloud-
edward-pollack/

Getting Started with SQL and Databases: Managing and


Manipulating Data with SQL 1st Edition Mark Simon

https://ebookmass.com/product/getting-started-with-sql-and-
databases-managing-and-manipulating-data-with-sql-1st-edition-
mark-simon/

SQL Server 2022 Administration Inside Out 1st Edition


Randolph West

https://ebookmass.com/product/sql-server-2022-administration-
inside-out-1st-edition-randolph-west/

Azure SQL Hyperscale Revealed: High-performance


Scalable Solutions for Critical Data Workloads 1st
Edition Zoran Bara■

https://ebookmass.com/product/azure-sql-hyperscale-revealed-high-
performance-scalable-solutions-for-critical-data-workloads-1st-
edition-zoran-barac-2/

Azure SQL Hyperscale Revealed: High-performance


Scalable Solutions for Critical Data Workloads 1st
Edition Zoran Bara■

https://ebookmass.com/product/azure-sql-hyperscale-revealed-high-
performance-scalable-solutions-for-critical-data-workloads-1st-
edition-zoran-barac/
Practical Graph
Structures in
SQL Server and
Azure SQL
Enabling Deeper Insights Using
Highly Connected Data

Louis Davidson
Practical Graph
Structures in SQL Server
and Azure SQL
Enabling Deeper Insights Using
Highly Connected Data

Louis Davidson
Practical Graph Structures in SQL Server and Azure SQL: Enabling Deeper Insights
Using Highly Connected Data

Louis Davidson
Cleveland, TN, USA

ISBN-13 (pbk): 978-1-4842-9458-1 ISBN-13 (electronic): 978-1-4842-9459-8


https://doi.org/10.1007/978-1-4842-9459-8

Copyright © 2023 by Louis Davidson


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Jonathan Gennick
Development Editor: Laura Berendson
Editorial Project Manager: Shaul Elson
Copy Editor: Mary Behr
Cover image by Garry Killian from Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York Plaza, Suite
4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.
com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner)
is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware
corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (https://github.com/Apress). For more detailed information, please visit www.apress.
com/source-code.
Printed on acid-free paper
To Val, what a life we have had so far… here’s to more of it.
Table of Contents
About the Author����������������������������������������������������������������������������������������������������� ix

About the Technical Reviewer��������������������������������������������������������������������������������� xi


Acknowledgments������������������������������������������������������������������������������������������������� xiii

Preface��������������������������������������������������������������������������������������������������������������������xv

Chapter 1: Introduction to Graphs���������������������������������������������������������������������������� 1


Graph Fundamentals��������������������������������������������������������������������������������������������������������������������� 3
Definition��������������������������������������������������������������������������������������������������������������������������������� 4
Summary������������������������������������������������������������������������������������������������������������������������������������ 15

Chapter 2: Data Structures and Algorithms����������������������������������������������������������� 17


Basic Implementation����������������������������������������������������������������������������������������������������������������� 17
Acyclic Graphs���������������������������������������������������������������������������������������������������������������������������� 19
Trees�������������������������������������������������������������������������������������������������������������������������������������� 22
Other Acyclic Graphs������������������������������������������������������������������������������������������������������������� 27
Cyclic Graphs������������������������������������������������������������������������������������������������������������������������������ 30
Non-Directed Graphs������������������������������������������������������������������������������������������������������������� 35
Summary������������������������������������������������������������������������������������������������������������������������������������ 36

Chapter 3: SQL Graph Table Basics������������������������������������������������������������������������ 39


Object Creation��������������������������������������������������������������������������������������������������������������������������� 40
Creating Data������������������������������������������������������������������������������������������������������������������������������ 43
Querying Data����������������������������������������������������������������������������������������������������������������������������� 48
Node-to-Node Querying��������������������������������������������������������������������������������������������������������� 48
Traversing Variable Level Paths��������������������������������������������������������������������������������������������� 59
Summary������������������������������������������������������������������������������������������������������������������������������������ 75

v
Table of Contents

Chapter 4: SQL Graph Tables: Extended Topics������������������������������������������������������� 77


Advanced Data Creation Techniques������������������������������������������������������������������������������������������� 77
Building an Interface Layer��������������������������������������������������������������������������������������������������� 78
Loading Data Using Composable JSON Tags������������������������������������������������������������������������� 87
Heterogenous Queries���������������������������������������������������������������������������������������������������������������� 93
Integrity Constraints and Indexes��������������������������������������������������������������������������������������������� 101
Edge Constraint������������������������������������������������������������������������������������������������������������������� 101
Uniqueness Constraints (and Indexes)�������������������������������������������������������������������������������� 107
Additional Constraints��������������������������������������������������������������������������������������������������������� 111
Metadata Roundup�������������������������������������������������������������������������������������������������������������������� 115
List Graph Objects in the Database������������������������������������������������������������������������������������� 115
Types of Graph Columns������������������������������������������������������������������������������������������������������ 116
Tools for Fetching Graph Information���������������������������������������������������������������������������������� 117
Summary���������������������������������������������������������������������������������������������������������������������������������� 118

Chapter 5: Tree Data Structures��������������������������������������������������������������������������� 121


Creating the Data Structures���������������������������������������������������������������������������������������������������� 122
Base Table Structures���������������������������������������������������������������������������������������������������������� 122
Demo Sales Structure���������������������������������������������������������������������������������������������������������� 125
Essential Tree Maintenance Code��������������������������������������������������������������������������������������������� 127
Code To Create New Nodes������������������������������������������������������������������������������������������������� 128
Reparenting Nodes�������������������������������������������������������������������������������������������������������������� 138
Deleting a Node������������������������������������������������������������������������������������������������������������������� 141
Tree Output Code���������������������������������������������������������������������������������������������������������������������� 148
Returning Part of the Tree���������������������������������������������������������������������������������������������������� 149
Determining If a Child Node Exists�������������������������������������������������������������������������������������� 151
Aggregating Child Activity at Every Level���������������������������������������������������������������������������� 154
Summary���������������������������������������������������������������������������������������������������������������������������������� 162

vi
Table of Contents

Chapter 6: Tree Structures, Algorithms, and Performance����������������������������������� 163


Alternative Tree Implementation����������������������������������������������������������������������������������������������� 164
Path Technique�������������������������������������������������������������������������������������������������������������������� 166
Helper Table������������������������������������������������������������������������������������������������������������������������� 175
Performance Comparison��������������������������������������������������������������������������������������������������������� 186
Summary���������������������������������������������������������������������������������������������������������������������������������� 189

Chapter 7: Other Directed Acyclic Graphs������������������������������������������������������������ 191


The Problem Set������������������������������������������������������������������������������������������������������������������������ 191
The Example����������������������������������������������������������������������������������������������������������������������������� 193
Determining If a Part Is Used in a Build������������������������������������������������������������������������������������ 197
Picking Items for a Build����������������������������������������������������������������������������������������������������������� 200
Printing Out the Parts List for a Build���������������������������������������������������������������������������������������� 201
Summary���������������������������������������������������������������������������������������������������������������������������������� 206

Chapter 8: A Graph For Testing����������������������������������������������������������������������������� 209


The Example����������������������������������������������������������������������������������������������������������������������������� 209
Creating the Tables�������������������������������������������������������������������������������������������������������������� 210
Loading the Data����������������������������������������������������������������������������������������������������������������� 212
The Queries������������������������������������������������������������������������������������������������������������������������� 215
Performance Tuning Results����������������������������������������������������������������������������������������������������� 228
Performance Tuning Roundup��������������������������������������������������������������������������������������������������� 231
Test�������������������������������������������������������������������������������������������������������������������������������������� 231
Index the Internal Columns�������������������������������������������������������������������������������������������������� 231
Employ a Maximum Degree of Parallelism of One�������������������������������������������������������������� 232
Consider Breaking Up Some Queries����������������������������������������������������������������������������������� 232
The End (or Is It the Beginning?)����������������������������������������������������������������������������������������������� 233

Index��������������������������������������������������������������������������������������������������������������������� 235

vii
About the Author
Louis Davidson has been working with databases for
more than 25 years as a corporate database developer
and architect. He is now the editor for the Redgate Simple
Talk website. He has been a Microsoft MVP for 18 years. In
addition to this book on graphs in SQL Server, he has written
six editions of his general-purpose SQL Server database
design book (Apress) and has worked on multiple other
book projects over the years.
Louis has been active in speaking about database design and implementation at many
conferences over the past 25 years, including SQL PASS, SQL Rally, SQL Saturday events,
CA World, Music City Data, and the devLink Technical Conference. He has a bachelor’s
degree in computer science from the University of Tennessee at Chattanooga. For more
information, please visit his website at drsql.org.

ix
About the Technical Reviewer
Kathi Kellenberger is a Customer Success Engineer at
Redgate and a Data Platform MVP. She has worked with
SQL Server since 1998 and has authored, co-authored, or
tech reviewed over 20 technical books. Kathi is a longtime
volunteer at LaunchCode in St. Louis where she has taught
T-SQL in the LaunchCode Women + program. When Kathi
isn’t working, she enjoys spending time with family and
friends, cycling, singing, and climbing the stairs of tall
buildings.

xi
Acknowledgments
My wife, for suffering through yet another long and painful book writing process.
The Microsoft MVP Program for all the connections it has provided me to meet
wonderful, bizarrely smart people for 18 years. And my lead, Rie Merritt, for all she has
done for me through the years; amazing how we met so many years ago. Just meeting
Bob Ward and Conor Cunningham is thrill enough, and there have been hundreds
besides them.
Shreya Verma and Arvind Shyamsundar for their help over the past few years as I
attempted to do crazy things with the graph objects on my local personal computer.
Dr. David Rosenstein, who first got me interested in graphs in relational structures so
many years ago. Paul Nielsen for the talks we had on graph structures.
Kathi Kellenberger for tech editing this book. I appreciate the hard work!
All the doctors/medical professionals who kept me alive and kicking these past few
years. (If you want to know more, just ask, if you have a while to talk. There is a reason
this book took me over two years to write.)
My coworkers at CBN whom I left during the writing of this book. I hope the graph
objects I left you with are serving you nicely.
My new coworkers at Redgate. I have been a friend of Redgate (as well as a member
of Friends of Redgate) for many years, writing for them. My new manager and teammates
have been nothing but awesome.
Amber Davis, for giving me the chance to be a Dollywood Insider. Obviously being
a Dollywood insider has little to do with this book, but I just wanted to say it again
(which she may never see!) as I am writing the acknowledgements in the Dollywood
Dreammore lobby. I learned a lot from her that has been useful writing some of this book
and in my new job at Redgate as Simple-Talk editor.

xiii
Preface
I started working on my first book 23 years ago. It was on relational database design.
I had learned a little about graphs at that point from a class I took by Dr. David
Rozenshtein (his 1997 book The Essence of SQL : A Guide to Learning Most of SQL in the
Least Amount of Time was essential). His class was very influential and taught me a lot
about how to think about SQL problems. This was a really long time ago (clearly), but
in that same class, one of the sections was on trees in SQL Server. I was hooked on the
subject.
In my 2012 edition of my database design book, I started to include hierarchies
as one of the topics. In my latest book, that came out after SQL Server 2019 arrived, I
promised a book of SQL Graph. This book in your hands is the answer to that challenge.
This is my first programming-based book in many years. Usually I am more
interested in helping you shape a design, but in this case, I want to show you the
mechanics of building a graph database solution using SQL Server and leave it more
to you to decide what to do with it from there. Part of this is due to the newness and
relative complexity of the topic, but also because graphs are meant to be very flexible
structures…way more flexible than the standard relational databases.
The chapters of the book are as follows:

• Chapter 1: What a graph is and ways graphs can be used. I touch on


some of the underpinnings of what makes a graph a graph and a taste
of the theory that mathematicians use to describe and work with
graph data structures.

• Chapter 2: How graphs are implemented and the algorithms that are
used to process them. While the basic structure of the graph is really
simple, there is some value to understanding how graph structures
are built in coding and having some idea of what you will see in the
rest of the book.

xv
Preface

• Chapter 3: The syntax that Microsoft has implemented for use with
graph data stored in SQL Server tables is similar to what you probably
already know from working with relational tables, but it is so much
more. In this chapter, I teach you how to use the syntax provided by
Microsoft to query graph tables in interesting ways.

• Chapter 4: Whereas in Chapter 3 I showed basic query techniques, in


this chapter I show methods that can help you load and protect the
integrity of the data in your SQL Graph tables.

• Chapter 5: A tree structure built using SQL Graph objects, including


code to load and manipulate those nodes in ways that you will need
when building production systems. In this chapter, you explore
the code to create and manage a tree in SQL Server, along with an
example of how it all works.

• Chapter 6: In this chapter, I dig into performance. You’ll examine


a new method of implementing a tree for comparison to the SQL
Graph objects and build some objects you can use to write queries
to report on data in your trees that operate faster. You will then build
some large, random data sets and compare how these methods
perform with certain larger sized data sets.

• Chapter 7: The goal of this chapter is to build a data structure that


can show some of the concerns with working with directed graphs
that are not trees. You will build a fairly simple bill of materials data
structure to demonstrate the techniques you will need when you are
working with these structures, which are similar to trees but still quite
different.

• Chapter 8: In this chapter, you will do some querying of larger data


sets in SQL Server’s graph objects. To do this, you will implement
a graph structure and data generation tools to try on large sets of
data to match your expected needs. Finally, you will explore a set of
performance tips for handling graph objects.

xvi
Preface

SQL Server’s relational engine may never be acceptable as a complete replacement


for a specific graph database system like CosmosDB, but even in its relative infancy with
just a few iterations complete in the SQL Server lifecycle, it has become a nice way to
extend your data structures inside existing relational data structures quickly and easily.
You can find the downloads in the book in two locations. First, on Apress’s website
you will find the original code for this book and any errata that is reported: ­https://
github.com/Apress/practical-graph-structures. Second, at https://github.com/
drsqlgithub/GraphBook1 you will find that code plus any new code and projects I create
that pertain to learning graphs until I start working on a second edition of this book
someday.
If you have any direct questions about the content, send email to louis@drsql.org
and I will do what I can.

xvii
CHAPTER 1

Introduction to Graphs
With great power comes great responsibility.
--Voltaire (and Spider-Man’s Uncle Ben)

At its core, a graph data structure is simply a model representing the connection of one
thing to one other thing and then those things to even more other things. Essentially a
graph database formalizes a database based on many-to-many relationships as the core
relationship.
Everyone who has ever modeled a relational database will either have modeled
a graph purposefully or inadvertently because many-to-many relationships begin to
appear as you add more concepts to your data model. The vast difference you will see is
that relational implementations, ideally, are rigidly modeled.
The term frequently used to decide whether to model a many-to-many relationship
in a relational database or a graph structure is whether the data is highly connected.
With a graph database structure, you can connect many tables to many other tables
and query that structure in a different (yet quite similar) manner to how you query a
relational database.
There are many examples of graphs, but some of the most common examples you
probably hear about are

• Social networks, where you record the relationship from one person
to another

• Suggestion processing systems like online retailers use to record the


relationship between a person and the products they have looked at
and ordered and how that matches up with other people who have
similar interests

• Manager-employee relationships where the employee has a manager


who also has a manager who is likely managed by someone else

1
© Louis Davidson 2023
L. Davidson, Practical Graph Structures in SQL Server and Azure SQL,
https://doi.org/10.1007/978-1-4842-9459-8_1
Chapter 1 Introduction to Graphs

With this information, you can discover interesting things about an object based on
its relationships and similarity to relationships other entities have.
Possibly the most famous graph that most people will have heard of is the basis of the
parlor game “Six Degrees of Kevin Bacon.” This game suggests that everyone is no more
than six connections away from anyone else, including Kevin Bacon (and not just that
your favorite breakfast meat is bacon.)
The fact that graphs are very natural data structures does not make them easy
to work with. Because they are less rigid data structures than relational tables, the
flexibility makes them quite complex to work with (certainly in the database engine).
Graph objects can represent a very messy reality, and the more complex the data you
are modeling, the more complicated it is to work with. Of course, the reward for that
complexity is the solutions you create are often quite tremendous.
Like many computer science topics, graphs are also a fundamental mathematical
concept. Some of the insights you can get from the math of graphs will help once we
start analyzing data. So, to begin this book on graphs, I will provide a very cursory look
at some mathematical concepts as I define what a graph is and how it can be used in
software.
Note that the concepts in this chapter were gleaned from many resources and are
generally common knowledge. However, when I was searching for resources to read
for an introduction to the concepts of graphs, including mathematical proofs (none of
which will come up in this book, so no worries!) of such concepts, one was Introduction
to Graph Theory by Richard J. Trudeau from Dover Publications in 1993. It is far deeper
than this chapter and definitely more than you need to learn to code with SQL Server’s
graph database extensions, and mathematical proofs have always been my Kryptonite!
However, I highly recommend this as a place to ascend to the next level beyond what I
will show you.
This chapter will be a quick, high-level overview of the many topics you will find
in this book and many other sources, plus ideas you may wish to use in the graph table
objects I will cover once you start building objects. The book itself will be mostly focused
on very practical applications and how to write certain types of code, but I found that
knowing some of the graph fundamentals really helped me to envision what I was
attempting to accomplish.

2
Chapter 1 Introduction to Graphs

Graph Fundamentals
While most readers will have the explicit goal of applying a graph to a specific problem
they are trying to solve, it is best to start at the beginning and discuss what a graph is
in the pure sense. (If you don’t care, you can skip to Chapter 3 where the T-SQL code
starts!) Going through the fundamentals will help you free your mind from preconceived
notions. Perhaps, more importantly, you can ignore the limitations of the tools and
specific problem sets you may wish to solve and just think about the whole problem set.
In math, there are the concepts of “pure” math and “applied” math. Pure math is
math for math’s sake. It is there to ask, “what can be done with a construct?” without
asking the limiting questions of, “is this helpful code to solve my problem or, even more
importantly, any problem?” Applied math is more or less the sort of thing we typical
computer architects/programmers are typically interested in since we have a problem
and want to find something to help us with that problem (and immediately so). Most
of the time, solutions are only interesting if they can solve the specific problems we
currently know about and have a manager riding on our back.
However, I always prefer to start just trying to see what I can accomplish with a new
tool before getting my hands dirty (metaphorically, of course; as a programmer, my
hands never get dirty at work unless the day’s snack includes chocolate).
Some of the things I will discuss will then be familiar in understanding what
we might do when looking for patterns in the data and eventually translating into
algorithms. Some designs may not be realistically possible due to current computing
limitations in SQL Server (or any graph database platform) or reasonable hardware
limitations at the time of writing in 2023. Having written my first book in 2000, it
astounds me how different this statement feels to me 23 years later sitting here with a
computer on my desk that has more power that medium to large corporations were
running on when I first wrote T-SQL.
In one of my sample databases you can download, I have millions of rows in just one
table, and I can process reasonable queries on my desktop computer in mere minutes.
Limitations always exist, but there are fewer and fewer limitations for every generation of
computer architecture that passes.
My goal here in this first chapter (and to a large extent, the second chapter) is to
simply introduce some of the terms and concepts around graphs to help you understand
how graphs are shaped and, eventually, processed.

3
Chapter 1 Introduction to Graphs

Definition
Graphs are based on two primary data structures: nodes (or in math terms, vertices),
and edges. Nodes represent a thing that one might care about, much like a table in a
relational database. Edges establish a connection between exactly one or two nodes
(when the node count is one, it means the node is related to itself.) A graph is defined as
being a set of nodes and a set of edges.
In a graph database, a node is like most any table with attributes describing what
the node represents. The edge is analogous to a many-to-many relationship table with
at least attributes to represent the node that the relationship is from and which it is
to. You will see that two major things set these new concepts apart from a relational
implementation.
First, the from and the to in an edge generally can be from any node object. Whereas
a relational table column used to reference another table value communicates that it is
a foreign key from Table X and nothing else, the from and to attributes of an edge can be
from multiple different node types if you so desire.

Tip I am fully aware that you can put any value into a column, so every foreign
key value in a column needn’t come from the same table. But that is not how it
should be done because data where a column can mean multiple things is very
confusing in a relational table. Graph structures work very similar to how relational
tables work. Still, they have special properties that allow two rows to contain data
from multiple sources without confusing the user/engine.

Second, to make use of these flexible structures, a special set of operations is enabled in
a graph engine, allowing easier access to the meaning of the relationships than we can get
using SQL. More detail on these operations and the basic algorithms are in Chapters 2 and 3.
For the first example, consider the simple graph represented in Figure 1-1—two
nodes connected by a single edge. If the type of node is important, it will be indicated
using different shapes.

4
Chapter 1 Introduction to Graphs

Figure 1-1. Simple graph

When diagraming a graph, edges may also have a property of direction. The direction
indicates that the relationship is not reciprocal. For example, consider Figure 1-2.

Figure 1-2. Simple directed graph

In this graph, N1 connects to N2, but N2 is not connected to N1. This is analogous to
a social media relationship such as when I follow Paul McCartney, but Paul McCartney
doesn’t follow me! It will often be very important to understand the value of the direction
because of the unbalanced nature of some relationships. Mr. McCartney doesn’t all of
the sudden wish to get any communication about where I am speaking at a conference,
but I wish to be informed of his concerts and new music being released.
In SQL Graph, and other graph products, edges are almost always directed. This will
become important later but will only complicate our discussion of graphs concepts in
general, so to start with, let’s ignore the directedness of the edges.
In my first example graph in Figure 1-1, I have two nodes and a single edge. This is a
very simple graph, but it is not the simplest graph. The simplest graph is a graph with 0
edges and 0 nodes, otherwise referred to as the NULL graph. You can also have a graph
with a single node and no edges, and a single node with a single edge, and so on. (You
can’t have an edge without a node.)
Just like modeling a relational database, there is an inherent danger in thinking of a
graph as a drawing and not a complex data structure. Consider a graph with the nodes
and edges seen in Figure 1-3.

5
Chapter 1 Introduction to Graphs

Figure 1-3. Graph with four edges and four nodes

This graph could be expressed as sets of nodes and edges in the following manner:
Nodes: {N1,N2,N3,N4}; Edges: {E1:{N1,N2}; E2:{N2,N4}; E3:{N3,N4}; E4:{N1,N3}}
By definition, all nodes and edges must be distinct, much like a table requires
distinct rows. And just like a table, the order of the items in the sets has no importance.
The following graph is the same as diagrammed and as defined prior to this paragraph:
Nodes: {N2,N3,N1,N4}; Edges: {E2:{N2,N4}; E1:{N1,N2}; E4:{N1,N3}; E3:{N3,N4}}
When drawing a graph as an image, there is a very similar consideration. Every
programmer with any skill has frequented a white board to draw a diagram of a
structure. If you were to draw a shape of a circle, a triangle, and a square on the white
board, instinctively you would believe them to be different things. Even if you drew a
rectangle, square, and a rhombus (all shapes with four sides) you would not think they
were the same.
But, in graph terms (just like when diagramming tables), the two graphs in Figure 1-4
are the same as each other and the graph in Figure 1-3, in which they are considered
“equal.”

6
Chapter 1 Introduction to Graphs

Figure 1-4. Two identical graph structures

The two graph diagrams in Figure 1-4 are copies of the same graph. The next concept
is related, in that we will look at graphs with the same shape but different nodes. When
a graph has the same node and edge shape (meaning the same nodes and edges, not
diagram shape,) the graphs are referred to as being isomorphic graphs. For example,
the two graphs in Figure 1-5 are not equal but they are isomorphic because they have the
same shape in their set of data (regardless of whether you draw them as a square or not).

Figure 1-5. Two isomorphic graph structures

This concept of isomorphism will be, if not actually referred to using the exact term,
interesting in your usage of graphs on occasion. Consider the set of nodes in Figure 1-6.

7
Another random document with
no related content on Scribd:
8. A bisexual free form gives origin to a bisexual parasitic form living
in an animal: example, Leptodera appendiculata in Snails.

9. The eggs develop in the earth, and give rise to embryos which are
transferred whilst still in the egg-cell to the body of an animal. The
embryos hatch out and form bisexual parasites: examples, Oxyuris,
Trichocephalus.

10. The larvae live in insects, the sexual worms in water or in the
earth: example, Mermis.

11. The larva lives encapsuled and is passively transferred to a


second animal: examples, Ollulanus, from Mouse to Cat; Cucullanus
elegans, from Cyclops to Perch; Spiroptera obtusa, from Meal-worm
to Mouse.

12. The sexual form lives for a short time in the intestine of a
Vertebrate, and produces larvae which bore through the intestinal
wall and become encapsuled in the tissues: example, Trichina
spiralis.

13. The sexual animal lives in the trachea of birds; the ova
containing embryos are coughed up and are taken into other birds
with food. They quit the egg-shell and wander into the air-sacs, and
finally into the trachea: example, Syngamus.

14. There are two larval forms; the first lives in water, the second in
the lungs of Amphibia, whence they wander into the intestine and
become sexually mature: example, Nematoxys longicauda in Triton
alpestris.

Parasitism.
1. Effect of Parasitism on the Parasite.—The usual effect of
parasitism on the parasitic organism is that the various organs
necessary for a free life tend to degenerate, whilst there is a
multiplication and development of organs of adhesion, by means of
which the parasite maintains its hold on its host. There is further an
immense increase in the powers of reproduction, which may take the
form of an increase in the number of fertilised eggs produced, or the
parasite may at some time of its life reproduce asexually, by
budding, or fission, or parthenogetically.

Of the various classes of animals which are more or less parasitic,


the Nematodes show less difference between the free-living and
parasitic members of the group than obtains in any other class. With
few exceptions, such as Sphaerularia, Allantonema, and one or two
others, the parasitic forms have undergone but little degeneration. It
is true that they have no eyes such as the free forms often possess,
but in other respects, such as in the nervous, muscular, and
digestive systems, they do not show any marked retrogression;
further, the mouth-armature is developed in many free forms, and is
not confined to the parasites.

The group has developed no methods of asexual reproduction by


budding or fission, such as are found in Platyhelminthes; and the
cases of an alternation of generations in which a sexual form
alternates with a parthenogenetic form, are rare, e.g. Rhabdonema
nigrovenosum; and it seems possible that even when
parthenogenesis has been described, further observation may show
that the parthenogenetic stage is really a protandrous
hermaphrodite, in which case the alternation of generations in
Nematodes, i.e. the hermaphrodite alternating with the dioecious
form, is a case of heterogamy or the alternation of two sexual
generations.

On the other hand, parasitic Nematodes produce enormous numbers


of eggs. Van Beneden states that 60,000,000 have been computed
in a single Nematode, and this multiplication of ova is absolutely
necessary, for the chance of the embryo reaching the right host, in
which alone it can develop, is always a small one.

It is a common thing to find that parasites are either hermaphrodite


or that the male is degenerate, as is the case with many of the
parasitic Crustacea, but with one or two exceptions the Nematoda
are bisexual, and although, as a rule, the males are smaller than the
females, they show no other trace of degeneracy.

In spite of the fact that the class as a whole shows but few special
modifications consequent on a parasitic mode of life, it is clear that
the Nematoda are peculiarly adapted for such a mode of life. Their
elongated thread-like bodies afford little resistance to the passage of
the food, which, as it passes through the intestine of the host, might
tend to carry the parasites out of the body. At the same time their
shape enables them to pierce and wriggle through the various
tissues without making any very serious lesions such as might prove
fatal to their host. Their extraordinary power of resisting desiccation
both in the egg and in the adult state vastly increases their chances
of ultimately hitting on the right host. They are capable of living in a
state of suspended animation for months, and even years when
dried (vide p. 136), and of resuming their activity on being
moistened.

The great faculty this group shows for living parasitically is evinced
by the extraordinary variety of life-history presented by the different
species. There is scarcely a stage which may not be parasitic; the
eggs, the larvae, the adults are all in some cases free, in others
parasitic, and in many cases first the one and then the other.

2. Occurrence and Effect of the Parasite on the Host.—Von


Linstow states that the only law that can be derived inductively from
the study of the life-history of Nematodes is that those that live in
animals never pass through all their stages of development in the
same organ; consequently, in considering the distribution of the
parasites within the body of their host we have a double habitat to
consider. Many forms, such as Trichina spiralis, wander from the
intestine to the muscles; others, such as Filaria medinensis, from the
alimentary canal to the lymphatics or blood vessels or subcutaneous
tissues. Others pass from the body-cavity to the intestine, as the
Mermithidae, which infest Insects, or from the stem and leaves of a
plant to its flower, as in the case of Tylenchus tritici.

With regard to their occurrence in the different classes of the animal


kingdom, they have been most frequently observed in Vertebrates
and in Insects. They are comparatively rare in the other large
divisions. Many genera are confined to certain hosts: thus Ascaris,
Filaria, Trichosoma occur only in Vertebrates; Spiroptera (with one
exception) in Mammals and Birds; Cucullanus in Fishes and
Amphibia; Strongylus and Physaloptera in Mammals, Birds, and
Reptiles; Dochmius, Pseudalius, Trichocephalus in Mammals;
Dispharagus, Hystrichis, Syngamus in Birds; Nematoxys, Hedruris in
Amphibia and Reptiles; Ichthyonema in Fishes; and Isacis and
Mermis in Insects.

Twenty-two species have been described as parasitic in man, of


which perhaps the most dangerous are Filaria medinensis, the three
varieties of F. sanguinis hominis; Dochmius (Ancylostomum)
duodenalis, and Trichina spiralis. The Ascaridae, as Ascaris
lumbricoides and Oxyuris vermicularis, though painful, seldom cause
death.

The enormous number of parasites harboured by one host is shown


by the fact mentioned in Leuckart's Parasites of Man, that
Nathusius[203] took from a single black stork 24 specimens of Filaria
labiata from the lungs, 16 Syngamus trachealis from the trachea,
more than 100 Spiroptera alata from the coats of the stomach,
besides several hundred Trematodes belonging to several different
species (see p. 63). Even this has been surpassed in the case of a
young horse, in whose body Krause found 500 Ascaris
megalocephala, 190 Oxyuris curvula, several millions of Strongylus
tetracanthus, 214 Sclerostomum armatum, 287 Filaria papillosa, 69
Taenia perfoliata, and 6 Cysticercus forms.

It is impossible here to enter into a full description of the destruction


caused to domesticated animals and crops by the presence of these
parasites; full details will be found in books dealing especially with
this question, such as Neumann's Parasites and Parasitic Diseases
of Domesticated Animals. A couple of cases will show how important
this matter is to the farmer. Crisp estimates that Syngamus trachealis
causes the death of half a million pullets in England every year, and
Mégnin states that in a single pheasantry 1200 victims died daily;
again, the loss of one-third the crop of beetroot is by no means
uncommon when it is infested with Heterodera schachtii. These
show the practical importance of what at first sight seem quite
insignificant animals, and the necessity for the minutest observation,
for only when we are fully acquainted with all the details of the life-
history of a parasite are we in a position to successfully combat it.

Sub-Order II. Nematomorpha.

Until the last few years it has been customary to regard the
Gordiidae as a family of Nematodes. Although in external
appearance and life-history they closely resemble the members of
this group, yet recent research has shown so many important
morphological differences between them and the Nematoda, that
most zoologists are now agreed in placing them in a different sub-
Order, the Nematomorpha, a name first suggested by Vejdovsky.[204]

Fig. 82.—A water plant around which a female Gordius is twining and
laying eggs. a, a, Clump and string of eggs. (From von Linstow.
[205])

The Gordiidae comprise but two genera, Gordius and Nectonema.


The latter has but one species, N. agile Verr., and is marine; the
former, on the other hand, is exclusively fresh-water, and contains a
very large number of species. Gordian worms are frequently to be
found in ditches, ponds, or large puddles, moving with an undulating
motion through the water, or twining and writhing round water-plants;
they are scarcer in running water. In shape they are like a piece of
thin whip-cord, slightly tapering at each end; the male, however, is
easily distinguished from the female by its forked tail (Fig. 89). Not
unfrequently a considerable number are found inextricably tangled
together into a knot, and the name of the genus refers to this fact.
Where numbers have suddenly appeared in water hitherto free from
them, legends have sprung up which attribute their presence to a
rain of worms; in reality they have come out of the bodies of Insects
in which they are parasitic for the greater part of their life.

The genus Gordius passes through three distinct stages, of which


the first two are larval and parasitic; the third is sexually mature and
lives in water. The second larval stage closely resembles the adult,
but the reproductive organs are not developed. The following
account of the structure of this larval form and of the adult is in the
main taken from von Linstow.[206]

The whole body is covered with a well-developed two-layered


cuticle, which in the adult is marked out into areas, and bears
numerous minute sensory bristles, which are especially developed in
the neighbourhood of the cloaca of the male. Beneath this is a
hypodermis which differs markedly from the sub-cuticle of
Nematodes, inasmuch as it consists of a single layer of polygonal
nucleated cells. Within this lies a single layer of longitudinal muscle-
cells, which differ from the corresponding layer of Nematodes in
having that part of their medulla which is not surrounded by the
contractile portion directed outwards towards the hypodermis, and
not inwards towards the body-cavity.
Fig. 83.—Transverse section through a young male Gordius tolosanus
Duj. (From von Linstow.) Highly magnified. a, Cuticle; b,
hypodermis; c, muscular layer; d, parenchyma; e, alimentary
canal; f, nervous system; g, cells of the testis.

The body is in the younger stages practically solid, the interior being
filled with clearly defined polygonal cells which are arranged in
definite rows; in later life certain splits arise in this tissue which
subserve various functions; between these splits strands of tissue
are left which form mesenteries, and some of the cells remain lining
the muscular layer (Fig. 86). These cells have been described by
Vejdovsky as a definite somatic, peritoneal epithelium, but this was
not found by von Linstow. Besides forming the mesenteries, and
acting as packing between the various organs of the body, these
cells also form the ova and the spermatozoa.

The splits which have appeared when the animal has reached the
second larval stage, are two dorsal and a ventral; the latter contains
the alimentary canal, and may be termed the body-cavity, the former
will develop the generative organs. The mouth is occluded in the
older larvae, and in the adults there is a distinct but solid
oesophagus which passes into a tubular intestine. The intestine
consists of a single layer of cells surrounding a lumen; it runs straight
to the hinder end of the body, where it opens in both sexes with the
ducts of the reproductive organs.

The nervous system consists of a well-defined circumoesophageal


ring with two dorsal swellings, and, arising from this, a median
ventral cord which runs the whole length of the body. The cord
consists of three longitudinal strands with ganglionic cells below
them; the latter, though they lie within the muscle layer, maintain a
connexion with the hypodermis. Behind, the nerve-cord splits in the
male, one half passing into each caudal fork. In the adult a pair of
black eyes can be detected on the head; the only other sense
organs are the tactile bristles mentioned above. Excretory organs
are unknown.

Fig. 84.—Section through a young female Gordius tolosanus. (From


von Linstow.) a, Cuticle; b, hypodermis; c, muscular layer; d,
parenchyma; e, alimentary canal; f, nervous system; g, egg-sac;
h, ovary.

The generative organs only attain maturity in the adult, which is, in
fact, exclusively devoted to reproduction. No trace of testes is found
in the larva, though the two dorsal splits from the walls of which the
spermatozoa will arise are present. They are lined by a definite
epithelium (Fig. 83), and this serves at once to distinguish them from
the body-cavity. Posteriorly the splits narrow and become the two
vasa deferentia which open one on each side into the cloaca. The
cells lining the lumen give rise to secondary cells, and these become
spermatozoa, the process extending from behind forwards. The
external organs—bursa, etc.—described by Vejdovsky were not
found by von Linstow.

Fig. 85.—Section through a mature female Gordius tolosanus. (From


von Linstow.) Lettering as in Fig. 84; g, egg-sac; h, ovary.
Fig. 86.—Section through a female Gordius tolosanus when the
deposition of ova is almost complete. a, b, c, d, e, and f, as in Fig.
84; g, egg-sac; h, ovary almost empty; i, dorsal canal containing
eggs; j, receptaculum seminis.

In the female larva two similar splits are present; these form the egg-
sacs. Posteriorly they end in two short oviducts which open into a
uterus, in which fertilisation takes place, and in which the secretion
arises which cements the eggs together. In the adult the ovaries and
a receptaculum seminis are found, in addition to the organs present
in the larva. The ovaries are formed from modifications of the
packing tissue; they begin close behind the head, and soon attain
such dimensions as to compress the egg-sacs and body-cavity to
small slits. After a time the wall between the ovary and the egg-sacs
becomes absorbed, and the eggs grow into the latter. In the old
females, where the egg sacs are empty, there is a considerable
space round the exhausted ovary, into which eggs continue to fall
off; there is also a median dorsal canal which contains a few eggs.
By this time the wall between the ovary and the egg-sac has again
appeared.

One of the most interesting points about the female is that, according
to Vejdovsky, the ovary is segmented, the cells which form the ova
being heaped up in segmentally-arranged masses. This observation,
if correct, is almost the only instance of segmentation recorded in the
group Nemathelminthes.
Fig. 87.—Nectonema agile Verrill. A, The adult. Magnified. (After
Fewkes.) B, Longitudinal section through the head. × about 20.
(From Bürger.) a, Mouth; b, circumoesophageal commissure
(dorsal); c, cell of salivary gland; d, septum cutting off head from
rest of body; e, testis; f, ventral cord; g, oesophageal cells; h,
lumen of oesophagus; i, cerebral ganglion (ventral).

The only other genus which is associated with Gordius in the group
Nematomorpha is Nectonema, of which there is as yet but one
species known, Nectonema agile Verr.[207] Our knowledge of the
anatomy of this worm is due mainly to Bürger[208] and Ward.[209]
Nectonema is a marine worm found swimming near the surface of
the sea with rapid undulatory motion. The males are from 50 to 200
mm. long, the females from 30 to 60 mm. The body is faintly ringed,
and bears two rows of fine bristles on each side. Owing to a curious
torsion of the body through a right angle, the lateral bristles of the
anterior third seem to be placed in the ventral and dorsal middle line.
They are very easily broken off. The body is divided into a small
anterior and a large posterior chamber by a transverse septum
placed a little way behind the head. The anterior chamber contains
the brain and is lined by a definite epithelium, the posterior is not.
The layers of the skin correspond with those of Nematodes or of
Gordius, but the hypodermal cells show no cell outlines; still they are
not so modified as in the former group. The hypodermis is thickened
in the median dorsal and ventral line, and the single nerve-cord lies
in the latter.

The alimentary canal is degenerate, as in Gordius. A mouth exists,


but it is minute, and opens into a very fine tube lined with chitin,
which pierces through the substance of a single elongated cell. This
minute oesophagus, with its coextensive cell, reaches back to the
transverse partition, but behind this a few other cells become
associated with it, and ultimately the lumen of the alimentary canal is
surrounded by four cells; but the number diminishes behind, and
soon only two cells surround the tube at any one level, and the
intestine dwindles away some little distance in front of the tail. There
is no sign of an anus. A circumoesophageal nerve-ring exists, of
which the ventral part is by far the larger (Fig. 87); it gives off a
ventral nerve-cord, which swells posteriorly in the male into a large
anal ganglion, far bigger than the brain, and larger in the male than
in the female.

The testes consist of a dorsally placed sac, continuous behind with a


vas deferens; this opens at the posterior end, which is pointed and
slightly curved ventrally. The ovary is unknown; but females have
been found with their body-cavity crammed with ova; these escape,
like the spermatozoa, from a genital pore at the posterior end of the
body.

Classification.—The separation of the Nematomorpha from the


Nematoda depends mainly on the character of the nervous system,
the absence of the lateral lines and of the dorsal line, the character
of the contents of the body-cavity, and the character of the
reproductive organs. In Gordiidae the latter are always placed dorsal
to the intestine, and ovaries and testes open alike at the hinder end
of the body. The importance of the differences in the organs just
enumerated has been considered sufficient to justify the removal of
the Gordiidae from the Nematoda, and the establishment of the
special sub-Order Nematomorpha for their reception; and although
Nectonema has a dorsal line, and is in some other respects
intermediate between the two groups, there can be little doubt that it
is more closely allied to Gordius than to any member of the
Nematoda, and it must therefore be placed with it in the
Nematomorpha.
On the other hand, it ought to be mentioned that Camerano[210]
found that the chief details of the fertilisation and development of the
egg in Gordius closely conform with what is known of the same
processes in Nematodes, and he is of opinion that these
resemblances are sufficiently important to justify the retention of the
group among the Nematoda.

Life-History.—The life-history of Gordius comprises four stages—


the early development of the egg, the first larval form, the second
larval form, and the sexually mature form. Both larval forms are
parasitic, and during their life they are actively engaged in feeding;
the free form, on the other hand, takes in no nourishment, and is
exclusively engaged in reproduction.

Fig. 88.—Abdomen of Pterostichus niger with the terga removed to


expose the Gordius larva within. Slightly magnified. (From von
Linstow.)

Von Linstow[211] gives the following account of the life-history of G.


tolosanus, a form which has been more fully worked out than any
other. In the month of April numerous specimens of the beetle
Pterostichus niger were found floating on the surface of the ditches
and small ponds in the fields surrounding Göttingen. Some were
found dead or dying; others appeared quite healthy, and these were
swimming actively, endeavouring to reach land. Within the abdomen
of these beetles, in about 20 per cent of those collected, the second
larval form of the G. tolosanus was found. The longest larvae were
122 mm. in length, and very soft, partly snow-white and partly brown
in colour; traces of the boring apparatus of the first larval form were
still to be seen, but in other respects the larva only differed from the
free form in the immaturity of its sexual organs. Besides the parasite
hardly anything was to be found in the abdomen of the beetle, the
larva having eaten up all trace of the fat body and the generative
organs of its host. The larvae bored their way out of the body of the
beetle and became adult animals.

It is rather difficult to say what brings these essentially terrestrial


beetles to the water, but von Linstow suggests that, as they live
partly on snails, and at this time of year there are not many land-
snails about, they may be in search of water-snails such as Limnaea.
They may also be sometimes blown into the water by wind storms,
but, whatever the cause is, their presence in water is essential for
the continuance of the life of their parasites.

Once free in the water the Gordius is soon sexually mature; the
fertilisation takes place in April, and then the female may be seen
twisting and writhing round the stems of water-plants and laying the
long bead-like strands of eggs (Fig. 82). The first deposition
observed by von Linstow took place on 14th April, the last on 2nd
August, and the period of egg-laying for each female extended over
four weeks. At first the eggs are snow-white, but within twenty-four
hours they turn brown in colour.

The development of the first larva within the egg takes about a
month. When it emerges from the egg-shell it is minute, .065 mm.
long, ringed anteriorly, and provided with a protrusible and retractile
boring apparatus consisting of three chitinous rods; round the base
of this piercing proboscis is a double crown of papillae, each bearing
a spine (Fig. 90).

Fig. 89.—The tail ends of a female Gordius (a) and a male (b) in
copula. × 1.5. (From G. Meissner.[212])
This first larval form breaks through the egg-shell and sinks to the
bottom of the water, where it moves about sluggishly and awaits the
arrival of the right host in which to take up its abode. This host is the
larva of the Alder-fly, Sialis lutaria Lin. (vide vol. v. p. 444), and into
this it bores and comes to rest in the muscles or the fat body. It does
not form distinct capsules. It remains in this larva during the following
winter, and in the spring passes over into the imago Sialis. The
complete insect frequents the small plants growing along the water's
edge, and falls an easy prey to the predaceous beetle Pt. niger. The
larva is eaten, and undergoing a change becomes the second larval
form mentioned above. It remains in the body of the beetle during
the second winter, and finally returns to the water as the adult some
eighteen or twenty months after it has been hatched from the egg.

Fig. 90.—Embryo or first larval form of Gordius tolosanus taken from


the egg. Highly magnified. a and b, The bristle-bearing papillae on
the head; c, the boring apparatus. (From von Linstow.)

From the above account of the life-history of Gordius it will be seen


that the chances of an egg reaching maturity are comparatively
small, and to compensate for this a very large number of eggs are
laid. In addition to the risk of the larvae not finding the right host at
the right time, and of the first host not being eaten by the second,
and the second not being drowned, there is the danger that the
ditches and ponds in which the adults live may dry up, and, in fact,
great numbers of worms perish by this taking place.

The sex of the adults may be told from their colour, the males being
of a blackish brown, the females of a light clay brown; the former
average 120 mm. in length, the latter 170 mm. The males are also
more numerous, the proportion being seven to three. Camerano[213]
has drawn attention to the fact that there is a certain polymorphism
in size, form, and colour which is especially common amongst the
males; dwarf forms with mature reproductive organs exist, and he is
of opinion that these differences depend both on the size of the
second host and on the duration of the parasitic life.

In addition to the larva of Sialis lutaria, the first larval stage has also
been found in the larva of Ephemera, Tanypus, Corethra, and
Chironomus; the second in Carabus hortensis Fabr., Procerus
(Carabus) coriaceus Linn., Calathus fuscipes Goeze, Molops elatus
Fabr., several species of Pterostichus, and a number of other
beetles. It is probable that its normal hosts are S. lutaria and Pt.
niger, but it is clear that it often comes to rest in other insects. The
view that the Gordiidae have no special hosts, but may either pass
the whole of their life-history within one and the same animal, or, on
the other hand, may inhabit animals belonging to very different
groups, is held by Villot, who has paid great attention to the subject.
He finds the first larval form encysted in the walls of the alimentary
canal in fishes, such as Leuciscus phoxinus, the minnow, Cobitis
barbatula, the loach, and Petromyzon planeri, the lamprey; in the
larvae of Diptera, Ephemera, and beetles, in Planorbis (a water
snail), in Enchytraeus (an Oligochaet); the second larval form in all
kinds of insects, spiders, Crustacea, fish, frogs, birds (Otis), and in
man, and these various habitats lead him to the conclusion that "Les
Gordiens n'ont pas d'hôtes spéciaux." On the other hand, as von
Linstow points out, it is contrary to our knowledge of parasites that a
single species should develop equally well in the body of warm and
cold-blooded Vertebrates and of Insects, and the explanation of the
presence of the larvae in these various forms may either be that they
belong to different species of Gordius or, more probably, that they
are accidentally present, having passed into their hosts with drinking
water.
Fig. 91.—Tarsal joint of an Ephemerid larva into which two Gordius
larvae (a, a) have penetrated. Magnified. (From G. Meissner.)

The number of species of Gordius is large; over 100 are enumerated


in the Compendium der Helminthologie,[214] the great majority of
which inhabit insects.

The life-history of Nectonema is practically unknown; the adults have


been found swimming near the surface of the sea at two places only:
Newport, R.I., and Wood's Holl, Mass., on the south coast of New
England. It has been fished close to the shore, from the end of June
to the beginning of October, when the tide is going out at evening
and there is no moon. This seems to indicate that it avoids the light.
When first caught the worms move actively about, coiling themselves
into figures of eight and then uncoiling; at the same time there is a
rhythmical movement caused by waves of muscular contraction
passing down each side of the body alternately; by this kind of
motion they make rapid and definite progress through the water.

It seems probable that the adult Nectonema is preceded by one or


more larval stages, and what appears to be a young form has been
obtained from the thoracic cavity of a prawn, Palaemonetes,[215]
which has thus some claim to be regarded as the host of this
species, but nothing is known about its early life-history.

Sub-Order III. Acanthocephala.

The Acanthocephala, which form the third class of the


Nemathelminthes, consists of but few genera; there are, however,
numerous species of very different size, varying from 10 to 65 cm.
long in the female Gigantorhynchus (Echinorhynchus) gigas, to quite
minute forms a few millimetres in length. The adult stage occurs in
the alimentary canal of Vertebrates, as a rule in those which live in,
or frequent water; the larvae are found in the bodies of certain
Invertebrates, very frequently small Crustacea.

Fig. 92.—Two specimens of Echinorhynchus proteus Westrumb., with


their anterior ends embedded in the wall of the intestine of a Pike.
Magnified with a lens. (From Hamann.)

Anatomy.—The body of the mature forms can usually be divided


into three sections—the proboscis, the neck, and the trunk, but the
middle region is not always discernible. The proboscis is armed with
rings of hooks (Fig. 93) arranged in longitudinal rows; they are
usually of two kinds, but in E. proteus of three. They have a certain
specific value, but not much stress can be laid on the number of
rings, e.g. in E. angustatus the number varies from eight to twenty-
four. The recurved hooks serve to fasten the parasite very firmly to
the tissues of the host. The proboscis is hollow and retractile; it can
be withdrawn into the body by means of muscles attached internally
to its tip. It does not, however, pass straight into the body-cavity, but
is retracted into a special cavity—the proboscis sheath—with a
double muscular wall. The proboscis sheath may perhaps be looked
upon as a septum, such as is found in some of the Nematomorpha,
dividing the body-cavity into two parts. It is inserted into the body-
wall at the junction of the neck and trunk or of the proboscis and
trunk. In addition to the muscles which withdraw the proboscis into
its sheath, there are two retractors running from the outside of the
sheath to the body-wall; these serve to retract the whole sheath and
its contents into the body-cavity of the trunk.
The structure of the skin is essentially like that of Nematodes, but the
details are much more complicated. The whole body is covered by a
thin cuticle secreted by the epidermis, which, as in the other groups,
breaks down and forms a syncytium called the sub-cuticle. The
minute fibrils which penetrate this layer are much more definitely
arranged than in Nematodes; the largest of them run from without
inwards, others run concentrically round the body. Large oval or
spherical nuclei are scattered in the sub-cuticle, which is further
honeycombed by a number of lacunae or spaces which are
described below.

Fig. 93.—A, Five specimens of Echinorhynchus acus Rud. attached to


a piece of intestinal wall, × 4; B, the proboscis of one still more
highly magnified.

Within the sub-cuticular layer is found a sheath of circularly-arranged


muscle-fibres, and within this again a sheath of longitudinal muscles
which do not extend into the proboscis; this inner layer lines the
body-cavity, there being no epithelium within it. In their minute
structure the muscle-cells resemble those of Nematodes.

The canals in the sub-cuticle form a very curious system of


anastomosing spaces, in which a clear fluid containing fat globules
circulates. The extent to which the system is developed varies in
different species, but in all there is a pair of longitudinal canals which
are situated laterally, and which give off the subsidiary channels in
their course. The above description applies to the lacunar spaces in
the skin of the trunk; those of the proboscis are quite distinct, and
there is no communication between the two sets of spaces; in fact,
the sub-cuticle in which the lacunae are formed is not continuous
across the line of junction of the proboscis and the neck, or, when
the latter is absent, of the proboscis and the trunk, but it is
interrupted by the ingrowth of a thin ring of cuticle which reaches
down to the muscular layers (Fig. 94).

Fig. 94.—A longitudinal section through the anterior end of


Echinorhynchus haeruca Rud. (From Hamann.) a, The proboscis
not fully expanded; b, proboscis-sheath; c, retractor muscles of
the proboscis; d, cerebral ganglion; e, retinaculum enclosing a
nerve; f, one of the retractors of the sheath; g, a lemniscus; h, one
of the spaces in the sub-cuticular tissue; i, longitudinal muscular
layer; j, circular muscular layer; k, line of division between the
sub-cuticular tissue of the trunk and that of the proboscis with the
lemnisci.

All the spaces in the skin of the proboscis open ultimately into a
circular canal situated round its base; on each side the canal opens
into a sac-like structure which extends through the body-cavity
towards the posterior end of the animal. These two lateral diverticula
are termed the lemnisci. They have always attracted considerable
attention from the workers at the group, and numerous functions
have from time to time been attributed to them. They are more or
less hollow, and their walls consist of sub-cuticular tissue surrounded
with a scanty muscular coat; they contain the same fluid as the
lacunae of the skin of the proboscis, with which they are placed in
communication by means of the circular canal; and it seems most
probable that, as Hamann[216] suggests, they act as reservoirs into
which the lacunar fluid retires when the proboscis is retracted, and
which, by means of the contractions of their muscular coat, force the
fluid into the lacunae when the proboscis is everted, and thus aid in
its protrusion.

The parasitic habits of Echinorhynchus have had a deeper influence


on the structure of the body than is the case with the Nematoda. All
traces of an alimentary canal have disappeared, and the animals live
entirely by the imbibition through the skin of the already elaborated
fluids of their hosts. The power of absorbing fluids is shown by the
fact that they swell up and become tense when placed in fresh water.

Until recently no definite excretory organs had been recognised, and


the function of excreting the nitrogenous matter was by some
assigned to the lemnisci. In 1893 Kaiser[217] described in G. gigas
two organs which he called nephridia, placed dorsally to the ducts of
the male and female reproductive organs. Each nephridium, which
somewhat resembles a cauliflower, consists of a stalk or duct,
opening at one end into the reproductive ducts, and at the other
branching and breaking up into a number of secondary and tertiary
twigs. The end of each twig is closed by a membrane pierced with a
number of most minute pores, by means of which it communicates
with the body-cavity; on the inner side the membrane bears a
number of long cilia, which keep up an active flickering. The
presence of these cilia is interesting, as elsewhere they are unknown
throughout the Nemathelminthes.

Fig. 95.—A, A longitudinal section through the terminal twigs of the


nephridium of Gigantorhynchus gigas. (From J. E. Kaiser.) Highly
magnified. a, Nucleus. B, A terminal twig more highly magnified;
b, the porous membrane.

You might also like