in reply to Finding subgraphs induced by a set of given vertices.
to give you some explanation of Anonymous Monks code:
you are not checking for subgraphs but subsets.
Perl's way to do this is using hashes, because hash-keys are unique sets of strings.
And hashslices are a very efficient way to determine the cut between to hashes.
see also: Using hashes for set operations...
checking for subgraphs is in general far more complicated
Cheers Rolf
In Section
Seekers of Perl Wisdom