max-flow

What is node-disjoint paths?

跟風遠走 提交于 2019-12-23 23:17:58
问题 I need explanation about what exactly node-disjoint paths? and How to determine maximum number of node-disjoint path between two nodes Source(s) and Sink(t) in a directed graph. Can anyone explain with graphically. 回答1: A path is sequence of vertices: s, v_1, .., v_m, t . Two paths s, v_1, .., v_m, t and s, u_1, ..., u_k, t are called node-disjoint if v_i != u_j for any valid i and j . We can reduce this problem to finding the maximum number of edge-disjoint paths by splitting each vertex

Modification to Maximum Flow Algorithm

旧巷老猫 提交于 2019-12-21 04:57:20
问题 I've tried to solve a question about the maximum-flow problem. I have one source and two sinks. I need to find a maximum flow in this network. This part is general max-flow. However, both targets have to get same amount of flow in this special version of the max-flow problem. Is there anyone who can help me what should I do to do that? 回答1: Let s be your source vertex and t1 and t2 the two sinks. You can use the following algorithm: Use regular max-flow with two sinks, for example by

Searching for minimal flow with fulfill capacity in flow graphs

北慕城南 提交于 2019-12-11 12:39:26
问题 I have modified task of maximum flow problems. I should find minimum flow which satisfies condition (where f is flow and c is capacity): f(u,v) >= c(u,v) So flow at every edge is at least capacity of edge. (I am writing capacity but it was rename because it's no longer capacity, it's count which must be satisfied by flow) One more thing. I have function MaxFlow which gives me classic maximal flow and I can call it once. Can anyone help me with pseudo algorithm? I am thinking about modifing

All pair Maximum Flow

坚强是说给别人听的谎言 提交于 2019-12-10 03:09:12
问题 Given a directed weighted graph, how to find the Maximum Flow ( or Minimum Edge Cut ) between all pairs of vertices. The naive approach is simply to call a Max Flow algorithm like Dinic's, whose complexity is O((V^2)*E) , for each pair. Hence for all pairs it is O((V^4)*E) . Is it possible to reduce the complexity to O((V^3)*E) or to O(V^3) by some optimizations? 回答1: Gomory-Hu Tree does not work with directed graphs , putting that aside, Gomory-Hu Tree will form a Graph maximum flow by

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

All pair Maximum Flow

六眼飞鱼酱① 提交于 2019-12-05 03:51:50
Given a directed weighted graph, how to find the Maximum Flow ( or Minimum Edge Cut ) between all pairs of vertices. The naive approach is simply to call a Max Flow algorithm like Dinic's, whose complexity is O((V^2)*E) , for each pair. Hence for all pairs it is O((V^4)*E) . Is it possible to reduce the complexity to O((V^3)*E) or to O(V^3) by some optimizations? Gomory-Hu Tree does not work with directed graphs , putting that aside, Gomory-Hu Tree will form a Graph maximum flow by applying minimum cuts. The time complexity is: O(|V|-1 * T(minimum-cut)) = O(|V|-1 * O(2|V|-2)) ~ O(|V|^2) *

Best graph algorithm/implementation for dynamic max-flow computation

你。 提交于 2019-12-05 00:51:40
问题 I have to write a program which requires to maintain some data in a directed flow graph. I need to compute the maximum-flow at runtime. I know that there exist several libraries for handling graphs, implementing almost every classical algorithm, but my problem is that my graph is dynamic, meaning it evolves at runtime. After every evolution, I need to recompute the new maximum-flow. An evolution is, either: adding an edge increasing the capacity of an edge and what I need to re-compute is the

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.