Class PureLinkGraphConnectedComponents.UnionFind
java.lang.Object
org.bigraphs.framework.core.analysis.PureLinkGraphConnectedComponents.UnionFind
- Enclosing class:
PureLinkGraphConnectedComponents
Generic subclass that solves the connectedness problem of a graph.
Vertices are integers.
This implementation is suited for hypergraphs (see
union(Set)).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountRoots(Map<Integer, Integer> parentMap) intfind(int x) intgetCount()getRank()getRootsOfPartitions(Map<Integer, Integer> parentMap) voidThe union method finds the representative (root) of each vertex in the hyperedge, and then merges the sets containing those representatives using the standard Union-Find operations.
-
Constructor Details
-
UnionFind
public UnionFind(int numVertices)
-
-
Method Details
-
find
public int find(int x) -
union
The union method finds the representative (root) of each vertex in the hyperedge, and then merges the sets containing those representatives using the standard Union-Find operations.It takes a Set
of vertices instead of just two vertices. This allows to handle hyperedges that connect multiple vertices. - Parameters:
vertices- the vertices connected to a hyperedge
-
getCount
public int getCount() -
getChildParentMap
-
getRank
-
getRootsOfPartitions
-
countRoots
-