0% found this document useful (0 votes)
12 views41 pages

Lecture 3

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)
12 views41 pages

Lecture 3

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/ 41

ISE 632: Network Flows and Combinatorial Optimization

Lecture 3: Total unimodularity and applications

Prof. J. G. Carlsson

Epstein Department of Industrial and Systems Engineering, University of Southern


California
Suggested reading

I B Korte and J Vygen. Combinatorial optimization.


Springer, 2002
Total unimodularity

I We just saw that the linear relaxation of the maximum-weight


matching problem has a {0, 1} solution because all corners of the
feasible region have integer solutions
I We say that the integrality gap (the difference between the LP
and the IP) is zero
I This is a special case of a general property called total
unimodularity :

Definition
A matrix A is said to be totally unimodular (TU) if each
sub-determinant of A is either 0, 1, or −1
I It turns out that an integer matrix A is totally unimodular if and
only if the set {x : Ax ≤ b , x ≥ 0} has integer corners for all
integer vectors b
Proof ( =⇒ )

I Suppose that A ∈ Rm×n is TU and let v be a corner of


{x : Ax ≤ b}
0 0
I Since v is a corner, we can write A v = b for a square submatrix
0 0
A ∈ Rn×n and some entries b
I Cramer’s rule says that
0
det(Ai )
vi =
det(A0 )
0 0 0
where Ai is the matrix where we replace the ith column of A by b
I The numerator is a product of integers and the denominator is ±1
I The other direction is less interesting/useful; see [1]

[1] B Korte and J Vygen. Combinatorial optimization.


Springer, 2002.
Facts about determinants
I det A = det AT
I If A and B have the same (square) size, then
det(AB) = det A det B
 
I det a b = ad − bc
c d
I Exchanging rows (or columns) reverses the sign:
   
a1 a1
 ..   .. 

 .  

 . 

 ai    aj 
..  = − det  .. 
  
det 

 . 

 .  

 aj  

 ai  
 ..   .. 
 .   . 
an an
I A row/column of all zeros implies det A = 0
I A row/column with all zeros except for a single 1 does not change
things:  
1 0
det = det M
a M
Facts about determinants

 
I If A ∈ Rm1 ×n and B ∈ Rm2 ×n are TU, is A
necessarily TU?
B
Facts about determinants

 
I If A ∈ Rm1 ×n and B ∈ Rm2 ×n are TU, is A
necessarily TU?
B
 
I No way! Use e.g. A = 1 −1 and B = 1 1
   
I The set x : A 2
x≤ has (3/2, −1/2) as a corner
B 1
Corollaries

I A is TU ⇐⇒ AT is TU
I A is TU ⇐⇒ (A, I ) is TU
I A is TU ⇐⇒ the corners of {x : Ax ≤ b, x ≥ 0} are always
integers if b is an integer
I A is TU =⇒ the corners of {x : Ax = b, x ≥ 0} are always
integers if b is an integer
I The dual problem of

maximize cT x s.t. Ax ≤ b, x ≥ 0 ,
x

which is
minimize bT y s.t. AT y ≥ c ,
y

is also integral, if b and c are integral


Equivalent condition

An equivalent expression of total unimodularity is:


Theorem
(Ghouila-Houri 1962) An m × n matrix A is totally unimodular if and
only if, for every R ⊆ {1, . . . , m}, there is a partition R = R1 ∪ R2 such
that X X
aij − aij ∈ {−1, 0, 1}
i∈R1 i∈R2

for all j ∈ {1, . . . , n}.


Example The “consecutive ones” property within each column
Consecutive ones example

I We have time periods 1, . . . , m and we need to schedule workers


for these time periods
I Each period i needs di workers
I Workers should only work on consecutive periods because it
would be a pain to leave and come back
I Each shift j looks like

aj = (0, . . . , 0, 1, . . . , 1, 0, . . . , 0)

and there could be many different shifts (say N in total), which we


