Skip to main content

union_find_parallel

Function union_find_parallel 

Source
pub fn union_find_parallel(
    n: usize,
    edges: &[(NodeId, NodeId)],
) -> Result<Vec<ComponentId>>
Expand description

Parallel union-find using Shiloach-Vishkin style algorithm.

This implementation uses atomic operations for thread-safe parallel execution. The algorithm works in rounds of:

  1. Hook: For each edge, attempt to hook smaller component under larger
  2. Jump: Pointer jumping to flatten trees

Continues until no changes occur (convergence).