This module exports one function, equivalence_sets(), which takes a list of sets and returns another list of sets whose contents are transitively grouped from the input sets.
Imagine the input sets to be [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] and [ 1, 3, 7 ]. The returned sets would be [ 1, 2, 3, 4, 7 ] and [ 5, 6 ], because [ 1, 2 ] and [ 3, 4 ] are tied together by [ 1, 3, 7 ], but [ 5, 6 ] stands on its own. So you could say the returned sets represent a kind of transitive union. (Real mathematicians may now flame me about the misuse of terminology.)
Each set is an array reference. The return sets are given as an array in list context, or as a reference to that array in scalar context.
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.