<<

3 Totally Unimodular Matrices and Their Applications

3.1 Totally Unimodular Matrices and Polyhedra n The integer hull of a rational polyhedron P = {x ∈ R : Ax ≤ b} is the following set,

n PI := conv(P ∩ Z ). (12)

It can be shown that the integer hull is a polyhedron as well. A polyhedron is called integer if PI = P . Access to PI , say, an H-presentation, allows to solve problems over P , since

n n max{wx : x ∈ Z , Ax ≤ b} = max{wx : x ∈ P ∩ Z } = max{wx : x ∈ PI } (13) and then, by over P on the right-hand side of (13) we can solve the integer programming problem on the left-hand side. We now study a class of matrices for which P = PI and describe several important applications.

Definition 3.1 A A is totally unimodular (TUM) if each subdeterminant of A is −1, 0 or 1.

By the definition, all entries of a totally are −1, 0 or 1 and hence, in particular, TUM matrices are integer. We have the following theorem of Hoffman and Kruskal.

Theorem 3.2 Let A be any totally unimodular matrix. Then for every integer vector b, the polyhedron P = {x : Ax ≤ b} is integer, that is, PI = P .

Proof. Suppose A is an m × n matrix. We assume that A has n. (Equivalently P is pointed, namely, has at least one , so contains no lines; this is the situation in practically any application.) m Consider any integer right-hand side vector b ∈ Z . Then P is integer if and only if every vertex of P is an integer vector. Consider any vertex v of P . By Proposition 2.18 there is a nonsingular n × n submatrix Av of A for which the subsystem Avv = bv is satisfied with equality by v, where bv is the corresponding subvector of b. But then

−1 1 ∗ v = Av bv = Avbv det(Av)

∗ ∗ i+j where Av is the adjoint matrix of Av whose (i, j)-th entry is (−1) times the of Av obtained by deleting its i-th-column and j-th row. Since A is TUM, we have det(Av) = ±1 and so v is integer.

Corollary 3.3 There is a polynomial time algorithm that, given any m, n, totally unimodular matrix m×n m n A ∈ Z , and vectors b ∈ Z and w ∈ Z . solves the following integer programming problem,

n max{wx : x ∈ Z , Ax ≤ b} . (14)

The property of being TUM is preserved under various operations. For instance, if A is TUM then so are AT ,[A, ±I] and [A, ±A]. This implies that other variants of (14) over TUM matrices, such as n n max{wx : x ∈ N , Ax ≤ b} or min{wx : x ∈ N , Ax = b}, are polynomial time solvable as well. Another nice and useful property of totally unimodular matrices will be discussed in Section 4 where we study test sets and Graver bases.

16 3.2 Deciding Total Unimodularity Clearly, deciding if a given matrix is totally unimodular is in co-NP. There are many characteri- zations of totally unimodular matrices, that do not lead to an efficient algorithm for testing total unimodularity. We mention, without proof, the following characterization.

Theorem 3.4 A matrix is totally unimodular if and only if every subset of its columns can be colored red-blue so that the sum of the red columns minus the sum of the blue columns is a (−1, 0, 1)-vector.

However, it turns out that it is possible to test totally unimodularity in polynomial time: this is a consequence of an involved decomposition theorem of Seymour which is beyond our scope here. As we shall see in the next subsection, a very useful subclass of totally unimodular matrices consist of totally unimodular matrices with exactly two non zero entries per column. The following characterization of such matrices leads to a simple efficient algorithm for their recognition.

Theorem 3.5 Let A be a (−1, 0, 1)-matrix with two non zero entries per column. Then A is totally unimodular if and only if its rows can be colored red-blue so that in each column the two non zeros are either of opposite sign and same color or opposite color and same sign.

Exercise 3.6

1. Prove Theorem 3.5 using Theorem 3.4.

2. Describe an efficient algorithm based on Theorem 3.5 for deciding if a given {−1, 0, +1}-matrix with two non zeros per column is TUM. Prove that your algorithm works.

