in reply to More efficient way to get uniq list elements from list of lists

Judging by your variable and sub names, you may want to look at Graph.pm. It may not be most efficient at this particular function, but it will certainly be more efficient over the whole application - more efficient of your development time if nothing else.

Written in terms of Graph.pm, your code looks like this:

use Graph; my @K = ([1,2], [1,3], [2,3], [2,4], [3,4]); my $g = Graph->new; $g->add_edges( map {@$_} @K ); print $g->vertices;

After Compline,
Zaxo

  • Comment on Re: More efficient way to get uniq list elements from list of lists
  • Download Code