Kosaraju's algorithm for finding strongly connected graph components.