Given a Directed Weighted Graph which is Strongly Connected. I need to find a strongly connected sub-graph out of this graph such that the difference between the maximum and minimum weight edges is minimum.
To be more clearly, I need to get rid of edges in such a way that after removing them, the graph will still be strongly connected and the difference between the maximum and minimum weight edges is minimum.
Here is an example:
The first line is the number of N nodes and M edges of this graph. The next M lines represent the edges of this graph.
3 6
1 2 8
2 3 32
3 1 16
1 3 81
3 2 243
2 1 27
The chosen N-nodes sub-graph would contain the edges:
1 2 8
2 3 32
3 1 16
The difference between the maximum and minimum weight edges is: 32 - 8 = 24. Which is minimum among all choices.
I'm looking for an optimal solution. There are at most 3000 nodes and 5000 edges.