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 :)
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.
So your question is how to efficiently detect a Bridge? This can be done in linear time (also see the link).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With