Maximum Flow and Minimum Cuts - Algorithms | CS 573, Study notes of Algorithms and Programming

Material Type: Notes; Class: Algorithms; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Unknown 1999;

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-4eu
koofers-user-4eu 🇺🇸

4

(1)

7 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithms Lecture 13: Maximum Flows and Minimum Cuts
Col. Klink: What are you waiting for? Cut the wire.
Col. Hogan:
That’s the problem. One of these wires disconnects the fuse,
the other one fires the bomb. Which one would you cut, Shultz?
Sgt. Schultz: Don’t ask me, this is a decision for an officer.
Col. Hogan: All right. Which wire, Colonel Klink?
Col. Klink: This one. [points to the white wire]
Col. Hogan: You’re sure?
Col. Klink: Yes.
[Hogan cuts the black wire; the bomb stops ticking]
Col. Klink: If you knew which wire it was, why did you ask me?
Col. Hogan:
I wasn’t sure which was the right one, but I was certain you’d
pick the wrong one.
“A Klink, a Bomb, and a Short Fuse", Hogan’s Heroes (1966)
13 Maximum Flows and Minimum Cuts
In the mid-1950s, Air Force researchers T. E. Harris and F. S. Ross published a classified report studying
the rail network that linked the Soviet Union to its satellite countries in Eastern Europe. The network
was modeled as a graph with 44 vertices, representing geographic regions, and 105 edges, representing
links between those regions in the rail network. Each edge was given a weight, representing the rate
at which material could be shipped from one region to the next. Essentially by trial and error, they
determined both the maximum amount of stuff that could be moved from Russia into Europe, as well as
the cheapest way to disrupt the network by removing links (or in less abstract terms, blowing up train
tracks), which they called ‘the bottleneck’. Their results (including the figure at the top of the page)
were only declassified in 1999.1
Figure 2
From Harris and Ross [1955]: Schematic diagram of the railway network of the Western So-
viet Union and Eastern European countries, with a maximum flow of value163,000 tons from
Russia to Eastern Europe, and a cut of capacity 163,000 tons indicated as The bottleneck.
The max-flow min-cut theorem
In the RAND Report of 19 November 1954, Ford and Fulkerson[1954] gave (next to defining
the maximum flow problem and suggesting the simplex method for it) the max-flow min-
cut theorem for undirected graphs, saying that the maximum flow value is equal to the
minimum capacity of a cut separating source and terminal. Their proof is not constructive,
but for planar graphs, with source and sink on the outer boundary, they give a polynomial-
time, constructive method. In a report of 26 May 1955, Robacker [1955a] showed that the
max-flow min-cut theorem can be derived also from the vertex-disjoint version of Mengers
theorem.
As for the directed case, Ford and Fulkerson [1955] observed that the max-flow min-cut
theorem holds also for directed graphs. Dantzig and Fulkerson [1955] showed, by extending
the results of Dantzig [1951a] on integer solutions for the transportation problem to the
25
Harris and Ross’s map of the Warsaw Pact rail network
This one of the first recorded applications of the maximum flow and minimum cut problems, which
are defined as follows. Let
G
= (
V,E
)be a directed graph, and let
s
and
t
be special vertices of
G
called
the source and target. As in the previous lectures, I will use
uv
to denote the directed edge from vertex
uto vertex v.
1
Both the map and the story were taken from Alexander Schrijver’s fascinating survey ‘On the history of combinatorial
optimization (till 1960)’.
1
pf3
pf4
pf5

Partial preview of the text

Download Maximum Flow and Minimum Cuts - Algorithms | CS 573 and more Study notes Algorithms and Programming in PDF only on Docsity!

Col. Klink: What are you waiting for? Cut the wire. Col. Hogan: That’s the problem. One of these wires disconnects the fuse, the other one fires the bomb. Which one would you cut, Shultz? Sgt. Schultz: Don’t ask me, this is a decision for an officer. Col. Hogan: All right. Which wire, Colonel Klink? Col. Klink: This one. [points to the white wire] Col. Hogan: You’re sure? Col. Klink: Yes. [Hogan cuts the black wire; the bomb stops ticking] Col. Klink: If you knew which wire it was, why did you ask me? Col. Hogan: I wasn’t sure which was the right one, but I was certain you’d pick the wrong one. — “A Klink, a Bomb, and a Short Fuse", Hogan’s Heroes (1966)

