Concept Flow - Strongly connected components
Start with directed graph
Run DFS to get finish times
Reverse all edges in graph
Run DFS in order of decreasing finish times
Each DFS tree forms a strongly connected component
Collect all SCCs
Done
The process finds groups of nodes where each node can reach every other by running DFS twice: once on the graph and once on the reversed graph.