142 78 645KB
English Pages 34 Year 2020
1
Integer Programming: 2nd Edition Solutions to Certain Exercises in IP Book Chapter 1. Exercises 3, 6–8, 10, 16 Chapter 2. Exercises 1, 3, 7, 9, 11 Chapter 3. Exercises 2, 3, 8, 12, 14, 16 Chapter 4. Exercises 2, 6, 9, 12, 13 Chapter 5. Exercises 4, 5, 8, 11 Chapter 6. Exercises 1, 5, 9, 11, 12 Chapter 7. Exercises 3, 4, 10, 12 Chapter 8. Exercises 2, 4, 6, 8, 12, 17 Chapter 9. Exercises 3, 6, 16, 17 Chapter 10. Exercises 2, 4, 5, 6 Chapter 11. Exercises 1, 3 Chapter 12. Exercises 1, 2, 4 Chapter 13. Exercise 1 Chapter 14. Exercises 1, 3, 5
Solutions to Certain Exercises in Chapter 1 3.
Modeling disjunctions. (i) Extend the formulation of discrete alternatives of Section 1.5 to the union of two bounded polyhedra (polytopes) Pk = {y ∈ Rn ∶ Ak y ≤ bk , 0 ≤ y ≤ u} for k = 1, 2 where maxk maxi {aki y − bki ∶ 0 ≤ y ≤ u} ≤ M.
Integer Programming, Second Edition. Laurence A. Wolsey. © 2021 John Wiley & Sons, Inc. Published 2021 by John Wiley & Sons, Inc. Companion website: www.wiley.com/go/wolsey/integerprogramming2e
2
Integer Programming: 2nd Edition
(ii) Show that an extended formulation for P1 ∪ P2 is the set Q: y = 𝑤1 + 𝑤2 Ak 𝑤k ≤ bk xk 0≤
𝑤k
≤
uxk
x1
+
x2
for k = 1, 2 for k = 1, 2 =1
y ∈ ℝn , 𝑤k ∈ ℝn , xk ∈ {0, 1} for k = 1, 2. Solution: Ak y ≤ bk +M𝟏𝛿k k ∈ [1, 2] 0≤y ≤ u 𝛿 1 + 𝛿2 = 1 k ∈ [1, 2] 𝛿k ∈ {0, 1} (ii) First we show that projy (Q) ⊆ P1 ∪ P2 . If x1 = 1, then 𝑤2 = x2 = 0 leaving (i)
y = 𝑤1 ,
A1 𝑤1 ≤ b1 ,
0 ≤ 𝑤1 ≤ u
and thus y ∈ P1 . Similarly, if x2 = 1, it follows that y ∈ P2 . Conversely, if y ∈ P1 ∪ P2 , suppose wlog that y ∈ P1 . Then (y, 𝑤1 , 𝑤2 , x1 , x2 ) ∈ Q with 𝑤1 = y, 𝑤2 = 0, x1 = 1, x2 = 0. 6.
Prove that the set of feasible solutions to the formulation of the traveling salesman problem in Section 1.3 is precisely the set of incidence vectors of tours. Solution: {
The solutions of the set
∶ x ∈ ℤn(n−1) +
∑ j∶j≠i
xij = 1 i ∈ [1, n],
∑ i∶i≠j
} xij = 1 j ∈ [1, n]
are assignments, namely a set of disjoint cycles, see Figure 1.2. The subtour elimination constraints eliminate any solution consisting of two or more cycles. Thus, the only solutions remaining are the tours. 7.
The QED Company must draw up a production program for the next nine weeks. Jobs last several weeks and once started must be carried out without interruption. During each week, a certain number of skilled workers are required to work full-time on the job. Thus, if job i lasts pi weeks, li,u workers are required in week u for u = 1, … , pi . The total number of workers available in week t is Lt . Typical job data (i, pi , li1 , · · · , lipi ) is shown below.
Integer Programming: 2nd Edition
Job
Length
Week1
Week2
Week3
Week4
1
3
2
3
1
—
2
2
4
5
—
—
3
4
2
4
1
5
4
4
3
4
2
2
5
3
9
2
3
—
(i) Formulate the problem of finding a feasible schedule as an IP. (ii) Formulate when the objective is to minimize the maximum number of workers used during any of the nine weeks. (iii) Job 1 must start at least two weeks before job 3. Formulate. (iv) Job 4 must start not later than one week after job 5. Formulate. (v) Jobs 1 and 2 both need the same machine, and cannot be carried out simultaneously. Formulate. Solution: (i) Let xti = 1 if job i starts in period t. Each job i must start in some period and terminate before the end of the time horizon ∑
9−pi +1
xui = 1 i ∈ [1, 5].
u=1
If job i starts in period u, the number of workers required by job i in period t is 𝓁i,t−u+1 for t ∈ [u, u + pi − 1]. So the bound on the number of workers available in period t gives: t 5 ∑ ∑
𝓁i,t−u+1 xui ≤ Lt t ∈ [1, 9].
i =1 u=t−pi +1
The remaining constraints are xti ∈ {0, 1} and xui = 0 if u > 9 − pi + 1. ∑5 ∑t (ii) Using (i), let 𝜂t = i=1 u=t−pi +1 𝓁i,t−u+1 xui be the number of workers used in period t. Add the constraints 𝜂t ≤ 𝜂 and the objective function min 𝜂. (iii) If job 1 has not started in the first t periods, job 3 cannot start in the first t + 2 periods. t ∑ u=1
xu1 ≥
t+2 ∑ u=1
xu3 t ∈ [1, 7].
3
4
Integer Programming: 2nd Edition
(iv) If job 5 has started in the first t periods, job 4 must have started in the first t + 1 periods. t ∑
xu5 ≤
u=1
t+1 ∑
xu4 t ∈ [1, 8].
u=1
(v) Jobs 1 and 2 cannot both be under way in period t. t ∑ u=t−pi +1
8.
t ∑
xu1 +
xu2 ≤ 1 t ∈ [1, 9].
u=t−p2 +1
Show that the uncapacitated facility location problem of Section 1.5 with a set N = {1, … , n} of depots can be written as the COP { } ∑ min c(S) + fj , S⊆N
j∈S
where c(S) =
∑m i=1
minj∈S cij .
Solution: Suppose (x, y) is an optimal solution and let S = {j ∈ N ∶ xj = 1}. ∑ ∑ Then, j∈S fj = j∈N fj xj . ∑ ∑ Also for fixed i ∈ M, as 0 ≤ yij ≤ xj = 0 for j ∉ S, min{ j∈N cij yij ∶ j∈N yij = ∑ ∑ 1, yi. ∈ ℝn+ } = min{ j∈S cij yij ∶ j∈S yij = 1, yi. ∈ ℝn+ } = minj∈S cij . The result follows. 10.
A set of n jobs must be carried out on a single machine that can do only one job at a time. Each job j takes pj hours to complete. Given job weights 𝑤j for j = 1, … , n, in what order should the jobs be carried out so as to minimize the weighted sum of their start times? Formulate this scheduling problem as a mixed integer program. Solution 1: Let 𝛿ij = 1 if job i precedes job j and let tj be the start-time of job j. min
n ∑
𝑤j tj
j=1
tj ≥
∑
pi 𝛿ij
i∶i≠j
𝛿ij + 𝛿ji = 1 1 ≤ i < j ≤ n 𝛿ij + 𝛿jk + 𝛿ki ≤ 2 ∀i, j, k, i ≠ j ≠ k 𝛿ij ∈ {0, 1} ∀i, j, i ≠ j
(1)
Integer Programming: 2nd Edition
Note that if no other constraints are present, the constraints (1) and the integrality of the 𝛿ij can be dropped. The resulting linear program has optimal 𝑤 𝑤 solutions with 𝛿ij ∈ {0, 1} satisfying (1) in which i precedes j if p i > p j . This i
j
is commonly known as Smith’s rule. Solution 2: (Processing times pj are integer). Let yit = 1 if job i starts in period t. min
n ∑
∑ 𝑤j ( tyjt ) t
j=1
∑
yit = 1 ∀ i
(2)
yju ≤ 1 ∀ t
(3)
t t ∑ ∑ j
u=t−pj +1
y ∈ {0, 1}nT T is the time horizon. The constraint (2) ensures that job i is started and (3) that there is at most one job active at time t. 16.
Frequency Assignment. Frequencies from the range {1, … , 6} must be assigned to 10 stations. For each pair of stations, there is an interference parameter which is the minimum amount by which the frequencies of the two stations must differ. The pairs with nonzero parameter are given below: e = (5, 7) (2, 3) (3, 4) (4, 5) (5, 6) (6, 7) (7, 8) (8, 9) 3 2 4 2 3 1 1 2 e = (9, 10) (1, 8) (2, 10) (3, 10) (5, 10) (7, 10) (2, 5) (5, 9) 3 2 1 1 4 2 2 2 The goal is to minimize the difference between the smallest and largest frequency assigned. Formulate and solve. Solution: Let xi ∈ ℤ ∩ [1, 6] be the value assigned to station i = 1, … , n. Let e = (i, j) with i < j be the station pairs whose frequencies need to be separated by de . Let ze = 0 if the constraint is satisfied with xj − xi ≥ de and ze = 1 if the constraint is satisfied with xi − xj ≥ de . Feasibility IP: xj − xi ≥ de − Mze ∀ e ∈ E xi − xj ≥ de − M(1 − ze ) ∀ e ∈ E 1 ≤ xj ≤ 6 ∀ j x ∈ ℤn , z ∈ {0, 1}|E| .
5
6
Integer Programming: 2nd Edition
Solutions to Certain Exercises in Chapter 2 1.
Find a maximum cardinality matching in the graph of Figure 2.5a by inspection. Give a proof that the solution found is optimal. Solution: Matching M = {(2, 2′ ), (3, 1′ ), (4, 3′ ), (5, 5′ ), (6, 6′ )} and node cover R = {2, 3, 6, 3′ , 5′ } with |M| = |R|.
3.
Find primal and dual bounds for the integer knapsack problem: z = max 42x1 + 26x2 + 35x3 + 71x4 + 53x5 14x1 + 10x2 + 12x3 + 25x4 + 20x5 ≤ 69 x ∈ Z+5 . Solution:
As
c1 a1
>
cj aj
for j > 1, the solution of the linear programming
69 14
relaxation is x1 = = 4 13 giving an upper bound of 69 ⋅ 42 = 207. 14 14 69 A first greedy heuristic solution is x1 = ⌊ 14 ⌋ = 4 giving a lower bound of 168. With x1 = 4, there remain 69 − 56 = 13 units available in the knapsack. This leads to an improved greedy solution of x1 = 4, x3 = 1 of value 203. 7.
Network Formulation of the Integer Knapsack Problem with positive integer coefficients aj > 0 for j ∈ [1, n] and b > 0. Let } { n n ∑ ∑ n cj xj ∶ aj xj ≤ b, x ∈ ℤ+ G(d) = max j=1
j=1
denoted problem P(d). (i) Show that G(d) ≥ G(d − aj ) + cj ∀ aj ≤ d ≤ b and j ∈ [1, n] and G(d) ≥ G(d − 1) ∀ 1 ≤ d ≤ b. (ii) Show that min y(b) y(d) − y(d − aj ) ≥ cj ∀j, d y(d) − y(d − 1) ≥ 0 ∀d y(0) = 0 is a strong dual of the knapsack problem. (iii) Take the dual of this linear program and interpret the variables and constraints of the resulting LP.
Integer Programming: 2nd Edition
Solution: (i) Let x∗ be an optimal solution to problem P(d − aj ) with G(d − aj ) = cx∗ and Ax∗ ≤ d − aj . Then x∗ + ej is feasible in P(d) with value cx∗ + cj . So G(d) ≥ cx∗ + cj = G(d − aj ) + cj . Let x∗ be an optimal solution to problem P(d − 1) with G(d − 1) = cx∗ and Ax∗ ≤ d − 1. Then, x∗ is feasible in P(d) with value cx∗ . So G(d) ≥ G(d − 1). (ii) Take y(d) = G(d) for d ∈ [0, b]. Then, G(b) is both an upper bound on the optimal value and the value of a primal feasible solution. (iii) The dual is ∑ cj xj,d max ∑ j
xj,d −
∑ j
d,j
xj,d+aj + zd − zd+1 = 0 0 ≤ d < b ∑
xj,b + zb = 1
j
xj,d ∈ ℝ1+ , zd ∈ ℝ1+ This is a longest path problem in an acyclic graph with nodes V = {0, 1, … , b}, xj,d = 1 if the arc (d − aj , d) is used and zd = 1 if the arc (d − 1, d) is used. 9.
Suppose that the value function 𝜙(d) = max{cx ∶ Ax ≤ d, x ∈ ℤn+ } is finite valued for all d ∈ ℤm . (i) Show that the value function 𝜙 is superadditive. (ii) Prove the Strong Duality Theorem 2.8. Solution: (i) 𝜙(0) ≥ 0. If 𝜙(0) > 0, 𝜙(d) is unbounded, a contradiction. Thus 𝜙(0) = 0. Suppose that 𝜙(di ) = cxi with Axi ≤ di , xi ∈ ℤn+ for i = 1, 2. Then x1 + x2 satisfies A(x1 + x2 ) ≤ d1 + d2 , x1 + x2 ∈ ℤn+ and has value c(x1 + x2 ). It follows that 𝜙(d1 + d2 ) ≥ c(x1 + x2 ) = 𝜙(d1 ) + 𝜙(d2 ). Showing that 𝜙 is nondecreasing is similar. (ii) 𝜙(b) is a feasible value for both the primal and the dual as 𝜙(aj ) ≥ cj for j ∈ [1, n].
7
8
Integer Programming: 2nd Edition
11.
Fourier–Motzkin elimination. Let Q be the polyhedron a i y + 𝑤 ≤ bi
i ∈ [1, m]
(4)
c y − 𝑤 ≤ dj
j ∈ [1, n]
(5)
j
e y ≤ fk k
(6)
k ∈ [1, K]
y ∈ ℝ ,𝑤 ∈ ℝ . p
1
(7)
Show that P = projy (Q), where P is the polyhedron (ai + cj )y ≤ bi + dj e y ≤ fk k
i ∈ [1, m], j ∈ [1, n]
k ∈ [1, K]
y∈ℝ . p
(8) (9) (10)
Repeating this procedure allows one to project any polyhedron onto a subset of its variables. Note that the number of constraints in the projected polyhedron can increase exponentially. Solution: If y ∈projy (Q), there exists 𝑤 such that (y, 𝑤) ∈ Q. Combining the valid inequalities (4) and (5) gives (8) and thus y ∈ P. So, projy (Q) ⊆ P. Conversely, suppose that y ∈ P. From (8), it follows that cj y − dj ≤ bi − ai y for all i, j and thus maxj [cj y − dj ] ≤ mini [bi − ai y]. Taking 𝑤 such that maxj [cj y − dj ] ≤ 𝑤 ≤ mini [bi − ai y], 𝑤 ≤ bi − ai y for all i and 𝑤 ≥ cj y − dj for all j and thus (y, 𝑤) ∈ Q. So, P ⊆ projy (Q).
Solutions to Certain Exercises in Chapter 3 2.
Prove that the polyhedron P = {(y1 , … , ym , x) ∈ Rm+1 ∶ x ≤ 1, yi ≤ x for + i = 1, … , m} has integer vertices. Solution: The matrix A obtained from the constraints xi − y ≤ 0 i ∈ [1, m] has a +1 and a −1 in each row. So it is transpose of a network matrix. Network matrices are TU by Proposition 3.4. The dual of a network matrix is TU by Proposition 3.1. As the rhs and bound vectors are integers, the vertices of P are integral by Proposition 3.3.
3.
A 0–1 matrix B has the consecutive 1’s property if for any column j, bij = bi′ j = 1 with i < i′ implies blj = 1 for i < l < i′ . A more general sufficient condition for total unimodularity is: Matrix A is TU if (i) aij ∈ {+1, −1, 0} for all i, j.
Integer Programming: 2nd Edition
(ii) For any subset M of the rows, there exists a partition (M1 , M2 ) of M such that each column j satisfies ∑ ∑ ∣ aij − aij ∣≤ 1. i∈M1
i∈M2
Use this to show that a matrix with the consecutive 1’s property is TU. Solution: Take any subset of the rows M. The matrix A∗ obtained by removing the rows not in M still has the consecutive 1’s property. Assign the remaining rows so that odd rows belong to M1 and even rows to M2 . Then for column j, if the first 1 appears in an odd numbered row, ∑ ∑ a − i∈M2 aij ∈ {0, 1} and if the first 1 appears in an even numbered i∈M∑ 1 ij ∑ row, i∈M1 aij − i∈M2 aij ∈ {0, −1}. 8.
Find a minimum weight spanning tree in the graph shown in Figure 3.4a. Solution: The greedy algorithm selects the edges in the following order: edge cost comment e1 = (3, 6) 1 e2 = (2, 3) 2 e3 = (2, 5) 3 e4 = (5, 9) 4 Cycle, Reject e5 = (6, 9) − e6 = (1, 2) 4 e7 = (5, 8) 6 e8 = (3, 7) 6 Cycle. Reject e9 = (1, 6) − e10 = (4, 8) 8 Finish.
12.
Show that the 0–1 covering problem ∑n z = min j=1 fj xj ∑n for i ∈ M j=1 aij xj ≥ bi x ∈ {0, 1}n with aij ≥ 0 for i ∈ M, j ∈ N can be written in the form { } ∑ z = min fj ∶ g(S) = g(N) , j∈S
where g ∶ (N) → R1+ is a nondecreasing set function. (i) What is g? (ii) Show that g is submodular and nondecreasing.
9
10
Integer Programming: 2nd Edition
Solution: ∑ ∑ (i) g(S) = i∈M min( j∈S aij , bi ). (ii) Suppose wlog that |M| = 1. 𝜌j (S) = g(S ∪ j) − g(S). As g is nondecreasing, 𝜌j is nonnegative. Case 1. If g(S ∪ k) ≥ b, 𝜌j (S ∪ k) = 0 ≤ 𝜌j (S). ∑ Case 2. If g(S ∪ k) < b, then 𝜌j (S ∪ k) = min[b − i∈S∪k ai , aj ]. As this ∑ also implies g(S) < b, 𝜌j (S) = min[b − i∈S ai , aj ] ≥ 𝜌j (S ∪ k). The claim follows. 14.
Given a matroid, show that (i) if A and B are independent sets with |A| > |B|, then there exists j ∈ A\B such that B ∪ {j} is independent, and (ii) for an arbitrary set A ⊆ N, every maximal independent set in A has the same cardinality. Solution: (i) Let r be he rank function of the matroid. As A and B are independent, r(A) = |A| and r(B) = |B| and by hypothesis r(A) > r(B). Now suppose there is no j ∈ A\B such that B ∪ {j} is independent. In other words, r(B) = r(B ∪ {j}) for all j ∈ A\B. By Proposition 3.11, ∑ r(A) ≤ r(B) + [r(B ∪ {j}) − r(B)] for all A, B ⊆ N j∈A\B
giving r(A) ≤ r(B) + (ii) follows from (i). 16.
∑
j∈A\B 0
= r(B), a contradiction.
Consider the Steiner tree problem on the graph of Figure 3.5 with terminal nodes 0, 4, 5, 6 and a weight of 1 on all the edges. Show that the LP relaxation of the directed cut formulation (3.15)–(3.17) is not integral by describing a fractional LP solution of smaller value than that of the optimal integer solution. Solution: Observe that all the directed cuts contain at least two arcs. Setting zij = 12 on each downward directed arc provides a feasible solution with xe = 12 on each edge and value 92 . Clearly, the optimal integer solution is 5 as there is no solution using only one of the edges adjacent to node 0 and at least 3 of the other edges are needed.
Integer Programming: 2nd Edition
Solutions to Certain Exercises in Chapter 4 2.
Find a maximum cardinality matching in the bipartite graph of Figure 4.6b. Demonstrate that your solution is optimal. Solution: M = {(1, 9), (2, 8), (3, 7), (6, 11)}. Augmenting path (5, 11), (6, 11), (6, 12). M = {(1, 9), (2, 8), (3, 7), (5, 11), (6, 12)}. R = {2, 3, 6, 9, 11}.
6.
Find a maximum weight matching in the weighted bipartite graph of Figure 4.7. Solution: ⎛3 ⎜ ⎜8 ⎜0 ⎜8 ⎜ ⎜0 ⎜0 ⎝
0 0 2 0 3 0
7 4 0 1 2 0
Adding a node 12 or 6′ , the profit matrix is 0 0 8 0 6 1
0 0 4 0 0 2
0⎞ ⎟ 0⎟ 0⎟ 0⎟⎟ 0⎟ 0⎟⎠
Choosing a dual solution greedily so as to have a reduced cost of zero in each row and column u0 = (7, 8, 8, 8, 6, 2), 𝑣0 = (0, −2, 0, 0, 0, −2) z = 35 M = {(1, 3′ ), (2, 1′ ), (5, 4′ ), (6, 6′ )} V1+ = {2, 3, 4, 5}, V2+ = {1′ , 4′ }, 𝛿 = 1 u1 = (7, 7, 7, 7, 5, 2), 𝑣1 = (1, −2, 0, 1, 0, −2) z = 33 M = {(1, 3′ ), (2, 1′ ), (3, 4′ ), (5, 2′ ), (6, 6′ )} V1+ = {2, 4}, V2+ = {1′ }, 𝛿 = 3 u2 = (7, 4, 7, 4, 5, 2), 𝑣2 = (4, −2, 0, 1, 0, −2) z = 30 M unchanged V1+ = {1, 2, 4}, V2+ = {1′ , 3′ }, 𝛿 = 2 u3 = (5, 2, 7, 2, 5, 2), 𝑣3 = (6, −2, 2, 1, 0, −2) z = 28 M = {(1, 3′ ), (2, 1′ ), (3, 4′ ), (4, 6′ ), (5, 2′ ), (6, 5′ )} Optimal Solution z = 28. 9.
Ten researchers are engaged in a set of ten projects. Let Si denote the researchers working on project i for i = 1, … , 10. To keep track of progress
11
12
Integer Programming: 2nd Edition
or problems, management wishes to designate one person working on each project to report at their weekly meeting. Ideally, no person should be asked to report on more than one project. Is this possible or not, when S1 = {3, 7, 8, 10}, S2 = {4, 8}, S3 = {2, 5, 7}, S4 = {1, 2, 7, 9}, S5 = {2, 5, 7}, S6 = {1, 4, 5, 7}, S7 = {2, 7}, S8 = {1, 6, 7, 10}, S9 = {2, 5}, S10 = {1, 2, 3, 6, 7, 8, 10}? Solution: This is known as a Systems of Discrete Representatives. Solve a maximum cardinality or max flow problem. Bipartite graph G with V1 = V2 = {1, … , n}. (ij) ∈ E if j ∈ Si . ∑ max xij ∑
(ij)∈E
xij ≤ 1 i = 1, … , n
j∶(ij)∈E
∑
xij ≤ 1 j = 1, … , n
i∶(ij)∈E
xij ∈ {0, 1} (ij) ∈ E. A primal solution: (1,10), (2,4), (3,2) (4,9) (6,1) (7,7) (8,6) (9,5) (10,8). A dual solution: ui = 1 for i ∈ {1, 2, 4, 6, 8, 10}, 𝑣j = 1 for j ∈ {2, 5, 7}. Flow = 9. There is no such system. There are only three researchers(𝑣j = 1) available to represent the four projects (ui = 0). 12.
Show that the convex hull of perfect matchings in a graph on an even number of nodes is described by the degree constraints (4.1), the nonnegativity constraints (4.2) and the inequalities ∑ xe ≥ 1 for S odd, |S| ≥ 3. e∈𝛿(S)
Solution: Let P′ denote the above polytope. From Theorem 4.2, we obtain ∑ the perfect matching polytope F by adding the valid inequality e∈E xe ≤ |V| 2 ∑ as an equality. This in turn implies that e∈𝛿(i) xe = 1 for i ∈ V. Now observe that the inequalities of P′ are clearly satisfied by the perfect matchings and thus F ⊆ P′ . It remains to show that P′ ⊆ F. ∑ ∑ Summing the degree constraints over an odd set S gives i∈S e∈𝛿(i) xe = |S|, ∑ ∑ ∑ or 2 e∈E(S) xe + e∈𝛿(S,V\S) xe = |S|. Subtracting e∈𝛿(S,V\S) xe ≥ 1 and dividing ∑ by 2 gives e∈E(S) xe ≤ |S|−1 for S odd. As the degree and nonnegativity con2 straints are the same in P′ and F, the claim follows. 13.
(i) For their annual Christmas party the thirty members of staff of the thriving company Ipopt were invited/obliged to dine together and then spend the night in a fancy hotel. The boss’s secretary had the
Integer Programming: 2nd Edition
unenviable task of allocating the staff two to a room. Knowing the likes and dislikes of everyone, he drew up a list of all the compatible pairs. How could you help her to fill all fifteen rooms? (ii) Recently a summer camp was organized for an equal number of English and French children. After a few days, the children had to participate in an orienteering competition in pairs, each pair made up of one French and one English child. To allocate the pairs, each potential pair was asked to give a weight from 1 to 10 representing their willingness to form a pair. Formulate the problem of choosing the pairs so as to maximize the sum of the weights. (iii) If you have a linear programming code available, can you help either the boss’s secretary or the camp organizer or both? Solution: (i) Construct a graph with one node per person. Add an edge if staff members i and j are compatible. The problem is then to find a perfect matching with 15 edges. (ii) Construct a bipartite graph with nodes V1 for the English children and V2 for the French with |V1 | = |V2 |. Assign weights to each pait (i, j) with i ∈ V1 , j ∈ V2 . The problem is to find a maximum weight assignment/matching in the bipartite graph. (iii) As we have seen, a maximum weight assignment can be found by linear programming. On the other hand, there is no small LP guaranteeing a solution to the perfect matching problem in an arbitrary graph. There is however an efficient algorithm. See discussion in Section 4.4.
Solutions to Certain Exercises in Chapter 5 4.
Formulate the optimal subtree of a tree problem as an integer program. Is this IP easy to solve? Solution: Let r be the root of the tree and let p(𝑣) denote the predecessor of 𝑣 on the path from 𝑣 to the root. Let x𝑣 = 1 if node 𝑣 is part of the subtree. Consider the formulation max c𝑣 x𝑣 𝑣∈V
xr ≤ 1
x𝑣 − xp(𝑣) ≤ 0 𝑣 ∈ V\{r} x ∈ ℝ|V| + Note that the constraint matrix is the dual of a network matrix. So it is TU. As the rhs vector is integer, the extreme points are integral.
13
14
Integer Programming: 2nd Edition
5.
Given a digraph D = (V, A), travel times cij for (i, j) ∈ A for traversing the arcs, and earliest passage times rj for j ∈ V, consider the problem of minimizing the time required to go from node 1 to node n. (i) Describe a dynamic programming recursion. (ii) Formulate as a mixed integer program. Is this mixed integer program easy to solve? Solution: (i) Let G(j) be the earliest passage time at node j. Consider the recursion G(j) ≥ max(rj , min (G(i) + cij )) i∈V\{j}
with initialization G(1) = r1 . (ii) One possible formulation. Let tj be the passage time at node j and xij = 1 if arc (i, j) lies on the path. mintn tj − ti ≥ cij xij − M(1 − xij ) i, j ∈ V, i ≠ j tj ≥ rj j ∈ V x ∈ {0, 1}|A| . Because of the big M in the formulation, the linear programming relaxation will be weak. 8.
Solve the problem 1
max x13 + 2x22 + 4x3 + 4x4 2x12 + 4x2 + 6x3 + 5x4 ≤ t x1 ≤ 3, x2 ≤ 2, x4 ≤ 1 x ∈ ℤ4+ for t ≤ 12. (Hint. One of the recursions in the chapter is easily adapted.) Solution:
The problem is of the form
fr (𝜆) = max
n ∑
cj (xj )
j=1 n ∑
aj (xj ) ≤ 𝜆
j=1
xj ∈ [0, hj ] ∩ ℤ j ∈ [1, n]
Integer Programming: 2nd Edition
Use the recursion fr (𝜆) =
11.
max (fr−1 (𝜆 − ar (xr )) + cr (xr )).
xr ∈[0,hr ]∩ℤ
Given a tree T and a list of T1 , … , Tm of subtrees of T with weights c(Ti ) for i = 1, … , m, describe an algorithm to find a maximum weight packing of node disjoint subtrees. Solution: Arbitrarily root the tree, so that each subtree is now rooted. Let S(𝑣) be the successor nodes of 𝑣 in T and Σ(R) the successor nodes of tree R. Let Ω𝑣 be the subtrees in the set that are rooted at node 𝑣 and G(𝑣) be the value of an optimal packing of the subtrees completely lying in the subtree of T rooted at 𝑣. Then, an optimal solution of value G(𝑣) either does not cover node 𝑣 or it is covered by a tree R in Ω𝑣 . ( ) ∑ ∑ G(𝑣) = max max[c(R) + G(u), G(u) . R∈Ω𝑣
u∈S(R)
u∈S(𝑣)
Solutions to Certain Exercises in Chapter 6 1.
The 2-PARTITION problem is specified by n positive integers (a1 , … , an ). ∑ The problem is to find a subset S ⊂ N = {1, … , n} such that j∈S aj = ∑ j∈N\S aj , or prove that it is impossible. Show that 2-PARTITION is polynomially reducible to 0–1 KNAPSACK. Does this imply that 2-PARTITION is NP-complete? Solution: 2-PARTITION is a special case of 0–1 KNAPSACK, so 2-PARTITION is polynomially reducible to 0–1 KNAPSACK. The fact that 0–1 KNAPSACK ∈ tells us nothing about the complexity of 2-PARTITION.
5.
Show that SET COVERING is polynomially reducible to UFL. Solution:
Writing SET-COVERING as the problem
min{cx ∶ Ax ≥ 1, x ∈ ℤn+ } with A an m by n 0–1 matrix and UFL as the problem { } ∑ mn n yij = 1 for ∀ i, yij ≤ xj ∀i, j, y ∈ [0, 1] , x ∈ {0, 1} min cx + dy ∶ . j
15
16
Integer Programming: 2nd Edition
Take dij = M(1 − aij ). Then, a solution of UFL will have yij = 0 whenever aij = 0 because of the large penalty and also satisfy Ax ≥ 𝟏 by combining ∑ j yij = 1 for = 1 with yij ≤ xj . Conversely, if x∗ is optimal in SET-COVERING, then the solution (x∗ , y∗ ) is feasible in UFL by taking yi,ji = 1 where ji = min{j ∶ xj = 1, aij = 1} and has the same cost. 9.
∑ Consider a 0–1 knapsack set X = {x ∈ {0, 1}n ∶ j∈N aj xj ≤ b} with 0 ≤ aj ≤ b for j ∈ N and let {xt }Tt=1 be the points of X. With it, associate the bounded polyhedron Π1 = {𝜋 ∈ ℝn+ ∶ xt 𝜋 ≤ 1 for t = 1, … , T} with extreme points {𝜋 s }Ss=1 . Consider a point x∗ with 0 ≤ xj∗ ≤ 1 for j ∈ N. ∑T ∑T (i) Show that x∗ ∈ conv(X) if and only if min{ t=1 𝜆t ∶ x∗ ≤ t=1 xt 𝜆t , 𝜆 ∈ T ∗ 1 ℝ+ } = max{x 𝜋 ∶ 𝜋 ∈ Π } ≤ 1. (ii) Deduce that if x∗ ∉ conv(X), then for some s = 1, … , S, 𝜋 s x∗ > 1. Solution: ∑T 𝜆∗t xt{with t=1 𝜆∗t = 1, 𝜆∗ ∈ ℝT+ . } ∑ T ∗ ≤ ∑T 𝜆 x t , 𝜆 ∈ ℝT 𝜆 ∶ x So 𝜆∗ is feasible in the LP Z = min + t=1 t t=1 t with objective value 1 and {∑so Z ≤ 1. } ∑T T T ∗ t ̂ Conversely if Z = min t=1 𝜆t ∶ x ≤ t=1 𝜆t x , 𝜆 ∈ ℝ+ ≤ 1, let 𝜆 be ∑ T ̂ t 𝜆t x + (1 − Z)𝟎 ∈ conv(X). an optimal solution. The x∗ =
(i) If x∗ ∈ conv(X), then x∗ =
∑T
t=1
t=1
Just take the LP dual. (ii) Follows from if and only if. 11.
∑ ∑ Consider the 0–1 knapsack problem: Z = max{ j∈N cj xj ∶ j∈N aj xj ≤ b, x ∈ n {0, 1} } with 0 < aj ≤ b for j ∈ N. Consider a greedy heuristic that chooses the better of the integer round down of the linear programming solution, and the best solution in which just one variable xk = 1 where ck = maxj cj . Show that zG ≥ 12 z. Solution:
Suppose that the items are ordered so that
c1 a1
cn . The an ∑ b− r−1 j=1 aj
≥···≥
linear programming solution is then x1 = … = xr−1 = 1, xr =
aj
for
some r with value Z LP . The greedy solution is x1 = … = xr−1 = 1. Otherwise set xr = 1. ( r−1 ) ( r−1 ) ) ( r−1 ∑ ∑ 1 1 ∑ 1 G Z = max cj , cr ≥ max cj , cr ≥ cj + cr ≥ Z LP ≥ Z 2 2 2 j=1 j=1 j=1 as required.
Integer Programming: 2nd Edition
12.
Consider the problem of finding a maximum cardinality matching from Chapter 4. A matching M ⊆ E is maximal if M ∪ {f } is not a matching for any f ∈ E\M. Let Z be the size of a maximum matching. Show that |M| ≥ 12 Z for any maximal matching M. ∑ Solution: Consider the dual linear program: zLP = min{ i ui ∶ ui + uj ≥ 1 for (i, j) ∈ E, u ∈ ℝ|V| + }. Consider a maximal matching M. Set ui = 1 if node i is incident to M. We claim that u is dual feasible. If not, there is some edge (i, j) with ui + uj < 1. This implies that neither node i nor node j touches M ∑ and thus M is not maximal. Now i∈V ui = 2|M| ≥ Z LP ≥ Z.
Solutions to Certain Exercises in Chapter 7 3.
Consider the 0–1 knapsack problem: } { n n ∑ ∑ n max cj xj ∶ aj xj ≤ b, x ∈ {0, 1} j=1
j=1
with aj , cj > 0 for j = 1, … , n. ∑r−1 ∑r c c (i) Show that if a1 ≥ · · · ≥ an > 0, j=1 aj ≤ b and j=1 aj > b, the solution 1 n ( ∑r−1 ) of the LP relaxation is xj = 1 for j = 1, … , r − 1, xr = b − j=1 aj ∕ar , and xj = 0 for j > r. (ii) Solve the instance max 17x1 + 10x2 + 25x3 + 17x4 5x1 + 3x2 + 8x3 + 7x4 ≤ 12 x ∈ {0, 1}4 by branch-and-bound. Solution: ∑r−1 (i) Let xj = 1 − xj . The constraint can now be rewritten as ar xr − j=1 aj xj + ∑n ∑r−1 j=r+1 aj xj = b − j=1 aj and the objective function as ∑r−1 ∑n ∑r−1 max cr xr − j=1 cj xj + j=r+1 cj xj + j=1 cj ∑r−1 Substituting for xr in the objective function gives max j=1 cj + ∑r−1 aj b− ∑r−1 ∑n a a cr aj=1 + j=1 (cj − cr a j )xj − j=r+1 (cj − cr a j )xj . As all the reduced r
r
r
costs are nonpositive, the solution with xr basic and values xr = xj = 1 for j = 1, … , r − 1 is optimal.
∑ b− r−1 j=1 aj ar
,
17
18
Integer Programming: 2nd Edition
(ii) Let b′ be the amount remaining from b when fixing and lower bounds on variables are taken into account. At any node, if aj > b′ , we set xj = 0, c c Note that a1 > · · · > a4 . 1
4
Node 1. LP solution x = (1, 1, 0.5, 0), ZLP = 39.5 Branch on x3 . Create nodes 2 and 3 with x3 = 0 and x3 = 1, respectively. Node 2. x3 = 0. LP solution x = (1, 1, 0, 47 ), ZLP = 36 57 Branch on x4 . Create nodes 4 and 5 with x4 = 0 and x4 = 1, respectively. Node 4. LP solution x = (1, 1, 0, 0), ZLP = 27. New incumbent Z = 27. Prune by optimality. Node 5. x4 = 1 implies remaining b′ = 5, so x3 = 0. LP solution x = (1, 0, 0, 1), ZLP = 34. New incumbent Z = 34. Prune by optimality. Node 3. x3 = 1 implies x1 = x4 = 0. LP Solution x = (0, 1, 1, 0), ZLP = 35. New incumbent Z = 35. Prune by optimality. All nodes have been pruned. 4.
Solve the integer knapsack problem: max 10x1 + 12x2 + 7x3 + 2x4 4x1 + 5x2 + 3x3 + 1x4 ≤ 10 x1 , x2 ∈ Z+1 , x3 , x4 ∈ {0, 1} by branch-and-bound. ′
At any node, we set xj ≤ ⌊ ba ⌋.
Solution: c
c
j
Note that a1 > · · · > a4 . 1 4 This gives x1 ≤ 2 and x2 ≤ 2. Node 1. LP solution x = (2, 25 , 0, 0), ZLP = 24.8. As the objective function value must be integer. Z ≤ ⌊24.8⌋ = 24. Branch on x2 . Create nodes 2 and 3 with x2 = 0 and x2 ≥ 1, respectively. Node 3. x2 ≥ 1 implies b′ = 5 and thus x1 ≤ 1 LP solution x = (1, 65 , 0, 0), ZLP = 24.4. Branch on x2 . Create nodes 4 and 5 with x2 ≤ 1 and x2 ≥ 2, respectively. Node 5. As x2 = 2, b′ = 0 and thus x1 = x3 = x4 = 0.
Integer Programming: 2nd Edition
LP solution x = (0, 2, 0, 0), ZLP = 24. New incumbent. Z = 24. As lower and upper bounds on Z are equal, the incumbent is optimal. 10.
Prove Proposition 7.6 concerning 0–1 preprocessing. Solution: (i) (ii) (iii) (iv)
X = ∅ if and only if b < 0. ∑n The constraint is redundant if and only if j=1 aj ≤ b. xj = 0 if and only if aj > b. xi + xj ≤ 1 is valid if and only if ai + aj > b. X = {x ∈ {0, 1}5 ∶ x1 + 3x2 − 5x3 + x4 + 5x5 ≤ 0}. Let xj = 1 − xj . The constraint can be rewritten as x1 + 3x2 + 5x3 + x4 + 5x5 ≤ 5. From (iv), we have that xi + x5 ≤ 1 whenever i ∈ {1, 2, 4} and xi + x3 ≤ 1 (or xi ≤ x3 ) for i ∈ {1, 2, 4, 5}.
12.
Suppose that Pi = {x ∈ ℝn ∶ Ai x ≤ bi } for i = 1, … , m and that Ck ⊆ {1, … , m} for k = 1, … , K. A disjunctive program is a problem of the form max{cx ∶ x ∈ ∪i∈Ck Pi for k = 1, … , K}. Show how the following can be modeled as disjunctive programs: (i) A 0–1 integer program. (ii) A linear complementarity problem: 𝑤 = q + Mz, 𝑤, z ∈ ℝm + , 𝑤j z j = 0 for j = 1, … , m. (iii) A single machine sequencing problem with job processing times pj , and variables tj representing the start time of job j for j = 1, … , n. (iv) The nonlinear expression z ≥ min{3x1 + 2x2 − 3, 9x1 − 4x2 + 6}. (v) The constraint: if x ∈ ℝ1+ is positive, then x lies between 20 and 50, and is a multiple of 5. Solution: (i) 0–1 IP. X ⊆ {0, 1}n . ∪S⊆N PS where PS = {x ∈ X ∶ x = xS }. m (ii) C = {(𝑤, z) ∈ ℝm + × ℝ+ ∶ 𝑤 = q + Mz}. ∪S⊆{1,…,m} PS where PS = {(𝑤, z) ∈ C ∶ 𝑤i = 0 for i ∈ S, zi = 0 for i ∈ {1, … , m}\S}.
19
20
Integer Programming: 2nd Edition
(iii) A permutation 𝜋 ∶ {1, … , n} gives the ordering of the jobs. 𝜋(1) precedes 𝜋(2), etc. ∪𝜋 P𝜋 where P𝜋 = {t ∈ ℝn+ ∶ t𝜋(i+1) ≥ t𝜋(i) + p𝜋(i) for i = 1, … , n − 1}. (iv) . (v) .
{(x, z) ∶ z ≥ 3x1 + 2x2 − 3} ∪ {(x, z) ∶ z ≥ 9x1 − 4x2 + 6}. {x ∶ x = 0} ∪
10 ⋃ {(x, k) ∶ x = 5k}. k=4
Solutions to Certain Exercises in Chapter 8 2.
In each of the examples below, a set X and a point x or (x, y) are given. Find a valid inequality for X cutting off the point. (i) .
X = {(x, y) ∈ {0, 1} × ℝ2+ ∶ y1 + y2 ≤ 2x, yj ≤ 1 for j = 1, 2} (x, y1 , y2 ) = (0.5, 1, 0)
(ii) .
X = {(x, y) ∈ ℤ1+ × ℝ1+ ∶ y ≤ 9, y ≤ 4x} ( (x, y) =
(iii) .
) 9 ,9 4
X = {(x, y1 , y2 ) ∈ ℤ1+ × ℝ2+ ∶ y1 + y2 ≤ 25, y1 + y2 ≤ 8x} (x, y1 , y2 ) =
(iv) .
(
25 , 20, 5 8
)
X = {x ∈ ℤ5+ ∶ 9x1 + 12x2 + 8x3 + 17x4 + 13x5 ≥ 50} ( ) 25 x = 0, , 0, 0, 0 6
(v) .
X = {x ∈ ℤ4+ ∶ 4x1 + 8x2 + 7x3 + 5x4 ≤ 33} ( ) 33 x = 0, 0, , 0 . 7
Solution: (i) y1 ≤ x. Violation 0.5 (ii) y ≤ 9 − 1(3 − x) (iii) y1 + y2 ≤ 25 − 1(4 − x)
Integer Programming: 2nd Edition 9 8 (iv) Gomory fractional cut ⌈ 12 ⌉x1 + ⌈ 12 ⌉x + ⌈ 12 ⌉x3 + ⌈ 17 ⌉x + ⌈ 13 ⌉x ≥ 12 2 12 4 12 5 50 ⌈ 12 ⌉ = 4. (v) Gomory fractional cut 0x1 + x2 + x3 + 0x4 ≤ ⌊ 33 ⌋ = 4. 7
4.
Consider the problem min x1 + 2x2 x1 + x2 ≥ 4 x1 + 5x2 ≥ 5 x ∈ ℤ2+ . , 1 ) is the optimal linear programming solution. (i) Show that x∗ = ( 15 4 4 (ii) Generate Gomory mixed integer cuts from the 2 rows of the optimal LP tableau taking the slack variables to be continuous variables. (iii) Observing that the slack variables are integer, generate the Gomory fractional cuts and compare. (iv) Solve the instance. Solution:
Optimal LP tableau:
min 17 4 x1 x2
+ 34 x3
+ 14 x4
− 54 x3
+ 14 x4
=
+ 14 x3
− 14 x4
=
15 4 1 4
x1 , x2 ∈ ℤ1+ , x3 , x4 ∈ ℝ1+ Gomory mixed integer cuts row 1: row 2:
15 x + 14 x4 ≥ 34 4 3 1 x + 34 x4 ≥ 14 4 3
Gomory fractional (all-integer) cuts row 1: 34 x3 + 14 x4 ≥ row 2: 14 x3 + 34 x4 ≥
3 4 1 4
Adding the Gomory fractional cut from row 1 and using the dual simplex algorithm gives an optimal solution x1 = 3, x2 = 1, x3 = 0, x4 = 3. 6.
Solve max{5x1 + 9x2 + 23x3 − 4y ∶ 2x1 + 3x2 + 9x3 ≤ 32 + y, x ∈ ℤ3+ , y ∈ ℝ1+ } using MIR inequalities. , 0), y = 0. LP solution x = (0, 32 3 ⌊ ⌋ y 32 x2 + 3x3 ≤ + ( ) = 10 + 1y. 3 3 1− 2
Solution:
3
Then x = (1, 10, 0), y = 0
21
22
Integer Programming: 2nd Edition
8.
Consider the stable set problem. An odd hole is a cycle with an odd number of nodes and no edges between nonadjacent nodes of the cycle. Let xj = 1 if j lies in the stable set. Show that if H is the node set of an odd hole, ∑ xj ≤ (∣ H ∣ −1)∕2 j∈H
is a valid inequality. Solution: Let h (odd) be the number of nodes. One has the inequalities x1 + x2 ≤ 1, x2 + x3 ≤ 1, · · · , xh + x1 ≤ 1. Summing and dividing by 2 gives the valid inequality x1 + x2 + · · · + xh ≤ h2 .
Chvatal–Gomory rounding gives x1 + x2 + · · · + xh ≤ ⌊ h2 ⌋ = 12.
|H|−1 . 2
Prove Proposition 8.10. Solution: Let Q = {x ∶ x = y1 + y2 , Ai yi ≤ bi zi , yi ≤ uzi i = 1, 2, z1 + z2 = i 1, z1 , z2 ≥ 0}. Suppose (x, y, z) ∈ Q with 0 < zi < 1. Set xi = yzi . then x = z1 x1 + z2 x2 with z1 + z2 = 1, z1 , z2 ≥ 0 with xi ∈ Pi as Ai xi ≤ bi and xi ≤ u for i = 1, 2. So x ∈ conv(P1 ∪ P2 ). When z1 = 1 or 0, it follows directly that x ∈ P1 , P2 , respectively. The other direction is simple.
17.
An Extended Formulation. Given the 0–1 integer program with X = {x ∈ {0, 1}n ∶ Ax ≤ b}. For simplicity take m = 1. (i) Choose some variable xk and show that the nonlinear inequalities n ∑
aj xj xk ≤ bxk and
j=1
n ∑
aj xj (1 − xk ) ≤ b(1 − xk )
j=1
are valid for X. (ii) Show that xk2 = xk is valid for X. (iii) Introduce additional variables yik = xi xk for all i ≠ k. Show that Qk is a valid relaxation for X: ∑ aj yjk + ak xk ≤ bxk ∑ j
j≠k
aj −
∑
aj yjk − ak xk ≤ b(1 − xk )
j≠k
x ∈ [0, 1] , y⋅k ∈ n
yik ≤ xk
for i ≠ k
yik ≤ xi
for i ≠ k
yik n−1 ℝ+ .
≥ xi + xk − 1 for i ≠ k
Integer Programming: 2nd Edition
(iv) Observe a certain resemblance to the formulation in Proposition 8.10. (v) Repeat the reformulation for all variables xj and set yij = yji for all i ≠ j. (vi) Repeat with pairs of variables, multiplying by xj xk , xj (1 − xk ), (1 − xj )xk , and (1 − xj )(1 − xk ) and introducing variables yijk , etc. Solution: ∑ ∑ (i) As j aj xj ≤ b is a valid inequality and xk ≥ 0, j aj xj xk ≤ bxk is a VI. ∑ Similarly as (1 − xk ) ≥ 0 j aj xj (1 − xk ) ≤ b(1 − xk ) is a VI. (ii) xk2 = xk for xk ∈ {0, 1}. (iii) If yik = xi xk with xi , xk ∈ {0, 1}, then yik ≤ xi , yik ≤ xk and yik ≥ xi + xk − 1, yik ≥ 0 are VIs. Conversely, if yik ≤ xi , yik ≤ xk and yik ≥ xi + xk − 1, yik ≥ 0 one can check: If x = (0, 0), then 0 ≤ yik ≤ xi = 0, so yik = 0. Correct. If x = (1, 1), then 1 = xi ≥ yik ≥ xi + xk − 1 = 1, so yik = 1. Correct. The two other cases are similar.
Solutions to Certain Exercises in Chapter 9 3.
In each of the examples below, a set X and a point x∗ are given. Find a valid inequality for X cutting off x∗ . (i) . X = {x ∈ {0, 1}5 ∶ 9x1 + 8x2 + 6x3 + 6x4 + 5x5 ≤ 14}
(ii) .
) ( 5 3 3 x = 0, , , , 0 , 8 4 4 X = {x ∈ {0, 1}5 ∶ 9x1 + 8x2 + 6x3 + 6x4 + 5x5 ≤ 14}
(iii) .
) 1 1 3 3 , , , ,0 , 4 8 4 4 X = {x ∈ {0, 1}5 ∶ 7x1 + 6x2 + 6x3 + 4x4 + 3x5 ≤ 14}
(iv) .
) 1 1 1 , 1, , , 1 , 7 2 4 X = {x ∈ {0, 1}5 ∶ 12x1 − 9x2 + 8x3 + 6x4 − 3x5 ≤ 2}
(
x=
(
x=
) ( 1 1 x = 0, 0, , , 1 . 2 6 Solution: (i) x2 + x3 + x4 ≤ 2. (ii) 2x1 + 2x2 + x3 + x4 ≤ 2.
23
24
Integer Programming: 2nd Edition
(iii) (x1 ) + x2 + x3 + x5 ≤ 2 (iv) Complementing gives 12z1 + 9z2 + 8z3 + 6z4 + 3z5 ≤ 14 with z∗ = (0, 1, 12 , 16 , 0). z2 + z3 ≤ 1 is violated. In terms of the x-variables, x3 ≤ x2 . 6.
In each of the examples below, a set X and a point (x∗ , y∗ ) are given. Find a valid inequality for X cutting off (x∗ , y∗ ). (i) X = {(x, y) ∈ {0, 1}3 × ℝ3+ ∶y1 + y2 + y3 ≤ 7, y1 ≤ 3x1 , y2 ≤ 5x2 , y3 ≤ 6x3 } (x∗ , y∗ ) = ( 23 , 1, 0; 2, 5, 0). (ii) X = {(x, y) ∈ {0, 1}3 × ℝ3+ ∶7 ≤ y1 + y2 + y3 , y1 ≤ 3x1 , y2 ≤ 5x2 , y3 ≤ 6x3 } (x∗ , y∗ ) = ( 23 , 1, 0; 2, 5, 0). (iii) X = {(x, y) ∈ {0, 1}6 × ℝ6+ ∶y1 + y2 + y3 ≤ 4 + y4 + y5 + y6 , y1 ≤ 3x1 , y2 ≤ 3x2 , y3 ≤ 6x3 , y4 ≤ 3x4 , y5 ≤ 5x5 , y6 ≤ 1x6 }. (x∗ , y∗ ) = (1, 1, 0, 0, 25 , 0; 3, 3, 0, 0, 2, 0). Solution: (i) y1 + y2 + 2(1 − x1 ) + 4(1 − x2 ) ≤ 7 is violated by 23 . (ii) Aggregating constraints gives 3x1 + 5x2 + 6x3 ≥ 7, x ∈ {0, 1}3 . Valid inequality x1 + x2 + x3 ≥ 2 is violated by 13 . (iii) y1 + y2 + (1 − x1 ) + (1 − x2 ) ≤ 4 + y4 + 2x5 + y6 is violated by 65 .
16.
Consider GAP with equality constraints max
m n ∑ ∑
cij xij
i=1 j=1 n
∑
xij
= 1 for i = 1, … , m
aij xij
≤ bj for j = 1, … , n
j=1 m
∑ i=1
x ∈ {0, 1}mn . ⎛5 7 ⎞ ⎛20 16⎞ Solve an instance with m = 3, n = 2, (aij ) = ⎜3 8 ⎟, (cij ) = ⎜15 19⎟, ⎜ ⎟ ⎜ ⎟ ⎝2 10⎠ ⎝19 14⎠ ( ) 6 and b = by cutting planes. 21
Integer Programming: 2nd Edition
Solution: Iteration 1 LP solution: Z = 57.2, x11 = 0.8, x12 = 0.2, x21 = 0, x22 = 1, x31 = 1, x32 = 0. SP1 : VI for the first knapsack set {x ∈ {0, 1}3 ∶ 5x1 + 3x2 + 2x3 ≤ 6} cutting off x∗ = (0.8, 0, 1). Cover inequality x11 + x31 ≤ 1 is violated by 0.8. Cut added to LP. Iteration 2 LP solution: Z = 54, x12 = x22 = x31 = 1. Integer and optimal. 17.
(Superadditive Inequalities) See Definition 2.6. Consider the feasible region X = {x ∈ ℤn+ ∶ Ax ≤ b} and let = {F ∶ ℝm → ℝ1 ∶ F is superadditive, F is nondecreasing, F(0) = 0}. ∑n (i) Show that j=1 F(aj )xj ≤ F(b) is a valid inequality for X. ⌋ ⌊∑n (ii) Show that F ∶ ℝm → ℝ1 with F(d) = i=1 ui di is superadditive for u ∈ ℝm +. (iii) Show that if F 1 , F 2 ∈ , then F ∗ = min(F 1 , F 2 ) ∈ . Solution:
∑n ∑n ∑n (i) For x ∈ X, j=1 F(aj )xj = j=1∶xj >0 (F(aj + … + F(aj ))) ≤ j=1 F(aj xj ) ≤ ) (∑ n n F j=1 aj xj ≤ F(b) where the first inequality uses x ∈ ℤ+ and superadditivity, the second uses superadditivity and F(0) = 0 and the third uses F nondecreasing and Ax ≤ b. ⌊∑ ⌋ ⌊∑ ⌋ ⌊∑ ⌋ ∑ 2 u d1 + u d2 = ui d1i + (ii) F(d1 + d2 ) = i di iu ) ⌊i ∑ ⌋ ⌊ ⌋ ( (∑ i 1i i ∑ i 2i )i ∑ 1 2 +1 if frac i u i di + i u i di ≥ 1 ≥ i u i di + i u i di = F(d1 ) + F(d2 ). (iii) Wlog min[F1 (u + 𝑣), F2 (u + 𝑣)] = F1 (u + 𝑣) ≥ F1 (u) + F1 (𝑣) ≥ min[F1 (u), F2 (u)] + min[F1 (𝑣), F2 (𝑣)].
Solutions to Certain Exercises in Chapter 10 2.
Suppose one dualizes the constraints yij ≤ xj in the strong formulation of UFL. (i) How strong is the resulting Lagrangian dual bound. (ii) How easy is the solution of the Lagrangian subproblem? Solution: (i) WLD = ZLP as solutions.
∑
j yij
= 1, yi. ∈ ℝn+ is an integer polytope, LP has integer
25
26
Integer Programming: 2nd Edition
(ii) L(u) =
{
∑
i Li (u)
+ min
j
{ Li (u) = min So L(u) =
4.
∑ i
∑
( xj fj −
∑ i
}
) uij
∶x∈
{0, 1}n
∑ ∑ (cij + uij )yij ∶ yij = 1, yi. ∈ ℝn+ j
min(cij + uij )) +
∑
j
j (fj
−
∑
where }
j
− i uij ) .
Consider GAP with equality constraints max n ∑ j=1 m
∑
i=1
m n ∑ ∑ i=1 j=1
cij xij
xij = 1 for i = 1, … , m aij xij ≤ bj for j = 1, … , n
x ∈ {0, 1}mn .
⎛20 16⎞ Solve an instance with m = 3, n = 2, (cij ) = ⎜15 19⎟, ⎜ ⎟ ⎝19 14⎠ ⎛5 7 ⎞ (aij ) = ⎜3 8 ⎟, ⎜ ⎟ ⎝2 10⎠ ( ) 6 and b = 21 by Lagrangian relaxation. Solution: The LP solution is Z = 57.2 with dual variables u = (16, 19, 17.4), 𝑣 = (0.8, 0). Set u1 = (16, 19, 17.4). Then, (cij − ui ) = (4, −4, 1.6; 0, 0, −3.4) and a solution x(u1 ) = (1, 0, 0; 0, 1, 0) with L(u1 ) = 56.4, so 𝛾 = (0, 0, 1). u2 = (16, 19, 17.4) − 𝜇(0, 0, 1). By inspection L(u) decreases for 𝜇 ≤ 2.4. Take u2 = (16, 19, 15). Then, (cij − ui ) = (4, −4, 4; 0, 0, −1) and a solution x(u2 ) = (0, 0, 1; 1, 1, 0) with L(u2 ) = 54 is feasible and thus optimal. 5.
Consider a 0–1 knapsack problem Z = max 11x1 + 5x2 + 14x3 3x1 + 2x2 + 4x3 ≤ 5 x ∈ {0, 1}3 .
Integer Programming: 2nd Edition
Construct a Lagrangian dual by dualizing the knapsack constraint. (i) What is the optimal value of the dual variable? (ii) Suppose one runs the subgradient algorithm using step size (b) in Theorem 10.4, starting with u0 = 2, 𝜇0 = 12 and 𝜌 = 12 . Show numerically that the subgradient algorithm does not reach the optimal dual solution. (iii) Given that L(u) is a 1-dimensional piecewise-linear convex function, suggest an alternative to the subgradient algorithm. Solution: (i) As {x ∶ x ∈ [0, 1]3 } = conv{x ∶ x ∈ {0, 1}3 }, WLD = ZLP . The fractional variable in the LP solution is x3 and so the optimal dual variable is . u = 14 4 (ii) Iteration 1. u1 = 2. L(u1 ) = max{(11 − 2 × 3)x1 + (5 − 2 × 2)x2 + (14 − 2 × 4)x3 + 2 × 5 ∶ x ∈ {0, 1}3 } = 22. Iteration 2. u2 Iteration 3. u3 Iteration 4. u4 Iteration 5. u5 Iteration 6. u6
= max[2 − 12 (5 − 3 − 2 − 4), 0] = 4, L(u2 ) = 20 = 11 , L(u3 ) = 39 4 2 = 3, L(u4 ) = 19 = 25 , L(u5 ) = 75 8 4 51 = 16 , etc.
(iii) Try bisection. 6.
Lagrangian Decomposition. Consider the problem Z = max{cx ∶ Ai x ≤ bi for i = 1, 2, x ∈ ℤn+ } with the reformulation max{𝛼cx1 + (1 − 𝛼)cx2 ∶ Ai xi ≤ bi for i = 1, 2, x1 − x2 = 0, xi ∈ ℤn+ for i = 1, 2} for 0 < 𝛼 < 1. Consider the Lagrangian dual of this formulation in which the n constraints x1 − x2 = 0 are dualized. What is the strength of this dual? Solution:
L(u) = L1 (u) + L2 (u) where
L1 (u) = max{(𝛼c − u)x1 ∶ A1 x1 ≤ b1 , x1 ∈ ℤn+ } and L2 (u) = max{((1 − 𝛼)c + u)x2 ∶ A2 x2 ≤ b2 , x2 ∈ ℤn+ }. WLD = maxn L(u). u∈ℝ
27
28
Integer Programming: 2nd Edition
By Theorem 10.3, WLD = max{𝛼cx1 + (1 − 𝛼)cx2 ∶ x1 ∈ conv(A1 x1 ≤ b1 , x1 ∈ ℤn+ ), x2 ∈ conv(A2 x2 ≤ b2 , x2 ∈ ℤn+ ), x1 = x2 } = max{cx ∶ x ∈ conv(A1 x ≤ b1 , x ∈ ℤn+ ) ∩ conv(A2 x ≤ b2 , x ∈ ℤn+ )}.
Solutions to Certain Exercises in Chapter 11 1.
Consider the problem UFL with formulation as in Chapter 1 min
m n ∑ ∑
cij yij +
i=1 j=1
n ∑
fj xj
j=1 n ∑
xij = 1 for j = 1, … , n
j=1
yij − xj ≤ 0 for i = 1, … , n, j = 1, … , n y∈
ℝmn + ,x
∈ {0, 1}n .
∑n Consider column generation, taking the constraints j=1 xij = 1 as the complicating constraints. (i) Describe the extreme points of conv(X) where X = {(x, y) ∈ {0, 1} × ℝn+ ∶ yi ≤ x for i = 1, … , m}. (ii) What is the complete Master Problem? (iii) What is the column generation subproblem? (iv) Consider an instance with m = 4, n = 3, ⎛2 ⎜ 3 (cij ) = ⎜ ⎜6 ⎜1 ⎝
1 4 4 3
5⎞ ⎟ 2⎟ 1⎟ 7 ⎟⎠
and f = (8, 6, 5).
Construct the restricted Master Problem using all the initial columns in which a depot serves exactly two clients. Carry out an iteration of the algorithm. Solution: (i) The extreme points are (y, x) = (eS , 1) for all subsets S ⊆ M = {1, … , m} and (𝟎, 0).
Integer Programming: 2nd Edition
(ii) The Master Problem is ∑∑ ∑ ( cij + fj )𝜆j,S ∑ ∑ j
∑
j
S⊆M i∈S
𝜆j,S = 1 for i ∈ M
S∶i∈S
𝜆j,S ≤ 1 for j = 1, … , n
S⊆M
𝜆j,S ≥ 0 for S ⊆ M, j = 1, … , n (iii) The subproblems are min j = 1, … , n. 3.
{∑m
i=1 (cij
− ui )yij + fj xj ∶ (y.j , xj ) ∈ X
}
for
Consider GAP with equality constraints m n ∑ ∑
max n ∑ j=1 m
∑
i=1
i=1 j=1
cij xij
xij
= 1 for i = 1, … , m
aij xij
≤ bj for j = 1, … , n
x∈
{0, 1}mn .
⎛5 7 ⎞ ⎛20 16⎞ ⎟ ⎟ ⎜ ⎜ Solve an instance with m = 3, n = 2, (aij ) = ⎜3 8 ⎟, (cij ) = ⎜15 19⎟, ⎜2 10⎟ ⎜19 14⎟ ⎠ ⎠ ⎝ ⎝ ( ) 6 by integer programming decomposition. and b = 21 Solution: The LP Master problem is initialized with the solutions (1,0,0) and (0,1,1) for the first knapsack constraint and (0,1,1) and (1,0,0) for the second. This gives max 20z11 +34z21 +33z12 +16z22 1 0 0 1 = 1 0 1 1 0 = 1 0 1 1 0 = 1 1 1 ≤ 1 1 1 ≤ 1 z ∈ ℝ4+
29
30
Integer Programming: 2nd Edition
Iteration 1 LP solution has Z = 53, u = (19, 0, 33), 𝑣 = (1, 0) SP1 takes the form: 𝜁 1 = max[(20, 15, 19) − (19, 0, 33)]x − 1 5x1 + 3x2 + 2x3 ≤ 6 x ∈ {0, 1}3 SP1 . Solution 𝜁 1 = 14, x∗ = (0, 1, 0). Column added to LPM.z31 Iteration 2 RLM: Z = 53, u = (5, 0, 19), 𝑣 = (15, 14) SP1 . 𝜁 1 = 0, SP2 𝜁 2 = 16, x∗ = (1, 1, 0). Column added to LPM.z32 Iteration 3 RLM: Z = 53, u = (0, 16, −2), 𝑣 = (20, 19) SP1 : 𝜁 1 = 2, x∗ = (0, 0, 1). Column added to LPM. z41 Iteration 4 RLM: Z = 54, u = (0, 15, −1), 𝑣 = (20, 20) SP1 : 𝜁 1 = 0 SP2 : 𝜁 2 = 0 RLM is solved to optimality. z41 = z32 = 1 gives x31 = x12 = x22 = 1. Solution is integer, so M is solved.
Solutions to Certain Exercises in Chapter 12 1.
Write an extended formulation with extreme points and extreme rays for the polyhedron −x1 +x2 ≤ 1 3x1 +x2 ≥ 5 x1 +x2 ≥ 1 x1 +2x2 ≤ 11. Solution: P has extreme points (3, 4), (1, 2), and (2, −1) and extreme rays (4, −3) and (2, −1) giving extended ( ) the ( ) formulation: ( ) ( ) ( ) 3 2 1 4 2 2 P = {x ∈ ℝ ∶ x = 𝜆 + 𝜆 + 𝜆 + 𝜇 + 𝜇, 4 1 −1 2 2 3 −3 1 −1 2 3 𝜆1 + 𝜆2 + 𝜆3 = 1, (𝜆, 𝜇) ∈ ℝ+ × ℝ2+ }.
2.
Consider the mixed integer program +5x2 +2y1 −7y2 +5y3 max 4x1 3x1 +4x2 +2y1 −2y2 +3y3 ≤ 10 x ≤ 3, x ∈ ℤ2+ , y ≤ 2, y ∈ ℝ3+ . Solve it using Benders’ algorithm.
Integer Programming: 2nd Edition
Solution: Top node BR z∗ = 127, x∗ = (3, 3). 𝜂 ∗ = 100. SP Infeasible. u∗ = 1, uy∗ = (0, 2, 0) (dual variables on y ≤ 2). Feasibility cut 3x1 + 4x2 ≤ 14 added. BR z∗ = 118.25, x∗ = (3, 1.25). 𝜂 ∗ = 100. SP 𝜙∗ = −14, u∗ = 3.5, uy∗ = (0, 0, 0). Optimality cut 𝜂 + 10.5x1 + 14x2 ≤ 35 added. BR z∗ = 35, x∗ = (0, 0). 𝜂 ∗ = 3.5. SP 𝜙∗ = 14, u∗ = 0, uy∗ = (2, 0, 5) Optimality cut 𝜂 ≤ 14 added. BR z∗ = 22, x∗ = (2, 0). 𝜂 ∗ = 14. SP 𝜙∗ = 20 , u∗ = 53 , uy∗ = (0, 0, 0) 3 Optimality cut 𝜂 + 5x1 + 20 x ≤ 50 added. 3 2 3 ∗ ∗ BR z = 16.1333, x = (0.5333, 0). 𝜂 ∗ = 14. SP 𝜙∗ = 12.4, u∗ = 1, uy∗ = (0, 0, 2) Optimality cut 𝜂 + 3x1 + 4x2 ≤ 14 added. BR z∗ = 46 , x∗ = ( 43 , 0). 𝜂 ∗ = 10. 3 SP 𝜙∗ = 10. Top node LP is solved. x∗ ∉ ℤ2+ . Branch on x1 . Node x1 ≤ 1 BR z∗ = 15.25, x∗ = (1, 0.25). 𝜂 ∗ = 10. SP 𝜙∗ = 10. LP is solved. x∗ ∉ ℤ2+ . Branch on x2 . Node x1 ≤ 1, x2 ≤ 0 BR z∗ = 15, x∗ = (1, 0). 𝜂 ∗ = 11. SP 𝜙∗ = 11. y∗ = (0.5, 0, 2) LP is solved. New incumbent. z∗ = 15. Node is pruned by optimality. Node x1 ≤ 1, x2 ≥ 1 BR z∗ = 15, Node pruned by bound. Node x1 ≥ 2 BR z∗ = 44 , Node pruned by bound. 3 The enumeration is complete. Optimal solution x∗ = (1, 0), y∗ = (0.5, 0, 2), Z = 15. 4.
Consider the facet-generating separation LP (12.9)–(12.14) and suppose that x0 = 0 and x∗ ∉ P. Write the dual of this LP. Show that it can be interpreted as (i) finding the smallest value 𝜆 > 1 such that x∗ ∈ 𝜆P, or as (ii) finding the last point on the line from the origin to x∗ that lies in P.
31
32
Integer Programming: 2nd Edition
Solution: (i) The dual of max 𝛾x∗ − 𝛾0 𝛾 − uF ≤ 0 −uG ≤ 0 u(d − Fx0 ) − 𝛾0 ≤ 0 𝛾0 ≤ 1 u ∈ ℝm +. is, with dual variables (x, y, 𝜆, 𝜇), min 𝜇 x = x∗ −𝜆 + 𝜇 = −1 −Fx − Gy + 𝜇d ≥ 0 x, y, 𝜇, 𝜆 ≥ 0 which can be rewritten as min 𝜆 − 1 Fx∗ + Gy ≤ 𝜆d y ≥ 0, 𝜆 ≥ 1. 𝜆∗
Let > 1 be an optimal solution. (ii) Note that if x̂ ∈ P is the point such that 𝜆∗ x̂ = x∗ , then x̂ is the last point in P on the line from the origin to x∗ .
Solutions to Certain Exercises in Chapter 13 1.
Devise a simple heuristic for the instance of GAP in Exercise 4 in Chapter 10. Solution: A very naive approach. Find a feasible solution. Take the smallest aij in each column and set the corresponding xij = 1. If the solution is infeasible and xij = 1, try to swap for another variable in the row xi,k and test for feasibility.
Integer Programming: 2nd Edition
Improving a feasible solution. Again if xij = 1, try to swap for another variable in the row xik that maintains feasibility and increases the value cik > cij . For this instance, initial solution x11 = x21 = x31 = 1. Infeasible in column 1. Swap x11 and set x12 = 1. Solution feasible. Feasible solution x12 = x21 = x31 = 1. Swap x21 and set x22 = 1 as solution remains feasible and c22 = 19 > c21 = 15. Feasible solution x12 = x22 = x31 = 1. Swapping x12 makes the solution infeasible and swapping x31 decreases the value. Stop. Heuristic solution x12 = x22 = x31 = 1 with objective value 19.
Solutions to Certain Exercises in Chapter 14 1.
As part of a multicommodity network design problem, you encounter the subset of different commodities passing through an arc. Each of the flows has an upper bound dj corresponding to its total demand. To meet the aggregate flow on the arc, capacity in multiples of C units needs to be installed. Thus, the set can be formulated as follows: ∑n X = {(x, y) ∈ ℤ × ℝn+ ∶ j=1 yj ≤ Cx, yj ≤ dj for j = 1, … , n}. For an instance with n = 6, C = 10, d = (4, 9, 6, 3, 5, 7), you obtain the fractional solution y∗ = (0, 9, 6, 0, 0, 7), x∗ = 2.2. Find a valid inequality cutting off this point. Describe a family of valid inequalities for the set X. Solution: As y1 = y4 = y5 = 0, we relax the inequality to obtain 𝑤 = y2 + y3 + y6 ≤ 6x and also 𝑤 ≤ d2 + d3 + d6 = 22. Now, see Example 8.3, we obtain the inequality 𝑤 ≤ 22 − 2(3 − x) cutting off the point. ∑ ∑ More generally, 𝑤 = j∈S 𝑤j ≤ Cx and 𝑤 ≤ j∈S dj leads to an exponential family of inequalities.
3.
Consider an item as in the multi-item lot-sizing problem in Section 14.4. (i) Suppose that the item cannot be produced for more than 𝛾 consecutive periods. Formulate. If the formulation appears to be weak, look for a stronger formulation. (ii) If the item must be produced at least once every 𝛿 periods, give a strong formulation. Solution: (i) One possibility: If there is a switch-on in period t, the item must not be produced in one of the periods in the interval [t + 1, t + 𝛾]. This gives: zt ≤
t+𝛾 ∑ u=t+1
(1 − yu ).
33
34
Integer Programming: 2nd Edition
A better alternative: If the item is produced in period t, production of the item must have started at some period in the interval [t − 𝛾 + 1, t]. This gives yt ≤
t ∑
zu .
u=t−𝛾+1
(ii) If not produced in t, production must start during the interval [t + 1, t + 𝛿]. This gives 1 − yt ≤
t+𝛿 ∑
zu .
u=t+1
5.
You have a discrete time model in which xti = 1 if job i starts in period t. All three jobs must be carried out. Given two jobs, you wish to formulate the constraint that the start of job 1 is not more than three periods after the start of job 2 and the start of job 3 is at least five periods after the start of job 1. (i) Formulate without introducing additional variables. (ii) Let zti = 1 if job i starts in or before period t. Reformulate using the zti variables. Can you say anything about the structure of the constraint matrix? Solution: ∑ (i) First, there are the assignment constraints t xti = 1 for i = 1, 2, 3. Then, if job 2 has started in or before time t, then job 1 must start in or before t + 3. This gives t ∑
xu2 ≤
u=1
t+3 ∑
xu1 .
u=1
Similarly, if job 3 starts in or before period t, then job 1 starts in or before t − 5 giving: t ∑ u=1
xu3 ≤
t−5 ∑
xu1 .
u=1
(ii) xti ∈ {0, 1} becomes 0 ≤ z1i ≤ z2i ≤ · · · ≤ zTi = 1. The other two con1 1 and zt3 ≤ zt−5 for all appropriate t. straints become zt2 ≤ zt+3 All the constraints have the form 𝑤1 − 𝑤2 ≤ b with b integer. The matrix is the dual of a network matrix and therefore totally unimodular.