简体   繁体   中英

Minimising Number of Bridges in a Graph

I was trying to solve a problem which basically reduces to this:
Give a set of N nodes numbered from 1 to N and M edges where N<10000 and M<100000 ,
Find an Edge(u,v) which when added to the graph -- Minimizes the number of bridges in the graph .
If there are many such edges - Print the one which has lowest lexicographical value.
What would be an efficient approach to this problem?

I believe this problem is very hard. Here would be outline of the solution I can think of:

1) Find all bridges in graph.

2) Now imagine that bridges are the only edges you want in your graph. You only keep bridges and join all the nodes between bridges in big nodes.

3) You now have a tree. Edges are bridges, nodes are "big nodes" that combine nodes from previous graph.

4) Let's call this forest graph T.

5) Connecting any two nodes in graph T, creates a cycle. Any edge in the cycle is not a bridge.

6) Point 5 implies that solution is found by creating the longest cycle possible. You can do that simply by finding two nodes that have longest distance between them.

7) You can find nodes with longest distance in graph. How is discussed here: A linear-time algorithm for finding the longest distance between two nodes in a free tree?

Let me know if any point needs further explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM