Class SequentialDisjointSetStruct
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.paged.dss.SequentialDisjointSetStruct
-
- All Implemented Interfaces:
DisjointSetStruct
- Direct Known Subclasses:
IncrementalDisjointSetStruct
,NonInrementalDisjointSetStruct
@Deprecated public abstract class SequentialDisjointSetStruct extends java.lang.Object implements DisjointSetStruct
Deprecated.Disjoint-set-struct is a data structure that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets.- See Also:
- Wiki
-
-
Constructor Summary
Constructors Constructor Description SequentialDisjointSetStruct()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract long
find(long nodeId)
Deprecated.Find set Id of element p.long
findAndBalance(long p)
Deprecated.Find set id of element p and balances the tree structure while searching.SequentialDisjointSetStruct
merge(SequentialDisjointSetStruct other)
Deprecated.Merges the given DisjointSetStruct into this one.boolean
sameSet(long p, long q)
Deprecated.Check if p and q belong to the same set.void
union(long p, long q)
Deprecated.Joins the set of p (Sp) with set of q (Sq).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.neo4j.graphalgo.core.utils.paged.dss.DisjointSetStruct
setIdOf, size
-
-
-
-
Method Detail
-
union
public void union(long p, long q)
Deprecated.Description copied from interface:DisjointSetStruct
Joins the set of p (Sp) with set of q (Sq).- Specified by:
union
in interfaceDisjointSetStruct
- Parameters:
p
- an item of Spq
- an item of Sq
-
find
public abstract long find(long nodeId)
Deprecated.Find set Id of element p. Note that implementations of this method might apply path optimizations while looking for the set id.- Parameters:
nodeId
- the element in the set we are looking for- Returns:
- an id of the set it belongs to
-
findAndBalance
public final long findAndBalance(long p)
Deprecated.Find set id of element p and balances the tree structure while searching.This default implementation uses recursive path compression logic.
- Parameters:
p
- the set element- Returns:
- returns the representative member of the set to which p belongs
-
sameSet
public final boolean sameSet(long p, long q)
Deprecated.Description copied from interface:DisjointSetStruct
Check if p and q belong to the same set.- Specified by:
sameSet
in interfaceDisjointSetStruct
- Parameters:
p
- a set itemq
- a set item- Returns:
- true if both items belong to the same set, false otherwise
-
merge
public SequentialDisjointSetStruct merge(SequentialDisjointSetStruct other)
Deprecated.Merges the given DisjointSetStruct into this one.- Parameters:
other
- DisjointSetStruct to merge with- Returns:
- merged DisjointSetStruct
-
-