[Lemon-user] disjoint set union find

Sven Peter sven.peter at stud.uni-heidelberg.de
Wed Oct 31 16:05:25 CET 2012


Hi,

I'm currently using the LEMON library to implement a graph algorithm and need a disjoin set union find data structure. 
It seems that LEMON provides an implementation of this with the UnionFind template, I am however having trouble using it.
Is there any more documentation available? All I could find was the automatically generated source code documentation and the kruskal source code in lemon which uses UnionFind.

What I really need in the end is a way to handle disjoint sets of the nodes of the graph where the representative is a node from that set.
I.e., I need to first create a set for every node in the graph that only contains that single node.
Then I need a way to FIND the representative of any node (figure out the set the node is in; return the representative) and I need to merge two sets.
I am currently using my own (rather stupid) implementation and around 50% of the time is spent in there, which I'd like to optimize.

Could someone point me to the right direction? Some really simple example would be great!


Thanks,


Sven


More information about the Lemon-user mailing list