pay cj for
I Let A be the matrix whose columns are all the entries aj
Consecutive ones example

I The LP is

minimize cT x s.t.
x
Ax ≥ d
x ≥ 0

where xj indicates how many workers are assigned to shift j


I This has the consecutive ones property, thus TU, and the LP is
integral
Example

I The bipartite matching polytope is totally unimodular:


n
X
xij = 1
i=1
Xn
xij = 1
j=1
xij ≥ 0

I This says that the integer program for a bipartite matching


problem is solvable as an LP (we already proved this using
Birkhoff-von Neumann)
Matching polytope

 
1 1 1
 .. .. .. 

 . . ··· . 


 1 1 1 

 1
A= ··· 1 


 1 ··· 1 

 .. 
 . 
1 ··· 1
Example

I The incidence matrix of any directed network is TU


I Recall that the incidence matrix for a directed network with n
vertices v1 , . . . , vn and k edges e1 , . . . , ek is an n × k matrix B
such that bij = 1 if vertex i is the origin of edge j, bij = −1 if
vertex i is the destination of edge j, and bij = 0 otherwise
Example

I The incidence matrix of any directed network is TU


I Recall that the incidence matrix for a directed network with n
vertices v1 , . . . , vn and k edges e1 , . . . , ek is an n × k matrix B
such that bij = 1 if vertex i is the origin of edge j, bij = −1 if
vertex i is the destination of edge j, and bij = 0 otherwise
I Just set R1 = R and R2 = ∅!
Maximum flow

I Given a directed, weighted graph G = (V , E , W ) and a pair of


vertices s and t
I Think of the edge weights wij as the “capacity” of that edge
I What’s the largest amount of “flow” we can send from s to t,
subject to the capacity constraints?
3
3
a b
4
6

s 1 2 7 t
2
6
2 5
c d
2
Maximum flow

I Let xij denote the amount of flow that we send across edge (i, j);
our problem is
X
maximize xsi s.t.
(s,i)∈E
xij ≤ wij
X X
xij = xji ∀i ∈
/ {s, t}
(i,j)∈E (j,i)∈E

xij ≥ 0 ∀ (i, j) ∈ E

I The above polyhedron is TU because it is described by the


incidence matrix of A
I More generally, the set of all single-commodity flows has a TU
matrix
Minimum-cost flow

I Let xij denote the amount of flow that we send across edge (i, j);
our problem is
X
minimize cij xij s.t.
(i,j)∈E
X
xsj = q
j
xij ≤ wij
X X
xij = xji ∀i ∈
/ {s, t}
(i,j)∈E (j,i)∈E

xij ≥ 0 ∀ (i, j) ∈ E

I The above polyhedron is TU because it is described by the


incidence matrix of A
Maximum flow with extra edge

I Let’s add in an extra edge with capacity ∞ from t to s:


3 3
a b a b
4 4
6 6

s 1 2 7 t s 1 2 7 t

6 6
5 5
c d c d
2 2

I Now we just need to maximize the amount of stuff from t to s,


and impose balance constraints everywhere (this makes the
formulation easier)
Maximum flow

maximize xts s.t.


X
X X
xij − xji =0 ∀i ∈ V
j:(i,j)∈E j:(j,i)∈E

xij ≤ wij (i, j) ∈ E


xij ≥ 0 (i, j) ∈ E

Just for fun (to make the dual easier), let’s remove the constraint that
xts ≥ 0 since we’re maximizing xts anyway (so it won’t affect anything)
Maximum flow in matrix form

maximize cT x s.t.
X
Ax = 0
x ≤ w
x ≥ 0 (except xts , for fun)

here A is the incidence matrix of the network and c is all zeros except
for the position corresponding to xts , which has a 1 in it
I The above constraint matrices are TU, thus we have an integral
solution if w is integral
Reminder: primal-dual relationship

Primal minimize cT x maximize bT y Dual