13 Maximum Flows and Minimum Cuts

In the mid-1950s, Air Force researchers T. E. Harris and F. S. Ross published a classified report studying the rail network that linked the Soviet Union to its satellite countries in Eastern Europe. The network was modeled as a graph with 44 vertices, representing geographic regions, and 105 edges, representing links between those regions in the rail network. Each edge was given a weight, representing the rate at which material could be shipped from one region to the next. Essentially by trial and error, they determined both the maximum amount of stuff that could be moved from Russia into Europe, as well as the cheapest way to disrupt the network by removing links (or in less abstract terms, blowing up train tracks), which they called ‘the bottleneck’. Their results (including the figure at the top of the page) were only declassified in 1999.^1

Figure 2 From Harris and Ross [1955]: Schematic diagram of the railway network of the Western So- viet Union and Eastern European countries, with a maximum flow of value 163,000 tons from Russia to Eastern Europe, and a cut of capacity 163,000 tons indicated as ‘The bottleneck’.

The max-flow min-cut theorem In the RAND Report of 19 November 1954, Ford and Fulkerson [1954] gave (next to defining the maximum flow problem and suggesting the simplex method for it) the max-flow min- cut theorem for undirected graphs, saying that the maximum flow value is equal to the minimum capacity of a cut separating source and terminal. Their proof is not constructive, but for planar graphs, with source and sink on the outer boundary, they give a polynomial- time, constructive method. In a report of 26 May 1955, Robacker [1955a] showed that the max-flow min-cut theorem can be derived also from the vertex-disjoint version of Menger’s theorem. As for the directed case, Ford and Fulkerson [1955] observed that the max-flow min-cut

Harris and Ross’s map of the Warsaw Pact rail network

This one of the first recorded applications of the maximum flow and minimum cut problems, which are defined as follows. Let G = (V, E) be a directed graph, and let s and t be special vertices of G called

the source and target. As in the previous lectures, I will use uv to denote the directed edge from vertex

u to vertex v. (^1) Both the map and the story were taken from Alexander Schrijver’s fascinating survey ‘On the history of combinatorial optimization (till 1960)’.

13.1 Flows

An ( s , t ) -flow (or just flow if the source and target are clear from context) is a function f : E → IR≥ 0 that satisfies the following balance constraint for all vertices v except possibly s and t: ∑

u

f (uv) =

w

f (vw).

In English, the total flow into any vertex is equal to the total flow out of that vertex. (To keep the

notation simple, we assume here that f (uv) = 0 if there is no edge uv in the graph.) The value of

the flow f is defined as the excess flow out of the source vertex s:

| f | =

w

f (sw) −

u

f (us)

It’s not hard to prove that the value | f | is also equal to the excess flow into the target vertex t. First we observe that ∑

v

w

f (vw) −

u

f (uv)

v

w

f (vw) −

v

u

f (uv) = 0

because both summations count the total flow across all edges. On the other hand, the balance constraint implies that ∑

v

w

f (vw) −

u

f (uv)

w

f (tw) −

u

f (us)

w

f (tw) −

u

f (ut)

= | f | +

w

f (tw) −

u

f (ut)

It follows that | f | =

u

f (ut) −

w

f (tw).

Now suppose we have another function c : E → IR≥ 0 that assigns a non-negative capacity c(e) to each edge e. We say that a flow f is subject to c if f (e) ≤ c(e) for every edge e. Most of the time we will consider only flows that are subject to some fixed capacity function c. We say that a flow f saturates edge e if f (e) = c(e), and avoids edge e if f (e) = 0. The maximum flow problem is to compute an (s, t)-flow in a given directed graph, subject to a given capacity function, whose value is as large as possible.

s t

10/

0/

10/

0/

10/

5/

5/

5/

0/

