AlgoScope

Kosaraju

AlgorithmadvancedConnectivity

Finish order from one DFS, reverse every edge, then DFS from the latest finisher to paint each component.

Decision · step 17 of 27Bridges and Components: Kosaraju on the same graph
071✓62✓53✓44✓35✓16✓2u

Pass 2: the unassigned vertex with the latest finish time is 0, finish 7. Start a DFS there on the reversed graph; it opens component 0.

Open in the player →or start at step 17

What you will see

Pass 1 stamps finish times; edges flip; pass 2 floods components in order.

How bridges and components works →

Cost

BestO(V + E)
AverageO(V + E)
WorstO(V + E)
SpaceO(V)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.

Screen readers: Vertices announce name, discovery numbers where relevant and component; each step announces the structural conclusion (bridge found, component closed).

Reduced motion: Component colouring and ordering changes crossfade in place.

Related

Taught by the same lesson

Bridges and Components covers these too, in the same run.