Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 991
Amitesh Avatar asked Aug 31 '13 06:08

Amitesh


1 Answers

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.

like image 150
Timothy Shields Avatar answered Nov 12 '22 14:11

Timothy Shields