in reply to How to make buckets of like data

Your "Buckets" are called connected components in graph theory.

Plenty of algorithms available, no need to reinvent the wheel. =)

update

see also older discussion and cpan connected component.

Cheers Rolf

  • Comment on Re: How to make buckets of like data (connected components)