Whilst the FGL library does indeed have a function components
that returns the connected components of a graph, it returns each
component as a list of Nodes. This implementation instead
returns each component as a graph, which is much more useful.

Connected components are found by choosing a random node, then
recursively extracting all neighbours of that node until no more
nodes can be removed.

Note that for directed graphs, these are known as the weakly
connected components.

A chain is a path in a graph where for each interior node, there is
exactly one predecessor and one successor node, i.e. that part of
the graph forms a "straight line". Furthermore, the initial node
should have only one successor, and the final node should have only
one predecessor. Chains are found by recursively finding the next
successor in the chain, until either a leaf node is reached or no
more nodes match the criteria.