A AT
≥ bi ≥0
constraints ≤ bi ≤0 variables
= bi free
≥0 ≤ cj
variables ≤0 ≥ cj constraints
free = cj
Dual in matrix form

minimize wT z s.t.
y,z
 
 y
AT I ≥ c
z
z ≥ 0

the TU property is preserved


Dual of maximum flow

X
minimize wij zij s.t.
y,z
(i,j)∈E

yi − yj + zij ≥ 0 (i, j) ∈ E \ (t, s)


yt − ys + zts = 1
zij ≥ 0 (i, j) ∈ E
Dual of maximum flow

X
minimize wij zij s.t.
y,z
(i,j)∈E

zij ≥ yj − yi (i, j) ∈ E \ (t, s)


zts = 1 − yt + ys
zij ≥ 0 (i, j) ∈ E

I We can assume WLOG that ys = 0

I Remember that wts = ∞, therefore we should have zts = 0,


whence
0 = 1 − yt + ys = 1 − yt =⇒ yt = 1
Dual of maximum flow

X
minimize wij zij s.t.
y,z
(i,j)∈E

zij ≥ yj − yi (i, j) ∈ E \ (t, s)


zts = 1 − yt + ys
zij ≥ 0 (i, j) ∈ E

I We can assume WLOG that ys = 0


I This is because we can set y 7→ y + c for any constant c and have
the same objective value
I Remember that wts = ∞, therefore we should have zts = 0,
whence
0 = 1 − yt + ys = 1 − yt =⇒ yt = 1
Dual of maximum flow

X
minimize wij zij s.t.
y,z
(i,j)∈E

zij ≥ yj − yi (i, j) ∈ E \ (t, s)


ys = 0
yt = 1
zij ≥ 0 (i, j) ∈ E

I We’d like to have yi ≥ yj for all the edges (i, j) ∈ E , but since
ys = 0 and there are paths from s to t, this can’t always be the
case
Dual of maximum flow

X
minimize wij max{yj − yi , 0} s.t.
y
(i,j)∈E
ys = 0
yt = 1

I We’d like to have yi ≥ yj for all the edges (i, j) ∈ E , but since
ys = 0 and there are paths from s to t, this can’t always be the
case
I Claim that the optimal solution has 0 ≤ yi ≤ 1; why?
Dual of maximum flow

X
minimize wij max{yj − yi , 0} s.t.
y
(i,j)∈E
ys = 0
yt = 1

I We’d like to have yi ≥ yj for all the edges (i, j) ∈ E , but since
ys = 0 and there are paths from s to t, this can’t always be the
case
I Claim that the optimal solution has 0 ≤ yi ≤ 1; why?
I Take any nodes where yi > 1 and set them equal to 1; all this
does is decrease the differences yj − yi (same argument for yi < 0)
Dual of maximum flow

X
minimize wij max{yj − yi , 0} s.t.
y
(i,j)∈E
ys = 0
yt = 1

I We’d like to have yi ≥ yj for all the edges (i, j) ∈ E , but since
ys = 0 and there are paths from s to t, this can’t always be the
case
I Claim that the optimal solution has 0 ≤ yi ≤ 1; why?
I Take any nodes where yi > 1 and set them equal to 1; all this
does is decrease the differences yj − yi (same argument for yi < 0)
I By TU property, there exists optimal y∗ such that yi∗ ∈ {0, 1}
Minimum cut problem

X
minimize wij max{yj − yi , 0} s.t.
y
(i,j)∈E
ys = 0
yt = 1
yi ∈ {0, 1} ∀i ∈ V

I The above problem (which we can solve as an LP) is called the


minimum cut problem
Max-flow min-cut theorem

3
3 3
a b a b
4 4
6 6

s 1 2 7 t s 1 2 7 t
2
6 6
5 2 5
c d c d
2 2

