How to find Strongly Connected Components in a Graph?

前端 未结 2 1851
时光取名叫无心
时光取名叫无心 2021-02-02 00:16

I am trying self-study Graph Theory, and now trying to understand how to find SCC in a graph. I have read several different questions/answers on SO (e.g., 1,2,3,4,5,6,7,8), but

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 00:51

    Your steps are correct and your answer is also correct, by examining the other answers you provided you can see that they used a different algorithm: First you run DFS on G transposed and then you run an undirected components algorithm on G processing the vertices in decreasing order of their post numbers from the previous step.

    The problem is they ran this last step on G transposed instead of in G and thus got an incorrent answer. If you read Dasgupta from page 98 onwards you will see a detailed explanation of the algorithm they (tried) to use.

提交回复
热议问题