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ﬂowmincut 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 FordFulkerson 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
, FordFulkerson
terminates after at most
k
iterations. Thus, this algorithm runs in
O
(
Ek
)
time
.
±
Rubric:
4 points max = 2 for FordFulkerson 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ﬂowmincut 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.
 Spring '08
 Chekuri,C
 Graph Theory, Glossary of graph theory, Bipartite graph, maximum flow

Click to edit the document details