0% found this document useful (0 votes)
10 views

Lecture 15

Uploaded by

Simon Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lecture 15

Uploaded by

Simon Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Stanford University — CS261: Optimization Handout 15

Luca Trevisan February 24, 2011

Lecture 15
In which we look at the linear programming formulation of the maximum flow problem,
construct its dual, and find a randomized-rounding proof of the max flow - min cut
theorem.

In the first part of the course, we designed approximation algorithms “by hand,”
following our combinatorial intuition about the problems. Then we looked at linear
programming relaxations of the problems we worked on, and we saw that approx-
imation algorithms for those problems could also be derived by rounding a linear
programming solution. We also saw that our algorithms could be interpreted as con-
structing, at the same time, an integral primal solution and a feasible solution for the
dual problem.
Now that we have developed exact combinatorial algorithms for a few problems (maxi-
mum flow, minimum s-t cut, global min cut, maximum matching and minimum vertex
cover in bipartite graphs), we are going to look at linear programming relaxations of
those problems, and use them to gain a deeper understanding of the problems and of
our algorithms.
We start with the maximum flow and the minimum cut problems.

1 The LP of Maximum Flow and Its Dual


Given a network (G = (V, E), s, t, c), the problem of finding the maximum flow in the
network can be formulated as a linear program by simply writing down the definition
of feasible flow.
We have one variable f (u, v) for every edge (u, v) ∈ E of the network, and the problem

1
is:
X
maximize f (s, v)
v:(s,v)∈E
subject to X X
f (u, v) = f (v, w) ∀v ∈ V − {s, t} (1)
u:(u,v)∈E w:(v,w)∈E
f (u, v) ≤ c(u, v) ∀(u, v) ∈ E
f (u, v) ≥ 0 ∀(u, v) ∈ E

Now we want to construct the dual.


When constructing the dual of a linear program, it is often useful to rewrite it in a
way that has a simpler structure, especially if it is possible to rewrite it in a way that
has fewer constraints (which will correspond to fewer dual variables), even at the cost
of introducing several new variables in the primal.
A very clean way of formulating the maximum flow problem is to think in terms of
the paths along which we are going to send the flow, rather than in terms of how much
flow is passing through a specific edge, and this point of view makes the conservation
constraints unnecessary.
In the following formulation, we have one variable xp for each of the possible simple
paths from s to t (we denote by P the set of such paths), specifying how much of the
flow from s to t is being routed along the path p:
X
maximize xp
p∈P
subject to X (2)
xp ≤ c(u, v) ∀(u, v) ∈ E
p∈P :(u,v)∈p
xp ≥ 0 ∀p ∈ P

Note that, usually, a network has exponentially many possible paths from s to t,
and so the linear program (2) has an exponential number of variables. This is ok
because we are never going to write down (2) for a specific network and pass it to a
linear programming solver; we are interested in (2) as a mathematical specification of
the maximum flow problem. If we want to actually find a maximum flow via linear
programming, we will use the equivalent formulation (1).
(There are several other cases in combinatorial optimization in which a problem has
a easier-to-understand linear programming relaxation or formulation that is exponen-
tially big, and one can prove that it is equivalent to another relaxation or formulation
of polynomial size. One then proves theorems about the big linear program, and the
theorems apply to the small linear program as well, because of the equivalence. Then

2
the small linear program can be efficiently solved, and the theorems about the big
linear program can be turned into efficient algorithms.)
Let us first confirm that indeed (1) and (2) are equivalent.

Fact 1 If f (·, ·) is a feasible solution for (1), then there is a feasible solution for (2)
of the same cost.

Proof: Note that this is exactly the Flow Decomposition Theorem that we proved
in Lecture 11, in which it is stated as Lemma 2. 

Fact 2 If {xp }p∈P is a feasible solution for (2), then there is a feasible solution for
(1) of the same cost.

Proof: Define
X
f (u, v) := xp
p∈P :(u,v)∈p

