Interface UnionFind
-
- All Known Implementing Classes:
WeightedQuickUnionRangeDBIDs
,WeightedQuickUnionStaticDBIDs
public interface UnionFind
Union-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 int
find(DBIDRef p)
Find the component ID of an element.DBIDs
getRoots()
Collect all component root elements.boolean
isConnected(DBIDRef p, DBIDRef q)
Test if two components are connected.int
union(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:
true
if 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
-
-