Algorithm for determining strongly connected components of a Graph:
Strongly Connected Components (G)
where d[u] = discovery time of the vertex u throughout DFS , f[u] = finishing time of a vertex u throughout DFS, GT = Transpose of the adjacency matrix
Step 1: Use DFS(G) to calculate f[u] ∀u∈V
Step 2: calculate G^{T}
Step 3: Execute DFS in G^{T}
Step 4: Output the vertices of each of tree within the depth-first forest of Step 3 as a separate strongly connected component.