Strongly Connected Components and Condensation
Contract mutually reachable vertices into a DAG and explain why a second graph traversal isolates each component.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Mutual reachability partitions the vertices
Vertices lie in the same strongly connected component if each reaches the other. Transitivity follows by concatenating paths. Contract each component to a single vertex and discard internal edges. The result is acyclic, since a directed cycle among distinct contracted vertices would make them mutually reachable. For two linked directed cycles with an edge only from the first to the second, the condensation has exactly two vertices and a single arrow.
Finish order finds a safe starting component
In a depth-first search of the original graph, if one component has an edge to another, its maximum finish time is greater. If it is discovered first, the second is fully explored and finished before the first search root exits. If the second is discovered first, it cannot reach the first. Now process vertices in decreasing finish time on the transposed graph, skipping visited vertices. The selected unvisited component has no outgoing edge in the reversed graph to another unvisited component, so each traversal recovers exactly one class. Topological order gives the resulting component dependency structure.[1][2]