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:
Perform DFS on the original graph to compute finish times and build a stack
Create the transpose graph by reversing all edges
Perform DFS on the transpose graph in order of the stack to find SCCs