← Back to the site

Question bank

466 fixed questions · 60 generated questions

Fixed questions (466)

Part: Models and bounds (96)

1. What is a MIP model (38)

mip-f-001 · level facile · notes
An optimisation model has a linear objective and linear constraints; some variables are binary, some integer and some continuous. Which class does it belong to?
  1. MILP (mixed integer linear programming)
  2. LP (linear programming)
  3. ILP (integer linear programming)
  4. BIP (binary integer programming)
Explanation. The domains distinguish the classes: all continuous is LP, all integer ILP, all binary BIP; a model with integer (or binary) and continuous variables together is a MILP.
mip-f-002 · level facile · notes
**Maximisation** problem. $\zmilp$ is the optimum of the MILP, $\zlp$ that of the linear relaxation with only $x \ge 0$, $\zlpp$ that with $x \le 1$ as well, $\zdual$ the optimum of the dual of the relaxation. $\bar x$ is feasible for the MILP, $\bar\pi$ for the dual. Which chain is correct?
  1. $\lb(\bar x) \le \zmilp \le \zlp \le \zlpp = \zdual \le \ub(\bar\pi)$
  2. $\lb(\bar x) \le \zdual \le \zmilp \le \zlpp \le \ub(\bar\pi)$
  3. $\lb(\bar x) \le \zmilp \le \zlpp \le \zlp = \zdual \le \ub(\bar\pi)$
  4. $\lb(\bar\pi) \le \zdual = \zlp \le \zlpp \le \zmilp \le \ub(\bar x)$
Explanation. In a maximisation the feasible solution gives the pessimistic side (a lower bound) and the dual lies on the side of the relaxation (an upper bound); adding $x \le 1$ restricts the relaxation and in a maximisation cannot raise it: $\zlpp \le \zlp$.
mip-f-003 · level facile · notes
Problem $\max\ x_1 + x_2$ with $2x_1 + 2x_2 \le 3$ and $x_1, x_2 \in \{0,1\}$. The linear relaxation (binaries replaced by $0 \le x \le 1$) has $(3/4, 3/4)$ among its optimal solutions. What does rounding that point up give?
  1. $(1,0)$, which is the integer optimum
  2. $(0,0)$, feasible with value $0$
  3. $(1,1)$, which is the integer optimum
  4. $(1,1)$, which violates the constraint
Explanation. Rounding up gives $(1,1)$ and $2+2 = 4 > 3$: it is infeasible. Rounding can produce infeasible points, and when it produces feasible ones there is no guarantee on their value.
mip-f-004 · level facile · notes
In a timetabling model, $x_i \in \{0,1\}$ equals $1$ if job $i$ is scheduled and $I$ is the set of jobs occupying the same time slot. The sentence "at most one job per slot" is a constraint of which kind?
  1. Set covering: $\sum_{i \in I} x_i \ge 1$
  2. Set packing: $\sum_{i \in I} x_i \le 1$
  3. Set covering: $\sum_{i \in I} x_i \le |I| - 1$
  4. Set partitioning: $\sum_{i \in I} x_i = 1$
Explanation. "At most one" is a set packing ($\le 1$); "exactly one" is a partitioning ($= 1$), "at least one" a covering ($\ge 1$).
mip-f-005 · level facile · notes
In a covering model $x_j \in \{0,1\}$ equals $1$ if post $j$ is active and $S_i$ is the set of posts covering zone $i$. The constraint "zone $i$ is covered" is $\sum_{j \in S_i} x_j \ge 1$. Of which logical expression is it the direct translation?
  1. An OR clause of the negations $\lnot x_j$, $j \in S_i$
  2. An OR clause of the literals $x_j$, $j \in S_i$
  3. An AND conjunction of the literals $x_j$, $j \in S_i$
  4. An implication $x_j \Rightarrow x_k$ for every pair $j, k \in S_i$
Explanation. The covering asks that at least one of the literals be true: it is the clause $\bigvee_{j \in S_i} x_j$ written as a sum $\ge 1$. The OR of the negations would say "at least one post switched off".
mip-f-006 · level facile · notes
In a minimisation problem only $\ub = 10$ (value of a feasible solution found by a heuristic) and $\lb = 7$ (value of a feasible dual solution) are known. The certified gap is $(\ub - \lb)/|\ub|$. What is it?
  1. $42.9\%$
  2. $70\%$
  3. $30\%$
  4. $0\%$
Explanation. $(10 - 7)/10 = 30\%$. It guarantees that the optimum lies between $7$ and $10$, not that it is close to either end; $42.9\%$ comes from dividing by $\lb$ instead of $\ub$.
mip-f-007 · level facile · notes
MILP with binary variables, **minimisation** problem. $\zlp$ is the optimum of the relaxation with only $x \ge 0$, $\zlpp$ that with $x \le 1$ as well, $\zmilp$ the integer optimum. Which relation always holds?
  1. $\zlp = \zlpp \le \zmilp$
  2. $\zlpp \le \zlp \le \zmilp$
  3. $\zlp \le \zlpp \le \zmilp$
  4. $\zmilp \le \zlpp \le \zlp$
Explanation. Every relaxation enlarges the feasible set, and the one without $x \le 1$ enlarges it more: in a minimisation the value can only go down, hence $\zlp \le \zlpp \le \zmilp$. Equality between the two relaxations holds only in special cases.
mip-f-008 · level facile · notes
MILP with binaries $x$. $\zlp$ is the relaxation with only $x \ge 0$, $\zlpp$ that with $x \le 1$ as well. When do the two certainly coincide?
  1. When the MILP has a unique optimal integer solution
  2. When the other constraints already imply $x \le 1$, such as $\sum_m x_{jm} = 1$
  3. When the problem is a maximisation and the profits are positive
  4. When all the variables have a positive cost in the objective
Explanation. The second relaxation adds the constraints $x \le 1$; if they are already implied, for instance by an assignment constraint with $x \ge 0$, adding them does not change the feasible set.
mip-f-009 · level teorema · notes
**Minimisation** MILP, with $\zlp$ the optimum of its linear relaxation and $\zmilp$ the integer optimum. Which statement about the feasible solutions of the dual of the relaxation is correct?
  1. Each is worth at least $\zmilp$: it is an upper bound on the integer optimum
  2. If the relaxation has a finite optimum, the optimal dual is worth $\zmilp$
  3. Each gives a bound on $\zmilp$ only if it is optimal for the dual
  4. Each is worth at most $\zlp$, hence at most $\zmilp$: it is a lower bound
Explanation. By weak duality every feasible dual solution is worth at most $\zlp$, and $\zlp \le \zmilp$: it is a lower bound, optimistic like the relaxation. The pessimistic bound comes only from a feasible solution of the MILP.
mip-f-010 · level teorema · notes
A **primal bound** is the value of a solution used to bound the integer optimum $\zmilp$. Which statement is correct?
  1. In a maximisation, the value of every feasible integer solution is a lower bound on $\zmilp$
  2. In a maximisation, the value of every feasible integer solution is an upper bound on $\zmilp$
  3. A solution satisfying the linear constraints with a fractional component gives a primal bound
  4. The optimal solution of the linear relaxation always gives a primal bound
Explanation. A primal bound comes from a feasible solution of the MILP, integrality included: in a maximisation it is worth at most the optimum, hence it is a lower bound. A fractional solution is feasible only for the relaxation.
mip-f-011 · level ipotesi · notes
Minimisation MILP with feasible set $X$ and linear relaxation with feasible set $\hat X$ (same objective). To prove $\zlp \le \zmilp$, what is needed?
  1. That $X \subseteq \hat X$: every solution of the MILP is feasible for the relaxation
  2. That the constraint matrix be totally unimodular
  3. Strong duality between the MILP and the dual of its relaxation
  4. That the relaxation have at least one integer optimal solution
Explanation. The relaxation optimises the same objective over a larger set, $X \subseteq \hat X$: the minimum over a larger set cannot be higher. Nothing else is needed; the other assumptions would serve to prove equality.
mip-f-012 · level ipotesi · notes
Minimisation problem with integer optimum $\zmilp$. To state $7 \le \zmilp \le 10$ without solving the MILP, what is enough?
  1. A feasible integer solution of value $10$ and a feasible solution of the dual of the relaxation of value $7$
  2. A possibly fractional solution satisfying the linear constraints, of value $10$, and a feasible dual of value $7$
  3. A dual solution of value $7$ in complementary slackness with an integer solution of value $10$
  4. An optimal solution of the dual of the relaxation of value $7$ and strong duality between MILP and dual
Explanation. The pessimistic side comes from a feasible solution of the MILP, integrality included; the optimistic side from any feasible dual solution, thanks to weak duality, which holds with no further assumption.
mip-f-152 · level facile · notes
Minimisation problem: a heuristic finds a solution of value $\ub = 22$ and the solver certifies the optimum $\zmilp = 20$. The gap of the heuristic is $|\ub - \zmilp| / |\zmilp|$. What is it?
  1. $2\%$
  2. $9.1\%$
  3. $10\%$
  4. $110\%$
Explanation. $|22 - 20| / 20 = 2/20 = 10\%$. Dividing by $\ub$ would give $9.1\%$, which is another measure; $2$ is the absolute difference, not the relative gap.
mip-f-153 · level facile · notes
Every job $i \in I$ must be assigned to **exactly one** of the machines $m \in \{1, \dots, k\}$, with $x_{im} \in \{0,1\}$ equal to $1$ if $i$ goes on $m$. Which family of constraints expresses it?
  1. $\sum_{m=1}^{k} x_{im} \le 1$ for every $i \in I$ (set packing)
  2. $\sum_{i \in I} x_{im} = 1$ for every machine $m$ (set partitioning)
  3. $\sum_{m=1}^{k} x_{im} = 1$ for every $i \in I$ (set partitioning)
  4. $\sum_{m=1}^{k} x_{im} \ge 1$ for every $i \in I$ (set covering)
Explanation. "Exactly one machine per job" is a partitioning over the job rows: the sum over $m$ equals $1$ for every $i$. Summing over $i$ would instead say "exactly one job per machine".
mip-f-154 · level facile · notes
During branch-and-bound on a **maximisation** problem, the solver knows the best integer solution found, of value $40$, and a bound from the relaxations, of value $46$. What can be said about the optimum $\zmilp$?
  1. $\zmilp = 46$, because it is the value of the relaxation
  2. $\zmilp = 40$, because the solution is integer
  3. $40 \le \zmilp$ only: the bound from the relaxations is not valid until the search closes
  4. $40 \le \zmilp \le 46$
Explanation. In a maximisation the integer solution is the pessimistic side ($\lb = 40$) and the relaxation bound the optimistic side ($\ub = 46$). The solver works to narrow the interval, and stops when the two sides coincide within the tolerance.
mip-f-155 · level teorema · notes
The linear relaxation of a MILP is solved and its integer variables are rounded to the nearest integer. Which statement is correct?
  1. The rounded point is at most as far from the integer optimum as the relaxation is
  2. The rounded point is optimal when the relaxation has a unique optimal solution
  3. The rounded point may be infeasible, and if it is feasible its value has no guarantee of being close to the optimum
  4. The rounded point is always feasible, but it may not be optimal
Explanation. Rounding may violate the constraints (as $(3/4, 3/4) \to (1,1)$ on $2x_1 + 2x_2 \le 3$), and even when it gives a feasible point it says nothing about its quality: this is why verified heuristics and bounds are needed.
mip-f-188 · level facile · notes
Binary knapsack: $\max \sum_j p_j x_j$ with $\sum_j w_j x_j \le c$ and $x_j \in \{0,1\}$, where $p_j$ is the value and $w_j$ the weight of item $j$, $c$ the capacity. Which are the data and which the variables?
  1. Data $w_j$, $c$; variables $x_j$ and $p_j$
  2. Data $p_j$, $w_j$, $c$; variables $x_j$
  3. Data $p_j$, $w_j$; variables $x_j$ and $c$
  4. Data $x_j$; variables $p_j$, $w_j$, $c$
Explanation. The data are the numbers known before deciding (values, weights, capacity); the variables are what the decision maker controls, here which items to take.
mip-f-189 · level facile · notes
Minimisation problem solved with Gurobi. The best integer solution has `ObjVal` $= 50$ and the dual bound is `ObjBound` $= 46$. The reported gap is `MIPGap` $= |\text{ObjVal} - \text{ObjBound}| / |\text{ObjVal}|$. What is it?
  1. $8\%$
  2. $92\%$
  3. $8.7\%$
  4. $4\%$
Explanation. $|50 - 46| / 50 = 4/50 = 8\%$. Dividing by the bound gives $8.7\%$; $4$ is the absolute gap, not the relative one; $92\%$ is the ratio $46/50$.
mip-f-300 · level facile · notes
A linear optimisation model has two families of variables: $x_j \ge 0$ continuous (quantities produced) and $y_j \in \{0,1\}$ (plant $j$ open or not). All constraints and the objective are linear. Which class does it belong to?
  1. BIP, because the model contains binary variables
  2. ILP, because one integer variable is enough to make it integer
  3. LP, because objective and constraints are all linear
  4. MILP, because some variables are integer (binary) and others continuous
Explanation. The class is decided by the domains: all continuous LP, all integer ILP, all binary BIP, a mix MILP. Here continuous and binary variables coexist, so MILP; linearity of objective and constraints is shared by all four classes.
mip-f-301 · level facile · notes
In an integer linear programming model one wants to express «each job goes to exactly one machine», «machine $m$ works no more than $a_m$ hours» and «at least $12$ units are needed». Which type of linear constraint corresponds, in order, to each requirement?
  1. $\ge$ sense, $\le$ sense, equality
  2. Equality, $\ge$ sense, $\le$ sense
  3. $\le$ sense, equality, $\ge$ sense
  4. Equality, $\le$ sense, $\ge$ sense
Explanation. An exact assignment is an equality, a capacity to respect a $\le$ constraint, a requirement to satisfy a $\ge$ constraint.
mip-f-302 · level facile · notes
Problem $\max\ x_1 + x_2$ with $2x_1 + 2x_2 \le 3$ and $x_1, x_2 \in \{0,1\}$. The linear relaxation (binaries replaced by $0 \le x \le 1$) returns $(3/4, 3/4)$. What do rounding up and rounding down this point give?
  1. Up $(1,1)$, feasible with value $2$; down $(0,0)$, with value $0$
  2. Up $(1,0)$, the integer optimum; down $(0,0)$, with value $0$
  3. Up $(1,1)$, infeasible; down $(0,0)$, feasible with value $0$
  4. Up $(1,1)$, infeasible; down $(1,0)$, the integer optimum
Explanation. $(1,1)$ gives $2 + 2 = 4 > 3$ and violates the constraint; $(0,0)$ is feasible but worth $0$, while the integer optimum is $1$. From this point neither direction finds the optimum.
mip-f-303 · level ipotesi · notes
Problem $\max\ x_1 + x_2$ with $2x_1 + 2x_2 \le 3$, $x \in \{0,1\}^2$: $\zlpp = 3/2$ (relaxation with $0 \le x \le 1$) and $\zmilp = 1$ (integer optimum). A student concludes: «the gap $1/2$ is the fault of rounding; a smarter rounding closes it». Which observation dismantles the conclusion?
  1. The gap disappears if the relaxation without bounds is used, that is, with $x \ge 0$ only
  2. Rounding down always closes the gap in maximisation problems with $\le$ constraints
  3. No feasible integer point is worth more than $1$: the gap is between the two problems, it does not depend on how one rounds
  4. The gap is $1/2$ only because the solver returned $(1/2, 1)$ instead of $(3/4, 3/4)$
Explanation. $\zmilp = 1$ is the largest value over the feasible integer points: no rounding, however smart, can exceed it, so $3/2 - 1$ is a jump between relaxation and integer problem. The relaxation without bounds is not tighter (it is at least $3/2$), and all points of the optimal segment have the same value.
mip-f-304 · level teorema · notes
**Minimisation** problem with $\ub > 0$ the value of a feasible integer solution and $\lb$ the value of a feasible solution of the dual of the relaxation. The certified gap is $(\ub - \lb)/\ub$. What does a gap of $5\%$ guarantee?
  1. That the integer optimum lies in $[\lb, \ub]$, so the solution is at most $5\%$ of $\ub$ away from the optimum
  2. That the integer optimum is at most $5\%$ below $\lb$
  3. That the integer optimum coincides with the midpoint between $\lb$ and $\ub$
  4. That the integer optimum is closer to $\ub$ than to $\lb$
Explanation. The two bounds enclose the optimum: $\lb \le \zmilp \le \ub$. Hence $\ub - \zmilp \le \ub - \lb = 0.05\,\ub$. Where the optimum lies inside the interval is unknown: the gap guarantees the interval, not closeness to an endpoint.
mip-f-305 · level facile · notes
Logical clause $x_1 \lor x_2 \lor x_3$ with $x_j \in \{0,1\}$ ($1$ = true). Which of the three classical patterns — set partitioning ($\sum x = 1$), set packing ($\sum x \le 1$), set covering ($\sum x \ge 1$) — is its direct translation?
  1. None: an OR needs one constraint for every pair of variables
  2. Set covering: $x_1 + x_2 + x_3 \ge 1$
  3. Set packing: $x_1 + x_2 + x_3 \le 1$
  4. Set partitioning: $x_1 + x_2 + x_3 = 1$
Explanation. The OR is true when at least one literal is true: that is exactly «at least one», the covering. Partitioning would impose exactly one (excluding two true literals), packing at most one.
mip-f-306 · level facile · notes
While solving a **minimisation** MILP, the solver knows the best integer solution found (value $80$) and, for one part of the search space, a relaxation bound equal to $83$. What can it do with that part?
  1. Discard it only if the bound were below $80$
  2. Nothing: a relaxation bound does not allow discarding integer solutions
  3. Discard it without exploring: none of its solutions can be worth less than $83 > 80$
  4. Explore it first, because its bound is the highest
Explanation. In a minimisation the relaxation gives an optimistic bound: in that part no solution goes below $83$, worse than the solution to beat ($80$), so the part is discarded.
mip-f-307 · level teorema · notes
Two formulations of the same **maximisation** MILP, with the same integer points: the relaxation of the first is worth $120$, that of the second $104$; the integer optimum is $100$. What is expected from the solver?
  1. With the second the integer optimum may differ from $100$
  2. With the first the solver closes sooner, because its bound is higher
  3. No difference: the solver works on the integer points, which are the same
  4. With the second the dual bound starts closer to the optimum, so in general less space remains to be explored
Explanation. The dual bound comes from the relaxation: the closer it is to the integer optimum (tighter formulation), the less work remains to close the gap. The integer optimum is the same because the integer points are the same.
mip-f-308 · level facile · notes
Minimisation problem: a heuristic gives $\ub = 0$ and a hand-built dual gives $\lb = -4$. How is the gap between the two bounds reported, following the course convention?
  1. As $(\ub - \lb)/|\lb| = 100\%$
  2. As an infinite gap, so the bounds are useless
  3. With the absolute difference $\ub - \lb = 4$, because the denominator $|\ub|$ is zero
  4. As $0\%$, because $\ub = 0$
Explanation. The relative gap divides by $|\ub|$; if it is zero it is not written and the absolute difference is reported, here $0 - (-4) = 4$.
mip-f-309 · level ipotesi · notes
Timetabling model: $x_i \in \{0,1\}$ equals $1$ if job $i$ is scheduled, $I_f$ is the set of jobs occupying slot $f$. One writes $\sum_{i \in I_f} x_i = 1$ for every slot, but the text only asks that no slot contains two jobs. What happens?
  1. The model becomes a covering, which is the right choice for timetables
  2. The model is too restrictive: it forces every slot to be filled and may become infeasible or lose the optimum; the packing $\le 1$ was needed
  3. The model is too loose: it allows two jobs in the same slot
  4. Nothing: equality and $\le 1$ are equivalent with binary variables
Explanation. «Not two jobs» is at most one, a packing. The equality adds «at least one», which the text does not ask: it cuts feasible solutions (empty slots), so it may worsen the optimum or make the model infeasible.
mip-f-310 · level teorema · notes
**Maximisation** MILP with binary variables: $\zmilp$ integer optimum, $\zlpp$ relaxation with $0 \le x \le 1$, $\zlp$ relaxation with $x \ge 0$ only, $\zdual$ optimum of the dual of the latter, $\ub(\bar\pi)$ value of any feasible dual solution. Which chain is correct?
  1. $\ub(\bar\pi) \le \zdual = \zlp \le \zlpp \le \zmilp$
  2. $\zmilp \le \zlpp \le \zlp \le \ub(\bar\pi) \le \zdual$
  3. $\zmilp \le \zlpp \le \zlp = \zdual \le \ub(\bar\pi)$
  4. $\zmilp \le \zlp \le \zlpp = \zdual \le \ub(\bar\pi)$
Explanation. Dropping constraints in a maximisation does not lower the optimum: $\zmilp \le \zlpp \le \zlp$. By strong duality $\zlp = \zdual$, and the dual is a minimisation, so each of its feasible solutions is worth at least $\zdual$.
mip-f-500 · level facile · notes
Model: $\max 5y_1 + 4y_2 + 6y_3$ with $y_1 + y_2 + y_3 \le 2$, $y_1 + y_3 \ge 1$, $y_k \in \{0,1\}$ ($y_k = 1$ if project $k$ is funded). What does the constraint $y_1 + y_3 \ge 1$ express, and what is the model's class?
  1. At least one of projects 1 and 3; MILP
  2. At most one of projects 1 and 3; BIP
  3. At least one of projects 1 and 3; BIP
  4. Exactly one of projects 1 and 3; ILP
Explanation. A $\ge 1$ constraint on binaries is a covering («at least one»). All variables are binary, so the model is a BIP (a special case of ILP, but BIP is the most precise class).
mip-f-501 · level facile · notes
MILP: $\max 3x_1 + 8x_2 - 10y$ with $x_1 + x_2 = 6$, $x_2 - 4y \le 0$, $x_1 \ge 1$, $x_1, x_2 \ge 0$, $y \in \{0,1\}$ ($y = 1$ if the plant is active). What does the constraint $x_2 - 4y \le 0$ impose?
  1. The plant is active only if $x_2 = 4$
  2. The second product is made only with the plant off
  3. At least $4$ units of the second product are made
  4. The second product is made only with the plant active, and at most $4$ units
Explanation. With $y = 0$ it leaves $x_2 \le 0$; with $y = 1$ it leaves $x_2 \le 4$. It is an activation link with the capacity as coefficient.
mip-f-502 · level facile · notes
Problem $\max x_1 + x_2$ with $2x_1 + 2x_2 \le 3$, $x \in \{0,1\}^2$. The relaxation with $0 \le x \le 1$ has infinitely many optimal solutions, among them $(1, 1/2)$. What does rounding $(1, 1/2)$ down give?
  1. $(1, 1)$, infeasible
  2. $(1, 0)$, feasible but not optimal
  3. $(0, 0)$, feasible with value $0$
  4. $(1, 0)$, feasible with value $1$: the integer optimum
Explanation. Down $1/2 \to 0$: $(1, 0)$ is worth $1 = \zmilp$. From $(3/4, 3/4)$ instead rounding down gives $(0, 0)$: the outcome depends on the starting point, there is no «right» direction.
mip-f-503 · level facile · notes
**Maximisation** problem: a heuristic finds $\lb = 45$, the solver certifies the integer optimum $\zmilp = 50$. What is the heuristic gap $|\lb - \zmilp| / |\zmilp|$?
  1. $90\%$
  2. $11.1\%$
  3. $10\%$
  4. $5\%$
Explanation. $5/50 = 10\%$. Dividing by the heuristic value gives $11.1\%$; $5$ is the absolute gap.
mip-f-504 · level facile · notes
Assignment with $x_{jm} \in \{0,1\}$ ($1$ if job $j$ goes on machine $m$). «Every job goes on one machine, and every machine receives at most one job»: which patterns appear, in order?
  1. Set covering and set partitioning
  2. Set partitioning ($\sum_m x_{jm} = 1$) and set packing ($\sum_j x_{jm} \le 1$)
  3. Set packing and set covering
  4. Set partitioning in both cases
Explanation. «Exactly one machine» per job is a partitioning; «at most one job» per machine is a packing.
mip-f-505 · level ipotesi · notes
Gurobi stops on the time limit on a minimisation MILP with `ObjVal` $= 120$ and `ObjBound` $= 110$. A student writes «the optimum is $115$, halfway between the two». What is wrong?
  1. Nothing: without further information the midpoint is the correct estimate
  2. The bounds only guarantee $110 \le \zmilp \le 120$: where the optimum lies in the interval is unknown
  3. The optimum is certainly $110$, because it is the dual bound
  4. The optimum is certainly $120$, because it is a solution found
Explanation. When the optimum is not reached, the only certainty is the sandwich between the best solution and the dual bound. No interior point is privileged.
mip-f-530 · level facile · notes
Minimisation ILP: $\min 4x_1 + 7x_2$ with $2x_1 + 3x_2 \ge 12$, $x_1 + x_2 \le 5$, $x_1, x_2 \in \mathbb{Z}_{\ge 0}$ (lots bought from two suppliers). Is the solution $(x_1, x_2) = (3, 2)$ feasible? What is it worth?
  1. Yes, it is worth $24$
  2. No: it violates $x_1 + x_2 \le 5$
  3. Yes, it is worth $26$
  4. No: it violates $2x_1 + 3x_2 \ge 12$
Explanation. $2 \cdot 3 + 3 \cdot 2 = 12 \ge 12$ and $3 + 2 = 5 \le 5$: feasible, value $4 \cdot 3 + 7 \cdot 2 = 26$. It is an upper bound on the optimum, because the problem is a minimisation.
mip-f-531 · level facile · notes
Minimisation MILP with binaries; $\zlp$ is the relaxation with $x \ge 0$ only, $\zlpp$ the one with $0 \le x \le 1$. Why is the relaxation an **optimistic** bound?
  1. Because the solver solves it first
  2. Because it always lies above the integer optimum, in every problem
  3. Because its solutions are always integer
  4. It drops constraints: it optimises over a set containing all integer solutions, so it cannot do worse than the integer optimum
Explanation. Every integer solution stays feasible for the relaxation: in a minimisation the relaxation lies below (or at) the integer optimum, in a maximisation above. In both cases on the «better» side.
mip-f-532 · level facile · notes
Minimisation problem: $\ub = 80$ from a heuristic, $\lb = 72$ from a hand-built dual, integer optimum unknown. What is the certified gap $(\ub - \lb)/|\ub|$?
  1. $11.1\%$
  2. $90\%$
  3. $10\%$
  4. $8$
Explanation. $(80 - 72)/80 = 8/80 = 10\%$. Dividing by $\lb$ gives $11.1\%$; $8$ is the absolute gap; $90\%$ is $\lb/\ub$.

2. Relaxations, duality and bounds (58)

mip-f-013 · level facile · notes
One writes the dual of a **minimisation** linear programme (the primal). A primal constraint of direction $\ge$ corresponds in the dual to a variable $\pi_i$ with which sign?
  1. $\pi_i \in \{0,1\}$
  2. $\pi_i \le 0$
  3. $\pi_i$ free
  4. $\pi_i \ge 0$
Explanation. In the conversion table, for a minimisation primal: a $\ge$ constraint gives $\pi_i \ge 0$, a $\le$ constraint gives $\pi_i \le 0$, an equality gives a free $\pi_i$.
mip-f-014 · level facile · notes
Lot sizing, **minimisation** primal: $x_t$ is the production of period $t$, $s_t$ the stock at the end of the period, $d_t$ the demand. What is the sign of the dual variable of the balance constraint $x_t + s_{t-1} - s_t = d_t$?
  1. Free
  2. It depends on the sign of $d_t$
  3. $\ge 0$
  4. $\le 0$
Explanation. An equality constraint corresponds to a free dual variable, whatever the direction of the objective and whatever the right-hand side.
mip-f-015 · level facile · notes
**Minimisation** primal $\min \sum_j c_j x_j$. A **free** primal variable $x_j$ (no sign constraint) corresponds in the dual to a constraint of which kind?
  1. An equality $= c_j$
  2. An inequality $\le c_j$
  3. An inequality $\ge c_j$
  4. No dual constraint
Explanation. A variable $x_j \ge 0$ gives a dual constraint $\le c_j$; a free variable gives an equality constraint $= c_j$.
mip-f-016 · level facile · notes
Minimum-cost assignment of jobs $j$ to machines $m$: $x_{jm}$ assigns, $t_{jm}$ is the time, $a_m$ the availability. What is the sign of the dual variable $\pi_m$ of the constraint $\sum_j t_{jm} x_{jm} \le a_m$?
  1. $\pi_m \ge 0$
  2. always $\pi_m = 0$
  3. $\pi_m$ free
  4. $\pi_m \le 0$
Explanation. In a minimisation primal a $\le$ constraint gives a non-positive dual variable. This is why setting $\bar\pi = 0$ (the "zero out and saturate" recipe) is always feasible for those constraints.
mip-f-017 · level facile · notes
MILP with integer optimum $\zmilp$ and relaxation (with bounds) of value $\zlpp$. What is a **valid inequality**?
  1. An inequality satisfied by all the feasible integer solutions; if it reduces $\zlpp$ it is a cut
  2. An inequality that always reduces $\zmilp$ and leaves the relaxation unchanged
  3. An inequality satisfied by the optimal solution of the relaxation, which therefore leaves $\zlpp$ unchanged
  4. An inequality satisfied by at least one optimal integer solution; if it reduces $\zlpp$ it is a cut
Explanation. Valid means satisfied by every feasible integer solution, hence it does not change $\zmilp$. A constraint that cuts off some feasible solutions but not all the optimal ones preserves optimality, and is not valid.
mip-f-018 · level facile · notes
Binary knapsack: weights $w = (5, 4, 3, 3)$, capacity $9$, i.e. $5x_1 + 4x_2 + 3x_3 + 3x_4 \le 9$ with $x_j \in \{0,1\}$. Which of the following is a **valid** inequality (satisfied by every feasible solution)?
  1. $x_3 + x_4 \le 1$
  2. $x_1 + x_2 \le 1$
  3. $x_2 + x_3 + x_4 \le 1$
  4. $x_1 + x_2 + x_3 \le 2$
Explanation. $\{1,2,3\}$ is a cover ($5+4+3 = 12 > 9$), so the three items do not fit together and $x_1 + x_2 + x_3 \le 2$ is valid. The others cut off feasible solutions: items 3 and 4 fit together ($6 \le 9$), and so do items 1 and 2 ($9 \le 9$).
mip-f-019 · level facile · notes
**Maximisation** MILP. A constructive heuristic returns a feasible integer solution; a feasible solution of the dual of the relaxation is built by hand. Which bounds do they give on the integer optimum?
  1. Both a lower bound
  2. The heuristic an upper bound, the dual a lower bound
  3. The heuristic a lower bound, the dual an upper bound
  4. Both an upper bound
Explanation. The name depends on the direction, the role does not: the feasible solution is on the pessimistic side (in a maximisation, below the optimum), the dual on the optimistic side (above).
mip-f-020 · level facile · notes
Minimisation covering model with linear relaxation $\zlp = 15/2$ and integer optimum $\zmilp = 10$. Gurobi reports `ObjBound = 10` (the final dual bound) and `NodeCount = 0` (no node explored). What does one conclude?
  1. The written model has an exact relaxation, and the hand-made dual can also reach $10$
  2. The linear relaxation of the written model is worth $10$, so the stated value $15/2$ is wrong
  3. The solver closed the gap at the root with presolve, cuts and heuristics; the relaxation of the written model is read with `relax()`
  4. The solver found the optimum without using bounds, and `ObjBound` equals `ObjVal` by construction
Explanation. `ObjBound` is not the root relaxation of the written model: the solver strengthens it on its own. The relaxation that matters for the hand-made bounds is that of the written model, and it is obtained with `relax()`.
mip-f-021 · level media · notes
Binary maximisation knapsack with capacity $b$. With $b = 9$ the integer optimum is $17$ and the optimal dual variable of the capacity constraint in the linear relaxation is $7/4$; with $b = 10$ the integer optimum is still $17$. By how much does the integer optimum really change going from $b = 9$ to $b = 10$?
  1. By $0$
  2. By $1$
  3. By $17/9$
  4. By $7/4$
Explanation. The integer optimum stays $17$: the true change is zero, while the LP dual promises $7/4$ per unit of capacity. LP duals are not the marginal prices of the MILP; the only correct answer is to solve the MILP again.
mip-f-022 · level media · notes
Multi-resource maximisation knapsack: $\max \sum_j p_j x_j$ with $\sum_j a_{ij} x_j \le b_i$ for every resource $i$. A dual solution is built by pricing **one** resource $i$ only, with $\bar v_i = \max_j p_j / a_{ij}$, and the others at zero. With $b_i = 10$ and the ratios $p_j/a_{ij}$ equal to $5/3,\ 9/4,\ 7/3,\ 2,\ 2$, which bound is obtained?
  1. $\ub = 20$
  2. $\lb = 70/3$
  3. $\ub = 70/3$
  4. $\ub = 45/2$
Explanation. The largest ratio is $7/3$ and every dual constraint $\sum_i a_{ij} v_i \ge p_j$ is satisfied by the single term $a_{ij}\bar v_i$: the solution is feasible and, in a maximisation, gives $\ub = b_i \bar v_i = 10 \cdot 7/3 = 70/3$. With a smaller ratio the dual would be infeasible.
mip-f-023 · level teorema · notes
Minimisation primal $\min \sum_j c_j x_j$ and its dual $\max \sum_i b_i \pi_i$; $\bar x$ and $\bar\pi$ are feasible solutions of the two problems. Which statement is **weak duality**?
  1. For every pair of feasible solutions, $\sum_i b_i \bar\pi_i \ge \sum_j c_j \bar x_j$
  2. If both solutions are optimal, $\sum_i b_i \bar\pi_i \le \sum_j c_j \bar x_j$
  3. For every pair of feasible solutions, $\sum_i b_i \bar\pi_i = \sum_j c_j \bar x_j$
  4. For every pair of feasible solutions, $\sum_i b_i \bar\pi_i \le \sum_j c_j \bar x_j$
Explanation. Weak duality holds for every feasible pair, with no further assumption, and gives a lower bound from any feasible dual solution, even a hand-made one. Equality between the optima is strong duality.
mip-f-024 · level teorema · notes
MILP with optimum $\zmilp$, linear relaxation with optimum $\zlp$ and dual of the relaxation with optimum $\zdual$. Which statement is correct?
  1. If the MILP has a finite optimum, $\zdual = \zmilp$
  2. If the relaxation has a finite optimum, $\zdual = \zlp$
  3. The MILP has a linear dual whose optimum coincides with $\zmilp$
  4. $\zdual < \zlp$ whenever the MILP has integer variables
Explanation. Strong duality holds between the relaxation and its dual, and serves as a check on the computations. Between the MILP and a linear programme it does not hold in general: the jump between $\zlp$ and $\zmilp$ is precisely what is missing.
mip-f-025 · level teorema · notes
Two formulations $A$ and $B$ of the same integer problem; $X_A$ and $X_B$ are the polyhedra of their linear relaxations. When is $B$ **stronger** than $A$?
  1. When they admit the same integer points and $X_B \subseteq X_A$
  2. When they admit the same integer points and $X_A \subseteq X_B$
  3. When they admit the same integer points and $B$ has more constraints than $A$
  4. When they admit the same integer points and the solver solves $B$ faster
Explanation. The comparison is done in two steps: same integer set, then inclusion of the polyhedra. Stronger means neither faster nor with more rows: strength is proved, speed is measured.
mip-f-026 · level ipotesi · notes
Minimisation MILP. $\bar\pi$ is a hand-made solution of the dual of the linear relaxation, of value $\sum_i b_i \bar\pi_i$. To use that value as a lower bound on $\zmilp$, what is needed?
  1. That $\bar\pi$ be dual feasible, weak duality, and the fact that the relaxation contains the solutions of the MILP
  2. That $\bar\pi$ satisfy complementary slackness with an optimal solution of the MILP, and weak duality
  3. That $\bar\pi$ be dual feasible, and strong duality between the MILP and the dual of the relaxation
  4. That $\bar\pi$ be dual optimal, strong duality, and the fact that the relaxation contains the solutions of the MILP
Explanation. Dual feasibility suffices: by weak duality $\sum_i b_i \bar\pi_i \le \zlp$ and, since the relaxation contains the solutions of the MILP, $\zlp \le \zmilp$. Optimality is not needed; checking every dual constraint is.
mip-f-027 · level ipotesi · notes
Assignment model with binaries $x_{jm}$ and constraints $\sum_m x_{jm} = 1$ for every $j$. $\zlp$ is the relaxation with only $x \ge 0$, $\zlpp$ that with $x \le 1$ as well. To prove $\zlp = \zlpp$, what is needed?
  1. That those constraints, with $x \ge 0$, already imply $x_{jm} \le 1$
  2. That the matrix of the model be totally unimodular
  3. Strong duality between the two linear relaxations
  4. That the MILP have a unique optimal integer solution
Explanation. With $x \ge 0$ and a sum equal to $1$ every term is at most $1$: the second relaxation adds constraints that are already implied, so it has the same feasible set and the same optimum.
mip-f-028 · level ipotesi · notes
A constraint is added to a MILP. To declare it a **valid inequality**, and not merely a constraint that preserves optimality (that keeps at least one optimal solution), what must be proved?
  1. That it is satisfied by at least one optimal integer solution
  2. That it is satisfied by the optimal solution of the relaxation
  3. That it reduces the value of the linear relaxation
  4. That it is satisfied by all the feasible integer solutions
Explanation. Valid means satisfied by every feasible integer solution. If it cuts off some feasible solution but keeps at least one optimum, the constraint preserves optimality and must be declared as such.
mip-f-156 · level facile · notes
Two-resource maximisation knapsack: $\max \sum_j p_j x_j$ with $\sum_j a_{ij} x_j \le b_i$, $i = 1, 2$, and $b = (10, 12)$. Dual recipe: price **one** resource $i$ only with $\bar v_i = \max_j p_j / a_{ij}$ and the other at zero; the bound is $b_i \bar v_i$. The largest ratios are $7/3$ for resource 1 and $2$ for resource 2. Which resource should be priced, and with which bound?
  1. Resource 2, $\ub = 20$
  2. Resource 1, $\lb = 70/3$
  3. Resource 2, $\ub = 24$
  4. Resource 1, $\ub = 70/3$
Explanation. Both choices are feasible and give an upper bound (maximisation): $10 \cdot 7/3 = 70/3 \approx 23.3$ and $12 \cdot 2 = 24$. One keeps the lower, $70/3$. $20$ multiplies the ratio of resource 2 by the $b$ of resource 1.
mip-f-157 · level facile · notes
Minimisation problem, solved with a heuristic, a hand-made dual and the solver: $\ub = 12$ (heuristic), $\lb = 9$ (hand-made dual), $\zlp = 10$, $\zmilp = 11$. Which of these numbers is inconsistent with the others?
  1. $\lb = 9$, because it must coincide with $\zlp$
  2. $\zlp = 10$, because it must coincide with $\zmilp$
  3. $\ub = 12$, because it must coincide with $\zmilp$
  4. None: $9 \le 10 \le 11 \le 12$ is the expected chain
Explanation. In a minimisation $\lb \le \zlp \le \zmilp \le \ub$ holds: the hand-made dual need not be optimal, the heuristic need not find the optimum and the relaxation need not be exact. A number outside this chain would signal a mistake.
mip-f-190 · level facile · notes
Minimisation problem $\min \{f(x) : x \in X\}$. Which of the following problems is a **relaxation**, that is, has an optimum no larger than that of the given problem?
  1. $\max \{f(x) : x \in X\}$, that is, the same set with the opposite sense
  2. $\min \{f(x) + 1 : x \in X\}$, that is, the same set with the objective raised
  3. $\min \{f(x) : x \in \hat X\}$ with $\hat X \subseteq X$, for example by adding a constraint
  4. $\min \{f(x) : x \in \hat X\}$ with $X \subseteq \hat X$, for example by dropping a constraint
Explanation. A relaxation has the same objective and a larger feasible set: the minimum over a larger set cannot be higher. Adding a constraint gives a restriction, which in a minimisation cannot lower the optimum.
mip-f-191 · level facile · notes
Minimisation linear programme $\min 3x_1 + 5x_2$ with $x_1 + x_2 \ge 4$, $x_1 + 3x_2 \ge 6$, $x \ge 0$. Its dual is $\max 4\pi_1 + 6\pi_2$ with $\pi_1 + \pi_2 \le 3$, $\pi_1 + 3\pi_2 \le 5$, $\pi \ge 0$. What does the dual solution $\bar\pi = (2, 1)$ give?
  1. $\lb = 14$, because $\bar\pi$ is dual feasible
  2. No bound, because $\bar\pi$ violates a dual constraint
  3. $\lb = 3$, the sum of the components of $\bar\pi$
  4. $\ub = 14$, because $\bar\pi$ is dual feasible
Explanation. Check: $2 + 1 = 3 \le 3$ and $2 + 3 = 5 \le 5$, so $\bar\pi$ is feasible and is worth $4 \cdot 2 + 6 \cdot 1 = 14$. In a minimisation a feasible dual gives a lower bound (weak duality).
mip-f-192 · level facile · notes
Minimum-cost covering: $\min \sum_j c_j x_j$ with $\sum_{j \in S_i} x_j \ge 1$ for every zone $i$ ($S_i$ = teams covering zone $i$) and $x_j \in \{0,1\}$. What is the dual of the relaxation with only $x \ge 0$?
  1. $\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \le c_j$ for every $j$, $\pi \ge 0$
  2. $\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \le c_j$ for every $j$, $\pi$ free
  3. $\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \ge c_j$ for every $j$, $\pi \ge 0$
  4. $\min \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \le c_j$ for every $j$, $\pi \ge 0$
Explanation. Minimisation primal with $\ge$ constraints: maximisation dual with $\pi_i \ge 0$, one per zone; to each variable $x_j \ge 0$ corresponds a dual constraint $\le c_j$ summing the $\pi_i$ of the zones covered by $j$.
mip-f-193 · level facile · notes
A covering model (minimisation) is closed by Gurobi with `NodeCount = 0` (no branching). Switching off the solver's presolve, cuts and heuristics (`Presolve = Cuts = Heuristics = 0`) the same model needs $5$ nodes. What can be concluded?
  1. The written model becomes stronger, because it needs more nodes to close the gap
  2. The relaxation of the written model gets worse, because switching off cuts weakens it
  3. The optimum does not change: how hard a model is depends on the solver too, not on the model alone
  4. The optimum changes, because without cuts the solver solves a different model
Explanation. Presolve, cuts and heuristics are tools of the solver: they change the work needed, not the model nor its optimum. The relaxation of the written model (the one of `relax()`) stays the same.
mip-f-194 · level teorema · notes
Maximisation MILP with a capacity constraint $\sum_j w_j x_j \le b$. $\tilde v$ is the optimal dual variable of that constraint in the linear relaxation. Which statement about moving from $b$ to $b + 1$ is correct?
  1. $\zmilp$ grows at least by $\tilde v$, because the relaxation lies above the integer optimum
  2. $\zmilp$ grows exactly by $\tilde v$, as in linear programming
  3. $b \tilde v$ is still an upper bound, but the change in $\zmilp$ is obtained only by solving the MILP again
  4. $\zmilp$ grows at most by $\tilde v$, and the difference is a rounding error
Explanation. The LP marginal price does not describe the integer optimum, which changes in jumps (by $0$ or by more than $\tilde v$). What remains true of the dual is its use as a bound; the true change is $\zmilp(b + 1) - \zmilp(b)$, to be computed.
mip-f-195 · level facile · notes
Two formulations $A$ and $B$ of the same integer problem admit the same integer points, and the polyhedra of their relaxations satisfy $X_B \subseteq X_A$. $B$ has more constraints and on the test instance the solver solves it more slowly. Which conclusion is correct?
  1. Neither is stronger, because they have the same integer points
  2. $A$ is stronger than $B$, because the solver solves it faster
  3. $A$ is stronger than $B$, because it has fewer constraints and a larger relaxation
  4. $B$ is stronger than $A$: strength is proved with the polyhedra, speed is measured
Explanation. Stronger means a contained relaxation, $X_B \subseteq X_A$, with the same integer points. A stronger formulation has fewer nodes but more rows, so it can be slower: they are two different properties.
mip-f-196 · level facile · notes
In the course's bound protocol, for every MILP the dual of a relaxation is written by hand and a feasible solution of it is built. Of which relaxation?
  1. Of the relaxation strengthened with the valid inequalities
  2. Of the relaxation without the bounds, with the binaries replaced by $x \ge 0$
  3. Of the relaxation with the bounds, with the binaries replaced by $0 \le x \le 1$
  4. Of the root relaxation computed by the solver after presolve and cuts
Explanation. The hand-made dual is that of $\mathit{LP}$, without the bounds: it has fewer primal constraints, hence fewer dual variables. The relaxation with the bounds, $\mathit{LP}^+$, is computed by the solver with `relax()`.
mip-f-311 · level teorema · notes
**Minimisation** MILP with binaries. $\zlp$: relaxation with $x \ge 0$ only; $\zlpp$: with $0 \le x \le 1$; $z(\mathit{LP}^{++})$: like $\zlpp$ plus some valid inequalities. Which chain always holds?
  1. $\zlp \le \zlpp \le z(\mathit{LP}^{++}) \le \zmilp$
  2. $\zmilp \le z(\mathit{LP}^{++}) \le \zlpp \le \zlp$
  3. $\zlpp \le \zlp \le z(\mathit{LP}^{++}) \le \zmilp$
  4. $\zlp \le \zlpp \le \zmilp \le z(\mathit{LP}^{++})$
Explanation. Each step adds constraints satisfied by all integer solutions: the feasible set shrinks without losing integer points, so in a minimisation the value can only rise, staying below $\zmilp$.
mip-f-312 · level facile · notes
In the course protocol the dual is written by hand for the relaxation **without** bounds ($x \in \{0,1\}$ becomes $x \ge 0$), not for the one with $0 \le x \le 1$. Why?
  1. It has fewer constraints, so the dual has fewer variables and is simpler to build by hand
  2. It always gives a tighter bound than the one with bounds
  3. It is the relaxation that Gurobi solves with `relax()`
  4. It is the only one of the two for which weak duality holds
Explanation. Without the constraints $x \le 1$ the dual loses one family of variables. The bound is equal to or weaker than the one with bounds (not tighter); `relax()` keeps the bounds; weak duality holds for both.
mip-f-313 · level teorema · notes
Minimisation linear programme $\min \sum_j c_j x_j$ (the primal) with finite optimum, and its dual $\max \sum_i b_i \pi_i$. What does **strong duality** state, and what is it used for in the course?
  1. The dual optimum coincides with the integer optimum of the MILP whose relaxation is the primal
  2. The two optima coincide; it serves as a check: the optimum of the hand-written dual must equal the primal optimum
  3. The two optima differ by at most the gap; it serves to estimate `MIPGap`
  4. Every feasible dual solution is worth as much as the primal optimum; it serves to build exact bounds by hand
Explanation. Strong duality: with finite optimum, $z(D(\mathit{LP})) = \zlp$. Arbitrary feasible dual solutions are worth at most $\zlp$ (weak duality), and between the MILP and the dual of the relaxation the jump $\zmilp - \zlp$ remains in general.
mip-f-314 · level ipotesi · notes
A student writes: «by strong duality the optimum of the dual of the relaxation equals $\zmilp$, so an optimal dual solution certifies the integer optimum». What is wrong?
  1. Nothing: strong duality holds for any programme, integer ones included
  2. Strong duality ties the dual to the relaxation: $z(D) = \zlp$, which in general differs from $\zmilp$; the MILP has no linear dual
  3. Strong duality holds only for maximisation problems
  4. Strong duality requires the dual solution to be integer
Explanation. The dual being written is that of the linear relaxation. Between the MILP and any linear programme strong duality does not hold in general: the jump $\zmilp - \zlp$ is exactly what is missing.
mip-f-315 · level facile · notes
Minimum-cost assignment with availabilities: $\sum_m x_{jm} = 1$ for every job $j$ (dual $\mu_j$ free) and $\sum_j t_{jm} x_{jm} \le a_m$ for every machine $m$ (dual $\pi_m \le 0$); dual constraints $\mu_j + t_{jm}\pi_m \le c_{jm}$. The «zero and saturate» recipe sets $\bar\pi = 0$. Which value of $\bar\mu_j$ is the largest feasible one?
  1. $\bar\mu_j = \min_m c_{jm}$
  2. $\bar\mu_j = \min_m c_{jm} / t_{jm}$
  3. $\bar\mu_j = \max_m c_{jm}$
  4. $\bar\mu_j = \sum_m c_{jm}$
Explanation. With $\pi = 0$ the dual constraints become $\mu_j \le c_{jm}$ for every $m$: the largest value is the minimum of the row costs. The bound is $\sum_j \min_m c_{jm}$: «every job costs at least its minimum cost».
mip-f-316 · level ipotesi · notes
Binary maximisation knapsack $\max \sum_j p_j x_j$ with $\sum_j w_j x_j \le b$. Dual of the relaxation without bounds: $\min b\,v$ with $w_j v \ge p_j$ for every $j$, $v \ge 0$. A student picks $\bar v = \min_j p_j/w_j$ and reports $\ub = b\,\bar v$. What is wrong?
  1. The right bound is $\bar v / b$, not $b\,\bar v$
  2. $\bar v$ violates the dual constraints of the items with higher ratio: the bound holds only with $\bar v = \max_j p_j / w_j$
  3. In a maximisation the dual gives a lower bound, not an upper bound
  4. Nothing: any value of $v$ gives an upper bound by weak duality
Explanation. Weak duality holds for **feasible** dual solutions: one needs $v \ge p_j/w_j$ for every $j$, that is, $v \ge \max_j p_j/w_j$. With the minimum ratio at least one constraint is violated and $b\,\bar v$ is not a bound.
mip-f-317 · level facile · notes
Minimum-cost covering: four teams with cost $c = (6, 6, 8, 8)$, six zones, and zone $i$ is covered by the teams $S_i$: $\{1,2\}, \{2,3\}, \{1,3\}, \{1,4\}, \{2,4\}, \{3,4\}$. The dual of the relaxation has $\pi_i \ge 0$ per zone and one constraint per team: the sum of the $\pi_i$ of the zones it covers does not exceed its cost. What does $\bar\pi_i = 1$ for every zone give?
  1. It is feasible and gives $\lb = 28$, the sum of the costs
  2. It is feasible and gives $\ub = 6$
  3. It is infeasible, because team 1 receives $6$
  4. It is feasible (every team covers $3$ zones, $3 \le 6$) and gives $\lb = 6$
Explanation. Every team appears in three zones, so it receives $3 \le c_j$: feasible. The value is $\sum_i \bar\pi_i = 6$ and, in a minimisation, a feasible dual gives a lower bound.
mip-f-318 · level facile · notes
Minimum-cost covering, with $x_j \in \{0,1\}$ team chosen and constraints $\sum_{j \in S_i} x_j \ge 1$ for every zone $i$. Writing the dual of the relaxation (minimisation primal), what sign has the dual variable $\pi_i$ of a zone and what sense has the dual constraint of a team $j$?
  1. $\pi_i \ge 0$; constraint $\sum_{i : j \in S_i} \pi_i \le c_j$
  2. $\pi_i \le 0$; constraint $\sum_{i : j \in S_i} \pi_i \le c_j$
  3. $\pi_i$ free; constraint $\sum_{i : j \in S_i} \pi_i = c_j$
  4. $\pi_i \ge 0$; constraint $\sum_{i : j \in S_i} \pi_i \ge c_j$
Explanation. Table for a minimisation primal: $\ge$ constraint → dual variable $\ge 0$; variable $x_j \ge 0$ → dual constraint of sense $\le c_j$.
mip-f-319 · level facile · notes
Multi-resource knapsack, **maximisation**: $\max \sum_j p_j x_j$ with $\sum_j a_{ij} x_j \le b_i$ for every resource $i$ and $x_j \in \{0,1\}$. In the dual of the relaxation without bounds, what sign do the variables $\pi_i$ have and what sense do the dual constraints have?
  1. $\pi_i \ge 0$, constraints $\sum_i a_{ij} \pi_i \le p_j$, objective $\min \sum_i b_i \pi_i$
  2. $\pi_i \ge 0$, constraints $\sum_i a_{ij} \pi_i \ge p_j$, objective $\min \sum_i b_i \pi_i$
  3. $\pi_i$ free, constraints $\sum_i a_{ij} \pi_i = p_j$, objective $\min \sum_i b_i \pi_i$
  4. $\pi_i \le 0$, constraints $\sum_i a_{ij} \pi_i \le p_j$, objective $\max \sum_i b_i \pi_i$
Explanation. In a maximisation the senses flip: $\le$ constraint → $\pi_i \ge 0$, variable $x_j \ge 0$ → dual constraint $\ge p_j$, and the dual is a minimisation. Each of its feasible solutions gives an upper bound.
mip-f-320 · level teorema · notes
**Maximisation** MILP. A heuristic returns a feasible integer solution $\bar x$; a feasible solution $\bar\pi$ of the dual of the relaxation is built by hand. Which pair of statements is correct?
  1. $\bar x$ gives $\ub(\bar x) \ge \zmilp$ and $\bar\pi$ gives $\lb(\bar\pi) \le \zmilp$
  2. Both give an upper bound, because the problem is a maximisation
  3. $\bar x$ gives $\lb(\bar x) \le \zmilp$ and $\bar\pi$ gives $\ub(\bar\pi) \ge \zmilp$
  4. $\bar x$ gives $\lb(\bar x)$ and $\bar\pi$ gives another $\lb$, on the same side
Explanation. In a maximisation a feasible solution is worth at most the optimum (lower bound, pessimistic side); the dual of the relaxation is a minimisation and each of its feasible solutions is worth at least $\zlp \ge \zmilp$ (upper bound).
mip-f-321 · level facile · notes
Binary knapsack with constraint $5x_1 + 4x_2 + 3x_3 + 3x_4 \le 9$. A set $S$ of items is a **cover** if $\sum_{j \in S} w_j > 9$; then $\sum_{j \in S} x_j \le |S| - 1$ is valid. Which of the following sets is a **minimal** cover (removing any item it is no longer a cover)?
  1. $\{3, 4\}$
  2. $\{1, 2, 3, 4\}$
  3. $\{1, 2\}$
  4. $\{1, 3, 4\}$
Explanation. $\{1,3,4\}$ weighs $11 > 9$; removing one item leaves $8$, $8$ or $6$, all $\le 9$. $\{1,2\}$ weighs $9$, it does not exceed the capacity; $\{1,2,3,4\}$ is a cover but not minimal; $\{3,4\}$ weighs $6$.
mip-f-322 · level facile · notes
One wants to prove that formulation $B$ of an integer problem is **stronger** than formulation $A$. Which are the two required steps?
  1. (1) $X_A \subseteq X_B$; (2) the relaxation of $B$ is worth more than that of $A$
  2. (1) $B$ has the same integer optimum as $A$; (2) $B$ has fewer variables
  3. (1) $A$ and $B$ have exactly the same integer points; (2) the relaxation polyhedra satisfy $X_B \subseteq X_A$
  4. (1) $B$ has fewer constraints than $A$; (2) $B$ is solved faster by Gurobi
Explanation. Without the same integer set nothing is being compared; then strength is the inclusion of the polyhedra. Speed is not proved, it is measured, and a stronger formulation often has more rows.
mip-f-323 · level ipotesi · notes
The disaggregated formulation $x_{ij} \le y_j$ is stronger than the aggregated one $\sum_i x_{ij} \le n\,y_j$. A student concludes: «so with Gurobi the disaggregated one is always faster». What is missing in the reasoning?
  1. The disaggregated one admits extra integer points, so it must be compared with another formulation
  2. The disaggregated one is not stronger: the two formulations have the same relaxation
  3. Nothing: a stronger formulation explores fewer nodes, so it is always faster
  4. Strength concerns the relaxation and is proved; speed also depends on the cost of each node (more rows) and must be measured
Explanation. Stronger means a tighter relaxation, hence typically fewer nodes; but the disaggregated one has many more rows and each node costs more. What is proved is strength; speed is measured.
mip-f-324 · level facile · notes
On a covering model (minimisation) the relaxation of the written model is worth $15/2$, the integer optimum $10$. Gurobi closes with `NodeCount = 0`. With `Presolve = Cuts = Heuristics = 0` the same model needs $5$ nodes. What does the comparison teach?
  1. `NodeCount = 0` means that the solver did not solve the relaxation
  2. Difficulty is not a property of the model alone: the solver's presolve, cuts and heuristics close the gap already at the root
  3. The relaxation of the written model is worth $10$, not $15/2$
  4. With the parameters set to zero Gurobi finds a different optimum
Explanation. The same model gives the same optimum, but the work changes with the solver's tools. The relaxation used in the hand-made bounds is still that of the written model ($15/2$), obtained with `relax()`.
mip-f-325 · level facile · notes
Binary maximisation knapsack with capacity $b$: with $b = 9$ the integer optimum is $17$, with $b = 10$ it is still $17$; the optimal dual of the capacity constraint in the linear relaxation is $7/4$ for both. By how much does the integer optimum really increase from $b = 9$ to $b = 10$?
  1. $0$
  2. $1$
  3. $17/9$
  4. $7/4$
Explanation. The true change is obtained by solving the MILP again: $17 - 17 = 0$. The LP dual ($7/4$) is the marginal price of the relaxation, not of the integer problem, whose response changes in jumps.
mip-f-326 · level teorema · notes
**Maximisation** MILP with a capacity constraint $\sum_j w_j x_j \le b$. One wants to know how much the integer optimum grows by adding one unit of capacity. Which procedure gives the correct answer?
  1. Read the optimal dual variable of the constraint in the linear relaxation
  2. Solve the MILP again with $b + 1$ and compute $\zmilp(b + 1) - \zmilp(b)$
  3. Multiply the relative gap by $b$
  4. Read the reduced cost of the variable with the highest ratio $p_j/w_j$
Explanation. The dual of the relaxation is still a bound, but as a marginal price of the MILP it is unreliable: the integer problem responds in jumps and has no closed formula. The only correct answer is to solve again.
mip-f-327 · level facile · notes
In the course's bound protocol, for a **minimisation** problem the final table reports $\ub$ (heuristic), $\lb$ (hand-built dual), $\zlp$ and $\zlpp$ (relaxations without and with the bounds $0 \le x \le 1$), $\zmilp$ (integer optimum) and the gap. Which ordering of the first five values must result, if everything is correct?
  1. $\ub \le \zmilp \le \zlpp \le \zlp \le \lb$
  2. $\lb \le \zlpp \le \zlp \le \zmilp \le \ub$
  3. $\zlp \le \lb \le \zlpp \le \zmilp \le \ub$
  4. $\lb \le \zlp \le \zlpp \le \zmilp \le \ub$
Explanation. $\lb$ comes from a feasible dual of the relaxation without bounds, so it is at most $\zlp$; then $\zlp \le \zlpp \le \zmilp$ (more constraints in a minimisation) and $\ub$, the value of a feasible solution, lies above the optimum.
mip-f-328 · level ipotesi · notes
In the bound protocol, a heuristic for a minimisation problem returns a vector that satisfies all linear constraints but has an integer component equal to $2.5$. Can its value be reported as $\ub$?
  1. No, because in a minimisation a feasible solution gives a lower bound
  2. Yes: it satisfies all linear constraints, so the value is an upper bound
  3. Yes, but only after rounding it up, which always stays feasible
  4. No: it is feasible for the relaxation, not for the MILP; the primal bound also requires integrality
Explanation. The feasibility check concerns constraints, bounds **and** integrality. A fractional point is worth as much as a relaxation point, which may lie below $\zmilp$. Rounding may violate the constraints.
mip-f-329 · level facile · notes
**Maximisation** primal $\max \sum_j c_j x_j$. A primal constraint of sense $\le$ and a primal variable $x_j \ge 0$ correspond in the (minimisation) dual to:
  1. a variable $\pi_i \ge 0$ and a constraint of sense $\ge c_j$
  2. a variable $\pi_i \le 0$ and a constraint of sense $\le c_j$
  3. a free variable $\pi_i$ and an equality constraint
  4. a variable $\pi_i \ge 0$ and a constraint of sense $\le c_j$
Explanation. For a maximisation primal the minimisation table flips: $\le$ constraint → $\pi_i \ge 0$; variable $\ge 0$ → dual constraint $\ge c_j$.
mip-f-330 · level teorema · notes
A constraint is added to a MILP. In which case can it be called a **cut**?
  1. If it is satisfied by all feasible integer solutions and reduces the value of the relaxation with bounds
  2. If it is satisfied by at least one optimal solution, even if it cuts feasible ones
  3. If it changes neither the integer optimum nor that of the relaxation
  4. If it removes at least one optimal integer solution
Explanation. A cut is a valid inequality (it excludes no feasible integer point, so $\zmilp$ does not change) that worsens $\zlpp$, that is, brings the relaxation closer to the integer optimum. A constraint that keeps only some optimum preserves optimality but is not valid.
mip-f-350 · level facile · notes
One wants to report the value $\zlpp$ of the linear relaxation (with bounds) of the model **as written**. Why can't the dual bound that Gurobi shows at the root while solving the MILP be used?
  1. The root bound is always weaker than $\zlpp$, because the solver has not started working yet
  2. The root bound coincides with $\zlp$, the relaxation without bounds
  3. The root bound includes the solver's presolve and cuts, so it may be tighter than the relaxation of the written model; `relax()` is needed
  4. Gurobi shows no bound at the root
Explanation. The solver strengthens the model before and during the root: its bound may already equal the integer optimum. The relaxation of the written model is obtained by solving `m.relax()`.
mip-f-506 · level facile · notes
Minimum-cost covering: elements with cost $c = (4, 3, 5, 3)$, zones $1, 2, 3$ covered respectively by $\{1, 2\}$, $\{2, 4\}$, $\{1, 3\}$. «Constructive on the constraints» dual recipe: scan the zones in order, raise $\pi_i$ to the minimum residual among the elements covering it, and subtract $\pi_i$ from the residuals of those elements. Which solution is obtained?
  1. $\bar\pi = (3, 0, 4)$, $\lb = 7$
  2. $\bar\pi = (3, 3, 4)$, $\lb = 10$
  3. $\bar\pi = (4, 3, 5)$, $\lb = 12$
  4. $\bar\pi = (3, 0, 1)$, $\lb = 4$
Explanation. Zone 1: residuals $4, 3$ → $\pi_1 = 3$, residuals $(1, 0, 5, 3)$. Zone 2: elements 2 and 4, residuals $0, 3$ → $\pi_2 = 0$. Zone 3: elements 1 and 3, residuals $1, 5$ → $\pi_3 = 1$. Value $4$, a lower bound because feasible by construction.
mip-f-507 · level facile · notes
Minimisation primal with an **equality** constraint $\sum_j a_{ij} x_j = b_i$ (for example «each job on exactly one machine»). Which dual variable corresponds to it?
  1. A $\pi_i \ge 0$
  2. A $\pi_i \le 0$
  3. None: equalities have no dual
  4. A free $\pi_i$, with no sign constraint
Explanation. An equality is equivalent to two inequalities of opposite sense, with duals of opposite sign: their difference is a free variable.
mip-f-508 · level facile · notes
Knapsack $5x_1 + 4x_2 + 3x_3 + 3x_4 \le 9$, values $(10, 7, 6, 4)$: the relaxation with bounds has solution $\tilde x = (1, 1/4, 1, 0)$. The cover cut for $S = \{1, 2, 3\}$ is $x_1 + x_2 + x_3 \le 2$. What happens at $\tilde x$?
  1. It is satisfied with slack
  2. It cannot be evaluated: $\tilde x$ is fractional
  3. It is violated ($9/4 > 2$): adding it cuts off $\tilde x$ and strengthens the relaxation
  4. It is satisfied with equality, so it is useless
Explanation. $1 + 1/4 + 1 = 9/4 > 2$. The cut is valid (every integer solution respects it) and separates $\tilde x$: with the four covers the relaxation drops from $71/4$ to $69/4$.
mip-f-509 · level facile · notes
Binary maximisation knapsack with capacity $b$: $\zmilp(10) = 17$, $\zmilp(11) = 20$, and the optimal dual of the capacity constraint in the linear relaxation is $7/4$. By how much does the integer optimum really grow from $b = 10$ to $b = 11$?
  1. $7/4$
  2. $0$
  3. $3$
  4. $20/11$
Explanation. The true change is $20 - 17 = 3$, more than the LP dual: the integer problem responds in jumps, sometimes $0$ (from $9$ to $10$), sometimes more than the marginal price.
mip-f-510 · level teorema · notes
Minimisation MILP; $\bar\pi$ is a solution of the dual of the relaxation built by hand with one of the course recipes (zero and saturate, constructive on constraints, best ratio). What is the only property that makes the bound $\sum_i b_i \bar\pi_i \le \zmilp$ valid?
  1. The feasibility of $\bar\pi$ for the dual, checked constraint by constraint
  2. The fact that the recipe starts from $\bar\pi = 0$
  3. The optimality of $\bar\pi$ for the dual
  4. The integrality of the components of $\bar\pi$
Explanation. Weak duality requires only feasibility. A non-optimal dual solution gives a weaker but valid bound; an infeasible one gives nothing.
mip-f-526 · level facile · notes
Activation with $n = 3$ objects and one resource: aggregated formulation $A$: $x_1 + x_2 + x_3 \le 3y$; disaggregated $B$: $x_i \le y$ for every $i$ (all binary). Which relaxation does the fractional point $x = (1, 0, 0)$, $y = 1/3$ belong to?
  1. To both: the two formulations have the same relaxation
  2. Only to that of $B$
  3. Only to that of $A$: in $B$ it violates $x_1 \le y$, so $X_B \subsetneq X_A$
  4. To neither
Explanation. In $A$: $1 \le 3 \cdot 1/3 = 1$, feasible. In $B$: $x_1 = 1 > 1/3 = y$, excluded. Same integer points, $B$'s polyhedron strictly contained: $B$ is stronger.
mip-f-527 · level teorema · notes
Two formulations $A$ and $B$ of a **minimisation** MILP, with the same integer points and $X_B \subseteq X_A$ (relaxation polyhedra). What is the relation between the relaxation values $z_A$ and $z_B$?
  1. $z_A \le z_B \le \zmilp$: $B$'s relaxation gives a bound at least as good
  2. $z_A = z_B$, because the integer points are the same
  3. No general relation
  4. $z_B \le z_A \le \zmilp$
Explanation. Minimising over a smaller set cannot give a lower value: $z_A \le z_B$; both stay below $\zmilp$ because they contain all integer points.
mip-f-533 · level facile · notes
**Maximisation** MILP $\max\{f(x) : x \in X\}$ and a problem $\max\{f(x) : x \in \hat X\}$ with $X \subseteq \hat X$. What is the relation between the two optima?
  1. They are equal
  2. No relation
  3. The optimum over $\hat X$ is smaller than or equal
  4. The optimum over $\hat X$ is greater than or equal: it is a relaxation, hence an upper bound
Explanation. In a maximisation, optimising over a larger set cannot give a lower value: the relaxation gives an upper bound. In minimisations the inequality flips.
mip-f-534 · level facile · notes
Minimisation primal with a **free** variable $x_j$ (no sign constraint) and cost $c_j$. Which dual constraint corresponds to it?
  1. A constraint $\sum_i a_{ij}\pi_i \ge c_j$
  2. An equality constraint $\sum_i a_{ij}\pi_i = c_j$
  3. A constraint $\sum_i a_{ij}\pi_i \le c_j$
  4. No constraint: the variable disappears
Explanation. Variable $\ge 0$ → dual constraint $\le c_j$; free variable → equality. The sign of the primal variables decides the sense of the dual constraints.
mip-f-535 · level facile · notes
Two-resource knapsack, maximisation: $\max \sum_j p_j x_j$ with $\sum_j a_{1j} x_j \le 10$, $\sum_j a_{2j} x_j \le 12$. In the dual ($\min 10\pi_1 + 12\pi_2$, $a_{1j}\pi_1 + a_{2j}\pi_2 \ge p_j$, $\pi \ge 0$) the solution $\bar\pi = (2, 1)$ is feasible. Which bound does it give?
  1. $\ub = 32$
  2. $\ub = 3$
  3. $\ub = 22$
  4. $\lb = 32$
Explanation. $10 \cdot 2 + 12 \cdot 1 = 32$; the dual of a maximisation is a minimisation, and each of its feasible solutions is worth at least the optimum: upper bound.
mip-f-536 · level facile · notes
Minimisation linear programme with a feasible solution $\bar x$ of value $40$ and a feasible dual solution $\bar\pi$ of value $40$. What is concluded?
  1. Nothing without solving
  2. Only $\bar x$ is optimal
  3. Both are optimal: by weak duality no primal solution is worth less than $40$ and no dual more than $40$
  4. The problem is unbounded
Explanation. Weak duality gives $\sum_i b_i\pi_i \le \sum_j c_j x_j$ for every feasible pair: equal values close the problem, and it is the optimality certificate of the linear programme.
mip-f-537 · level facile · notes
Bound protocol for a **maximisation** problem: the heuristic gives $40$, the hand-built dual $55$, the relaxations $\zlp = 52$ (without bounds) and $\zlpp = 50$ (with $0 \le x \le 1$), the integer optimum $45$. Which line contains an error?
  1. $\zlpp$ should exceed $\zlp$
  2. No error: $40 \le 45 \le 50 \le 52 \le 55$ is the expected order in a maximisation
  3. The hand-built dual should be at most $\zlp$
  4. The heuristic should exceed the optimum
Explanation. In a maximisation: feasible solution $\le \zmilp \le \zlpp \le \zlp \le$ feasible dual (which is a minimisation and is worth at least $\zlp$). All values respect the chain.

Part: Gurobi and heuristics (98)

3. From the model to Python/Gurobi (54)

mip-f-029 · level facile · notes
In gurobipy (the Python interface of Gurobi) one declares the dual variable of an equality constraint, which must be allowed to take negative values. Which call is correct?
  1. `addVar()` with no arguments
  2. `addVar(vtype=GRB.BINARY)`
  3. `addVar(lb=-GRB.INFINITY)`
  4. `addVar(ub=GRB.INFINITY)`
Explanation. A continuous variable has `lb = 0` by default: without `lb=-GRB.INFINITY` the model is silently wrong. `GRB.BINARY` already implies `lb = 0` and `ub = 1`, and an infinite `ub` is already the default.
mip-f-030 · level facile · notes
Gurobi, minimisation problem. After `optimize()` one reads `Status = TIME_LIMIT` (time limit reached) and `SolCount` $\ge 1$ (at least one integer solution found). `ObjVal` is the value of the best solution, `ObjBound` the dual bound. What can be reported?
  1. `ObjBound` $\le \zmilp \le$ `ObjVal`
  2. $\zmilp =$ `ObjBound`
  3. $\zmilp =$ `ObjVal`
  4. Nothing: without `OPTIMAL` no number is meaningful
Explanation. With the time limit and at least one solution one reports an interval; saying "the optimum is `ObjVal`" would be false. With `SolCount = 0` instead there is nothing to report.
mip-f-031 · level facile · notes
Gurobi, minimisation problem, with the parameter `SolutionLimit = 1` (stop at the first integer solution). The solver stops with `Status = 10`, `ObjVal = 12` (value of the solution) and `ObjBound = 10` (dual bound). What is correct to say about the optimum $\zmilp$?
  1. It lies between $10$ and $12$
  2. It is $12$
  3. The model is infeasible
  4. It is $10$
Explanation. The solver has a solution of value $12$ and a bound of $10$: the only safe statement is the interval $10 \le \zmilp \le 12$.
mip-f-032 · level facile · notes
Gurobi considers a variable integer within the tolerance `IntFeasTol` ($10^{-5}$). A binary `x` comes back with value `x.X` $= 0.9999999997$. How does one check in Python code whether it equals $1$?
  1. `if x.X > 0.5`
  2. `if x.X >= 1`
  3. `if round(x.X, 12) == 1`
  4. `if x.X == 1`
Explanation. "Integer" means integer within the tolerance: comparisons are made with a margin, and for a binary the threshold $0.5$ is enough. Exact comparison, even after rounding to many digits, fails on this value.
mip-f-033 · level facile · notes
Travelling salesman on $n$ cities, MTZ formulation: $x_{ij} = 1$ if the tour goes from $i$ to $j$, and $u_i \in [1, n-1]$ is the position of city $i \ne 1$ along the tour. What does the constraint $u_i - u_j + n\, x_{ij} \le n - 1$ impose when $x_{ij} = 1$?
  1. $u_i = u_j$: the two cities have the same position
  2. $u_i \ge u_j + 1$: the position of $i$ follows that of $j$
  3. $u_i - u_j \le n - 1$, which forbids nothing
  4. $u_j \ge u_i + 1$: the position of $j$ follows that of $i$
Explanation. With $x_{ij} = 1$ what remains is $u_i - u_j \le -1$. With $x_{ij} = 0$ it becomes $u_i - u_j \le n - 1$, always true because the $u$ lie between $1$ and $n - 1$. A subtour avoiding city $1$ would need ever-increasing positions that close on themselves.
mip-f-034 · level facile · notes
Bin packing: items of weight $w = (5, 4, 3, 3)$, bins of capacity $c = 7$; $x_{jb} = 1$ if item $j$ goes into bin $b$, $y_b = 1$ if $b$ is used, constraints $\sum_j w_j x_{jb} \le c\, y_b$, objective $\min \sum_b y_b$. What is the value of the linear relaxation?
  1. $2$
  2. $4$
  3. $15/7$
  4. $3$
Explanation. The relaxation buys fractions of a bin and drops to $\sum_j w_j / c = 15/7 \approx 2.14$: it does not know that a bin opens whole. The integer optimum is $3$.
mip-f-035 · level facile · notes
Assignment with $3$ jobs and $3$ machines: $x_{jm} \in \{0,1\}$ for every pair, one "assign" constraint $\sum_m x_{jm} = 1$ per job and one availability constraint $\sum_j t_{jm} x_{jm} \le a_m$ per machine. How many variables and how many constraints (domains excluded) does the model have?
  1. $9$ variables and $3$ constraints
  2. $9$ variables and $9$ constraints
  3. $9$ variables and $6$ constraints
  4. $6$ variables and $9$ constraints
Explanation. One variable per job-machine pair ($3 \cdot 3 = 9$), one "assign" constraint per job and one availability constraint per machine ($3 + 3 = 6$).
mip-f-036 · level facile · notes
Makespan on identical machines: $d_j$ is the duration of job $j$, $x_{jm} = 1$ if $j$ goes on machine $m$, and the model is $\min z$ with $\sum_j d_j x_{jm} - z \le 0$ for every machine. Which modelling technique is it?
  1. Max-min: $z$ goes up to the load of the least loaded machine
  2. A big-M switching off the unused machines
  3. Min-max: $z$ goes down to the load of the busiest machine
  4. A set covering constraint on the machines
Explanation. The load rows keep $z$ above every load and the minimisation squeezes it onto the largest: it is the min-max technique.
mip-f-037 · level teorema · notes
Gurobi stops when the relative gap between `ObjVal` (best solution) and `ObjBound` (dual bound) falls below the parameter `MIPGap`, by default $10^{-4}$. Which statement is correct?
  1. With the default the solver may declare `OPTIMAL` before reaching the exact optimum
  2. `ObjBound` at the end of the solve is the value of the root relaxation
  3. The `Runtime` of two models with different settings tells which formulation is stronger
  4. `OPTIMAL` guarantees the exact optimum, whatever the value of `MIPGap`
Explanation. The solver stops when the relative gap falls below `MIPGap`: on instances with large values it is worth lowering it. `ObjBound` is not the root relaxation, and times obtained with different settings are not comparable.
mip-f-038 · level ipotesi · notes
After `optimize()` in Gurobi one wants to write in the report "the optimum of the MILP is `ObjVal`". Which check is necessary and sufficient?
  1. That `SolCount` is at least $1$
  2. That `ObjVal` is an integer
  3. That `Status` equals `OPTIMAL`
  4. That `NodeCount` equals $0$
Explanation. Only with `Status = OPTIMAL` is the optimum proved. With `SolCount` $\ge 1$ but a limit reached one reports the interval between `ObjBound` and `ObjVal`; `NodeCount` and the integrality of the value say nothing.
mip-f-158 · level facile · notes
In gurobipy, `r = m.relax()` returns a copy of model `m` in which binary variables become continuous in $[0,1]$ and integer ones continuous above their `lb`. What does one get with `r.optimize()` and `r.ObjVal`?
  1. The final dual bound `ObjBound` of the integer model `m`
  2. The value of the best integer solution of `m`
  3. The value of the root relaxation after the solver's cuts and presolve
  4. The value of the linear relaxation of the written model, with the bounds of the binaries
Explanation. `relax()` builds the relaxation of the model as written: it is the number to compare with the hand-made bounds. The relaxation strengthened by the solver and `ObjBound` are something else.
mip-f-159 · level facile · notes
Gurobi returns `Status = TIME_LIMIT` and `SolCount = 0`: the time limit expired without any integer solution being found. What can be reported about the optimum of the MILP?
  1. That the model is infeasible
  2. That the optimum is `ObjBound`
  3. Nothing: neither a solution nor, in general, a useful bound
  4. That the optimum lies between `ObjBound` and `ObjVal`
Explanation. Without solutions there is no pessimistic side, and the time limit does not prove infeasibility (that requires `Status = INFEASIBLE`). Not even a gap is written.
mip-f-160 · level facile · notes
Bin packing with $n = 5$ items and $k = 5$ available bins: binaries $x_{jb}$ (item $j$ in bin $b$) and $y_b$ (bin used), constraints $\sum_b x_{jb} = 1$ per item and $\sum_j w_j x_{jb} \le c\, y_b$ per bin. How many variables and how many constraints (domains excluded)?
  1. $30$ variables and $30$ constraints
  2. $30$ variables and $10$ constraints
  3. $25$ variables and $10$ constraints
  4. $30$ variables and $5$ constraints
Explanation. The $x_{jb}$ are $5 \cdot 5 = 25$ and the $y_b$ are $5$: $30$ variables. The constraints are $5$ assignment and $5$ capacity constraints: $10$.
mip-f-161 · level teorema · notes
Travelling salesman with $x_{ij} = 1$ if the tour goes from $i$ to $j$, and only the constraints "leave every city once" and "enter every city once". Which statement is correct?
  1. They describe exactly the Hamiltonian tours, and the MTZ constraints only strengthen the relaxation
  2. They admit only tours through city $1$, so subtours are impossible
  3. They admit subtours only if the distances are not symmetric
  4. They admit solutions made of several disjoint subtours, which the MTZ constraints exclude
Explanation. Leaving and entering every city once describes a set of disjoint cycles, not necessarily a single one. The position variables $u_i$ of the MTZ formulation forbid the cycles that do not touch city $1$.
mip-f-197 · level facile · notes
In gurobipy (the Python interface of Gurobi) one writes `x = m.addVars(4, 3, vtype=GRB.BINARY)`. How many variables are created and how are they indexed?
  1. $7$ binaries, `x[0]`, …, `x[6]`
  2. $12$ binaries, `x[i, j]` with `i` in $0, \dots, 3$ and `j` in $0, \dots, 2$
  3. $12$ binaries, `x[i, j]` with `i` in $1, \dots, 4$ and `j` in $1, \dots, 3$
  4. $4$ binaries, each with domain $\{0, 1, 2\}$
Explanation. `addVars(4, 3)` creates the $4 \times 3$ matrix; Python indices start from zero, while in the written models they start from one.
mip-f-198 · level facile · notes
In gurobipy `x = m.addVars(n, k, vtype=GRB.BINARY)` assigns job $j$ to machine $h$. Which statement writes the family "every job on exactly one machine", $\sum_h x_{jh} = 1$ for every $j$?
  1. `m.addConstrs(x.sum('*', j) == 1 for j in range(n))`
  2. `m.addConstrs(x.sum(j, '*') == 1 for j in range(1, n))`
  3. `m.addConstr(x.sum(j, '*') == 1 for j in range(n))`
  4. `m.addConstrs(x.sum(j, '*') == 1 for j in range(n))`
Explanation. `addConstrs` adds a family from a generator; `x.sum(j, '*')` sums over the dummy machine index. Summing over the first index counts the jobs of a machine; `range(1, n)` skips job $0$.
mip-f-199 · level facile · notes
In gurobipy a signed deviation $d \in \mathbb{R}$, which must be allowed to be negative, is declared with `d = m.addVar()`, without arguments. What happens?
  1. $d$ is free by default, so the model is correct
  2. $d$ becomes binary, because that is the default type
  3. $d$ gets `lb = 0` by default and the solved model is a different one, without any warning
  4. Gurobi raises an error, because the domain is missing
Explanation. A continuous variable has `lb = 0` by default: a variable that must be allowed to be negative is declared with `lb=-GRB.INFINITY`, otherwise the model is silently wrong.
mip-f-200 · level facile · notes
In the course code the model is built by a function `modello(t, c, a)` that receives the data as arguments, instead of reading them from global variables. Why?
  1. Because the solver then solves the model faster
  2. So that the same function serves for the base instance and for all the variants
  3. To avoid the difference between indices starting from zero and from one
  4. Because gurobipy cannot read global variables
Explanation. It is one of the course's three writing rules (with one `addConstrs` per family and all variables declared together): data as arguments make the function reusable on different instances.
mip-f-201 · level facile · notes
In gurobipy, before `r = m.relax()` (which returns a copy of `m` with the integer variables made continuous) the course code calls `m.update()`. Why?
  1. `relax()` copies the model, and the pending modifications must be applied first
  2. `update()` declares the binaries continuous, and `relax()` just copies them
  3. `update()` resets the solver parameters, which would otherwise pass to the copy
  4. `update()` solves the integer model, and `relax()` needs a model already solved
Explanation. gurobipy applies modifications lazily: added variables and constraints enter the model only with `update()` or `optimize()`. Without it, the copy made by `relax()` might not contain them.
mip-f-202 · level facile · notes
Makespan on identical machines: $4$ jobs of duration $d = (3, 4, 5, 6)$ on $k = 2$ machines; binaries $x_{jm}$ (job $j$ on machine $m$), one continuous $z$, constraints $\sum_m x_{jm} = 1$ per job and $\sum_j d_j x_{jm} - z \le 0$ per machine, $\min z$. How many variables and how many constraints (domains excluded)?
  1. $9$ variables and $6$ constraints
  2. $9$ variables and $4$ constraints
  3. $8$ variables and $6$ constraints
  4. $9$ variables and $8$ constraints
Explanation. Variables: $4 \cdot 2 = 8$ binaries plus $z$, that is $9$. Constraints: $4$ assignment plus $2$ load, that is $6$. Forgetting $z$ gives $8$; counting one load constraint per pair gives $8$.
mip-f-203 · level facile · notes
In the course protocol, the solution of the constructive heuristic goes through `assert ammissibile(m, ...)` before its value becomes a primal bound. What does that check verify?
  1. Only the linear constraints, even with fractional components
  2. Constraints, variable bounds and integrality
  3. That the solution is optimal for the MILP
  4. That strong duality holds with the hand-written dual
Explanation. Only a solution satisfying constraints, bounds **and** integrality is feasible for the MILP, and only then is its value a primal bound.
mip-f-204 · level facile · notes
The course protocol always follows the same order of steps for every problem. Which one?
  1. Data, LP and dual, model, MIP, heuristic and check, table
  2. Data, model, heuristic and check, LP and dual, MIP, table
  3. Data, model, MIP, heuristic and check, LP and dual, table
  4. Model, data, MIP, table, heuristic and check, LP and dual
Explanation. First the two hand-made bounds (heuristic, then dual), then the solver: the MIP serves to judge the bounds, not the other way round. The table gathers all the numbers at the end.
mip-f-205 · level facile · notes
The licence included in the pip package of `gurobipy` allows models up to $2000$ variables and $2000$ constraints. What happens if a model exceeds the limit?
  1. Gurobi raises an explicit error when `optimize()` is called
  2. Gurobi solves the linear relaxation instead of the MILP
  3. Gurobi solves only the first $2000$ variables and returns a partial optimum
  4. Gurobi returns `Status = TIME_LIMIT` without solutions
Explanation. The *size-limited* licence never silently produces a wrong result: beyond the limit `optimize()` fails with an error. The course instances are all far below the limit.
mip-f-206 · level facile · notes
In the course code, every number quoted in the notes (bounds, optima, gaps) comes from a CSV produced by the problem's script. What does `verifica_numeri.py` do?
  1. It compares, with an `assert`, every number quoted in the text with the value in the CSV
  2. It solves every MILP again with another solver and compares the optima
  3. It rewrites the numbers of the text by copying them from the CSV
  4. It checks that every model fits within the licence limit
Explanation. A number exists in one place only, the CSV; the notes, the site and the check read it from there, and the `assert`s flag every disagreement.
mip-f-207 · level ipotesi · notes
In gurobipy, `r = m.relax()` followed by `r.optimize()`. To report `r.ObjVal` as $\zlpp$, the linear relaxation with the bounds of the written model `m`, what is needed?
  1. That `m` was solved before, so that `relax()` inherits its solution
  2. That `m` is updated with `update()` before `relax()` and that `r` ends with `Status = OPTIMAL`
  3. That the integer model `m` ends with `NodeCount = 0`
  4. That `r.ObjVal` equals `m.ObjBound` at the end of the solve
Explanation. `r` is a copy of `m` with the integers made continuous: the copy must contain the whole model (hence `update()`) and its LP must be solved to optimality. `ObjBound` is something else: it can include cuts and branching.
mip-f-331 · level facile · notes
In gurobipy (the Python interface of Gurobi) a model `m` contains the variables `x`. Which statement sets the objective «maximise $\sum_j p_j x_j$»?
  1. `m.setObjective(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
  2. `m.optimize(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
  3. `m.addConstr(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
  4. `m.setObjective(max(p[j] * x[j] for j in J))`
Explanation. `setObjective(expression, sense)` sets the objective; `quicksum` builds the linear sum. `addConstr` adds constraints, Python's `max` does not build a linear expression, `optimize()` takes no arguments.
mip-f-332 · level facile · notes
In gurobipy, after `m.optimize()` with `m.Status == GRB.OPTIMAL`, how are the optimal value and the value of variable `x[2]` read?
  1. `m.Status` and `x[2].VarName`
  2. `m.getObjective()` and `x[2].LB`
  3. `m.ObjBound` and `x[2].Start`
  4. `m.ObjVal` and `x[2].X`
Explanation. `ObjVal` is the value of the best (here optimal) solution and a variable's `X` attribute its value. `ObjBound` is the dual bound, `Start` a starting value, `LB` the lower bound.
mip-f-333 · level facile · notes
In gurobipy the four variable classes of the course are declared: binary, non-negative integer, non-negative continuous, free continuous. Which declaration corresponds to the **non-negative integer**?
  1. `m.addVar(vtype=GRB.BINARY, ub=GRB.INFINITY)`
  2. `m.addVar(vtype=GRB.INTEGER)`
  3. `m.addVar(lb=0)`
  4. `m.addVar(vtype=GRB.INTEGER, lb=-GRB.INFINITY)`
Explanation. The default lower bound is $0$, so `vtype=GRB.INTEGER` suffices. With `lb=-GRB.INFINITY` it would be a free integer; `addVar(lb=0)` is continuous.
mip-f-334 · level ipotesi · notes
In gurobipy the absolute value $|u - v|$ is linearised with a variable $d$ and the constraints $d \ge u - v$, $d \ge v - u$; the signed difference $s = u - v$ instead must be allowed to be negative. A student declares both with `m.addVar()`. Which of the two is declared wrongly?
  1. $d$: an absolute value must be declared with `lb=-GRB.INFINITY`
  2. Neither: `addVar()` creates free variables
  3. $s$: without `lb=-GRB.INFINITY` the lower bound is $0$ and negative values are forbidden
  4. Both: `addVar()` without arguments creates a binary variable
Explanation. `addVar()` creates a continuous variable with $\mathrm{lb} = 0$. For $d \ge |u - v| \ge 0$ that is fine; for $s$, which may be negative, `lb=-GRB.INFINITY` is needed, otherwise the model cuts solutions silently.
mip-f-335 · level facile · notes
In the course code the model is written «one family per block». What does that mean?
  1. Each constraint family goes into a different Gurobi model
  2. Each family of variables or constraints of the mathematical model corresponds to a single statement (`addVars`, `addConstrs`), with a comment naming it
  3. Variables and constraints are written in the same block, mixed, to save lines
  4. Each constraint is written with a separate `addConstr` statement, one per line
Explanation. The one-to-one match between the families of the written model and the code blocks makes the code checkable line by line against the model.
mip-f-336 · level facile · notes
In gurobipy `x = m.addVars(n, k, vtype=GRB.BINARY)` assigns job $j$ to machine $h$, with durations `t[j, h]` and availabilities `a[h]`. Which statement writes the family «machine $h$ does not exceed its availability», one constraint per machine?
  1. `m.addConstrs(gp.quicksum(t[j, h] * x[j, h] for j in range(n)) <= a[h] for h in range(k))`
  2. `m.addConstrs(t[j, h] * x[j, h] <= a[h] for j in range(n) for h in range(k))`
  3. `m.addConstrs(gp.quicksum(t[j, h] * x[j, h] for h in range(k)) <= a[h] for j in range(n))`
  4. `m.addConstr(gp.quicksum(t[j, h] * x[j, h] for j in range(n) for h in range(k)) <= sum(a))`
Explanation. One constraint per machine: the outer generator runs over $h$, the sum over $j$. The second is a single aggregated constraint, the third one constraint per pair, the fourth sums over the wrong index.
mip-f-337 · level facile · notes
Gurobi, minimisation problem with `MIPGap` $= 10^{-4}$ (default): the solver stops as soon as $|\text{ObjVal} - \text{ObjBound}|/|\text{ObjVal}| \le 10^{-4}$. With `ObjVal` $= 20000$, which value of `ObjBound` is enough to stop with `Status = OPTIMAL`?
  1. $19800$
  2. $19990$
  3. $19998$
  4. $19980$
Explanation. One needs $20000 - \text{ObjBound} \le 20000 \cdot 10^{-4} = 2$, that is, $\text{ObjBound} \ge 19998$. That is why «optimal» for Gurobi means optimal within the tolerance.
mip-f-338 · level ipotesi · notes
A course script checks a Gurobi solution with `assert x[j].X == 1` for a binary, and the assert fails even though the solver returned `Status = OPTIMAL`. What is the most likely cause, and the fix?
  1. `X` is the relaxation value: read `x[j].Xn` instead
  2. The value is $1$ only within `IntFeasTol` (for example $0.9999999$): compare `round(x[j].X)` or use a tolerance
  3. Binaries in gurobipy are `True`/`False`: write `x[j].X is True`
  4. The solver returned an infeasible solution: rerun it with `MIPGap = 0`
Explanation. Gurobi deems a variable integer within the integrality tolerance: the floating value may be $0.9999999997$. Exact comparison fails; round or use a tolerance.
mip-f-339 · level facile · notes
In gurobipy `r = m.relax()` produces the linear relaxation of model `m`. What do binary variables become and which of the two course relaxations is obtained?
  1. Continuous in $[0,1]$: one obtains $\zlpp$, the relaxation with bounds
  2. Continuous in $[0, +\infty)$: one obtains $\zlp$, the relaxation without bounds
  3. They disappear: `relax()` fixes them to $0$
  4. They stay binary, but the solver stops branching
Explanation. `relax()` removes the integer type keeping the bounds: a binary becomes continuous in $[0,1]$, that is, the relaxation with bounds $\zlpp$.
mip-f-340 · level facile · notes
Bin packing: items of weight $w = (6, 5, 4, 3, 2)$ in containers of capacity $c = 10$. The lower bound $\lceil \sum_j w_j / c \rceil$ says that at least how many containers are needed?
  1. $1$
  2. $2$
  3. $3$
  4. $5$
Explanation. $\sum_j w_j = 20$ and $20/10 = 2$: at least $2$ containers are needed. Here they suffice: $\{6, 4\}$ and $\{5, 3, 2\}$, so the optimum is $2$.
mip-f-341 · level teorema · notes
Makespan on $k$ identical machines, jobs of duration $d_j$, model $\min z$ with $\sum_j d_j x_{jm} \le z$ for every machine and $\sum_m x_{jm} = 1$ for every job. Which value is always a lower bound on the optimum $\zmilp$?
  1. $\sum_j d_j$
  2. $\sum_j d_j / k - \max_j d_j$
  3. $\max\{\sum_j d_j / k,\ \max_j d_j\}$
  4. $\min_j d_j$
Explanation. The average load $\sum_j d_j / k$ cannot exceed the maximum load, and the longest job lies entirely on one machine: both are lower bounds, hence also their maximum. $\sum_j d_j$ is an upper bound (everything on one machine).
mip-f-342 · level ipotesi · notes
TSP on $n$ cities with the MTZ formulation: $u_i - u_j + (n-1)x_{ij} \le n - 2$ for every arc $(i,j)$ with $i, j \ne 1$, and $u_i \in [1, n-1]$ the position of city $i$ in the tour. Why do the constraints **exclude** city $1$?
  1. Because subtours can never pass through city 1
  2. Because city 1 always has position $u_1 = n$
  3. To save constraints: including it would give the same model
  4. The tour must return to the start: with city 1 included the Hamiltonian cycle would be forbidden too
Explanation. Along a cycle using arcs $(i,j)$ the constraints impose $u_j \ge u_i + 1$; summing them over a cycle gives a contradiction. Excluding city 1 forbids only the cycles that do not touch it, that is, subtours, and the full tour survives.
mip-f-343 · level facile · notes
In the course protocol every problem produces the table $\ub$ (heuristic), $\lb$ (hand-built dual), $\zlp$ and $\zlpp$ (relaxations without and with the bounds $0 \le x \le 1$), $\zmilp$ (integer optimum), gap. Where does the value $\zlp$ (relaxation without bounds) come from in the code?
  1. From the model of the relaxation without bounds, or from the hand-written dual, solved with Gurobi: by strong duality the two values coincide
  2. From `m.ObjBound` after optimising the MILP
  3. From the constructive heuristic, as the value of its solution
  4. From `m.relax()`, which also drops the upper bounds of the binaries
Explanation. `relax()` keeps the bounds and gives $\zlpp$; `ObjBound` is the solver's final bound; the heuristic gives $\ub$. The value $\zlp$ is the optimum of the relaxation without bounds, equal by strong duality to the optimum of the hand-written dual: this is what the `assert` checks.
mip-f-344 · level facile · notes
In the course protocol, why does the hand-built dual solution go through a feasibility check (every dual constraint and every sign) before its value enters the table?
  1. Because the dual value must coincide with the integer optimum
  2. Because Gurobi rejects non-integer dual solutions
  3. Because only a feasible dual solution gives a valid bound by weak duality
  4. Because the hand-built dual is always optimal and only needs confirming
Explanation. Weak duality holds for feasible dual solutions: a solution violating even one dual constraint gives no bound. A hand-built solution is in general not optimal.
mip-f-345 · level facile · notes
The course code also runs on Colab: each chapter has a notebook opened from the badge at the top of the page. What does the first cell of each notebook do?
  1. It installs `gurobipy` and downloads the three common Python modules of the course
  2. It activates the academic Gurobi licence from the portal
  3. It solves all the course models and saves the CSV files
  4. It runs `verifica_numeri.py` on all chapters
Explanation. The first cell prepares the environment: it installs the pip package `gurobipy` (with the bundled size-limited licence, enough for the course instances) and downloads the common modules; the following cells build and solve the chapter's models.
mip-f-346 · level facile · notes
From the course's `python/` folder, after creating the virtual environment and installing `gurobipy pandas matplotlib`, which command runs all chapters and notebooks at once?
  1. `python3 fam07_1_assegnamento.py`
  2. `python3 esegui_tutti.py`
  3. `pip install esegui_tutti`
  4. `python3 verifica_numeri.py`
Explanation. `esegui_tutti.py` runs all scripts and notebooks; `verifica_numeri.py` checks the quoted numbers with `assert`s; `fam07_1_assegnamento.py` runs a single problem.
mip-f-511 · level facile · notes
In gurobipy, what is the difference between `m.addConstr(...)` and `m.addConstrs(...)`?
  1. `addConstrs` adds variables and constraints together
  2. They are the same statement under two names
  3. `addConstr` adds linear constraints, `addConstrs` quadratic ones
  4. `addConstr` adds a single constraint; `addConstrs` one per element of a generator (a family)
Explanation. `addConstrs(expr for i in I)` creates one constraint per $i$, indexed like the generator: it is how a family is written in one statement.
mip-f-512 · level facile · notes
Gurobi, after `optimize()`: `Status = INFEASIBLE`. What can be stated, and what cannot be read?
  1. The model is unbounded
  2. The solver found no solutions within the time, but they might exist
  3. The written model has no feasible solutions; `ObjVal` does not exist and the status must be read before any value
  4. `ObjVal` holds the value of the relaxation
Explanation. `INFEASIBLE` is a proof (for the written model) that no solutions exist. It differs from `TIME_LIMIT` with `SolCount = 0`, where nothing is known. In both cases reading `ObjVal` raises an error.
mip-f-513 · level facile · notes
Travelling salesman on $n = 6$ cities, MTZ formulation: $x_{ij}$ binary for every directed arc $(i, j)$ with $i \ne j$, and a position variable $u_i$ for every city other than 1. How many variables does the model have?
  1. $41$
  2. $36$
  3. $30$
  4. $35$
Explanation. Directed arcs: $6 \cdot 5 = 30$; positions: $5$. Total $35$. ($36$ would also count arcs from a city to itself.)
mip-f-514 · level teorema · notes
**Minimisation** MILP with binaries; `r = m.relax()` and `r.optimize()` give $\zlpp$, while the hand-written dual (relaxation without bounds) has optimum $\zlp$. Which relation must result, if everything is correct?
  1. $\zmilp \le \zlpp \le \zlp$
  2. $\zlp = \zlpp$ always
  3. $\zlp \le \zlpp \le \zmilp$
  4. $\zlpp \le \zlp \le \zmilp$
Explanation. `relax()` keeps the bounds $x \le 1$, so it solves a problem with more constraints than the relaxation without bounds: in a minimisation the value can only rise, staying below the integer optimum.
mip-f-528 · level facile · notes
Bin packing in gurobipy: $x_{jb} = 1$ if item $j$ goes into container $b$, $y_b = 1$ if the container is used, capacity $c$. Which constraint links capacity and use of container $b$?
  1. $\sum_j w_j x_{jb} \le c$
  2. $\sum_b x_{jb} \le y_b$
  3. $\sum_j w_j x_{jb} \le c\, y_b$
  4. $x_{jb} \le c\, y_b$
Explanation. The aggregated constraint does two things: it respects the capacity of a used container and, with $y_b = 0$, forbids placing items in it. Without $y_b$ the model would not count the used containers.
mip-f-529 · level facile · notes
Makespan on identical machines: $\min z$ with $\sum_j d_j x_{jm} \le z$ for every machine $m$. Why at the optimum does $z$ equal exactly the load of the busiest machine?
  1. Because there is a constraint $z = \max_m \sum_j d_j x_{jm}$
  2. $z$ lies above every load by the constraints and the objective pushes it down: it stops at the maximum load
  3. It is not true: $z$ may stay larger than the maximum load
  4. Because $z$ is declared integer
Explanation. It is the maximum variable: the constraints give $z \ge$ every load, minimisation brings it to equality with the largest. The $\max$ cannot be written directly in a linear model.
mip-f-538 · level facile · notes
In gurobipy, which statement creates an empty model and which solves it?
  1. `m = gp.Env()` and `m.solve()`
  2. `m = gp.Model()` and `m.run()`
  3. `m = GRB.Model()` and `gp.optimize(m)`
  4. `m = gp.Model()` and `m.optimize()`
Explanation. `gp.Model()` creates the model, to which variables, constraints and objective are added; `optimize()` solves it, and only afterwards are `Status`, `ObjVal` and the `X` values read.
mip-f-539 · level facile · notes
In gurobipy, how is a binary variable `y` declared?
  1. `y = m.addVar(lb=0, ub=1)`
  2. `y = m.addVar(vtype='bool')`
  3. `y = m.addVar(vtype=GRB.BINARY)`
  4. `y = m.addVar(vtype=GRB.INTEGER, lb=-1, ub=1)`
Explanation. `GRB.BINARY` imposes values in $\{0,1\}$. `lb=0, ub=1` without a type gives a continuous variable in $[0,1]$, that is, its relaxation.
mip-f-540 · level facile · notes
Gurobi, maximisation problem: `Status = OPTIMAL`, `ObjVal` $= 120$, `ObjBound` $= 120.005$, with default `MIPGap` $10^{-4}$. What is reported?
  1. $\zmilp = 120.005$
  2. $\zmilp = 120.0025$, the midpoint
  3. $120 \le \zmilp \le 120.005$, optimality not proved
  4. $\zmilp = 120$ (optimal within the tolerance)
Explanation. With `OPTIMAL` one reports `ObjVal`; the residual gap ($\approx 0.004\%$) is below the tolerance, which is why the solver stopped.
mip-f-541 · level facile · notes
In gurobipy one solves `r = m.relax()` on an assignment model with constraints $\sum_m x_{jm} = 1$, and gets an integer solution. What does it mean?
  1. The relaxation with bounds has an integer optimum, so $\zlpp = \zmilp$ and that solution is optimal for the MILP too
  2. That the model was written wrongly
  3. Nothing: the MILP must be solved anyway to get a bound
  4. That `relax()` did not remove integrality
Explanation. If the relaxation optimum is feasible for the integer problem (integrality included), it is optimal for it too. In assignment models this often happens, because of the matrix structure.
mip-f-542 · level facile · notes
In the course protocol, which step comes **before** solving the MIP with the solver?
  1. Heuristic with feasibility check, then hand-written dual and relaxations
  2. The figures and notebooks
  3. The bound table
  4. Computing the heuristic gap
Explanation. Order: data → model → heuristic and check → LP and dual → MIP → table → figures and notebooks. The heuristic gap needs the optimum, so it comes after the MIP.
mip-f-543 · level teorema · notes
Gurobi, minimisation problem, `Status = TIME_LIMIT`, `SolCount` $\ge 1$, `ObjVal` $= 75$, `ObjBound` $= 70$. Which statement is proved?
  1. $\zmilp \ge 75$
  2. $\zmilp = 70$
  3. $70 \le \zmilp \le 75$
  4. $\zmilp = 75$
Explanation. The solution found is feasible (upper bound in a minimisation), the dual bound is a lower bound: the optimum lies between the two, but which value it takes is not proved.
mip-f-544 · level teorema · notes
Bin packing: containers of capacity $c$, items of weight $w_j$. Which value is always a lower bound on the minimum number of containers?
  1. the number of items
  2. $\lfloor \sum_j w_j / c \rfloor - 1$
  3. $\max_j w_j$
  4. $\lceil \sum_j w_j / c \rceil$
Explanation. The used containers carry at most $c$ each: at least $\sum_j w_j / c$ containers are needed, and the number is integer. The number of items is an upper bound (one per container).

4. Constructive heuristics (44)

mip-f-039 · level facile · notes
A constructive heuristic, applied to a **maximisation** MILP with optimum $\zmilp$, returns a feasible integer solution of value $16$. How is the result written correctly?
  1. $\zmilp = 16$
  2. $\zlp \le 16$
  3. $\zmilp \le \ub = 16$
  4. $\lb = 16 \le \zmilp$
Explanation. In a maximisation a feasible solution is worth at most the optimum: it is a lower bound. Calling the result of a heuristic on a maximisation $\ub$ is the commonest sign mistake.
mip-f-040 · level facile · notes
Assignment of jobs to machines with limited availability. The next-fit heuristic (fills one machine at a time and never goes back) cannot place the last job and answers "no solution found". What does one conclude?
  1. That the problem is infeasible and the model must be corrected
  2. That an improvement heuristic is needed to prove infeasibility
  3. Nothing about the feasibility of the problem: the failure concerns the heuristic
  4. That the linear relaxation is infeasible
Explanation. A constructive heuristic is myopic and never goes back. To prove that a model is infeasible one needs the solver (`Status = INFEASIBLE`) or a proof.
mip-f-041 · level facile · notes
Bin packing: items to be placed, in the given order, into bins of fixed capacity. What distinguishes the next-fit heuristic from first-fit?
  1. First-fit opens a new bin for every item; next-fit fills the current one as long as it can
  2. Next-fit first sorts the items by decreasing weight; first-fit takes them in the given order
  3. Next-fit chooses the bin left fullest; first-fit the first bin where the item fits
  4. Next-fit looks only at the current bin and never goes back; first-fit tries all the open bins in order
Explanation. Next-fit closes a bin as soon as an item does not fit; first-fit puts the item into the first open bin where it fits. Choosing the fullest bin is best-fit; both scan the items in the given order.
mip-f-042 · level facile · notes
Uncapacitated lot sizing (choose in which periods to produce to cover the demand, with setup and holding costs). What is the relation between the "least unit cost" rule and the Wagner–Whitin procedure?
  1. Wagner–Whitin is the hand-made dual of least unit cost, and gives a lower bound on it
  2. Least unit cost is a heuristic, and its value is only a bound; Wagner–Whitin is an exact algorithm
  3. They are two names for the same heuristic, which picks setups at the lowest average unit cost
  4. Least unit cost is exact on this model, Wagner–Whitin is an improvement heuristic
Explanation. Wagner–Whitin solves uncapacitated lot sizing to optimality by dynamic programming, in polynomial time; least unit cost decides one setup at a time and may stop above the optimum.
mip-f-043 · level facile · notes
Makespan on $3$ identical machines (minimise the largest load): LPT gives loads $(11, 8, 8)$, while the optimum is $9$. Local search with the single move "shift one job to another machine" stops at $11$. What does one conclude?
  1. It proved that the linear relaxation is worth $11$
  2. It found a better lower bound than the elementary one
  3. It proved that $11$ is the optimal makespan for this instance
  4. It found a local optimum, which is still only an upper bound on the optimal makespan
Explanation. Local search returns a feasible solution, hence an upper bound in a minimisation, and nothing else. Here reaching $9$ needs a swap move between two machines.
mip-f-044 · level facile · notes
Makespan: seven jobs of duration $t = (5, 5, 4, 4, 3, 3, 3)$ on $k = 3$ identical machines, minimising the load of the busiest machine. What is the elementary bound $\max(\max_j t_j,\ \sum_j t_j / k)$?
  1. $11$
  2. $27$
  3. $9$
  4. $5$
Explanation. $\max_j t_j = 5$ and $\sum_j t_j / k = 27/3 = 9$: the bound is $9$, and here it is exactly the optimum, while LPT gives $11$.
mip-f-045 · level facile · notes
Binary knapsack with values $p = (10, 7, 6, 4)$, weights $w = (5, 4, 3, 3)$, capacity $9$. The heuristic scanning by decreasing $p_j/w_j$ takes items 1 and 3 (value $16$); the optimum takes 1 and 2 (value $17$). Why does the heuristic fail?
  1. The heuristic actually picks by increasing weight, not by ratio
  2. The heuristic violates the capacity and the solution must be repaired
  3. Item 2 has the highest ratio and the heuristic discards it
  4. After items 1 and 3 there is a residual capacity that no remaining item can use
Explanation. After items 1 and 3 the residual is $1$ and stays unused, while 1 and 2 fill the knapsack exactly. In a maximisation $\lb = 16 \le \zmilp = 17$.
mip-f-046 · level facile · notes
Travelling salesman on $n$ cities: the nearest neighbour heuristic (always moves to the closest unvisited city) is run from all $n$ starting cities and the shortest tour is kept. What does one obtain?
  1. A certificate of optimality when two different starts give the same tour
  2. A lower bound on the length of the optimal tour, because the minimum is taken
  3. An upper bound that is in general better, at $n$ times the cost: still a bound from one side only
  4. The optimal tour, because every city has been tried as a start
Explanation. It is the simplest form of multi-start: many feasible solutions, keeping the best. It is still a feasible solution, hence an upper bound; whether it is optimal can only be known some other way.
mip-f-047 · level teorema · notes
Makespan: $n$ jobs of duration $t_j$ on $k$ identical machines, minimising the largest load. LPT sorts the jobs by decreasing duration and puts each on the least loaded machine. Which statement is correct?
  1. LPT is optimal when the durations are all different from each other
  2. With $k = 2$ machines LPT always finds the optimal assignment
  3. The makespan of any assignment, LPT included, is at least $\max(\max_j t_j,\ \sum_j t_j / k)$
  4. The makespan of LPT is always at most $\sum_j t_j / k$
Explanation. The machine receiving the longest job works at least $\max_j t_j$, and the busiest works at least the average $\sum_j t_j / k$: the bound holds for every feasible solution. LPT remains a heuristic.
mip-f-048 · level teorema · notes
A constructive heuristic for a MILP builds a solution one decision at a time, without going back. Which statement is correct?
  1. A solution satisfying the linear constraints with some fractional component still gives a primal bound
  2. It always returns a feasible solution, possibly of poor quality
  3. Its value is always within $50\%$ of the integer optimum
  4. If it ends with a solution satisfying constraints, bounds and integrality, its value is a primal bound; if it fails it gives no bound
Explanation. The heuristic can get stuck halfway; when it ends with a feasible solution of the MILP, integrality included, that is the pessimistic side of the sandwich. It proves nothing about quality.
mip-f-049 · level ipotesi · notes
Minimisation MILP. To declare that the value of a hand-built solution is an upper bound on the integer optimum, what must be checked?
  1. That the solution is close to the optimal solution of the relaxation
  2. That the solution is a local optimum for local search
  3. That the solution satisfies the constraints, the variable bounds and integrality
  4. That the solution satisfies the linear constraints only, possibly with fractional components
Explanation. The feasibility check is not a formality: a solution with a fractional component is feasible for the relaxation, not for the MILP, and its value is not a primal bound.
mip-f-050 · level ipotesi · notes
Bin packing (minimum number of bins of capacity $7$): items of total weight $21$, and the best-fit heuristic packs them into $3$ bins. To conclude without a solver that $3$ is optimal, what is needed?
  1. The fact that best-fit is exact for bin packing when the weights are integer
  2. The elementary bound $\lceil 21/7 \rceil = 3$, valid for every solution, together with the feasible best-fit solution
  3. The linear relaxation with continuous $y_b$ being equal to $3$, together with the best-fit solution
  4. That next-fit and first-fit also find a solution with $3$ bins
Explanation. Best-fit gives $\ub = 3$; the total weight forces at least $\lceil 21/7 \rceil = 3$ bins, i.e. $\lb = 3$. The two bounds coincide and the optimum is proved.
mip-f-162 · level facile · notes
Minimum-cost set covering: teams are chosen to cover all the zones. The constructive heuristic always picks the team with the smallest ratio $c_j / \text{new}(j)$, where $\text{new}(j)$ is the number of still uncovered zones that $j$ covers. Teams: A costs $6$ and covers $3$ uncovered zones, B costs $4$ and covers $1$, C costs $5$ and covers $2$. Which is picked first?
  1. B (smallest cost)
  2. A (ratio $2$)
  3. None: ties are broken at random
  4. C (ratio $5/2$)
Explanation. The ratios are $6/3 = 2$, $4/1 = 4$ and $5/2$: A wins. The criterion is the cost per newly covered zone, not the absolute cost, which would pick B.
mip-f-163 · level facile · notes
Binary maximisation knapsack: values $p = (12, 9, 8)$, weights $w = (6, 5, 4)$, capacity $10$. The heuristic scans the items by decreasing $p_j / w_j$ and takes every item that still fits. What value does it return?
  1. $21$
  2. $20$
  3. $17$
  4. $12$
Explanation. The ratios are $2$, $1.8$ and $2$: with equal ratios the smaller index comes first, so the order is 1, 3, 2. Item 1 fits (residual $4$) and so does item 3 (residual $0$): value $12 + 8 = 20$, a lower bound. Here it is also the optimum.
mip-f-164 · level facile · notes
Lot sizing with setup $f = 50$ and holding $h = 1$ per unit and period; demands $d = (20, 10, 30)$. The least unit cost rule, starting from period 1, computes the average cost per unit covering $1$, $2$ or $3$ periods. What is it when covering the first **two** periods?
  1. $60$
  2. $5/3$
  3. $2$
  4. $5/2$
Explanation. One produces $20 + 10 = 30$ units in period 1; the $10$ of period 2 stay one period in stock. Cost $(50 + 1 \cdot 10)/30 = 60/30 = 2$. $5/3$ forgets the holding; $60$ is the total cost, not the cost per unit.
mip-f-165 · level teorema · notes
Local search on a minimisation MILP: starting from a feasible solution, a move is applied as long as a better neighbour exists. Which statement is correct?
  1. It always stops at the global optimum, if the move is rich enough
  2. It stops at a local optimum with respect to that move, which is an upper bound but in general not the optimum
  3. The value where it stops is a lower bound, because no neighbour is better
  4. It stops at the global optimum when it starts from the constructive heuristic's solution
Explanation. "No better neighbour" holds only within the neighbourhood defined by the move: the solution remains feasible, hence an upper bound in a minimisation, and proving its optimality needs a bound from the other side.
mip-f-208 · level facile · notes
Travelling salesman, nearest neighbour heuristic: from the starting city one moves each time to the nearest unvisited city, and at the end returns to the start. Why is the last arc often the longest of the tour?
  1. Because the heuristic chooses the longest arc to close the tour
  2. It is forced: one returns to the start whatever the distance, without choosing it
  3. Because the return arc counts twice in the tour length
  4. Because the cities left for last are always the farthest from each other
Explanation. The heuristic is myopic: it chooses the arcs one at a time without looking ahead, and the closing arc is not chosen, it is suffered.
mip-f-209 · level facile · notes
Three jobs of duration $(3, 3, 2)$ go on two machines with availability $(5, 3)$ minutes. Next-fit (fills one machine at a time, in order, never going back) puts job 1 on machine 1, job 2 on machine 2, and has nowhere to put job 3. Is the problem feasible?
  1. No: next-fit explores all the assignments before failing
  2. Yes, but only by splitting job 3 between the two machines
  3. No: the total duration $8$ exceeds the total availability
  4. Yes: jobs 2 and 3 on machine 1 ($5$) and job 1 on machine 2 ($3$)
Explanation. The total duration is $8 = 5 + 3$, and the assignment $\{2, 3\} \to 1$, $\{1\} \to 2$ fills it exactly. The failure of a myopic heuristic is information about the heuristic, not about the problem.
mip-f-210 · level facile · notes
Minimum-cost set covering: teams A, B, C, D cost $4, 3, 5, 3$ and cover zones A $\{1,3,4\}$, B $\{1,2,5\}$, C $\{2,3,6\}$, D $\{4,5,6\}$. The heuristic chooses each time the team with minimum ratio cost / new zones covered (equal ratios: the first in alphabetical order), until everything is covered. What cost does it obtain?
  1. $8$
  2. $10$
  3. $11$
  4. $6$
Explanation. Step 1: ratios $4/3$, $1$, $5/3$, $1$: B is chosen. Step 2: A covers $\{3,4\}$ ($2$), C $\{3,6\}$ ($5/2$), D $\{4,6\}$ ($3/2$): D is chosen. Step 3: zone 3 is left, A ($4$) beats C ($5$). Cost $3 + 3 + 4 = 10$; B and D alone ($6$) leave zone 3 uncovered.
mip-f-211 · level facile · notes
Among the course's constructive heuristics (next-fit, first-fit and best-fit for bin packing, LPT for the makespan, covering, ratio rule for the knapsack, nearest neighbour for the TSP, least unit cost for lot sizing), which gives a **lower** bound on the optimum?
  1. Best-fit for bin packing, because it fills the containers best
  2. None: a heuristic always gives an upper bound
  3. LPT for the makespan, because the makespan is a maximum of the loads
  4. The ratio rule for the knapsack, because the knapsack is a maximisation problem
Explanation. A feasible solution gives the pessimistic side: an upper bound in a minimisation, a lower bound in a maximisation. The knapsack is the only maximisation problem in the list; the makespan is minimised.
mip-f-212 · level facile · notes
On the instances of the heuristics chapter, best-fit (bin packing) and the covering heuristic find the optimum (gap $0\%$), while next-fit has gap $66.7\%$. What could be known **before** solving the MILP?
  1. That next-fit would be wrong, because it looks at a single container
  2. Nothing about the gap: without a bound on the other side $0\%$ and $67\%$ are told apart only afterwards
  3. That best-fit would be optimal, because it is the most accurate rule
  4. That the gap would be zero for all the heuristics of a minimisation problem
Explanation. A heuristic alone says how much a realisable solution costs, not how much is being lost: this is why the course always asks for two bounds, a primal and a dual one.
mip-f-351 · level teorema · notes
A constructive heuristic for a **minimisation** MILP stops with the message «no solution found». Which conclusion is correct?
  1. The MILP is infeasible, because the heuristic tried all possibilities
  2. None about the problem: the heuristic is myopic; infeasibility is proved by the solver (`INFEASIBLE`) or by a proof
  3. The primal bound is $+\infty$ and the gap is $0\%$
  4. The linear relaxation is infeasible
Explanation. The heuristic decides one thing at a time and never goes back: it may get stuck even on feasible instances. The failure is information about the heuristic, not about the problem.
mip-f-352 · level facile · notes
Bin packing: items of weight $w = (4, 4, 5, 3, 2, 3)$, in the given order, into containers of capacity $C = 7$. **First-fit** puts each item in the first open container where it fits, otherwise opens a new one. How many containers does it use?
  1. $6$
  2. $4$
  3. $5$
  4. $3$
Explanation. $4 \to$ b1; $4 \to$ b2; $5 \to$ b3; $3 \to$ b1 (filled to $7$); $2 \to$ b2 ($6$); $3$ fits nowhere (residuals $0, 1, 2$) $\to$ b4. Four containers; next-fit uses $5$, best-fit $3$.
mip-f-353 · level facile · notes
Bin packing, **best-fit** heuristic on the filling: each item goes, among the open containers where it fits, into the one with the smallest residual space after insertion (ties: smallest index); if it fits nowhere a new one is opened. Open containers with residuals $(3, 2, 5)$; an item of weight $2$ arrives. Where does it go?
  1. Into a new container
  2. Into container 2, which is left with residual $0$
  3. Into container 3, the one with most space
  4. Into container 1, the first where it fits
Explanation. It fits in all three, with final residuals $1$, $0$, $3$: the minimum is container 2. First-fit would choose container 1, worst-fit container 3.
mip-f-354 · level facile · notes
Makespan on $k = 2$ identical machines, jobs of duration $t = (2, 3, 4, 5)$. **List scheduling** in the given order (each job on the least loaded machine, ties: smallest index) gives one makespan; LPT (same rule, jobs by decreasing duration) another. What are they, in order?
  1. List scheduling $8$, LPT $8$
  2. List scheduling $8$, LPT $7$
  3. List scheduling $9$, LPT $7$
  4. List scheduling $7$, LPT $7$
Explanation. Given order: $2 \to$ M1, $3 \to$ M2, $4 \to$ M1 (loads $6, 3$), $5 \to$ M2 (loads $6, 8$): makespan $8$. LPT: $5 \to$ M1, $4 \to$ M2, $3 \to$ M2 ($5, 7$), $2 \to$ M1 ($7, 7$): makespan $7$, equal to the bound $\sum t / k = 7$, hence optimal.
mip-f-355 · level ipotesi · notes
LPT for the makespan on identical machines sorts the jobs by **decreasing** duration and puts each on the least loaded machine. If the sorting is removed (list scheduling in the given order), what is lost?
  1. Nothing: the least-loaded rule gives the same result in any order
  2. Feasibility: without sorting some jobs remain unassigned
  3. The guarantee that the result is optimal, which LPT always has
  4. Long jobs may come last onto already loaded machines, and the makespan worsens: the decreasing order is essential
Explanation. Without sorting the solution stays feasible but long jobs placed at the end unbalance the loads. LPT is not always optimal anyway: on $t = (5,5,4,4,3,3,3)$, $k = 3$ it gives $11$ against $9$.
mip-f-356 · level facile · notes
Set covering, cheapest-completion heuristic: at each step the element $j$ with minimum **cost per new zone** $c_j / \text{new}(j)$ is chosen, where $\text{new}(j)$ counts the still uncovered zones that $j$ covers (ties: smallest index). At the first step the costs are $c = (4, 3, 5, 3)$ and the new zones $(3, 3, 3, 2)$. Which element is chosen?
  1. Element 2 (ratio $1$)
  2. Element 1 (covers more zones at equal cost)
  3. Element 4 (minimum cost $3$, higher index)
  4. Element 4 (ratio $3/2$)
Explanation. The ratios are $4/3$, $1$, $5/3$, $3/2$: the minimum is element 2. The criterion is the cost per new zone, not the absolute cost (where 2 and 4 would tie).
mip-f-357 · level ipotesi · notes
Constructive covering heuristic (minimum cost): at some step uncovered zones remain, but no element not yet chosen covers any of them ($\text{new}(j) = 0$ for every $j$). What must the heuristic do, and why?
  1. Return «no solution found»: with no new zones the ratio $c_j/\text{new}(j)$ is undefined and the cover cannot be completed
  2. Return the partial solution as a primal bound
  3. Restart from the first step with a different order, until it finds a cover
  4. Choose the minimum-cost element, which covers something anyway
Explanation. The partial solution leaves zones uncovered: it is infeasible and gives no bound. The failure case must be declared in the pseudocode.
mip-f-358 · level facile · notes
Binary maximisation knapsack: values $p = (10, 7, 6, 4)$, weights $w = (5, 4, 3, 3)$, capacity $C = 9$. The heuristic scans the items by decreasing $p_j/w_j$ (ties: smallest index) and takes every item that fits in the residual. Which bound is obtained, and of which type?
  1. $\ub = 16$ (items 1 and 3)
  2. $\lb = 16$ (items 1 and 3)
  3. $\ub = 17$ (items 1 and 2)
  4. $\lb = 17$ (items 1 and 2)
Explanation. Ratios $2$, $7/4$, $2$, $4/3$: order 1, 3, 2, 4. It takes 1 (residual $4$) and 3 (residual $1$), then nothing fits: value $16$. In a maximisation a feasible solution gives a lower bound; the optimum is $17$.
mip-f-359 · level teorema · notes
Binary maximisation knapsack with a single capacity constraint. The heuristic by decreasing ratio $p_j/w_j$ gives $\lb$; the dual of the relaxation with $\bar v = \max_j p_j/w_j$ gives $\ub = C\,\bar v$; $\zmilp$ is the integer optimum. Which statement is always true?
  1. $\ub$ always coincides with the optimum of the relaxation
  2. $\lb \le \zmilp \le \ub$, but neither is in general equal to the optimum
  3. The ratio heuristic is always optimal on the binary knapsack
  4. $\ub - \lb$ never exceeds the value of the lightest item
Explanation. The first is a lower bound (feasible solution), the second an upper bound (feasible dual). The heuristic may fail (unused residual) and $C\bar v$ is in general higher than $\zlp$.
mip-f-360 · level facile · notes
Travelling salesman on five cities, symmetric distances: $d_{12} = 5$, $d_{13} = 2$, $d_{14} = 2$, $d_{15} = 9$, $d_{23} = 4$, $d_{24} = 3$, $d_{25} = 4$, $d_{34} = 4$, $d_{35} = 7$, $d_{45} = 7$. Nearest neighbour starts from city 2 (ties: smallest index) and finally returns to the start. How long is the tour?
  1. $16$
  2. $18$
  3. $19$
  4. $25$
Explanation. From 2 the nearest is 4 ($3$); from 4 city 1 ($2$); from 1 city 3 ($2$); city 5 remains ($7$); back to 2 ($4$). Total $3 + 2 + 2 + 7 + 4 = 18$, which here is the optimum; starting from 1 one gets $25$.
mip-f-361 · level facile · notes
Travelling salesman: nearest neighbour is run from **all** $n$ starting cities and the shortest tour is kept (multi-start). What is obtained?
  1. The TSP optimum, because all starts have been tried
  2. A lower bound, because the minimum of the tours is taken
  3. An upper bound better than or equal to that of a single start, at the cost of $n$ runs; it remains a one-sided bound
  4. The same tour from every start, because the rule is deterministic
Explanation. Every tour is feasible, so the best one is still only an upper bound (minimisation). Different starts give different tours; trying all starts is not the same as enumerating all tours.
mip-f-362 · level facile · notes
Uncapacitated lot sizing: demands $d = (20, 10, 30, 40, 10)$, setup cost $f = 50$, holding cost $h = 1$ per unit and period. The least unit cost rule, from period 1, compares the average cost per unit of covering $1$ period ($50/20$) or $2$ periods ($(50 + 10)/30$). Which does it choose, and with what average cost?
  1. $3$ periods, average cost $1.5$
  2. $1$ period, average cost $2.5$
  3. $2$ periods, average cost $2$
  4. $2$ periods, average cost $2.5$
Explanation. One period: $50/20 = 2.5$. Two periods: the $10$ units of period 2 are held one period, cost $50 + 10 = 60$ over $30$ units, that is $2$. (Three periods: $50 + 10 + 60 = 120$ over $60$, again $2$: ties keep the smaller number.)
mip-f-363 · level teorema · notes
Uncapacitated lot sizing. What is the difference between the least unit cost rule and the Wagner–Whitin procedure?
  1. Wagner–Whitin is an exact algorithm (dynamic programming) for this model; least unit cost is a heuristic and gives only an upper bound
  2. They are the same procedure under two names
  3. Wagner–Whitin gives a lower bound, least unit cost an upper bound
  4. Wagner–Whitin is a faster heuristic; least unit cost is exact
Explanation. Wagner–Whitin solves uncapacitated lot sizing to optimality in polynomial time; the least unit cost rule looks at one launch at a time and may fail (on the course example $200$ against $170$).
mip-f-364 · level facile · notes
Makespan on $3$ identical machines, loads $L = (11, 8, 8)$ with machine 1 holding jobs $(5, 3, 3)$. Local search uses only the move «move one job to another machine» and accepts only moves that reduce the makespan. What happens?
  1. No move improves: moving a job of $3$ brings another machine to $11$; the search stops at $11$
  2. Local search always finds the optimum $9$ with move operations
  3. Moving a job of $3$ brings the makespan to $9$
  4. Moving the job of $5$ brings the makespan to $13$, then it goes down to $9$
Explanation. Removing a $3$ lowers machine 1 to $8$, but the receiving machine rises to $11$: the makespan does not decrease. Moving the $5$ gives $13$. To reach $9$ a swap move is needed.
mip-f-365 · level ipotesi · notes
Minimisation MILP. A local search starts from a heuristic solution ($\ub = 30$) and stops at a local optimum of value $26$. A student writes «$\zmilp = 26$, because no move improves». What is missing to claim it?
  1. A lower bound equal to $26$ (for example from a feasible dual or from the solver): the local optimum gives only $\ub = 26$
  2. Checking that the solution is integer: if so, it is optimal
  3. Nothing: a local optimum is always global in MILPs
  4. Repeating the local search with the same move
Explanation. Local search returns a feasible solution, that is, a bound on the pessimistic side. Having stopped does not mean having arrived: a bound from the other side matching it is needed.
mip-f-366 · level facile · notes
Two machines with availabilities $(5, 3)$ and three jobs of duration $(3, 3, 2)$, all to be assigned. Which assignment proves the problem feasible, even though next-fit fails?
  1. Jobs 1 and 2 on machine 1, job 3 on machine 2
  2. None: the failure of next-fit proves that none exists
  3. Jobs 1 and 3 on machine 2, job 2 on machine 1
  4. Jobs 2 and 3 on machine 1 ($5$), job 1 on machine 2 ($3$)
Explanation. $3 + 2 = 5 \le 5$ and $3 \le 3$: feasible. The others violate an availability ($6 > 5$, $5 > 3$). The failure of the heuristic says nothing about the existence of solutions.
mip-f-367 · level facile · notes
An assignment MILP with availabilities: the constructive heuristic fails. Which tool can **prove** that the model is infeasible?
  1. A second constructive heuristic with a different order, if it fails too
  2. The solver, returning `Status = INFEASIBLE`, or a mathematical proof
  3. Local search starting from the partial solution
  4. The linear relaxation, if it has a fractional solution
Explanation. Heuristics, even several, do not prove non-existence: they are myopic. A feasible fractional relaxation proves nothing about the integer problem; the solver (or an argument) is needed.
mip-f-368 · level facile · notes
In the course's overview of heuristics, next-fit on bin packing uses $5$ containers when the optimum is $3$. What is the heuristic gap $|\ub - \zmilp|/|\zmilp|$?
  1. $66.7\%$
  2. $2\%$
  3. $33.3\%$
  4. $40\%$
Explanation. $(5 - 3)/3 = 2/3 \approx 66.7\%$. Dividing by $\ub$ would give $40\%$; $33.3\%$ is the gap of first-fit ($4$ containers).
mip-f-369 · level facile · notes
In the course's overview of heuristics, the ratio heuristic on the knapsack (maximisation) finds $16$ and the optimum is $17$. How is the result written correctly?
  1. $\lb = 16 \le \zmilp = 17$, gap $5.9\%$
  2. $\ub = 17$, gap $0\%$
  3. $\ub = 16 \ge \zmilp$, gap $5.9\%$
  4. $\lb = 16$, gap $6.25\%$
Explanation. In a maximisation a feasible solution gives a lower bound. Gap with respect to the optimum: $(17 - 16)/17 \approx 5.9\%$; dividing by $16$ gives $6.25\%$.
mip-f-515 · level teorema · notes
Bin packing with containers of capacity $C$ and items of total weight $W$. Best-fit returns $k$ containers and $k = \lceil W / C \rceil$. What can be concluded?
  1. Best-fit is always optimal
  2. Nothing: the solver is needed to confirm
  3. The solution is optimal only if all containers are exactly full
  4. The solution is optimal: $\lceil W/C \rceil$ is a lower bound and the solution attains it
Explanation. No solution uses fewer than $\lceil W/C \rceil$ containers; a feasible solution matching it closes the sandwich: $\lb = \ub$. The containers need not be full.
mip-f-516 · level ipotesi · notes
TSP, nearest neighbour: a student claims «the rule picks the shortest available arc at each step, so the tour is optimal». Which observation refutes it?
  1. The rule is optimal only with symmetric distances
  2. The tour obtained may visit a city twice
  3. The rule does not pick the shortest arc, but the longest
  4. Locally best choices do not guarantee the best tour: the final return arc is forced and may be very long
Explanation. The heuristic is myopic: on the course instance the tour from 1 is $25$ long against the optimum $18$, and the last arc ($5 \to 1$, length $9$) is the one that costs.
mip-f-548 · level teorema · notes
Makespan on identical machines, LPT on $t = (5, 5, 4, 4, 3, 3, 3)$ and $k = 3$: $\ub = 11$; bound $\max(\max_j t_j, \sum_j t_j/k) = 9$, which is the optimum. Which general conclusion is correct?
  1. LPT gives a feasible solution but is not always optimal; the elementary bound may coincide with the optimum
  2. The elementary bound is never attained
  3. If LPT is not optimal, the problem is infeasible
  4. LPT is always optimal with identical machines
Explanation. LPT is a heuristic: here it misses by $22.2\%$. The bound $\max(\max t, \sum t/k)$ is exact in this case, but one knows it only after finding a solution of value $9$.
mip-f-549 · level teorema · notes
In the course's overview of heuristics some find the optimum (gap $0\%$) and others do not (up to $67\%$). What can be said **before** solving the MILP?
  1. That the best heuristic is always best-fit
  2. Nothing about quality: a heuristic alone gives only a one-sided bound; a bound from the other side is needed to measure what is lost
  3. That heuristics with gap $0\%$ are those with more steps
  4. That the heuristic gap is computed from its value
Explanation. The heuristic gap needs the optimum; without it, a dual bound is needed for the certified gap. That is why the course always asks for two bounds.

Part: Modelling techniques (108)

5. Logic and binary variables (43)

mip-f-051 · level facile · notes
In Boolean logic a literal is a variable or its negation. When is an expression in **conjunctive normal form** (CNF)?
  1. When every variable appears in a single clause
  2. When it is an OR of terms, each an AND of literals
  3. When it is an AND of clauses, each an OR of literals
  4. When it contains no negated variable
Explanation. A clause is an OR of literals and CNF is an AND of clauses: it is the form from which one linear constraint per clause is written. An OR of ANDs is the disjunctive normal form.
mip-f-052 · level facile · notes
Binary variables $x_1, x_2, x_3$ ($1$ = true). Which linear constraint is satisfied exactly by the assignments that make the clause $x_1 \lor \lnot x_2 \lor x_3$ true?
  1. $x_1 - x_2 + x_3 \ge 0$
  2. $x_1 + x_2 + x_3 \ge 1$
  3. $x_1 - x_2 + x_3 \le 1$
  4. $x_1 - x_2 + x_3 \ge 1$
Explanation. Every OR becomes a $+$, the negative literal $\lnot x_2$ becomes $1 - x_2$, the clause becomes $\ge 1$: $x_1 + 1 - x_2 + x_3 \ge 1$, that is $x_1 - x_2 + x_3 \ge 0$.
mip-f-053 · level facile · notes
Binary variables. The clause $\lnot x_1 \lor \lnot x_6 \lor x_7$ translates into $(1 - x_1) + (1 - x_6) + x_7 \ge 1$. Which of the following is an equivalent form of the same constraint?
  1. $x_1 + x_6 - x_7 \ge 1$
  2. $x_7 - x_1 - x_6 \ge 1$
  3. $x_1 + x_6 + x_7 \le 2$
  4. $x_1 + x_6 - x_7 \le 1$
Explanation. Moving the constants to the right gives $-x_1 - x_6 + x_7 \ge -1$, and multiplying by $-1$ gives $x_1 + x_6 - x_7 \le 1$: it is the same constraint, more readable when there are two or more negative literals.
mip-f-054 · level facile · notes
Binary variables. For the implication $x_a \Rightarrow x_b$ the constraint $x_b - x_a \ge 0$ has already been written. How many more constraints are needed to also impose the contrapositive $\lnot x_b \Rightarrow \lnot x_a$?
  1. One, $x_a - x_b \ge 0$
  2. Two, one per literal
  3. One, $x_a + x_b \le 1$
  4. None: it has the same clause $\lnot x_a \lor x_b$
Explanation. $\lnot x_b \Rightarrow \lnot x_a$ is $x_b \lor \lnot x_a$ (by double negation), the same clause as $x_a \Rightarrow x_b$: the contrapositive is not a second constraint.
mip-f-055 · level facile · notes
Binary variables $x_1, x_2, x_3$. "At most one out of three" is written with the three clauses $x_1 + x_2 \le 1$, $x_1 + x_3 \le 1$, $x_2 + x_3 \le 1$, or with $x_1 + x_2 + x_3 \le 1$. What is the difference, also in the linear relaxation ($0 \le x \le 1$)?
  1. Same binary solutions, but the single constraint is tighter in the relaxation: $(1/2, 1/2, 1/2)$ satisfies the clauses and violates it
  2. Same binary solutions, but the three clauses are tighter in the relaxation because they are more constraints
  3. Different binary solutions: the single constraint excludes assignments that the three clauses allow
  4. Same binary solutions and same relaxation: the two forms are interchangeable in the continuum too
Explanation. On binary assignments the two forms coincide; in the continuum the cardinality constraint cuts off points the clauses allow. When counting is possible, count.
mip-f-056 · level facile · notes
Five binary variables $x_i$, $i \in I$. "At least $2$ out of $5$" is written $\sum_{i \in I} x_i \ge 2$. In CNF the same constraint asks that every subset of $4$ variables contain a true one. How many clauses would be needed?
  1. $32$
  2. $1$
  3. $10$
  4. $5$
Explanation. "At least $p$ out of $|I|$" in CNF asks that every subset of $|I| - p + 1$ elements contain a true one: $\binom{5}{4} = 5$ clauses, against a single cardinality constraint. $10 = \binom{5}{2}$ counts the pairs.
mip-f-057 · level facile · notes
A Boolean expression is **unsatisfiable** if no assignment of the variables makes it true. Which of the following is?
  1. $(x_a \lor x_b) \land (x_c \lor x_d) \land \lnot x_e$
  2. $(x_a \lor x_b) \land (\lnot x_a \lor x_b) \land (x_a \lor \lnot x_b)$
  3. $\lnot x_a \lor \big((x_b \lor x_c) \land (x_d \lor x_e)\big)$
  4. $(x_a \lor x_b) \land (\lnot x_a \lor x_b) \land (x_a \lor \lnot x_b) \land (\lnot x_a \lor \lnot x_b)$
Explanation. Each of the four assignments of $(x_a, x_b)$ falsifies one of the four clauses. Without the last clause $x_a = x_b = 1$ works.
mip-f-058 · level facile · notes
Boolean variables $x_a, x_b, x_c$. "At least two out of $a, b, c$" is written $(x_a \land x_b) \lor (x_a \land x_c) \lor (x_b \land x_c)$. What is its conjunctive normal form?
  1. $x_a \land x_b \land x_c$
  2. $(x_a \lor x_b) \land (x_a \lor x_c) \land (x_b \lor x_c)$
  3. $(x_a \lor x_b \lor x_c) \land (\lnot x_a \lor \lnot x_b \lor \lnot x_c)$
  4. $x_a \lor x_b \lor x_c$
Explanation. Distributivity gives three pairwise clauses: every pair must contain at least one true element, which is exactly "at least two out of three".
mip-f-059 · level facile · notes
Project selection: $x_p \in \{0,1\}$ equals $1$ if project $p$ is chosen. "If project 4 is chosen then at least two out of 1, 2, 3". Which **single** constraint translates it exactly on binary solutions?
  1. $x_1 + x_2 + x_3 - x_4 \ge 1$
  2. $x_1 + x_2 + x_3 \ge 2$
  3. $x_1 + x_2 + x_3 \ge 2x_4$
  4. $x_1 + x_2 + x_3 \le 2x_4$
Explanation. With $x_4 = 1$ it asks for at least two projects, with $x_4 = 0$ it says nothing: the same binary solutions as the three CNF clauses, in a single constraint that is stronger in the relaxation. The third asks for one project only.
mip-f-060 · level facile · notes
For Boolean variables $x_a, x_b$, which law states the equivalence $\lnot(x_a \land x_b) \iff \lnot x_a \lor \lnot x_b$?
  1. The absorption law
  2. The distributive law
  3. The double negation law
  4. De Morgan's law
Explanation. It is De Morgan's law; its other form is $\lnot(x_a \lor x_b) \iff \lnot x_a \land \lnot x_b$. Double negation is $\lnot\lnot x \iff x$.
mip-f-061 · level facile · notes
Boolean variables. Why can the implication $(x_a \land x_b) \Rightarrow x_c$ **not** be replaced by $(x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$?
  1. With $x_a = 1$, $x_b = 0$, $x_c = 0$ the original is true and the replacement false: the replacement cuts off allowed solutions
  2. With $x_a = x_b = 0$, $x_c = 1$ the original is false and the replacement true: the replacement admits forbidden solutions
  3. With $x_a = x_b = x_c = 1$ the original is false and the replacement true: the replacement admits forbidden solutions
  4. With $x_a = x_b = 1$, $x_c = 0$ the original is true and the replacement false: the replacement cuts off allowed solutions
Explanation. With a false antecedent $x_a \land x_b$ the original is true, but $x_a \Rightarrow x_c$ is false: the conjunction of the two implications is strictly stronger. Splitting is allowed only with a disjunction in the antecedent.
mip-f-062 · level facile · notes
Binary variables; every CNF clause becomes one linear constraint. How many constraints are needed for $x_a \lor x_b \Rightarrow x_c$, and how many for $x_a \Rightarrow x_b \lor x_c$?
  1. One each
  2. Two the first, one the second
  3. Two each
  4. One the first, two the second
Explanation. The first is $(\lnot x_a \lor x_c) \land (\lnot x_b \lor x_c)$: two clauses. The second is the single clause $\lnot x_a \lor x_b \lor x_c$, i.e. $x_b + x_c - x_a \ge 0$.
mip-f-063 · level media · notes
Boolean variables. The implication $(x_1 \lor x_4) \land x_6 \Rightarrow x_2 \land (x_5 \lor x_7)$ is brought to CNF with $p \Rightarrow q \equiv \lnot p \lor q$, De Morgan and distributivity. How many clauses (and hence linear constraints) are obtained?
  1. $6$
  2. $3$
  3. $4$
  4. $2$
Explanation. Negating the antecedent gives $(\lnot x_1 \lor \lnot x_6) \land (\lnot x_4 \lor \lnot x_6)$, the consequent is $x_2 \land (x_5 \lor x_7)$; distributing the OR yields $2 \cdot 2 = 4$ clauses, for instance $\lnot x_1 \lor \lnot x_6 \lor x_5 \lor x_7$.
mip-f-064 · level teorema · notes
Which equivalence between Boolean expressions holds for every $x_a, x_b, x_c \in \{0,1\}$?
  1. $x_a \Rightarrow (x_b \lor x_c) \iff (x_a \Rightarrow x_b) \land (x_a \Rightarrow x_c)$
  2. $(x_a \land x_b) \Rightarrow x_c \iff (x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$
  3. $x_a \Rightarrow x_b \iff x_b \Rightarrow x_a$
  4. $(x_a \lor x_b) \Rightarrow x_c \iff (x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$
Explanation. A disjunctive antecedent splits, and so does a conjunctive consequent. A conjunctive antecedent does not, nor does a disjunctive consequent, and an implication is not equivalent to its converse.
mip-f-065 · level teorema · notes
A Boolean expression in the variables $x_1, \dots, x_n$ is translated into a system of linear constraints on the same binary variables. When is the translation **correct**?
  1. When every binary assignment making the expression true satisfies all the constraints
  2. When every binary assignment satisfying all the constraints makes the expression true
  3. When the optimal solution of the linear relaxation makes the expression true
  4. When, for every binary assignment, the expression is true if and only if all the constraints are satisfied
Explanation. Both directions are needed: no true assignment excluded and no false one admitted. With few variables it is checked by enumerating the $2^n$ assignments, which is a proof by cases.
mip-f-066 · level ipotesi · notes
Binary variables $x_1, x_2, x_3$. One wants to prove that $x_1 + x_2 + x_3 \le 1$ and the three clauses $x_i + x_j \le 1$ ($i < j$) have the same binary solutions but different linear relaxations. What is enough?
  1. Enumerating the $8$ binary assignments and exhibiting a fractional point, such as $(1/2, 1/2, 1/2)$, that satisfies the clauses and violates the single constraint
  2. Enumerating the $8$ binary assignments and noting that the clauses outnumber the single constraint
  3. Applying weak duality to the two relaxations and comparing their optimal values
  4. Exhibiting a fractional point that satisfies the single constraint and violates the clauses, without enumerating
Explanation. Enumeration proves equality on binary points; for the difference in the relaxations one continuous point admitted by one formulation and not by the other is enough, and that point lies on the clauses' side.
mip-f-067 · level ipotesi · notes
Boolean variables. To prove that $(x_a \land x_b) \Rightarrow x_c$ is **not** equivalent to $(x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$, what is needed?
  1. An assignment making the first true and the second false, such as $x_a = 1$, $x_b = 0$, $x_c = 0$
  2. Applying De Morgan to the contrapositive of the first expression
  3. An assignment making the first false and the second true, such as $x_a = x_b = 1$, $x_c = 0$
  4. Showing that the two expressions have the same number of true assignments
Explanation. One counterexample is enough. It cannot be an assignment making the first false and the second true: the second is stronger, so such an assignment does not exist (with $x_a = x_b = 1$, $x_c = 0$ both are false).
mip-f-068 · level ipotesi · notes
Binary variables. To translate $x_a \Rightarrow x_b \land x_c$ into the two constraints $x_b - x_a \ge 0$ and $x_c - x_a \ge 0$, which results are used?
  1. $p \Rightarrow q \equiv \lnot p \lor q$, distributivity $x \lor (y \land z) \iff (x \lor y) \land (x \lor z)$ and one constraint per clause
  2. $p \Rightarrow q \equiv \lnot p \lor q$, De Morgan $\lnot(y \land z) \iff \lnot y \lor \lnot z$ and one constraint per clause
  3. Distributivity $x \land (y \lor z) \iff (x \land y) \lor (x \land z)$, double negation and one constraint per clause
  4. The contrapositive $\lnot q \Rightarrow \lnot p$, absorption $x \lor (x \land y) \iff x$ and one constraint per clause
Explanation. The implication becomes $\lnot x_a \lor (x_b \land x_c)$, distributivity of OR over AND turns it into $(\lnot x_a \lor x_b) \land (\lnot x_a \lor x_c)$, and every clause gives a constraint.
mip-f-166 · level facile · notes
Binary variables $x_1, x_2$. "Exactly one of the two" (exclusive OR) is true only for $(1,0)$ and $(0,1)$. Which linear constraint translates it exactly?
  1. $x_1 + x_2 \ge 1$
  2. $x_1 - x_2 = 0$
  3. $x_1 + x_2 \le 1$
  4. $x_1 + x_2 = 1$
Explanation. It is the CNF $(x_1 \lor x_2) \land (\lnot x_1 \lor \lnot x_2)$: "at least one" ($\ge 1$) and "at most one" ($\le 1$) together give the equality. $x_1 - x_2 = 0$ would admit exactly the two excluded cases.
mip-f-167 · level facile · notes
Project knapsack: $\max \sum_p r_p x_p$ with a budget constraint and $x_p \in \{0,1\}$. The logical constraint "projects 2 and 5 are not chosen together" is added. What happens to the integer optimum?
  1. It always goes up, because the constraint excludes an expensive combination
  2. It stays the same or goes up: a logical constraint removes no feasible solutions
  3. It always stays the same, because the logical constraint acts only on the relaxation
  4. It stays the same or goes down: the constraint restricts the feasible set of a maximisation
Explanation. The constraint $x_2 + x_5 \le 1$ removes the solutions choosing both; in a maximisation the optimum over a smaller set cannot increase. It stays the same if an optimum already avoided them.
mip-f-213 · level facile · notes
Boolean expressions in the binary variables $x_a, x_b$ ($1$ = true). Which of the following is true for **every** assignment?
  1. $x_a \land \lnot x_a$
  2. $(x_a \lor x_b) \land \lnot x_b$
  3. $x_a \lor x_b$
  4. $x_a \lor \lnot x_a \lor x_b$
Explanation. $x_a \lor \lnot x_a$ is always true, and adding a literal to a true disjunction keeps it true. $x_a \land \lnot x_a$ is unsatisfiable; the other two are satisfiable but false for $x_a = x_b = 0$.
mip-f-214 · level facile · notes
A Boolean expression in $3$ binary variables has been translated into linear constraints on the same variables. How is the translation **proved** correct?
  1. Enumerate the $8$ assignments and check for each: expression true $\iff$ constraints satisfied
  2. Check the assignments that make the expression true: they must satisfy the constraints
  3. Solve the linear relaxation and check that its optimum makes the expression true
  4. Try one random assignment: if it is consistent, all of them are
Explanation. Correct means "true if and only if the constraints are satisfied" on every assignment: both directions are needed on all $2^3$ cases. Checking only the true assignments lets constraints that are too loose pass.
mip-f-215 · level facile · notes
Maximum-revenue project selection with a budget, $x_p \in \{0,1\}$. Without logical constraints the optimum is $30$; adding six implications translated into clauses, the integer optimum drops to $28$ and the linear relaxation (with $0 \le x \le 1$) of the new model is $29$. Which reading is correct?
  1. The logical constraints restrict the set and lower the optimum; $29$ is an upper bound on $28$
  2. The optimum dropped because the clauses were translated wrongly: a logical constraint removes no value
  3. $29$ is a lower bound on $28$, because the relaxation has fewer constraints
  4. The logical constraints act only on integer solutions, so the relaxation should be $30$
Explanation. In a maximisation adding constraints cannot raise the optimum ($30 \to 28$), and the relaxation lies above the integer optimum ($29 \ge 28$). The clauses cut the relaxation too: $29 < 30$.
mip-f-370 · level facile · notes
Boolean variables $x_a, x_b$ ($1$ = true). Is the expression $x_a \land \lnot x_a$ satisfiable, that is, is there an assignment making it true?
  1. No: for every value of $x_a$ one of the two literals is false
  2. Yes, with $x_a = 0$
  3. It depends on $x_b$
  4. Yes, with $x_a = 1$
Explanation. $x_a$ and $\lnot x_a$ cannot be true together: the expression is unsatisfiable (a contradiction); $x_b$ does not appear in it.
mip-f-371 · level facile · notes
Boolean variables $x_a, x_b$ ($1$ = true). For how many of the four assignments of $(x_a, x_b)$ is the expression $x_a \Rightarrow x_b$ true?
  1. $2$
  2. $3$
  3. $1$
  4. $4$
Explanation. $x_a \Rightarrow x_b$ is equivalent to $\lnot x_a \lor x_b$: it is false only for $x_a = 1$, $x_b = 0$. True in the other three.
mip-f-372 · level facile · notes
Boolean variables. Which of the following expressions is in **conjunctive normal form** (CNF: conjunction of clauses, each clause a disjunction of literals)?
  1. $x_1 \Rightarrow (x_2 \land x_3)$
  2. $\lnot(x_1 \lor x_2)$
  3. $(x_1 \land x_2) \lor x_3$
  4. $(x_1 \lor \lnot x_2) \land (x_2 \lor x_3)$
Explanation. The first is an AND of two ORs of literals. The second is an OR of an AND; the third has a negation over a clause; the fourth contains an implication.
mip-f-373 · level facile · notes
Binary variables ($1$ = true). The clause $x_1 \lor \lnot x_2 \lor \lnot x_3$ is translated with the rule «a positive literal is $x$, a negated one $1 - x$, the sum is $\ge 1$». Which constraint is obtained, with constants on the right?
  1. $x_1 - x_2 - x_3 \ge 0$
  2. $x_1 + x_2 + x_3 \ge 1$
  3. $x_1 - x_2 - x_3 \ge 1$
  4. $x_1 - x_2 - x_3 \ge -1$
Explanation. $x_1 + (1 - x_2) + (1 - x_3) \ge 1$, that is $x_1 - x_2 - x_3 \ge 1 - 2 = -1$. Only $(0, 1, 1)$ is excluded, giving $-2$.
mip-f-374 · level teorema · notes
A Boolean expression in CNF with $k$ clauses is translated into linear constraints on binary variables with the course rules (one clause, one constraint $\ge 1$). Which property does the translation have?
  1. The binary assignments satisfying the $k$ constraints are exactly those making the expression true
  2. Every solution of the linear relaxation of the constraints makes the expression true
  3. The number of constraints is always $2^n$, with $n$ variables
  4. The translation also admits assignments making the expression false, which the objective then discards
Explanation. A clause is true if and only if at least one of its literals is true, that is, if the sum of the translated literals is at least $1$; the CNF is true if and only if all clauses are. The correspondence holds on binary points, not on fractional ones.
mip-f-375 · level facile · notes
Binary variables ($1$ = true). Which linear constraint translates exactly $x_a \Rightarrow \lnot x_b$ («if $a$ is chosen, $b$ is not»)?
  1. $x_a + x_b \le 1$
  2. $x_a \le x_b$
  3. $x_a + x_b \ge 1$
  4. $x_a - x_b \le 0$
Explanation. $x_a \Rightarrow \lnot x_b$ is equivalent to $\lnot x_a \lor \lnot x_b$: $(1 - x_a) + (1 - x_b) \ge 1$, that is $x_a + x_b \le 1$, excluding only $(1,1)$.
mip-f-376 · level facile · notes
Boolean variables. Which split of an implication into two simpler implications is **valid** (equivalent to the original)?
  1. $(x_a \lor x_b) \Rightarrow x_c \iff (x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$
  2. $x_a \Rightarrow (x_b \lor x_c) \iff (x_a \Rightarrow x_b) \land (x_a \Rightarrow x_c)$
  3. $(x_a \land x_b) \Rightarrow x_c \iff (x_a \Rightarrow x_c) \land (x_b \Rightarrow x_c)$
  4. $(x_a \land x_b) \Rightarrow x_c \iff (x_a \Rightarrow x_c) \lor (x_b \Rightarrow x_c) \lor x_c$
Explanation. With a disjunctive antecedent one may split: either one being true requires $x_c$. With a conjunctive antecedent the split is strictly stronger; with a disjunctive consequent the split into AND is too strong.
mip-f-377 · level facile · notes
A translation of a Boolean expression in $4$ binary variables into linear constraints is checked by enumeration. How many assignments must be checked, and what is checked for each?
  1. $16$; that at least one constraint is satisfied when the expression is true
  2. $16$; that the expression is true if and only if all constraints are satisfied
  3. $8$; that the constraints are satisfied
  4. $4$; that every variable appears in at least one constraint
Explanation. With $4$ binaries there are $2^4 = 16$ assignments, and for each one the truth of the expression and the satisfaction of all constraints must coincide: it is the proof by cases.
mip-f-378 · level ipotesi · notes
A student checks the translation of a Boolean expression by verifying only that **every** assignment making the expression true satisfies all constraints. What remains unchecked?
  1. That the assignments making the expression false violate at least one constraint: the constraints might be too loose
  2. That the linear relaxation of the constraints is integral
  3. That the constraints are linear
  4. Nothing: one direction suffices, the other follows
Explanation. An exact translation needs both directions: true ⇒ constraints satisfied (no solution cut) and false ⇒ at least one constraint violated (no wrong solution admitted). The empty system of constraints passes the first check.
mip-f-379 · level facile · notes
Project selection, $x_p \in \{0,1\}$ ($1$ = project chosen). «If project 1 or project 2 is chosen, project 3 must be chosen.» Which translation is exact?
  1. $x_1 + x_2 + x_3 \ge 1$
  2. $x_3 \ge x_1$ and $x_3 \ge x_2$
  3. $x_1 + x_2 - x_3 \le 1$
  4. $x_3 \ge x_1 + x_2$
Explanation. $(x_1 \lor x_2) \Rightarrow x_3$ splits into two implications, each a constraint $x_3 \ge x_i$. $x_3 \ge x_1 + x_2$ forbids $x_1 = x_2 = 1$; $x_1 + x_2 - x_3 \le 1$ translates the antecedent with AND.
mip-f-380 · level facile · notes
Binary variables ($1$ = true). «Exactly two of $x_1, x_2, x_3, x_4$.» Which constraint translates it in one go?
  1. $x_1 + x_2 + x_3 + x_4 = 2$
  2. $x_1 + x_2 = 1$ and $x_3 + x_4 = 1$
  3. $x_1 + x_2 + x_3 + x_4 \ge 2$
  4. $x_1 + x_2 \le 1$ and $x_3 + x_4 \le 1$
Explanation. A cardinality is counted directly. «At least two» also admits three or four; the other two pairs of constraints impose a split between the pairs that the text does not ask (they exclude for example $x_1 = x_2 = 1$).
mip-f-381 · level teorema · notes
Project selection with **maximum** revenue and a budget. Some logical constraints are added (implications translated exactly). Which relation links the optimum with the logical constraints, $z_L$, to the one without, $z_0$?
  1. $z_L \le z_0$: logical constraints restrict the feasible set
  2. $z_L \ge z_0$: logical constraints guide the solver towards better solutions
  3. $z_L = z_0$: exactly translated implications cut no solutions
  4. No general relation
Explanation. Adding constraints to a maximisation cannot raise the optimum. Translating exactly means not cutting solutions that respect the logic, but those violating it are excluded.
mip-f-382 · level ipotesi · notes
In a project selection model the condition «if project 2 is chosen, then project 5 is chosen» is translated as $x_2 = x_5$. What is the effect of the mistake?
  1. None: with binaries $x_2 = x_5$ is equivalent to $x_2 \le x_5$
  2. It allows $x_2 = 1$, $x_5 = 0$, which the logic forbids
  3. It makes the model infeasible in every case
  4. It also forbids $x_5 = 1$, $x_2 = 0$, which the logic allows: the model is tighter and may lose the optimum
Explanation. The implication is $x_2 \le x_5$. The equality adds the reverse direction $x_5 \Rightarrow x_2$, which the text does not ask: it cuts feasible solutions, so in a maximisation the optimum may drop.
mip-f-383 · level facile · notes
Each binary variable is associated with a subset of a universe $U$: $x_a = 1$ means «the chosen element lies in $A$». Which set operation corresponds to $x_a \land x_b$?
  1. The complement $\overline{A}$
  2. The union $A \cup B$
  3. The intersection $A \cap B$
  4. The difference $A \setminus B$
Explanation. AND is true when the element lies in both sets: intersection. OR corresponds to union, negation to complement.
mip-f-384 · level facile · notes
With the correspondence between logic and sets ($\land \leftrightarrow \cap$, $\lor \leftrightarrow \cup$, $\lnot \leftrightarrow$ complement), which set identity corresponds to De Morgan's law $\lnot(x_a \lor x_b) \iff \lnot x_a \land \lnot x_b$?
  1. $A \cup (A \cap B) = A$
  2. $\overline{A \cup B} = \overline{A} \cap \overline{B}$
  3. $\overline{A \cup B} = \overline{A} \cup \overline{B}$
  4. $\overline{A \cap B} = \overline{A} \cap \overline{B}$
Explanation. The negation of an OR becomes the complement of a union, equal to the intersection of the complements. The second and third mix the two laws; the last is absorption.
mip-f-385 · level facile · notes
Logic and sets: with $x_a = 1$ if the chosen element lies in $A$, absorption $x_a \lor (x_a \land x_b) \iff x_a$ corresponds to which identity?
  1. $A \cup (A \cap B) = A \cup B$
  2. $A \cup (A \cap B) = A \cap B$
  3. $A \cap (A \cup B) = B$
  4. $A \cup (A \cap B) = A$
Explanation. $A \cap B \subseteq A$, so joining it with $A$ adds nothing. The dual absorption is $A \cap (A \cup B) = A$, not $B$.
mip-f-386 · level teorema · notes
Distributivity $x_a \land (x_b \lor x_c) \iff (x_a \land x_b) \lor (x_a \land x_c)$ can be proved by enumerating the $8$ assignments or with Venn diagrams. Which set identity expresses it?
  1. $\overline{A \cap (B \cup C)} = \overline{A} \cup \overline{B} \cup \overline{C}$
  2. $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$
  3. $A \cup (B \cap C) = (A \cap B) \cup (A \cap C)$
  4. $A \cap (B \cup C) = (A \cup B) \cap (A \cup C)$
Explanation. AND becomes intersection, OR union: intersection distributes over union. The third is the other distributivity written wrongly; the fourth gets the complement of $B \cup C$ wrong.
mip-f-517 · level ipotesi · notes
Binary variables $x_1, x_2, x_3$. «At most one of three» is written with three clauses ($x_1 + x_2 \le 1$, $x_1 + x_3 \le 1$, $x_2 + x_3 \le 1$) or with $x_1 + x_2 + x_3 \le 1$. A student concludes «they are equivalent in every respect». What is overlooked?
  1. Nothing: they are equivalent also in the relaxation
  2. The aggregated constraint admits $(1, 1, 0)$
  3. They have the same binary solutions, but not the same relaxation: $(1/2, 1/2, 1/2)$ satisfies the clauses and violates the aggregated constraint
  4. They do not have the same binary solutions: the clauses admit $(1, 1, 0)$
Explanation. On binary points they coincide; in the relaxation the aggregated form is tighter. When one can count, one counts: it is shorter and stronger.
mip-f-550 · level ipotesi · notes
Binary variables. A student translates $x_a \Rightarrow x_b$ as $x_a \ge x_b$. What is wrong?
  1. An equality is needed
  2. The direction is reversed: $x_a \ge x_b$ translates $x_b \Rightarrow x_a$; the required implication is $x_b \ge x_a$
  3. Nothing: the two forms are equivalent
  4. Two constraints are needed
Explanation. $x_a \Rightarrow x_b$ excludes only $(1, 0)$: $x_b - x_a \ge 0$. The student's constraint excludes $(0, 1)$ instead.
mip-f-551 · level ipotesi · notes
Binary variables. The clause $x_1 \lor \lnot x_2$ is translated by a student as $x_1 - x_2 \ge 1$. What happens?
  1. The constraint is too tight: it admits only $(1, 0)$, while the clause is also true at $(0, 0)$ and $(1, 1)$; the right constant is $0$
  2. The constraint is infeasible
  3. The constraint is too loose
  4. Nothing: it is the correct translation
Explanation. $x_1 + (1 - x_2) \ge 1$ gives $x_1 - x_2 \ge 0$. Forgetting to move the negated literal's constant to the right cuts assignments that the clause admits.

6. Links between variables (65)

mip-f-069 · level facile · notes
Activation link: $n$ objects $i$, $m$ resources $j$, $x_{ij} = 1$ if object $i$ uses resource $j$, $y_j = 1$ if the resource is activated. Disaggregated form $x_{ij} \le y_j$ for every pair, aggregated form $\sum_i x_{ij} \le n\, y_j$ for every resource. Which statement is correct?
  1. The disaggregated form has $n\,m$ constraints and admits fewer binary solutions than the aggregated one
  2. The aggregated form has $n\,m$ constraints and a tighter relaxation; the disaggregated one has $m$
  3. The two forms have the same number of constraints and the same linear relaxation
  4. The disaggregated form has $n\,m$ constraints and a tighter relaxation; the aggregated one has $m$
Explanation. On binary points the two forms are equivalent; in the relaxation the disaggregated one is stronger, because it prevents activating the resource for a mere fraction $1/n$. More rows, tighter relaxation.
mip-f-070 · level facile · notes
Activation link $x_{ij} \le y_j$ ($x_{ij} = 1$ if $i$ uses resource $j$, $y_j = 1$ if $j$ is activated), in a minimisation with activation cost $f_j\, y_j$ in the objective. What can be said about "if resource $j$ is activated then somebody uses it"?
  1. It holds in every optimal solution even when $f_j = 0$
  2. It is not imposed by the constraints; if $f_j > 0$ it holds in every optimal solution
  3. It is imposed by the constraints $x_{ij} \le y_j$ in every feasible solution
  4. It holds in no optimal solution, whatever $f_j$ is
Explanation. $y_j = 1$ with all $x_{ij} = 0$ is feasible. With $f_j > 0$ switching the resource off strictly reduces the cost: "in every optimum". With $f_j = 0$ one can only say "there exists an optimum with $y_j = 0$".
mip-f-071 · level facile · notes
Fixed cost: plant $j$ produces the continuous quantity $q_j \ge 0$, at most the capacity $C_j$, and pays $f_j$ if it is open ($y_j = 1$). The link is written $q_j \le K\, y_j$. Which coefficient $K$ should be chosen?
  1. The sum of the capacities of all the plants
  2. $1$, because $y_j$ is binary
  3. The capacity $C_j$, derived from the data
  4. Any large number, for instance $100$
Explanation. The right coefficient is the smallest upper bound on the quantity when the plant is open: the capacity. A "large enough" big-M is valid but weakens the relaxation considerably; $K = 1$ would cut off the solutions with $q_j > 1$.
mip-f-072 · level facile · notes
Minimum lot: with the binary $y_j$ one wants the quantity $q_j$ to be **semicontinuous**, i.e. $q_j \in \{0\} \cup [\ell, c_j]$, with threshold $\ell$ and capacity $c_j \ge \ell$. Which pair of constraints imposes it?
  1. $q_j \le c_j\, y_j$ and $q_j \ge 0$
  2. $q_j \ge \ell\, y_j$ and $q_j \le c_j$
  3. $\ell \le q_j$ and $q_j \le c_j$
  4. $\ell\, y_j \le q_j$ and $q_j \le c_j\, y_j$
Explanation. With $y_j = 0$ one gets $0 \le q_j \le 0$, with $y_j = 1$ one gets $\ell \le q_j \le c_j$. Without $\ell y_j$ the threshold is missing, without $c_j y_j$ one can produce with the plant off, and $\ell \le q_j$ forbids zero.
mip-f-073 · level facile · notes
Model with fixed cost ($q_j \le c_j y_j$, $y_j \in \{0,1\}$). Adding the minimum lot $q_j \ge \ell\, y_j$ raises the integer optimum from $44$ to $49$, but the linear relaxation ($0 \le y_j \le 1$) stays $112/3$. Why?
  1. In the relaxation it suffices to lower $y_j$ to $q_j/\ell$: the threshold constraint never bites in the continuum
  2. Because the threshold constraint is not valid and the solver ignores it in the relaxation
  3. Because the threshold $\ell$ exceeds the capacity and the constraint is redundant
  4. Because the linear relaxation keeps the $y_j$ integer
Explanation. With $y_j$ free in $[0,1]$ the constraint is met with $y_j \le q_j/\ell$, and the fixed cost already pushes $y_j$ towards $q_j/c_j \le q_j/\ell$: the whole effect of the threshold falls on integrality.
mip-f-074 · level facile · notes
Integer count: $q \ge 0$ units go into boxes of capacity $c$, and $w$ is the number of boxes. How does one impose $w \ge \lceil q/c \rceil$ in a linear model?
  1. With $w \le q/c + 1$ and $w$ integer
  2. With $w = \lceil q/c \rceil$ written in the constraint
  3. With $w \ge q/c$ and $w$ continuous
  4. With $q \le c\, w$ and $w$ declared integer
Explanation. $\lceil \cdot \rceil$ is not linear and cannot be written in a constraint: $q \le c\, w$ gives $w \ge q/c$ and integrality raises $w$ to the ceiling. The gap between $q/c$ and $\lceil q/c \rceil$ comes entirely from integrality.
mip-f-075 · level facile · notes
Maximum variable: $x_j \in \{0,1\}$ selects element $j$ of duration $t_j \ge 0$; the model minimises $z$ with $z \ge t_j x_j$ for every $j$ and $z \ge 0$. In which case can one **not** conclude that in every optimum $z = \max_{j : x_j = 1} t_j$?
  1. When the durations $t_j$ are all distinct
  2. When $z$ also appears in another constraint that wants it large
  3. When no $x_j$ equals $1$
  4. When the problem has several optimal solutions
Explanation. The optimality step lowers $z$ to the maximum: if another constraint wants it large, lowering it may violate that constraint, and only $z \ge \max$ remains. With no $x_j = 1$ the convention $\max \emptyset = 0$ holds, guaranteed by $z \ge 0$.
mip-f-076 · level facile · notes
Five jobs of total duration $21$ are split between two workers. Three fairness models: min-max (minimise the largest load), max-min (maximise the smallest load) and range (minimise max minus min). All choose the loads $(11, 10)$, with optimal values $11$, $10$ and $1$. What follows?
  1. Min-max is off by $10$ units with respect to the range model
  2. With more than two workers the three models would always choose the same solution
  3. The three values describe the same solution and are not comparable with each other
  4. The range is the best model, because it has the lowest optimal value
Explanation. Comparing "$z = 11$" of a min-max with "$z = 1$" of a range means nothing: they measure different things. And with more than two workers min-max and max-min in general choose different splits.
mip-f-077 · level facile · notes
Continuous variables $u, v$ and a constant $k > 0$. How is the constraint $|u - v| \le k$ imposed in a linear model?
  1. It cannot: the absolute value needs a non-linear model
  2. With $u - v \le k$ and $v - u \le k$, with no binary variables
  3. With the single constraint $u - v \ge -k$
  4. With a binary $b$ and a big-M, as for a disjunction
Explanation. $|u - v| \le k$ is the intersection of two half-planes, a convex set: two linear constraints suffice. It is the case $|u - v| \ge k$ that needs a binary.
mip-f-078 · level facile · notes
Continuous variables $u, v$. One wants to **minimise** $|u - v|$ with a linear model. Which formulation is correct?
  1. A variable $d \ge 0$ with $d \ge u - v$ and $d \ge v - u$, and $\min d$
  2. No auxiliary variable: $\min (u - v)$
  3. A binary $b$ and a variable $d$ with $d \ge u - v - Mb$, and $\min d$
  4. A variable $d \ge 0$ with $d \le u - v$ and $d \le v - u$, and $\min d$
Explanation. The two constraints impose $d \ge |u - v|$ and minimisation, if $d$ appears nowhere else, brings equality. In the objective an absolute value to be minimised costs two constraints and no binary.
mip-f-079 · level facile · notes
Conditional constraint: with $x \in \{0,1\}^3$, the constraint $3x_1 + 4x_2 + 5x_3 \le 6$ must hold only if the binary $y$ equals $1$, and it is written $3x_1 + 4x_2 + 5x_3 \le 6 + M(1 - y)$. What happens using $M = 5$ instead of $M = 6$?
  1. The model becomes infeasible for every value of $y$
  2. With $y = 0$ what remains is $3x_1 + 4x_2 + 5x_3 \le 11$, which excludes $x = (1,1,1)$: the integer set changes
  3. Nothing on the integer set: with $M = 5$ only the linear relaxation gets worse
  4. The relaxation improves and the integer set stays exactly the same
Explanation. The maximum of $3x_1 + 4x_2 + 5x_3$ is $12$, so the switched-off constraint needs $M \ge 12 - 6 = 6$. With $M = 5$ the switched-off constraint still cuts off $(1,1,1)$, and the model answers another question.
mip-f-080 · level facile · notes
Conditional constraint $3x_1 + 4x_2 + 5x_3 \le 6 + M(1 - y)$, with binary $x, y$ and objective $\max\ x_1 + x_2 + x_3 + y$: the smallest valid $M$ is $6$. What changes using $M = 1000$?
  1. Nothing, neither on the integer set nor on the linear relaxation
  2. The relaxation gets stronger, because the switched-off constraint no longer bites
  3. The integer set stays the same, the relaxation gets weaker (from $3$ to almost $4$)
  4. The integer set changes and the integer optimum rises from $3$ to $4$
Explanation. A valid $M$ larger than necessary is improvable: same integer set, weaker relaxation, because lowering $y$ slightly is enough to switch the constraint almost entirely off. $M$ is always computed from the data.
mip-f-081 · level facile · notes
Sequencing $n$ jobs on one machine: $s_{ij} = 1$ if $i$ precedes $j$, with $s_{ij} + s_{ji} = 1$ for every pair, and one big-M precedence constraint on the completion times for every ordered pair $(i, j)$, $i \ne j$. How many constraints does each family have?
  1. $n(n-1)$ order and $n(n-1)/2$ precedence
  2. $n(n-1)$ each
  3. $n(n-1)/2$ each
  4. $n(n-1)/2$ order and $n(n-1)$ precedence
Explanation. The order is imposed once per unordered pair ($i < j$), the precedence once per ordered pair ($i \ne j$), because each direction has its own constraint to switch on or off.
mip-f-082 · level facile · notes
Class of three jobs with binaries $x_j$ (job performed) and $y$ (class complete), maximisation problem. There are only the constraints $y \le x_j$, no constraint for the direction "all performed $\Rightarrow y = 1$", and the bonus of $y$ in the objective is $0$. What may happen at the optimum?
  1. One may get $y = 0$ with all $x_j = 1$: $y$ is no longer a faithful indicator
  2. The optimal value changes with respect to the model with both directions
  3. In every optimum $y = 1$ if all $x_j = 1$, because the objective imposes it
  4. The model becomes infeasible, because one direction of the link is missing
Explanation. Without a bonus the exchange argument fails: raising $y$ does not improve the objective. The optimal value stays the same, but $y$ no longer says "class complete"; if $y$ appears in other constraints, the second direction must be written.
mip-f-083 · level facile · notes
"At least $p$ different types": $q_j$ is the quantity of type $j$, $y_j = 1$ if the type is active, with $q_j \le c_j y_j$ and $\sum_j y_j \ge p$, but **without** the minimum lot $q_j \ge \ell\, y_j$ ($\ell > 0$). What is wrong?
  1. The count is met by switching on indicators with $q_j = 0$: the condition no longer says anything
  2. Nothing: the activation constraint $q_j \le c_j y_j$ suffices to give the count a meaning
  3. The linear relaxation becomes exact and the integrality of the $y_j$ is no longer needed
  4. The model becomes infeasible whenever $p$ exceeds the number of profitable types
Explanation. Without a threshold a solution with $y_j = 1$ and $q_j = 0$ is feasible. Counting types works only if every type switched on really produces something: activation and minimum lot go together.
mip-f-084 · level facile · notes
An integer variable $v \in \{0, \dots, 2^p - 1\}$ is rewritten with the binary expansion $v = \sum_{k=0}^{p-1} 2^k b_k$, with $b_k \in \{0,1\}$. What is its effect on the linear relaxation?
  1. No strengthening: with $b_k \in [0,1]$ it covers the whole interval $[0, 2^p - 1]$, like $0 \le v \le 2^p - 1$
  2. It always strengthens it, because it adds $p$ binary variables to the model
  3. It makes it exact, because every value of $v$ has a single binary representation
  4. It makes it infeasible, because fractional $b_k$ do not represent integers
Explanation. The expansion serves to reformulate, not to strengthen, for instance when another part of the model needs binary indicators of the bits. In the continuum fractional $b_k$ produce every value of the interval.
mip-f-085 · level facile · notes
Soft constraint: the target $a'x = \beta$ is written $a'x + s^- - s^+ = \beta$ with deviations $s^-, s^+ \ge 0$ and penalties $\pi^- s^- + \pi^+ s^+$ in the minimisation objective, $\pi^-, \pi^+ > 0$. What holds in every optimum?
  1. The two deviations are equal, $s^- = s^+$
  2. At least one of the two deviations is zero, and $s^- + s^+ = |a'x - \beta|$
  3. $s^-$ measures how much $a'x$ exceeds the target $\beta$
  4. Both deviations are zero, because the penalties are positive
Explanation. If both were positive, subtracting their minimum from both would keep the constraint satisfied and strictly reduce the objective. $s^-$ measures how much one is below the target, $s^+$ how much above.
mip-f-086 · level facile · notes
A piecewise linear and **convex** cost function $g(q)$, to be minimised, is modelled as a convex combination $\sum_k \lambda_k$ of its breakpoints. Are the segment binaries and the adjacency constraints (only two consecutive positive $\lambda$) also needed?
  1. Yes, always: without adjacency the model mixes distant breakpoints and gets the cost wrong
  2. Yes, because without segment binaries the model becomes infeasible
  3. No: the lower convex envelope coincides with $g$, and minimisation picks adjacent $\lambda$ by itself
  4. No, but only if the breakpoints are equally spaced and the slopes integer
Explanation. With convex $g$ and a minimisation the model without binaries is already correct. With non-convex $g$, for instance with quantity discounts, adjacency is mandatory.
mip-f-087 · level facile · notes
**Non-convex** piecewise linear cost (quantity discounts), modelled with the $\lambda_k$ of the breakpoints. Without segment binaries $w_t$ and adjacency the optimum is $117/4$; with binaries and adjacency the integer optimum is $33$. What is the linear relaxation (with $0 \le w_t \le 1$) of the model with adjacency?
  1. $117/4$: with fractional $w_t$ adjacency does not bite
  2. $33$, like its integer optimum
  3. More than $33$, because the model is tighter
  4. A value strictly between $117/4$ and $33$
Explanation. Adjacency changes the integer set, hence the optimum, but not the strength of the relaxation: with fractional $w_t$ the model mixes the breakpoints again. Two things not to be confused.
mip-f-088 · level facile · notes
Two plants with fixed cost, quantity $q_j$ and opening $y_j \in \{0,1\}$. With the link $q_j \le C_j y_j$ ($C_j$ capacity) the relaxation is $112/3$; with $q_j \le 100\, y_j$ and $q_j \le C_j$ separately it is $1059/50$; the integer optimum is $44$ in both. What does one conclude?
  1. Same integer set, but the big-M gives a tighter relaxation because it has one more constraint
  2. Different integer sets: the big-M admits solutions that the capacity link excludes
  3. Same relaxation and same integer set: the two values differ by rounding
  4. Same integer set, but the coefficient equal to the capacity gives a much tighter relaxation
Explanation. Both forms are valid and have the same integer optimum; the big-M lets the model buy tiny fractions of a plant ($y_j = q_j/100$) and the relaxation collapses.
mip-f-089 · level teorema · notes
A property of an optimal solution is proved by an exchange argument: a solution violating it is modified, staying feasible, and the objective is compared. Which statement is correct?
  1. If the exchange does not worsen the objective the property holds in every optimum, because no optimum can violate it
  2. If the exchange strictly improves the objective the property holds in every optimum; if it leaves it unchanged it holds only in some optimum
  3. A property proved by exchange holds in every feasible solution, not only in the optima
  4. If the variable's coefficient in the objective is zero, the exchange proves the property in every optimum
Explanation. The strength of the conclusion depends on the sign of the coefficient: a strict improvement gives "in every optimum", an unchanged objective gives at most "there exists an optimum". Writing "in every optimum" with a merely non-negative coefficient is the commonest mistake.
mip-f-090 · level teorema · notes
Activation with binaries $x_{ij}$ (object $i$ uses resource $j$, $i = 1, \dots, n$) and $y_j$ (resource active): disaggregated form $x_{ij} \le y_j$, aggregated form $\sum_i x_{ij} \le n\, y_j$. Which statement is correct?
  1. The aggregated form implies the disaggregated one for every $x \ge 0$ and every $y \in [0,1]$
  2. The disaggregated form does not imply the aggregated one, not even on binary points
  3. They are equivalent on fractional points too, so they have the same linear relaxation
  4. On binary points they are equivalent; the direction "aggregated $\Rightarrow$ disaggregated" uses binarity and fails outside binary points
Explanation. Summing the disaggregated constraints over $i$ gives the aggregated one, always. The opposite direction uses $y_j \in \{0,1\}$ and $x_{ij} \le 1$: and this is exactly what makes the two forms differ in the relaxation.
mip-f-091 · level teorema · notes
Continuous variables $u, v$ and a constant $k > 0$. Which statement about the constraint $|u - v| \ge k$ is correct?
  1. It is written with a variable $d$ and the constraints $d \ge u - v$, $d \ge v - u$ and $d \ge k$
  2. The set it describes is not convex, so no system of linear constraints without integer variables describes it
  3. It is written with the two linear constraints $u - v \ge k$ and $v - u \ge k$, with no integer variables
  4. It is convex like $|u - v| \le k$, because the absolute value is a convex function
Explanation. It is the complement of a strip: a disjunction, which requires a binary and a big-M. Imposing both constraints would give $0 \ge 2k$, infeasible; and $d \ge |u - v|$ with $d \ge k$ does not say that $|u - v|$ is large.
mip-f-092 · level teorema · notes
Alldiff: $n$ objects must receive distinct values among $n$ values. With $x_{iv} = 1$ if object $i$ receives value $v$, it is written as a double set partitioning: $\sum_v x_{iv} = 1$ for every object and $\sum_i x_{iv} = 1$ for every value. Which statement is correct?
  1. The formulation is correct only if the binary expansion of the values is added
  2. The values turn out distinct only in optimal solutions, not in all feasible ones
  3. The relaxation is as weak as that of a big-M, and must be strengthened with cuts
  4. The matrix is that of assignment, totally unimodular: the vertices of the relaxation are integer
Explanation. "Every object one value" and "every value to one object only" impose a bijection in every feasible solution; total unimodularity makes integrality free, i.e. $\zlpp = \zmilp$ for every linear objective.
mip-f-093 · level ipotesi · notes
Maximum variable: binaries $x_j$, durations $t_j \ge 0$, variable $z \ge 0$ with the constraints $z \ge t_j x_j$ for every $j$. To prove that in every optimum $z = \max_{j : x_j = 1} t_j$, what is needed?
  1. The constraints $z \ge t_j x_j$, a strictly positive coefficient of $z$ in a maximisation, and $z \ge 0$
  2. The constraints $z \ge t_j x_j$, a non-negative coefficient of $z$ in a minimisation, and $z$ absent from every other constraint
  3. The constraints $z \ge t_j x_j$, a strictly positive coefficient of $z$ in a minimisation, and $z$ absent from every other constraint
  4. The constraints $z \ge t_j x_j$ and $z$ absent from every other constraint, whatever the coefficient of $z$
Explanation. These are the three steps: the constraint gives $z \ge \max$, optimality lowers $z$ (with a strictly positive coefficient in a minimisation and $z$ absent elsewhere), the synthesis gives equality in every optimum.
mip-f-094 · level ipotesi · notes
Activation with $x_{ij} \in \{0,1\}$ ($i = 1, \dots, n$) and $y_j$. To prove that the aggregated form $\sum_i x_{ij} \le n\, y_j$ implies the disaggregated one $x_{ij} \le y_j$, what is needed?
  1. That $y_j$ be binary (cases $y_j = 0$ and $y_j = 1$) and that $x_{ij} \le 1$, because the $x$ are binary
  2. That the activation cost of resource $j$ be strictly positive
  3. Only that $x_{ij} \ge 0$, whatever the value of $y_j$ in $[0,1]$
  4. That the matrix of the aggregated constraint be totally unimodular
Explanation. With $y_j = 0$ the aggregated form gives $\sum_i x_{ij} \le 0$, hence every $x_{ij} = 0$; with $y_j = 1$ it suffices that $x_{ij} \le 1$. Outside binary points the direction fails: $y_j = 1/n$ with a single $x_{ij} = 1$ satisfies the aggregated form.
mip-f-095 · level ipotesi · notes
Conditional constraint $a'x \le b + M(1 - y)$: it must hold when the binary $y$ equals $1$ and be switched off when it equals $0$. To prove that a given value of $M$ is **valid**, what is needed?
  1. That $M \ge \max a'x - b$ over the points allowed by the other constraints, usually computed from the variable bounds, which must be finite
  2. That the linear relaxation with that value of $M$ have the same optimum as the MILP
  3. That $y$ be binary, whatever the value of $M$, as long as it is positive
  4. That $M$ be larger than all the coefficients appearing in the model
Explanation. With $y = 0$ the constraint must be satisfied by every point the other constraints allow: $M \ge \max a'x - b$ is needed. Without finite bounds on the variables no finite $M$ is guaranteed valid.
mip-f-096 · level ipotesi · notes
Sequencing on one machine: $\kappa_i$ is the completion of job $i$ of duration $t_i$, $s_{ij} = 1$ if $i$ follows $j$, and $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ij})$. To prove that $M = \sum_h t_h$ is valid, what is needed?
  1. $\kappa_i \ge t_i$ and the horizon $\kappa_j \le \sum_h t_h$ on the solutions among which the optimum is sought
  2. That $M$ be at least the largest duration $\max_h t_h$ and that the durations be integer
  3. Only $s_{ij} + s_{ji} = 1$, i.e. that every pair is ordered one way
  4. Only $\kappa_i \ge t_i$, i.e. that no job ends before its own duration
Explanation. With $s_{ij} = 0$ one has $\kappa_j + t_i - M \le \sum_h t_h + t_i - \sum_h t_h = t_i \le \kappa_i$. Without an upper bound on the $\kappa_j$ no finite $M$ is valid: the horizon must be declared.
mip-f-097 · level ipotesi · notes
Complete-class indicator: binaries $x_1, \dots, x_p$ and $y$, with $y \le x_j$ for every $j$. One wants to omit the constraint $y \ge \sum_j x_j - (p - 1)$. What is needed so that in every optimum $y = 1$ when all $x_j = 1$?
  1. That the $x_j$ have positive revenues in the objective, whatever the bonus of $y$
  2. That $y$ appear in the objective of a maximisation with bonus $v \ge 0$ and in no other constraint
  3. That $y$ appear in a constraint counting the complete classes, with bonus $v > 0$
  4. That $y$ appear in the objective of a maximisation with bonus $v > 0$ and in no other constraint
Explanation. With $v > 0$ and $y$ absent elsewhere, raising $y$ to $1$ stays feasible and strictly increases the objective. With $v = 0$, or if $y$ appears in other constraints, the second direction must be written.
mip-f-098 · level ipotesi · notes
Soft constraint $a'x + s^- - s^+ = \beta$ with $s^-, s^+ \ge 0$ and penalties $\pi^- s^- + \pi^+ s^+$ in a minimisation. To prove that in every optimum at least one of the two deviations is zero, what is needed?
  1. Penalties $\pi^-, \pi^+ \ge 0$ and the fact that subtracting the same value from $s^-$ and $s^+$ leaves the difference $s^- - s^+$ unchanged
  2. That the deviations $s^-, s^+$ be declared binary, so that only one can be switched on
  3. That the hard constraint $a'x = \beta$ have at least one feasible solution
  4. Penalties $\pi^-, \pi^+ > 0$ and the fact that subtracting the same value from $s^-$ and $s^+$ leaves the difference $s^- - s^+$ unchanged
Explanation. If $s^- = \sigma > 0$ and $s^+ = \tau > 0$, removing $\min(\sigma, \tau)$ from both keeps the constraint and reduces the objective by $(\pi^- + \pi^+) \min(\sigma, \tau) > 0$: a contradiction. With zero penalties the reduction is not strict.
mip-f-216 · level facile · notes
Integer counting: $q = 37$ units go into boxes of capacity $c = 10$, with $q \le c\, w$ and the number of boxes $w$ minimised. What is $w$ at the optimum of the linear relaxation, where $w$ is continuous?
  1. $\tfrac{10}{37}$
  2. $\tfrac{37}{10}$
  3. $4$
  4. $3$
Explanation. In the continuous problem the minimum pushes $w$ down to $q/c = 37/10$. The ceiling $\lceil 37/10 \rceil = 4$ comes only from the integrality of $w$; $3$ boxes are not enough.
mip-f-217 · level facile · notes
Fairness among $K$ workers: $\ell_k$ is the load of worker $k$ (a linear expression of the assignments). Which model **maximises the minimum load**?
  1. A variable $u$, the constraints $u \le \ell_k$ for every $k$ and $\min u$
  2. A variable $u$, the constraints $u \ge \ell_k$ for every $k$ and $\max u$
  3. A variable $u$, the constraint $u = \sum_k \ell_k / K$ and $\max u$
  4. A variable $u$, the constraints $u \le \ell_k$ for every $k$ and $\max u$
Explanation. $u \le \ell_k$ keeps $u$ below every load and the maximum pushes it onto the smallest: this is the max-min. With $u \ge \ell_k$ and $\max u$ the problem is unbounded; with $\min u$, $u$ decreases without limit.
mip-f-218 · level facile · notes
"At least $p = 2$ different types": $q_j$ is the quantity of type $j \in \{1,2,3\}$, $y_j$ the binary of active type, with $5 y_j \le q_j \le 20 y_j$ and $y_1 + y_2 + y_3 \ge 2$. Which solution is feasible?
  1. $q = (5, 7, 0)$, $y = (1, 1, 0)$
  2. $q = (25, 5, 0)$, $y = (1, 1, 0)$
  3. $q = (3, 8, 0)$, $y = (1, 1, 0)$
  4. $q = (10, 0, 0)$, $y = (1, 1, 0)$
Explanation. An active type must have a quantity between the threshold $5$ and the capacity $20$. $q_2 = 0$ with $y_2 = 1$ violates the threshold (it is exactly the "empty" count the threshold prevents); $3 < 5$; $25 > 20$.
mip-f-219 · level facile · notes
In the map of the techniques linking variables, each technique has something to declare when used. What must be declared for a big-M conditional constraint, $a'x \le b + M(1 - y)$ with $y$ binary?
  1. The value of $M$, computed from the data
  2. That $M$ is any large number
  3. That the integrality of $y$ realises a rounding up
  4. The sign of the coefficient of $y$ in the objective
Explanation. An $M$ too small cuts off solutions, one too large weakens the relaxation: it must be computed from the variable bounds and declared. The sign in the objective is declared for activation, the rounding for integer counting.
mip-f-387 · level facile · notes
Fixed cost: plant $j$ produces $q_j \ge 0$, with capacity $C_j = 40$, and pays the fixed cost $f_j$ if open ($y_j = 1$). The link is $q_j \le C_j y_j$. Why not write $q_j \le M y_j$ with $M = 10^6$?
  1. There is no difference: the value of $M$ does not matter if $M \ge C_j$
  2. Because $q_j \le M y_j$ no longer imposes that a closed plant produces nothing
  3. With a huge $M$ the relaxation can keep $y_j = q_j/M$ almost zero, paying a tiny fraction of the fixed cost: the bound worsens
  4. Because with $M = 10^6$ the model becomes infeasible
Explanation. Both constraints are correct on integer points, but in the relaxation $y_j \ge q_j/M$: with $M = C_j$ the plant pays at least $f_j q_j / C_j$, with a huge $M$ almost nothing. The right coefficient is the capacity.
mip-f-388 · level teorema · notes
Fixed cost, minimisation problem: $\min \sum_j (c_j q_j + f_j y_j)$ with $q_j \le C_j y_j$, $q_j \ge 0$, $y_j \in \{0,1\}$, $f_j > 0$. In an optimal solution, what holds for a plant with $q_j = 0$?
  1. $y_j = 1$: a plant must be open to be able to produce in the future
  2. $y_j = 0$: opening it would cost $f_j > 0$ with no advantage
  3. $y_j$ may equal $0$ or $1$ indifferently
  4. $y_j = q_j / C_j$
Explanation. The constraint only imposes $q_j > 0 \Rightarrow y_j = 1$. The reverse direction ($q_j = 0 \Rightarrow y_j = 0$) is imposed by the objective: with $f_j > 0$ closing an unused plant lowers the cost.
mip-f-389 · level facile · notes
Minimum lot: $q_j$ must be $0$ or lie in $[\ell, c_j]$, with $\ell = 5$ and $c_j = 20$; $y_j \in \{0,1\}$. With the constraints $\ell y_j \le q_j \le c_j y_j$, which values of $q_j$ are allowed with $y_j = 1$ and with $y_j = 0$?
  1. With $y_j = 1$: $0 \le q_j \le 20$; with $y_j = 0$: $0 \le q_j \le 5$
  2. With $y_j = 1$: only $q_j = 5$ or $q_j = 20$; with $y_j = 0$: only $q_j = 0$
  3. With $y_j = 1$: $5 \le q_j \le 20$; with $y_j = 0$: only $q_j = 0$
  4. With $y_j = 1$: $5 \le q_j \le 20$; with $y_j = 0$: $q_j \le 5$
Explanation. With $y_j = 0$ the two constraints become $0 \le q_j \le 0$; with $y_j = 1$ they become $5 \le q_j \le 20$. The domain is the union of a point and an interval: a semicontinuous variable.
mip-f-390 · level ipotesi · notes
Minimum lot with $\ell y_j \le q_j \le c_j y_j$, $y_j \in \{0,1\}$, in a minimum-cost problem with fixed cost $f_j > 0$. A student removes the constraint $\ell y_j \le q_j$, claiming that «the objective already pushes $y_j$ to zero». What is lost?
  1. The integrality of $y_j$
  2. Nothing: the objective also imposes the threshold
  3. The threshold: with $y_j = 1$ the values $0 < q_j < \ell$ remain allowed, that is, lots smaller than the minimum
  4. The link «closed plant, no production»
Explanation. The objective pushes $y_j$ to zero when $q_j = 0$, but does not prevent producing a positive quantity below the threshold with the plant open: that direction is given only by $\ell y_j \le q_j$.
mip-f-391 · level facile · notes
Integer count: pieces of size $a = (4, 7, 5)$, all to be shipped ($x_i = 1$), in boxes of capacity $c = 6$; $w \in \mathbb{Z}_{\ge 0}$ is the number of boxes, with $\sum_i a_i x_i \le c\,w$, and $w$ is minimised. What is $w$ at the optimum of the model, and in the linear relaxation?
  1. $w = 3$; in the relaxation $w = 8/3$
  2. $w = 3$; in the relaxation $w = 3$
  3. $w = 2$; in the relaxation $w = 8/3$
  4. $w = 16$; in the relaxation $w = 16/6$
Explanation. $\sum_i a_i = 16$, so $w \ge 16/6 = 8/3$: the relaxation stops there, the integer rises to $\lceil 8/3 \rceil = 3$. It is a rounding up. (The model counts the total capacity, not the packing of the pieces.)
mip-f-392 · level teorema · notes
Integer count: $w \in \mathbb{Z}_{\ge 0}$ with the single constraint $Q \le c\,w$ ($Q > 0$ fixed quantity, $c > 0$ capacity), minimising a positive unit cost for $w$. What holds at the optimum?
  1. $w = \lfloor Q/c \rfloor$
  2. $w = \lfloor Q/c \rfloor + 1$
  3. $w = Q/c$
  4. $w = \lceil Q/c \rceil$
Explanation. The constraint gives $w \ge Q/c$ and $w$ integer, so $w \ge \lceil Q/c \rceil$; the objective pushes $w$ to the smallest feasible value. $\lfloor Q/c \rfloor + 1$ fails when $Q/c$ is an integer.
mip-f-393 · level facile · notes
Maximum variable: $x_j \in \{0,1\}$ chooses activity $j$ of duration $t_j$, and $z$ should equal the duration of the longest chosen activity. The constraints are $z \ge t_j x_j$ for every $j$ and $z \ge 0$. In which type of objective does $z$ equal the maximum exactly at the optimum?
  1. When $z$ appears with a positive coefficient in an objective to be minimised
  2. Only if the objective is $\min \sum_j t_j x_j$
  3. In any objective: the constraints already fix it
  4. When $z$ appears with a positive coefficient in an objective to be maximised
Explanation. The constraints give $z \ge \max_j t_j x_j$; only an objective pushing $z$ down (minimising it) brings it to equality. Maximising it, $z$ would grow without limit.
mip-f-394 · level facile · notes
Maximum variable $z \ge t_j x_j$, with durations $t = (4, 9, 6)$ and choice $x = (1, 0, 1)$, in a problem minimising $z$ plus other terms not depending on $z$. What is $z$ in an optimal solution with this choice?
  1. $4$
  2. $9$
  3. $6$
  4. $10$
Explanation. The constraints give $z \ge 4$, $z \ge 0$, $z \ge 6$: the smallest feasible value is $6$, the longest duration among the chosen activities. $9$ belongs to an unchosen activity; $10$ is the sum.
mip-f-395 · level facile · notes
Fairness between two workers: loads $\ell_1 = 10$ and $\ell_2 = 6$ in a given assignment. In the three course models — min-max ($\min z$, $z \ge \ell_k$), max-min ($\max u$, $u \le \ell_k$), difference ($\min z - u$ with both) — what are $z$, $u$ and $z - u$ at the optimum **for this fixed assignment**?
  1. $z = 10$, $u = 6$, $z - u = 4$
  2. $z = 10$, $u = 10$, $z - u = 0$
  3. $z = 16$, $u = 0$, $z - u = 16$
  4. $z = 8$, $u = 8$, $z - u = 0$
Explanation. With fixed loads $z$ drops to the maximum load ($10$), $u$ rises to the minimum ($6$), and the difference is $4$. The value $8$ is the average, which none of the three models computes.
mip-f-396 · level ipotesi · notes
Fairness: $\ell_k$ is the load of resource $k$. One wants to minimise the spread between maximum and minimum load with $\min (z - u)$. A student writes only the constraints $z \ge \ell_k$ for every $k$, forgetting $u \le \ell_k$. What happens?
  1. $u$ is no longer tied to the loads and grows without limit: $z - u$ goes to $-\infty$ and the model is unbounded
  2. The model still minimises the spread, because $u$ settles at the minimum load
  3. The model becomes a min-max
  4. The model is infeasible
Explanation. The difference model needs both groups of constraints: $z$ is pushed down and held by $z \ge \ell_k$, $u$ is pushed up and held only by $u \le \ell_k$. Without them, $u$ has no upper limit.
mip-f-397 · level facile · notes
Absolute value in a minimisation objective: $|u - v|$ is minimised by introducing $d \ge 0$ with $d \ge u - v$ and $d \ge v - u$, and minimising $d$. With $u = 7$ and $v = 3$ fixed, what is $d$ at the optimum?
  1. $-4$
  2. $10$
  3. $4$
  4. $0$
Explanation. The constraints give $d \ge 4$ and $d \ge -4$; minimising, $d$ drops to the larger of the two, $4 = |7 - 3|$. The linearisation works because the absolute value is minimised.
mip-f-398 · level ipotesi · notes
Conditional constraint $a'x \le b + M(1 - y)$, with $y$ binary and $x$ within its bounds. A student chooses $M$ **smaller** than the maximum of $a'x - b$ over the bounds. What may happen?
  1. With $y = 0$ the constraint is not fully switched off and cuts feasible solutions, perhaps the optimal one
  2. The model becomes unbounded
  3. Nothing: a smaller $M$ only gives a tighter relaxation
  4. With $y = 1$ the constraint no longer holds
Explanation. $M$ must be at least $\max (a'x - b)$ over the bounds so that with $y = 0$ every $x$ satisfies it. Below that value the switched-off constraint still cuts points: the model is wrong, not just tighter.
mip-f-399 · level facile · notes
Sequencing $n$ jobs on one machine: $s_{ij} = 1$ if $j$ precedes $i$, with $s_{ij} + s_{ji} = 1$ for $i < j$ and $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ij})$ for $i \ne j$. With $n = 5$ jobs, how many variables $s_{ij}$ and how many big-M constraints are there?
  1. $20$ variables and $10$ big-M constraints
  2. $20$ variables and $20$ big-M constraints
  3. $25$ variables and $20$ big-M constraints
  4. $10$ variables and $10$ big-M constraints
Explanation. One $s_{ij}$ and one big-M constraint per ordered pair with $i \ne j$: $n(n-1) = 20$. The constraints $s_{ij} + s_{ji} = 1$ are instead one per unordered pair, $\binom{5}{2} = 10$.
mip-f-400 · level teorema · notes
Sequencing on one machine with no idle time, jobs of duration $t_j$. The constraint $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ij})$ must be switched off when $s_{ij} = 0$. Which value of $M$ suffices for every pair?
  1. $M = \max_j t_j$, the duration of the longest job
  2. $M = t_i + t_j$, the sum of the two durations of the pair
  3. $M = \sum_j t_j$, the total duration: no completion exceeds this value
  4. $M = n$, the number of jobs
Explanation. With no idle time every $\kappa$ lies in $[t_j, \sum t]$, so $\kappa_j + t_i - \kappa_i \le \sum_j t_j$: with that $M$ the switched-off constraint is always satisfied. Smaller values such as $\max t_j$ may cut sequences.
mip-f-401 · level facile · notes
If and only if: binary $y$ must equal $1$ exactly when $x_1 = x_2 = x_3 = x_4 = 1$ (binaries). With the constraints $y \le x_j$ for every $j$, which constraint completes the link?
  1. $y \ge x_1 + x_2 + x_3 + x_4 - 4$
  2. $y \ge x_1 + x_2 + x_3 + x_4 - 3$
  3. $y \ge x_1 + x_2 + x_3 + x_4$
  4. $y \le x_1 + x_2 + x_3 + x_4 - 3$
Explanation. The constraint $y \ge \sum_j x_j - (p - 1)$ with $p = 4$ forces $y = 1$ only if all equal $1$ (sum $4$, right side $1$); with at least one at zero the right side is $\le 0$. With $-4$ the right side never exceeds $0$.
mip-f-402 · level teorema · notes
Link «$y = 1$ if and only if all binaries $x_1, \dots, x_p$ equal $1$», with $y \le x_j$ for every $j$. In a **maximisation** problem where $y$ has a positive coefficient in the objective (a bonus), can the constraint $y \ge \sum_j x_j - (p-1)$ be omitted?
  1. Yes: the objective pushes $y$ to $1$ as soon as allowed, so the missing direction is imposed by the optimisation
  2. Yes, but only if the problem is a minimisation
  3. No: without that constraint the model becomes unbounded
  4. No: without that constraint $y$ may equal $1$ even with some $x_j = 0$
Explanation. $y \le x_j$ forbids the bonus if an element is missing. The reverse direction («all at one ⇒ bonus») is guaranteed at the optimum by the positive coefficient in a maximisation: one direction is enough.
mip-f-403 · level facile · notes
Counting distinct types: $q_j \ge 0$ is the quantity of type $j \in \{1, \dots, 5\}$, $y_j$ the indicator, with $q_j \le c_j y_j$, $q_j \ge \ell y_j$ and $\sum_j y_j \ge 3$. What does the model impose?
  1. That at least $3$ types are produced, each in quantity at least $\ell$
  2. That at most $3$ types are produced
  3. That exactly $3$ types are produced
  4. That the total quantity is at least $3\ell$, however distributed
Explanation. Each $y_j = 1$ forces $q_j \ge \ell$, and the counting constraint wants at least three of them: at least three types present significantly. The total quantity alone is not enough (it could all lie in one type).
mip-f-404 · level ipotesi · notes
«At least $p$ distinct types» with $q_j \le c_j y_j$, $\sum_j y_j \ge p$. A student omits the threshold $q_j \ge \ell y_j$. Which unwanted solution becomes feasible?
  1. $\sum_j y_j > p$, that is, more types than required
  2. $y_j = 0$ with $q_j > 0$: a type produced without being counted
  3. $y_j = 1$ with $q_j = 0$: an «active» type without production, satisfying the count without producing anything
  4. None: $q_j \le c_j y_j$ suffices on its own
Explanation. $q_j \le c_j y_j$ forbids producing without activating, not activating without producing. Without the threshold the count is satisfied by indicators at $1$ with zero quantities: both thresholds are needed.
mip-f-405 · level facile · notes
Binary expansion: an integer variable $v \in \{0, 1, \dots, 100\}$ is rewritten as $v = \sum_{k=0}^{p-1} 2^k b_k$ with $b_k \in \{0,1\}$. What is the smallest number $p$ of binaries representing all allowed values?
  1. $8$
  2. $100$
  3. $6$
  4. $7$
Explanation. With $p$ binaries one represents $0, \dots, 2^p - 1$: with $6$ one reaches $63$, with $7$ one reaches $127 \ge 100$. (The constraint $v \le 100$ is then needed to exclude the excess values.)
mip-f-406 · level facile · notes
Alldiff: $4$ objects must receive $4$ pairwise distinct values; $p_{iv} = 1$ if object $i$ receives value $v$, with $\sum_v p_{iv} = 1$ for every object and $\sum_i p_{iv} = 1$ for every value. How many binary variables and how many constraints does the formulation have?
  1. $8$ binaries and $8$ constraints
  2. $4$ binaries and $6$ constraints
  3. $16$ binaries and $8$ constraints
  4. $16$ binaries and $16$ constraints
Explanation. One binary per object–value pair, $4 \cdot 4 = 16$; one constraint per object and one per value, $4 + 4 = 8$. It is an assignment.
mip-f-407 · level facile · notes
Soft constraint: the period demand, $\beta = 50$, is written $a'x + s^- - s^+ = 50$ with $s^-, s^+ \ge 0$ and penalty $\pi^- s^- + \pi^+ s^+$ ($\pi^-, \pi^+ > 0$) in a minimisation objective. If the solution provides $a'x = 42$, what are the deviations at the optimum?
  1. $s^- = 8$, $s^+ = 8$
  2. $s^- = 8$, $s^+ = 0$
  3. $s^- = 58$, $s^+ = 50$
  4. $s^- = 0$, $s^+ = 8$
Explanation. The constraint gives $s^- - s^+ = 8$; minimising positive penalties keeps only the necessary deviation: $s^- = 8$ (the target is undershot by $8$), $s^+ = 0$.
mip-f-408 · level facile · notes
A planning model with every period's demand as a hard constraint $a'x = \beta$ turns out infeasible (insufficient capacity). What does the soft-constraint technique offer?
  1. Removing the demand constraint, which makes the model feasible at no cost
  2. Replacing the constraint with $a'x + s^- - s^+ = \beta$ and penalising the deviations: the model becomes feasible and tells how much and where the target is missed
  3. Making the integer variables continuous
  4. Increasing $\beta$ until the model becomes feasible
Explanation. A soft constraint can be violated by paying: the optimal solution balances cost and penalty and measures the violation with $s^-$, $s^+$. Dropping it altogether would lose the target.
mip-f-409 · level facile · notes
Piecewise linear cost with nodes $q = (0, 10, 20)$ and values $g = (0, 50, 80)$. With the convex combination of the nodes ($q = \sum_k q_k \lambda_k$, $g = \sum_k g_k \lambda_k$, $\sum_k \lambda_k = 1$) and adjacency (only the $\lambda$ of the two nodes of the chosen segment positive), what is $g$ for $q = 14$?
  1. $62$
  2. $56$
  3. $80$
  4. $70$
Explanation. $q = 14$ lies in the second segment: $\lambda_1 = 0.6$, $\lambda_2 = 0.4$, so $g = 0.6 \cdot 50 + 0.4 \cdot 80 = 62$. ($70$ uses the slope of the first segment, $56$ combines nodes $0$ and $20$.)
mip-f-410 · level teorema · notes
Piecewise linear cost modelled with node weights $\lambda_k$. In which case can the segment binaries $w_t$ and the adjacency constraints be omitted without changing the optimum?
  1. Always: the $\lambda$ are already a convex combination
  2. Never: without binaries the model is not linear
  3. When the function is concave and is minimised
  4. When the function is convex and is minimised: the optimum uses adjacent nodes on its own
Explanation. Minimising a convex function, mixing non-adjacent nodes gives a value above the graph, never convenient. With quantity discounts (non-convex) the relaxation would choose the chord below the graph: the binaries are needed.
mip-f-411 · level facile · notes
Map of the variable-linking techniques: a plant with a fixed cost, capacity and continuous quantity which, if open, must produce at least a minimum threshold. Which two techniques are combined?
  1. Alldiff and binary expansion
  2. Maximum variable and absolute value
  3. Fixed cost ($q_j \le C_j y_j$) and minimum lot ($q_j \ge \ell y_j$)
  4. If and only if and precedences
Explanation. The continuous quantity tied to opening is the fixed cost; the threshold «if produced, at least $\ell$» is the minimum lot, with the same binary $y_j$.
mip-f-412 · level facile · notes
Map of techniques: facing a new link between variables, which of these questions is **not** one of those to ask?
  1. How strong is the relaxation of the chosen formulation?
  2. Which direction of the link does the constraint impose and which (possibly) the objective?
  3. How many lines of code are needed in gurobipy?
  4. What is the smallest valid coefficient (the capacity, the minimum $M$)?
Explanation. For every link one declares what the constraint imposes and what the objective does, chooses the tightest valid coefficient and assesses the strength of the relaxation; code length is not a modelling criterion.
mip-f-518 · level teorema · notes
Absolute value: $d \ge u - v$, $d \ge v - u$ linearises $d = |u - v|$ in which case?
  1. Only if $u \ge v$
  2. When $d$ is maximised
  3. Always, in any objective
  4. When $d$ is minimised (or has a positive coefficient in a minimisation): at the optimum $d$ drops to the larger of the two
Explanation. The constraints give $d \ge |u - v|$; only the downward push of the objective brings equality. To maximise $|u - v|$, or impose $|u - v| \ge k$, a binary is needed.
mip-f-519 · level ipotesi · notes
Binary expansion of an integer variable $v \in \{0, \dots, 100\}$ with $7$ binaries: $v = \sum_{k=0}^{6} 2^k b_k$. A student omits the constraint $v \le 100$. What happens?
  1. The values from $101$ to $127$ become feasible, which the problem does not allow
  2. The model becomes infeasible
  3. Negative values become feasible
  4. Nothing: with $7$ binaries one reaches exactly $100$
Explanation. With $7$ binaries one represents $0, \dots, 127$: the constraint $v \le 100$ is needed to exclude the excess values.
mip-f-545 · level facile · notes
Activation: $x_{ij} = 1$ if object $i$ uses resource $j$, $y_j = 1$ if the resource is active, $n$ objects. With the aggregated form $\sum_i x_{ij} \le n\,y_j$, how many constraints are needed for $m$ resources, and how many with the disaggregated $x_{ij} \le y_j$?
  1. $n$ and $n\,m$
  2. $n\,m$ and $m$
  3. $m$ and $n\,m$
  4. $m$ and $m$
Explanation. Aggregated: one constraint per resource. Disaggregated: one per object–resource pair. More rows, but a stronger relaxation.
mip-f-546 · level facile · notes
Big-M disjunction: at least one of $g_1(x) \le 0$ and $g_2(x) \le 0$ must hold; with a binary $y$ one writes $g_1(x) \le M_1(1 - y)$ and $g_2(x) \le M_2\,y$. What happens with $y = 1$?
  1. The first constraint is active, the second switched off (if $M_2$ is large enough)
  2. Both are switched off
  3. The second is active, the first switched off
  4. Both constraints are active
Explanation. With $y = 1$: $g_1(x) \le 0$ (active) and $g_2(x) \le M_2$, satisfied by every $x$ within the bounds if $M_2 \ge \max g_2$. The binary chooses which constraint must hold.
mip-f-547 · level facile · notes
Sequencing on one machine: $\kappa_j \ge t_j$ for every job $j$ ($\kappa_j$ completion, $t_j$ duration). What does this constraint express?
  1. The machine works one job at a time
  2. Every job finishes within its duration
  3. All jobs start together
  4. No job finishes before having worked at least its duration, starting from $0$
Explanation. The first job of the sequence finishes no earlier than its duration; the others are pushed later by the big-M precedence constraints.

Part: The problems (164)

Fifteen numerical models (62)

mip-f-099 · level facile · notes
An eight-seat van: four groups offer a price to ride, and $x_j \in \{0,1\}$ equals $1$ if group $j$ is accepted. Rule: "if group 2 is accepted, group 4 must be accepted too". Which constraint translates it?
  1. $x_2 + x_4 \ge 1$
  2. $x_2 + x_4 \le 1$
  3. $x_2 - x_4 \le 0$
  4. $x_4 - x_2 \le 0$
Explanation. The implication $x_2 \Rightarrow x_4$ is the clause $\lnot x_2 \lor x_4$, i.e. $x_4 - x_2 \ge 0$, also written $x_2 - x_4 \le 0$. The opposite direction would say "if 4 then 2".
mip-f-100 · level facile · notes
Bus lines: four lines $j$ to be given to three companies $i$ with costs $c_{ij}$; each line to one company, each company at most two lines, minimum cost. The lowest cost offered for each line is $(1, 2, 3, 1)$. With the "zero out and saturate" dual recipe ($\bar\alpha_j = \min_i c_{ij}$, capacity duals at zero), which bound is obtained?
  1. $\ub = 7$
  2. $\ub = 3$
  3. $\lb = 7$
  4. $\lb = 3$
Explanation. The recipe gives $1 + 2 + 3 + 1 = 7$: "every line costs at least its lowest offer". It is a lower bound because the problem is a minimisation; the optimum is $9$, because the company capacities prevent taking all the minima.
mip-f-101 · level facile · notes
Relay: three strokes $s$ and four swimmers $n$, $x_{sn} = 1$ if $n$ swims stroke $s$; constraints $\sum_n x_{sn} = 1$ per stroke and $\sum_s x_{sn} \le 1$ per swimmer, minimum total time. Why does the linear relaxation have the same optimum as the integer problem?
  1. Because one swimmer stays out and frees one degree of freedom
  2. Because the hand-made dual solution is optimal for the dual
  3. The matrix is that of an assignment, totally unimodular: the vertices of the relaxation are integer
  4. Because the swimmers' times are all integers
Explanation. The matrix is totally unimodular and integrality costs nothing. This stops being true as soon as a constraint with different coefficients is added, for instance a capacity.
mip-f-102 · level facile · notes
Hub-and-spoke: the minimum number of hub cities is chosen so that every city is within $1000$ miles of a hub (set covering). In the dual $\pi_c = 1$ is given to Atlanta, Denver and Seattle and $0$ to the others, giving $\lb = 3$. What does it say, in words?
  1. The three cities are pairwise far apart: no hub can serve two of them, so at least three hubs are needed
  2. Three hubs suffice to serve all the cities, so the optimum is three
  3. Every hub can serve at most three cities, so there are at least three hubs
  4. Atlanta, Denver and Seattle must be chosen as hubs in every optimal solution
Explanation. The feasible dual prices mutually distant cities: each hub covers at most one of them, so there are at least three hubs. That three suffice is shown by a feasible solution, with $\ub = 3$.
mip-f-103 · level facile · notes
Funds bought in lots: $x_1, \dots, x_4 \in \mathbb{Z}_{\ge 0}$ are the lots bought of the four funds. Rule: "the lots of the second fund do not exceed $50\%$ of the total number of lots". How is it written in linear form?
  1. $x_2 \le 50$
  2. $-x_1 + x_2 - x_3 - x_4 \le 0$
  3. $x_2 - x_1 - x_3 - x_4 \ge 0$
  4. $2x_2 \le x_1 + x_3 + x_4 + 1$
Explanation. From $x_2 \le \tfrac12 (x_1 + x_2 + x_3 + x_4)$, multiplying by $2$ and moving everything to the left, one gets $-x_1 + x_2 - x_3 - x_4 \le 0$.
mip-f-104 · level facile · notes
Funds bought in lots (maximisation, budget $100$): a candidate dual solution $(\bar\alpha, \bar\beta) = (5/32, 1/8)$ gives, on the first dual constraint $12\alpha - \beta \ge 2$, the value $12 \cdot 5/32 - 1/8 = 7/4$. What does one conclude?
  1. It is feasible and gives the upper bound $100 \cdot 5/32$
  2. It is feasible, but the bound it gives is weak
  3. It is not a feasible dual solution, and its value is not a bound
  4. It suffices that the other dual constraints hold: one violated constraint does not count
Explanation. $7/4 < 2$: the first constraint is violated by $1/4$. A dual value can be read as a bound only after checking all the constraints, one by one.
mip-f-105 · level facile · notes
Seminars: the student chooses sessions $(s, k)$ (seminar $s$, slot $k$) with liking $p_{sk}$, $x_{sk} \in \{0,1\}$, and must attend **exactly** two: $\sum_{s,k} x_{sk} = 2$. Maximisation problem. What is the sign of the dual variable $\gamma$ of that constraint?
  1. $\gamma \ge 0$
  2. Free
  3. $\gamma \in \{0,1\}$
  4. $\gamma \le 0$
Explanation. An equality constraint gives a free dual variable. The shortest recipe sets everything to zero except $\bar\gamma = \max_{s,k} p_{sk}$, and gives $\ub = 2 \max_{s,k} p_{sk}$.
mip-f-106 · level facile · notes
Queens on a $4 \times 4$ board: $x_{ij} = 1$ if there is a queen on square $(i,j)$, and on every row, column and diagonal one imposes $\sum x_{ij} \le 1$. Why are the diagonals made of a single square not written?
  1. Because they would make the solution with a queen in the corner infeasible
  2. Because a queen in a corner cannot attack any other queen
  3. Because those squares are already counted among the column constraints
  4. They would give $x_{ij} \le 1$ on a variable that is already binary: a row that forbids nothing
Explanation. What remains are the $5 + 5$ diagonals with at least two squares: with $4$ rows and $4$ columns they make $18$ set packing constraints, without losing any solution.
mip-f-107 · level facile · notes
CNC machine: $x_i = 1$ if operation $i$ is performed, $y_j = 1$ if tool $j$ is mounted; the operation needs **all** the tools of its kit $T_i$. How many link constraints are needed for operation $i$, and which?
  1. One only: $\sum_{j \in T_i} y_j \ge x_i$
  2. None: the limit on the number of tools suffices
  3. $|T_i|$, one per tool: $x_i \le y_j$ for every $j \in T_i$
  4. One only: $x_i \le \sum_{j \in T_i} y_j$
Explanation. $x_i \Rightarrow \bigwedge_{j \in T_i} y_j$ has a conjunction in the consequent: it costs one constraint per tool. The sum (second and third options, which are the same constraint) would say "at least one tool".
mip-f-108 · level facile · notes
Four indivisible jobs of total duration $18$ are split between two workers, with loads $w_1, w_2$. The min-max model ($\min \max(w_1, w_2)$) is worth $9$, the range model ($\min |w_1 - w_2|$) $0$. Which statement is correct?
  1. The range model is wrong, because a load cannot be $0$
  2. The two models have different optimal solutions, because the values differ
  3. Same optimal solutions and different optimal values: $9$ is the largest load, $0$ the difference
  4. Min-max is off by $9$ units, because the optimal difference is $0$
Explanation. With a constant total, $\max(w_1, w_2) = 9 + |w_1 - w_2|/2$: minimising one is minimising the other. Reporting $9$ as the difference, or $0$ as the largest load, is a mistake.
mip-f-109 · level facile · notes
Music school timetable: $x_{dti} = 1$ if on day $d$, hour $t$, there is a lesson of instrument $i$, and $y_{di} = 1$ if instrument $i$ is present on day $d$. With the link $x_{dti} \le y_{di}$ alone, the constraint "at least two instruments per day" $\sum_i y_{di} \ge 2$ achieves nothing. What must be added?
  1. A big-M on the number of hours of each instrument
  2. $\sum_i y_{di} \le 2$, to fix the count at two
  3. $x_{dti} \ge y_{di}$ for every hour $t$ of the day
  4. $y_{di} \le \sum_t x_{dti}$, the opposite direction of the link
Explanation. With one direction only it suffices to set $y_{di} = 1$ with no lesson to meet the count. When a constraint counts indicators, the link must go both ways. $x_{dti} \ge y_{di}$ for every $t$ would force a lesson in every hour.
mip-f-110 · level facile · notes
Emergency room shifts: every shift pattern covers $1$ on its four full-time days and $1/2$ on the half-shift day; $x_j$ is the number of staff assigned to pattern $j$ and every day has a minimum requirement. Which model is it?
  1. A linear programme: the variables can be continuous without changing the optimum
  2. A set packing with coefficients $1$ and $1/2$ and binary variables
  3. A set partitioning with binary variables, one pattern per day
  4. A set covering with coefficients $1$ and $1/2$ and integer, non-binary variables
Explanation. Every day must have at least its requirement covered: $\ge$ constraints with coefficients $1$, $1/2$ or $0$; the variables count people, so they are integer but not binary.
mip-f-111 · level teorema · notes
Minimisation problem whose linear relaxation is exact, $\zlp = \zmilp = 9$, while a hand-made dual solution is worth $7$. Which statement is correct?
  1. An exact relaxation also makes every constructive heuristic optimal
  2. If a dual solution is worth less than $\zlp$, it is infeasible
  3. That the relaxation is exact says nothing about the quality of a particular hand-made dual solution
  4. If the relaxation is exact, every feasible dual solution is worth $\zmilp$
Explanation. The hand-made dual solution is feasible but not optimal for the dual: it gives $\lb = 7 \le \zlp = 9$. By strong duality a dual of value $9$ exists, but the hand-made recipe is not bound to find it.
mip-f-112 · level ipotesi · notes
Vehicles with a minimum quantity: $x_j \in \mathbb{Z}_{\ge 0}$ units of type $j$, binary $y_j$ (type produced), minimum $q_j$ and maximum $M_j$. To conclude that $x_j$ is **semi-integer**, i.e. $x_j = 0$ or $q_j \le x_j \le M_j$, what is needed?
  1. The constraint $x_j \le M_j y_j$ alone, with binary $y_j$ and integer $x_j$
  2. The constraint $x_j \le M_j y_j$ and a positive unit profit for type $j$
  3. Both constraints $x_j \ge q_j y_j$ and $x_j \le M_j y_j$, with binary $y_j$ and integer $x_j$
  4. The constraint $x_j \ge q_j y_j$ alone, with binary $y_j$ and integer $x_j$
Explanation. With $y_j = 0$ the two constraints give $x_j = 0$, with $y_j = 1$ they give $q_j \le x_j \le M_j$. Without the first the minimum quantity disappears; without the second a type could be produced with $y_j = 0$.
mip-f-168 · level facile · notes
Queens on a $5 \times 5$ board: $x_{ij} = 1$ if there is a queen on $(i,j)$, and one constraint $\sum x_{ij} \le 1$ is written for every row, column and diagonal **with at least two squares** (in each of the two directions there are $2 \cdot 5 - 3$ of them). How many constraints in all?
  1. $18$
  2. $28$
  3. $10$
  4. $24$
Explanation. Rows and columns are $5 + 5 = 10$; the diagonals with at least two squares are $7$ per direction, $14$ in all: $24$ constraints. $28$ also counts the $4$ single-square diagonals, $18$ is the count for the $4 \times 4$ board.
mip-f-169 · level facile · notes
Eight-seat van, four groups of $2$, $3$, $4$ and $5$ people offering $30$, $50$, $80$ and $70$ euros; at most two groups, and "if 2 is accepted then 4 is accepted". What is the maximum revenue?
  1. $120$
  2. $110$
  3. $130$
  4. $150$
Explanation. The pairs within eight seats are $\{1,2\}$, $\{1,3\}$, $\{1,4\}$, $\{2,4\}$, while $\{3,4\}$ is excluded ($9 > 8$). $\{1,2\}$ breaks the rule; $\{1,3\}$ is worth $110$, $\{1,4\}$ $100$, $\{2,4\}$ $120$. $130$ and $150$ are disallowed pairs.
mip-f-170 · level facile · notes
Aircraft to order: customer $j$ orders up to $D_j$ aircraft; $x_j \in \mathbb{Z}_{\ge 0}$ is how many are built and $y_j = 1$ if the fixed set-up cost $f_j$ is paid. Which link imposes "no set-up, no production", with the tightest coefficient?
  1. $x_j \le 1000\, y_j$
  2. $y_j \le x_j$
  3. $x_j \le D_j\, y_j$
  4. $x_j \le D_j + y_j$
Explanation. With $y_j = 0$ the constraint gives $x_j = 0$, with $y_j = 1$ it leaves $x_j \le D_j$, which holds anyway: the coefficient is the customer's order, read from the data. Any large number is valid but weakens the relaxation.
mip-f-171 · level facile · notes
Shoes, production and workers: $y_t$ workers in month $t$, each working $160$ hours; one pair needs $4$ hours. Which constraint links the production $x_t$ (pairs) to the workers?
  1. $x_t \le 160\, y_t$, with integer $y_t$
  2. $160\, x_t \le 4\, y_t$, with integer $y_t$
  3. $4\, x_t = 160\, y_t$, with continuous $y_t$
  4. $4\, x_t \le 160\, y_t$, with integer $y_t$
Explanation. The hours required, $4 x_t$, do not exceed the hours available, $160 y_t$: each worker makes at most $40$ pairs a month. Workers are counted, so $y_t$ is integer; the equality would force all hours to be used.
mip-f-220 · level facile · notes
Relay: three strokes (backstroke, breaststroke, butterfly) to be given to different swimmers, chosen among four, minimising the total time. Times in seconds, rows = strokes, columns = Carlo, Paolo, Fabio, Marco: backstroke $(37, 32, 33, 37)$, breaststroke $(43, 33, 42, 34)$, butterfly $(33, 28, 38, 30)$. The heuristic scans the strokes in the given order and assigns each to the fastest free swimmer. What time does it obtain?
  1. $93$
  2. $95$
  3. $99$
  4. $96$
Explanation. Backstroke to Paolo ($32$), breaststroke to Marco ($34$, the fastest among those left), butterfly to Carlo ($33$): $\ub = 99$. $93$ takes the minimum of each row and uses Paolo three times; $95$ is the optimum, which the heuristic does not find.
mip-f-221 · level facile · notes
Hub-and-spoke: $y_j = 1$ if city $j$ becomes a hub, and city $i$ is served if there is a hub in $S_i$, the set of cities within $1000$ miles of $i$ ($i$ included). The model is a set covering with a symmetric coefficient matrix. Why symmetric?
  1. Because "within $1000$ miles" is a symmetric relation: $j \in S_i \iff i \in S_j$
  2. Because there are as many candidate hubs as cities, and every square matrix is symmetric
  3. Because every city covers itself, and the diagonal is made of $1$s
  4. Because all the hub costs are equal to $1$
Explanation. The entry in row $i$ and column $j$ is $1$ if $j \in S_i$; the distance between two cities is the same both ways, so $j \in S_i$ if and only if $i \in S_j$. Square does not mean symmetric.
mip-f-222 · level facile · notes
Vehicles with minimum quantity: $1000$ tonnes of steel and $2000$ hours available. The large minivan needs $8$ tonnes and $55$ hours per unit, with minimum quantity $5$. In the link $x_5 \le M_5 y_5$ ($x_5$ integer units, $y_5$ binary) $M_5$ is the maximum producible of that type alone. What is it?
  1. $37$
  2. $125$
  3. $36$
  4. $5$
Explanation. $M_5 = \min\{\lfloor 1000/8 \rfloor, \lfloor 2000/55 \rfloor\} = \min\{125, 36\} = 36$: the hours decide. $125$ looks at steel only; $37$ rounds up and admits a unit that cannot be produced; $5$ is the minimum threshold.
mip-f-223 · level facile · notes
Aircraft on order: $x_j \in \mathbb{Z}_{\ge 0}$ aircraft for customer $j$, $y_j = 1$ if the set-up $f_j$ is paid, with $x_j \le D_j y_j$ and $-f_j y_j$ in the maximisation objective. Customer 3 has $f_3 = 0$ and $D_3 = 5$. What can be said of $y_3$?
  1. It equals $0$ in every optimal solution, because its coefficient is zero
  2. It equals $1$ in every feasible solution, even with $x_3 = 0$
  3. With $x_3 > 0$ it can be $0$, because the customer pays no set-up
  4. With $x_3 > 0$ the constraint forces $y_3 = 1$; with $x_3 = 0$ it can be $0$ or $1$ without changing the objective
Explanation. The link says $y_3 = 0 \Rightarrow x_3 = 0$, that is $x_3 > 0 \Rightarrow y_3 = 1$. With $f_3 = 0$ nothing pushes $y_3$ to $0$ when $x_3 = 0$: both choices give the same value.
mip-f-224 · level facile · notes
Seminars: $x_{sk} = 1$ if the student attends seminar $s \in \{1,2,3\}$ in time slot $k \in \{1,2,3,4\}$ (consecutive slots). Which family imposes "never two consecutive hours of lessons"?
  1. $\sum_s (x_{sk} + x_{s,k+1}) \le 1$ for $k = 1, 2, 3$
  2. $\sum_s x_{sk} \le 1$ for every slot $k$
  3. $\sum_s (x_{sk} + x_{s,k+1}) \ge 1$ for $k = 1, 2, 3$
  4. $x_{sk} + x_{s,k+1} \le 1$ for every seminar $s$ and $k = 1, 2, 3$
Explanation. Two consecutive slots $k$ and $k+1$ may contain at most one lesson, of any seminar. The single-seminar constraint would allow different seminars in adjacent slots; $\sum_s x_{sk} \le 1$ only forbids two lessons in the same slot.
mip-f-225 · level facile · notes
CNC machine, maximum profit, tool magazine of $k = 4$ tools. Operations (tools required, profit): 1 $\{1,3,4,5\}$, $2000$; 2 $\{1,2,6\}$, $1500$; 3 $\{1,2,3,5\}$, $1800$; 4 $\{2,4,5\}$, $1700$; 5 $\{5,6\}$, $800$. Dual recipe: the profit of each operation $i$ is spread equally over its tools, $\bar\beta_{ij} = p_i / |T_i|$, and $\bar\alpha = \max_j \sum_{i : j \in T_i} \bar\beta_{ij}$; the bound is $k \bar\alpha$. What is it?
  1. $\ub = \tfrac{23000}{3}$
  2. $\ub = 7800$
  3. $\ub = 2000$
  4. $\ub = 5800$
Explanation. The sums per tool are largest on tool 5: $500 + 450 + \tfrac{1700}{3} + 400 = \tfrac{5750}{3}$, and $4 \cdot \tfrac{5750}{3} = \tfrac{23000}{3}$. $7800$ is the sum of the profits, $5800$ uses tool 1 ($4 \cdot 1450$), which is not the maximum; $2000$ is the heuristic's lower bound.
mip-f-226 · level facile · notes
Shoe factory, maximum revenue. Per pair: boots leather $850$ g and price $150$, minimum $100$ pairs; loafers $600$ g, $120$, minimum $200$; walking shoes $700$ g, $130$, minimum $150$. Available leather $120\,000$ g (hours and nails are never binding). The heuristic scans the types by price per gram of leather, decreasing, and produces of each the maximum possible, provided it reaches the minimum. What revenue does it obtain?
  1. $22\,230$
  2. $24\,000$
  3. $420\,000$
  4. $21\,150$
Explanation. Ratios $3/17$, $1/5$, $13/70$: loafers first, $120\,000/600 = 200$ pairs, and the leather runs out: $200 \cdot 120 = 24\,000$. Sorting by price gives $141$ boots ($21\,150$); $22\,230$ is $171$ walking shoes; $420\,000$ ignores the leather.
mip-f-227 · level ipotesi · notes
Shoe factory (maximum revenue, leather, hours and nails constraints, minimum thresholds): the heuristic produces $200$ loafers, revenue $24\,000$; the dual solution that prices only leather, $1/5$ euro per gram, is worth $120\,000 \cdot 1/5 = 24\,000$. To conclude **without a solver** that $24\,000$ is the optimum, what is needed?
  1. That the dual solution is the lowest among the three recipes (leather, hours, nails)
  2. That the loafers solution uses up exactly the available leather
  3. That the loafers solution is feasible and integer and that the dual solution is feasible
  4. That loafers have the highest price per gram of leather
Explanation. A feasible integer solution gives $\lb = 24\,000$, a feasible dual gives $\ub = 24\,000$ (weak duality): they coincide, so the optimum is certified. Being the smallest of the three recipes is not enough without dual feasibility.
mip-f-228 · level teorema · notes
Balancing indivisible jobs between two workers, with loads $w_1, w_2$ and constant total $w_1 + w_2 = q$. Which identity links the min-max objective to the difference objective?
  1. $\max(w_1, w_2) = |w_1 - w_2|$
  2. $\max(w_1, w_2) = q - |w_1 - w_2|$
  3. $\max(w_1, w_2) = q/2 + |w_1 - w_2|/2$
  4. $\max(w_1, w_2) = q/2 - |w_1 - w_2|/2$
Explanation. The larger of the two is the average plus half the difference. With constant $q$ the two objectives have the same optimal solutions, but different optimal values, which are not compared.
mip-f-229 · level facile · notes
Emergency room shifts: pattern 2 works full time on Tuesday, Wednesday, Thursday and Friday, half time on Saturday, and rests Sunday and Monday. A full day costs $100$ euro on weekdays, $110$ on Saturday, $130$ on Sunday; at half time the day's cost is halved. How much does pattern 2 cost per worker?
  1. $465$
  2. $510$
  3. $400$
  4. $455$
Explanation. Four full weekdays, $400$, plus half of Saturday, $55$: $455$. $510$ pays Saturday in full; $400$ forgets the half shift; $465$ halves Sunday instead of Saturday.
mip-f-230 · level facile · notes
Shoes, production and workers, a **minimisation** problem: the hours constraint of month $t$ is $160\, y_t - 4\, x_t \ge 0$ ($y_t$ workers, $x_t$ pairs). In the dual of the relaxation, what sign has the variable $\beta_t$ of that constraint?
  1. $\beta_t$ free
  2. $\beta_t \in \{0, 1\}$
  3. $\beta_t \le 0$
  4. $\beta_t \ge 0$
Explanation. In a minimisation primal a $\ge$ constraint gives a non-negative dual variable; the equalities (inventory and workforce balances) give free variables.
mip-f-231 · level facile · notes
Music school timetable: $2$ days $d$, $2$ hours $t$ per day, $2$ instruments $i$; $x_{dti} = 1$ if instrument $i$ is taught at hour $t$ of day $d$, $y_{di} = 1$ if instrument $i$ appears on day $d$. The link must be written in both directions: $x_{dti} \le y_{di}$ and $y_{di} \le \sum_t x_{dti}$. How many link constraints in total?
  1. $8$
  2. $16$
  3. $4$
  4. $12$
Explanation. The first direction has one constraint per triple $(d, t, i)$: $2 \cdot 2 \cdot 2 = 8$; the second one per pair $(d, i)$: $4$. Total $12$. With the first direction only ($8$) the constraint "at least two instruments per day" is empty.
mip-f-420 · level facile · notes
Van with $8$ seats, four groups of $2$, $3$, $4$, $5$ people offering $30$, $50$, $80$, $70$ euro (accepted whole or not at all); at most two groups; if group 2 is accepted group 4 is accepted too; revenue is maximised. The heuristic scans the groups by decreasing offer and accepts a group only if all constraints stay satisfied (implication included). Which bound is obtained?
  1. $\ub = 110$ (groups 1 and 3)
  2. $\lb = 120$ (groups 2 and 4)
  3. $\lb = 110$ (groups 1 and 3)
  4. $\lb = 150$ (groups 3 and 4)
Explanation. Order $3, 4, 2, 1$: 3 fits ($4$ seats); 4 does not ($9 > 8$); 2 would force 4 (three groups); 1 fits ($6$ seats). Value $110$: in a maximisation it is a lower bound. The optimum, $120$, takes groups 2 and 4.
mip-f-421 · level facile · notes
Van with $8$ seats, four groups of $2$, $3$, $4$, $5$ people offering $30$, $50$, $80$, $70$ euro (accepted whole or not at all); at most two groups; if group 2 is accepted group 4 is accepted too; revenue is maximised. In the dual of the relaxation ($\alpha$ for seats, $\beta$ for the number of groups, $\gamma$ for the implication, all $\ge 0$; objective $\min 8\alpha + 2\beta$) one sets $\bar\beta = \bar\gamma = 0$. Which minimum $\bar\alpha$ is feasible and which bound does it give?
  1. $\bar\alpha = 14$, $\ub = 112$
  2. $\bar\alpha = 20$, $\lb = 160$
  3. $\bar\alpha = 20$, $\ub = 160$
  4. $\bar\alpha = 50/3$, $\ub = 400/3$
Explanation. The dual constraints become $2\alpha \ge 30$, $3\alpha \ge 50$, $4\alpha \ge 80$, $5\alpha \ge 70$: one needs $\alpha \ge \max(15, 50/3, 20, 14) = 20$. Value $8 \cdot 20 = 160$, an upper bound because the primal is a maximisation: «a seat is worth as much as the group paying best for it».
mip-f-422 · level facile · notes
Van with $8$ seats, four groups of $2$, $3$, $4$, $5$ people offering $30$, $50$, $80$, $70$ euro (accepted whole or not at all); at most two groups; if group 2 is accepted group 4 is accepted too; revenue is maximised. The optimum is $120$ (groups 2 and 4). Removing one constraint at a time, which of the two logical constraints really «costs», and how much?
  1. Neither: without one or the other the optimum stays $120$
  2. The implication: without it the optimum rises to $130$ (groups 2 and 3)
  3. Both cost $10$ euro each
  4. The two-group limit: without it the optimum rises to $150$
Explanation. Without the limit on the number of groups the optimum stays $120$: no triple fits in $8$ seats with higher revenue. Without the implication one can take 2 and 3 ($7$ seats, $130$). The implication costs $10$ euro.
mip-f-423 · level facile · notes
Bus lines: three companies, four lines, costs (rows companies, columns lines) $(10, 4, 9, 7)$, $(1, 2, 3, 10)$, $(8, 9, 10, 1)$; each line to exactly one company, each company at most two lines; cost is minimised. The heuristic scans the lines in the given order and assigns each to the cheapest company among those not yet saturated. Which bound is obtained?
  1. $\lb = 13$
  2. $\ub = 9$
  3. $\ub = 7$
  4. $\ub = 13$
Explanation. Line 1 to company 2 ($1$), line 2 again to 2 ($2$, now saturated), line 3 to 1 ($9$), line 4 to 3 ($1$): $13$, an upper bound in a minimisation. The optimum is $9$.
mip-f-424 · level facile · notes
Bus lines: three companies, four lines, costs (rows companies, columns lines) $(10, 4, 9, 7)$, $(1, 2, 3, 10)$, $(8, 9, 10, 1)$; each line to exactly one company, each company at most two lines; cost is minimised. What is the minimum cost $\zmilp$ (optimum of the integer model)?
  1. $9$
  2. $13$
  3. $10$
  4. $7$
Explanation. For example lines 1 and 3 to company 2 ($1 + 3$), line 2 to company 1 ($4$), line 4 to company 3 ($1$): $9$. The value $7$ (sum of column minima) would use company 2 for three lines.
mip-f-425 · level facile · notes
Relay: three strokes to be given to three different swimmers chosen among four, minimising the total time. Times (rows backstroke, breaststroke, butterfly; columns Carlo, Paolo, Fabio, Marco): $(37, 32, 33, 37)$, $(43, 33, 42, 34)$, $(33, 28, 38, 30)$. In the dual of the relaxation the swimmer variables are set to zero and each stroke gets the time of its best specialist, $\bar\alpha_s = \min_n t_{sn}$. Which bound is obtained, and why is it not attainable?
  1. $\lb = 99$; it is the value of the heuristic
  2. $\ub = 93$; in a minimisation the dual gives an upper bound
  3. $\lb = 93$; Paolo is the fastest both in backstroke and butterfly, but can swim only one stroke
  4. $\lb = 95$; it is the optimum, reached with Paolo in two strokes
Explanation. $\bar\alpha = (32, 33, 28)$, sum $93$: a lower bound in a minimisation. The best specialist of backstroke and butterfly is the same person, so $93$ is not attainable; the optimum is $95$.
mip-f-426 · level teorema · notes
Relay: three strokes to be given to three different swimmers chosen among four, minimising the total time. Times (rows backstroke, breaststroke, butterfly; columns Carlo, Paolo, Fabio, Marco): $(37, 32, 33, 37)$, $(43, 33, 42, 34)$, $(33, 28, 38, 30)$. The linear relaxation (binaries replaced by $x \ge 0$) is worth $95$, exactly the integer optimum. Why is the relaxation exact here?
  1. Because there are more swimmers than strokes
  2. Because the times are integer
  3. The constraint matrix is the assignment one, totally unimodular: all vertices of the relaxation are integer
  4. Because the problem is a minimisation
Explanation. With a totally unimodular matrix and integer right-hand sides every vertex of the polyhedron is integer, so the relaxation optimum is already integer. Integer data alone are not enough: adding a capacity with coefficients other than $0$ and $1$ loses the property.
mip-f-427 · level facile · notes
Hub-and-spoke (minimum number of hubs, every city within $1000$ miles of a hub): Atlanta covers Atlanta, Chicago, Houston, New York; Chicago and New York cover Atlanta, Chicago, New York; Denver covers Denver and Los Angeles; Houston covers Atlanta and Houston; Los Angeles covers Denver, Los Angeles, San Francisco; San Francisco covers Los Angeles, San Francisco, Seattle; Seattle covers San Francisco and Seattle. The covering heuristic chooses each time the city with minimum cost per newly covered city (cost $1$ per hub, ties broken by the listed order). Which hubs does it choose?
  1. Atlanta, Los Angeles, San Francisco
  2. Atlanta, Los Angeles
  3. Chicago, Los Angeles, Seattle
  4. Atlanta, Denver, Seattle
Explanation. Step 1: Atlanta covers $4$ new cities (ratio $1/4$). Step 2: Denver, Los Angeles, San Francisco, Seattle remain; Los Angeles covers three of them. Step 3: Seattle remains, covered by San Francisco (first in the order). Three hubs.
mip-f-428 · level ipotesi · notes
Hub-and-spoke (minimum number of hubs, every city within $1000$ miles of a hub): Atlanta covers Atlanta, Chicago, Houston, New York; Chicago and New York cover Atlanta, Chicago, New York; Denver covers Denver and Los Angeles; Houston covers Atlanta and Houston; Los Angeles covers Denver, Los Angeles, San Francisco; San Francisco covers Los Angeles, San Francisco, Seattle; Seattle covers San Francisco and Seattle. In the dual of the relaxation ($\pi_i \ge 0$ per city, and for every candidate hub the sum of the $\pi_i$ of the cities it covers $\le 1$) one sets $\bar\pi = 1$ for Atlanta, Denver and Seattle and $0$ elsewhere. Why is this solution feasible, and what does it prove?
  1. It is infeasible: Atlanta appears in four sets
  2. The three cities are the largest; it gives $\lb = 3$, but the optimum could be $2$
  3. Every hub covers at least one of the three; it gives $\ub = 3$
  4. No hub covers two of those three cities; it gives $\lb = 3$, which with the $3$-hub heuristic proves optimality
Explanation. The sets of hubs covering Atlanta, Denver and Seattle are disjoint, so every dual constraint receives at most $1$. The value $3$ is a lower bound: with a $3$-hub solution, $\lb = \ub = 3$.
mip-f-429 · level facile · notes
Funds bought in lots (maximisation): budget $100$ million; indivisible lots of $12$, $15$, $18$, $25$ million; annual return $1/6$, $1/3$, $1/9$ and $16\%$ of the capital invested in the four funds; the lots of the second fund do not exceed $50\%$ of the total lots. What is the return of one lot of each fund, in order (objective coefficients)?
  1. $(12, 15, 18, 25)$
  2. $(2, 5, 2, 16)$
  3. $(2, 5, 2, 4)$
  4. $(1/6, 1/3, 1/9, 4/25)$
Explanation. Return of one lot = lot cost times rate: $12/6 = 2$, $15/3 = 5$, $18/9 = 2$, $25 \cdot 0.16 = 4$. The rates alone are not the coefficients, because the variables count lots.
mip-f-430 · level facile · notes
Funds bought in lots (maximisation): budget $100$ million; indivisible lots of $12$, $15$, $18$, $25$ million; annual return $1/6$, $1/3$, $1/9$ and $16\%$ of the capital invested in the four funds; the lots of the second fund do not exceed $50\%$ of the total lots. In the dual of the relaxation the variable of the $50\%$ constraint is set to zero and the budget gets the price $\bar\alpha = \max_j (\text{lot return} / \text{lot cost})$. Which bound is obtained?
  1. $\ub = 25$
  2. $\ub = 100/6$
  3. $\ub = 100/3$
  4. $\lb = 100/3$
Explanation. The ratios are $1/6$, $1/3$, $1/9$, $4/25$: the maximum is $1/3$ (second fund), so $\ub = 100 \cdot 1/3 \approx 33.3$. It is an upper bound because the primal is a maximisation; the optimum is $23$.
mip-f-431 · level facile · notes
Vehicles (maximum profit): $1000$ t of steel and $2000$ hours; per unit of utility car, saloon, large car, minivan, large minivan: steel $(2, 3, 5, 6, 8)$, hours $(30, 25, 40, 45, 55)$, profit $(200, 250, 300, 550, 700)$; if a type is produced, at least $(10, 10, 10, 5, 5)$ units. A dual bound is built by pricing a single resource: $\ub = (\text{availability}) \cdot \max_j (\text{profit}_j / \text{usage}_j)$. Which resource gives the better bound, and what is it?
  1. Steel: $1000 \cdot 100 = 100000$
  2. Hours: $2000 \cdot 10 = 20000$
  3. Steel: $1000 \cdot 700/8 = 87500$
  4. Hours: $2000 \cdot 700/55 = 280000/11 \approx 25455$
Explanation. Profit per hour: $6.7$, $10$, $7.5$, $12.2$, $12.7$ → maximum $700/55$, bound $280000/11$. Profit per tonne: maximum $100$ (utility car), bound $100000$, much weaker. $20000$ is infeasible (it uses the saloon's ratio, not the maximum).
mip-f-432 · level facile · notes
Vehicles (maximum profit): $1000$ t of steel and $2000$ hours; per unit of utility car, saloon, large car, minivan, large minivan: steel $(2, 3, 5, 6, 8)$, hours $(30, 25, 40, 45, 55)$, profit $(200, 250, 300, 550, 700)$; if a type is produced, at least $(10, 10, 10, 5, 5)$ units. The heuristic finds $\lb = 25200$, the optimum is $\zmilp = 25250$. What is the heuristic gap $|\lb - \zmilp| / |\zmilp|$?
  1. about $2\%$
  2. about $0.2\%$
  3. $50$
  4. about $0.8\%$
Explanation. $50 / 25250 \approx 0.0020$, that is $0.2\%$. $50$ is the absolute gap; $0.8\%$ would confuse the optimum with the dual bound ($25455$).
mip-f-433 · level teorema · notes
Custom aircraft (maximum net profit): three customers order up to $3$, $2$, $5$ aircraft; setup $3$, $2$, $0$ million if producing for the customer; unit profit $2$, $3$, $1$ million; hours per aircraft $200$, $400$, $200$; capacity $1000$ hours. Model: $x_j \le D_j y_j$, $\max \sum_j (p_j x_j - f_j y_j)$. In the relaxation ($0 \le y_j \le 1$) it pays to set $y_j = x_j / D_j$, that is, to pay the setup proportionally. How much does one hour of capacity then yield for each customer?
  1. $1/200$, $1/400$, $1/200$
  2. $1/200$ million for all three customers
  3. $1/100$, $3/400$, $1/200$
  4. $2$, $3$, $1$
Explanation. Net profit per aircraft: $2 - 3/3 = 1$, $3 - 2/2 = 2$, $1 - 0 = 1$; divided by hours: $1/200$, $2/400 = 1/200$, $1/200$. Each hour is worth $1/200$, so $\ub = 1000/200 = 5$, and customer 3 with $5$ aircraft ($1000$ hours) attains it: optimum $5$.
mip-f-434 · level facile · notes
Custom aircraft (maximum net profit): three customers order up to $3$, $2$, $5$ aircraft; setup $3$, $2$, $0$ million if producing for the customer; unit profit $2$, $3$, $1$ million; hours per aircraft $200$, $400$, $200$; capacity $1000$ hours. Model: $x_j \le D_j y_j$, $\max \sum_j (p_j x_j - f_j y_j)$. One produces $5$ aircraft for customer 3 and nothing else. What is the net profit, and what can be concluded knowing that a feasible dual gives $\ub = 5$?
  1. $5$; the MILP must still be solved to know whether it is optimal
  2. $2$; customer 3's setup is paid anyway
  3. $5$; but it is an upper bound, not a solution
  4. $5$; it coincides with $\ub$, so the solution is optimal
Explanation. $5 \cdot 1 - 0 = 5$, using exactly $1000$ hours. A feasible solution whose value equals an upper bound is optimal: the certificate closes the problem without a solver.
mip-f-435 · level facile · notes
Seminars (maximum appreciation): three seminars, four consecutive time slots; appreciation (rows seminars, columns slots 9–10, 10–11, 11–12, 12–13): $(8, 6, 5, 3)$, $(7, 9, 4, 6)$, $(5, 7, 8, 9)$. Exactly two sessions are attended, each seminar at most once, never two in consecutive slots (nor in the same slot). What is the maximum appreciation $\zmilp$ (optimum of the integer model)?
  1. $34$
  2. $17$
  3. $18$
  4. $19$
Explanation. Seminar 2 at 10–11 ($9$) and seminar 3 at 12–13 ($9$): non-consecutive slots, different seminars, total $18$. $19$ would need consecutive slots or two sessions of the same seminar; $34$ is the weak bound $\sum_k \max_s p_{sk}$.
mip-f-436 · level facile · notes
Seminars (maximum appreciation): three seminars, four consecutive time slots; appreciation (rows seminars, columns slots 9–10, 10–11, 11–12, 12–13): $(8, 6, 5, 3)$, $(7, 9, 4, 6)$, $(5, 7, 8, 9)$. Exactly two sessions are attended, each seminar at most once, never two in consecutive slots (nor in the same slot). A simple dual solution gives each slot the maximum appreciation in that slot, $\bar\alpha_k = \max_s p_{sk}$, and sets the other dual variables to zero. What is the bound, and why is it weak?
  1. $\ub = 26$: the sum of the maxima per seminar
  2. $\lb = 34$: in a maximisation the dual gives a lower bound
  3. $\ub = 18$: it coincides with the optimum
  4. $\ub = 34$: it pays for all four slots, while only two are attended
Explanation. $8 + 9 + 8 + 9 = 34$, almost twice the optimum $18$: the recipe ignores the «exactly two» constraint. A recipe pricing that constraint closes the problem at $18$.
mip-f-437 · level facile · notes
Maximum number of queens on a $4 \times 4$ board with no captures: $x_{ij} = 1$ if there is a queen in $(i,j)$, and $\sum x_{ij} \le 1$ is written for every row, every column and every diagonal (in both directions) with **at least two squares**. How many diagonal constraints are there?
  1. $14$
  2. $12$
  3. $10$
  4. $8$
Explanation. Per direction there are $2 \cdot 4 - 1 = 7$ diagonals, $2$ of which have a single square and give no constraint: $5$ per direction, $10$ in all (plus $4$ rows and $4$ columns).
mip-f-438 · level facile · notes
Maximum number of queens on a $4 \times 4$ board with no captures. Row-by-row heuristic: in row $i$ take the first column not attacked by the queens already placed, otherwise the row stays empty; no backtracking. How many queens does it place, and which bound does it give?
  1. $2$: $\lb = 2$
  2. $4$: it is the optimum
  3. $3$: $\ub = 3$
  4. $3$ (in $(1,1)$, $(2,3)$, $(4,2)$): $\lb = 3$
Explanation. $(1,1)$; in row 2 column 3; in row 3 all squares are attacked; in row 4 column 2. Three queens, a lower bound in a maximisation; the optimum is $4$ (for example $(1,2), (2,4), (3,1), (4,3)$).
mip-f-439 · level facile · notes
CNC machine (maximum profit), magazine with at most $k = 4$ tools; operations (required tools, profit): 1 $\{1,3,4,5\}$, $2000$; 2 $\{1,2,6\}$, $1500$; 3 $\{1,2,3,5\}$, $1800$; 4 $\{2,4,5\}$, $1700$; 5 $\{5,6\}$, $800$. An operation is performed only if all its tools are mounted. What is the maximum profit $\zmilp$ (optimum of the integer model)?
  1. $2500$
  2. $5200$
  3. $2000$
  4. $3200$
Explanation. With tools $\{2, 4, 5, 6\}$ operations 4 and 5 are performed: $1700 + 800 = 2500$. No richer pair of operations fits in $4$ tools (for example 2 and 4 need $5$). $5200$ is the linear relaxation.
mip-f-440 · level facile · notes
CNC machine (maximum profit), magazine with at most $k = 4$ tools; operations (required tools, profit): 1 $\{1,3,4,5\}$, $2000$; 2 $\{1,2,6\}$, $1500$; 3 $\{1,2,3,5\}$, $1800$; 4 $\{2,4,5\}$, $1700$; 5 $\{5,6\}$, $800$. An operation is performed only if all its tools are mounted. The heuristic scans the operations by decreasing profit and mounts each tool set if the magazine allows it. Which bound does it give, and what is its gap with respect to the optimum $2500$?
  1. $\lb = 2000$, gap $25\%$
  2. $\lb = 2000$ (operation 1 only), gap $20\%$
  3. $\lb = 3800$ (operations 1 and 3), gap $52\%$
  4. $\ub = 2000$, gap $20\%$
Explanation. Operation 1 fills the magazine ($4$ tools); every other would need one more tool. Value $2000$, a lower bound; gap $(2500 - 2000)/2500 = 20\%$ (dividing by $2000$ would give $25\%$).
mip-f-441 · level facile · notes
Shoe factory (maximum revenue): one pair of boots, moccasins, walking shoes needs $850$, $600$, $700$ g of leather and earns $150$, $120$, $130$ euro; $120000$ g of leather are available (besides hours and nails); minimum production thresholds if the type is produced. Pricing only the leather, $\bar\alpha = \max_j (\text{price}_j / \text{leather}_j)$, and the other resources at zero, which upper bound is obtained?
  1. $21176$
  2. $22286$
  3. $18000$
  4. $24000$
Explanation. Revenue per gram: $150/850 \approx 0.176$, $120/600 = 0.2$, $130/700 \approx 0.186$: maximum $0.2$, bound $120000 \cdot 0.2 = 24000$. It coincides with the heuristic ($200$ moccasins), so the optimum is $24000$.
mip-f-442 · level facile · notes
Balancing: four indivisible jobs of duration $2$, $3$, $6$, $7$ are split between two workers, minimising the maximum load (min-max). LPT assigns the jobs by decreasing duration to the less loaded worker (ties: worker 1). Which loads does it obtain, and what can be concluded with the bound $\sum_j t_j / 2$?
  1. $(9, 9)$; the bound is $9$, so the solution is optimal
  2. $(13, 5)$; the bound is $9$
  3. $(9, 9)$; the bound is $7$, a gap remains
  4. $(10, 8)$; the bound is $9$, gap $11\%$
Explanation. $7 \to$ 1, $6 \to$ 2, $3 \to$ 2 ($9$), $2 \to$ 1 ($9$): loads $(9, 9)$. The maximum load is at least the average $18/2 = 9$: $\lb = \ub = 9$.
mip-f-443 · level ipotesi · notes
Balancing: four indivisible jobs of duration $2$, $3$, $6$, $7$ are split between two workers, minimising the maximum load (min-max). The text only says «loads as balanced as possible». Why must the translation into a model be declared?
  1. Because balancing cannot be modelled with binary variables
  2. Because with two workers all translations give the same model
  3. Because the min-max model is the only linear one
  4. «Balanced» admits several objectives (min-max, max-min, difference) which in general may have different optima
Explanation. Min-max, max-min and difference are three different models; with two workers and constant total load they coincide, but with more workers they may give different solutions. The choice must therefore be declared.
mip-f-444 · level facile · notes
Emergency room shifts (minimum cost): full-time staff requirement Mon–Sun $(10, 8, 12, 9, 9, 7, 8)$, total $63$; each pattern works four consecutive full days, one half day and two rest days; a full day costs at least $100$ euro (weekday), $110$ on Saturday, $130$ on Sunday. A simple dual bound is $\lb = 100 \cdot 63 = 6300$. Which reasoning justifies it?
  1. It is the heuristic's cost divided by the number of patterns
  2. Every worker costs $100$ euro per week
  3. Every unit of daily requirement costs at least $100$ euro, the cheapest cost of a full day
  4. $63$ workers are needed, each paid $100$ euro
Explanation. A full-time worker on one day costs at least $100$ (and half a worker covers $1/2$ at half price): the cost per unit of covered requirement is at least $100$, and there are $63$ units. The optimum is $7060$.
mip-f-445 · level facile · notes
Emergency room shifts (minimum cost): full-time staff requirement Mon–Sun $(10, 8, 12, 9, 9, 7, 8)$, total $63$; each pattern works four consecutive full days, one half day and two rest days; a full day costs at least $100$ euro (weekday), $110$ on Saturday, $130$ on Sunday. The covering heuristic gives $\ub = 8410$, the optimum is $\zmilp = 7060$. What is the heuristic gap?
  1. about $19.1\%$
  2. about $33.5\%$
  3. about $16.1\%$
  4. $1350$
Explanation. $(8410 - 7060)/7060 = 1350/7060 \approx 19.1\%$. Dividing by $8410$ gives $16.1\%$; $33.5\%$ is the gap between $8410$ and the bound $6300$ divided by $6300$.
mip-f-446 · level facile · notes
Shoes and workers over three months (minimum cost): demands $3000$, $5000$, $7000$ pairs, initial stock $500$; a worker costs $1500$ euro per month and works $160$ hours; a pair needs $4$ hours and $15$ euro of raw materials; storage $3$ euro per pair and month; training a hire $100$ euro. A simple bound: every pair to be produced costs at least raw materials plus labour. What is this minimum cost per pair, and how many pairs must be produced at least?
  1. $15 + 1500/160 \approx 24.4$ euro; $14500$ pairs
  2. $15 + 4 \cdot 1500/160 = 52.5$ euro; $15000 - 500 = 14500$ pairs, so $\lb = 761250$
  3. $15$ euro; $15000$ pairs, so $\lb = 225000$
  4. $52.5$ euro; $15000$ pairs, so $\lb = 787500$
Explanation. One worker hour costs $1500/160 = 9.375$ euro, four hours $37.5$; with raw materials $52.5 = 105/2$. Net of the stock $14500$ pairs are needed: $\lb = 761250$, against the optimum $774180$.
mip-f-447 · level facile · notes
Shoes and workers over three months (minimum cost): demands $3000$, $5000$, $7000$ pairs, initial stock $500$; a worker costs $1500$ euro per month and works $160$ hours; a pair needs $4$ hours and $15$ euro of raw materials; storage $3$ euro per pair and month; training a hire $100$ euro. The heuristic's plan costs $825000$, the optimum $774180$, and the relaxations are $773500$. Why does it pay at the optimum to produce in advance and hold stock?
  1. Hiring and paying workers only for the third-month peak costs more than storage at $3$ euro per pair
  2. Because storage is free in the first month
  3. Because the initial stock must be used up immediately
  4. It does not pay: the optimum produces exactly the demand every month
Explanation. Workers are paid in full every month: sizing the workforce on the peak of $7000$ pairs would leave unused hours in earlier months. Producing in advance levels the workforce requirement and costs only $3$ euro per pair and month.
mip-f-448 · level facile · notes
Music school timetable: Monday and Tuesday, two hours each; $2$ hours of guitar and $2$ of violin must be placed; every day must have lessons of at least two different instruments. The guitar teacher would rather not come on Tuesday, the violin teacher not on Monday; the number of hours violating a preference is minimised. What is the optimal value $\zmilp$?
  1. $2$
  2. $4$
  3. $0$
  4. $1$
Explanation. With two hours per day and two different instruments each day has one hour of guitar and one of violin: guitar comes one hour on Tuesday and violin one hour on Monday, two violations. Without the variety constraint one would reach $0$.
mip-f-449 · level ipotesi · notes
Music school timetable: Monday and Tuesday, two hours each; $2$ hours of guitar and $2$ of violin must be placed; every day must have lessons of at least two different instruments. The guitar teacher would rather not come on Tuesday, the violin teacher not on Monday; the number of hours violating a preference is minimised. The relaxation without bounds is worth $\zlp = 0$, the one with bounds $\zlpp = 2$, the optimum $\zmilp = 2$. A student reports «$\lb = 2$, because each day needs one hour of each instrument». What is true of this argument?
  1. It is wrong: the correct bound is $0$, so the optimum is $0$
  2. It is an upper bound, not a lower bound
  3. It is a valid combinatorial argument on the integer problem, but not a bound from the dual of the relaxation without bounds, which gives at most $0$
  4. It is a bound of the relaxation without bounds, which is therefore worth $2$
Explanation. The reasoning uses integrality (one whole hour per instrument), so it holds for the MILP but not for the relaxation without bounds ($\zlp = 0$): a feasible dual of that relaxation cannot exceed $0$. The source of the bound must be declared.
mip-f-460 · level facile · notes
Shoe factory (maximum revenue, leather, hours and nails constraints, minimum thresholds if a type is produced): the heuristic produces $200$ moccasins with revenue $24000$, and a feasible dual of the relaxation (pricing only leather) gives $\ub = 24000$. What is concluded, without solving the MILP?
  1. The relaxation is integral, but the MILP optimum may be higher
  2. Nothing: the MILP must be solved to confirm
  3. The optimum is below $24000$, because the thresholds cut solutions
  4. The heuristic's solution is optimal: $\lb = \ub = 24000$
Explanation. A lower bound (feasible solution) and an upper bound (feasible dual) that are equal enclose the optimum in one point: $\zmilp = 24000$, certified by hand.
mip-f-520 · level teorema · notes
Bus lines (assignment with capacity counted in number of lines, minimisation): the linear relaxation is worth $\zlp = 9$, equal to the integer optimum $\zmilp$, but the «zero and saturate» dual solution is worth $7$. What does the comparison teach?
  1. The integer optimum is actually $7$
  2. The dual solution is wrong, because it is not worth $9$
  3. That the relaxation is exact says nothing about the quality of a particular hand-built dual solution
  4. The relaxation cannot be exact if the hand-built dual is worth $7$
Explanation. $7$ is a valid lower bound, weaker than the dual optimum $9 = \zlp$: the recipe does not give the dual optimum. They are two different facts.

7. Assignment and scheduling (31)

mip-f-113 · level facile · notes
Minimum-cost assignment with availability: $x_{jm} = 1$ if job $j$ goes on machine $m$; every job on one machine, and $\sum_j t_{jm} x_{jm} \le a_m$ for every machine. Why are there no links between variables to prove in this model?
  1. Because the assignment constraints are equalities
  2. It has a single family of variables, and availability is a capacity constraint, not an implication
  3. Because all the costs $c_{jm}$ are strictly positive
  4. Because the constraint matrix is totally unimodular
Explanation. Links connect different families of variables. A capacity constraint compares required minutes with available minutes: the relation is the inequality itself. With different times $t_{jm}$ the matrix is not even totally unimodular.
mip-f-114 · level facile · notes
Machines with a fixed cost: $x_{jm} = 1$ if job $j$ goes on machine $m$, $y_m = 1$ if the machine is used (cost $c_m > 0$), $t_{jm}$ times, $a_m$ availability. What does the constraint $\sum_j t_{jm} x_{jm} \le a_m y_m$ impose?
  1. Every used machine performs at most one job at a time
  2. Every job goes on the used machine of minimum cost, within its availability
  3. If a machine performs jobs then it is used, and a used machine does not exceed its availability
  4. If a machine is used then it performs at least one job, within its availability
Explanation. A single constraint acts as link and capacity. The direction "used $\Rightarrow$ performs jobs" is not imposed: it follows from optimality because $c_m > 0$.
mip-f-115 · level facile · notes
Parallel jobs: the jobs assigned to the same machine start together, and the time of machine $m$ is the **maximum** of the times $t_{jm}$ of its jobs; the sum of the machine times is minimised. With binary $x_{jm}$, how is it linearised?
  1. With a continuous $y_m$, the constraints $y_m \le t_{jm} x_{jm}$ for every job, and $\min \sum_m y_m$
  2. With a continuous $y_m$, the constraints $y_m \ge t_{jm} x_{jm}$ for every job, and $\min \sum_m y_m$
  3. With a continuous $y_m$, the constraint $y_m \ge \sum_j t_{jm} x_{jm}$, and $\min \sum_m y_m$
  4. With a continuous $y_m$, the constraint $y_m = \max_j t_{jm} x_{jm}$, and $\min \sum_m y_m$
Explanation. It is the maximum variable: the constraints give $y_m \ge \max_j t_{jm} x_{jm}$ and the objective, with a positive coefficient, brings equality. The $\max$ is not linear; the sum would give the time of jobs in series.
mip-f-116 · level facile · notes
Parallel jobs, with $y_m \ge t_{jm} x_{jm}$ and $\min \sum_m y_m$. With $\bar t_m = \max_j t_{jm}$ the constraints $\bar t_m \sum_j x_{jm} - y_m \ge 0$ are added, forcing $y_m = 0$ when the machine is empty. What are they?
  1. Valid inequalities, satisfied by every feasible solution, that strengthen the relaxation
  2. Redundant constraints, already implied by the maximum constraints $y_m \ge t_{jm} x_{jm}$
  3. Constraints that preserve optimality but are not valid: the model admits $y_m > 0$ on an empty machine
  4. Constraints that make the model infeasible when a machine stays empty
Explanation. A feasible solution with $y_m > 0$ on an empty machine violates them, so they are not valid; but every optimum satisfies them, because there $y_m = 0$.
mip-f-117 · level facile · notes
One machine, jobs split into classes with setup: $x_j = 1$ if job $j$ is performed, $y_c = 1$ if class $c$ is activated (cost $f_c \ge 0$, possibly zero, and time $s_c$), maximisation problem. In which form does "if no job of the class is performed, the class is not activated" hold?
  1. It holds in every optimal solution, because the setup consumes time
  2. It is imposed by the constraints $x_j \le y_c$ in every feasible solution
  3. There exists an optimum in which it holds, because $f_c$ may be zero
  4. It holds in no optimal solution
Explanation. Setting $y_c = 0$ stays feasible, frees $s_c$ minutes and does not worsen the objective because $f_c \ge 0$; with $f_c = 0$ the exchange does not strictly improve, so the correct conclusion is the weaker one.
mip-f-118 · level facile · notes
Classes with setup: $\mathscr{J}_c$ is the set of jobs of class $c$. Instead of the links $x_j \le y_c$, $j \in \mathscr{J}_c$, the aggregated form $\sum_{j \in \mathscr{J}_c} x_j \le |\mathscr{J}_c|\, y_c$ is used. What changes?
  1. Different integer set, weaker relaxation
  2. Nothing, not even in the linear relaxation
  3. Same integer set, stronger relaxation
  4. Same integer set, weaker relaxation
Explanation. It is the aggregated activation: equivalent on binary points, weaker in the relaxation ($y_c = 1/|\mathscr{J}_c|$ suffices for one job), with fewer rows.
mip-f-119 · level facile · notes
One machine, jobs in classes: $x_j = 1$ if job $j$ is performed, and the binary $z$ must equal $1$ if jobs of at least two different classes are performed. Which constraint imposes "$x_j = 1$ and $x_i = 1$, with $i, j$ of different classes, $\Rightarrow z = 1$"?
  1. $z \le x_j + x_i - 1$
  2. $x_j + x_i - z \le 1$
  3. $x_j + x_i + z \le 2$
  4. $x_j + x_i - 2z \ge 0$
Explanation. The implication $x_j \land x_i \Rightarrow z$ is the clause $\lnot x_j \lor \lnot x_i \lor z$, i.e. $x_j + x_i - z \le 1$: one constraint per mixed pair.
mip-f-120 · level facile · notes
Total tardiness on one machine: $s_{ji} = 1$ if $j$ precedes $i$, with $s_{ji} + s_{ij} = 1$ and big-M precedences. Why can the transitivity inequalities $s_{ji} + s_{ik} - s_{jk} \le 1$ be added?
  1. They are needed to make the big-M $M = \sum_j t_j$ valid in the precedence constraints
  2. They are valid, because a cycle of precedences is impossible, and they cut off the $1/2$ solutions of the relaxation
  3. They preserve optimality but are not valid: they cut off some feasible sequences
  4. They are implied by the order constraints $s_{ji} + s_{ij} = 1$, so they change nothing
Explanation. Every feasible sequence respects transitivity ($j$ before $i$ and $i$ before $k$ give $j$ before $k$): the inequalities are valid. In the relaxation, where $s = 1/2$ half switches off the precedences, they are cuts.
mip-f-121 · level facile · notes
Total tardiness: $\kappa_j$ is the completion of job $j$ and $d_j$ its due date. With $\tau_j \ge \kappa_j - d_j$, $\tau_j \ge 0$ and $\min \sum_j \tau_j$, what holds for $\tau_j$?
  1. The constraints give $\tau_j \ge \max\{0, \kappa_j - d_j\}$, and the optimum brings equality
  2. The constraints already give $\tau_j = \max\{0, \kappa_j - d_j\}$ in every feasible solution
  3. A binary with big-M is needed to write the maximum of $0$ and $\kappa_j - d_j$
  4. $\tau_j$ becomes negative when the job finishes early
Explanation. The link is the inequality itself; equality comes from the objective: lowering $\tau_j$ to the maximum stays feasible and reduces the sum. A big-M would be needed only to have the maximum in a "$\le$" constraint.
mip-f-122 · level teorema · notes
Classes with a bonus: $\mathscr{J}_c$ are the jobs of class $c$, $y_c = 1$ gives a bonus $v_c > 0$ in a maximisation, and there are only the constraints $x_j \ge y_c$ for $j \in \mathscr{J}_c$ ($y_c$ appears only there). Which statement is correct?
  1. "$y_c = 1 \Rightarrow$ class complete" is imposed by the constraints; "class complete $\Rightarrow y_c = 1$" holds in every optimum
  2. Both directions are imposed by the constraints $x_j \ge y_c$ in every feasible solution
  3. Neither direction is guaranteed, by the constraints or by optimality
  4. "Class complete $\Rightarrow y_c = 1$" holds only in some optimum, because the bonus is not enough
Explanation. The constraint gives one direction in every feasible solution; for the other, raising $y_c$ to $1$ with the class complete stays feasible and strictly increases the objective by $v_c > 0$: "in every optimum".
mip-f-123 · level ipotesi · notes
Machines with a fixed cost (minimisation): $y_m = 1$ if the machine is used, cost $c_m$, link $\sum_j t_{jm} x_{jm} \le a_m y_m$. To prove that **in every optimum** a used machine performs at least one job, what is needed?
  1. $c_m > 0$ and the fact that setting $y_m = 0$ on an empty machine keeps the link satisfied ($0 \le 0$)
  2. $c_m \ge 0$ and the fact that setting $y_m = 0$ on an empty machine keeps the link satisfied ($0 \le 0$)
  3. The assignment constraints and total unimodularity of the matrix
  4. The link constraint alone, which holds in every feasible solution
Explanation. It is the exchange argument: switching off an empty machine stays feasible and reduces the cost by $c_m$. Strict positivity is needed for "in every optimum"; with $c_m = 0$ one would only get "there exists an optimum".
mip-f-124 · level ipotesi · notes
One machine with jobs in classes: the binary $z = 1$ reduces the availability by $u > 0$ minutes and is forced by $x_j + x_i - z \le 1$ for every mixed pair; $z$ does not appear in the objective. To prove that **there exists an optimum** with $z = 0$ when the performed jobs lie in a single class, what is needed?
  1. That $u > 0$ and that the machine availability be saturated at the optimum
  2. That setting $z = 0$ stays feasible (it frees $u$ minutes, no mixed pair is active) and that $z$ does not appear in the objective
  3. The constraint $x_j + x_i - z \le 1$ read backwards, as "$z = 1 \Rightarrow$ mixed pair"
  4. That $z$ have a strictly positive coefficient in the maximisation objective
Explanation. The exchange stays feasible and leaves the objective unchanged, because $z$ does not appear in it: the conclusion is "there exists an optimum", not "in every optimum".
mip-f-125 · level ipotesi · notes
Total tardiness on one machine, with precedences $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ji})$ and $\kappa_i \ge t_i$; the model does not impose $\kappa_j \le M$. What is needed to state that $M = \sum_j t_j$ switches off the precedences on all the solutions among which the optimum is sought?
  1. That every job meet its due date, $\kappa_j \le d_j$
  2. That the optimal total tardiness be zero
  3. That there exists an optimum without idle time, on which every $\kappa_j \le \sum_j t_j$, together with $\kappa_i \ge t_i$
  4. That the binaries $s_{ji}$ satisfy the transitivity inequalities
Explanation. If the machine stops, the following jobs can be brought forward and no tardiness gets worse: there exists an optimum without idle time, and there $\kappa_j + t_i - M \le t_i \le \kappa_i$.
mip-f-172 · level facile · notes
Selection of jobs with revenue $r_j$ and machines with fixed cost $c_m$, to be maximised (revenues minus costs of the machines used). A heuristic chooses jobs and machines and gets a profit of $20$; the hand-made dual of the relaxation is worth $34$. How is the result written?
  1. $\zmilp \le 20$
  2. $20 \le \zmilp \le 34$
  3. $\zmilp \ge 34$
  4. $34 \le \zmilp \le 20$
Explanation. In a maximisation the heuristic's solution is the pessimistic side (lower bound) and the dual the optimistic side (upper bound). The integer optimum of that instance is $25$.
mip-f-173 · level facile · notes
Job selection (revenue $r_j$, time $t_j$) on machines with fixed cost $c_m$ and availability $a_m$, to be maximised. A job has $r_j < \min_m c_m$ and fits on no machine already switched on for other jobs. What can be said?
  1. It must go on the cheapest machine, which remains profitable
  2. It must be performed anyway, because every job has a positive revenue
  3. Performing it never pays: it would require switching on a machine that costs more than it earns
  4. It makes the problem infeasible, because no machine can host it
Explanation. Switching on a machine just for that job adds $r_j - c_m < 0$ to the profit. The jobs are not mandatory ($\sum_m x_{jm} \le 1$): leaving it out is feasible and better.
mip-f-174 · level facile · notes
Job selection: every job $j$ is performed on **at most** one machine, $\sum_m x_{jm} \le 1$, instead of exactly one. Why is this constraint "$\le$" in the maximisation problem with revenues $r_j > 0$?
  1. Because the jobs are optional: one chooses which to perform, and an unprofitable job stays out
  2. Because the dual requires non-negative variables for those constraints
  3. Because with "$=$" the linear relaxation would become integer
  4. Because positive revenues already push every job onto a machine
Explanation. The problem decides which jobs to perform: with "$= 1$" every job would become mandatory and the model would answer another question. The sign of the dual is a consequence, not the reason.
mip-f-232 · level facile · notes
Minimum-cost assignment with availability: three jobs of duration $(3, 2, 4)$ (the same on every machine), two machines with availability $(5, 6)$; costs $c_{jm}$ per job: $(2, 5)$, $(1, 3)$, $(1, 6)$. The heuristic takes the jobs in order and puts each on the cheapest machine where it still fits. What cost does it obtain?
  1. $9$
  2. $4$
  3. $10$
  4. $8$
Explanation. Job 1 on machine 1 (cost $2$, residual $2$); job 2 on machine 1 (cost $1$, residual $0$); job 3 no longer fits on machine 1 and goes to machine 2 (cost $6$): $\ub = 9$. $4 = 2 + 1 + 1$ ignores availabilities: it is the dual bound "every job at its minimum cost".
mip-f-233 · level teorema · notes
Minimum-cost assignment with availability ($\sum_m x_{jm} = 1$ per job, $\sum_j t_{jm} x_{jm} \le a_m$ per machine). The dual of the relaxation has free $\mu_j$, $\pi_m \le 0$ and the constraints $\mu_j + t_{jm} \pi_m \le c_{jm}$, objective $\sum_j \mu_j + \sum_m a_m \pi_m$. Which statement is correct?
  1. For every $\bar\pi \le 0$, $\bar\mu_j = \min_m (c_{jm} - t_{jm} \bar\pi_m)$ is feasible and gives a lower bound
  2. For every $\bar\pi \le 0$, $\bar\mu_j = \max_m (c_{jm} - t_{jm} \bar\pi_m)$ is feasible and gives a lower bound
  3. For every $\bar\pi \ge 0$, $\bar\mu_j = \min_m (c_{jm} - t_{jm} \bar\pi_m)$ is feasible and gives a lower bound
  4. Only $\bar\pi = 0$ with $\bar\mu_j = \min_m c_{jm}$ gives a feasible dual
Explanation. Once $\bar\pi \le 0$ is fixed (the sign required by a $\le$ constraint in a minimisation), the largest $\mu_j$ with $\mu_j \le c_{jm} - t_{jm}\bar\pi_m$ for every $m$ is the minimum over $m$. With the maximum some constraint is violated; $\bar\pi = 0$ is just the "zero and saturate" case.
mip-f-461 · level facile · notes
Minimum-cost assignment with availabilities: $x_{jm} = 1$ if job $j$ goes on machine $m$, time $t_{jm}$, availability $a_m$, constraint $\sum_j t_{jm} x_{jm} \le a_m$. If $t_{jm} > a_m$ for some pair, what can be done before solving?
  1. Fix $x_{jm} = 1$, because the job must be assigned anyway
  2. Fix $x_{jm} = 0$: the model shrinks and the relaxation does not worsen
  3. Increase $a_m$ up to $t_{jm}$
  4. Nothing: the availability constraint already excludes it, also in the relaxation
Explanation. No integer solution can use that pair; in the relaxation, however, $x_{jm}$ could equal $a_m / t_{jm} < 1$. Fixing it to zero removes a variable without losing integer solutions, and can only strengthen the relaxation.
mip-f-462 · level facile · notes
Machines with a fixed usage cost: $x_{jm} = 1$ if job $j$ goes on machine $m$, $y_m = 1$ if the machine is used (cost $c_m$), times $t_{jm}$, availability $a_m$. The model uses the aggregated constraint $\sum_j t_{jm} x_{jm} \le a_m y_m$. What does it impose on its own?
  1. Only that a switched-off machine does not work
  2. That every switched-on machine performs at least one job
  3. Both the availability of a switched-on machine and that a switched-off machine performs no jobs
  4. Only the availability: a separate constraint is needed for the switched-off machine
Explanation. With $y_m = 1$ it is the availability constraint; with $y_m = 0$ it becomes $\sum_j t_{jm} x_{jm} \le 0$, so no job (positive times). That a switched-on machine really works is imposed by the objective, not by the constraint.
mip-f-463 · level teorema · notes
Machines with fixed cost: model with the aggregated constraint $\sum_j t_{jm} x_{jm} \le a_m y_m$. The disaggregated constraints $x_{jm} \le y_m$ are added for every pair. What is their effect?
  1. They lower the value of the relaxation, because they add variables
  2. They do not change the integer optimum (they are implied on integer points) but raise the value of the relaxation
  3. They change the integer optimum, because they forbid feasible assignments
  4. They change nothing, neither the optimum nor the relaxation
Explanation. On integer points $x_{jm} = 1$ with $y_m = 0$ is already forbidden by the aggregated constraint; in the relaxation, however, the aggregated one allows a small $y_m$ with a large $x_{jm}$. The disaggregated ones cut those fractional points: stronger formulation, same integer set.
mip-f-464 · level facile · notes
Job selection with fixed-cost machines (maximum profit = revenues of the jobs performed minus the costs $c_m$ of the machines used). Job $j$ has revenue $r_j$ smaller than $\min_m c_m$. In which case is performing it never worthwhile?
  1. When the machine is already on for other jobs
  2. When it would be the only job on its machine: its revenue does not pay for switching on
  3. Always: a low-revenue job is never performed
  4. Never: every performed job increases profit
Explanation. Alone on a machine it would bring $r_j - c_m < 0$. On a machine already on for other jobs the fixed cost is already paid and the job adds $r_j > 0$, if there is time.
mip-f-465 · level facile · notes
Machines performing jobs in parallel: all jobs assigned to machine $m$ start together, and the machine's time is that of its longest job; the sum of the machine times is minimised. With $x_{jm} = 1$ if $j$ goes on $m$ and $y_m \ge 0$ the machine time, which constraint defines $y_m$?
  1. $y_m = \max_j t_{jm}$
  2. $y_m \ge \sum_j t_{jm} x_{jm}$
  3. $y_m \le t_{jm} x_{jm}$ for every job $j$
  4. $y_m \ge t_{jm} x_{jm}$ for every job $j$
Explanation. It is a maximum variable: $y_m$ lies above every time of the assigned jobs, and minimising it brings it down to the longest. The sum would describe jobs in series; $\max_j t_{jm}$ ignores which jobs are assigned.
mip-f-466 · level ipotesi · notes
Parallel machines (minimum sum of times $y_m$, with $y_m \ge t_{jm} x_{jm}$). With $\bar t_m = \max_j t_{jm}$ the constraints $\bar t_m \sum_j x_{jm} - y_m \ge 0$ are added, forcing $y_m = 0$ on an empty machine. How should they be classified?
  1. They are valid inequalities, because no optimal solution violates them
  2. They are cuts: they reduce the relaxation without removing integer solutions
  3. They are wrong: they exclude the optimal solution
  4. They are not valid (the model admits $y_m > 0$ on an empty machine) but preserve optimality, because the objective brings $y_m$ to zero anyway
Explanation. A valid inequality removes no feasible integer solution; these constraints remove the solutions with $y_m > 0$ on an empty machine, feasible but never optimal. They remove only non-optimal solutions: they preserve optimality.
mip-f-467 · level facile · notes
Class setups on one machine (maximum profit): $x_j = 1$ if job $j$ is performed, $y_c = 1$ if class $c$ is activated, with setup cost $f_c$ and setup time $s_c$; availability $a$. Which pair of constraints models activation and capacity?
  1. $\sum_{j \in \mathscr{J}_c} x_j = y_c$, and $\sum_j t_j x_j + \sum_c s_c y_c \le a$
  2. $y_c \le x_j$ for every $j$ in class $c$, and $\sum_j t_j x_j \le a$
  3. $x_j \le y_c$, and $\sum_j t_j x_j \le a + \sum_c s_c y_c$
  4. $x_j \le y_c$ for every $j$ in class $c$, and $\sum_j t_j x_j + \sum_c s_c y_c \le a$
Explanation. A job is performed only if its class is active; the setup consumes time, so it adds to the job times in the capacity constraint. The equality would impose a single job per class; the last one gives time away instead of consuming it.
mip-f-468 · level teorema · notes
Class setups (maximum profit, $x_j \le y_c$ for the jobs of class $c$, setup cost $f_c \ge 0$). The constraint $\sum_{j \in \mathscr{J}_c} x_j \ge y_c$ («an activated class performs at least one job») is added. What can be said?
  1. It is necessary: without it the model is wrong
  2. It is not valid (the model admits an activated empty class) but it preserves optimality: activating an empty class costs without yielding
  3. It changes the optimum, because it forbids optimal solutions
  4. It is valid and strengthens the relaxation
Explanation. An activated class without jobs is feasible in the model, so the constraint is not valid; but it is never better than the same solution with $y_c = 0$, so at least one optimal solution survives.
mip-f-469 · level ipotesi · notes
One machine, jobs divided into classes (maximum revenue). The availability drops by $u > 0$ minutes **if and only if** jobs of at least two classes are performed; the binary $z$ equals $1$ when the reduction applies. Which of the two directions must be imposed by a constraint, and why?
  1. Both, always, because it is an if and only if
  2. «Two classes used ⇒ $z = 1$»: the objective prefers $z = 0$ (more time), so optimisation does not guarantee this direction
  3. «$z = 1$ ⇒ two classes used»: without it the solver would set $z = 1$ to gain time
  4. Neither: the objective imposes both directions
Explanation. The reduction is a penalty: left free, $z$ would stay at $0$. So the constraint forcing it to $1$ when two classes are active is needed; the reverse direction is guaranteed at the optimum, because $z = 1$ for no reason only removes time.
mip-f-470 · level facile · notes
Total tardiness on one machine: $s_{ij} = 1$ if $j$ precedes $i$ (with $s_{ij} + s_{ji} = 1$). What role do the transitivity inequalities $s_{ji} + s_{ik} - s_{jk} \le 1$ («if $i$ precedes $j$ and $k$ precedes $i$, then $k$ precedes $j$») play?
  1. They are valid (a cycle of precedences is impossible in a sequence) and cut fractional solutions of the relaxation
  2. They are necessary: without them the model admits integer cyclic sequences
  3. They preserve optimality but are not valid
  4. They worsen the relaxation
Explanation. Every real sequence respects them, so they are valid; in the relaxation the $s$ may equal $1/2$ and these inequalities cut those points. With the big-M constraints on completions integer cycles are already excluded.
mip-f-521 · level ipotesi · notes
Assignment with availabilities and constraints $\sum_m x_{jm} = 1$. A student adds $x_{jm} \le 1$ «to strengthen the relaxation». What is obtained?
  1. An infeasible model
  2. A different integer optimum
  3. A stronger relaxation, because points with $x_{jm} > 1$ are removed
  4. Nothing: those constraints are implied by the assignment with $x \ge 0$, so the relaxation does not change
Explanation. With $x \ge 0$ and sum $1$ on every row each $x_{jm}$ is already at most $1$: the constraints are valid but redundant also in the relaxation.
mip-f-552 · level ipotesi · notes
Total tardiness on one machine: $\tau_j \ge \kappa_j - d_j$ and $\tau_j \ge 0$, minimising $\sum_j \tau_j$. A student omits $\tau_j \ge 0$. What happens?
  1. Early jobs would get $\tau_j < 0$ and «offset» the delays: net lateness would be minimised, not total tardiness
  2. Nothing: $\tau_j$ is non-negative at the optimum anyway
  3. The model becomes infeasible
  4. The maximum tardiness is minimised
Explanation. Tardiness is $\max\{0, \kappa_j - d_j\}$: both constraints are needed, and minimisation brings $\tau_j$ to the larger of the two. Without the zero, earliness becomes a reward.
mip-f-553 · level ipotesi · notes
Job selection on fixed-cost machines (maximum profit): $x_{jm} = 1$ if job $j$ runs on machine $m$, with $\sum_m x_{jm} \le 1$. A student writes $\sum_m x_{jm} = 1$. What is the effect?
  1. It weakens the relaxation without changing the optimum
  2. It allows a job on two machines
  3. None: with binaries it is the same
  4. It makes all jobs mandatory: the problem no longer chooses which to perform and the optimum may worsen (or the model become infeasible)
Explanation. «At most one machine» leaves the choice of not performing the job; the equality removes it. It is the «all jobs mandatory» variant, which costs profit.

8. Location and covering (18)

mip-f-126 · level facile · notes
Capacitated facility location: $x_l = 1$ if site $l$ is installed (capacity $u_l$, cost $i_l > 0$), $y_{lc} \ge 0$ are the litres shipped from $l$ to customer $c$. The constraint $u_l x_l - \sum_c y_{lc} \ge 0$ does two things. Which ones?
  1. It meets the customers' demand and imposes the capacity of the site
  2. It imposes the capacity of the site and forces every installed site to ship something
  3. It links shipments to installation (nothing leaves a closed site) and imposes the capacity of the site
  4. It meets the customers' demand and links shipments to installation
Explanation. With $x_l = 0$ it gives $\sum_c y_{lc} \le 0$, with $x_l = 1$ it gives $\sum_c y_{lc} \le u_l$: aggregated activation with the right coefficient. That an open site ships something follows from optimality, since $i_l > 0$.
mip-f-127 · level facile · notes
p-median: at most $k$ open sites ($x_l = 1$), every customer $c$ assigned to a site ($y_{lc} = 1$), the sum of distances is minimised; there are no opening costs. The link $x_l \ge y_{lc}$ is imposed. What can be said about the direction "open site $\Rightarrow$ serves at least one customer"?
  1. It follows from the CNF of $y_{lc} \Rightarrow x_l$, which gives both directions
  2. It holds in every optimum, because the distances are strictly positive
  3. It is neither imposed nor guaranteed by optimality: nothing discourages an unused open site
  4. It is imposed by the constraint $\sum_l x_l \le k$ on the number of sites
Explanation. The CNF of $y_{lc} \Rightarrow x_l$ only gives $x_l \ge y_{lc}$. Without an opening cost the exchange "close an empty site" does not improve the objective.
mip-f-128 · level facile · notes
Signal coverage: $x_l = 1$ if site $l$ is installed ($m$ candidate sites), $y_c = 1$ if customer $c$ is covered, and $\mathscr{L}_c$ are the sites giving $c$ a strong signal. What does $\sum_{l \in \mathscr{L}_c} x_l + (m - 1)\, y_c \le m$ impose when $y_c = 1$?
  1. At most $m - 1$ strong sites installed for customer $c$
  2. No strong site installed for customer $c$
  3. At most one strong site installed for customer $c$
  4. At least one strong site installed for customer $c$
Explanation. With $y_c = 1$ what remains is $\sum_{l \in \mathscr{L}_c} x_l \le 1$ (not too much interference); with $y_c = 0$ it is $\le m$, which forbids nothing.
mip-f-129 · level facile · notes
Hubs with maximum cost: $y_j = 1$ if hub $j$ is active, $x_{ij} = 1$ if terminal $i$ goes to $j$, and $z_j \ge c_{ij} x_{ij}$ is the hub's largest connection cost, minimised. With $M_j = \max_i c_{ij}$, the added constraint $z_j \le M_j y_j$ is:
  1. A valid inequality that strengthens the linear relaxation
  2. Not valid (the model admits $z_j > 0$ with $y_j = 0$), but it preserves optimality
  3. Necessary for the model to compute the cost correctly
  4. Redundant, because implied by the maximum constraints $z_j \ge c_{ij} x_{ij}$
Explanation. Minimising $z_j$, an optimum sets it to zero anyway when the hub is off: the constraint cuts off feasible solutions but no optimum.
mip-f-130 · level facile · notes
Hubs with capacity $k$ terminals: the aggregated link is $\sum_i x_{ij} \le k\, y_j$. The disaggregated links $x_{ij} \le y_j$ are **added** as well. What happens to the integer optimum and to the linear relaxation (with bounds)?
  1. The integer optimum goes up, the relaxation does not change
  2. Neither the integer optimum nor the relaxation changes
  3. Both go up, because the model has more constraints
  4. The integer optimum does not change, the relaxation goes up
Explanation. The disaggregated links are implied by the aggregated constraint on integer points, not in the relaxation: adding them leaves the optimum untouched and strengthens the relaxation (in a minimisation, raises it).
mip-f-131 · level facile · notes
p-median without opening costs: the constraint is "at most $k$ open sites", $\sum_l x_l \le k$, with $k$ not exceeding the number of candidate sites. What changes by writing "exactly $k$"?
  1. Nothing on the optimal value: opening one more site lengthens no distance
  2. The problem becomes infeasible, because the extra sites stay empty
  3. The linear relaxation becomes integer
  4. The optimal value always gets worse, because useless sites are opened
Explanation. Without opening costs an extra site can only shorten the distances (every customer picks the closest), so there exists an optimum with $k$ open sites: the two forms give the same value.
mip-f-132 · level teorema · notes
Hubs with activation costs $f_j \ge 0$ (possibly zero), link $\sum_i x_{ij} \le k\, y_j$, minimisation problem. Which statement about the direction "activated hub $\Rightarrow$ serves at least one terminal" is correct?
  1. It is imposed by the aggregated activation constraint in every feasible solution
  2. It holds in every optimum whatever $f_j \ge 0$ is, because an empty hub is useless
  3. It is not imposed by the constraints; if $f_j > 0$ it holds in every optimum, if $f_j = 0$ only in some optimum
  4. It never holds, because the maximum cost $z_j$ may stay positive
Explanation. $y_j = 1$ with all $x_{ij} = 0$ is feasible. The exchange "switch off an empty hub" strictly improves only if $f_j > 0$: the strength of the conclusion depends on the sign of the coefficient.
mip-f-133 · level ipotesi · notes
Signal coverage, maximisation: $y_c = 1$ if customer $c$ is covered, with profit $p_c$; two link constraints impose "$y_c = 1 \Rightarrow$ enough signal and not too much interference". To prove that if both conditions hold then $y_c = 1$ **in every optimum**, what is needed?
  1. That the customer have at least one candidate site with a strong signal
  2. The constraint $\sum_l x_l \le k$ on the number of installed sites
  3. $p_c > 0$ and the fact that $y_c$ appears only in those two constraints, which stay satisfied when it is raised
  4. $p_c \ge 0$ and the fact that $y_c$ appears only in those two constraints, which stay satisfied when it is raised
Explanation. Raising $y_c$ to $1$ stays feasible (both conditions hold) and strictly increases the objective by $p_c > 0$. With $p_c = 0$ one would only get "there exists an optimum".
mip-f-175 · level facile · notes
p-median (minimisation, at most $k$ sites, every customer to its assigned open site): a feasible dual solution is obtained by giving each customer the value $\bar\mu_c = \min_l d_{lc}$, the distance to the closest site overall. With minimum distances per customer $3$, $6$ and $4$, which bound is obtained?
  1. $\ub = 13$
  2. $\lb = 6$
  3. $\lb = 13$
  4. $\lb = 4$
Explanation. The value is $3 + 6 + 4 = 13$: "every customer travels at least its minimum distance", as if all sites were open. In a minimisation it is a lower bound.
mip-f-176 · level facile · notes
p-median with $k = 2$ and three candidate sites; site-customer distances $d_{lc}$, rows by site: site 1 $(5, 6, 10)$, site 2 $(3, 12, 9)$, site 3 $(10, 9, 4)$. Sites 1 and 2 are opened and every customer goes to the closest open one. What value is obtained?
  1. $13$
  2. $15$
  3. $18$
  4. $21$
Explanation. Customer 1: $\min(5, 3) = 3$; customer 2: $\min(6, 12) = 6$; customer 3: $\min(10, 9) = 9$. Total $18$, an upper bound. Opening 1 and 3 gives $\min(5,10) + \min(6,9) + \min(10,4) = 5 + 6 + 4 = 15$, which is the optimum.
mip-f-177 · level facile · notes
Capacitated facility location (minimisation): site $l$ with installation cost $i_l$ and capacity $u_l$, transport $t_{lc}$ per litre. The dual recipe "spreads" the fixed cost over the capacity: $\bar\mu_l = i_l / u_l$. With $i_l = 60$ and $u_l = 50$, how much does it cost per litre, in that recipe, to serve a customer from site $l$ with $t_{lc} = 4$?
  1. $4$
  2. $26/5$
  3. $6/5$
  4. $64$
Explanation. Every litre pays the transport plus its share of the fixed cost: $t_{lc} + \bar\mu_l = 4 + 60/50 = 26/5$. The dual value of the customer is the minimum of this sum over the sites.
mip-f-178 · level facile · notes
Capacitated facility location: the demand $d_c$ of customer $c$ must be met exactly, with continuous shipments $y_{lc} \ge 0$ from the sites $l$. Which constraint expresses it?
  1. $\sum_l y_{lc} \le d_c$ for every customer $c$
  2. $\sum_l y_{lc} = d_c$ for every customer $c$
  3. $\sum_c y_{lc} = d_c$ for every site $l$
  4. $y_{lc} = d_c\, x_l$ for every pair $(l, c)$
Explanation. One sums over all the sites serving customer $c$: the total received is its demand. The last option would force every open site to serve the whole demand of every customer.
mip-f-179 · level ipotesi · notes
p-median: besides the links $x_l \ge y_{lc}$ one considers $\sum_c y_{lc} \le n\, x_l$ ($n$ customers). To declare it a **valid inequality** weaker than the disaggregated links, what must be shown?
  1. That it is obtained by summing the links $y_{lc} \le x_l$ over the customers, and that a fractional point satisfies it while violating one of them
  2. That the relaxation with it coincides with the relaxation with the disaggregated links
  3. That it is satisfied by at least one optimal solution, even if it cuts off other feasible ones
  4. That it cuts off the optimal solution of the linear relaxation and keeps at least one integer optimum
Explanation. A sum of valid constraints, hence valid; and $y_{l1} = 1$, $x_l = 1/n$ satisfies it but violates $y_{l1} \le x_l$: in the relaxation it is weaker.
mip-f-234 · level teorema · notes
Capacitated location: $x_l = 1$ if site $l$ is installed (capacity $u_l$), $y_{lc} \ge 0$ litres shipped from $l$ to customer $c$, with $\sum_l y_{lc} = d_c$ and $u_l x_l - \sum_c y_{lc} \ge 0$. Which statement about the constraint $y_{lc} \le d_c x_l$ is correct?
  1. It is valid only if every site has capacity $u_l \ge \sum_c d_c$
  2. It is redundant even in the relaxation, because implied by the capacity constraint
  3. It preserves the optimum but is not valid: it cuts off feasible shipments above $d_c$
  4. It is valid: with $x_l = 0$ it follows from $\sum_c y_{lc} \le 0$, with $x_l = 1$ from the demand; it can strengthen the relaxation
Explanation. It holds on every integer solution: closed site, no shipment; open site, $y_{lc} \le \sum_{l'} y_{l'c} = d_c$. In the continuous problem a fractional $x_l$ can satisfy the aggregated capacity and violate $y_{lc} \le d_c x_l$: it is a cut.
mip-f-471 · level facile · notes
Coverage with signal and interference (maximum profit): a customer $c$ is covered if the total signal of the installed sites is at least $t = 5$. Customer 5 receives from the three candidate sites the signals $1$, $0$, $2$. What can be done before solving?
  1. Open all three sites to cover it
  2. Lower the threshold $t$ for that customer
  3. Nothing: the solver will find out by itself
  4. Fix its coverage variable to zero: even opening all sites it receives $3 < 5$
Explanation. A data check: the maximum possible signal is $1 + 0 + 2 = 3 < 5$, so the customer can never be covered and its variable can be fixed to zero, without changing the optimum.
mip-f-472 · level facile · notes
Coverage with signal and interference: a customer is covered if, among other things, **at most one** installed site generates a signal $\ge b$ for it; $\mathscr{L}_c$ is the set of sites generating a signal $\ge b$ for $c$, $x_l = 1$ if site $l$ is installed, $w_c = 1$ if $c$ is covered. For which customers is the interference constraint redundant?
  1. For none: the constraint is always needed
  2. For those with $|\mathscr{L}_c| \ge 2$
  3. For those with $|\mathscr{L}_c| \le 1$: they cannot receive two strong signals
  4. For those with the lowest profit
Explanation. If at most one site can give a strong signal, «at most one strong site installed» is always true and the constraint cuts nothing: it can be omitted for those customers.
mip-f-473 · level ipotesi · notes
Hubs with capacity and maximum connection cost (minimisation): $y_j = 1$ if hub $j$ is active, $z_j \ge c_{ij} x_{ij}$ is the hub's maximum connection cost, and the objective sums activation costs and the $z_j$. With $M_j = \max_i c_{ij}$ the constraint $z_j \le M_j y_j$ is added. How should it be classified?
  1. It is a valid inequality
  2. It preserves optimality but is not valid: the model admits $z_j > 0$ with $y_j = 0$, which is never convenient when minimising
  3. It excludes the optimum
  4. It is necessary for the model to be correct
Explanation. $z_j$ is pushed down by the objective: with the hub off it is $0$ at the optimum. The constraint removes feasible solutions with $z_j > 0$ and the hub off (so it is not valid), but none of them is optimal.
mip-f-522 · level teorema · notes
Capacitated location (minimum cost): $x_l = 1$ if site $l$ is installed, $y_{lc} \ge 0$ litres sent from $l$ to customer $c$, with $\sum_c y_{lc} \le u_l x_l$ and $\sum_l y_{lc} = d_c$. The constraint $y_{lc} \le d_c x_l$ is valid. Why is it not needed for correctness?
  1. Because it is false: a customer may receive more than its demand
  2. Because it makes the model infeasible
  3. It is implied by the two constraints together on integer points: with the site closed nothing leaves, and no customer receives more than its demand
  4. Because the $y$ are binary
Explanation. With $x_l = 0$ the capacity zeroes the site's flows; with $x_l = 1$ demand limits each flow to $d_c$. In the relaxation it may still strengthen (disaggregated form).

9. Production planning (15)

mip-f-134 · level facile · notes
Lot sizing with a fixed cost over $4$ periods: demands $d = (30, 20, 40, 10)$, initial stock $r_0 = 0$, required final stock $r_n = 0$; $x_t$ is the production and $y_t = 1$ if production is set up in period $t$. What is the smallest $M_3$ in the constraint $x_3 \le M_3\, y_3$ that cuts off no optimal solution?
  1. $100$
  2. $40$
  3. $70$
  4. $50$
Explanation. At an optimum one never produces more than the remaining demand: $M_3 = d_3 + d_4 + r_n = 40 + 10 = 50$. A larger value is valid but weakens the relaxation; a smaller one may cut off optimal solutions.
mip-f-135 · level facile · notes
Lot sizing: $x_t \ge 0$ is the production of period $t$, $y_t = 1$ if set up (fixed cost $q_t > 0$), with the constraint $x_t \le M_t\, y_t$, minimisation problem. What holds?
  1. $x_t = 0 \Rightarrow y_t = 0$ is imposed; $y_t = 0 \Rightarrow x_t = 0$ holds in every optimum
  2. $y_t = 0 \Rightarrow x_t = 0$ is imposed; $x_t = 0 \Rightarrow y_t = 0$ holds in every optimum
  3. Both directions are imposed by the constraint $x_t \le M_t\, y_t$
  4. $y_t = 0 \Rightarrow x_t = 0$ is imposed; $x_t = 0 \Rightarrow y_t = 0$ holds only in some optimum
Explanation. The constraint says "no setup, no production"; the opposite direction comes from optimality, because setting $y_t = 0$ saves $q_t > 0$. With $q_t = 0$ one would only say "there exists an optimum".
mip-f-136 · level facile · notes
Production and workforce, no layoffs: $m_0$ initial workers, $y_t$ workers in service in month $t$ (first formulation), $z_t$ workers hired at the start of month $t$ (second formulation). Which correspondence links the two formulations?
  1. $y_t = m_0 + \sum_{j=1}^{t} z_j$, i.e. $z_t = y_t - y_{t-1}$ with $y_0 = m_0$
  2. $z_t = y_t + y_{t-1}$ with $y_0 = m_0$
  3. $y_t = z_t$ for every month $t$
  4. $y_t = m_0 + z_t$ for every month $t$
Explanation. The workers of a month are the initial ones plus all those hired up to that month. $y_t = m_0 + z_t$ would forget the hirings of previous months.
mip-f-137 · level facile · notes
Production and workforce: in the formulation with the workforce $y_t$ (workers in service) the ban on layoffs is $y_t \ge y_{t-1}$. What does it correspond to in the formulation with the hirings $z_t = y_t - y_{t-1}$?
  1. To the constraints on the available working hours
  2. To the non-negativity of the $z_t$: the ban is hidden in the domain
  3. To no constraint: the two formulations are not equivalent
  4. To the inventory balance constraints
Explanation. With $z_t = y_t - y_{t-1}$, the condition $z_t \ge 0$ is exactly $y_t \ge y_{t-1}$. This is why the hiring formulation has fewer constraints.
mip-f-138 · level facile · notes
Vehicles with a minimum lot: type $j$ consumes $a_{ij} \ge 0$ units of resource $i$, available in quantity $b_i$. How is the maximum producible quantity $M_j$ of type $j$ alone, used in $x_j \le M_j y_j$, computed?
  1. $M_j = \max_i \lfloor b_i / a_{ij} \rfloor$ over the resources the type consumes
  2. $M_j = \sum_i \lfloor b_i / a_{ij} \rfloor$ over the resources the type consumes
  3. $M_j = \min_i \lfloor b_i / a_{ij} \rfloor$ over all resources, including those with $a_{ij} = 0$
  4. $M_j = \min \{\lfloor b_i / a_{ij} \rfloor : a_{ij} > 0\}$, over the resources the type consumes only
Explanation. Type $j$ alone is limited by the scarcest resource among those it consumes; a resource with $a_{ij} = 0$ does not limit it, and dividing by zero makes no sense. The maximum or the sum would not be tight upper bounds.
mip-f-139 · level facile · notes
Vehicles: $y_j = 1$ if type $j$ is produced (at least at the minimum lot). The bonus $\bar r > 0$ is earned if at least two types are produced; the binary $z = 1$ gives the bonus in a maximisation. Which constraint imposes "$z = 1 \Rightarrow$ at least two active types"?
  1. $\sum_j y_j \le 2z$
  2. $z \le y_1 + y_2$
  3. $z \ge \sum_j y_j - 1$
  4. $2z \le \sum_j y_j$
Explanation. With $z = 1$ at least two active types are needed, which by the minimum lot are really produced. The opposite direction is not imposed: it follows from optimality because $\bar r > 0$. $z \le y_1 + y_2$ would accept a single type.
mip-f-140 · level teorema · notes
Two formulations of the same problem are equivalent on integer points (there is a correspondence between their integer solutions with the same cost, up to a constant). Which statement is correct?
  1. They do not always have the same linear relaxation: it must be checked case by case
  2. They always have the same objective function, constants included
  3. The one with fewer constraints always has the stronger linear relaxation
  4. They always have the same linear relaxation, because they describe the same problem
Explanation. Equivalence on integers says nothing about the continuum; in some cases the relaxations coincide, but it is a check, not a given. And the objective functions may differ by a constant.
mip-f-141 · level ipotesi · notes
Vehicles: the binary $z$ gives the bonus $\bar r$ in a maximisation, with the single constraint $2z \le \sum_j y_j$. To prove that with at least two active types $z = 1$ **in every optimum**, what is needed?
  1. $\bar r \ge 0$ and the fact that raising $z$ to $1$ keeps $2z \le \sum_j y_j$ satisfied
  2. $\bar r > 0$ and the fact that raising $z$ to $1$ keeps $2z \le \sum_j y_j$ satisfied
  3. That the unit profits $\bar p_j$ of all types be positive
  4. The minimum lot constraints $x_j \ge \bar q_j y_j$ and $\bar r > 0$
Explanation. With two active types raising $z$ stays feasible and strictly increases the objective by $\bar r$. With $\bar r = 0$ the argument fails and $z$ stops being a faithful indicator.
mip-f-180 · level facile · notes
Lot sizing over $n$ periods: $x_t$ production, $s_t$ stock at the end of period $t$, $d_t$ demand, initial stock $r_0$. What is the balance constraint of the first period?
  1. $x_1 - s_1 = d_1 + r_0$
  2. $x_1 + s_1 = d_1 + r_0$
  3. $x_1 - s_1 = d_1 - r_0$
  4. $x_1 = d_1$
Explanation. What comes in ($r_0 + x_1$) equals what goes out ($d_1$) plus what remains ($s_1$): $r_0 + x_1 = d_1 + s_1$, i.e. $x_1 - s_1 = d_1 - r_0$. $x_1 = d_1$ would forbid producing in advance.
mip-f-181 · level facile · notes
Lot sizing with setup $f = 50$ and holding $h = 1$ per unit and period, demands $d = (20, 10)$, no initial stock. Plan A: one setup in period 1 covering both periods. Plan B: one setup per period. What do the two plans cost (excluding the unit production cost, equal for both)?
  1. A $70$, B $100$
  2. A $50$, B $100$
  3. A $60$, B $50$
  4. A $60$, B $100$
Explanation. A pays one setup ($50$) and holds $10$ units for one period ($10$): $60$. B pays two setups: $100$. $50$ forgets the holding, $70$ charges holding on $20$ units instead of $10$.
mip-f-182 · level facile · notes
"Just in time" production: every month exactly the demand is produced and the minimum number of workers needed is hired. With $160$ hours a month per worker and $4$ hours per pair, how many workers are needed for $100$ pairs in a month?
  1. $2$
  2. $25$
  3. $5/2$
  4. $3$
Explanation. One needs $4 \cdot 100 = 400$ hours, and $400/160 = 2.5$: workers are counted, so $\lceil 2.5 \rceil = 3$. The fractional value is what the relaxation would use.
mip-f-183 · level teorema · notes
Lot sizing with a fixed cost: $M_t = \sum_{\tau \ge t} d_\tau + r_n$ in the constraint $x_t \le M_t\, y_t$ is replaced by a larger value, for instance $10 M_t$. Which statement is correct?
  1. The integer optimum does not change and the linear relaxation gets stronger
  2. The integer optimum changes, because larger quantities can be produced
  3. The integer optimum does not change and the linear relaxation gets weaker
  4. The model becomes infeasible for the periods with zero demand
Explanation. A larger valid $M$ neither removes nor adds optimal solutions, but in the relaxation $y_t = x_t/(10 M_t)$ suffices and the fixed cost paid collapses: the bound gets worse.
mip-f-235 · level ipotesi · notes
Production and workforce without layoffs: formulation A uses the workforce $y_t$ with $y_t \ge y_{t-1}$, formulation B the hirings $z_t \ge 0$; $y_0 = m_0$ initial workers. To prove that A and B are equivalent on the integer points, what is needed?
  1. The correspondence $z_t = y_t - y_{t-1}$, one-to-one between integer solutions, preserving feasibility and the cost up to a constant
  2. That the two formulations have the same number of variables and constraints
  3. That the two linear relaxations have the same optimal value
  4. That the hiring cost is zero, so that the two objectives coincide
Explanation. Equivalence on the integer points: to every integer solution of one corresponds a feasible one of the other, with the same cost up to a constant. $z_t \ge 0$ translates exactly $y_t \ge y_{t-1}$. The relaxations are compared separately.
mip-f-474 · level facile · notes
Vehicle production with minimum quantity $\bar q_j$ if type $j$ is produced and big-M: $\bar q_j y_j \le x_j \le M_j y_j$. How is $M_j$ chosen in the course?
  1. The maximum producible quantity of type $j$ alone with the available resources
  2. A large constant equal for all, for example $10^6$
  3. The minimum quantity $\bar q_j$
  4. The maximum producible quantity of the whole plan
Explanation. $M_j = \min_i \lfloor b_i / a_{ij} \rfloor$ (resources permitting) is the tightest value that cuts no solutions: it strengthens the relaxation compared with an arbitrary constant. If $\bar q_j > M_j$ the type would be eliminated.
mip-f-523 · level ipotesi · notes
Production with a diversification bonus: the binary $z$ equals $1$ if at least two types are produced, and brings the bonus $\bar r > 0$ in a maximisation; $y_j = 1$ if type $j$ is produced. A student writes only $2z \le \sum_j y_j$. Is it enough?
  1. No: the constraint allows the bonus with a single type
  2. No: $z$ must be a general integer, not binary
  3. Yes: the constraint forbids the bonus with fewer than two types, and the objective brings $z$ to $1$ as soon as allowed
  4. No: $z \ge \sum_j y_j - 1$ is also needed, otherwise the bonus is never collected
Explanation. The direction «bonus ⇒ at least two types» is imposed by the constraint; the reverse is guaranteed by the positive coefficient of $z$ in a maximisation. One constraint, one binary.

10. Mixed problems (38)

mip-f-142 · level facile · notes
Rewards of a loyalty scheme: every reward $i$ is taken with points only ($x_i = 1$) or with a cash contribution ($y_i = 1$), in at most one way: $x_i + y_i \le 1$. Which statement is correct?
  1. If the reward is not taken with points, then it is taken with a contribution
  2. The constraint forces every reward to be taken in one of the two ways
  3. The constraint admits only the configurations $(1,0)$ and $(0,1)$
  4. The constraint forbids only $(1,1)$: $(0,0)$ is allowed too, so $x_i = 0$ does not imply $y_i = 1$
Explanation. It is a set packing: three configurations allowed. Forcing every reward to be taken would require the equality $x_i + y_i = 1$, a partitioning, and the problem would change.
mip-f-143 · level facile · notes
Combinatorial auction: $x_j = 1$ if bid $j$ (on the set of items $B_j$) is accepted; every item is sold at most once. Why is one constraint per item written, $\sum_{j : i \in B_j} x_j \le 1$, instead of $x_j + x_{j'} \le 1$ for every pair of conflicting bids?
  1. Because the pairwise constraints would give a different set of integer solutions
  2. Because the pairwise constraints need auxiliary variables for every conflict
  3. Because the per-item constraint always makes the linear relaxation integer
  4. It has fewer constraints and is tighter: three bids on the same item cannot be worth $1/2$ each
Explanation. The two forms have the same integer points; per item there are as many constraints as items instead of a number growing like the square of the bids, and $x_1 = x_2 = x_3 = 1/2$ satisfies the pairs but not the row.
mip-f-144 · level facile · notes
"Triangle" auction: three items and three bids of profit $1$, each on two different items, so that every pair of bids shares an item. What are the linear relaxation $\zlp$ and the integer optimum $\zmilp$ (maximisation)?
  1. Both $3/2$
  2. $\zlp = 3$ and $\zmilp = 1$
  3. $\zlp = 3/2$ and $\zmilp = 1$
  4. Both $1$
Explanation. With $x = 1/2$ on all three bids every item is sold "once" and the value is $3/2$; any two bids share an item, so the integer optimum accepts only one.
mip-f-145 · level facile · notes
Diet: $x_i$ kilos of food $i$, $y_i = 1$ if the food is in the diet, with $x_i \le d_i y_i$; the diet must use at least $t$ different foods, $\sum_i y_i \ge t$. Why is the minimum lot $x_i \ge c_i y_i$ with $c_i > 0$ also needed?
  1. To make the linear relaxation of the model exact
  2. To respect the upper limits on the intake of the nutrients
  3. Without it, indicators with $x_i = 0$ would be switched on and the variety would be met by foods not eaten
  4. Because otherwise the model is infeasible when $t$ is large
Explanation. The count looks at the indicators, not at the quantities: with $y_i = 1$ the minimum lot guarantees $x_i \ge c_i > 0$. Without it, the cost drops by switching on foods "at zero quantity".
mip-f-146 · level facile · notes
Decorated trees: $x_c \in \mathbb{Z}_{\ge 0}$ counts the trees decorated with configuration $c$, and the binary $z_c$ must equal $1$ only if the configuration is really used (at least $f$ different configurations are required, $\sum_c z_c \ge f$). Which constraint is used?
  1. $z_c \ge x_c$
  2. $z_c \le x_c$, with no big-M
  3. $x_c \le M z_c$, with $M$ the number of trees
  4. $x_c + z_c \le 1$
Explanation. Since $x_c$ is an integer count, $z_c = 1$ directly imposes $x_c \ge 1$. $x_c \le M z_c$ is the link in the other direction, which does not prevent counting empty configurations; $z_c \ge x_c$ would forbid more than one tree.
mip-f-147 · level facile · notes
Shipments in boxes of capacity $w$: $x_{psc}$ units of product $p$ from plant $s$ to customer $c$, and $y_{sc} \in \mathbb{Z}_{\ge 0}$ boxes on the route, with $\sum_p x_{psc} \le w\, y_{sc}$. What does it impose on $y_{sc}$?
  1. $y_{sc} \in \{0, 1\}$: one box per route
  2. $y_{sc} \le \lfloor \sum_p x_{psc} / w \rfloor$
  3. $y_{sc} = \sum_p x_{psc} / w$, possibly fractional
  4. $y_{sc} \ge \lceil \sum_p x_{psc} / w \rceil$: integrality produces the ceiling
Explanation. It is the integer count: the constraint gives $y_{sc} \ge \sum_p x_{psc} / w$ and integrality rounds up. That no empty boxes travel follows from optimality, since the number of boxes is minimised.
mip-f-148 · level facile · notes
Children in summer camps: in every camp $j$ nationality $c$ must have at least as many children as **each** other one, i.e. $n_{cj} \ge n_{ij}$ for every $i \ne c$ ($n_{ij}$ children of nationality $i$ in camp $j$). What is the difference with the single constraint $n_{cj} \ge \sum_{i \ne c} n_{ij}$?
  1. The single constraint is weaker, because it is one instead of many
  2. No difference, for any number of nationalities
  3. The single constraint admits camps in which $c$ is outnumbered by another nationality
  4. With more than two nationalities the single constraint is stronger: it asks that $c$ exceed all the others together
Explanation. The two readings coincide with two nationalities and diverge with more than two, where the single constraint cuts off solutions the statement allows. Fewer constraints do not mean the right model.
mip-f-149 · level facile · notes
Branches between two companies: $x_i = 1$ if branch $i$ goes to company $A$, otherwise to $B$; one minimises $z$, the maximum over the products of the revenue difference between $A$ and $B$ (in absolute value). Why is the linear relaxation worth $0$?
  1. Because the variable $z$ is free and the relaxation drives it to $-\infty$, then to $0$
  2. Because the model has a single family of binary variables
  3. With $x_i = 1/2$ every branch is split in half and the revenues of the two companies coincide on every product
  4. Because the revenues are all non-negative and $z$ is bounded below
Explanation. A fractional solution puts half of every branch in each company and evens everything out. The useful bound, here, is combinatorial: it comes from integrality.
mip-f-150 · level teorema · notes
Tracks onto CDs: $x_{ij} = 1$ if track $i$ (duration $d_i$) goes on CD $j$; one minimises $y - z$ with $y \ge \sum_i d_i x_{ij}$ and $z \le \sum_i d_i x_{ij}$ for every CD $j$. Which statement is correct?
  1. The constraints already impose $y$ equal to the duration of the longest CD
  2. At the optimum $z$ is $0$, because it is bounded only from above
  3. Minimising $y - z$ is equivalent to minimising $y$ alone
  4. The constraints give $y \ge$ largest duration and $z \le$ smallest duration, and at the optimum the equalities hold
Explanation. It is the maximum variable applied twice, in opposite directions: the objective pushes $y$ down and $z$ up. Minimising $y$ alone is the makespan, with different optima.
mip-f-151 · level ipotesi · notes
Books onto shelves: $x_{bs} = 1$ if book $b$ (height $h_b$) goes on shelf $s$, and $y_s$ is the height of the shelf, with $\min \sum_s y_s$. To prove that in every optimum $y_s$ is the height of the tallest book on the shelf, what is needed?
  1. The constraints $y_s \ge h_b\, x_{bs}$, the coefficient $1 > 0$ of $y_s$ in the minimisation and $y_s$ absent from every other constraint
  2. A big-M equal to the largest height and the constraints $y_s \ge h_b\, x_{bs}$
  3. The width constraints of the shelves and the coefficient $1 > 0$ of $y_s$ in the minimisation
  4. The constraints $y_s \ge h_b\, x_{bs}$ and $y_s$ absent from every other constraint, whatever the coefficient
Explanation. The constraint gives $y_s \ge \max_{b : x_{bs} = 1} h_b$; since $y_s$ costs in the objective and appears nowhere else, lowering it to the maximum stays feasible and strictly improves.
mip-f-184 · level facile · notes
Combinatorial auction (maximisation): the heuristic sorts the bids by profit **per item** requested, $p_j / |B_j|$, decreasing (equal ratios in the listed order), and accepts those whose items are still free. Bids: $\{1\}$ for $6$, $\{1,3\}$ for $12$, $\{3,4\}$ for $12$, $\{2,4\}$ for $10$. Which set does it accept?
  1. $\{1,3\}$ and $\{3,4\}$, value $24$
  2. $\{1\}$ and $\{2,4\}$, value $16$
  3. $\{1,3\}$ and $\{2,4\}$, value $22$
  4. $\{1\}$ and $\{3,4\}$, value $18$
Explanation. The ratios are $6$, $6$, $6$ and $5$: with equal ratios the given order is followed. $\{1\}$ and then $\{3,4\}$ are accepted; $\{1,3\}$ and $\{2,4\}$ find items already sold. $\lb = 18$, while the optimum is $22$; the last option sells item 3 twice.
mip-f-185 · level facile · notes
Combinatorial auction (maximisation): in the dual of the relaxation $\lambda_i \ge 0$ is the price of item $i$, with $\sum_{i \in B_j} \lambda_i \ge p_j$ for every bid. The recipe $\bar\lambda_i = \max_{j : i \in B_j} p_j / |B_j|$ is feasible. Why divide by $|B_j|$?
  1. It spreads the bid's profit over its items: it stays feasible and gives a lower upper bound than without dividing
  2. To always obtain the optimal dual solution
  3. Without the division the dual solution would be infeasible
  4. To turn the bound into a lower bound instead of an upper bound
Explanation. $\bar\lambda_i = \max_j p_j$ is also feasible, but it charges a bid's profit to each of its items and inflates the bound. Dividing, $\sum_{i \in B_j} \bar\lambda_i \ge |B_j| \cdot p_j / |B_j| = p_j$ still holds, with lower prices.
mip-f-186 · level facile · notes
Tracks onto two CDs, minimising the duration difference: each track, in the given order, goes on the CD currently shorter (on equal durations on the first). With durations $(10, 7, 6, 5, 4, 3)$, what difference is obtained?
  1. $1$
  2. $3$
  3. $9$
  4. $0$
Explanation. $10 \to$ CD1, $7 \to$ CD2, $6 \to$ CD2 ($13$), $5 \to$ CD1 ($15$), $4 \to$ CD2 ($17$), $3 \to$ CD1 ($18$): durations $18$ and $17$, difference $1$. It is an upper bound; the total $35$ is odd, so $0$ is impossible and $1$ is optimal.
mip-f-187 · level ipotesi · notes
Branches between two companies, $\min z$ with $z \ge$ revenue difference on every product: the linear relaxation is worth $0$. To still obtain a positive lower bound on the integer optimum, what can one rely on?
  1. On the value of the constructive heuristic, which is a lower bound in minimisation problems
  2. On integrality: each branch goes wholly to one company, and product by product exact ties are limited
  3. On a feasible dual solution of the relaxation with a positive value
  4. On strong duality of the relaxation, which gives a bound equal to the integer optimum
Explanation. No feasible dual exceeds $\zlp = 0$; the useful bound is combinatorial and comes from indivisibility. For instance, a product sold by a single branch leaves a difference equal to its whole revenue.
mip-f-236 · level facile · notes
Loyalty programme prizes with $s = 3$ prizes: for each prize $x_i = 1$ (points only) and $y_i = 1$ (points plus contribution), with $x_i + y_i \le 1$ per prize, one points budget constraint and one minimum preference constraint. How many variables and how many constraints (domains excluded)?
  1. $3$ variables and $5$ constraints
  2. $6$ variables and $5$ constraints
  3. $6$ variables and $3$ constraints
  4. $6$ variables and $9$ constraints
Explanation. Two binaries per prize: $6$. Constraints: $3$ mutual exclusion, $1$ budget, $1$ preference, that is $5$. Forgetting budget and preference gives $3$; counting them once per prize gives $9$.
mip-f-237 · level teorema · notes
Diet: $x_i \ge 0$ kilos of food $i$, $y_i \in \{0,1\}$ food in the diet, with $x_i - c_i y_i \ge 0$ and $x_i - d_i y_i \le 0$ (minimum lot $c_i > 0$, cap $d_i$). Which statement is correct?
  1. In every feasible solution $c_i \le x_i \le d_i$, whatever $y_i$
  2. The two constraints make $x_i$ integer, because $y_i$ is binary
  3. If $c_i \le d_i$, in every feasible solution $x_i = 0$ or $c_i \le x_i \le d_i$; if $c_i > d_i$ the constraints force $y_i = 0$
  4. $x_i = 0$ implies $y_i = 1$, because the minimum lot is positive
Explanation. With $y_i = 0$ the constraints give $0 \le x_i \le 0$; with $y_i = 1$ they give $c_i \le x_i \le d_i$, an empty interval if $c_i > d_i$. It is the semicontinuous variable: $x_i$ stays continuous inside the interval.
mip-f-238 · level facile · notes
Decorated trees: $x_c$ trees with configuration $c$, which needs $u_{cl}$ lights of colour $l$; $y_b$ boxes of type $b$, which contains $v_{bl}$ lights of colour $l$. What does the constraint $\sum_b v_{bl}\, y_b - \sum_c u_{cl}\, x_c \ge 0$, written for every colour $l$, say?
  1. The lights of colour $l$ bought are enough for those needed by the decorated trees
  2. The number of boxes is at least the number of trees
  3. Every box bought must be used on at least one tree
  4. The lights of colour $l$ needed are enough to fill the boxes bought
Explanation. The first term counts the lights of colour $l$ in the boxes, the second those mounted on the trees: the non-negative difference says the purchase covers the need, colour by colour.
mip-f-239 · level facile · notes
Shipments in boxes: $k = 2$ products, $n = 2$ plants, $m = 3$ customers. Constraints: demand $\sum_s x_{psc} = d_{pc}$ per product–customer pair, availability $\sum_c x_{psc} \le a_{ps}$ per product–plant pair, capacity $\sum_p x_{psc} \le w\, y_{sc}$ per plant–customer route. How many constraints in total (domains excluded)?
  1. $18$
  2. $10$
  3. $12$
  4. $16$
Explanation. Demand $k m = 6$, availability $k n = 4$, capacity $n m = 6$: $16$. $12$ forgets availability; $18 = 6 + 12$ uses one capacity per triple and forgets availability.
mip-f-240 · level facile · notes
Children among summer camps: $s = 4$ nationalities, $r = 3$ camps; in every camp nationality $c$ must have at least as many children as each other one, with one constraint per pair (other nationality $i \ne c$, camp $j$). How many majority constraints?
  1. $18$
  2. $12$
  3. $9$
  4. $3$
Explanation. $(s - 1)\, r = 3 \cdot 3 = 9$: one constraint for every other nationality in every camp. $12 = s\,r$ includes comparing $c$ with itself; $18$ compares every pair of nationalities; $3$ writes only one per camp.
mip-f-241 · level facile · notes
Books on shelves: $x_{bs} = 1$ if book $b$ (height $h_b$) goes on shelf $s$, $y_s$ height of the shelf, $\min \sum_s y_s$. Why write $y_s \ge h_b\, x_{bs}$ for every pair $(b, s)$ instead of $y_s = \max_b h_b\, x_{bs}$?
  1. Because then $y_s$ can be declared binary
  2. Because $y_s = \max_b h_b x_{bs}$ would give an infeasible model
  3. Because the pairwise constraints already impose equality in every feasible solution
  4. The maximum is not linear; the pairwise constraints express it linearly and the minimum brings $y_s$ to the maximum
Explanation. It is the maximum variable in disaggregated form: the constraints give $y_s \ge$ height of the tallest book on the shelf, and the minimisation objective, where $y_s$ has a positive coefficient, pushes it onto that value.
mip-f-475 · level facile · notes
Rewards with two modes (minimum money): reward $i$ is obtained with $a_i$ points ($x_i = 1$) or with $b_i < a_i$ points plus $c_i$ euro ($y_i = 1$), at most once and in a single mode; available points $p$. Which constraints express mutual exclusion and the points budget?
  1. $x_i + y_i \le 1$ for every $i$, and $\sum_i (a_i x_i + b_i y_i) \le p$
  2. $x_i + y_i \le 2$ for every $i$, and $\sum_i (a_i + b_i)(x_i + y_i) \le p$
  3. $x_i \le y_i$ for every $i$, and $\sum_i (a_i x_i + b_i y_i) \le p$
  4. $x_i + y_i = 1$ for every $i$, and $\sum_i a_i x_i \le p$
Explanation. At most one mode per reward is a packing of two variables; the points spent depend on the chosen mode. The equality would force taking every reward.
mip-f-476 · level facile · notes
Rewards with two modes: points only ($a_i$ points) or $b_i < a_i$ points plus $c_i$ euro; money spent is minimised. If $c_i = 0$ for some reward, what can be done?
  1. Fix that reward to «taken»
  2. Eliminate the mode with contribution, which is useless
  3. Nothing: both modes remain necessary
  4. Eliminate the «points only» mode of that reward: the other costs the same euros and fewer points
Explanation. With $c_i = 0$ the second mode dominates the first (zero euro in both, fewer points): variable $x_i$ can be removed without losing optima. It is not implied that the reward is worth taking.
mip-f-477 · level facile · notes
Diet (minimum cost) with minimum lot and variety: $q_i \ge 0$ kilograms of food $i$, $y_i = 1$ if the food enters the diet, with at least $c_i$ and at most $d_i$ kilograms if chosen, and at least $t$ different foods. Which constraints express this?
  1. $c_i y_i \le q_i \le d_i y_i$ for every $i$, and $\sum_i y_i \ge t$
  2. $c_i \le q_i \le d_i$ for every $i$, and $\sum_i q_i \ge t$
  3. $c_i y_i \le q_i \le d_i y_i$ for every $i$, and $\sum_i y_i \le t$
  4. $q_i \le d_i y_i$ for every $i$, and $\sum_i y_i \ge t$
Explanation. Minimum lot (semicontinuous) plus counting of distinct types, with both thresholds: without $c_i y_i \le q_i$ a «chosen» food could have zero kilograms and count towards variety.
mip-f-478 · level facile · notes
The classical diet problem (Stigler, 1945) — minimum cost with lower and upper bounds on nutrients — is a pure LP. What makes it a MILP in the course version?
  1. The upper bounds on nutrients
  2. The fact that quantities are in kilograms
  3. The minimum lots for the chosen foods and the counting of different foods
  4. The cost per kilogram of the foods
Explanation. Nutrient bounds and costs stay linear and continuous. The two additions requiring binaries are the threshold «if eaten, at least $c_i$ kilograms» and the minimum number of different foods.
mip-f-479 · level facile · notes
Decorated trees (minimum cost): $x_c \in \mathbb{Z}_{\ge 0}$ trees with configuration $c$, which needs $u_{cl}$ lights of colour $l$; $z_b \in \mathbb{Z}_{\ge 0}$ boxes of type $b$, containing $v_{bl}$ lights of colour $l$. Which constraint guarantees enough lights?
  1. $v_{bl} z_b \ge u_{cl} x_c$ for every $b$, $c$, $l$
  2. $\sum_l \sum_b v_{bl} z_b \ge \sum_l \sum_c u_{cl} x_c$
  3. $\sum_b v_{bl} z_b \ge \sum_c u_{cl} x_c$ for every colour $l$
  4. $\sum_b z_b \ge \sum_c x_c$
Explanation. The lights bought of each colour must cover those required of that colour: one constraint per colour. Summing over colours would allow compensating one colour with another.
mip-f-480 · level facile · notes
Decorated trees (minimum cost), with the constraint $\sum_c x_c = q$ on the number of trees to decorate. What would happen writing it as $\le q$ or as $\ge q$?
  1. In both cases the optimum would stay the same
  2. With $\ge q$ the optimum would decorate infinitely many trees
  3. With $\le q$ the optimum would decorate nothing (zero cost); with $\ge q$ nothing would change, because decorating more costs more
  4. With $\le q$ nothing would change; with $\ge q$ the problem would become infeasible
Explanation. In a minimisation with positive costs the objective pushes the number of trees down: with $\le q$ down to zero; with $\ge q$ it stops at $q$, as with the equality.
mip-f-481 · level teorema · notes
Shipping in boxes (minimum number of boxes): $x_{psc} \in \mathbb{Z}_{\ge 0}$ units of product $p$ from plant $s$ to customer $c$, $y_{sc} \in \mathbb{Z}_{\ge 0}$ boxes on the route, with $\sum_p x_{psc} \le w\,y_{sc}$, integer data. Why could the $x$ be continuous without changing the optimum?
  1. They could not: continuous $x$ would always change the optimum
  2. Because the problem is a minimisation
  3. Because the number of boxes is already integer
  4. With $y$ fixed it is still a transportation problem, with a totally unimodular matrix: with integer data it has integer solutions
Explanation. With the boxes fixed, the constraints on the $x$ (availabilities, demands, route capacities) have the transportation structure: vertices are integer, so there is always an integer plan with the same boxes. The $x$ stay integer because the problem speaks of units.
mip-f-482 · level facile · notes
Shipping in boxes of capacity $w = 10$ units, minimum number of boxes; customer demands total $11$ units. The relaxation gives the bound $\sum_{p,c} d_{pc} / w = 11/10$. Which integer lower bound follows?
  1. $11$: one box per unit
  2. $2$: the number of boxes is integer, so one rounds up
  3. $11/10$: a bound is not rounded
  4. $1$: one rounds to the nearest integer
Explanation. In a minimisation with integer-valued objective, $\zmilp \ge 11/10$ implies $\zmilp \ge \lceil 11/10 \rceil = 2$. Rounding down would give a valid but weaker bound.
mip-f-483 · level facile · notes
Summer camps (maximum children accepted): $f_{ij}, g_{ij} \in \mathbb{Z}_{\ge 0}$ girls and boys of nationality $i$ in camp $j$. In every camp girls must be at least as many as boys. Which constraint expresses this?
  1. $\sum_j f_{ij} \ge \sum_j g_{ij}$ for every nationality $i$
  2. $\sum_{i,j} f_{ij} \ge \sum_{i,j} g_{ij}$
  3. $f_{ij} \ge g_{ij}$ for every nationality $i$ and camp $j$
  4. $\sum_i f_{ij} \ge \sum_i g_{ij}$ for every camp $j$
Explanation. The comparison is per camp, summing all nationalities. Per nationality and camp would be too restrictive; per nationality over all camps, or in total, too loose.
mip-f-484 · level facile · notes
Summer camps (maximum children accepted) with capacity $d_j$ per camp: $15$ and $8$ places. Which immediate upper bound holds on the optimum, regardless of the parity and majority constraints?
  1. $\ub = 23$, the sum of the capacities
  2. $\ub = 46$, twice the capacities (girls and boys)
  3. $\ub = 15$, the capacity of the largest camp
  4. $\lb = 23$
Explanation. No camp takes more than its capacity, so the accepted children are at most $15 + 8 = 23$: it is the bound obtained by pricing only the capacity constraints at $1$.
mip-f-485 · level teorema · notes
Antitrust split of branches into two companies, minimising the maximum revenue difference between them over all products. With **a single** product, which classical problem does it reduce to?
  1. Transportation, with integral relaxation
  2. Number partitioning, NP-complete (one of Karp's twenty-one problems)
  3. The assignment problem, solvable in polynomial time
  4. The fractional knapsack
Explanation. With one product one seeks a bipartition of numbers making the two sums as close as possible: number partitioning. With several products it is the vector version, still NP-hard.
mip-f-486 · level facile · notes
Branch split: $x_i = 1$ if branch $i$ goes to company A, $0$ to B; $v_{ij}$ revenue of branch $i$ with product $j$. The difference between A and B on product $j$ is $D_j = \sum_i v_{ij}(2x_i - 1)$. How is $\max_j |D_j|$ minimised with a linear model?
  1. $\min z$ with $z \le D_j$ and $z \le -D_j$ for every $j$
  2. $\min z$ with $z \ge D_j$ and $z \ge -D_j$ for every product $j$
  3. $\min z$ with $z \ge D_j$ for every $j$
  4. $\min \sum_j D_j$
Explanation. Maximum variable and absolute value together: two constraints per product put $z$ above $|D_j|$, and minimising $z$ brings it down to the maximum. With $z \ge D_j$ alone negative differences would escape.
mip-f-487 · level teorema · notes
Tracks on two CDs, minimising the difference between the duration of the longest and the shortest CD; durations are integer and sum to $35$ minutes. Why is the optimum at least $1$?
  1. Because the linear relaxation is worth $1$
  2. The two durations are integers with an odd sum, so they cannot be equal: the difference is at least $1$
  3. Because each CD must contain at least one track
  4. Because the longest track lasts at least $1$ minute
Explanation. $L_1 + L_2 = 35$ with integer $L_1, L_2$: $L_1 - L_2 = 35 - 2L_2$ is odd, so at least $1$ in absolute value. It is a parity argument, which the relaxation (value $0$) does not see.
mip-f-488 · level facile · notes
Tracks on $m$ CDs (minimum difference between longest and shortest CD, with $z_{\max} \ge L_j$ and $z_{\min} \le L_j$ for every CD). Every CD must contain at least $w_j = 1$ track. Why is the constraint needed, although it never bites at the optimum?
  1. Because without it the model is unbounded
  2. Without it an empty CD (duration $0$) would be feasible and the problem's definition would not be respected, even if it is not convenient at the optimum
  3. It is not needed: it can be dropped without changing the problem
  4. Because it makes the relaxation integral
Explanation. An empty CD has duration $0$ and brings the difference up to the total duration, so it is never optimal; but the problem requires at least one track per CD and the model must say so. On other instances ($w_j > 1$) the constraint may bite.
mip-f-489 · level facile · notes
Books on shelves (minimum sum of heights, identical shelves): swapping the contents of two shelves gives a solution of the same value. How is this symmetry broken on large instances?
  1. By imposing $y_1 \ge y_2 \ge \dots \ge y_m$ on the shelf heights
  2. By adding one more shelf
  3. By fixing every book to a shelf before solving
  4. By making the assignment variables continuous
Explanation. Every solution has a permutation of the shelves with non-increasing heights, so the constraint loses no optimum but removes the symmetric copies the solver would explore uselessly.
mip-f-490 · level facile · notes
Books on shelves: each book $b$ has width $w_b$ and height $h_b$, shelves have width $c$, a shelf's height is that of its tallest book, the sum of the heights is minimised. Compared with classical bin packing, what changes?
  1. Items can be split among several containers
  2. The cost of a container is not fixed but depends on its content (the tallest book)
  3. One maximises instead of minimising
  4. The containers have different capacities
Explanation. As in bin packing items go into containers of capacity $c$, but every shelf costs the maximum height of its books: it is modelled with a maximum variable $y_s \ge h_b x_{bs}$.
mip-f-524 · level teorema · notes
Summer camps (maximum children accepted, integer counting variables, all constraints are sums). The constraint «girls at least as many as boys» and the one «nationality $c$ at least as numerous as any other» are:
  1. Independent: there can be camps respecting one and violating the other
  2. The first implies the second
  3. Equivalent: one implies the other
  4. Both redundant, because the capacity implies them
Explanation. The first compares genders, the second nationalities: a camp with many girls of another nationality respects the first and violates the second, and vice versa. On the course instance the second one bites.
mip-f-525 · level ipotesi · notes
Shipping in boxes: if the costs were per unit transported and there were no boxes, the problem would be a pure transportation problem. What would be lost by removing the boxes from the course model?
  1. The integrality of the units, which become fractional in transportation
  2. Nothing: pure transportation has the same optimum
  3. The availability constraints of the plants
  4. The step cost of whole boxes: exactly what makes the problem integer and hard
Explanation. Without boxes transportation has an integral relaxation and is solved in polynomial time. The integer variables $y_{sc}$ (boxes) introduce the fixed cost per box, which makes the problem a true MILP.

Generated questions (60)

Each generator builds a new instance, with different numbers, at every start: a few examples here.

1. What is a MIP model (5)

Example 1 · mip-g-gap-euristica · level facile · notes
In a minimisation problem the constructive heuristic finds a solution of value $75$, a hand-made dual solution is worth $47$ and the solver certifies the integer optimum $\zmilp = 60$. What is the gap of the heuristic, that is, the relative distance of its value from the optimum, measured with respect to the optimum?
  1. $25.0\%$
  2. $20.0\%$
  3. $37.3\%$
  4. $21.7\%$
Explanation. The gap of the heuristic is measured against the known optimum: $|\ub - \zmilp| / |\zmilp| = 15/60 \approx 25.0\%$. The ratio $(\ub - \lb)/|\ub|$ is instead the certified gap between the two bounds, used when the optimum is unknown.
Example 2 · mip-g-gap-euristica · level facile · notes
In a minimisation problem the constructive heuristic finds a solution of value $69$, a hand-made dual solution is worth $41$ and the solver certifies the integer optimum $\zmilp = 47$. What is the gap of the heuristic, that is, the relative distance of its value from the optimum, measured with respect to the optimum?
  1. $46.8\%$
  2. $31.9\%$
  3. $40.6\%$
  4. $12.8\%$
Explanation. The gap of the heuristic is measured against the known optimum: $|\ub - \zmilp| / |\zmilp| = 22/47 \approx 46.8\%$. The ratio $(\ub - \lb)/|\ub|$ is instead the certified gap between the two bounds, used when the optimum is unknown.
Example 1 · mip-g-divario-certificato · level media · notes
**Maximisation** problem. A constructive heuristic finds a feasible integer solution of value $61$; a feasible solution of the dual of the linear relaxation, built by hand, is worth $108$. The certified gap is $(\ub - \lb)/|\ub|$, with $\ub$ and $\lb$ the upper and lower bound on the integer optimum. What is it (rounded to one decimal)?
  1. $43.5\%$
  2. $77.0\%$
  3. $56.5\%$
  4. $47.0\%$
Explanation. In a maximisation the heuristic gives $\lb = 61$ and the dual $\ub = 108$: $(108 - 61)/108 \approx 43.5\%$. Dividing by $\lb$ is the mistake of swapping the roles of the two bounds; $\lb/\ub$ is the complement, not the gap.
Example 2 · mip-g-divario-certificato · level media · notes
**Minimisation** problem. A constructive heuristic finds a feasible integer solution of value $117$; a feasible solution of the dual of the linear relaxation, built by hand, is worth $104$. The certified gap is $(\ub - \lb)/|\ub|$, with $\ub$ and $\lb$ the upper and lower bound on the integer optimum. What is it (rounded to one decimal)?
  1. $11.1\%$
  2. $12.5\%$
  3. $88.9\%$
  4. $13.0\%$
Explanation. In a minimisation the heuristic gives $\ub = 117$ and the dual $\lb = 104$: $(117 - 104)/117 \approx 11.1\%$. Dividing by $\lb$ is the mistake of swapping the roles of the two bounds; $\lb/\ub$ is the complement, not the gap.
Example 1 · mip-g-arrotonda-bound · level facile · notes
**Maximisation** MILP with all variables integer and integer objective coefficients, so every feasible solution has an integer value. The linear relaxation is worth $\zlp = \tfrac{301}{4}$. What is the tightest bound on the integer optimum $\zmilp$ that follows?
  1. $\ub = 75$
  2. $\ub = 76$
  3. $\ub = \tfrac{301}{4}$
  4. $\ub = 74$
Explanation. In a maximisation $\zmilp \le \zlp$; since $\zmilp$ is integer one rounds down: $\ub = \lfloor \tfrac{301}{4} \rfloor = 75$. Rounding the other way is not a bound; $\zlp$ itself is valid but weaker.
Example 2 · mip-g-arrotonda-bound · level facile · notes
**Minimisation** MILP with all variables integer and integer objective coefficients, so every feasible solution has an integer value. The linear relaxation is worth $\zlp = \tfrac{251}{6}$. What is the tightest bound on the integer optimum $\zmilp$ that follows?
  1. $\lb = 42$
  2. $\lb = 41$
  3. $\lb = \tfrac{251}{6}$
  4. $\lb = 43$
Explanation. In a minimisation $\zlp \le \zmilp$; since $\zmilp$ is integer one rounds up: $\lb = \lceil \tfrac{251}{6} \rceil = 42$. Rounding the other way is not a bound; $\zlp$ itself is valid but weaker.
Example 1 · mip-g-due-rilassamenti · level facile · notes
Binary maximisation knapsack: values $p = (10, 14, 13, 11)$, weights $w = (5, 6, 2, 5)$, capacity $C = 14$. $\zlp$ is the relaxation with $x \ge 0$ only, $\zlpp$ the one with $0 \le x \le 1$. What are $(\zlp, \zlpp)$?
  1. $(91, 40)$
  2. $(40, 91)$
  3. $(91, 38)$
  4. $(48, 40)$
Explanation. Without bounds it pays to fill the knapsack with the item of maximum ratio $p_j/w_j$, even several times: $\zlp = C \max_j p_j/w_j = 91$. With $x \le 1$ items are taken by decreasing ratio and the last one partially: $\zlpp = 40$. In a maximisation $\zlp \ge \zlpp \ge \zmilp$.
Example 2 · mip-g-due-rilassamenti · level facile · notes
Binary maximisation knapsack: values $p = (11, 13, 15, 12)$, weights $w = (6, 7, 2, 7)$, capacity $C = 12$. $\zlp$ is the relaxation with $x \ge 0$ only, $\zlpp$ the one with $0 \le x \le 1$. What are $(\zlp, \zlpp)$?
  1. $(90, \tfrac{67}{2})$
  2. $(\tfrac{67}{2}, 90)$
  3. $(90, 28)$
  4. $(51, \tfrac{67}{2})$
Explanation. Without bounds it pays to fill the knapsack with the item of maximum ratio $p_j/w_j$, even several times: $\zlp = C \max_j p_j/w_j = 90$. With $x \le 1$ items are taken by decreasing ratio and the last one partially: $\zlpp = \tfrac{67}{2}$. In a maximisation $\zlp \ge \zlpp \ge \zmilp$.
Example 1 · mip-g-ilp-due-var · level complessa · notes
Maximisation ILP: $\max 6x_1 + 3x_2$ with $3x_1 + 3x_2 \le 22$, $5x_1 + x_2 \le 13$, $x_1, x_2 \in \mathbb{Z}_{\ge 0}$. What are $\zlp$ (relaxation with continuous $x \ge 0$) and $\zmilp$?
  1. $\zlp = \tfrac{105}{4}$, $\zmilp = 24$
  2. $\zlp = \tfrac{105}{4}$, $\zmilp = 21$
  3. $\zlp = 26$, $\zmilp = 24$
  4. $\zlp = 24$, $\zmilp = \tfrac{105}{4}$
Explanation. The relaxation has its optimum at a vertex: $\zlp = \tfrac{105}{4}$. Enumerating the feasible integer points the optimum is $\zmilp = 24$. Rounding the optimal vertex down gives only $21$, and $\lfloor \zlp \rfloor$ is a bound, not the optimum.
Example 2 · mip-g-ilp-due-var · level complessa · notes
Maximisation ILP: $\max 2x_1 + 8x_2$ with $2x_1 + x_2 \le 28$, $x_1 + 6x_2 \le 26$, $x_1, x_2 \in \mathbb{Z}_{\ge 0}$. What are $\zlp$ (relaxation with continuous $x \ge 0$) and $\zmilp$?
  1. $\zlp = \tfrac{476}{11}$, $\zmilp = 42$
  2. $\zlp = \tfrac{476}{11}$, $\zmilp = 40$
  3. $\zlp = 43$, $\zmilp = 42$
  4. $\zlp = 42$, $\zmilp = \tfrac{476}{11}$
Explanation. The relaxation has its optimum at a vertex: $\zlp = \tfrac{476}{11}$. Enumerating the feasible integer points the optimum is $\zmilp = 42$. Rounding the optimal vertex down gives only $40$, and $\lfloor \zlp \rfloor$ is a bound, not the optimum.

2. Relaxations, duality and bounds (7)

Example 1 · mip-g-duale-azzera · level facile · notes
Minimum-cost assignment with availability: $n = 4$ jobs, $k = 3$ machines, $\sum_m x_{jm} = 1$ per job and $\sum_j t_{jm} x_{jm} \le a_m$ per machine; the rows of the costs $c_{jm}$, one per job, are (7, 10, 11), (2, 10, 8), (8, 11, 1), (11, 3, 4). The dual of the relaxation has a free $\mu_j$ per job, $\pi_m \le 0$ per machine, constraints $\mu_j + t_{jm} \pi_m \le c_{jm}$ and objective $\max \sum_j \mu_j + \sum_m a_m \pi_m$. Recipe "zero out and saturate": $\bar\pi = 0$ and each $\bar\mu_j$ at the largest feasible value. What is the bound?
  1. $13$
  2. $43$
  3. $24$
  4. $6$
Explanation. With $\bar\pi = 0$ the dual constraints become $\mu_j \le c_{jm}$ for every $m$, so $\bar\mu_j = \min_m c_{jm}$ and the bound is $\sum_j \min_m c_{jm} = 13$: "every job costs at least its minimum cost". In a minimisation it is a lower bound, valid by weak duality.
Example 2 · mip-g-duale-azzera · level facile · notes
Minimum-cost assignment with availability: $n = 3$ jobs, $k = 3$ machines, $\sum_m x_{jm} = 1$ per job and $\sum_j t_{jm} x_{jm} \le a_m$ per machine; the rows of the costs $c_{jm}$, one per job, are (11, 4, 2), (5, 11, 10), (8, 12, 10). The dual of the relaxation has a free $\mu_j$ per job, $\pi_m \le 0$ per machine, constraints $\mu_j + t_{jm} \pi_m \le c_{jm}$ and objective $\max \sum_j \mu_j + \sum_m a_m \pi_m$. Recipe "zero out and saturate": $\bar\pi = 0$ and each $\bar\mu_j$ at the largest feasible value. What is the bound?
  1. $15$
  2. $34$
  3. $22$
  4. $11$
Explanation. With $\bar\pi = 0$ the dual constraints become $\mu_j \le c_{jm}$ for every $m$, so $\bar\mu_j = \min_m c_{jm}$ and the bound is $\sum_j \min_m c_{jm} = 15$: "every job costs at least its minimum cost". In a minimisation it is a lower bound, valid by weak duality.
Example 1 · mip-g-zaino-sandwich · level media · notes
Binary knapsack: values $p = (4, 4, 6, 14, 11)$, weights $w = (4, 7, 2, 4, 6)$, capacity $C = 11$, to be maximised ($x_j = 1$ if item $j$ is taken). The constructive heuristic scans the items by decreasing $p_j/w_j$ and takes every item that still fits; in the dual of the relaxation ($\min C v$ with $w_j v \ge p_j$, $v \ge 0$) one chooses $\bar v = \max_j p_j / w_j$. Which bounds are obtained?
  1. $\lb = 24$, $\ub = \tfrac{77}{2}$
  2. $\lb = 20$, $\ub = \tfrac{77}{2}$
  3. $\lb = 24$, $\ub = 39$
  4. $\lb = \tfrac{77}{2}$, $\ub = 24$
Explanation. In a maximisation the heuristic gives a lower bound: $\lb = 24$ (one does not stop at the first item that does not fit). The dual gives an upper bound: $\ub = C \cdot \max_j p_j/w_j = \tfrac{77}{2}$, feasible because $w_j \bar v \ge p_j$ for every $j$. In a minimisation the names would swap.
Example 2 · mip-g-zaino-sandwich · level media · notes
Binary knapsack: values $p = (12, 7, 12, 4)$, weights $w = (6, 4, 4, 5)$, capacity $C = 8$, to be maximised ($x_j = 1$ if item $j$ is taken). The constructive heuristic scans the items by decreasing $p_j/w_j$ and takes every item that still fits; in the dual of the relaxation ($\min C v$ with $w_j v \ge p_j$, $v \ge 0$) one chooses $\bar v = \max_j p_j / w_j$. Which bounds are obtained?
  1. $\lb = 19$, $\ub = 24$
  2. $\lb = 12$, $\ub = 24$
  3. $\lb = 19$, $\ub = 35$
  4. $\lb = 24$, $\ub = 19$
Explanation. In a maximisation the heuristic gives a lower bound: $\lb = 19$ (one does not stop at the first item that does not fit). The dual gives an upper bound: $\ub = C \cdot \max_j p_j/w_j = 24$, feasible because $w_j \bar v \ge p_j$ for every $j$. In a minimisation the names would swap.
Example 1 · mip-g-duale-valore · level facile · notes
Linear relaxation of a minimisation MILP: $\min 7x_1 + 7x_2 + 8x_3$ with $x_1 + x_2 + x_3 \ge 7$, $2x_1 + x_2 + 2x_3 \ge 10$, $x \ge 0$. The dual has $\pi_1, \pi_2 \ge 0$, one constraint per variable ($a_{1j}\pi_1 + a_{2j}\pi_2 \le c_j$) and objective $\max 7\pi_1 + 10\pi_2$. The solution $\bar\pi = (1, 3)$ is feasible. Which lower bound does it give on the integer optimum?
  1. $\lb = 37$
  2. $\lb = 4$
  3. $\lb = 31$
  4. $\lb = 22$
Explanation. By weak duality the dual value $7 \cdot 1 + 10 \cdot 3 = 37$ lies below $\zlp \le \zmilp$. Summing the components or swapping the right-hand sides does not give the dual objective; $\sum_j c_j$ is not a bound.
Example 2 · mip-g-duale-valore · level facile · notes
Linear relaxation of a minimisation MILP: $\min 8x_1 + 15x_2 + 8x_3$ with $3x_1 + 4x_2 + x_3 \ge 3$, $2x_1 + 4x_2 + 3x_3 \ge 10$, $x \ge 0$. The dual has $\pi_1, \pi_2 \ge 0$, one constraint per variable ($a_{1j}\pi_1 + a_{2j}\pi_2 \le c_j$) and objective $\max 3\pi_1 + 10\pi_2$. The solution $\bar\pi = (2, 1)$ is feasible. Which lower bound does it give on the integer optimum?
  1. $\lb = 16$
  2. $\lb = 3$
  3. $\lb = 23$
  4. $\lb = 31$
Explanation. By weak duality the dual value $3 \cdot 2 + 10 \cdot 1 = 16$ lies below $\zlp \le \zmilp$. Summing the components or swapping the right-hand sides does not give the dual objective; $\sum_j c_j$ is not a bound.
Example 1 · mip-g-tabella-duale · level media · notes
One writes the dual of a **minimisation** linear programme with 6 constraints, of sense $1$: $\le$, $2$: $\ge$, $3$: $\ge$, $4$: $\le$, $5$: $=$, $6$: $\le$, and variables $x_{1} \ge 0$, $x_{2} \ge 0$, $x_{3} \ge 0$. How many dual variables are, in order, $\ge 0$, $\le 0$ and free?
  1. $(2, 3, 1)$
  2. $(3, 2, 1)$
  3. $(2, 3, 0)$
  4. $(3, 3, 0)$
Explanation. One dual variable per constraint. Minimisation primal: $\ge \to \pi_i \ge 0$, $\le \to \pi_i \le 0$, $= \to$ free. Free primal variables decide the sense of the dual constraints (equalities), not the sign of the dual variables.
Example 2 · mip-g-tabella-duale · level media · notes
One writes the dual of a **minimisation** linear programme with 6 constraints, of sense $1$: $\ge$, $2$: $\le$, $3$: $=$, $4$: $=$, $5$: $\le$, $6$: $=$, and variables $x_{1}$ free, $x_{2} \ge 0$, $x_{3}$ free. How many dual variables are, in order, $\ge 0$, $\le 0$ and free?
  1. $(1, 2, 3)$
  2. $(2, 1, 3)$
  3. $(1, 2, 2)$
  4. $(4, 2, 0)$
Explanation. One dual variable per constraint. Minimisation primal: $\ge \to \pi_i \ge 0$, $\le \to \pi_i \le 0$, $= \to$ free. Free primal variables decide the sense of the dual constraints (equalities), not the sign of the dual variables.
Example 1 · mip-g-copertura-minimale · level media · notes
Binary knapsack with constraint $6x_{1} + 8x_{2} + 8x_{3} + 2x_{4} + 8x_{5} \le 22$. A set $S$ of items is a **cover** if $\sum_{j \in S} w_j > 22$ (then $\sum_{j \in S} x_j \le |S| - 1$ is valid); it is **minimal** if removing any item it is no longer a cover. Which set is a minimal cover?
  1. $\{1, 2, 3, 4\}$
  2. $\{1, 2, 3, 4, 5\}$
  3. $\{2, 5\}$
  4. $\{1, 4, 5\}$
Explanation. $\{1, 2, 3, 4\}$ weighs $24 > 22$ and removing any item it drops to $22$ or less. $\{1, 2, 3, 4, 5\}$ is a cover but not minimal; the other two weigh at most $22$.
Example 2 · mip-g-copertura-minimale · level media · notes
Binary knapsack with constraint $8x_{1} + 4x_{2} + 2x_{3} + 5x_{4} \le 15$. A set $S$ of items is a **cover** if $\sum_{j \in S} w_j > 15$ (then $\sum_{j \in S} x_j \le |S| - 1$ is valid); it is **minimal** if removing any item it is no longer a cover. Which set is a minimal cover?
  1. $\{1, 2, 4\}$
  2. $\{1, 2, 3, 4\}$
  3. $\{1, 3, 4\}$
  4. $\{2, 4\}$
Explanation. $\{1, 2, 4\}$ weighs $17 > 15$ and removing any item it drops to $15$ or less. $\{1, 2, 3, 4\}$ is a cover but not minimal; the other two weigh at most $15$.
Example 1 · mip-g-taglio-violato · level media · notes
Binary maximisation knapsack with values $p = (12, 7, 9, 9)$ and constraint $6x_{1} + 8x_{2} + 3x_{3} + 6x_{4} \le 14$. The relaxation with $0 \le x \le 1$ has optimal solution $\tilde x = (1, 0, 1, \tfrac{5}{6})$. For a minimal cover $S$ ($\sum_{j \in S} w_j > 14$) the cut is $\sum_{j \in S} x_j \le |S| - 1$. Which of these minimal covers gives a cut **violated** by $\tilde x$?
  1. $\{1, 3, 4\}$
  2. $\{1, 2, 3\}$
  3. $\{1, 2, 4\}$
  4. $\{2, 3, 4\}$
Explanation. Sum $\tilde x$ over the items of each cover and compare with $|S| - 1$: only for $\{1, 3, 4\}$ does the sum exceed the limit, so only that cut separates $\tilde x$ and strengthens the relaxation.
Example 2 · mip-g-taglio-violato · level media · notes
Binary maximisation knapsack with values $p = (7, 13, 3, 6)$ and constraint $7x_{1} + 5x_{2} + 6x_{3} + 7x_{4} \le 7$. The relaxation with $0 \le x \le 1$ has optimal solution $\tilde x = (\tfrac{2}{7}, 1, 0, 0)$. For a minimal cover $S$ ($\sum_{j \in S} w_j > 7$) the cut is $\sum_{j \in S} x_j \le |S| - 1$. Which of these minimal covers gives a cut **violated** by $\tilde x$?
  1. $\{1, 2\}$
  2. $\{3, 4\}$
  3. $\{2, 4\}$
  4. $\{1, 4\}$
Explanation. Sum $\tilde x$ over the items of each cover and compare with $|S| - 1$: only for $\{1, 2\}$ does the sum exceed the limit, so only that cut separates $\tilde x$ and strengthens the relaxation.
Example 1 · mip-g-zaino-ottimo-gap · level complessa · notes
Binary maximisation knapsack: values $p = (13, 18, 17, 14, 3)$, weights $w = (5, 7, 2, 6, 8)$, capacity $C = 16$. The heuristic by decreasing $p_j/w_j$ (ties: smallest index) gives $\lb$; the dual of the relaxation with $\bar v = \max_j p_j/w_j$ gives $\ub = C\bar v$. What are the optimum $\zmilp$ and the certified gap $(\ub - \lb)/\ub$ (one decimal)?
  1. $\zmilp = 49$, gap $64.7\%$
  2. $\zmilp = 49$, gap $2.0\%$
  3. $\zmilp = 48$, gap $64.7\%$
  4. $\zmilp = 49$, gap $183.3\%$
Explanation. $\lb = 48$, $\ub = 136$, so the certified gap is $\approx 64.7\%$; enumerating the subsets $\zmilp = 49$. The heuristic gap with respect to the optimum ($2.0\%$) is another measure; dividing by $\lb$ is a mistake.
Example 2 · mip-g-zaino-ottimo-gap · level complessa · notes
Binary maximisation knapsack: values $p = (12, 16, 4, 12, 20)$, weights $w = (8, 7, 7, 3, 2)$, capacity $C = 10$. The heuristic by decreasing $p_j/w_j$ (ties: smallest index) gives $\lb$; the dual of the relaxation with $\bar v = \max_j p_j/w_j$ gives $\ub = C\bar v$. What are the optimum $\zmilp$ and the certified gap $(\ub - \lb)/\ub$ (one decimal)?
  1. $\zmilp = 36$, gap $68.0\%$
  2. $\zmilp = 36$, gap $11.1\%$
  3. $\zmilp = 32$, gap $68.0\%$
  4. $\zmilp = 36$, gap $212.5\%$
Explanation. $\lb = 32$, $\ub = 100$, so the certified gap is $\approx 68.0\%$; enumerating the subsets $\zmilp = 36$. The heuristic gap with respect to the optimum ($11.1\%$) is another measure; dividing by $\lb$ is a mistake.

3. From the model to Python/Gurobi (5)

Example 1 · mip-g-gurobi-conta · level facile · notes
In gurobipy (the Python interface of Gurobi) the makespan on identical machines is written with these statements, applied to an empty model `m`: `x = m.addVars(6, 5, vtype=GRB.BINARY)`; `z = m.addVar()`; `m.addConstrs(x.sum(j, '*') == 1 for j in range(6))`; `m.addConstrs(gp.quicksum(d[j] * x[j, i] for j in range(6)) <= z for i in range(5))`. How many constraints does the model have (domains excluded)?
  1. $11$
  2. $30$
  3. $6$
  4. $12$
Explanation. `addVars(a, b)` creates $a \cdot b$ variables, `addVar()` a single one; `addConstrs` adds one constraint per element of the generator, so two nested `for` give one constraint per pair. The total is $11$.
Example 2 · mip-g-gurobi-conta · level facile · notes
In gurobipy (the Python interface of Gurobi) the makespan on identical machines is written with these statements, applied to an empty model `m`: `x = m.addVars(8, 3, vtype=GRB.BINARY)`; `z = m.addVar()`; `m.addConstrs(x.sum(j, '*') == 1 for j in range(8))`; `m.addConstrs(gp.quicksum(d[j] * x[j, i] for j in range(8)) <= z for i in range(3))`. How many variables does the model have?
  1. $25$
  2. $24$
  3. $27$
  4. $12$
Explanation. `addVars(a, b)` creates $a \cdot b$ variables, `addVar()` a single one; `addConstrs` adds one constraint per element of the generator, so two nested `for` give one constraint per pair. The total is $25$.
Example 1 · mip-g-gurobi-gap · level media · notes
Gurobi, **maximisation** problem. The solver stops with `Status = TIME_LIMIT` (time limit reached) after finding integer solutions: `ObjVal` $= 137$ is the value of the best integer solution, `ObjBound` $= 161$ the dual bound. The reported gap is `MIPGap` $= |\text{ObjVal} - \text{ObjBound}| / |\text{ObjVal}|$. What can be stated about the integer optimum $\zmilp$?
  1. $137 \le \zmilp \le 161$, gap $17.5\%$
  2. $161 \le \zmilp \le 137$, gap $17.5\%$
  3. $\zmilp = 137$, gap $0\%$
  4. $137 \le \zmilp \le 161$, gap $14.9\%$
Explanation. Without `OPTIMAL` the two bounds remain: the integer solution is the pessimistic side, the dual bound the optimistic one, so $137 \le \zmilp \le 161$, and the gap is $24/137 \approx 17.5\%$. Dividing by `ObjBound` is a mistake; $\zmilp = \text{ObjVal}$ can be written only with `Status = OPTIMAL`.
Example 2 · mip-g-gurobi-gap · level media · notes
Gurobi, **minimisation** problem. The solver stops with `Status = TIME_LIMIT` (time limit reached) after finding integer solutions: `ObjVal` $= 177$ is the value of the best integer solution, `ObjBound` $= 167$ the dual bound. The reported gap is `MIPGap` $= |\text{ObjVal} - \text{ObjBound}| / |\text{ObjVal}|$. What can be stated about the integer optimum $\zmilp$?
  1. $167 \le \zmilp \le 177$, gap $5.6\%$
  2. $177 \le \zmilp \le 167$, gap $5.6\%$
  3. $\zmilp = 177$, gap $0\%$
  4. $167 \le \zmilp \le 177$, gap $6.0\%$
Explanation. Without `OPTIMAL` the two bounds remain: the integer solution is the pessimistic side, the dual bound the optimistic one, so $167 \le \zmilp \le 177$, and the gap is $10/177 \approx 5.6\%$. Dividing by `ObjBound` is a mistake; $\zmilp = \text{ObjVal}$ can be written only with `Status = OPTIMAL`.
Example 1 · mip-g-mipgap-soglia · level facile · notes
Gurobi, **maximisation** problem, parameter `MIPGap` $= 5\%$: the solver stops with `OPTIMAL` as soon as $|\text{ObjVal} - \text{ObjBound}| / |\text{ObjVal}| \le$ `MIPGap`. The best solution is worth `ObjVal` $= 4800$. What is the largest value of `ObjBound` at which the solver stops?
  1. $5040$
  2. $4805$
  3. $7200$
  4. $4560$
Explanation. One needs $|4800 - \text{ObjBound}| \le 4800 \cdot 5\% = 240$; in a maximisation the bound lies above the solution, so `ObjBound` $= 5040$. The percentage must not be subtracted as an absolute number, and the bound does not lie on the solution's side.
Example 2 · mip-g-mipgap-soglia · level facile · notes
Gurobi, **minimisation** problem, parameter `MIPGap` $= 1\%$: the solver stops with `OPTIMAL` as soon as $|\text{ObjVal} - \text{ObjBound}| / |\text{ObjVal}| \le$ `MIPGap`. The best solution is worth `ObjVal` $= 6800$. What is the smallest value of `ObjBound` at which the solver stops?
  1. $6732$
  2. $6799$
  3. $6120$
  4. $6868$
Explanation. One needs $|6800 - \text{ObjBound}| \le 6800 \cdot 1\% = 68$; in a minimisation the bound lies below the solution, so `ObjBound` $= 6732$. The percentage must not be subtracted as an absolute number, and the bound does not lie on the solution's side.
Example 1 · mip-g-cmax-lb · level facile · notes
Makespan on $k = 3$ identical machines (minimum load of the busiest machine), jobs of duration $t = (10, 11, 3, 10, 8, 8)$. What is the better of the two elementary lower bounds, $\max_j t_j$ and $\sum_j t_j / k$?
  1. $\tfrac{50}{3}$
  2. $11$
  3. $50$
  4. $6$
Explanation. $\max_j t_j = 11$ and $\sum_j t_j / k = \tfrac{50}{3}$: in a minimisation the better bound is the larger one, $\tfrac{50}{3}$. $\sum_j t_j$ is an upper bound (everything on one machine), not a lower bound.
Example 2 · mip-g-cmax-lb · level facile · notes
Makespan on $k = 3$ identical machines (minimum load of the busiest machine), jobs of duration $t = (5, 3, 6, 11, 10, 9)$. What is the better of the two elementary lower bounds, $\max_j t_j$ and $\sum_j t_j / k$?
  1. $\tfrac{44}{3}$
  2. $11$
  3. $44$
  4. $6$
Explanation. $\max_j t_j = 11$ and $\sum_j t_j / k = \tfrac{44}{3}$: in a minimisation the better bound is the larger one, $\tfrac{44}{3}$. $\sum_j t_j$ is an upper bound (everything on one machine), not a lower bound.
Example 1 · mip-g-bpp-ffd · level complessa · notes
Bin packing: items of weight $w = (9, 10, 3, 10, 8, 8, 10, 2)$, containers of capacity $C = 13$. First-fit decreasing sorts the items by decreasing weight (ties: smallest index) and puts each in the first open container where it fits, otherwise opens a new one. With $\ub$ the number of containers of first-fit decreasing and the lower bound $\lb = \lceil \sum_j w_j / C \rceil$, what are $(\ub, \lb)$?
  1. $(6, 5)$
  2. $(7, 5)$
  3. $(6, 4)$
  4. $(5, 6)$
Explanation. First-fit decreasing uses $6$ containers (upper bound); $\sum_j w_j = 60$, so $\lb = \lceil 60/13 \rceil = 5$. First-fit in the given order uses $6$ containers.
Example 2 · mip-g-bpp-ffd · level complessa · notes
Bin packing: items of weight $w = (5, 3, 6, 12, 11, 9, 13, 11)$, containers of capacity $C = 15$. First-fit decreasing sorts the items by decreasing weight (ties: smallest index) and puts each in the first open container where it fits, otherwise opens a new one. With $\ub$ the number of containers of first-fit decreasing and the lower bound $\lb = \lceil \sum_j w_j / C \rceil$, what are $(\ub, \lb)$?
  1. $(6, 5)$
  2. $(7, 5)$
  3. $(6, 4)$
  4. $(5, 6)$
Explanation. First-fit decreasing uses $6$ containers (upper bound); $\sum_j w_j = 70$, so $\lb = \lceil 70/15 \rceil = 5$. First-fit in the given order uses $6$ containers.

4. Constructive heuristics (7)

Example 1 · mip-g-lpt · level facile · notes
Makespan on identical machines: jobs of duration $t = (3, 4, 2, 2, 4, 6)$ go on $k = 3$ identical machines, minimising the makespan. What value does LPT return (jobs by decreasing duration, each on the least loaded machine, ties broken by the smallest index)?
  1. $8$
  2. $10$
  3. $7$
  4. $6$
Explanation. LPT sorts the jobs by decreasing duration and puts each on the least loaded machine; the makespan is the largest final load, $8$. It is an upper bound, since the problem is a minimisation; $\max(\max_j t_j, \lceil \sum_j t_j / k \rceil)$ is instead a lower bound.
Example 2 · mip-g-lpt · level facile · notes
Makespan on identical machines: jobs of duration $t = (4, 6, 8, 7, 2, 8, 4)$ go on $k = 3$ identical machines, minimising the makespan. What value does LPT return (jobs by decreasing duration, each on the least loaded machine, ties broken by the smallest index)?
  1. $14$
  2. $16$
  3. $13$
  4. $12$
Explanation. LPT sorts the jobs by decreasing duration and puts each on the least loaded machine; the makespan is the largest final load, $14$. It is an upper bound, since the problem is a minimisation; $\max(\max_j t_j, \lceil \sum_j t_j / k \rceil)$ is instead a lower bound.
Example 1 · mip-g-bin-packing · level facile · notes
Bin packing: items of weight $w = (5, 6, 2, 6, 5, 5, 6)$, in the given order, go into bins of capacity $C = 9$. **next-fit** puts each item into the current bin if it fits, otherwise opens a new bin which becomes the current one (it never goes back). How many bins does it use?
  1. $6$
  2. $4$
  3. $7$
  4. $5$
Explanation. Running the rule item by item opens $6$ bins. Next-fit looks only at the current bin, first-fit at the first bin where the item fits, best-fit at the one left fullest; $\lceil \sum_j w_j / C \rceil$ is the elementary lower bound.
Example 2 · mip-g-bin-packing · level facile · notes
Bin packing: items of weight $w = (5, 4, 5, 5, 5, 4, 2, 4)$, in the given order, go into bins of capacity $C = 8$. **next-fit** puts each item into the current bin if it fits, otherwise opens a new bin which becomes the current one (it never goes back). How many bins does it use?
  1. $7$
  2. $6$
  3. $5$
  4. $8$
Explanation. Running the rule item by item opens $7$ bins. Next-fit looks only at the current bin, first-fit at the first bin where the item fits, best-fit at the one left fullest; $\lceil \sum_j w_j / C \rceil$ is the elementary lower bound.
Example 1 · mip-g-tsp-vicino · level media · notes
Travelling salesman (TSP): five cities with symmetric distances, row by row: 1: (-, 2, 3, 1, 1); 2: (2, -, 3, 5, 2); 3: (3, 3, -, 4, 5); 4: (1, 5, 4, -, 7); 5: (1, 2, 5, 7, -). Starting from city 1, nearest neighbour always moves to the closest unvisited city (ties broken by the smallest index) and finally returns to the start. How long is the tour?
  1. $11$
  2. $10$
  3. $14$
  4. $12$
Explanation. The tour is $1 \to 4 \to 3 \to 2 \to 5 \to 1$, of length $11$, including the return arc (often the most expensive one). It is a feasible solution, hence an upper bound: it says nothing about the distance from the optimum.
Example 2 · mip-g-tsp-vicino · level media · notes
Travelling salesman (TSP): five cities with symmetric distances, row by row: 1: (-, 8, 8, 2, 9); 2: (8, -, 9, 7, 7); 3: (8, 9, -, 3, 6); 4: (2, 7, 3, -, 5); 5: (9, 7, 6, 5, -). Starting from city 1, nearest neighbour always moves to the closest unvisited city (ties broken by the smallest index) and finally returns to the start. How long is the tour?
  1. $26$
  2. $18$
  3. $30$
  4. $27$
Explanation. The tour is $1 \to 4 \to 3 \to 5 \to 2 \to 1$, of length $26$, including the return arc (often the most expensive one). It is a feasible solution, hence an upper bound: it says nothing about the distance from the optimum.
Example 1 · mip-g-copertura-bound · level media · notes
Minimum-cost covering: four teams (one per district) of cost $c = (6, 6, 8, 8)$ must cover six zones, each covered by the teams of the two districts it borders: in order $\{1,2\}, \{2,3\}, \{1,3\}, \{1,4\}, \{2,4\}, \{3,4\}$. The heuristic always picks the team of minimum cost per newly covered zone (equal ratios: the smallest index). In the dual of the relaxation ($\pi_i \ge 0$ per zone, $\sum_{i \text{ covered by } j} \pi_i \le c_j$ per team) the zones are scanned in order, $\pi_i$ is raised until the first dual constraint is saturated and the residuals are updated. What are $(\ub, \lb)$?
  1. $(20, 14)$
  2. $(14, 20)$
  3. $(20, 38)$
  4. $(20, 46)$
Explanation. The heuristic gives a feasible cover of cost $\ub = 20$; the dual recipe gives $\lb = 14$, feasible because every residual stays non-negative. Without updating the residuals the dual solution is infeasible and its value is not a bound.
Example 2 · mip-g-copertura-bound · level media · notes
Minimum-cost covering: four teams (one per district) of cost $c = (5, 8, 4, 2)$ must cover six zones, each covered by the teams of the two districts it borders: in order $\{1,2\}, \{2,3\}, \{1,3\}, \{1,4\}, \{2,4\}, \{3,4\}$. The heuristic always picks the team of minimum cost per newly covered zone (equal ratios: the smallest index). In the dual of the relaxation ($\pi_i \ge 0$ per zone, $\sum_{i \text{ covered by } j} \pi_i \le c_j$ per team) the zones are scanned in order, $\pi_i$ is raised until the first dual constraint is saturated and the residuals are updated. What are $(\ub, \lb)$?
  1. $(11, 9)$
  2. $(9, 11)$
  3. $(11, 19)$
  4. $(11, 38)$
Explanation. The heuristic gives a feasible cover of cost $\ub = 11$; the dual recipe gives $\lb = 9$, feasible because every residual stays non-negative. Without updating the residuals the dual solution is infeasible and its value is not a bound.
Example 1 · mip-g-zaino-rapporto · level facile · notes
Binary maximisation knapsack: values $p = (7, 4, 12, 10, 16)$, weights $w = (3, 2, 4, 3, 5)$, capacity $C = 10$. The heuristic scans the items by decreasing $p_j/w_j$ (ties: smallest index) and takes **every** item that fits in the residual, continuing the scan even after a rejection. What value does it obtain?
  1. $30$
  2. $28$
  3. $21$
  4. $26$
Explanation. With the ratio order the rule obtains $30$, a lower bound because the problem is a maximisation. Sorting by value or by weight gives other results; stopping at the first item that does not fit gives $26$.
Example 2 · mip-g-zaino-rapporto · level facile · notes
Binary maximisation knapsack: values $p = (17, 11, 9, 16, 4)$, weights $w = (7, 5, 5, 6, 4)$, capacity $C = 10$. The heuristic scans the items by decreasing $p_j/w_j$ (ties: smallest index) and takes **every** item that fits in the residual, continuing the scan even after a rejection. What value does it obtain?
  1. $20$
  2. $17$
  3. $15$
  4. $16$
Explanation. With the ratio order the rule obtains $20$, a lower bound because the problem is a maximisation. Sorting by value or by weight gives other results; stopping at the first item that does not fit gives $16$.
Example 1 · mip-g-ricerca-locale · level media · notes
Makespan on $3$ identical machines: jobs of duration $t = (6, 5, 7, 7, 9, 4)$, assigned to machines $(1, 2, 1, 1, 1, 1)$ (in job order), loads $(33, 5, 0)$. All moves «move one job to another machine» are evaluated and the best one is applied, only if it reduces the makespan. What makespan is obtained after one step (if no move improves, the current one)?
  1. $24$
  2. $33$
  3. $13$
  4. $23$
Explanation. The current makespan is $33$; the best move leads to $24$. The optimum is $13$ and the bound $\lceil \sum t / k \rceil = 13$: a local move does not guarantee reaching them.
Example 2 · mip-g-ricerca-locale · level media · notes
Makespan on $3$ identical machines: jobs of duration $t = (8, 2, 8, 7, 8, 8)$, assigned to machines $(1, 2, 3, 3, 2, 3)$ (in job order), loads $(8, 10, 23)$. All moves «move one job to another machine» are evaluated and the best one is applied, only if it reduces the makespan. What makespan is obtained after one step (if no move improves, the current one)?
  1. $16$
  2. $23$
  3. $14$
  4. $15$
Explanation. The current makespan is $23$; the best move leads to $16$. The optimum is $16$ and the bound $\lceil \sum t / k \rceil = 14$: a local move does not guarantee reaching them.
Example 1 · mip-g-lpt-bound · level complessa · notes
Makespan on $k = 3$ identical machines, jobs of duration $t = (8, 8, 8, 5, 2, 4, 7, 10)$. LPT sorts the jobs by decreasing duration (ties: smallest index) and puts each on the least loaded machine (ties: machine of smallest index). The lower bound is $\max\{\max_j t_j, \lceil \sum_j t_j / k \rceil\}$ (the makespan is integer). What are $(\ub, \lb)$, with $\ub$ the LPT makespan?
  1. $(19, 18)$
  2. $(18, 19)$
  3. $(22, 18)$
  4. $(19, 17)$
Explanation. LPT gives makespan $19$, an upper bound (minimisation); the bound is $\max\{10, \lceil 52/3 \rceil\} = 18$. Without sorting (list scheduling in the given order) one gets $22$.
Example 2 · mip-g-lpt-bound · level complessa · notes
Makespan on $k = 3$ identical machines, jobs of duration $t = (9, 9, 3, 10, 10, 8, 8, 4)$. LPT sorts the jobs by decreasing duration (ties: smallest index) and puts each on the least loaded machine (ties: machine of smallest index). The lower bound is $\max\{\max_j t_j, \lceil \sum_j t_j / k \rceil\}$ (the makespan is integer). What are $(\ub, \lb)$, with $\ub$ the LPT makespan?
  1. $(22, 21)$
  2. $(21, 22)$
  3. $(21, 21)$
  4. $(22, 20)$
Explanation. LPT gives makespan $22$, an upper bound (minimisation); the bound is $\max\{10, \lceil 61/3 \rceil\} = 21$. Without sorting (list scheduling in the given order) one gets $21$.

5. Logic and binary variables (5)

Example 1 · mip-g-implicazione · level facile · notes
Boolean logic with binary variables: $x_{6}, x_{9}, x_{8}$ equal $1$ if the corresponding proposition is true. Which set of linear constraints translates **exactly** the implication $x_{6} \Rightarrow x_{9} \lor x_{8}$, i.e. admits all and only the assignments that make it true?
  1. $x_{9} + x_{8} - x_{6} \ge 0$
  2. $x_{9} - x_{6} \ge 0$ and $x_{8} - x_{6} \ge 0$
  3. $x_{6} - x_{9} - x_{8} \ge 0$
  4. $x_{9} + x_{8} - x_{6} \ge 1$
Explanation. Bring the implication to CNF ($p \Rightarrow q$ is $\lnot p \lor q$), then every clause becomes a constraint $\ge 1$ with $1 - x$ for the negative literals: this gives $x_{9} + x_{8} - x_{6} \ge 0$. A disjunction in the antecedent or a conjunction in the consequent costs two constraints; splitting a conjunctive antecedent is not allowed.
Example 2 · mip-g-implicazione · level facile · notes
Boolean logic with binary variables: $x_{3}, x_{8}, x_{1}$ equal $1$ if the corresponding proposition is true. Which set of linear constraints translates **exactly** the implication $x_{3} \Rightarrow x_{8} \land x_{1}$, i.e. admits all and only the assignments that make it true?
  1. $x_{8} - x_{3} \ge 0$ and $x_{1} - x_{3} \ge 0$
  2. $x_{8} + x_{1} - x_{3} \ge 0$
  3. $x_{3} - x_{8} \ge 0$ and $x_{3} - x_{1} \ge 0$
  4. $x_{8} + x_{1} - x_{3} \ge 1$
Explanation. Bring the implication to CNF ($p \Rightarrow q$ is $\lnot p \lor q$), then every clause becomes a constraint $\ge 1$ with $1 - x$ for the negative literals: this gives $x_{8} - x_{3} \ge 0$ and $x_{1} - x_{3} \ge 0$. A disjunction in the antecedent or a conjunction in the consequent costs two constraints; splitting a conjunctive antecedent is not allowed.
Example 1 · mip-g-progetti-logici · level complessa · notes
Six projects with revenues $r = (7, 12, 9, 6, 10, 11)$ and costs $c = (4, 3, 6, 1, 3, 1)$, budget $b = 14$; $x_p = 1$ if project $p$ is funded ($1$ = true in the implications), the cost of the chosen projects does not exceed $b$ and revenue is maximised. The implications $x_{4} \land x_{2} \Rightarrow x_{1}$ and $x_{5} \Rightarrow \lnot x_{1}$ hold, translated exactly into linear constraints. What is $\zmilp$?
  1. $42$
  2. $39$
  3. $48$
  4. $41$
Explanation. Enumerate the subsets within budget that respect the two implications (the first becomes a single constraint, $x_a + x_b - x_c \le 1$): the optimum is $42$. Without logical constraints it would be $48$; splitting the conjunctive antecedent would cut off allowed solutions.
Example 2 · mip-g-progetti-logici · level complessa · notes
Six projects with revenues $r = (12, 5, 5, 6, 3, 12)$ and costs $c = (4, 4, 1, 2, 4, 1)$, budget $b = 10$; $x_p = 1$ if project $p$ is funded ($1$ = true in the implications), the cost of the chosen projects does not exceed $b$ and revenue is maximised. The implications $x_{4} \land x_{3} \Rightarrow x_{5}$ and $x_{5} \Rightarrow \lnot x_{6}$ hold, translated exactly into linear constraints. What is $\zmilp$?
  1. $34$
  2. $29$
  3. $35$
  4. $33$
Explanation. Enumerate the subsets within budget that respect the two implications (the first becomes a single constraint, $x_a + x_b - x_c \le 1$): the optimum is $34$. Without logical constraints it would be $35$; splitting the conjunctive antecedent would cut off allowed solutions.
Example 1 · mip-g-verifica-conta · level media · notes
A Boolean expression in three binary variables $x_1, x_2, x_3$ ($1$ = true) has been translated into the constraints $x_1 - x_3 \ge 0$ and $x_1 + x_2 + x_3 \le 2$. To check the translation the $8$ assignments are enumerated. How many of them satisfy both constraints?
  1. $5$
  2. $3$
  3. $6$
  4. $4$
Explanation. Enumerating the $8$ assignments, those satisfying both constraints are $5$: they must coincide with those making the expression true. $3$ are the excluded ones.
Example 2 · mip-g-verifica-conta · level media · notes
A Boolean expression in three binary variables $x_1, x_2, x_3$ ($1$ = true) has been translated into the constraints $x_1 + x_2 - x_3 \le 1$ and $x_1 - x_2 - x_3 \ge -1$. To check the translation the $8$ assignments are enumerated. How many of them satisfy both constraints?
  1. $6$
  2. $2$
  3. $7$
  4. $5$
Explanation. Enumerating the $8$ assignments, those satisfying both constraints are $6$: they must coincide with those making the expression true. $2$ are the excluded ones.
Example 1 · mip-g-clausola-rhs · level facile · notes
Binary variables ($1$ = true). The clause $\lnot x_{2} \lor x_{5} \lor \lnot x_{6} \lor x_{8}$ is translated with the rule «positive literal $x$, negated $1 - x$, sum $\ge 1$», then moving the constants to the right: $-x_{2} + x_{5} - x_{6} + x_{8} \ge \beta$. What is $\beta$?
  1. $\beta = -1$
  2. $\beta = 1$
  3. $\beta = -2$
  4. $\beta = 3$
Explanation. Every negated literal brings a $1$ to the left: with $2$ negated literals the right-hand side becomes $1 - 2 = -1$. Thus the only excluded assignment is the one making all literals false.
Example 2 · mip-g-clausola-rhs · level facile · notes
Binary variables ($1$ = true). The clause $x_{1} \lor x_{6} \lor x_{7} \lor \lnot x_{8} \lor x_{9}$ is translated with the rule «positive literal $x$, negated $1 - x$, sum $\ge 1$», then moving the constants to the right: $x_{1} + x_{6} + x_{7} - x_{8} + x_{9} \ge \beta$. What is $\beta$?
  1. $\beta = 0$
  2. $\beta = 1$
  3. $\beta = -1$
  4. $\beta = 2$
Explanation. Every negated literal brings a $1$ to the left: with $1$ negated literals the right-hand side becomes $1 - 1 = 0$. Thus the only excluded assignment is the one making all literals false.
Example 1 · mip-g-cardinalita-clausole · level facile · notes
Binary variables $x_1, \dots, x_{6}$. The condition «at most 3 of the 6» is written with a single cardinality constraint $\sum_i x_i \le 3$. How many clauses would be needed to write it in CNF?
  1. $15$
  2. $20$
  3. $21$
  4. $6$
Explanation. «At most $p$» requires every group of $p + 1$ variables to contain a false one: $\binom{6}{4} = 15$ clauses, against a single cardinality constraint (also stronger in the relaxation).
Example 2 · mip-g-cardinalita-clausole · level facile · notes
Binary variables $x_1, \dots, x_{6}$. The condition «at least 3 of the 6» is written with a single cardinality constraint $\sum_i x_i \ge 3$. How many clauses would be needed to write it in CNF?
  1. $15$
  2. $20$
  3. $21$
  4. $6$
Explanation. «At least $p$» requires every group of $n - p + 1$ variables to contain a true one: $\binom{6}{4} = 15$ clauses, against a single cardinality constraint (also stronger in the relaxation).

6. Links between variables (12)

Example 1 · mip-g-bigm-minimo · level facile · notes
Big-M conditional constraint. The variables $x_{1}, x_{2}, x_{3}, x_{4}$ are integer with $0 \le x_j \le u_j$ and $u = (3, 3, 2, 1)$. The constraint $8x_{1} + 2x_{2} + 6x_{3} + 9x_{4} \le 43$ must hold only when the binary $y$ equals $1$, and it is written $8x_{1} + 2x_{2} + 6x_{3} + 9x_{4} \le 43 + M(1 - y)$: with $y = 0$ it must be satisfied by every $x$ within the bounds. What is the smallest valid $M$, computed from the variable bounds alone?
  1. $8$
  2. $51$
  3. $2$
  4. $94$
Explanation. With $y = 0$ the constraint is switched off only if $M$ is at least the maximum of the left-hand side minus the right-hand side $43$. The maximum of the left-hand side over the bounds is $51$, so $M = 51 - 43 = 8$. Forgetting to subtract the right-hand side gives a valid but improvable $M$; a smaller value cuts off solutions.
Example 2 · mip-g-bigm-minimo · level facile · notes
Big-M conditional constraint. The variables $x_{1}, x_{2}, x_{3}$ are integer with $0 \le x_j \le u_j$ and $u = (1, 3, 2)$. The constraint $4x_{1} + 5x_{2} + 8x_{3} \le 30$ must hold only when the binary $y$ equals $1$, and it is written $4x_{1} + 5x_{2} + 8x_{3} \le 30 + M(1 - y)$: with $y = 0$ it must be satisfied by every $x$ within the bounds. What is the smallest valid $M$, computed from the variable bounds alone?
  1. $5$
  2. $35$
  3. $1$
  4. $65$
Explanation. With $y = 0$ the constraint is switched off only if $M$ is at least the maximum of the left-hand side minus the right-hand side $30$. The maximum of the left-hand side over the bounds is $35$, so $M = 35 - 30 = 5$. Forgetting to subtract the right-hand side gives a valid but improvable $M$; a smaller value cuts off solutions.
Example 1 · mip-g-costo-fisso-valore · level facile · notes
Fixed cost: three plants with fixed costs $f = (14, 18, 14)$, unit costs $c = (4, 1, 4)$ and capacities $C = (9, 9, 10)$; $q_j \ge 0$ is the quantity produced by plant $j$ and $y_j = 1$ if the plant is open. The model minimises $\sum_j (c_j q_j + f_j y_j)$ subject to $q_j \le C_j y_j$ and $y_j \in \{0,1\}$. With the quantities fixed at $q = (0, 8, 2)$, what is the objective value under the best choice of the $y_j$ compatible with the constraints?
  1. $48$
  2. $16$
  3. $62$
  4. $188$
Explanation. A plant that produces must be open ($q_j > 0 \Rightarrow y_j = 1$, imposed by the constraint); one that does not produce is closed, since $f_j > 0$. So one pays the variable cost plus only the fixed costs of the plants with $q_j > 0$: $48$. The fixed cost is not multiplied by the quantity.
Example 2 · mip-g-costo-fisso-valore · level facile · notes
Fixed cost: three plants with fixed costs $f = (11, 6, 17)$, unit costs $c = (6, 3, 4)$ and capacities $C = (6, 10, 10)$; $q_j \ge 0$ is the quantity produced by plant $j$ and $y_j = 1$ if the plant is open. The model minimises $\sum_j (c_j q_j + f_j y_j)$ subject to $q_j \le C_j y_j$ and $y_j \in \{0,1\}$. With the quantities fixed at $q = (4, 9, 0)$, what is the objective value under the best choice of the $y_j$ compatible with the constraints?
  1. $68$
  2. $51$
  3. $85$
  4. $149$
Explanation. A plant that produces must be open ($q_j > 0 \Rightarrow y_j = 1$, imposed by the constraint); one that does not produce is closed, since $f_j > 0$. So one pays the variable cost plus only the fixed costs of the plants with $q_j > 0$: $68$. The fixed cost is not multiplied by the quantity.
Example 1 · mip-g-conteggio-intero · level facile · notes
Integer counting: items of size $a = (6, 8, 8, 2, 8)$ must all be shipped in boxes of capacity $c = 12$, and $w$ is the number of boxes. The model minimises $w$ subject to $\sum_i a_i \le c\, w$ and $w \in \mathbb{Z}_{\ge 0}$. What is the value of $w$ at the optimum?
  1. $3$
  2. $2$
  3. $\tfrac{8}{3}$
  4. $4$
Explanation. The constraint gives $w \ge 32/12$ and integrality raises it to $\lceil 32/12 \rceil = 3$: the ceiling is not written, the declaration of $w$ as integer realises it. The fractional value is that of the relaxation.
Example 2 · mip-g-conteggio-intero · level facile · notes
Integer counting: items of size $a = (8, 4, 2, 5, 8)$ must all be shipped in boxes of capacity $c = 13$, and $w$ is the number of boxes. The model minimises $w$ subject to $\sum_i a_i \le c\, w$ and $w \in \mathbb{Z}_{\ge 0}$. What is the value of $w$ at the optimum?
  1. $3$
  2. $2$
  3. $\tfrac{27}{13}$
  4. $4$
Explanation. The constraint gives $w \ge 27/13$ and integrality raises it to $\lceil 27/13 \rceil = 3$: the ceiling is not written, the declaration of $w$ as integer realises it. The fractional value is that of the relaxation.
Example 1 · mip-g-assoluto-bigm · level facile · notes
Absolute value as a constraint: the continuous variables $u, v$ lie in $[0, 19]$ and we want $|u - v| \ge 11$. With a binary $b$ (choosing which of the two directions holds) one writes $u - v \ge 11 - M(1 - b)$ and $v - u \ge 11 - M\, b$. What is the smallest $M$ valid for both constraints, that is, such that the switched-off constraint is satisfied by every $u, v$ within the bounds?
  1. $30$
  2. $41$
  3. $49$
  4. $19$
Explanation. When a constraint is switched off it must hold for every $u, v$: the first needs $11 - M \le \min (u - v) = -19$, that is $M \ge 11 + 19 = 30$. The $\ge$ case of the absolute value is not convex: it is a disjunction, and the binary is necessary.
Example 2 · mip-g-assoluto-bigm · level facile · notes
Absolute value as a constraint: the continuous variables $u, v$ lie in $[0, 14]$ and we want $|u - v| \ge 11$. With a binary $b$ (choosing which of the two directions holds) one writes $u - v \ge 11 - M(1 - b)$ and $v - u \ge 11 - M\, b$. What is the smallest $M$ valid for both constraints, that is, such that the switched-off constraint is satisfied by every $u, v$ within the bounds?
  1. $25$
  2. $11$
  3. $14$
  4. $28$
Explanation. When a constraint is switched off it must hold for every $u, v$: the first needs $11 - M \le \min (u - v) = -14$, that is $M \ge 11 + 14 = 25$. The $\ge$ case of the absolute value is not convex: it is a disjunction, and the binary is necessary.
Example 1 · mip-g-precedenze-M · level facile · notes
Precedences on one machine: jobs of duration $t = (6, 8, 8, 2)$, $\kappa_i$ is the completion time of job $i$, $s_{ij} = 1$ if $j$ precedes $i$, with $s_{ij} + s_{ji} = 1$, $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ij})$ and $\kappa_j \ge t_j$. The optimum is sought among sequences without idle time. What is the smallest $M$ for which the switched-off constraint ($s_{ij} = 0$) is satisfied by all these sequences?
  1. $24$
  2. $8$
  3. $22$
  4. $16$
Explanation. Without idle time $\kappa_j \le \sum_h t_h$, and with $M = \sum_h t_h = 24$ one has $\kappa_j + t_i - M \le t_i \le \kappa_i$: the switched-off constraint cuts nothing. A smaller value fails when $j$ is the last job and $i$ the first. The horizon must be declared.
Example 2 · mip-g-precedenze-M · level facile · notes
Precedences on one machine: jobs of duration $t = (8, 4, 2, 5)$, $\kappa_i$ is the completion time of job $i$, $s_{ij} = 1$ if $j$ precedes $i$, with $s_{ij} + s_{ji} = 1$, $\kappa_i \ge \kappa_j + t_i - M(1 - s_{ij})$ and $\kappa_j \ge t_j$. The optimum is sought among sequences without idle time. What is the smallest $M$ for which the switched-off constraint ($s_{ij} = 0$) is satisfied by all these sequences?
  1. $19$
  2. $8$
  3. $17$
  4. $11$
Explanation. Without idle time $\kappa_j \le \sum_h t_h$, and with $M = \sum_h t_h = 19$ one has $\kappa_j + t_i - M \le t_i \le \kappa_i$: the switched-off constraint cuts nothing. A smaller value fails when $j$ is the last job and $i$ the first. The horizon must be declared.
Example 1 · mip-g-tratti · level facile · notes
The cost $g(q)$ is continuous and piecewise linear, with breakpoints $(0, 4, 8, 13)$ and values $(0, 24, 32, 37)$ (quantity discounts: it is not convex). The model writes $q = \sum_k q_k \lambda_k$ and $g = \sum_k g_k \lambda_k$ with breakpoint weights $\lambda_k \ge 0$ summing to $1$, one binary $w_t$ per segment ($\sum_t w_t = 1$) and adjacency: only the $\lambda$ of the two breakpoints of the chosen segment are positive. $q = 11$ is fixed. What is $g$?
  1. $35$
  2. $\tfrac{407}{13}$
  3. $38$
  4. $37$
Explanation. With adjacency only the $\lambda$ of the two breakpoints of the segment containing $q$ are positive, and $(q, g)$ lies on the graph: $g(11) = 35$. Without adjacency the model would mix the extreme breakpoints and drop to the lower convex envelope, $\tfrac{407}{13}$.
Example 2 · mip-g-tratti · level facile · notes
The cost $g(q)$ is continuous and piecewise linear, with breakpoints $(0, 3, 8, 11)$ and values $(0, 12, 22, 25)$ (quantity discounts: it is not convex). The model writes $q = \sum_k q_k \lambda_k$ and $g = \sum_k g_k \lambda_k$ with breakpoint weights $\lambda_k \ge 0$ summing to $1$, one binary $w_t$ per segment ($\sum_t w_t = 1$) and adjacency: only the $\lambda$ of the two breakpoints of the chosen segment are positive. $q = 10$ is fixed. What is $g$?
  1. $24$
  2. $\tfrac{250}{11}$
  3. $26$
  4. $25$
Explanation. With adjacency only the $\lambda$ of the two breakpoints of the segment containing $q$ are positive, and $(q, g)$ lies on the graph: $g(10) = 24$. Without adjacency the model would mix the extreme breakpoints and drop to the lower convex envelope, $\tfrac{250}{11}$.
Example 1 · mip-g-se-e-solo-se · level facile · notes
If and only if (product of binaries): the variables $x_{1}, x_{2}, x_{3}, y$ are binary and we want $y = 1$ **if and only if** $x_{1} = x_{2} = x_{3} = 1$ (i.e. $y$ is the product of the $x$). The constraints $y \le x_j$, $j \in \{1, \dots, 3\}$, are already in the model. Which constraint must be added to have the link in both directions in every feasible solution?
  1. $y \ge x_{1} + x_{2} + x_{3} - 2$
  2. $y \ge x_{1} + x_{2} + x_{3} - 3$
  3. $3y \ge x_{1} + x_{2} + x_{3}$
  4. $y \le x_{1} + x_{2} + x_{3} - 2$
Explanation. If all $x_j$ equal $1$ the right-hand side of $y \ge x_{1} + x_{2} + x_{3} - 2$ is $1$ and forces $y = 1$; if at least one is zero it is at most $0$ and says nothing. With $-3$ instead of $-2$ the constraint never bites.
Example 2 · mip-g-se-e-solo-se · level facile · notes
If and only if (product of binaries): the variables $x_{1}, x_{2}, x_{3}, y$ are binary and we want $y = 1$ **if and only if** $x_{1} = x_{2} = x_{3} = 1$ (i.e. $y$ is the product of the $x$). The constraints $y \le x_j$, $j \in \{1, \dots, 3\}$, are already in the model. Which constraint must be added to have the link in both directions in every feasible solution?
  1. $y \ge x_{1} + x_{2} + x_{3} - 2$
  2. $y \ge x_{1} + x_{2} + x_{3} - 3$
  3. $3y \ge x_{1} + x_{2} + x_{3}$
  4. $y \le x_{1} + x_{2} + x_{3} - 2$
Explanation. If all $x_j$ equal $1$ the right-hand side of $y \ge x_{1} + x_{2} + x_{3} - 2$ is $1$ and forces $y = 1$; if at least one is zero it is at most $0$ and says nothing. With $-3$ instead of $-2$ the constraint never bites.
Example 1 · mip-g-disgiunzione · level media · notes
Disjunction with big-M: the variables are integer with $0 \le x_1 \le 4$ and $0 \le x_2 \le 4$, and **at least one** of the constraints $5x_1 + 6x_2 \le 27$ or $x_1 + 5x_2 \le 15$ must hold. With a binary $y$ one writes $5x_1 + 6x_2 \le 27 + M_1(1 - y)$ and $x_1 + 5x_2 \le 15 + M_2\, y$. What are the smallest valid values $(M_1, M_2)$, derived from the bounds?
  1. $(17, 9)$
  2. $(9, 17)$
  3. $(44, 24)$
  4. $(17, 17)$
Explanation. Each constraint, when switched off, must be satisfied by every point of the bounds: $M_1 = 44 - 27 = 17$ and $M_2 = 24 - 15 = 9$. Each constraint has its own $M$; using the larger one for both is valid but weakens the relaxation.
Example 2 · mip-g-disgiunzione · level media · notes
Disjunction with big-M: the variables are integer with $0 \le x_1 \le 3$ and $0 \le x_2 \le 6$, and **at least one** of the constraints $2x_1 + x_2 \le 9$ or $3x_1 + 6x_2 \le 29$ must hold. With a binary $y$ one writes $2x_1 + x_2 \le 9 + M_1(1 - y)$ and $3x_1 + 6x_2 \le 29 + M_2\, y$. What are the smallest valid values $(M_1, M_2)$, derived from the bounds?
  1. $(3, 16)$
  2. $(16, 3)$
  3. $(12, 45)$
  4. $(16, 16)$
Explanation. Each constraint, when switched off, must be satisfied by every point of the bounds: $M_1 = 12 - 9 = 3$ and $M_2 = 45 - 29 = 16$. Each constraint has its own $M$; using the larger one for both is valid but weakens the relaxation.
Example 1 · mip-g-equita · level media · notes
Five jobs of duration $p = (8, 6, 6, 9, 2)$ are split between two workers, each job wholly to one of them; $\ell_k$ is the load of worker $k$. Three models are compared: min-max ($\min z$ with $z \ge \ell_k$ for every $k$), max-min ($\max u$ with $u \le \ell_k$) and range ($\min z - u$ with both groups of constraints). What are the three optimal values, in order?
  1. $(16, 15, 1)$
  2. $(\tfrac{31}{2}, \tfrac{31}{2}, 0)$
  3. $(15, 16, 1)$
  4. $(16, 16, 0)$
Explanation. The total is $31$, odd: the best split is $(16, 15)$, and with two workers all three models choose it. Their values differ, though, $16$, $15$ and $1$: they describe the same solution and are not comparable. $\tfrac{31}{2}$ is the relaxation.
Example 2 · mip-g-equita · level media · notes
Five jobs of duration $p = (7, 8, 8, 3, 9)$ are split between two workers, each job wholly to one of them; $\ell_k$ is the load of worker $k$. Three models are compared: min-max ($\min z$ with $z \ge \ell_k$ for every $k$), max-min ($\max u$ with $u \le \ell_k$) and range ($\min z - u$ with both groups of constraints). What are the three optimal values, in order?
  1. $(18, 17, 1)$
  2. $(\tfrac{35}{2}, \tfrac{35}{2}, 0)$
  3. $(17, 18, 1)$
  4. $(18, 18, 0)$
Explanation. The total is $35$, odd: the best split is $(18, 17)$, and with two workers all three models choose it. Their values differ, though, $18$, $17$ and $1$: they describe the same solution and are not comparable. $\tfrac{35}{2}$ is the relaxation.
Example 1 · mip-g-costo-fisso-ottimo · level complessa · notes
Fixed cost with demand: three plants with fixed costs $f = (14, 18, 15)$, unit costs $c = (3, 1, 4)$, capacities $C = (8, 8, 9)$; the demand $D = 10$ must be met; $q_j$ is the quantity produced by plant $j$ and $y_j = 1$ if it is open. The model is $\min \sum_j (f_j y_j + c_j q_j)$ subject to $\sum_j q_j = D$, $q_j \le C_j y_j$, $q_j \ge 0$, $y_j \in \{0,1\}$. What is $\zmilp$?
  1. $46$
  2. $\tfrac{71}{2}$
  3. $61$
  4. $14$
Explanation. For every set of open plants with enough capacity, fill the cheapest per unit first and add the fixed costs: the best is $46$. The fractional value $\tfrac{71}{2}$ is $\zlpp$, where every plant costs $c_j + f_j/C_j$ per unit.
Example 2 · mip-g-costo-fisso-ottimo · level complessa · notes
Fixed cost with demand: three plants with fixed costs $f = (11, 7, 17)$, unit costs $c = (5, 2, 4)$, capacities $C = (5, 9, 9)$; the demand $D = 19$ must be met; $q_j$ is the quantity produced by plant $j$ and $y_j = 1$ if it is open. The model is $\min \sum_j (f_j y_j + c_j q_j)$ subject to $\sum_j q_j = D$, $q_j \le C_j y_j$, $q_j \ge 0$, $y_j \in \{0,1\}$. What is $\zmilp$?
  1. $94$
  2. $\tfrac{426}{5}$
  3. $59$
  4. $95$
Explanation. For every set of open plants with enough capacity, fill the cheapest per unit first and add the fixed costs: the best is $94$. The fractional value $\tfrac{426}{5}$ is $\zlpp$, where every plant costs $c_j + f_j/C_j$ per unit.
Example 1 · mip-g-deviazioni · level media · notes
Soft constraints: three targets $\beta = (40, 90, 60)$ are written $a_t'x + s_t^- - s_t^+ = \beta_t$ with $s_t^-, s_t^+ \ge 0$; a penalty $\pi^- = 6$ per unit below the target and $\pi^+ = 2$ per unit above, in a minimisation objective. A plan gives $a'x = (30, 100, 75)$. What is the total penalty, with the deviations at their optimal value?
  1. $110$
  2. $170$
  3. $210$
  4. $10$
Explanation. For each target only one deviation is used: $s^- = \max(0, \beta - a'x)$ paid $6$, $s^+ = \max(0, a'x - \beta)$ paid $2$. Total $110$. Swapping the penalties, or offsetting deviations of opposite sign, gives wrong values.
Example 2 · mip-g-deviazioni · level media · notes
Soft constraints: three targets $\beta = (50, 50, 50)$ are written $a_t'x + s_t^- - s_t^+ = \beta_t$ with $s_t^-, s_t^+ \ge 0$; a penalty $\pi^- = 5$ per unit below the target and $\pi^+ = 4$ per unit above, in a minimisation objective. A plan gives $a'x = (60, 35, 65)$. What is the total penalty, with the deviations at their optimal value?
  1. $175$
  2. $185$
  3. $200$
  4. $-25$
Explanation. For each target only one deviation is used: $s^- = \max(0, \beta - a'x)$ paid $5$, $s^+ = \max(0, a'x - \beta)$ paid $4$. Total $175$. Swapping the penalties, or offsetting deviations of opposite sign, gives wrong values.
Example 1 · mip-g-violabili-ottimo · level complessa · notes
One decides the integer production $q \in \{0, \dots, 20\}$ of a period. A fixed cost $f = 60$ is paid if $q > 0$ (link $q \le 20\,y$, $y$ binary) and $c = 5$ per unit. The demand $D = 15$ is a soft constraint: each missing unit costs $\pi^- = 13$; the regular capacity $K = 5$ can be exceeded with overtime at $\pi^+ = 2$ per unit beyond $K$. What is the minimum cost?
  1. $155$
  2. $95$
  3. $135$
  4. $195$
Explanation. The cost is $f[q > 0] + 5q + 13\max(0, 15 - q) + 2\max(0, q - 5)$; enumerating $q$ (it suffices to look at $q \in \{0, 5, 15\}$, the breakpoints) the minimum is $155$, with $q = 15$. Forgetting the fixed cost gives $95$, forgetting overtime $135$.
Example 2 · mip-g-violabili-ottimo · level complessa · notes
One decides the integer production $q \in \{0, \dots, 20\}$ of a period. A fixed cost $f = 70$ is paid if $q > 0$ (link $q \le 20\,y$, $y$ binary) and $c = 5$ per unit. The demand $D = 16$ is a soft constraint: each missing unit costs $\pi^- = 11$; the regular capacity $K = 13$ can be exceeded with overtime at $\pi^+ = 7$ per unit beyond $K$. What is the minimum cost?
  1. $168$
  2. $98$
  3. $150$
  4. $171$
Explanation. The cost is $f[q > 0] + 5q + 11\max(0, 16 - q) + 7\max(0, q - 13)$; enumerating $q$ (it suffices to look at $q \in \{0, 13, 16\}$, the breakpoints) the minimum is $168$, with $q = 13$. Forgetting the fixed cost gives $98$, forgetting overtime $150$.

Fifteen numerical models (4)

Example 1 · mip-g-turni-costo · level facile · notes
Emergency room shifts: the pattern starting on Tuesday works full time on Tuesday, Wednesday, Thursday, Friday, half time on Saturday and rests on Sunday and Monday. A full day costs $120$ euro on weekdays, $130$ on Saturday and $160$ on Sunday; at half time the day's cost is halved. How much does the pattern cost per worker, in one week?
  1. $545$
  2. $610$
  3. $480$
  4. $560$
Explanation. Add the four full days, $480$, and half of the half-time day, $65$: total $545$. The typical mistakes are paying the half shift in full, forgetting it, or halving the wrong day.
Example 2 · mip-g-turni-costo · level facile · notes
Emergency room shifts: the pattern starting on Monday works full time on Monday, Tuesday, Wednesday, Thursday, half time on Friday and rests on Saturday and Sunday. A full day costs $90$ euro on weekdays, $120$ on Saturday and $130$ on Sunday; at half time the day's cost is halved. How much does the pattern cost per worker, in one week?
  1. $405$
  2. $450$
  3. $360$
  4. $420$
Explanation. Add the four full days, $360$, and half of the half-time day, $45$: total $405$. The typical mistakes are paying the half shift in full, forgetting it, or halving the wrong day.
Example 1 · mip-g-furgone · level complessa · notes
A van with $7$ seats. Some groups offer a price to board, all together or none (group 1: $3$ people, $60$ euro; group 2: $2$ people, $50$ euro; group 3: $3$ people, $70$ euro; group 4: $2$ people, $70$ euro). At most $2$ groups are accepted and, if group 4 is accepted, group 1 must be accepted too. With $x_j = 1$ if group $j$ is accepted and the constraints translated exactly, what is the maximum revenue $\zmilp$?
  1. $130$
  2. $140$
  3. $180$
  4. $120$
Explanation. Enumerate the subsets of at most $2$ groups that fit in the seats and respect $x_{4} \le x_{1}$: the best earns $130$. Forgetting the implication gives $140$, forgetting the limit on the number of groups gives $180$.
Example 2 · mip-g-furgone · level complessa · notes
A van with $10$ seats. Some groups offer a price to board, all together or none (group 1: $5$ people, $30$ euro; group 2: $5$ people, $80$ euro; group 3: $4$ people, $70$ euro; group 4: $2$ people, $80$ euro; group 5: $4$ people, $40$ euro). At most $2$ groups are accepted and, if group 2 is accepted, group 3 must be accepted too. With $x_j = 1$ if group $j$ is accepted and the constraints translated exactly, what is the maximum revenue $\zmilp$?
  1. $150$
  2. $160$
  3. $190$
  4. $140$
Explanation. Enumerate the subsets of at most $2$ groups that fit in the seats and respect $x_{2} \le x_{3}$: the best earns $150$. Forgetting the implication gives $160$, forgetting the limit on the number of groups gives $190$.
Example 1 · mip-g-staffetta-ottimo · level media · notes
Three tasks to be given to three different resources chosen among four, at minimum total time (assignment with more resources than tasks). Times, rows per task: $(36, 37, 41, 43)$, $(27, 41, 38, 38)$, $(43, 25, 43, 28)$. The dual of the relaxation with the resource variables at zero gives each task its minimum time: its value is $\lb$. What are $(\zmilp, \lb)$, with $\zmilp$ the optimal total time?
  1. $(92, 88)$
  2. $(88, 92)$
  3. $(99, 88)$
  4. $(92, 87)$
Explanation. Enumerating the assignments with distinct resources the optimum is $92$; the sum of the row minima gives $\lb = 88$, lower when two tasks share the same best resource. The task-by-task heuristic would give $99$.
Example 2 · mip-g-staffetta-ottimo · level media · notes
Three tasks to be given to three different resources chosen among four, at minimum total time (assignment with more resources than tasks). Times, rows per task: $(40, 31, 30, 29)$, $(45, 27, 44, 35)$, $(40, 40, 41, 26)$. The dual of the relaxation with the resource variables at zero gives each task its minimum time: its value is $\lb$. What are $(\zmilp, \lb)$, with $\zmilp$ the optimal total time?
  1. $(83, 82)$
  2. $(82, 83)$
  3. $(96, 82)$
  4. $(83, 81)$
Explanation. Enumerating the assignments with distinct resources the optimum is $83$; the sum of the row minima gives $\lb = 82$, lower when two tasks share the same best resource. The task-by-task heuristic would give $96$.
Example 1 · mip-g-fondi-rendimento · level facile · notes
Funds in lots (EX 5): indivisible lots of $12$, $15$, $18$, $25$ million with annual return $1/6$, $1/3$, $1/9$ and $16\%$ of the capital invested; budget $100$; the lots of the second fund do not exceed $50\%$ of the total lots. The portfolio $x = (0, 2, 1, 1)$ (lots per fund) is feasible. What is its annual return, in millions?
  1. $16$
  2. $73$
  3. $\tfrac{211}{225}$
  4. $43$
Explanation. One lot yields $(2, 5, 2, 4)$ million: $16$. The expense ($73$) is not the return, and summing rates times lots forgets the capital of each lot.
Example 2 · mip-g-fondi-rendimento · level facile · notes
Funds in lots (EX 5): indivisible lots of $12$, $15$, $18$, $25$ million with annual return $1/6$, $1/3$, $1/9$ and $16\%$ of the capital invested; budget $100$; the lots of the second fund do not exceed $50\%$ of the total lots. The portfolio $x = (2, 2, 0, 1)$ (lots per fund) is feasible. What is its annual return, in millions?
  1. $18$
  2. $79$
  3. $\tfrac{29}{25}$
  4. $39$
Explanation. One lot yields $(2, 5, 2, 4)$ million: $18$. The expense ($79$) is not the return, and summing rates times lots forgets the capital of each lot.

7. Assignment and scheduling (3)

Example 1 · mip-g-conteggio-scheduling · level facile · notes
Assignment of jobs to machines with a fixed cost: $x_{jm} = 1$ if job $j$ goes on machine $m$, $y_m = 1$ if machine $m$ is used, $t_{jm}$ is the time of job $j$ on $m$ and $a_m$ the availability of $m$. The constraint families are $\sum_{m} x_{jm} = 1\ \forall j$, $\ \sum_{j} t_{jm} x_{jm} \le a_m y_m\ \forall m$; the variables are $x_{jm}$ and $y_m$ binary. With $n = 7$ jobs and $k = 3$ machines, how many linear constraints does the model have, domain constraints excluded?
  1. $10$
  2. $24$
  3. $7$
  4. $11$
Explanation. Count family by family, following the quantifiers: "$\forall j$" gives one row (or variable) per element, "$\forall j, m$" one per pair, a constraint without quantifier just one. The total is $10$. The typical mistakes are counting ordered pairs instead of unordered ones and forgetting a family (or an auxiliary variable).
Example 2 · mip-g-conteggio-scheduling · level facile · notes
Parallel jobs on machines: $x_{jm} = 1$ if job $j$ goes on machine $m$, $y_m$ is the time of machine $m$ (the maximum of the times $t_{jm}$ of its jobs), $p_m$ the maximum number of jobs on $m$. The constraint families are $\sum_{m} x_{jm} = 1\ \forall j$, $\ \sum_{j} x_{jm} \le p_m\ \forall m$, $\ y_m \ge t_{jm} x_{jm}\ \forall j, m$; the variables are $x_{jm}$ binary and $y_m \ge 0$. With $n = 7$ jobs and $k = 2$ machines, how many variables does the model have?
  1. $16$
  2. $14$
  3. $21$
  4. $9$
Explanation. Count family by family, following the quantifiers: "$\forall j$" gives one row (or variable) per element, "$\forall j, m$" one per pair, a constraint without quantifier just one. The total is $16$. The typical mistakes are counting ordered pairs instead of unordered ones and forgetting a family (or an auxiliary variable).
Example 1 · mip-g-ritardo-totale · level complessa · notes
Total tardiness on one machine: four jobs with durations $t = (7, 2, 7, 3)$ and due dates $d = (6, 2, 3, 7)$, processed one at a time without interruption from time $0$. $\kappa_j$ is the completion time of job $j$ and the model minimises $\sum_j \tau_j$ subject to $\tau_j \ge \kappa_j - d_j$, $\tau_j \ge 0$ and the big-M precedence constraints. What is $\zmilp$, the minimum total tardiness?
  1. $22$
  2. $28$
  3. $33$
  4. $16$
Explanation. At the optimum $\tau_j = \max\{0, \kappa_j - d_j\}$ and a sequence without idle time is best: it suffices to compare the $24$ sequences. The minimum total tardiness is $22$; ordering by due date or by duration is only a heuristic and may give more.
Example 2 · mip-g-ritardo-totale · level complessa · notes
Total tardiness on one machine: four jobs with durations $t = (7, 6, 5, 7)$ and due dates $d = (19, 4, 23, 22)$, processed one at a time without interruption from time $0$. $\kappa_j$ is the completion time of job $j$ and the model minimises $\sum_j \tau_j$ subject to $\tau_j \ge \kappa_j - d_j$, $\tau_j \ge 0$ and the big-M precedence constraints. What is $\zmilp$, the minimum total tardiness?
  1. $4$
  2. $10$
  3. $12$
  4. $2$
Explanation. At the optimum $\tau_j = \max\{0, \kappa_j - d_j\}$ and a sequence without idle time is best: it suffices to compare the $24$ sequences. The minimum total tardiness is $4$; ordering by due date or by duration is only a heuristic and may give more.
Example 1 · mip-g-ritardo-sequenza · level facile · notes
One machine, four jobs with durations $t = (6, 8, 3, 6)$ and due dates $d = (12, 7, 9, 9)$, processed without interruption from $0$ in the order $3, 2, 1, 4$. The tardiness of job $j$ is $\tau_j = \max\{0, \kappa_j - d_j\}$, with $\kappa_j$ the completion time. What is the total tardiness $\sum_j \tau_j$?
  1. $23$
  2. $17$
  3. $14$
  4. $8$
Explanation. Compute the completions in the given order and add only the positive parts of $\kappa_j - d_j$: $23$. Adding the (negative) earliness too gives $17$; the maximum tardiness is another objective; using start times instead of completions is a mistake.
Example 2 · mip-g-ritardo-sequenza · level facile · notes
One machine, four jobs with durations $t = (4, 4, 4, 7)$ and due dates $d = (14, 4, 15, 12)$, processed without interruption from $0$ in the order $4, 3, 2, 1$. The tardiness of job $j$ is $\tau_j = \max\{0, \kappa_j - d_j\}$, with $\kappa_j$ the completion time. What is the total tardiness $\sum_j \tau_j$?
  1. $16$
  2. $7$
  3. $11$
  4. $8$
Explanation. Compute the completions in the given order and add only the positive parts of $\kappa_j - d_j$: $16$. Adding the (negative) earliness too gives $7$; the maximum tardiness is another objective; using start times instead of completions is a mistake.

8. Location and covering (4)

Example 1 · mip-g-conteggio-localizzazione · level facile · notes
p-median: $x_l = 1$ if site $l$ is open, $y_{lc} = 1$ if customer $c$ is served by site $l$, at most $k$ open sites. The constraint families are $\sum_{l} y_{lc} = 1\ \forall c$, $\ \sum_{l} x_l \le k$, $\ x_l \ge y_{lc}\ \forall l, c$; the variables are $x_l$ and $y_{lc}$ binary. With $m = 5$ candidate sites and $n = 4$ customers, how many linear constraints does the model have, domain constraints excluded?
  1. $25$
  2. $10$
  3. $24$
  4. $26$
Explanation. Count family by family, following the quantifiers: "$\forall j$" gives one row (or variable) per element, "$\forall j, m$" one per pair, a constraint without quantifier just one. The total is $25$. The typical mistakes are counting ordered pairs instead of unordered ones and forgetting a family (or an auxiliary variable).
Example 2 · mip-g-conteggio-localizzazione · level facile · notes
p-median: $x_l = 1$ if site $l$ is open, $y_{lc} = 1$ if customer $c$ is served by site $l$, at most $k$ open sites. The constraint families are $\sum_{l} y_{lc} = 1\ \forall c$, $\ \sum_{l} x_l \le k$, $\ x_l \ge y_{lc}\ \forall l, c$; the variables are $x_l$ and $y_{lc}$ binary. With $m = 7$ candidate sites and $n = 2$ customers, how many variables does the model have?
  1. $21$
  2. $14$
  3. $16$
  4. $9$
Explanation. Count family by family, following the quantifiers: "$\forall j$" gives one row (or variable) per element, "$\forall j, m$" one per pair, a constraint without quantifier just one. The total is $21$. The typical mistakes are counting ordered pairs instead of unordered ones and forgetting a family (or an auxiliary variable).
Example 1 · mip-g-pmediana-bound · level media · notes
p-median (minimisation) with $3$ candidate sites, $4$ customers and at most $k = 2$ open sites; every customer goes to the nearest open site and the sum of the distances $d_{lc}$ is minimised. Rows per site: site 1 $(7, 7, 10, 11)$, site 2 $(2, 10, 8, 8)$, site 3 $(11, 1, 11, 3)$. A heuristic opens sites 1 and 2; in the dual of the relaxation every customer gets $\bar\mu_c = \min_l d_{lc}$, the distance from the nearest site of all, which is feasible. What are $(\ub, \lb)$?
  1. $(25, 14)$
  2. $(14, 25)$
  3. $(38, 14)$
  4. $(25, 4)$
Explanation. With the open sites every customer takes the nearer of the two: $\ub = 25$. The dual sums the column minima over all sites: $\lb = 14$. Assigning the customer to the farther open site, or using a single minimum for everyone, does not give correct bounds.
Example 2 · mip-g-pmediana-bound · level media · notes
p-median (minimisation) with $3$ candidate sites, $4$ customers and at most $k = 2$ open sites; every customer goes to the nearest open site and the sum of the distances $d_{lc}$ is minimised. Rows per site: site 1 $(4, 7, 10, 9)$, site 2 $(1, 10, 4, 1)$, site 3 $(2, 12, 11, 10)$. A heuristic opens sites 1 and 3; in the dual of the relaxation every customer gets $\bar\mu_c = \min_l d_{lc}$, the distance from the nearest site of all, which is feasible. What are $(\ub, \lb)$?
  1. $(28, 13)$
  2. $(13, 28)$
  3. $(37, 13)$
  4. $(28, 4)$
Explanation. With the open sites every customer takes the nearer of the two: $\ub = 28$. The dual sums the column minima over all sites: $\lb = 13$. Assigning the customer to the farther open site, or using a single minimum for everyone, does not give correct bounds.
Example 1 · mip-g-ufl-costo · level facile · notes
Location (minimum cost): $3$ candidate sites with installation cost $i = (60, 60, 80)$, $4$ customers with demand $d = (8, 2, 8, 6)$ litres, transport cost per litre $t_{lc}$ (rows per site): site 1 $(4, 6, 1, 6)$, site 2 $(2, 2, 1, 1)$, site 3 $(2, 4, 1, 3)$. Capacities are sufficient and each customer is supplied by the cheapest open site. Sites 2 and 3 are installed. What does the solution cost?
  1. $174$
  2. $34$
  3. $190$
  4. $146$
Explanation. Installation $140$ plus transport $\sum_c d_c \min_{l \text{ open}} t_{lc} = 34$: total $174$. Forgetting installation, using the dearer site or not multiplying by demand are the typical mistakes.
Example 2 · mip-g-ufl-costo · level facile · notes
Location (minimum cost): $3$ candidate sites with installation cost $i = (50, 80, 40)$, $4$ customers with demand $d = (2, 5, 8, 8)$ litres, transport cost per litre $t_{lc}$ (rows per site): site 1 $(4, 6, 5, 4)$, site 2 $(6, 5, 1, 6)$, site 3 $(6, 5, 5, 2)$. Capacities are sufficient and each customer is supplied by the cheapest open site. Sites 2 and 3 are installed. What does the solution cost?
  1. $181$
  2. $61$
  3. $245$
  4. $134$
Explanation. Installation $120$ plus transport $\sum_c d_c \min_{l \text{ open}} t_{lc} = 61$: total $181$. Forgetting installation, using the dearer site or not multiplying by demand are the typical mistakes.
Example 1 · mip-g-ufl-ottimo · level complessa · notes
Location (minimum cost): $3$ candidate sites with installation cost $i = (60, 60, 80)$, $4$ customers with demand $d = (8, 2, 8, 6)$ litres, transport cost per litre $t_{lc}$ (rows per site): site 1 $(4, 6, 1, 6)$, site 2 $(2, 2, 1, 1)$, site 3 $(2, 4, 1, 3)$. Sufficient capacities; at least one site must be installed and each customer is supplied by an installed site. What is the minimum cost $\zmilp$?
  1. $94$
  2. $234$
  3. $34$
  4. $104$
Explanation. Enumerate the $7$ non-empty subsets of sites; for each the cost is installation plus $\sum_c d_c \min_l t_{lc}$ over the open sites. The minimum is $94$. Transport alone with all sites free ($34$) is a lower bound, not the optimum.
Example 2 · mip-g-ufl-ottimo · level complessa · notes
Location (minimum cost): $3$ candidate sites with installation cost $i = (50, 80, 40)$, $4$ customers with demand $d = (2, 5, 8, 8)$ litres, transport cost per litre $t_{lc}$ (rows per site): site 1 $(4, 6, 5, 4)$, site 2 $(6, 5, 1, 6)$, site 3 $(6, 5, 5, 2)$. Sufficient capacities; at least one site must be installed and each customer is supplied by an installed site. What is the minimum cost $\zmilp$?
  1. $133$
  2. $227$
  3. $57$
  4. $143$
Explanation. Enumerate the $7$ non-empty subsets of sites; for each the cost is installation plus $\sum_c d_c \min_l t_{lc}$ over the open sites. The minimum is $133$. Transport alone with all sites free ($57$) is a lower bound, not the optimum.

9. Production planning (4)

Example 1 · mip-g-lotti-bigM · level facile · notes
Lot sizing with a fixed setup cost over $n = 4$ periods: demands $d = (15, 35, 30, 35)$, initial stock $r_0 = 10$, required final stock $r_n = 15$, positive holding costs. $x_t$ is the production of period $t$, $y_t = 1$ if production is launched in the period, and the setup is modelled with $x_t \le M_t\, y_t$. What is the smallest $M_{3}$, read from the data, that cuts off no optimal solution?
  1. $80$
  2. $70$
  3. $65$
  4. $130$
Explanation. At an optimum one never produces more than the demand still to be covered: $M_t = \sum_{\tau \ge t} d_\tau + r_n$; only in the first period is the initial stock, which is a datum, subtracted. Here $M_{3} = 80$. A larger value is valid but weakens the relaxation.
Example 2 · mip-g-lotti-bigM · level facile · notes
Lot sizing with a fixed setup cost over $n = 4$ periods: demands $d = (35, 15, 5, 20)$, initial stock $r_0 = 15$, required final stock $r_n = 15$, positive holding costs. $x_t$ is the production of period $t$, $y_t = 1$ if production is launched in the period, and the setup is modelled with $x_t \le M_t\, y_t$. What is the smallest $M_{3}$, read from the data, that cuts off no optimal solution?
  1. $40$
  2. $25$
  3. $90$
  4. $20$
Explanation. At an optimum one never produces more than the demand still to be covered: $M_t = \sum_{\tau \ge t} d_\tau + r_n$; only in the first period is the initial stock, which is a datum, subtracted. Here $M_{3} = 40$. A larger value is valid but weakens the relaxation.
Example 1 · mip-g-lotti-luc · level media · notes
Uncapacitated lot sizing over $4$ periods: demands $d = (40, 20, 20, 10)$, no initial stock, setup cost $f = 40$ for every period with production, holding cost $h = 2$ per unit and period. The least unit cost rule starts from the first uncovered period, chooses to cover $1, 2, \dots$ periods with the lowest average cost per unit (setup plus holding, divided by the units) — ties: the smallest number — and restarts from the next period. What total setup and holding cost does it obtain?
  1. $160$
  2. $140$
  3. $220$
  4. $200$
Explanation. The rule launches in periods 1, 2, 3, 4 and costs $160$: it is an upper bound. The optimum (Wagner–Whitin) is $140$, so here the heuristic is not optimal: it looks at one launch at a time and never goes back.
Example 2 · mip-g-lotti-luc · level media · notes
Uncapacitated lot sizing over $4$ periods: demands $d = (20, 35, 20, 10)$, no initial stock, setup cost $f = 50$ for every period with production, holding cost $h = 2$ per unit and period. The least unit cost rule starts from the first uncovered period, chooses to cover $1, 2, \dots$ periods with the lowest average cost per unit (setup plus holding, divided by the units) — ties: the smallest number — and restarts from the next period. What total setup and holding cost does it obtain?
  1. $190$
  2. $170$
  3. $200$
  4. $260$
Explanation. The rule launches in periods 1, 3 and costs $190$: it is an upper bound. The optimum (Wagner–Whitin) is $170$, so here the heuristic is not optimal: it looks at one launch at a time and never goes back.
Example 1 · mip-g-lot-bilancio · level facile · notes
Lot sizing over $4$ periods: initial stock $r_0 = 10$, production $x = (35, 35, 50, 15)$, demand $d = (25, 10, 15, 20)$. The balance is $r_{t-1} + x_t = d_t + r_t$, with $r_t$ the stock at the end of period $t$. What is $r_3$?
  1. $80$
  2. $95$
  3. $130$
  4. $75$
Explanation. $r_3 = r_0 + x_1 + x_2 + x_3 - d_1 - d_2 - d_3 = 80$. Forgetting the demand of period 3, or all demands, are the typical mistakes; $75$ is the stock at the end of period 4.
Example 2 · mip-g-lot-bilancio · level facile · notes
Lot sizing over $4$ periods: initial stock $r_0 = 15$, production $x = (45, 5, 50, 35)$, demand $d = (30, 35, 40, 30)$. The balance is $r_{t-1} + x_t = d_t + r_t$, with $r_t$ the stock at the end of period $t$. What is $r_3$?
  1. $10$
  2. $50$
  3. $115$
  4. $15$
Explanation. $r_3 = r_0 + x_1 + x_2 + x_3 - d_1 - d_2 - d_3 = 10$. Forgetting the demand of period 3, or all demands, are the typical mistakes; $15$ is the stock at the end of period 4.
Example 1 · mip-g-lotto-costo · level facile · notes
Uncapacitated lot sizing over $4$ periods, no initial or final stock: demand $d = (25, 30, 35, 40)$, production plan $x = (130, 0, 0, 0)$. Every period with $x_t > 0$ pays the setup $f = 80$ ($x_t \le M y_t$) and each unit in stock at the end of a period costs $h = 2$. What does the plan cost?
  1. $520$
  2. $80$
  3. $600$
  4. $960$
Explanation. Setups: $1 \cdot 80 = 80$; end-of-period stocks from $r_t = r_{t-1} + x_t - d_t$, summed and multiplied by $2$: $440$. Total $520$.
Example 2 · mip-g-lotto-costo · level facile · notes
Uncapacitated lot sizing over $4$ periods, no initial or final stock: demand $d = (20, 35, 20, 10)$, production plan $x = (75, 0, 0, 10)$. Every period with $x_t > 0$ pays the setup $f = 80$ ($x_t \le M y_t$) and each unit in stock at the end of a period costs $h = 2$. What does the plan cost?
  1. $310$
  2. $160$
  3. $390$
  4. $460$
Explanation. Setups: $2 \cdot 80 = 160$; end-of-period stocks from $r_t = r_{t-1} + x_t - d_t$, summed and multiplied by $2$: $150$. Total $310$.

10. Mixed problems (4)

Example 1 · mip-g-scaffali-valore · level facile · notes
Books on shelves: books of height $h = (31, 31, 33, 18, 17, 17)$ and width $w = (6, 5, 2, 3, 3, 4)$, $m = 3$ shelves of width $c = 14$; $x_{bs} = 1$ if book $b$ goes on shelf $s$, $y_s \ge 0$ is the height of the shelf, and the model minimises $\sum_s y_s$ subject to $y_s \ge h_b\, x_{bs}$ for every pair. The shelves assigned to the books, in order, are $(1, 2, 3, 1, 2, 2)$ (a feasible assignment). What is the objective value with the best $y_s$ for this assignment?
  1. $95$
  2. $147$
  3. $99$
  4. $68$
Explanation. The constraints give $y_s \ge \max_{b : x_{bs} = 1} h_b$ and minimisation brings each $y_s$ down to that maximum: the height of a shelf is that of its tallest book. The sum is $95$.
Example 2 · mip-g-scaffali-valore · level facile · notes
Books on shelves: books of height $h = (21, 33, 34, 33, 35)$ and width $w = (2, 5, 5, 5, 6)$, $m = 3$ shelves of width $c = 14$; $x_{bs} = 1$ if book $b$ goes on shelf $s$, $y_s \ge 0$ is the height of the shelf, and the model minimises $\sum_s y_s$ subject to $y_s \ge h_b\, x_{bs}$ for every pair. The shelves assigned to the books, in order, are $(2, 2, 2, 1, 3)$ (a feasible assignment). What is the objective value with the best $y_s$ for this assignment?
  1. $102$
  2. $156$
  3. $105$
  4. $89$
Explanation. The constraints give $y_s \ge \max_{b : x_{bs} = 1} h_b$ and minimisation brings each $y_s$ down to that maximum: the height of a shelf is that of its tallest book. The sum is $102$.
Example 1 · mip-g-asta-bound · level media · notes
Combinatorial auction (maximisation): items $1, \dots, 4$, each sold at most once; every bid buys a set $B_j$ of items at price $p_j$: $\{3,4\}$: $4$; $\{2,3,4\}$: $3$; $\{1,2,3\}$: $4$; $\{3\}$: $4$; $\{2,4\}$: $3$. The heuristic sorts the bids by decreasing $p_j / |B_j|$ (equal ratios in the listed order) and accepts those whose items are still free. In the dual of the relaxation ($\lambda_i \ge 0$ price of item $i$, $\sum_{i \in B_j} \lambda_i \ge p_j$) one sets $\bar\lambda_i = \max_{j : i \in B_j} p_j / |B_j|$ ($0$ if no bid contains $i$). What are $(\lb, \ub)$?
  1. $(7, \tfrac{53}{6})$
  2. $(\tfrac{53}{6}, 7)$
  3. $(7, 16)$
  4. $(4, \tfrac{53}{6})$
Explanation. The heuristic accepts compatible bids: $\lb = 7$. The dual sums the prices $\bar\lambda_i$: $\ub = \tfrac{53}{6}$, feasible because every bid receives at least $|B_j| \cdot p_j/|B_j| = p_j$. Without dividing by $|B_j|$ the bound rises to $16$; sorting by price instead of ratio gives $4$.
Example 2 · mip-g-asta-bound · level media · notes
Combinatorial auction (maximisation): items $1, \dots, 4$, each sold at most once; every bid buys a set $B_j$ of items at price $p_j$: $\{1,2\}$: $6$; $\{1,2,4\}$: $4$; $\{3\}$: $15$; $\{2,4\}$: $15$; $\{4\}$: $12$. The heuristic sorts the bids by decreasing $p_j / |B_j|$ (equal ratios in the listed order) and accepts those whose items are still free. In the dual of the relaxation ($\lambda_i \ge 0$ price of item $i$, $\sum_{i \in B_j} \lambda_i \ge p_j$) one sets $\bar\lambda_i = \max_{j : i \in B_j} p_j / |B_j|$ ($0$ if no bid contains $i$). What are $(\lb, \ub)$?
  1. $(33, \tfrac{75}{2})$
  2. $(\tfrac{75}{2}, 33)$
  3. $(33, 51)$
  4. $(30, \tfrac{75}{2})$
Explanation. The heuristic accepts compatible bids: $\lb = 33$. The dual sums the prices $\bar\lambda_i$: $\ub = \tfrac{75}{2}$, feasible because every bid receives at least $|B_j| \cdot p_j/|B_j| = p_j$. Without dividing by $|B_j|$ the bound rises to $51$; sorting by price instead of ratio gives $30$.
Example 1 · mip-g-cd-differenza · level facile · notes
Tracks of duration $d = (6, 8, 8, 6, 2, 3)$ minutes distributed over two CDs (minimum difference between the duration of the longest and the shortest CD, $z_{\max} - z_{\min}$ with $z_{\max} \ge L_j$ and $z_{\min} \le L_j$). The tracks go, in order, onto CDs $(2, 1, 2, 2, 2, 1)$. What is the objective for this assignment?
  1. $11$
  2. $22$
  3. $1$
  4. $33$
Explanation. The CD durations are $11$ and $22$; at the optimum for this assignment $z_{\max} = 22$ and $z_{\min} = 11$, difference $11$. $z_{\max}$ alone is the makespan, not the spread.
Example 2 · mip-g-cd-differenza · level facile · notes
Tracks of duration $d = (8, 2, 8, 7, 8, 8)$ minutes distributed over two CDs (minimum difference between the duration of the longest and the shortest CD, $z_{\max} - z_{\min}$ with $z_{\max} \ge L_j$ and $z_{\min} \le L_j$). The tracks go, in order, onto CDs $(1, 1, 2, 2, 2, 2)$. What is the objective for this assignment?
  1. $21$
  2. $31$
  3. $1$
  4. $41$
Explanation. The CD durations are $10$ and $31$; at the optimum for this assignment $z_{\max} = 31$ and $z_{\min} = 10$, difference $21$. $z_{\max}$ alone is the makespan, not the spread.
Example 1 · mip-g-premi-punti · level facile · notes
Loyalty programme: reward $i$ is obtained in mode A with $a_i$ points, or in mode B with $b_i$ points plus $c_i$ euro ($x_i + y_i \le 1$). Data $a = (60, 30, 90, 40, 60)$, $b = (40, 10, 80, 30, 50)$, $c = (5, 4, 6, 1, 3)$. The customer chooses, reward by reward, the modes $(B, A, –, –, A)$ («–» = reward not taken). How many points are spent?
  1. $130$
  2. $150$
  3. $100$
  4. $135$
Explanation. Points $\sum_i (a_i x_i + b_i y_i) = 130$; the euros ($5$) are not points. Counting all taken rewards with $a_i$, or all with $b_i$, ignores the chosen mode.
Example 2 · mip-g-premi-punti · level facile · notes
Loyalty programme: reward $i$ is obtained in mode A with $a_i$ points, or in mode B with $b_i$ points plus $c_i$ euro ($x_i + y_i \le 1$). Data $a = (50, 50, 90, 80, 70)$, $b = (30, 30, 70, 70, 50)$, $c = (2, 5, 4, 6, 2)$. The customer chooses, reward by reward, the modes $(–, A, B, B, A)$ («–» = reward not taken). How many points are spent?
  1. $260$
  2. $290$
  3. $220$
  4. $270$
Explanation. Points $\sum_i (a_i x_i + b_i y_i) = 260$; the euros ($10$) are not points. Counting all taken rewards with $a_i$, or all with $b_i$, ignores the chosen mode.