3. Is the following matrix TUM ? Prove your answer.

 0001111000000   0010010001001     0000000000111     1001000100100  .    0000001111000     0100100010010  1110000000000

3.3 Directed Graphs and Bipartite Graphs We now describe two very important classes of totally unimodular matrices, which have very impor- tant consequences for several fundamental discrete optimization problems including transportation problems and transhipment problems (which include network flows as special case). Recall that a digraph is a pair G = (V,E) where V is a finite set of vertices and E ⊆ V × V is a finite set of arcs, which are ordered pairs of elements of V . We write either e = (u, v) or e = uv for an arc e with tail u and head v and may think of e as an arrow pointing from u to v. The matrix A of a digraph G is the V × E vertex-arc matrix with Av,e := 1 if v is the head of e, Av,e := −1 if v is the tail of e, and Av,e := 0 otherwise. We have the following very useful theorem.

Theorem 3.7 The A of any digraph G = (V,E) is totally unimodular.

17 Proof. Let A be the incidence matrix of a digraph G. We prove by induction on m that the determi- nant of any m × m submatrix B of A is 0 or ±1. For m = 1 this trivially holds. Suppose then m ≥ 2. If B has also two nonzero entries per column then the rows of B sum to zero so B is singular and det(B) = 0. Otherwise, there is a column of B containing at most one nonzero entry: evaluating det(B) by Laplace expansion on that column, we see that det(B) is obtained by multiplying the of an (m−1)×(m−1) submatrix of B and hence of A by 0 or ±1, and the claim follows by induction.

Next recall that a graph is a pair G = (V,E) where V is a finite set of vertices and E is a finite set of edges, which are unordered pairs of elements of V . We write either e = {u, v} or e = uv or e = vu for an edge e with vertices u, v. The incidence matrix A of a graph G is the V × E vertex-edge matrix with Av,e := 1 if v ∈ e (that is, v is a vertex of e), and Av,e := 0 otherwise. A graph G = (V,E) is bipartite if its vertex set can be partitioned V = U ] W so that every edge e ∈ E has one vertex in U and one in W . A is often denoted by G = (U, W, E) with the partition U ] W explicitly given. We have the following second useful theorem. Theorem 3.8 The incidence matrix A of any bipartite graph G = (U, W, E) is totally unimodular. Proof. Let A be the incidence matrix of G = (U, W, E). Let A0 be obtained from A by multiplying all rows corresponding to vertices in U by −1. Note that A is totally unimodular if and only A0 is. Let G0 be the digraph obtained from G by orienting every edge e = uw from u ∈ U to w ∈ W . Then A0 is the incidence matrix of G0. It follows from Theorem 3.7 that A0 is totally unimodular, and hence so is A.

3.4 Applications: Transportation Problems and Transshipment Problems 3.4.1 Transportation Problems Consider the following generalized transportation problem with both lower and upper bounds,

X m×n X X min { wi,jxi,j : x ∈ Z , li,j ≤ xi,j ≤ ui,j , xi,j = ri , xi,j = cj } . (15) i,j j i

Let Am.n denote the matrix defining the demand and supply equations. Then Am.n is the incidence matrix of the complete bipartite graph Km,n. For instance, with m = 2 and n = 4 it is given by 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1   1 1 0 0 0 0 0 0 A2,4 =   . 0 0 1 1 0 0 0 0   0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1

Let Inm be the nm × nm . Arrange coordinates of m × n matrices as vectors by

x := (x1,1, . . . , xm,1, . . . , x1,n, . . . , xm,n) and likewise for w = (wi,j), l = (li,j) and u = (ui,j). Put r = (r1, . . . , rm) and c = (c1, . . . , cn). Define  r    Am,n  c    −Am,n −r A :=   , b :=   .  Inm  −c   −Inm  u  −l

18 m×n Then the generalized transportation problem (15) is equivalent to max{wx : x ∈ P ∩ Z } with

m×n X X m×n P := {x ∈ R : li,j ≤ xi,j ≤ ui,j , xi,j = ri , xi,j = cj } = {x ∈ R : Ax ≤ b} . j i

