Skip to content
StackDecode
GraphsExplained

Kosaraju's Algorithm

DFS finish order, then DFS on the reversed graph finds each SCC.

Time

O(V + E)

Extra space

O(V)

Use it for

Strongly connected components.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.