-
A courier network has arcs \((s,a)\) , \((s,b)\) , \((a,b)\) , \((a,t)\) , \((b,t)\) with travel times \(3,1,1,4,5\) . Find the fastest route from \(s\) to \(t\) and a set of node labels proving that no route is faster, and say how the proof would change if the time on \((a,b)\) were \(-3\) .
Solution
The routes are \(s,a,t\) with time \(3+4=7\) ; \(s,b,t\) with time \(1+5=6\) ; and \(s,a,b,t\) with time \(3+1+5=9\) . Dijkstra’s algorithm settles \(s\) , then \(b\) with label \(1\) , then \(a\) with label \(3\) , then \(t\) with label \(\min\{3+4,\ 1+5\}=6\) . The fastest route is \(s,b,t\) , taking \(6\) .
The labels \(d(s)=0\) , \(d(a)=3\) , \(d(b)=1\) , \(d(t)=6\) are a feasible potential: on \((s,a)\) , \(3\le 0+3\) ; on \((s,b)\) , \(1\le 0+1\) ; on \((a,b)\) , \(1\le 3+1\) ; on \((a,t)\) , \(6\le 3+4\) ; on \((b,t)\) , \(6\le 1+5\) . By Theorem 2.3 no walk from \(s\) to \(t\) is shorter than \(d(t)=6\) .
If the time on \((a,b)\) were \(-3\) , the route \(s,a,b,t\) would take \(3-3+5=5\) and become the fastest. Dijkstra’s algorithm is no longer justified, since it would settle \(b\) at label \(1\) before discovering the label \(0\) through \(a\) . The network has no cycle, so distances exist; the Bellman–Ford recursion gives \(d(a)=3\) , \(d(b)=0\) , \(d(t)=5\) , and the proof is again that these labels satisfy the inequality on every arc.
-
The same network has capacities \(4,3,2,3,4\) on the arcs in the order listed. Find the largest amount that can be shipped from \(s\) to \(t\) and a proof that no more can be shipped, and decide whether enlarging the capacity of a single arc can raise the amount.
Solution
Send \(4\) units on \((s,a)\) and \(3\) on \((s,b)\) ; from \(a\) send \(3\) on \((a,t)\) and \(1\) on \((a,b)\) ; then \(b\) receives \(3+1=4\) and sends \(4\) on \((b,t)\) . Conservation holds at \(a\) and \(b\) , no capacity is exceeded, and the value is \(7\) .
The cut \(S=\{s\}\) has leaving arcs \((s,a)\) and \((s,b)\) of capacity \(4+3=7\) . By Lemma 3.3 no flow exceeds \(7\) , so the flow is maximum.
There is a second minimum cut: \(S=\{s,a,b\}\) has leaving arcs \((a,t)\) and \((b,t)\) , of capacity \(3+4=7\) . Because of this, enlarging a single arc cannot raise the maximum flow. Enlarging an arc out of \(s\) leaves the cut around \(t\) at \(7\) , enlarging an arc into \(t\) leaves the cut around \(s\) at \(7\) , and enlarging \((a,b)\) changes neither. At least one arc in each of the two cuts must be enlarged; for example raising \((s,b)\) to \(4\) and \((b,t)\) to \(5\) gives a maximum flow of \(8\) .
-
Four tutors can each take one of four students, and the hours of preparation tutor \(i\) needs for student \(j\) are given by the matrix with rows \((4,2,5,7)\) , \((8,3,10,8)\) , \((12,5,4,5)\) , \((6,3,7,14)\) . Find an assignment with least total preparation and numbers on tutors and students that certify it.
Solution
Apply the Hungarian method. Row minima \(2,3,4,3\) give \(p=(2,3,4,3)\) ; the column minima of what remains are \(2,0,0,1\) , so \(q=(2,0,0,1)\) . The reduced costs are
\[ \begin{pmatrix}0&0&3&4\\3&0&7&4\\6&1&0&0\\1&0&4&10\end{pmatrix}. \]A maximum matching among the zeros has three pairs, for instance \((1,1)\) , \((2,2)\) , \((3,3)\) ; row \(4\) is free, since rows \(2\) and \(4\) both have their only zero in column \(2\) . From row \(4\) the search reaches column \(2\) and row \(2\) : \(S=\{2,4\}\) , \(T=\{2\}\) , \(\delta=1\) . After the update, \(S=\{1,2,4\}\) , \(T=\{1,2\}\) , and \(\delta=3\) . The prices become \(p=(5,7,4,7)\) , \(q=(-1,-4,0,1)\) , with reduced costs
\[ \begin{pmatrix}0&1&0&1\\2&0&3&0\\9&5&0&0\\0&0&0&6\end{pmatrix}, \]which contain the perfect matching \((1,3)\) , \((2,2)\) , \((3,4)\) , \((4,1)\) .
The assignment is: tutor 1 with student 3, tutor 2 with student 2, tutor 3 with student 4, tutor 4 with student 1, with total \(5+3+5+6=19\) . The prices total \(5+7+4+7-1-4+0+1=19\) , so by Lemma 4.9 no assignment takes less. The optimum is not unique; tutor 1 with student 1, tutor 2 with student 2, tutor 3 with student 4, tutor 4 with student 3 also totals \(19\) .
-
Maximize \(3x_1+4x_2\) subject to \(2x_1+3x_2\le 10\) , \(4x_1+x_2\le 9\) , \(x\ge 0\) integer. Solve the problem completely, giving both the optimal plan and an argument that would convince someone who has not seen your search.
Solution
The relaxation’s optimum is where both constraints are active: \(x=(1.7,2.2)\) with value \(13.9\) , so \(z^\star\le 13\) .
List the feasible integer points by \(x_1\) . For \(x_1=0\) : \(x_2\le 3\) . For \(x_1=1\) : \(3x_2\le 8\) , so \(x_2\le 2\) . For \(x_1=2\) : \(x_2\le 9-8=1\) . For \(x_1=3\) the second constraint fails. The best point in each column is \((0,3)\) with value \(12\) , \((1,2)\) with value \(11\) , and \((2,1)\) with value \(10\) . So \(x^\star=(0,3)\) and \(z^\star=12\) .
For someone who has not seen the search, two short arguments are available. One is the list just given, which is a three-leaf enumeration: every feasible point has \(x_1\in\{0,1,2\}\) and the best in each case is shown. The other is a valid inequality: every feasible integer point satisfies \(x_1+x_2\le 3\) (see the next problem), and then \(3x_1+4x_2=3(x_1+x_2)+x_2\le 9+x_2\) , with \(x_2\le 3\) from the first constraint; so the value is at most \(12\) , attained at \((0,3)\) . Either argument, together with the feasible point, is a certificate.
-
For the integer set of Problem 4, find one inequality that is valid for all its points and violated by the optimum of its relaxation, derive it by a rule that guarantees validity, and determine whether adding it makes the relaxation’s optimum integral.
Solution
Use Proposition 8.2 with multipliers \(\mu=(\tfrac3{10},\tfrac1{10})\) . The combination is
\[ \bigl(\tfrac6{10}+\tfrac4{10}\bigr)x_1+\bigl(\tfrac9{10}+\tfrac1{10}\bigr)x_2\le 3+\tfrac9{10}, \]that is, \(x_1+x_2\le 3.9\) . The coefficients are integers, and rounding the right side down gives \(x_1+x_2\le 3\) , valid for all feasible integer points.
At the relaxation optimum \((1.7,2.2)\) the left side is \(3.9>3\) , so the inequality is violated there.
With the cut added, maximize \(3x_1+4x_2\) subject to \(2x_1+3x_2\le 10\) , \(4x_1+x_2\le 9\) , \(x_1+x_2\le 3\) , \(x\ge 0\) . On the line \(x_1+x_2=3\) the objective is \(9+x_2\) , so \(x_2\) should be as large as possible; the first constraint gives \(2(3-x_2)+3x_2\le 10\) , so \(x_2\le 4\) , and nonnegativity of \(x_1\) gives \(x_2\le 3\) . The optimum of the new relaxation is \((0,3)\) with value \(12\) , an integer point. One cut made the relaxation’s optimum integral and solved the problem.
-
A matrix has rows \((1,1,0,0)\) , \((0,1,1,0)\) , \((0,0,1,1)\) , \((1,0,0,1)\) . Decide whether linear programs with this constraint matrix and integer right-hand sides always have integral vertices, and justify your decision; then decide the same question after the last row is replaced by \((1,0,1,0)\) .
Solution
In the first matrix every column has exactly two ones: column 1 in rows \(1,4\) ; column 2 in rows \(1,2\) ; column 3 in rows \(2,3\) ; column 4 in rows \(3,4\) . Split the rows into \(R_1=\{1,3\}\) and \(R_2=\{2,4\}\) . In every column the two ones lie in different classes, so Theorem 6.9 applies and the matrix is totally unimodular. It is the node–edge incidence matrix of a four-cycle, which is bipartite. By Theorem 6.7, programs with this matrix and integer right-hand sides have integral vertices.
After the change the rows are \((1,1,0,0)\) , \((0,1,1,0)\) , \((0,0,1,1)\) , \((1,0,1,0)\) . Rows \(1,2,4\) and columns \(1,2,3\) form the triangle matrix
\[ \begin{pmatrix}1&1&0\\0&1&1\\1&0&1\end{pmatrix}, \]with determinant \(2\) . The matrix is not totally unimodular, and integral vertices are not guaranteed: with right-hand side \((1,1,1,1)\) and constraints \(Ax\le b\) , \(x\ge 0\) , the point \((\tfrac12,\tfrac12,\tfrac12,\tfrac12)\) is feasible with all four rows active and is a vertex, since the four rows are linearly independent.
-
Items have profits \((9,7,6,4)\) and weights \((5,4,3,2)\) , and the capacity is \(7\) . Find the optimal selection by a method with a guaranteed running time, state that running time in terms of the data, and give the bound that the relaxation provides.
Solution
Use the table of Theorem 9.1, which takes \(O(nW)\) operations, here \(4\cdot 8\) entries. With profits \((9,7,6,4)\) and weights \((5,4,3,2)\) :
\(k\) \(0\) \(1\) \(2\) \(3\) \(4\) \(5\) \(6\) \(7\) \(1\) \(0\) \(0\) \(0\) \(0\) \(0\) \(9\) \(9\) \(9\) \(2\) \(0\) \(0\) \(0\) \(0\) \(7\) \(9\) \(9\) \(9\) \(3\) \(0\) \(0\) \(0\) \(6\) \(7\) \(9\) \(9\) \(13\) \(4\) \(0\) \(0\) \(4\) \(6\) \(7\) \(10\) \(11\) \(13\) The optimal value is \(F_4(7)=13\) . Backtracking: \(F_4(7)=F_3(7)\) , so item 4 is out; \(F_3(7)=13\ne F_2(7)=9\) , so item 3 is in, leaving capacity \(4\) ; \(F_2(4)=7\ne F_1(4)=0\) , so item 2 is in. The selection is items \(2,3\) , with weight \(7\) and profit \(13\) . Items \(1,4\) give \(13\) as well.
For the relaxation, the ratios are \(1.8\) , \(1.75\) , \(2\) , \(2\) ; taking items \(3\) and \(4\) , with weight \(5\) , and then \(\tfrac25\) of item 1 gives \(10+3.6=13.6\) . Rounded down, the bound is \(13\) , which the table’s answer attains.
-
A decision problem asks whether a given graph has a vertex cover with at most \(k\) nodes. Explain what evidence shows that an instance has the answer yes, why no comparable evidence is expected for the answer no, and for which graphs a short proof of no does exist.
Hint
A yes-instance is certified by the cover itself, checked edge by edge: the problem is in NP. A no-instance would need a proof that all subsets of size \(k\) fail, and since the problem is NP-complete no short proof is expected in general. For bipartite graphs a matching with more than \(k\) edges is a short proof of no, by Lemma 4.2, and König’s theorem says one always exists.
-
A plant chooses which of three machines to rent, at fixed costs \(10\) , \(12\) , \(15\) , to produce \(20\) units; the machines have capacities \(12\) , \(14\) , \(20\) and unit costs \(2\) , \(1\) , \(1\) . Formulate the problem with binary and continuous variables, choosing every constant as small as validity allows, and find the optimal plan.
Solution
Let \(x_i\in\{0,1\}\) say whether machine \(i\) is rented and \(y_i\ge 0\) be its output. Minimize \(10x_1+12x_2+15x_3+2y_1+y_2+y_3\) subject to \(y_1+y_2+y_3=20\) and \(y_1\le 12x_1\) , \(y_2\le 14x_2\) , \(y_3\le 20x_3\) . The constants are the capacities; for machine 3 the capacity \(20\) is also the total demand, so no smaller constant is valid for any of them.
Enumerate the rental decisions. Machine 3 alone: \(15+20=35\) . Machines 1 and 2: capacity \(26\) , fixed cost \(22\) , with \(14\) units on machine 2 at cost \(14\) and \(6\) on machine 1 at cost \(12\) : \(48\) . Machines 1 and 3: \(25+20=45\) . Machines 2 and 3: \(27+20=47\) . All three cost more still, and machine 1 alone or machine 2 alone cannot produce \(20\) units. The optimal plan is to rent machine 3 only and make all \(20\) units on it, at cost \(35\) .
-
An algorithm for a minimization problem returns a solution of cost \(140\) , and a relaxation of the same instance has value \(112.4\) with all cost coefficients integers. State what can be concluded about the optimal cost and about the quality of the solution, and what additional computation could tighten the conclusion.
Answer
The optimal cost is an integer at least \(112.4\) , hence at least \(113\) , and at most \(140\) . The solution is within a factor \(140/113\approx 1.24\) of optimal. To tighten the conclusion, strengthen the relaxation with cuts or branch to raise the lower bound, or run a heuristic to lower the upper bound.
-
Five computers are linked by cables \(12\) , \(13\) , \(23\) , \(34\) , \(45\) , \(35\) . Find a smallest set of computers meeting every cable, prove its minimality by an argument that does not list all subsets, and say whether the theorem of König could have been used.
Solution
The cables form two triangles, on \(\{1,2,3\}\) and on \(\{3,4,5\}\) , sharing computer \(3\) . The set \(\{2,3,4\}\) meets every cable: \(12\) and \(23\) at \(2\) , \(13\) , \(34\) , \(35\) at \(3\) , and \(45\) at \(4\) .
No set of two computers suffices. If computer \(3\) is chosen, the cables \(12\) and \(45\) remain and have no common endpoint, so two more computers are needed. If \(3\) is not chosen, the cables \(13\) and \(23\) force \(1\) and \(2\) , and the cables \(34\) and \(35\) force \(4\) and \(5\) . So three is the minimum.
König’s theorem could not have been used: the graph contains triangles and is not bipartite, and indeed its largest matching has only two cables, for example \(12\) and \(34\) , since any three disjoint cables would need six computers. The matching bound \(2\) is strictly below the minimum cover \(3\) .
-
Explain why the running time \(O(nW)\) for the knapsack table and the NP-hardness of the knapsack problem are compatible, and for an instance with \(n=50\) and \(W=10^{15}\) name a method from this book that still gives a provable statement in reasonable time.
Hint
\(W\) is exponential in the number of bits used to write it, so \(O(nW)\) is pseudo-polynomial and the instances that make knapsack hard are those with huge numbers. For \(n=50\) , \(W=10^{15}\) : the scaling algorithm of Theorem 9.4 gives a solution within any chosen \(\varepsilon\) in \(O(n^3/\varepsilon)\) operations; branch-and-bound with the Dantzig bound gives an exact answer with a certificate when its tree stays small.
-
A two-machine scheduling model contains, for jobs with processing times \(3\) and \(5\) on a shared machine, the requirement that one job finishes before the other starts within a horizon of \(12\) time units. Write the requirement with one binary variable and the smallest valid constants, and explain the effect of using the constant \(1000\) instead.
Solution
Let \(t_1,t_2\ge 0\) be the start times, so the jobs occupy the machine from \(t_1\) to \(t_1+3\) and from \(t_2\) to \(t_2+5\) . Both must finish by time \(12\) , so \(t_1\le 9\) and \(t_2\le 7\) . With \(x\in\{0,1\}\) , where \(x=0\) means job 1 goes first:
\[ t_1+3\le t_2+12x,\qquad t_2+5\le t_1+12(1-x). \]For \(x=0\) the first constraint is the real requirement and the second reads \(t_2+5\le t_1+12\) , which always holds because \(t_2+5\le 12\) and \(t_1\ge 0\) . For \(x=1\) the roles are exchanged. The constant must be at least the largest value of \(t_1+3-t_2\) , which is \(9+3-0=12\) , and at least the largest value of \(t_2+5-t_1\) , which is \(7+5-0=12\) . So \(12\) , the horizon, is the smallest valid constant in both constraints.
With the constant \(1000\) the integer solutions are the same, but the relaxation is far weaker. The first constraint holds for every pair of start times as soon as \(1000x\ge 12\) , and the second as soon as \(1000(1-x)\ge 12\) ; so every \(x\) between \(0.012\) and \(0.988\) switches both constraints off, and the relaxation sees no conflict between the jobs at all. With the constant \(12\) only \(x=1\) switches the first constraint off completely and only \(x=0\) the second, so a fractional \(x\) always leaves part of the requirement in force.
-
For the network of Problem 1 with unit capacities on all arcs, determine the maximum number of routes from \(s\) to \(t\) that share no arc, and a smallest set of arcs whose failure disconnects \(t\) from \(s\) ; name the theorem connecting the two numbers.
Answer
Two: the routes \(s,a,t\) and \(s,b,t\) share no arc, and removing the two arcs \((s,a)\) and \((s,b)\) leaves no route. The numbers agree by Menger’s theorem, Corollary 3.9.
-
A solver stops with incumbent value \(870\) and best bound \(905\) on a maximization problem. A colleague proposes adding the constraint \(c^{\top}x\ge 880\) to “help the solver”. Say whether this can change the optimal solution, whether it is a valid inequality in the sense of Chapter 8, and what it does to the search.
Hint
It is not a valid inequality in the sense of Definition 8.1: feasible solutions with value below \(880\) , including the incumbent, violate it. If \(z^\star\ge 880\) the optimal solution is unchanged and the search is helped; if \(870\le z^\star<880\) the constrained problem is infeasible and the true optimum is lost. The safe version is the cutoff \(c^{\top}x\ge 871\) when values are integers, which is what pruning by bound already does.
-
Six towns must each be within reach of a fire station; a station in town \(i\) reaches the towns in \(S_i\) , where \(S_1=\{1,2\}\) , \(S_2=\{1,2,3\}\) , \(S_3=\{2,3,4\}\) , \(S_4=\{3,4,5\}\) , \(S_5=\{4,5,6\}\) , \(S_6=\{5,6\}\) . Find the fewest stations, show that the constraint matrix has a property that makes the relaxation integral, and name the property.
Solution
Stations in towns \(2\) and \(5\) reach \(\{1,2,3\}\) and \(\{4,5,6\}\) , all six towns. One station is not enough, since no \(S_i\) contains more than three towns. So two stations is the minimum.
The model minimizes \(x_1+\dots+x_6\) subject to, for each town \(j\) , \(\sum_{i:\,j\in S_i}x_i\ge 1\) . In the constraint matrix, with a row for each town and a column for each station, column \(i\) has ones exactly in the rows of \(S_i\) , and each \(S_i\) is a run of consecutive towns. By Theorem 6.11 the matrix is totally unimodular, and with the integer right-hand side Theorem 6.7 makes every vertex of the relaxation integral. The property is total unimodularity, here in the form of consecutive ones.
A dual certificate confirms the value: towns \(1\) and \(6\) have no station in common, since no \(S_i\) contains both, so assigning price \(1\) to each of them and \(0\) to the others is feasible for the dual, with value \(2\) .