You are on page 1of 28

Discrete Optimization: Integrality of Polyhedra

Master Course/Spring 2014/Lecture 8

Xian Qiu
Faculty of Computer Science
Zhejiang University

Email

xianqiu@zju.edu.cn

Outline

1. Blossom Shrinking Algorithm


2. Convex Hulls, Polytopes & Polyhedra
3. Matching Polytopes
4. Total Unimodularity

U Zhejiang University

X.Qiu

2/28

Blossom Shrinking Algorithm

Input: Undirected graph G = (V , E ) and a matching M


Output: Matching N with N = M + 1 or claim M is
maximum
Let W be the set of free nodes.
If no M-alternating W -W walk, then M is maximum.
Now assume P is such a shortest W -W walk

Case 1: P is a path, then augment along P: M MP


Case 2: Else, find M-blossom C and apply the algorithm
(recursively) to G = G /C and M = M/C .
If it gives M -augmenting path P in G , then transform P
to an M-augmenting path in G otherwise M is maximum.

U Zhejiang University

X.Qiu

3/28

Analysis

A shortest M-alternating W -W walk can be found in O(m)


(using BFS)

G /C can be constructed in O(m)

The recursion has depth at most O(n)

Thus each implementation of the algorithm takes O(nm)

Implement the algorithm at most n time. Thus maximum


weight matching can be found in time O(n2 m)

Can be improved to O( nm) (Micali and Vazirani 1980)

U Zhejiang University

X.Qiu

4/28

Example
C

D
C

long alternating path

U Zhejiang University

X.Qiu

5/28

Maximum Weight Matchings

Given G = (V , E ) and a weight function w E R

Find matching M s.t. w (M) = eM w (e) is maximized

The Blossom-Shrinking algorithm can be carried over but with


more efforts (e.g. need deshrinking)

Edmondss breakthrough (1965): Maximum weight matching


can be solved in O(n3 )
Paths, Trees, and Flowers, Canad. J. Math. 17 (1965)

Faster algorithm by Gabow (1990) runs in O(n(n + m log n))

U Zhejiang University

X.Qiu

6/28

Applications

Optimal pairing: Assigning hotel rooms, bus seats, sport


teams of two players, etc.

Merging web servers

Airline time tabling

Chinese postman problem

Designing approximation algorithms: e.g. Christofides


approximation algorithm for TSP

Analyzing chemical structures

U Zhejiang University

X.Qiu

7/28

Integrality of Min-cost Flows


Recall the LP formulation of minimum cost flow problem
min c T x
s.t. Ax = b,

Ex w

x 0,
Its dual LP is
max b T w T
s.t. AT E c
0
Theorem. If b and w are integral, then both LPs have integer
optimal solutions.
U Zhejiang University

X.Qiu

8/28

LPs with No integer Optimal Solutions


Consider the following LP (with integral input)
max x1 + x2 + x3
s.t. x1 + x2 1
x1 + x3 1
x2 + x3 1
x1 , x2 , x3 0

x1

x3
x2

Optimal solution x = (1/2, 1/2, 1/2), objective = 3/2


Integer optimum: x = (1, 0, 0), objective = 1
Question: When has an LP integer solutions? How to derive
min-max relation?

U Zhejiang University

X.Qiu

9/28

Convex Hulls

-1-

Let S = {s1 , . . . , sk } Rn be a finite set.


x Rn is a convex combination of s1 , . . . , sk if there exist
non-negative scalars 1 , . . . , k s.t.
ki=1 i = 1 and x = ki=1 i si
The convex hull of S is the collection of convex combination
of vectors in S

conv-hull(S)

U Zhejiang University

X.Qiu

10/28

Convex Hulls

-2-

Theorem. max {c T x x S} = max {c T x x conv-hull(S)}


Proof. It suffices to show LHS RHS. Let x conv-hull(S). Then
c T x = c T (1 s1 + . . . + k sk )
(1 + . . . + k ) max c T si
i

= max c si
T

= max {c T x x S}

U Zhejiang University

X.Qiu

11/28

Separation Theorem
A hyperplane is given by {x Rn c T x = t}.
Theorem. Let S Rn be finite and let y / conv-hull(S). Then
there is a hyperplane separating y from conv-hull(S), i.e.,
c T x t, x conv-hull(S) and c T y > t.
cT x t
cT y > t
y

conv-hull(S)
U Zhejiang University

X.Qiu

12/28

Farkas Lemma
Farkas Lemma. Consider A Rmn and b Rm . Then
(1) x 0 such that Ax = b or
(2) y such that y T A 0T and y T b < 0 (but not both).
Proof. Assume (1) is true. Then
y T A 0T y T Ax 0T x = 0 y T b 0.
Assume (1) is not true. Consider the primal-dual pair:
P

max 0T x,
s.t. Ax = b,
x 0

min y T b,
s.t. y T A 0

P is in feasible, then D unbounded (as y = 0 is feasible)


Then there exists y with y T b < 0.
U Zhejiang University

X.Qiu

13/28

Geometric Interpretation
A = [a1 a2 . . . an ] (aj = column vector)
cone(A) = {b Rn b = ni=1 xi ai , xi 0}

h
b
a1

a2

a1

a2
b

U Zhejiang University

X.Qiu

14/28

Polytopes & Polyhedra


A polyhedron P Rn is described by a system of linear
inequalities, i.e. P = {x Rn Ax b}
A polyhedron P is a polytope if P is bounded.

supp. hyperplane
P

vertex
P
face

polyhedron

U Zhejiang University

polytope

X.Qiu

15/28

Polytope & Convex Hull


Theorem. A polytope equals the convex hull of its vertices, i.e.
P = {x Rn Ax b} = conv-hull {x 1 , . . . , x k } .

Proposition. x P (polyhedron) is a vertex iff x can not be


written as a convex combination of vectors in P/ {x}.

U Zhejiang University

X.Qiu

16/28

Remarks
The following approach can be used to derive min-max relation for
combinatorial optimization problems.
1. Formulate the com. opt. problem over a finite set S of
feasible solutions.
2. Determine a linear description of conv-huss(S).
3. Apply LP duality to obtain a min-max relation.
Difficulties
1. Not clear how to derive LP description of conv-hull(S).
2. Even it is guaranteed to exist, # ineq. may be exponentially
large.

U Zhejiang University

X.Qiu

17/28

Matching Polytopes

-1-

Given a matching M of G = (V , E ), it can be written as a vector


x M = (xe )eE RE , with xe = 1 if e M and xe = 0 otherwise.
The matching polytope of G is defined as:
Pmatching (G ) = conv-hull {x M M is a matching in G } .
The perfect matching polytope is defined as the convex hull of
all perfect matching vectors (M is perfect if M = V /2).

U Zhejiang University

X.Qiu

18/28

Matching Polytopes

-2-

Theorem. Let G = (V , E ) be a bipartite graph. Then


Pperfect matching (G ) is the set of vectors x RE satisfying
xe = 1, v V ,

ev

xe 0, e E .
Theorem. Pmatching (G ) is the set of vectors x RE satisfying
xe 1, v V ,

ev

xe 0, e E .

U Zhejiang University

X.Qiu

19/28

Proof of the Perfect Matching Polytope


Each perfect matching x P = Pperfect
show all vertices of P are integral.

matching (G ).

It suffices to

By contradiction. Consider the fractional edges


E = {e E 0 < xe < 1} .
As ev xe = 1, then exists a cycle C E.
Let = min {xe1 , xe2 , xe3 , xe4 }.
Let d = (de )eE , with
de1 = de3 = 1, de2 = de4 = 1 (0 else).

xe1
xe4

xe2
xe3

x + = x + d, x = x d. Thus x = (x + + x )/2, a convex


combination of x + and x (contradiction!).

U Zhejiang University

X.Qiu

20/28

Matching & Vertex Cover


