This is a problem with minimal costs . You can assign a throughput for each edge equal to 1, then look for a minimum cost stream between a and b with stream = 2.
Someone might think that you can use a simple algorithm to find the shortest path from a to b , remove its edges from the graph, and then find another short path.
This approach is not always optimal. For some graphs, this gives a good approximation. For others, this can give a very bad solution:
Here, after removing the edges of the first shortest path (green), the only remaining path (red) is very difficult. The cost of this solution is 1 + 1 + 10 + 1 + 1 + 2 + 90 + 2 = 108. The optimal cost is 1 + 15 + 1 + 2 + 1 + 10 + 1 + 2 = 32.
source share