Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Short Explication Max Flow

Uploaded by

Patrice Kizito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Short Explication Max Flow

Uploaded by

Patrice Kizito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CS 6901 (Applied Algorithms) –

Lecture 15

Antonina Kolokolova∗

November 6, 2014

1 Network flows

1.1 Cuts of Flow Networks

For the moment, we will concern ourselves with one more question about the algorithm.
Let’s assume it does halt; is it then the case that the flow it has found is as large as possible?
The answer turns out to be YES! We know that if an augmenting path exists then the current
flow is not optimal. We want to prove that if there is no augmenting path, then the current
flow is optimal.

This is a subtle proof. Let us fix flow network F = (G, c, s, t), G = (V, E), and flow f .
We are going to introduce the new notion of a cut of F. We will see that if there is no
augmenting path, then there will exist a special cut that shows that f is optimal.

A cut (S, T ) of F is a partition of V into S and T = V − S such that s ∈ S and t ∈ T . We


define the capacity of (S, T ) to be the sum of the capacities over all edges going from S to
T ; note that this is a sum of nonnegative numbers. We define the flow across (S, T ) to be
the sum of the flows over all edges going from S to T ; note that this sum may consist of
negative numbers. More formally:

The capacity of the cut (S, T ) is defined by


X
c(S, T ) = c(x, y)
(x,y)∈(S×T )∩E


This set of notes uses a variety of sources, in particular some material from Kleinberg-Tardos book and
notes from University of Toronto CSC 364

1
The flow across (S, T ) is
X
f (S, T ) = f (x, y) − f (y, x)
(x,y)∈(S×T )∩E

Example: Consider our earlier example of the flow network F with flow f 0 . Consider
the cut (S, T ) = ({s, v3 }, {t, v1 , v2 , v4 }). We have c(S, T ) = 20 + 13 + 8 + 22 = 63 and
f 0 (S, T ) = 13 + 12 + (−14) + (−7) + 21 = 25.

We see that f (S, T ) in the above example is exactly equal to |f |, and this is no coincidence.
Intuitively it makes sense that the amount flowing out of s should be exactly the same as
the amount flowing across any cut, and this is proven in the next lemma. In particular, by
considering the cut (V − {t}, {t}), we see that |f | is exactly equal to the amount flowing into
t.

Lemma 1 Fix flow network F = (G, c, s, t) and flow f . Then for every cut (S, T ),
f (S, T ) = |f |.

Corollary 1 Fix flow network F = (G, c, s, t) and flow f . Then for every cut (S, T ),
f (S, T ) ≤ c(S, T ).

Corollary 2 The value of every flow in F is less than or equal to the capacity of every cut
of F.

We now state and prove the famous “max-flow, min cut” theorem. This theorem says that
the maximum value over all flows in F is exactly equal to the minimum capacity over all
cuts. It also tells us that if F has no augmenting paths with respect to a flow f , then |f | is
the maximum possible.

Theorem 1 (MAX-FLOW, MIN-CUT THEOREM)


Fix flow network F = (G, c, s, t), G = (V, E), and flow f . Then the following are equivalent

1) f is a max flow (that is, a flow of maximum possible value) in F.

2) There are no augmenting paths with respect to f .

3) |f | = c(S, T ) for some cut (S, T ) of F.

Proof:
(1) ⇒ (2)
Suppose (1) holds. We have already seen that if there were an augmenting path with respect

2
to f , then a flow with value larger than |f | could be constructed. Since f is a max flow,
there must be no augmenting paths.

(2) ⇒ (3)
Suppose (2) holds. Then there is no path from s to t in Gf .
Let S = {v ∈ V | there exists a path from s to v in Gf }, and let T = V − S. Clearly (S, T )
is a cut. We claim that |f | = c(S, T ). ¿From the above Lemma 3, it suffices to show that
f (S, T ) = c(S, T ). For this, it suffices to show that for every edge (u, v) ∈ (S × T ) ∩ E,
f (u, v) = c(u, v). So consider such an edge (u, v). If we had f (u, v) < c(u, v), then (u, v)
would be an edge with positive residual capacity, and hence (u, v) would be an edge of Gf ,
and hence (since u ∈ S), there would be a path in Gf from s to v, and hence v ∈ S – a
contradiction.

(3) ⇒ (1)
Suppose (3) holds. Let (S, T ) be a cut of F such that |f | = c(S, T ). ¿From the above
corollary, we know that every flow has value less than or equal to c(S, T ), and hence every
flow has value less than or equal to |f |. So f is a max flow.

This theorem tells us that if Ford-Fulkerson halts, then the resulting flow is optimal.

1.2 Open-pit mining/project selection application

Recall our second motivating example: given a mineral deposit where the cost and profit of
excavating of every cubic meter of soil is known, and a cubic meter of soil can be excavated
only if the one directly above is taken out, determine which ones to take out when construct-
ing an open-pit mine. That is, we want to find a ”cut” in the ground which will give us the
best profit.

Construct a weight graph G as follows. Make a vertex for every cubic meter of soil (call
them units, for brevity), and add two extra vertices s and t. For unit, make an edge of cost
∞ from its vertex to the vertex corresponding to the unit right above it. Connect s to every
vertex corresponding to units with cost < prof it by an edge of weight pi = prof iti − costi .
Connect every vertex corresponding to a unit with cost > prof it (that is, net profit pi < 0)
to t by an edge of weight −pi = costi − prof iti .

Now, run Ford-Fulkerson, and calculate the minimal cut by running BFS from s in the final
residual network to compute the set of vertices S reachable from s. Now, this set of vertices
(minus s) is the set of units that should be dug out to maximize the profit.

You might also like