Defined in File GenericUnionFind.hpp
Implements the Union Find data structure to maintain disjoint sets efficiently. Uses path compression and union by rank to achieve running time linear in the number of elements times the inverse Ackermann function.
Public Functions
Create a new set representation with not more than max_element elements. Initially every element is in its own set.
max_element – maximum number of elements
Assigns every element to a singleton set. Set id is equal to element id.
Find the representative to element @u
u – element
representative of set containing @u
Merge the two sets contain @u and @v
u – element u
v – element v
Convert the Union Find data structure to a Partition
Partition equivalent to the union find data structure