Strongly Connected Components
Partition a directed graph by mutual reachability, replay two-pass DFS and contract its strongly connected components into a DAG.
Free theory articlePartition a directed graph by mutual reachability, replay two-pass DFS and contract its strongly connected components into a DAG.
Concept & interpretation
A directed arrow grants travel in one direction. Two vertices belong to the same strongly connected component, or SCC, exactly when each can reach the other by a directed path. A component is maximal: every vertex mutually reachable with its members is included. A single outgoing route does not establish strong connectivity.
Experiment with the native controls
Open the interactive Strongly Connected Components module. The graph and final partition are available immediately; the replay separately exposes the algorithm's intermediate stack and discovered trees.
- Choose Cycle chain under Graph example. Confirm three SCCs, seven unique arrows and two condensation arrows. With From vertex 0 and To vertex 5, read a forward path and no reverse path.
- Choose Condensation DAG under Graph view. The native graph contracts to C0, C1 and C2. Change to Transpose graph: every original arrow reverses, but the final partition remains unchanged. The query cards continue to describe original G.
- Return to Original graph and press Next step. The active white ring moves to vertex 0. Use Play scan, pause, or Finish scan to inspect the exit list and the three second-pass trees. Rewind scan returns the cursor to zero without changing the graph.
- Append a new line
5 0in Directed edges. Watch the six vertices acquire one component color, read SCC count one and see the return path 5→0. The edited graph starts a fresh replay. - Press Reset example, then append
0 3and1 4on separate lines. There are nine unique original arrows, but still two condensation arrows: three different arrows from C0 to C1 collapse to one. - Drag a node to rearrange it and drag the background to pan. Reset view or Home restores the camera; Reset layout also restores automatic node positions. Neither changes the graph. Use the visible vertex buttons as a keyboard alternative for selecting the query source.