max xe
eE

s.t. xe 1, v V
ev

matching

xe {0, 1} .

min yv
v V

s.t. yv 1, e E
v e

vertex cover

U Zhejiang University

yv {0, 1} .

X.Qiu

21/28

Konigs Theorem
Let (G ) be the size of a maximum matching and (G ) be the
size of a minimum vertex cover.
Theorem. For bipartite graph G = (V , E ), one has (G ) = (G ).
Proof. It suffices to show (G ) (G ).
Claim. G has a vertex u covered by each maximum matching.
For G = G u, one has (G ) = (G ) 1.
By induction, assume G has a vertex cover C of size (G ).
Then C {u} is a vertex cover of size (G ) + 1 = (G ).

U Zhejiang University

X.Qiu

22/28

Proof of the Claim


Claim. G has a vertex u covered by each maximum matching.
Proof. Consider any edge (u, v ) E . Assume maximum matchings
M,N miss u and v resp.

Let P be the component of M N


containing u.
P

So P is a path (why?), but not


M-augmenting (as M is maximum).
P has even length, thus P {u, v } is an
N-augmenting path, a contradiction.

v
M
N

U Zhejiang University

X.Qiu

23/28

Integral Polytopes
A polyhedron P = {x Rn Ax b} is integral if every vertex of P
is integral.
LP of the following form has integral optimal solutions if P is
integral.
max c T x
s.t. Ax b.
Thus we can even solve ILP problems by solving LP only.
How to characterize integral polytopes? (Total unimodularity)

U Zhejiang University

X.Qiu

24/28

(Totally) Unimodular Matrices


Definition

An integer square matrix B Znn is unimodular if


det(B) = 1.
An integer matrix A Zmn is totally unimodular (TU) if
each square submatrix B of A has det(B) {0, 1}.

Some easy facts


Entries of a TU matrix are {0, 1}.
If A is TU, multiplying any row/column by 1 the result is
again TU.
If A is TU, adding any row/column unit vector ei the result is
again TU.

U Zhejiang University

X.Qiu

25/28

Integrality of Polytopes
Lemma
Let B Zmm be an invertible matrix and let b Zm . B 1 b is
integral iff det(B) = 1.
Proof. () x = B 1 b. By Cramers rule (Linear Algebra):
xi = det(Ai )/det(B),
where Ai is obtained by replacing i-th column of A by b.
() Assume B 1 b is integral, b Zn .
Then B 1 ei is integral for i = 1, . . . , m, implying B 1 is integral.
det(B) det(B 1 ) = 1 implying det(B) = 1.

U Zhejiang University

X.Qiu

26/28

TU Matrices and Integrality


Define for A Zmn , b Zm ,
P1 (A) = {x Rn Ax = b, x 0} ,
P2 (A) = {x Rn Ax b, x 0} .
We call A is unimodular if every basis of A is unimodular (assume
A is of full rank).

Theorem

P1 (A) is integral for all b Zm if and only if A is unimodular.

P2 (A) is integral for all b Zm if and only if A is TU.

Easy to see: P2 (A) is integral (A I ) is unimodular A is TU.

U Zhejiang University

X.Qiu

27/28

Proof of the Theorem


() Assume P1 (A) is integral for all b Zm . Let B be any basis
of A. We need to show that det(B) = 1.
Equivalent to show B 1 v is integral for all v Zm .
(Lemma)
Let y Zm be s.t. z = y + B 1 v 0 and let
b = Bz = B(y + B 1 v ) = By + v .
( Zm )

Extend z to z Z by adding 0s. We get Az = Bz = b.


Thus z is a vertex of P1 (A) (why?).
So z is integral and thus B 1 v = z y is integral.
() Assume A is unimodular. Let x be a vertex of P1 (A). Then x
satisfies n linearly independent constraints with equality.
m non-zero entries of x correspond to B 1 b (integral), where B is
a basis of A, and other m n entries are 0.

U Zhejiang University

X.Qiu

28/28

You might also like