How can the number of strongly connected components of a graph change if a new edge is added

随声附和 提交于 2019-12-23 11:59:08

问题


Exercise: 22.5-1 CLRS
How can the number of strongly connected components of a graph change if a new edge is added?


Somewhere the answer given is If a new edge is added, one of two things could happen.
1) If the new edge connects two vertices that belong to a strongly connected component, the number of strongly connected components will remain the same.
2) If, instead, the edge connects two strongly connected components, and the edge is in the reverse direction of an existing path between the two components, then a new strongly connected component will be made, increasing the number of components.

I think the second point is incorrect. Lets say we have two strongly connected component C and C'
a) If no edge or edge C->C' exists between them and new edge connects as C->C' then nothing will happen.
b) If edge C->C' exists between them and new edge connects as C'->C then C' will be merged to C decreasing the number of strongly connected component by 1 as every vertex will be reachable from each other.

Please correct me if i am wrong.


回答1:


You're exactly correct. The answer you quoted is wrong in its description: adding edges is only ever going to decrease the number of strongly connected components. Once all possible edges have been added, there's just a single strongly connected component left - the entire graph.



来源:https://stackoverflow.com/questions/18545463/how-can-the-number-of-strongly-connected-components-of-a-graph-change-if-a-new-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!