Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max Flow Linear time algorithm, Find a valid flow

So let me explain the question:

You are given a graph. You find the max flow. But it turns out that an edge, e_i, had the wrong capacity. It had one less. Unfortunately, the flow was maxed out at the old capacity.

Compute the new max flow in linear time (in terms of the number of edges and vertices) once you are told e_i had the wrong capacity.

Here's my plan: (1) You can't only drop the flow at edge e_i by one at an edge because you must violate certain constraints: like flow is conserved at an edge. Fix the flows so you can get a valid flow. But how?

(2) Someone has given me a hint: it will be helpful to show the valid flow = previous flow -1.mmm...

Help.

like image 931
user678392 Avatar asked Aug 01 '26 10:08

user678392


1 Answers

Here's a couple of tips:

  1. Suppose you found a path with nonzero flow (i.e >= 1), and contained this edge e_i. How might you use this path to make the overall flow valid again? Now, suppose you aren't given this path. How might you get it yourself?
  2. Now, you know that the max flow of the new graph is either the same, or one less than before (why?). How might you find out which in linear time?
like image 144
Dennis Meng Avatar answered Aug 05 '26 15:08

Dennis Meng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!