Strongly-Connected-Components (G)
| 1 |
Call DFS (G) to compute finishing times f[u]
for each vertex u |
| 2 |
Compute GT |
| 3 |
Call DFS (GT), but in the main loop of DFS,
consider the vertices in order of decreasing f[u] (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.
Do this by starting with the smallest f[u] value (from GT) and
use the predecessor array p, from GT
Components that are connected in G are still connected; e.g. (abe, cd) since G contains (b, c). |
|