Chapter 14 ยท Advanced Graphs

Strongly Connected Components (SCC)

Group the vertices of a directed graph so that inside a group everyone can reach everyone. Kosaraju does it with two Depth-First Search (DFS) passes; Tarjan does it in one pass with low-link values. Collapse each group and a Directed Acyclic Graph (DAG) appears.

Click a vertex, then another, to add or remove that directed edge.

current vertex on the DFS path (in progress) finished, no component yet DFS tree edge edge being examined ๐ŸŽจ other fills = one color per component
Condensation DAG (each component collapsed to one node)

How to read this

Try this

  1. Lesson graph, Kosaraju: the finish order is 5 4 3 2 1 0 7 6. Pass 2 starts at 6 and finds {6, 7}, then {0, 1, 2}, then {3, 4, 5}.
  2. Same graph, Tarjan: final low values are 0 0 0 3 3 3 6 6, and components come out as {3, 4, 5}, {0, 1, 2}, {6, 7}, which is reverse topological order of the condensation.
  3. Click 5 then 1 to add edge 5 โ†’ 1. Now 0โ€ฆ5 all reach each other: two components merge into one, and the condensation shrinks.
  4. Press A DAG: every vertex is its own component, and Kosaraju's pass-2 order is a topological order.
  5. Kosaraju: what goes wrong if pass 2 used the original graph? Try it in your head on the lesson graph: a DFS from 6 would leak into {3, 4, 5}. That's why the transpose matters.

Go deeper