Pass 1: Stack
Perform DFS on the original graph. Push nodes onto a stack in order of their finishing times.
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
A two-pass DFS approach to find all Strongly Connected Components. It utilizes a transpose graph to ensure that DFS traversal is trapped within single SCCs.
Perform DFS on the original graph. Push nodes onto a stack in order of their finishing times.
Reverse every directed edge in the graph. SCCs remain SCCs, but the inter-component reachability is reversed.
Pop nodes from the stack and perform DFS on the reversed graph. Each DFS call extracts one full SCC.
In an SCC, every vertex is reachable from every other vertex. Kosaraju's is the classic way to find these components.