Kosaraju's Algorithm Visualization

Kosaraju's algorithm finds Strongly Connected Components (SCCs) in a directed graph. An SCC is a portion of a graph where every vertex is reachable from every other vertex within that component.

The algorithm works in three main steps:

  1. Perform DFS on the original graph to compute finish times and build a stack
  2. Create the transpose graph by reversing all edges
  3. Perform DFS on the transpose graph in order of the stack to find SCCs
Step 1: Original Graph with DFS
Original Graph
DFS Stack
Transpose Graph
SCCs Discovered