Disjoint-set structures: connectivity, cycles, and grouping.
Find the edge that closes a cycle in a tree-plus-one-edge graph.