that is, let f (u, v) the sum of the flows of all the paths that use the edge (u, v). Then
f (·, ·) satisfies the capacity constraints and, regarding the conservation constraints,
we have
X X X
f (u, v) = xp = f (u, v)
u:(u,v)∈E p∈P :v∈p w:(v,w)∈E

Let us now construct the dual of (2). We have one dual variable yu,v for every edge
(u, v) ∈ E, and the linear program is:
X
minimize c(u, v)yu,v
(u,v)∈E
subject to X (3)
yu,v ≥ 1 ∀p ∈ P
(u,v)∈p
yu,v ≥ 0 ∀(u, v) ∈ E

The linear program (3) is assigning a weight to each edges, which we may think of as
a “length,” and the constraints are specifying that, along each possible path, s and t
are at distance at least one. This means that dual variables are expressing a way of
“separating” s from t and, after thinking about it for a moment, we see that (3) can
be seen as a linear programming relaxation of the minimum cut problem.

3
Fact 3 For every feasible cut A in the network (G, s, t, c), there is a feasible solution
{yu,v }(u,v)∈E to (3) whose cost is the same as the capacity of A.

Proof: Define yu,v = 1 if u ∈ A and v 6∈ A, and let yu,v = 0 otherwise. Then


X X
c(u, v)yu,v = c(u, v) = capacity(A)
u,v u∈A,v6∈A

This means that the optimum of (3) is smaller than or equal to the capacity of the
minimum cut in the network. Now we are going to describe a randomized rounding
method that shows that the optimum of (3) is actually equal to the capacity of the
minimum cut. Since the optimum of (3) is equal to the optimum of (2) by the Strong
Duality Theorem, and we have proved that the optimum of (3) is equal to the cost
of the maximum flow of the network, Lemma 4 below will prove that the cost of the
maximum flow in the network is equal to the capacity of the minimum flow, that is,
it will be a different proof of the max flow - min cut theorem. It is actually a more
difficult proof (because it uses the Strong Duality Theorem whose proof, which we
have skipped, is not easy), but it is a genuinely different one, and a useful one to
understand, because it gives an example of how to use randomized rounding to solve
a problem optimally. (So far, we have only seen examples of the use of randomized
rounding to design approximate algorithms.)

Lemma 4 Given any feasible solution {yu,v }(u,v)∈E to (3), it is possible to find a cut
A such that
X
capacity(A) ≤ c(u, v)yu,v
u,v

Proof: Interpret the yu,v as weights on the edges, and use Dijkstra’s algorithm to
find, for every vertex v, the distance d(v) from s to v according to the weights yu,v .
The constraints in (3) imply that d(t) ≥ 1.
Pick a value T uniformly at random in the interval [0, 1), and let A be the set

A := {v : d(v) ≤ T }

Then, for every choice of T , A contains s and does not contain t, and so it is a feasible
cut.
Using linearity of expectation, the average (over the choice of T ) capacity of A can
be written as

4
X
E capacity(A) = c(u, v) P[u ∈ A ∧ v 6∈ A]
T ∼[0,1)
(u,v)∈E

and

P[u ∈ A ∧ v 6∈ A] = P[d(u) ≤ T < d(v)] = d(v) − d(u)


Finally, we observe the “triangle inequality”

d(v) ≤ d(u) + yu,v


which says that the shortest path from s to v is at most the length of the shortest
path from s to u plus the length of the edge (u, v).
Putting all together, we have
X
E capacity(A) ≤ c(u, v)yu,v
T ∼[0,1)
(u,v)∈E

and there clearly must exist a choice of T for which the capacity of A is at most the
expected capacity.
About finding A efficiently, we can also note that, although there is an infinite number
of choices for T , there are only at most |V | − 1 different cuts that can be generated.
If we sort the vertices in increasing order of d(v), and let them be u1 , . . . , u|V | in this
order, then we have s = u1 , and let k be such that d(uk ) < 1 but d(uk+1 ) ≥ 1. Then
the only cuts which are generated in our probability distribution are the k cuts of the
form