I We want a subset C of vertices that contains s (and doesn’t


contain t) that minimizes the total weight of all the edges that go
from C to V \ C
I The preceding result says that the smallest possible “s − t cut”
has the same objective value as the maximum flow (both are 7 in
the diagram above)
Maximum matching and maximum flow

a v

b w

c x

d y

e z

I To find a maximum bipartite matching, just add s and t to a


bipartite network, orient the edges, and insert new edges from s to
U and W to t with capacity 1
I Maximum flow ⇐⇒ maximum matching
I We could use weights of 1 for the middle edges instead of ∞
Maximum matching and maximum flow

a ∞ v
∞ ∞
1 w
b 1
1 ∞
s 1 c ∞ x 1 t
1 ∞ 1

1 d ∞ y 1

e ∞ z

I To find a maximum bipartite matching, just add s and t to a


bipartite network, orient the edges, and insert new edges from s to
U and W to t with capacity 1
I Maximum flow ⇐⇒ maximum matching
I We could use weights of 1 for the middle edges instead of ∞
Easy proof of Hall’s theorem
a v

b w

c x

d y

e z

I Obviously, if there exists S with |N(S)| < |S|, then no perfect


matching exists (same as before)
I On the other hand, suppose a maximum matching (equivalently, a
maximum flow) has value < n
I Then there is a cut C with value < n as well; we claim that
setting S = C ∩ U is a constricting set
I Say there are k blue nodes in the cut, so (n − k) edges from s to
U are counted
I We have (n − k) + |N(S)| < n =⇒ |N(S)| < k, as desired
Easy proof of Hall’s theorem
a ∞ v
∞ ∞
1 w
b 1
1 ∞
s 1 c ∞ x 1 t
1 ∞ 1

1 d ∞ y 1

e ∞ z

I Obviously, if there exists S with |N(S)| < |S|, then no perfect


matching exists (same as before)
I On the other hand, suppose a maximum matching (equivalently, a
maximum flow) has value < n
I Then there is a cut C with value < n as well; we claim that
setting S = C ∩ U is a constricting set
I Say there are k blue nodes in the cut, so (n − k) edges from s to
U are counted
I We have (n − k) + |N(S)| < n =⇒ |N(S)| < k, as desired
Easy proof of Hall’s theorem
a ∞ v
∞ ∞
1 w
b 1
1 ∞
s 1 c ∞ x 1 t
1 ∞ 1

1 d ∞ y 1

e ∞ z

I Obviously, if there exists S with |N(S)| < |S|, then no perfect


matching exists (same as before)
I On the other hand, suppose a maximum matching (equivalently, a
maximum flow) has value < n
I Then there is a cut C with value < n as well; we claim that
setting S = C ∩ U is a constricting set
I Say there are k blue nodes in the cut, so (n − k) edges from s to
U are counted
I We have (n − k) + |N(S)| < n =⇒ |N(S)| < k, as desired
Menger’s theorem

Theorem
In any directed network with nodes s and t, the maximum number of
edge-disjoint paths from s to t is equal to the minimum number of
edges whose removal separates s from t.
Menger’s theorem

Theorem
In any directed network with nodes s and t, the maximum number of
edge-disjoint paths from s to t is equal to the minimum number of
edges whose removal separates s from t.

Proof.
This is a special case of max-flow min-cut where all edges have weight
1.
Total dual integrality (TDI)

I Total unimodularity is a property of a matrix, not a linear system


I A weaker condition (but still a very strong one!) is total dual
integrality (TDI): consider the primal-dual pairs
maximize c T x s.t. minimize b T y s.t.
(1) (2)
Ax ≤ b AT y = c
y ≥0

Definition
The system Ax ≤ b is totally dual integral (TDI) if for all integer c,
the dual problem (2) has an integral solution y ∗ whenever the optimal
value is finite.

Theorem
If Ax ≤ b is TDI and b is integral, then all the corners of the polytope
{x : Ax ≤ b} are integral.
References I

[1] B Korte and J Vygen.


Combinatorial optimization.
Springer, 2002.

You might also like