3 Totally Unimodular Matrices and Their Applications
Total Page:16
File Type:pdf, Size:1020Kb
3 Totally Unimodular Matrices and Their Applications 3.1 Totally Unimodular Matrices and Integer 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 integer programming 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 linear programming 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 matrix A is totally unimodular (TUM) if each subdeterminant of A is −1, 0 or 1. By the definition, all entries of a totally unimodular matrix 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 rank n. (Equivalently P is pointed, namely, has at least one vertex, 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 minor 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 incidence 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 incidence matrix 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 determinant 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 bipartite graph 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 identity matrix. 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 .