Ai := {s = u1 , u2 , . . . , ui }
P
for i = 1, . . . , k, and one of them must have capacity ≤ (u,v)∈E yu,v c(u, v). We can
compute the capacity of each Ai and pick the Ai with the smallest capacity. 

Let us now see what the dual of (1) looks like. It will look somewhat more mysterious
than (3), but now we know what to expect: because of the equivalence between (1) and
(2), the dual of (1) will have to be a linear programming relaxation of the minimum
cut problem, and it will have an exact randomized rounding procedure.
The dual of (1) has one variable for each vertex v (except s and t), which we shall
call yv , corresponding to the conservation constraints, and one variable for each edge,

5
which we shall call yu,v , corresponding to the capacity constraints.
X
minimize c(u, v)yu,v
(u,v)∈E
subject to
(4)
yv + ys,v ≥ 1 ∀v : (s, v) ∈ E
yv − yu + yu,v ≥ 0 ∀(u, v) ∈ E, u 6= s, v 6= t
−yu + yu,t ≥ 0 ∀u : (u, t) ∈ E

Let us see that (4) is a linear programming relaxation of the minimum cut problem
and that it admits an exact rounding algorithm.

Fact 5 If A is a feasible cut in the network, then there is a feasible solution to (4)
such that
X
capacity(A) = c(u, v)yu,v
(u,v)∈E

Proof: Define yv = 1 if v ∈ A, and yv = 0 if v 6∈ A. Define yu,v = 1 if u ∈ A and


v 6∈ A, and yu,v = 0 otherwise.
To see that it is a feasible solution, let us first consider the constraints of the first
kind. They are always satisfied because if v ∈ A then yv = 1, and if v 6∈ A then
(s, v) crosses the cut and ys,v = 1, so the left-hand-side is always at least one. We
can similarly see that the constraints of the third type are satisfied.
Regarding the constraints of the second kind, we can do a case analysis and see that
the constraint is valid if yu = 0 (regardless of the value of the other variables), and it
is also valid if yv = 1 (regardless of the value of the other variables). The remaining
case is yu = 1 and yv = 0, which is the case in which (u, v) crosses the cut and so
yu,v = 1. 

Fact 6 Given a feasible solution of (4), we can find a feasible cut whose capacity is
equal to the cost of the solution.

Proof: Pick uniformly at random T in [0, 1], then define

A := {s} ∪ {v : yv ≥ T }

This is always a cut, because, by construction, it contains s and it does not contain
t. (Recall that there is no variable yt because there is no conservation constraint for
t.)

6
Then we have X
E capacity(A) = c(u, v) P[u ∈ A ∧ v 6∈ A]
u,v

It remains to argue that, for every edge (u, v), we have

P[u ∈ A ∧ v 6∈ A] ≤ yu,v
For edges of the form (s, v), we have

P[s ∈ A ∧ v 6∈ A] = P[v 6∈ A] = P[yv < T ≤ 1] = 1 − yv ≤ ys,v

(Actually, the above formula applies if 0 ≤ yv < 1. If yv ≥ 1, then the probability


is zero and ys,v ≥ 0 and we are fine; if yv < 0, then the probability is one, and
ys,v ≥ 1 − yv > 1, so we are again fine.)
For edges of the form (u, v) in which u and v are in V − {s, t} we have

P[u ∈ A ∧ v 6∈ A] = P[yv < T ≤ yu ] = yu − yv ≤ yu,v

(Again, we have to look out for various exceptional cases, such as the case yv ≥ yu ,
in which case the probability is zero and yu,v ≥ 0, and the case yv < 0, and the case
yu > 1.)
For edges of the form (v, t), we have

P[v ∈ A ∧ t 6∈ A] = P[v ∈ A] = P[yv ≥ T ] = yv ≤ yv,t

(Same disclaimers.) 

You might also like