Strong Connectivity in Directed Graphs
Check reachability in both directions when deciding whether two vertices belong together.
Core Intuition & How It Works
A Strongly Connected Component (SCC) is a maximal subgraph where every vertex can reach every other vertex via directed paths. Kosaraju’s and Tarjan’s algorithms decompose any directed graph into SCCs and a condensation DAG in O(V + E).
In the Byte Sized Algorithms interactive classroom, you can step forward and backward through this algorithm with your keyboard while watching the visual diagram, memory state, and highlighted pseudocode update together.
Time & Space Complexity
| Metric | Complexity |
|---|---|
| Time Complexity | O(V + E) |
| Space Complexity | O(V) |
| Topic Chapter | Chapter 11: Graph Traversal & Connectivity |
| Difficulty Level | Intermediate |
Key Pattern to Recognize
In Kosaraju’s algorithm, push vertices by DFS finish time on G, then pop and run DFS on the reversed graph Gᵀ.
Common Pitfalls & Edge Cases
Running the second pass of Kosaraju’s algorithm in arbitrary order instead of decreasing finish time.
Real-World & Technical Interview Applications
2-SAT solvers, call-graph recursion analysis, dead-code elimination, and citation/web community clustering.