Overview
Connected Components runs traversal from unvisited nodes to label each reachable group in an undirected graph.
Groups graph nodes by which nodes can reach each other.
Compact metadata for implementation and discovery.
Connected Components runs traversal from unvisited nodes to label each reachable group in an undirected graph.
Quick facts
Runtime and memory behavior at a glance.
Best
O(V + E)
Average
O(V + E)
Worst
O(V + E)
Space
O(V)
Show each connected group receiving a different color.
Connected Components operates in O(V + E) time and O(V) space within the Connectivity family. Often compared with Breadth-First Search and Union-Find.
What each reference supports for this entry.
Textbook support for Connected Components's standard algorithm design, invariants, and complexity analysis.
Open sourceAlgorithm catalog support for Connected Components's problem context, known alternatives, and practical selection tradeoffs.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Connected components can be found by repeated BFS over unvisited vertices.
Union-Find can also maintain components under edge additions.