Lecture 14
Lecture 14
1 Introduction
At a big conference in Wisconsin in 1948 with many famous economists and mathematicians,
George Dantzig gave a talk related to linear programming. When the talk was over and it
was time for questions, Harold Hotelling raised his hand in objection and said “But we
all know the world is nonlinear,” and then he sat down. John von Neumann replied on
Dantzig’s behalf “The speaker titled his talk ‘linear programming’ and carefully stated his
axioms. If you have an application that satisfies the axioms, well use it. If it does not, then
don’t.” [Dan02]
Figure 1: A cartoon Dantzig’s Stanford colleagues reported as hanging outside his of-
fice [Coo11]
In this lecture, we will see some examples of problems we can solve using linear program-
ming. Some of these problems are expressible as linear programs, and therefore we can use a
polynomial time algorithm to solve them. However, there are also some problems that can-
not be captured by linear programming in a straightforward way, but as we will see, linear
programming is still useful in order to solve them or “approximate” a solution to them.
1
Figure 2: An example of an input to the Max Flow problem
Q
each edge (u, v) ∈ E has a “capacity” cuv ∈ ≥0 . In Figure 2, we can see an example of such
graph. Capacities represent the maximum amount of flow that can pass through an edge.
The objective of the problem is to route as much flow as possible from s to t [Wik13a].
The maximum flow problem was first studied in 1930 by A.N. Tolstoy̌ as a model of
Soviet railway traffic flow [Sch02] (e.g. nodes are cities, edges are railway lines, there is a
cement factory at s, there is a plant that needs cement at t, and capacities represent how
much cement a railway can ship in one day in some units).
For every node v 6∈ {s, t}, the incoming flow to v must be equal to the outgoing flow from
v. This is called flow conservation constraint. Considering this, we can express the problem
as a linear program as follows:
X X
max fsv − fus
f
v:s→v u:u→s
X X
s.t. fuv = fvw , ∀v 6= s, t (flow conservation)
u:u→v w:v→w
2
Figure 3: An optimal solution to the example of Figure 2
X
s.t. xuv = 1, ∀u ∈ U (every person has a job)
u∼v
X
xuv = 1, ∀v ∈ V (every job is assigned to someone)
u∼v
3
LPOP T
objective ILPOP T
{0, 1}n
Figure 4: The dots are integers points of {0, 1}n , and inside the convex polytope are all the
feasible points of the LP
Now suppose that in the above program we drop the integer constraints of the form xuv ∈
{0, 1}, and we replace them with the linear constraints 0 ≤ xuv ≤ 1, ∀{u, v} ∈ E. Then, we
get a linear program (LP), which can solve in polynomial time. This procedure is called a
relaxation of the integer program.
Relaxation Facts:
• If the LP is feasible, then either the ILP is infeasible, or the ILP is feasible and
LPOP T ≥ ILPOP T (in case of a maximization problem).
The above two facts hold because as we can see from the corresponding programs, every
feasible solution to the ILP is a feasible solution to the LP.
The second fact is useful because it gives an upper bound to the optimal solution we are
searching for. Therefore, one approach is to use some heuristic to solve our problem, and
if the objective is close to the other bound, then we know that we are “near” the optimal
solution.
However, in this case, even more is true, which are not true in general for every relaxation.
More specifically, we have the following theorem.
Proof. We will prove the contrapositive, if x e is a feasible, non-integral solution to LP, then it
is not an extreme point, i.e. we can write x e = 12 x+ + 12 x− , for two distinct feasible solutions
x+ and x− .
Since x
e is non-integral, there is some x euv that is non-integral. The sum of the edges
incident to v is 1, therefore there is at least one other edge incident to v that is non-integral,
say {v, z}. Then, look at vertex z. Again there is one other edge incident to z that is non-
integral. This procedure can’t go on forever, therefore at some point we will end up with a
cycle that returns to v.
4
Figure 5: A graph where a greedy algorithm for Vertex Cover can perform very poorly. The
greedy may return all the vertices with degree 1 with total cost 5, but the minimum vertex
cover has cost 2.
The cycle is “non-integral”, therefore ∃ > 0 such that < x euv < 1 − , for every {u, v}
on the cycle. The graph is bipartite, therefore the cycle is even. Add to all odd edges along
the cycle, and − to all even edges. The sum of the edges along the cycle remains the same,
therefore you get a feasible solution x+ . Similarly, if you add to all even edges along the
cycle, and − to all odd edges, you get a feasible solution x− . The solutions x+ and x− are
e = 12 x+ + 21 x− , because when we add something in
distinct, since > 0, and it holds that x
an edge in x+ , we subtract the same thing in x− .
Observation 3.2. At least one of x+ , x− in the proof has objective at least as good as x
e.
Suppose you solve the LP with an LP solver, which gives an optimal solution which is
non-integral (it is not a vertex of the polytope). The proof above gives an algorithm to
convert this solution to an optimal integer solution. Therefore, the theorem implies that the
problem can be solved in polynomial time.
Fact 3.3. The “integrality” property of the theorem holds for any linear program of the form:
max / min c·x
x x
0
s.t. b ≤ M x ≤ b,
` ≤ x ≤ u,
where b0 , b, `, u are integer vectors (possibly ±∞), and M is totally unimodular. A matrix is
called totally unimodular if all of its square submatrices have determinant +1, −1, or 0.
5
The Min Vertex Cover problem is NP-hard. Therefore, we can’t expect to solve it to
optimality using linear programming. However, as before we can express it as an integer
linear program. Let xv be an indicator variable that is 1 if v belongs to the vertex cover,
and 0 otherwise. Then, we can write the problem as follows:
P
min v∈S cv xv
x
s.t. xu + xv ≥ 1, ∀{u, v} ∈ E (every edge is covered)
xv ∈ {0, 1}, ∀v ∈ V .
As before, we can relax this integer program by replacing the constraints xv ∈ {0, 1} with
the constraints 0 ≤ xv ≤ 1, to get a linear program (LP). We know that LPOP T ≤ OP T .
Suppose we solve the LP to optimality, and we get back an optimal LP-feasible solution x∗
(often called “fractional solution”).
LP Rounding is called the procedure that takes an LP-feasible solution and somehow
converts it to an actual ILP-feasible solution with almost as “good quality” as the LP-
feasible solution.
For the1 Vertex Cover problem, say x e is a feasible LP solution. Define S = Sxe =
v:xev ≥ 2 .
Proof. For every edge {u, v} ∈ E, it holds that xu + xv ≥ 1. This means that at least one of
xu and xv is at least 21 , therefore at least one of u and v belongs to S.
6
5 Duality
Suppose you have a linear program of the form:
max c · x
x
s.t. a(1) · x ≤ b1 ,
a(2) · x ≤ b2 ,
......
a(m) · x ≤ bn .
Let λ1 , λ2 , . . . , λm ≥ 0 be numbers such that if you multiply the ith constraint with λi and
you add all the constraints together, you get c · x ≤ β, for some number β. Then, you know
that β is an upper bound to the optimal solution of the linear program. Therefore, you want
to find λi ’s that achieve the minimum possible β. In other words, you want to solve the
following linear program:
m
X
min bi λ i
λ
i=1
s.t. λ1 a11 + λ2 a21 + . . . + λm am1 = c1 ,
λ1 a12 + λ2 a22 + . . . + λm am2 = c2 ,
......
λ1 a1n + λ2 a2n + . . . + λm amn = cn ,
λ1 , λ2 , . . . , λm ≥ 0.
This is called the dual linear program. Farkas Lemma, we’ve seen in the previous lecture,
implies that if the original linear program (the primal ) is feasible, then the dual is feasible,
and the two LP’s have the same value (which may be ±∞).
Rule of Life: If you have an LP, you should take its dual and try to “interpret” it.
To see an example of what this means, let’s go back to the Max Flow problem. If we take
its linear program and clean it up a little bit (e.g. if there is a constraint with something
≤ b and another one with the same thing ≥ b, we convert it to a constraint of the form
something = b), we get the following dual linear program:
X
min cuv λuv
λ,µ
(u,v)∈E
s.t. µs = 1,
µt = 0,
λuv ≥ 0, ∀(u, v) ∈ E
λuv ≥ µu − µv , ∀(u, v) ∈ E,
where the variables λuv correspond to the capacity constraints of the Max Flow, and the
variables µv correspond to the flow conservation constraints.
This dual linear program is the natural LP relaxation of the ILP for the Min (s-t) Cut
problem. In this problem, we want to find a set of vertices S ⊆ V such that s ∈ S and
7
P
t 6∈ S, which minimizes the quantity u∈S,v6∈S cuv . The variables µv are indicator variables
that say if v belongs to S or not, and the variables λuv are indicator variables that say if the
edge (u, v) goes from the set S to the set V \ S or not.
From the observation above, we conclude that
Opt Max s-t Flow = Opt Min fractional s-t Cut ≤ Opt Min s-t Cut.
It turns out that the inequality is actually an equality, which means that the Min Cut
problem is also solvable in polynomial time.
References
[Coo11] William Cook. In Pursuit of the Traveling Salesman: Mathematics at the Limits
of Computation. Princeton University Press, 2011.
[Dan02] George B Dantzig. Linear Programming. Operations Research, pages 42–47, 2002.
[Sch02] Alexander Schrijver. On the history of the transportation and maximum flow
problems. Mathematical Programming, 91(3):437–445, 2002.