By Theorem 3.8, the matrix A is totally unimodular. Therefore, by Theorem 3.2, the transportation polyhedron P is integer, PI = P . In particular, this proves Theorem 2.23 asserting that the vertices of the Birkhoff polytope of bistochastic matrices are precisely the permutation matrices. Finally, it follows from Corollary 3.3 that the generalized transportation problem (15) can be solved in polynomial time by linear programming over P = PI .

m×n m Theorem 3.9 There is a polynomial time algorithm that given any m, n ∈ N, w, l, u ∈ Z , r ∈ Z , n and c ∈ Z , solves the generalized transportation problem

X m×n X X min { wi,jxi,j : x ∈ Z , li,j ≤ xi,j ≤ ui,j , xi,j = ri , xi,j = cj } . i,j j i

3.4.2 Transshipment and Network Flow Problems The transshipment problem is the following: we are given a digraph G = (V,E), lower and upper bounds le, ue on the capacity of each arc e, demand dv (interpreted as demand if positive and as supply if negative) at each vertex v, and transshipment cost we per transshipment over each arc e. The goal is to find a transshipment, that is, a value xe on each arc e that respects the capacity and demand constraints, which attains minimum cost. For vertex v let δ+(v), δ−(v) ⊆ E be the sets of arcs entering v and leaving v, respectively. The problem can be cast as the following integer program,    X E X X  min wexe : x ∈ Z , le ≤ xe ≤ ue , xe − xe = dv , v ∈ V . (16)  e∈E e∈δ+(v) e∈δ−(v) 

Similarly to the transportation problem discussed above, the transshipment problem can be re-written E as max{wx : x ∈ Z : Ax ≤ b} for suitable matrix A derived from the incidence matrix of the digraph G. It now follows from Theorem 3.7 that this matrix A is totally unimodular. Therefore, by Theorem 3.2, the underlying transshipment polyhedron is again integer. Finally, it follows again from Corollary 3.3 that the transshipment problem can be solved in polynomial time by linear programming.

E Theorem 3.10 There is a polynomial time algorithm that give any digraph G = (V,E), w, l, u ∈ Z , V and d ∈ Z solves the transshipment problem    X E X X  min wexe : x ∈ Z , le ≤ xe ≤ ue , xe − xe = dv , v ∈ V .  e∈E e∈δ+(v) e∈δ−(v) 

19 Exercise 3.11

1. Let G = (V,E) be the so-called tournament of order 5, that is, the digraph with V = {1, 2, 3, 4, 5} and E the set of all non- arcs which we order lexicographically as

E := (12, 13, 14, 15, 21, 23, 24, 25, 31, 32, 34, 35, 41, 42, 43, 45, 51, 52, 53, 54) . (17)

V E Consider the vector d := (−2, 2, 0, 2, −2) ∈ R and the vectors l, u, w ∈ Z , where l := 0 is the zero vector and, using the order of E in (17), u, w are given by

u := 21211111111111111212  .

w := 04011411444411411040  . E Find an optimal solution x ∈ Z to the corresponding transshipment problem using linear programming (say with Matlab).

2. The maximum flow problem is the following: we are given a digraph G = (V,E), two distinct vertices s, t ∈ V , and capacity ue on each arc e. The goal is to find a maximum s − t flow, that is, a nonnegative value xe on each arc e that respects capacity constraints and flow preservation at all vertices other than s, t, and that maximizes the net flow into t. The problem can be cast as the following integer program,    X X E X X  max xe − xe : x ∈ Z , 0 ≤ xe ≤ ue , xe − xe = 0 , v ∈ V \{s, t} . e∈δ+(t) e∈δ−(t) e∈δ+(v) e∈δ−(v) 

(a) Show that the theory of total unimodularity implies again that the underlying polyhedron is integer and hence the problem can be solved in polynomial time by linear programming. (b) Reduce the maximum flow problem to the transshipment problem, that is, describe data for the latter in terms of the data for the former and a way to read off an optimal solution to the former in terms of an optimal solution to the latter.

20