Lecture 15
Lecture 15
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
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
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.
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
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
Fact 6 Given a feasible solution of (4), we can find a feasible cut whose capacity is
equal to the cost of the solution.
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
P[u ∈ A ∧ v 6∈ A] ≤ yu,v
For edges of the form (s, v), we have
(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
(Same disclaimers.)