Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reverse operation to "Union and find"

We know there is "Union and find" for disjoint sets. http://en.wikipedia.org/wiki/Union_find

But how to do reverse operation ? Consider a set with N nodes connected with E edges( which is in fact a graph ). And at each step we want to delete some edge and check if this delete operation leads to have another disjoint set. Is it possible to do it fastly like in "Union and find"?

P.S this is not homework, we have holiday :)

like image 850
Krzysztof Lewko Avatar asked Jun 22 '11 10:06

Krzysztof Lewko


2 Answers

This is known as the online edge deletion problem or online connectivity problem. Some links to algorithms are in this section of the Wikipedia article on graph connectivity.

like image 165
Rafał Dowgird Avatar answered Sep 28 '22 20:09

Rafał Dowgird


So your question is how to efficiently detect a Bridge? This can be done in linear time (also see the link).

like image 22
dcn Avatar answered Sep 28 '22 19:09

dcn