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

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

CS 473 Homework 8 Solutions Spring 2010 1. Suppose you have already computed a maximum ( s , t ) -ﬂow f in a ﬂow 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 ﬂow f is integral. (a) Suppose we increase the capacity of e by k units. Describe and analyze an algorithm to update the maximum ﬂow. 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 maxﬂow-mincut theorem, the value of the maximum ﬂow also increases by at most k . Let G f denote the residual graph of the given ﬂow f , after increasing the (residual) capacity of edge e . To ﬁnd the new maximum ﬂow in G , we simply run Ford-Fulkerson on the updated residual graph G f . As usual, whenever we ﬁnd an augmenting path in G f , we increase the value of the ﬂow f along that path and update the residual capacities. Because all capacities are integers and the maximum ﬂow 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 ﬂow. 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 maxﬂow-mincut theorem, the value of the maximum ﬂow 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 ﬂow, and therefore still a maximum ﬂow. Otherwise, either G f contains a directed cycle through the reversed edge v u , or G f

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online