edmonds-karp

Update Maximum Flow After Adding an Edge

自作多情 提交于 2019-12-07 08:28:53
问题 Consider we have a network flow and using Edmond-Karp algorithm, we already have the maximum flow on the network. Now, if we add an arbitrary edge (with certain capacity) to the network, what is the best way to update the maximum flow? I was thinking about updating the residual network regarding the new edge and again look for augmenting path until we find new max flow, but I am not sure if it works or if it is the best way! 回答1: After doing maxflow you know the amount of content each edge

Missing some paths in edmonds karp max flow algorithm

随声附和 提交于 2019-12-06 12:05:26
问题 I'd implement Edmond Karp algorithm, but seems it's not correct and I'm not getting correct flow, consider following graph and flow from 4 to 8: Algorithm runs as follow: First finds 4→1→8, Then finds 4→5→8 after that 4→1→6→8 And I think third path is wrong, because by using this path we can't use flow from 6→8 (because it used), and in fact we can't use flow from 4→5→6→8. In fact if we choose 4→5→6→8, and then 4→1→3→7→8 and then 4→1→3→7→8 we can gain better flow(40). I Implemented algorithm

Update Maximum Flow After Adding an Edge

南楼画角 提交于 2019-12-05 16:48:11
Consider we have a network flow and using Edmond-Karp algorithm, we already have the maximum flow on the network. Now, if we add an arbitrary edge (with certain capacity) to the network, what is the best way to update the maximum flow? I was thinking about updating the residual network regarding the new edge and again look for augmenting path until we find new max flow, but I am not sure if it works or if it is the best way! After doing maxflow you know the amount of content each edge flowed. So, when the cost of an edge changed you can do the following things : Suppose, the content flowed by

Missing some paths in edmonds karp max flow algorithm

与世无争的帅哥 提交于 2019-12-04 15:22:13
I'd implement Edmond Karp algorithm , but seems it's not correct and I'm not getting correct flow, consider following graph and flow from 4 to 8: Algorithm runs as follow: First finds 4→1→8, Then finds 4→5→8 after that 4→1→6→8 And I think third path is wrong, because by using this path we can't use flow from 6→8 (because it used), and in fact we can't use flow from 4→5→6→8. In fact if we choose 4→5→6→8, and then 4→1→3→7→8 and then 4→1→3→7→8 we can gain better flow(40). I Implemented algorithm from wiki sample code. I think we can't use any valid path and in fact this greedy selection is wrong.

Edmonds-Karp Algorithm for a graph which has nodes with flow capacities

﹥>﹥吖頭↗ 提交于 2019-12-03 14:19:27
问题 I am implementing this algorithm for a directed graph. But the interesting thing about this graph nodes have also their own flow capacities. I think, this subtle change of the original problem must be handled in a special way. Because, In original max-flow problem It was okay to find any path from start to finish(actually, in Edmonds-Karp algorithm, we need to do BFS, and choose the first path that reaches the final node) But with this node-capacity extension, we need to be more careful about

Edmonds-Karp Algorithm for a graph which has nodes with flow capacities

人走茶凉 提交于 2019-12-03 04:32:10
I am implementing this algorithm for a directed graph. But the interesting thing about this graph nodes have also their own flow capacities. I think, this subtle change of the original problem must be handled in a special way. Because, In original max-flow problem It was okay to find any path from start to finish(actually, in Edmonds-Karp algorithm, we need to do BFS, and choose the first path that reaches the final node) But with this node-capacity extension, we need to be more careful about 'this path selection' job. I know it because, I implemented the original-algorithm and found myself