Lesson 64 of 86IntermediatePro Interactive Lesson

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

MetricComplexity
Time ComplexityO(V + E)
Space ComplexityO(V)
Topic ChapterChapter 11: Graph Traversal & Connectivity
Difficulty LevelIntermediate

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.

Unlock the full course

All 86 lessons across 15 chapters

View pricing

Delete account

This permanently deletes your account and ends any Pro access.