The Maximum Flow Problem
The Maximum Flow Problem
November 3, 2005
Maximum Flow
vX,wY
f (vw)
vX,wV
f (vw).
vX,wX
The maximum flow problem. Let G = (V, E) be a directed graph with a distinguished source, s V , and a distinguished sink, t V . Each edge has a positive capacity,
which we describe by the function cap : V V R with
cap(vw) > 0 if vw E and cap(vw) = 0 if vw 6 E.
For example, we assume G has no loops, so cap(vv) = 0
for all v V . A flow is a function f : V V R that
Residual capacity. The capacity constraint in the definition of a flow implies f (X, Y ) cap(X, Y ), for every cut. This implies that the value of a max-flow is
no larger than the capacity of a min-cut. We will prove
shortly that the two are, in fact, equal. To this end, we
introduce the residual capacity, res : V V R, defined by res = cap f . The capacity constraint implies
res(vw) 0 for every ordered pair of vertices. The resid-
3, 3
4, 1
3
1 3
1, 1
2, 2
3,2
3, 0
2
2
3, 2
4, 2
3
1
vX,wY
60
with positive residual capacity. As can be seen in Figure 74, only the edges in G as well as their oppositely
directed versions can be in R. An augmenting path is
a path p from s to t in R, and its residual capacity is
res(p) = minvwp res(vw). For example, in Figure 74
there are two augmenting paths that visit each vertex at
most once, and both have residual capacity equal to one.
We can increase the flow by pushing up to res(p) additional units of flow along p.
|f + f 0 | = |f | + |f 0 | |f |.
(i) f is a max-flow;
(ii) there is no augmenting path;
(iii) |f | = cap(X, Y ) for some cut V = X Y .
P ROOF. (i) (ii) (iii) (i). The first implication
is obvious and so is the last. To prove (ii) (iii), let
X be the set of vertices reachable from s in R and set
Y = V X. By construction, each edge from X to Y is
saturated. Therefore,
X
f (vw)
|f | =
vX,wY
cap(vw),
vX,wY
61
1
2
3
3
0
1
3
0
2
1
1
1 3
2
1
1
2
2
1 2
2
1
2
2
4
1
3
simple way for finding a blocking flow in L uses depthfirst search. Starting from s, we stop when we have a path
62