A directed graph is strongly connected for every pair of vertices , there is a path from to and a path from to .

Using Edge and Transpose Edge, we can find the strongly connected components of a directed graph .

Steps:

  1. Call DFS(G) to compute finishing times for each vertex .
  2. compute .
  3. call DFS(G^T), but in the main loop of DFS, consider the vertices in order of decreasing (as computed in line 1).
  4. output the vertices of each tree in the depth-first forest formed in line 3 as a separate strongly connected component.

Component Graph: Suppose has strongly connected components. Then we define and , is the representative of . We define . Then is a directed acyclic graph.

Let and be distinct strongly connected components in directed graph . Let and , and suppose contains a path from to , then cannot also contain a path from to .

Let and be distinct strongly connected components in directed graph . Suppose edge where , . Then .