所谓有向图是强连通的,如果每个顶点都可以从其他顶点到达的话。
Coreman给出的算法如下:
STRONGLY-CONNECTED-COMPONENTS (G)
1. Call DFS(G) to compute finishing times f[u] for all u.
2. Compute GT
3. Call DFS(GT), but in the main loop, consider vertices in order of decreasing f[u] (as computed in first DFS)
4. Output the vertices in each tree of the depth-first forest formed in second DFS as a separate SCC.我试图理解这个算法的正确性,以及步骤3背后的逻辑,但没有理解。请帮助我理解这个,给我这个背后的感觉。
我读了一些答案,但没有给我适当的感觉。所以请用逻辑来解释,例如。提前谢谢。
发布于 2013-12-30 09:19:46
以下是算法的说明:-
为了更清晰起见,您可以搜索Kosaraju的SCC算法
https://stackoverflow.com/questions/20835804
复制相似问题