in reply to breaking up undirected graphs

It sounds like you are looking for an edge whose removal disconnects the graph (edge 4,7 in your case). This is called a "cut-edge" or a "bridge". Fortunately, Graph has a simple way to find all the bridges:
use Graph::Undirected; my $g = Graph::Undirected->new; $g->add_edges( map [ split /,/, $_ ], qw[ 1,2 1,4 2,3 3,4 4,7 7,8 7,10 8,9 9,10 ] ); my @bridges = $g->bridges; print "Found bridge(s):\n"; print " - @$_\n" for @bridges; $g->delete_edge(@$_) for @bridges; print "Resulting components:\n"; print " - @$_\n" for $g->connected_components; __END__ Found bridge(s): - 4 7 Resulting components: - 4 1 2 3 - 8 9 10 7
I'm not sure, but the bridges method may not work if the graph is not connected (the biconnectivity method computes the same information and has such a warning in the documentation).

Update: showed how to remove bridges to obtain list of "clusters" that is induced.

blokhead