AlgoPlus//graph / scc
Read the theory

Strongly Connected Components

Kosaraju's two-pass DFS collapses each mutually-reachable group into one component.

Pass
Done
Components
Directed edges (u-v, comma-separated)
Legend
Current vertex
Component 1
Component 2
Component 3
AI Tutor Workspace
In a nutshell
A strongly connected component is a group of vertices in a directed graph where every vertex can reach every other. Kosaraju's algorithm finds them all in two passes: a depth-first search records the order in which vertices finish, then a second depth-first search on the graph with all edges reversed — taken in reverse finish order — carves out exactly one component per search tree.
Ready
Press play to begin the cinematic walkthrough.
First DFS to learn who finishes last, then DFS the reversed graph in that order — reversing the edges traps each mutually-reachable group inside its own search tree.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Strongly Connected Components.