Interface UnionFind
-
- All Known Implementing Classes:
WeightedQuickUnionRangeDBIDs,WeightedQuickUnionStaticDBIDs
public interface UnionFindUnion-find implementations in ELKI, for DBID objects.- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intfind(DBIDRef p)Find the component ID of an element.DBIDsgetRoots()Collect all component root elements.booleanisConnected(DBIDRef p, DBIDRef q)Test if two components are connected.intunion(DBIDRef p, DBIDRef q)Join the components of elements p and q.
-
-
-
Method Detail
-
union
int union(DBIDRef p, DBIDRef q)
Join the components of elements p and q.- Parameters:
p- First elementq- Second element- Returns:
- Component id.
-
isConnected
boolean isConnected(DBIDRef p, DBIDRef q)
Test if two components are connected.- Parameters:
p- First elementq- Second element- Returns:
trueif they are in the same component.
-
getRoots
DBIDs getRoots()
Collect all component root elements.- Returns:
- Root elements
-
find
int find(DBIDRef p)
Find the component ID of an element.- Parameters:
p- Element- Returns:
- Component id
-
-