I haven't read YAML before, (Data::Dumper is nice and perl-y), so I'm partly guessing at the structure here.
@subgraphs looks like a list of the connected components. Pick one element of the array, and you're looking at one subgraph.
The number of connected components is just 0+@subgraphs.
In reply to Re: Finding connected components in a graph.
by SuicideJunkie
in thread Finding connected components in a graph.
by zing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |