Skip to main content

Module union_find

Module union_find 

Source
Expand description

Union-Find (Disjoint Set) data structure.

Union-Find efficiently tracks connected components in undirected graphs. Supports:

  • find(x): Find representative of x’s component
  • union(x, y): Merge components containing x and y

Uses path compression and union by rank for near O(1) amortized operations.

Structs§

UnionFind
Union-Find data structure with path compression and union by rank.

Functions§

union_find_parallel
Parallel union-find using Shiloach-Vishkin style algorithm.
union_find_sequential
Sequential union-find on edge list.