An (s, t)-flow with value 10. Each edge is labeled with its flow/capacity.

13.3 The Max-Flow Min-Cut Theorem

Surprisingly, for any weighted directed graph, there is always a flow f and a cut (S, T ) that satisfy the equality condition. This is the famous max-flow min-cut theorem:

The value of the maximum flow is equal to the cost of the minimum cut.

The rest of this section gives a proof of this theorem; we will eventually turn this proof into an algorithm. Fix a graph G, vertices s and t, and a capacity function c : E → IR≥ 0. The proof will be easier if we

assume that the capacity function is reduced : For any vertices u and v, either c(uv) = 0 or c(vu) = 0,

or equivalently, if an edge appears in G, then its reversal does not. This assumption is easy to enforce.

Whenever an edge uv and its reversal vu are both the graph, replace the edge uv with a path

uxv of length two, where x is a new vertex and c(ux) = c(xv) = c(uv). The modified graph

has the same maximum flow value and minimum cut cost as the original graph.

Enforcing the one-direction assumption.

Let f be a flow subject to c. We define a new capacity function cf : V × V → IR, called the residual capacity , as follows:

cf (uv) =

c(uv) − f (uv) if uv ∈ E

f (vu) if vu ∈ E

0 otherwise

Since f ≥ 0 and f ≤ c, the residual capacities are always non-negative. It is possible to have cf (uv) > 0

even if uv is not an edge in the original graph G. Thus, we define the residual graph Gf = (V, Ef ),

where Ef is the set of edges whose residual capacity is positive. Notice that the residual capacities are

not necessarily reduced; it is quite possible to have both cf (uv) > 0 and cf (vu) > 0.

s t

10/

0/

10/

0/

10/

5/

5/

5/

0/ s t 10

10

5

10

15 5 5

10 5

15

5

10 10

A flow f in a weighted graph G and the corresponding residual graph Gf.

Suppose there is no path from the source s to the target t in the residual graph Gf. Let S be the set of vertices that are reachable from s in Gf , and let T = V \ S. The partition (S, T ) is clearly an (s, t)-cut. For every vertex u ∈ S and v ∈ T , we have

cf (uv) = (c(uv) − f (uv)) + f (vu) = 0,

which implies that c(uv) − f (uv) = 0 and f (vu) = 0. In other words, our flow f saturates every

edge from S to T and avoids every edge from T to S. It follows that | f | = ‖S, T ‖. Moreover, f is a maximum flow and (S, T ) is a minimum cut.

s t 10

10

5

10

15 5 5

10 5

15

5

10 10 s t

10/

5/

5/

5/

10/

5/

0/

10/

0/

An augmenting path in Gf with value F = 5 and the augmented flow f ′.

On the other hand, suppose there is a path s = v 0 v 1  · · · vr = t in Gf. We refer to v 0 v 1  · · · vr

as an augmenting path. Let F = mini cf (vi vi+ 1 ) denote the maximum amount of flow that we can

push through the augmenting path in Gf. We define a new flow function f ′^ : E → IR as follows:

f ′(uv) =

f (uv) + F if uv is in the augmenting path

f (uv) − F if vu is in the augmenting path

f (uv) otherwise

To prove this is a legal flow function subject to the original capacities c, we need to verify that f ′^ ≥ 0

and f ′^ ≤ c. Consider an edge uv in G. If uv is in the augmenting path, then f ′(uv) > f (uv) ≥ 0

and

f ′(uv) = f (uv) + F by definition of f ′

≤ f (uv) + cf (uv) by definition of F

= f (uv) + c(uv) − f (uv) by definition of cf

= c(uv) Duh.

On the other hand, if the reversal vu is in the augmenting path, then f ′(uv) < f (uv) ≤ c(uv)

and

f ′(uv) = f (uv) − F by definition of f ′

≥ f (uv) − cf (vu) by definition of F

= f (uv) − f (uv) by definition of cf

= 0 Duh.

Finally, we observe that (without loss of generality) only the first edge in the augmenting path leaves s, so | f ′| = | f | + F > 0. In other words, f is not a maximum flow. This completes the proof!