hw8sol - CS 473 Homework 8 Solutions Spring 2010 1. Suppose...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 473 Homework 8 Solutions Spring 2010 1. Suppose you have already computed a maximum ( s , t ) -flow f in a flow network G with integer capacities. Let k be an arbitrary positive integer, and let e be an arbitrary edge in G whose capacity is at least k . Assume that the given maximum flow f is integral. (a) Suppose we increase the capacity of e by k units. Describe and analyze an algorithm to update the maximum flow. Solution: Increasing the capacity of any edge by k increases the capacity of any cut con- taining e by k , and leaves the capacity of any other cut unchanged. Thus, the minimum cut capacity increases by at most k . By the maxflow-mincut theorem, the value of the maximum flow also increases by at most k . Let G f denote the residual graph of the given flow f , after increasing the (residual) capacity of edge e . To find the new maximum flow in G , we simply run Ford-Fulkerson on the updated residual graph G f . As usual, whenever we find an augmenting path in G f , we increase the value of the flow f along that path and update the residual capacities. Because all capacities are integers and the maximum flow value increases by at most k , Ford-Fulkerson terminates after at most k iterations. Thus, this algorithm runs in O ( Ek ) time . ± Rubric: 4 points max = 2 for Ford-Fulkerson in G f + 2 for time analysis. This is not the only correct solution. This is more detail than necessary for full credit. (b) Now suppose we decrease the capacity of e by k units. Describe and analyze an algorithm to update the maximum flow. Solution: We describe below how to handle the case k = 1 in O ( E ) time. To handle larger values of k , just iterate the following algorithm k times. Decreasing the capacity of any edge u v by 1 decreases the capacity of any cut containing u v by 1, and leaves the capacity of any other cut unchanged. Thus, the minimum cut capacity decreases by at most 1. By the maxflow-mincut theorem, the value of the maximum flow also decreases by at most 1. If the decremented edge u v is not saturated, there is nothing to do; f is still a legal flow, and therefore still a maximum flow. Otherwise, either G f contains a directed cycle through the reversed edge v u , or G f
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

hw8sol - CS 473 Homework 8 Solutions Spring 2010 1. Suppose...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online