dsagraphs
Union-find fits connectivity that only grows
Anonymous
For an undirected graph that gains edges but never removes them, keep one representative per component. To add an edge, find both representatives; if they differ, join the components. Path compression plus union by size gives amortized near-constant work per operation. If edges can disappear, this structure alone can't maintain connectivity.
0