Crate disjoint_sets [] [src]

Implementations of Tarjan’s union-find data structure for disjoint sets.

The two variants are:

  • UnionFind: An array-based union-find where clients represent elements as small unsigned integers.
  • UnionFindNode: A tree-based union-find where each set can have associated ata, and where clients represent elements as opaque tree nodes.

Both data structures perform rank-balanced path compression using interior mutability.

Structs

UnionFind

Array-based union-find representing a set of disjoint sets.

UnionFindNode

Tree-based union-find with associated data.

Traits

ElementType

A type that can be used as a union-find element.