This is documentation for an old release of SciPy (version 1.8.1). Read this page in the documentation of the latest stable release (version 1.15.1).
scipy.cluster.hierarchy.DisjointSet.merge#
- DisjointSet.merge(x, y)[source]#
Merge the subsets of x and y.
The smaller subset (the child) is merged into the larger subset (the parent). If the subsets are of equal size, the root element which was first inserted into the disjoint set is selected as the parent.
- Parameters
- x, yhashable object
Elements to merge.
- Returns
- mergedbool
True if x and y were in disjoint sets, False otherwise.