SignedUnionFind
org.appliedtopology.tda4j.SignedUnionFind
Union-find over 0 until size in which every element carries an orientation, a unit of the field C, relative to the root of its component. It is the bookkeeping behind the representatives of the dual union-find engines (FastCubicalHomologyEngine, FastAlphaHomologyEngine): an element is a top cell, a component a region of top cells, and the region's coherently oriented sum is sum of orientation(c) * c over its members.
findcompresses paths and composes orientations along them, soorientation(i)is amortised near-constant.union(young, old, flip)hangs rootyoungunder rootold, multiplying the whole young component's orientations byflip(a unit,±1in practice). It never touches the members.- The merges also form a forest that path compression does not change:
members(root)walks the subtree of a root, which is frozen once that root has been merged away, and returns every member with its orientation relative to that root.
A merge therefore costs nearly constant time, and a representative costs time proportional to its region, paid only for the bars that are reported.
Attributes
- Experimental
- true
- Source
- SignedUnionFind.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article