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?
MILP (mixed integer linear programming)
LP (linear programming)
ILP (integer linear programming)
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.
**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?
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$.
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,0)$, which is the integer optimum
$(0,0)$, feasible with value $0$
$(1,1)$, which is the integer optimum
$(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.
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?
Set covering: $\sum_{i \in I} x_i \ge 1$
Set packing: $\sum_{i \in I} x_i \le 1$
Set covering: $\sum_{i \in I} x_i \le |I| - 1$
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$).
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?
An OR clause of the negations $\lnot x_j$, $j \in S_i$
An OR clause of the literals $x_j$, $j \in S_i$
An AND conjunction of the literals $x_j$, $j \in S_i$
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".
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?
$42.9\%$
$70\%$
$30\%$
$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$.
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?
$\zlp = \zlpp \le \zmilp$
$\zlpp \le \zlp \le \zmilp$
$\zlp \le \zlpp \le \zmilp$
$\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.
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?
When the MILP has a unique optimal integer solution
When the other constraints already imply $x \le 1$, such as $\sum_m x_{jm} = 1$
When the problem is a maximisation and the profits are positive
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.
**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?
Each is worth at least $\zmilp$: it is an upper bound on the integer optimum
If the relaxation has a finite optimum, the optimal dual is worth $\zmilp$
Each gives a bound on $\zmilp$ only if it is optimal for the dual
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.
A **primal bound** is the value of a solution used to bound the integer optimum $\zmilp$. Which statement is correct?
In a maximisation, the value of every feasible integer solution is a lower bound on $\zmilp$
In a maximisation, the value of every feasible integer solution is an upper bound on $\zmilp$
A solution satisfying the linear constraints with a fractional component gives a primal bound
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.
Minimisation MILP with feasible set $X$ and linear relaxation with feasible set $\hat X$ (same objective). To prove $\zlp \le \zmilp$, what is needed?
That $X \subseteq \hat X$: every solution of the MILP is feasible for the relaxation
That the constraint matrix be totally unimodular
Strong duality between the MILP and the dual of its relaxation
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.
Minimisation problem with integer optimum $\zmilp$. To state $7 \le \zmilp \le 10$ without solving the MILP, what is enough?
A feasible integer solution of value $10$ and a feasible solution of the dual of the relaxation of value $7$
A possibly fractional solution satisfying the linear constraints, of value $10$, and a feasible dual of value $7$
A dual solution of value $7$ in complementary slackness with an integer solution of value $10$
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.
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?
$2\%$
$9.1\%$
$10\%$
$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.
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?
$\sum_{m=1}^{k} x_{im} \le 1$ for every $i \in I$ (set packing)
$\sum_{i \in I} x_{im} = 1$ for every machine $m$ (set partitioning)
$\sum_{m=1}^{k} x_{im} = 1$ for every $i \in I$ (set partitioning)
$\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".
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$?
$\zmilp = 46$, because it is the value of the relaxation
$\zmilp = 40$, because the solution is integer
$40 \le \zmilp$ only: the bound from the relaxations is not valid until the search closes
$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.
The linear relaxation of a MILP is solved and its integer variables are rounded to the nearest integer. Which statement is correct?
The rounded point is at most as far from the integer optimum as the relaxation is
The rounded point is optimal when the relaxation has a unique optimal solution
The rounded point may be infeasible, and if it is feasible its value has no guarantee of being close to the optimum
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.
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?
Data $w_j$, $c$; variables $x_j$ and $p_j$
Data $p_j$, $w_j$, $c$; variables $x_j$
Data $p_j$, $w_j$; variables $x_j$ and $c$
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.
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?
$8\%$
$92\%$
$8.7\%$
$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$.
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?
BIP, because the model contains binary variables
ILP, because one integer variable is enough to make it integer
LP, because objective and constraints are all linear
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.
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?
$\ge$ sense, $\le$ sense, equality
Equality, $\ge$ sense, $\le$ sense
$\le$ sense, equality, $\ge$ sense
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.
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?
Up $(1,1)$, feasible with value $2$; down $(0,0)$, with value $0$
Up $(1,0)$, the integer optimum; down $(0,0)$, with value $0$
Up $(1,1)$, infeasible; down $(0,0)$, feasible with value $0$
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.
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?
The gap disappears if the relaxation without bounds is used, that is, with $x \ge 0$ only
Rounding down always closes the gap in maximisation problems with $\le$ constraints
No feasible integer point is worth more than $1$: the gap is between the two problems, it does not depend on how one rounds
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.
**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?
That the integer optimum lies in $[\lb, \ub]$, so the solution is at most $5\%$ of $\ub$ away from the optimum
That the integer optimum is at most $5\%$ below $\lb$
That the integer optimum coincides with the midpoint between $\lb$ and $\ub$
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.
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?
None: an OR needs one constraint for every pair of variables
Set covering: $x_1 + x_2 + x_3 \ge 1$
Set packing: $x_1 + x_2 + x_3 \le 1$
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.
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?
Discard it only if the bound were below $80$
Nothing: a relaxation bound does not allow discarding integer solutions
Discard it without exploring: none of its solutions can be worth less than $83 > 80$
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.
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?
With the second the integer optimum may differ from $100$
With the first the solver closes sooner, because its bound is higher
No difference: the solver works on the integer points, which are the same
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.
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?
As $(\ub - \lb)/|\lb| = 100\%$
As an infinite gap, so the bounds are useless
With the absolute difference $\ub - \lb = 4$, because the denominator $|\ub|$ is zero
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$.
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?
The model becomes a covering, which is the right choice for timetables
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
The model is too loose: it allows two jobs in the same slot
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.
**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?
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$.
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?
At least one of projects 1 and 3; MILP
At most one of projects 1 and 3; BIP
At least one of projects 1 and 3; BIP
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).
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)$, infeasible
$(1, 0)$, feasible but not optimal
$(0, 0)$, feasible with value $0$
$(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.
**Maximisation** problem: a heuristic finds $\lb = 45$, the solver certifies the integer optimum $\zmilp = 50$. What is the heuristic gap $|\lb - \zmilp| / |\zmilp|$?
$90\%$
$11.1\%$
$10\%$
$5\%$
Explanation. $5/50 = 10\%$. Dividing by the heuristic value gives $11.1\%$; $5$ is the absolute gap.
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?
Set covering and set partitioning
Set partitioning ($\sum_m x_{jm} = 1$) and set packing ($\sum_j x_{jm} \le 1$)
Set packing and set covering
Set partitioning in both cases
Explanation. «Exactly one machine» per job is a partitioning; «at most one job» per machine is a packing.
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?
Nothing: without further information the midpoint is the correct estimate
The bounds only guarantee $110 \le \zmilp \le 120$: where the optimum lies in the interval is unknown
The optimum is certainly $110$, because it is the dual bound
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.
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?
Yes, it is worth $24$
No: it violates $x_1 + x_2 \le 5$
Yes, it is worth $26$
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.
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?
Because the solver solves it first
Because it always lies above the integer optimum, in every problem
Because its solutions are always integer
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.
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|$?
$11.1\%$
$90\%$
$10\%$
$8$
Explanation. $(80 - 72)/80 = 8/80 = 10\%$. Dividing by $\lb$ gives $11.1\%$; $8$ is the absolute gap; $90\%$ is $\lb/\ub$.
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?
$\pi_i \in \{0,1\}$
$\pi_i \le 0$
$\pi_i$ free
$\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$.
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$?
Free
It depends on the sign of $d_t$
$\ge 0$
$\le 0$
Explanation. An equality constraint corresponds to a free dual variable, whatever the direction of the objective and whatever the right-hand side.
**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?
An equality $= c_j$
An inequality $\le c_j$
An inequality $\ge c_j$
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$.
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$?
$\pi_m \ge 0$
always $\pi_m = 0$
$\pi_m$ free
$\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.
MILP with integer optimum $\zmilp$ and relaxation (with bounds) of value $\zlpp$. What is a **valid inequality**?
An inequality satisfied by all the feasible integer solutions; if it reduces $\zlpp$ it is a cut
An inequality that always reduces $\zmilp$ and leaves the relaxation unchanged
An inequality satisfied by the optimal solution of the relaxation, which therefore leaves $\zlpp$ unchanged
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.
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)?
$x_3 + x_4 \le 1$
$x_1 + x_2 \le 1$
$x_2 + x_3 + x_4 \le 1$
$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$).
**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?
Both a lower bound
The heuristic an upper bound, the dual a lower bound
The heuristic a lower bound, the dual an upper bound
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).
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?
The written model has an exact relaxation, and the hand-made dual can also reach $10$
The linear relaxation of the written model is worth $10$, so the stated value $15/2$ is wrong
The solver closed the gap at the root with presolve, cuts and heuristics; the relaxation of the written model is read with `relax()`
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()`.
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$?
By $0$
By $1$
By $17/9$
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.
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?
$\ub = 20$
$\lb = 70/3$
$\ub = 70/3$
$\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.
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**?
For every pair of feasible solutions, $\sum_i b_i \bar\pi_i \ge \sum_j c_j \bar x_j$
If both solutions are optimal, $\sum_i b_i \bar\pi_i \le \sum_j c_j \bar x_j$
For every pair of feasible solutions, $\sum_i b_i \bar\pi_i = \sum_j c_j \bar x_j$
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.
MILP with optimum $\zmilp$, linear relaxation with optimum $\zlp$ and dual of the relaxation with optimum $\zdual$. Which statement is correct?
If the MILP has a finite optimum, $\zdual = \zmilp$
If the relaxation has a finite optimum, $\zdual = \zlp$
The MILP has a linear dual whose optimum coincides with $\zmilp$
$\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.
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$?
When they admit the same integer points and $X_B \subseteq X_A$
When they admit the same integer points and $X_A \subseteq X_B$
When they admit the same integer points and $B$ has more constraints than $A$
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.
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?
That $\bar\pi$ be dual feasible, weak duality, and the fact that the relaxation contains the solutions of the MILP
That $\bar\pi$ satisfy complementary slackness with an optimal solution of the MILP, and weak duality
That $\bar\pi$ be dual feasible, and strong duality between the MILP and the dual of the relaxation
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.
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?
That those constraints, with $x \ge 0$, already imply $x_{jm} \le 1$
That the matrix of the model be totally unimodular
Strong duality between the two linear relaxations
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.
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?
That it is satisfied by at least one optimal integer solution
That it is satisfied by the optimal solution of the relaxation
That it reduces the value of the linear relaxation
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.
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?
Resource 2, $\ub = 20$
Resource 1, $\lb = 70/3$
Resource 2, $\ub = 24$
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.
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?
$\lb = 9$, because it must coincide with $\zlp$
$\zlp = 10$, because it must coincide with $\zmilp$
$\ub = 12$, because it must coincide with $\zmilp$
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.
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?
$\max \{f(x) : x \in X\}$, that is, the same set with the opposite sense
$\min \{f(x) + 1 : x \in X\}$, that is, the same set with the objective raised
$\min \{f(x) : x \in \hat X\}$ with $\hat X \subseteq X$, for example by adding a constraint
$\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.
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?
$\lb = 14$, because $\bar\pi$ is dual feasible
No bound, because $\bar\pi$ violates a dual constraint
$\lb = 3$, the sum of the components of $\bar\pi$
$\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).
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$?
$\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \le c_j$ for every $j$, $\pi \ge 0$
$\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \le c_j$ for every $j$, $\pi$ free
$\max \sum_i \pi_i$ with $\sum_{i : j \in S_i} \pi_i \ge c_j$ for every $j$, $\pi \ge 0$
$\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$.
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?
The written model becomes stronger, because it needs more nodes to close the gap
The relaxation of the written model gets worse, because switching off cuts weakens it
The optimum does not change: how hard a model is depends on the solver too, not on the model alone
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.
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?
$\zmilp$ grows at least by $\tilde v$, because the relaxation lies above the integer optimum
$\zmilp$ grows exactly by $\tilde v$, as in linear programming
$b \tilde v$ is still an upper bound, but the change in $\zmilp$ is obtained only by solving the MILP again
$\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.
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?
Neither is stronger, because they have the same integer points
$A$ is stronger than $B$, because the solver solves it faster
$A$ is stronger than $B$, because it has fewer constraints and a larger relaxation
$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.
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?
Of the relaxation strengthened with the valid inequalities
Of the relaxation without the bounds, with the binaries replaced by $x \ge 0$
Of the relaxation with the bounds, with the binaries replaced by $0 \le x \le 1$
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()`.
**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?
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$.
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?
It has fewer constraints, so the dual has fewer variables and is simpler to build by hand
It always gives a tighter bound than the one with bounds
It is the relaxation that Gurobi solves with `relax()`
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.
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?
The dual optimum coincides with the integer optimum of the MILP whose relaxation is the primal
The two optima coincide; it serves as a check: the optimum of the hand-written dual must equal the primal optimum
The two optima differ by at most the gap; it serves to estimate `MIPGap`
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.
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?
Nothing: strong duality holds for any programme, integer ones included
Strong duality ties the dual to the relaxation: $z(D) = \zlp$, which in general differs from $\zmilp$; the MILP has no linear dual
Strong duality holds only for maximisation problems
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.
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?
$\bar\mu_j = \min_m c_{jm}$
$\bar\mu_j = \min_m c_{jm} / t_{jm}$
$\bar\mu_j = \max_m c_{jm}$
$\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».
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?
The right bound is $\bar v / b$, not $b\,\bar v$
$\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$
In a maximisation the dual gives a lower bound, not an upper bound
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.
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?
It is feasible and gives $\lb = 28$, the sum of the costs
It is feasible and gives $\ub = 6$
It is infeasible, because team 1 receives $6$
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.
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$?
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?
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.
**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?
$\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).
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)?
$\{3, 4\}$
$\{1, 2, 3, 4\}$
$\{1, 2\}$
$\{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$.
One wants to prove that formulation $B$ of an integer problem is **stronger** than formulation $A$. Which are the two required steps?
(1) $X_A \subseteq X_B$; (2) the relaxation of $B$ is worth more than that of $A$
(1) $B$ has the same integer optimum as $A$; (2) $B$ has fewer variables
(1) $A$ and $B$ have exactly the same integer points; (2) the relaxation polyhedra satisfy $X_B \subseteq X_A$
(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.
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?
The disaggregated one admits extra integer points, so it must be compared with another formulation
The disaggregated one is not stronger: the two formulations have the same relaxation
Nothing: a stronger formulation explores fewer nodes, so it is always faster
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.
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?
`NodeCount = 0` means that the solver did not solve the relaxation
Difficulty is not a property of the model alone: the solver's presolve, cuts and heuristics close the gap already at the root
The relaxation of the written model is worth $10$, not $15/2$
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()`.
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$?
$0$
$1$
$17/9$
$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.
**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?
Read the optimal dual variable of the constraint in the linear relaxation
Solve the MILP again with $b + 1$ and compute $\zmilp(b + 1) - \zmilp(b)$
Multiply the relative gap by $b$
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.
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?
$\ub \le \zmilp \le \zlpp \le \zlp \le \lb$
$\lb \le \zlpp \le \zlp \le \zmilp \le \ub$
$\zlp \le \lb \le \zlpp \le \zmilp \le \ub$
$\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.
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$?
No, because in a minimisation a feasible solution gives a lower bound
Yes: it satisfies all linear constraints, so the value is an upper bound
Yes, but only after rounding it up, which always stays feasible
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.
**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:
a variable $\pi_i \ge 0$ and a constraint of sense $\ge c_j$
a variable $\pi_i \le 0$ and a constraint of sense $\le c_j$
a free variable $\pi_i$ and an equality constraint
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$.
A constraint is added to a MILP. In which case can it be called a **cut**?
If it is satisfied by all feasible integer solutions and reduces the value of the relaxation with bounds
If it is satisfied by at least one optimal solution, even if it cuts feasible ones
If it changes neither the integer optimum nor that of the relaxation
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.
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?
The root bound is always weaker than $\zlpp$, because the solver has not started working yet
The root bound coincides with $\zlp$, the relaxation without bounds
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
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()`.
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?
$\bar\pi = (3, 0, 4)$, $\lb = 7$
$\bar\pi = (3, 3, 4)$, $\lb = 10$
$\bar\pi = (4, 3, 5)$, $\lb = 12$
$\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.
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?
A $\pi_i \ge 0$
A $\pi_i \le 0$
None: equalities have no dual
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.
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$?
It is satisfied with slack
It cannot be evaluated: $\tilde x$ is fractional
It is violated ($9/4 > 2$): adding it cuts off $\tilde x$ and strengthens the relaxation
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$.
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$?
$7/4$
$0$
$3$
$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.
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?
The feasibility of $\bar\pi$ for the dual, checked constraint by constraint
The fact that the recipe starts from $\bar\pi = 0$
The optimality of $\bar\pi$ for the dual
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.
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?
To both: the two formulations have the same relaxation
Only to that of $B$
Only to that of $A$: in $B$ it violates $x_1 \le y$, so $X_B \subsetneq X_A$
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.
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$?
$z_A \le z_B \le \zmilp$: $B$'s relaxation gives a bound at least as good
$z_A = z_B$, because the integer points are the same
No general relation
$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.
**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?
They are equal
No relation
The optimum over $\hat X$ is smaller than or equal
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.
Minimisation primal with a **free** variable $x_j$ (no sign constraint) and cost $c_j$. Which dual constraint corresponds to it?
A constraint $\sum_i a_{ij}\pi_i \ge c_j$
An equality constraint $\sum_i a_{ij}\pi_i = c_j$
A constraint $\sum_i a_{ij}\pi_i \le c_j$
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.
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?
$\ub = 32$
$\ub = 3$
$\ub = 22$
$\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.
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?
Nothing without solving
Only $\bar x$ is optimal
Both are optimal: by weak duality no primal solution is worth less than $40$ and no dual more than $40$
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.
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?
$\zlpp$ should exceed $\zlp$
No error: $40 \le 45 \le 50 \le 52 \le 55$ is the expected order in a maximisation
The hand-built dual should be at most $\zlp$
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.
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?
`addVar()` with no arguments
`addVar(vtype=GRB.BINARY)`
`addVar(lb=-GRB.INFINITY)`
`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.
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?
`ObjBound` $\le \zmilp \le$ `ObjVal`
$\zmilp =$ `ObjBound`
$\zmilp =$ `ObjVal`
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.
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$?
It lies between $10$ and $12$
It is $12$
The model is infeasible
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$.
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$?
`if x.X > 0.5`
`if x.X >= 1`
`if round(x.X, 12) == 1`
`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.
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$?
$u_i = u_j$: the two cities have the same position
$u_i \ge u_j + 1$: the position of $i$ follows that of $j$
$u_i - u_j \le n - 1$, which forbids nothing
$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.
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?
$2$
$4$
$15/7$
$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$.
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?
$9$ variables and $3$ constraints
$9$ variables and $9$ constraints
$9$ variables and $6$ constraints
$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$).
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?
Max-min: $z$ goes up to the load of the least loaded machine
A big-M switching off the unused machines
Min-max: $z$ goes down to the load of the busiest machine
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.
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?
With the default the solver may declare `OPTIMAL` before reaching the exact optimum
`ObjBound` at the end of the solve is the value of the root relaxation
The `Runtime` of two models with different settings tells which formulation is stronger
`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.
After `optimize()` in Gurobi one wants to write in the report "the optimum of the MILP is `ObjVal`". Which check is necessary and sufficient?
That `SolCount` is at least $1$
That `ObjVal` is an integer
That `Status` equals `OPTIMAL`
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.
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`?
The final dual bound `ObjBound` of the integer model `m`
The value of the best integer solution of `m`
The value of the root relaxation after the solver's cuts and presolve
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.
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?
That the model is infeasible
That the optimum is `ObjBound`
Nothing: neither a solution nor, in general, a useful bound
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.
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)?
$30$ variables and $30$ constraints
$30$ variables and $10$ constraints
$25$ variables and $10$ constraints
$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$.
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?
They describe exactly the Hamiltonian tours, and the MTZ constraints only strengthen the relaxation
They admit only tours through city $1$, so subtours are impossible
They admit subtours only if the distances are not symmetric
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$.
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?
$7$ binaries, `x[0]`, …, `x[6]`
$12$ binaries, `x[i, j]` with `i` in $0, \dots, 3$ and `j` in $0, \dots, 2$
$12$ binaries, `x[i, j]` with `i` in $1, \dots, 4$ and `j` in $1, \dots, 3$
$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.
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$?
`m.addConstrs(x.sum('*', j) == 1 for j in range(n))`
`m.addConstrs(x.sum(j, '*') == 1 for j in range(1, n))`
`m.addConstr(x.sum(j, '*') == 1 for j in range(n))`
`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$.
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?
$d$ is free by default, so the model is correct
$d$ becomes binary, because that is the default type
$d$ gets `lb = 0` by default and the solved model is a different one, without any warning
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.
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?
Because the solver then solves the model faster
So that the same function serves for the base instance and for all the variants
To avoid the difference between indices starting from zero and from one
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.
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?
`relax()` copies the model, and the pending modifications must be applied first
`update()` declares the binaries continuous, and `relax()` just copies them
`update()` resets the solver parameters, which would otherwise pass to the copy
`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.
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)?
$9$ variables and $6$ constraints
$9$ variables and $4$ constraints
$8$ variables and $6$ constraints
$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$.
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?
Only the linear constraints, even with fractional components
Constraints, variable bounds and integrality
That the solution is optimal for the MILP
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.
The course protocol always follows the same order of steps for every problem. Which one?
Data, LP and dual, model, MIP, heuristic and check, table
Data, model, heuristic and check, LP and dual, MIP, table
Data, model, MIP, heuristic and check, LP and dual, table
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.
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?
Gurobi raises an explicit error when `optimize()` is called
Gurobi solves the linear relaxation instead of the MILP
Gurobi solves only the first $2000$ variables and returns a partial optimum
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.
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?
It compares, with an `assert`, every number quoted in the text with the value in the CSV
It solves every MILP again with another solver and compares the optima
It rewrites the numbers of the text by copying them from the CSV
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.
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?
That `m` was solved before, so that `relax()` inherits its solution
That `m` is updated with `update()` before `relax()` and that `r` ends with `Status = OPTIMAL`
That the integer model `m` ends with `NodeCount = 0`
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.
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$»?
`m.setObjective(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
`m.optimize(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
`m.addConstr(gp.quicksum(p[j] * x[j] for j in J), GRB.MAXIMIZE)`
`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.
In gurobipy, after `m.optimize()` with `m.Status == GRB.OPTIMAL`, how are the optimal value and the value of variable `x[2]` read?
`m.Status` and `x[2].VarName`
`m.getObjective()` and `x[2].LB`
`m.ObjBound` and `x[2].Start`
`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.
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**?
`m.addVar(vtype=GRB.BINARY, ub=GRB.INFINITY)`
`m.addVar(vtype=GRB.INTEGER)`
`m.addVar(lb=0)`
`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.
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?
$d$: an absolute value must be declared with `lb=-GRB.INFINITY`
Neither: `addVar()` creates free variables
$s$: without `lb=-GRB.INFINITY` the lower bound is $0$ and negative values are forbidden
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.
In the course code the model is written «one family per block». What does that mean?
Each constraint family goes into a different Gurobi model
Each family of variables or constraints of the mathematical model corresponds to a single statement (`addVars`, `addConstrs`), with a comment naming it
Variables and constraints are written in the same block, mixed, to save lines
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.
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?
`m.addConstrs(gp.quicksum(t[j, h] * x[j, h] for j in range(n)) <= a[h] for h in range(k))`
`m.addConstrs(t[j, h] * x[j, h] <= a[h] for j in range(n) for h in range(k))`
`m.addConstrs(gp.quicksum(t[j, h] * x[j, h] for h in range(k)) <= a[h] for j in range(n))`
`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.
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`?
$19800$
$19990$
$19998$
$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.
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?
`X` is the relaxation value: read `x[j].Xn` instead
The value is $1$ only within `IntFeasTol` (for example $0.9999999$): compare `round(x[j].X)` or use a tolerance
Binaries in gurobipy are `True`/`False`: write `x[j].X is True`
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.
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?
Continuous in $[0,1]$: one obtains $\zlpp$, the relaxation with bounds
Continuous in $[0, +\infty)$: one obtains $\zlp$, the relaxation without bounds
They disappear: `relax()` fixes them to $0$
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$.
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$
$2$
$3$
$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$.
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$?
$\sum_j d_j$
$\sum_j d_j / k - \max_j d_j$
$\max\{\sum_j d_j / k,\ \max_j d_j\}$
$\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).
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$?
Because subtours can never pass through city 1
Because city 1 always has position $u_1 = n$
To save constraints: including it would give the same model
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.
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?
From the model of the relaxation without bounds, or from the hand-written dual, solved with Gurobi: by strong duality the two values coincide
From `m.ObjBound` after optimising the MILP
From the constructive heuristic, as the value of its solution
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.
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?
Because the dual value must coincide with the integer optimum
Because Gurobi rejects non-integer dual solutions
Because only a feasible dual solution gives a valid bound by weak duality
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.
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?
It installs `gurobipy` and downloads the three common Python modules of the course
It activates the academic Gurobi licence from the portal
It solves all the course models and saves the CSV files
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.
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?
`python3 fam07_1_assegnamento.py`
`python3 esegui_tutti.py`
`pip install esegui_tutti`
`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.
Gurobi, after `optimize()`: `Status = INFEASIBLE`. What can be stated, and what cannot be read?
The model is unbounded
The solver found no solutions within the time, but they might exist
The written model has no feasible solutions; `ObjVal` does not exist and the status must be read before any value
`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.
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?
$41$
$36$
$30$
$35$
Explanation. Directed arcs: $6 \cdot 5 = 30$; positions: $5$. Total $35$. ($36$ would also count arcs from a city to itself.)
**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?
$\zmilp \le \zlpp \le \zlp$
$\zlp = \zlpp$ always
$\zlp \le \zlpp \le \zmilp$
$\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.
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$?
$\sum_j w_j x_{jb} \le c$
$\sum_b x_{jb} \le y_b$
$\sum_j w_j x_{jb} \le c\, y_b$
$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.
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?
Because there is a constraint $z = \max_m \sum_j d_j x_{jm}$
$z$ lies above every load by the constraints and the objective pushes it down: it stops at the maximum load
It is not true: $z$ may stay larger than the maximum load
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.
In gurobipy, which statement creates an empty model and which solves it?
`m = gp.Env()` and `m.solve()`
`m = gp.Model()` and `m.run()`
`m = GRB.Model()` and `gp.optimize(m)`
`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.
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?
The relaxation with bounds has an integer optimum, so $\zlpp = \zmilp$ and that solution is optimal for the MILP too
That the model was written wrongly
Nothing: the MILP must be solved anyway to get a bound
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.
In the course protocol, which step comes **before** solving the MIP with the solver?
Heuristic with feasibility check, then hand-written dual and relaxations
The figures and notebooks
The bound table
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.
Gurobi, minimisation problem, `Status = TIME_LIMIT`, `SolCount` $\ge 1$, `ObjVal` $= 75$, `ObjBound` $= 70$. Which statement is proved?
$\zmilp \ge 75$
$\zmilp = 70$
$70 \le \zmilp \le 75$
$\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.
Bin packing: containers of capacity $c$, items of weight $w_j$. Which value is always a lower bound on the minimum number of containers?
the number of items
$\lfloor \sum_j w_j / c \rfloor - 1$
$\max_j w_j$
$\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).
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?
$\zmilp = 16$
$\zlp \le 16$
$\zmilp \le \ub = 16$
$\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.
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?
That the problem is infeasible and the model must be corrected
That an improvement heuristic is needed to prove infeasibility
Nothing about the feasibility of the problem: the failure concerns the heuristic
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.
Bin packing: items to be placed, in the given order, into bins of fixed capacity. What distinguishes the next-fit heuristic from first-fit?
First-fit opens a new bin for every item; next-fit fills the current one as long as it can
Next-fit first sorts the items by decreasing weight; first-fit takes them in the given order
Next-fit chooses the bin left fullest; first-fit the first bin where the item fits
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.
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?
Wagner–Whitin is the hand-made dual of least unit cost, and gives a lower bound on it
Least unit cost is a heuristic, and its value is only a bound; Wagner–Whitin is an exact algorithm
They are two names for the same heuristic, which picks setups at the lowest average unit cost
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.
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?
It proved that the linear relaxation is worth $11$
It found a better lower bound than the elementary one
It proved that $11$ is the optimal makespan for this instance
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.
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)$?
$11$
$27$
$9$
$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$.
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?
The heuristic actually picks by increasing weight, not by ratio
The heuristic violates the capacity and the solution must be repaired
Item 2 has the highest ratio and the heuristic discards it
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$.
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?
A certificate of optimality when two different starts give the same tour
A lower bound on the length of the optimal tour, because the minimum is taken
An upper bound that is in general better, at $n$ times the cost: still a bound from one side only
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.
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?
LPT is optimal when the durations are all different from each other
With $k = 2$ machines LPT always finds the optimal assignment
The makespan of any assignment, LPT included, is at least $\max(\max_j t_j,\ \sum_j t_j / k)$
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.
A constructive heuristic for a MILP builds a solution one decision at a time, without going back. Which statement is correct?
A solution satisfying the linear constraints with some fractional component still gives a primal bound
It always returns a feasible solution, possibly of poor quality
Its value is always within $50\%$ of the integer optimum
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.
Minimisation MILP. To declare that the value of a hand-built solution is an upper bound on the integer optimum, what must be checked?
That the solution is close to the optimal solution of the relaxation
That the solution is a local optimum for local search
That the solution satisfies the constraints, the variable bounds and integrality
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.
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?
The fact that best-fit is exact for bin packing when the weights are integer
The elementary bound $\lceil 21/7 \rceil = 3$, valid for every solution, together with the feasible best-fit solution
The linear relaxation with continuous $y_b$ being equal to $3$, together with the best-fit solution
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.
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?
B (smallest cost)
A (ratio $2$)
None: ties are broken at random
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.
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?
$21$
$20$
$17$
$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.
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?
$60$
$5/3$
$2$
$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.
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?
It always stops at the global optimum, if the move is rich enough
It stops at a local optimum with respect to that move, which is an upper bound but in general not the optimum
The value where it stops is a lower bound, because no neighbour is better
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.
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?
Because the heuristic chooses the longest arc to close the tour
It is forced: one returns to the start whatever the distance, without choosing it
Because the return arc counts twice in the tour length
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.
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?
No: next-fit explores all the assignments before failing
Yes, but only by splitting job 3 between the two machines
No: the total duration $8$ exceeds the total availability
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.
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?
$8$
$10$
$11$
$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.
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?
Best-fit for bin packing, because it fills the containers best
None: a heuristic always gives an upper bound
LPT for the makespan, because the makespan is a maximum of the loads
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.
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?
That next-fit would be wrong, because it looks at a single container
Nothing about the gap: without a bound on the other side $0\%$ and $67\%$ are told apart only afterwards
That best-fit would be optimal, because it is the most accurate rule
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.
A constructive heuristic for a **minimisation** MILP stops with the message «no solution found». Which conclusion is correct?
The MILP is infeasible, because the heuristic tried all possibilities
None about the problem: the heuristic is myopic; infeasibility is proved by the solver (`INFEASIBLE`) or by a proof
The primal bound is $+\infty$ and the gap is $0\%$
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.
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?
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?
Into a new container
Into container 2, which is left with residual $0$
Into container 3, the one with most space
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.
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?
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?
Nothing: the least-loaded rule gives the same result in any order
Feasibility: without sorting some jobs remain unassigned
The guarantee that the result is optimal, which LPT always has
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$.
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?
Element 2 (ratio $1$)
Element 1 (covers more zones at equal cost)
Element 4 (minimum cost $3$, higher index)
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).
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?
Return «no solution found»: with no new zones the ratio $c_j/\text{new}(j)$ is undefined and the cover cannot be completed
Return the partial solution as a primal bound
Restart from the first step with a different order, until it finds a cover
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.
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?
$\ub = 16$ (items 1 and 3)
$\lb = 16$ (items 1 and 3)
$\ub = 17$ (items 1 and 2)
$\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$.
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?
$\ub$ always coincides with the optimum of the relaxation
$\lb \le \zmilp \le \ub$, but neither is in general equal to the optimum
The ratio heuristic is always optimal on the binary knapsack
$\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$.
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?
$16$
$18$
$19$
$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$.
Travelling salesman: nearest neighbour is run from **all** $n$ starting cities and the shortest tour is kept (multi-start). What is obtained?
The TSP optimum, because all starts have been tried
A lower bound, because the minimum of the tours is taken
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
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.
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?
$3$ periods, average cost $1.5$
$1$ period, average cost $2.5$
$2$ periods, average cost $2$
$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.)
Uncapacitated lot sizing. What is the difference between the least unit cost rule and the Wagner–Whitin procedure?
Wagner–Whitin is an exact algorithm (dynamic programming) for this model; least unit cost is a heuristic and gives only an upper bound
They are the same procedure under two names
Wagner–Whitin gives a lower bound, least unit cost an upper bound
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$).
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?
No move improves: moving a job of $3$ brings another machine to $11$; the search stops at $11$
Local search always finds the optimum $9$ with move operations
Moving a job of $3$ brings the makespan to $9$
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.
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?
A lower bound equal to $26$ (for example from a feasible dual or from the solver): the local optimum gives only $\ub = 26$
Checking that the solution is integer: if so, it is optimal
Nothing: a local optimum is always global in MILPs
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.
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?
Jobs 1 and 2 on machine 1, job 3 on machine 2
None: the failure of next-fit proves that none exists
Jobs 1 and 3 on machine 2, job 2 on machine 1
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.
An assignment MILP with availabilities: the constructive heuristic fails. Which tool can **prove** that the model is infeasible?
A second constructive heuristic with a different order, if it fails too
The solver, returning `Status = INFEASIBLE`, or a mathematical proof
Local search starting from the partial solution
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.
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|$?
$66.7\%$
$2\%$
$33.3\%$
$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).
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?
$\lb = 16 \le \zmilp = 17$, gap $5.9\%$
$\ub = 17$, gap $0\%$
$\ub = 16 \ge \zmilp$, gap $5.9\%$
$\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\%$.
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?
Best-fit is always optimal
Nothing: the solver is needed to confirm
The solution is optimal only if all containers are exactly full
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.
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?
The rule is optimal only with symmetric distances
The tour obtained may visit a city twice
The rule does not pick the shortest arc, but the longest
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.
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?
LPT gives a feasible solution but is not always optimal; the elementary bound may coincide with the optimum
The elementary bound is never attained
If LPT is not optimal, the problem is infeasible
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$.
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?
That the best heuristic is always best-fit
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
That heuristics with gap $0\%$ are those with more steps
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.
In Boolean logic a literal is a variable or its negation. When is an expression in **conjunctive normal form** (CNF)?
When every variable appears in a single clause
When it is an OR of terms, each an AND of literals
When it is an AND of clauses, each an OR of literals
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.
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?
$x_1 - x_2 + x_3 \ge 0$
$x_1 + x_2 + x_3 \ge 1$
$x_1 - x_2 + x_3 \le 1$
$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$.
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?
$x_1 + x_6 - x_7 \ge 1$
$x_7 - x_1 - x_6 \ge 1$
$x_1 + x_6 + x_7 \le 2$
$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.
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$?
One, $x_a - x_b \ge 0$
Two, one per literal
One, $x_a + x_b \le 1$
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.
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$)?
Same binary solutions, but the single constraint is tighter in the relaxation: $(1/2, 1/2, 1/2)$ satisfies the clauses and violates it
Same binary solutions, but the three clauses are tighter in the relaxation because they are more constraints
Different binary solutions: the single constraint excludes assignments that the three clauses allow
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.
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?
$32$
$1$
$10$
$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.
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?
Explanation. Distributivity gives three pairwise clauses: every pair must contain at least one true element, which is exactly "at least two out of three".
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?
$x_1 + x_2 + x_3 - x_4 \ge 1$
$x_1 + x_2 + x_3 \ge 2$
$x_1 + x_2 + x_3 \ge 2x_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.
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)$?
With $x_a = 1$, $x_b = 0$, $x_c = 0$ the original is true and the replacement false: the replacement cuts off allowed solutions
With $x_a = x_b = 0$, $x_c = 1$ the original is false and the replacement true: the replacement admits forbidden solutions
With $x_a = x_b = x_c = 1$ the original is false and the replacement true: the replacement admits forbidden solutions
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.
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$?
One each
Two the first, one the second
Two each
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$.
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?
$6$
$3$
$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$.
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.
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**?
When every binary assignment making the expression true satisfies all the constraints
When every binary assignment satisfying all the constraints makes the expression true
When the optimal solution of the linear relaxation makes the expression true
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.
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?
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
Enumerating the $8$ binary assignments and noting that the clauses outnumber the single constraint
Applying weak duality to the two relaxations and comparing their optimal values
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.
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?
An assignment making the first true and the second false, such as $x_a = 1$, $x_b = 0$, $x_c = 0$
Applying De Morgan to the contrapositive of the first expression
An assignment making the first false and the second true, such as $x_a = x_b = 1$, $x_c = 0$
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).
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?
$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
$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
Distributivity $x \land (y \lor z) \iff (x \land y) \lor (x \land z)$, double negation and one constraint per clause
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.
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?
$x_1 + x_2 \ge 1$
$x_1 - x_2 = 0$
$x_1 + x_2 \le 1$
$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.
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?
It always goes up, because the constraint excludes an expensive combination
It stays the same or goes up: a logical constraint removes no feasible solutions
It always stays the same, because the logical constraint acts only on the relaxation
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.
Boolean expressions in the binary variables $x_a, x_b$ ($1$ = true). Which of the following is true for **every** assignment?
$x_a \land \lnot x_a$
$(x_a \lor x_b) \land \lnot x_b$
$x_a \lor x_b$
$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$.
A Boolean expression in $3$ binary variables has been translated into linear constraints on the same variables. How is the translation **proved** correct?
Enumerate the $8$ assignments and check for each: expression true $\iff$ constraints satisfied
Check the assignments that make the expression true: they must satisfy the constraints
Solve the linear relaxation and check that its optimum makes the expression true
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.
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?
The logical constraints restrict the set and lower the optimum; $29$ is an upper bound on $28$
The optimum dropped because the clauses were translated wrongly: a logical constraint removes no value
$29$ is a lower bound on $28$, because the relaxation has fewer constraints
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$.
Boolean variables. Which of the following expressions is in **conjunctive normal form** (CNF: conjunction of clauses, each clause a disjunction of literals)?
$x_1 \Rightarrow (x_2 \land x_3)$
$\lnot(x_1 \lor x_2)$
$(x_1 \land x_2) \lor x_3$
$(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.
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?
$x_1 - x_2 - x_3 \ge 0$
$x_1 + x_2 + x_3 \ge 1$
$x_1 - x_2 - x_3 \ge 1$
$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$.
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?
The binary assignments satisfying the $k$ constraints are exactly those making the expression true
Every solution of the linear relaxation of the constraints makes the expression true
The number of constraints is always $2^n$, with $n$ variables
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.
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.
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?
$16$; that at least one constraint is satisfied when the expression is true
$16$; that the expression is true if and only if all constraints are satisfied
$8$; that the constraints are satisfied
$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.
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?
That the assignments making the expression false violate at least one constraint: the constraints might be too loose
That the linear relaxation of the constraints is integral
That the constraints are linear
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.
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?
$x_1 + x_2 + x_3 \ge 1$
$x_3 \ge x_1$ and $x_3 \ge x_2$
$x_1 + x_2 - x_3 \le 1$
$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.
Binary variables ($1$ = true). «Exactly two of $x_1, x_2, x_3, x_4$.» Which constraint translates it in one go?
$x_1 + x_2 + x_3 + x_4 = 2$
$x_1 + x_2 = 1$ and $x_3 + x_4 = 1$
$x_1 + x_2 + x_3 + x_4 \ge 2$
$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$).
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$?
$z_L \le z_0$: logical constraints restrict the feasible set
$z_L \ge z_0$: logical constraints guide the solver towards better solutions
$z_L = z_0$: exactly translated implications cut no solutions
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.
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?
None: with binaries $x_2 = x_5$ is equivalent to $x_2 \le x_5$
It allows $x_2 = 1$, $x_5 = 0$, which the logic forbids
It makes the model infeasible in every case
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.
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$?
The complement $\overline{A}$
The union $A \cup B$
The intersection $A \cap B$
The difference $A \setminus B$
Explanation. AND is true when the element lies in both sets: intersection. OR corresponds to union, negation to complement.
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$?
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.
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?
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.
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?
Nothing: they are equivalent also in the relaxation
The aggregated constraint admits $(1, 1, 0)$
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
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.
Binary variables. The clause $x_1 \lor \lnot x_2$ is translated by a student as $x_1 - x_2 \ge 1$. What happens?
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$
The constraint is infeasible
The constraint is too loose
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.
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?
The disaggregated form has $n\,m$ constraints and admits fewer binary solutions than the aggregated one
The aggregated form has $n\,m$ constraints and a tighter relaxation; the disaggregated one has $m$
The two forms have the same number of constraints and the same linear relaxation
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.
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"?
It holds in every optimal solution even when $f_j = 0$
It is not imposed by the constraints; if $f_j > 0$ it holds in every optimal solution
It is imposed by the constraints $x_{ij} \le y_j$ in every feasible solution
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$".
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?
The sum of the capacities of all the plants
$1$, because $y_j$ is binary
The capacity $C_j$, derived from the data
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$.
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?
$q_j \le c_j\, y_j$ and $q_j \ge 0$
$q_j \ge \ell\, y_j$ and $q_j \le c_j$
$\ell \le q_j$ and $q_j \le c_j$
$\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.
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?
In the relaxation it suffices to lower $y_j$ to $q_j/\ell$: the threshold constraint never bites in the continuum
Because the threshold constraint is not valid and the solver ignores it in the relaxation
Because the threshold $\ell$ exceeds the capacity and the constraint is redundant
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.
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?
With $w \le q/c + 1$ and $w$ integer
With $w = \lceil q/c \rceil$ written in the constraint
With $w \ge q/c$ and $w$ continuous
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.
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$?
When the durations $t_j$ are all distinct
When $z$ also appears in another constraint that wants it large
When no $x_j$ equals $1$
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$.
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?
Min-max is off by $10$ units with respect to the range model
With more than two workers the three models would always choose the same solution
The three values describe the same solution and are not comparable with each other
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.
Continuous variables $u, v$ and a constant $k > 0$. How is the constraint $|u - v| \le k$ imposed in a linear model?
It cannot: the absolute value needs a non-linear model
With $u - v \le k$ and $v - u \le k$, with no binary variables
With the single constraint $u - v \ge -k$
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.
Continuous variables $u, v$. One wants to **minimise** $|u - v|$ with a linear model. Which formulation is correct?
A variable $d \ge 0$ with $d \ge u - v$ and $d \ge v - u$, and $\min d$
No auxiliary variable: $\min (u - v)$
A binary $b$ and a variable $d$ with $d \ge u - v - Mb$, and $\min d$
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.
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$?
The model becomes infeasible for every value of $y$
With $y = 0$ what remains is $3x_1 + 4x_2 + 5x_3 \le 11$, which excludes $x = (1,1,1)$: the integer set changes
Nothing on the integer set: with $M = 5$ only the linear relaxation gets worse
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.
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$?
Nothing, neither on the integer set nor on the linear relaxation
The relaxation gets stronger, because the switched-off constraint no longer bites
The integer set stays the same, the relaxation gets weaker (from $3$ to almost $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.
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?
$n(n-1)$ order and $n(n-1)/2$ precedence
$n(n-1)$ each
$n(n-1)/2$ each
$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.
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?
One may get $y = 0$ with all $x_j = 1$: $y$ is no longer a faithful indicator
The optimal value changes with respect to the model with both directions
In every optimum $y = 1$ if all $x_j = 1$, because the objective imposes it
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.
"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?
The count is met by switching on indicators with $q_j = 0$: the condition no longer says anything
Nothing: the activation constraint $q_j \le c_j y_j$ suffices to give the count a meaning
The linear relaxation becomes exact and the integrality of the $y_j$ is no longer needed
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.
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?
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$
It always strengthens it, because it adds $p$ binary variables to the model
It makes it exact, because every value of $v$ has a single binary representation
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.
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?
The two deviations are equal, $s^- = s^+$
At least one of the two deviations is zero, and $s^- + s^+ = |a'x - \beta|$
$s^-$ measures how much $a'x$ exceeds the target $\beta$
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.
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?
Yes, always: without adjacency the model mixes distant breakpoints and gets the cost wrong
Yes, because without segment binaries the model becomes infeasible
No: the lower convex envelope coincides with $g$, and minimisation picks adjacent $\lambda$ by itself
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.
**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?
$117/4$: with fractional $w_t$ adjacency does not bite
$33$, like its integer optimum
More than $33$, because the model is tighter
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.
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?
Same integer set, but the big-M gives a tighter relaxation because it has one more constraint
Different integer sets: the big-M admits solutions that the capacity link excludes
Same relaxation and same integer set: the two values differ by rounding
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.
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?
If the exchange does not worsen the objective the property holds in every optimum, because no optimum can violate it
If the exchange strictly improves the objective the property holds in every optimum; if it leaves it unchanged it holds only in some optimum
A property proved by exchange holds in every feasible solution, not only in the optima
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.
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?
The aggregated form implies the disaggregated one for every $x \ge 0$ and every $y \in [0,1]$
The disaggregated form does not imply the aggregated one, not even on binary points
They are equivalent on fractional points too, so they have the same linear relaxation
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.
Continuous variables $u, v$ and a constant $k > 0$. Which statement about the constraint $|u - v| \ge k$ is correct?
It is written with a variable $d$ and the constraints $d \ge u - v$, $d \ge v - u$ and $d \ge k$
The set it describes is not convex, so no system of linear constraints without integer variables describes it
It is written with the two linear constraints $u - v \ge k$ and $v - u \ge k$, with no integer variables
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.
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?
The formulation is correct only if the binary expansion of the values is added
The values turn out distinct only in optimal solutions, not in all feasible ones
The relaxation is as weak as that of a big-M, and must be strengthened with cuts
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.
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?
The constraints $z \ge t_j x_j$, a strictly positive coefficient of $z$ in a maximisation, and $z \ge 0$
The constraints $z \ge t_j x_j$, a non-negative coefficient of $z$ in a minimisation, and $z$ absent from every other constraint
The constraints $z \ge t_j x_j$, a strictly positive coefficient of $z$ in a minimisation, and $z$ absent from every other constraint
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.
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?
That $y_j$ be binary (cases $y_j = 0$ and $y_j = 1$) and that $x_{ij} \le 1$, because the $x$ are binary
That the activation cost of resource $j$ be strictly positive
Only that $x_{ij} \ge 0$, whatever the value of $y_j$ in $[0,1]$
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.
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?
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
That the linear relaxation with that value of $M$ have the same optimum as the MILP
That $y$ be binary, whatever the value of $M$, as long as it is positive
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.
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?
$\kappa_i \ge t_i$ and the horizon $\kappa_j \le \sum_h t_h$ on the solutions among which the optimum is sought
That $M$ be at least the largest duration $\max_h t_h$ and that the durations be integer
Only $s_{ij} + s_{ji} = 1$, i.e. that every pair is ordered one way
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.
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$?
That the $x_j$ have positive revenues in the objective, whatever the bonus of $y$
That $y$ appear in the objective of a maximisation with bonus $v \ge 0$ and in no other constraint
That $y$ appear in a constraint counting the complete classes, with bonus $v > 0$
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.
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?
Penalties $\pi^-, \pi^+ \ge 0$ and the fact that subtracting the same value from $s^-$ and $s^+$ leaves the difference $s^- - s^+$ unchanged
That the deviations $s^-, s^+$ be declared binary, so that only one can be switched on
That the hard constraint $a'x = \beta$ have at least one feasible solution
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.
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?
$\tfrac{10}{37}$
$\tfrac{37}{10}$
$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.
Fairness among $K$ workers: $\ell_k$ is the load of worker $k$ (a linear expression of the assignments). Which model **maximises the minimum load**?
A variable $u$, the constraints $u \le \ell_k$ for every $k$ and $\min u$
A variable $u$, the constraints $u \ge \ell_k$ for every $k$ and $\max u$
A variable $u$, the constraint $u = \sum_k \ell_k / K$ and $\max u$
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.
"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?
$q = (5, 7, 0)$, $y = (1, 1, 0)$
$q = (25, 5, 0)$, $y = (1, 1, 0)$
$q = (3, 8, 0)$, $y = (1, 1, 0)$
$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$.
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?
The value of $M$, computed from the data
That $M$ is any large number
That the integrality of $y$ realises a rounding up
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.
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$?
There is no difference: the value of $M$ does not matter if $M \ge C_j$
Because $q_j \le M y_j$ no longer imposes that a closed plant produces nothing
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
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.
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$?
$y_j = 1$: a plant must be open to be able to produce in the future
$y_j = 0$: opening it would cost $f_j > 0$ with no advantage
$y_j$ may equal $0$ or $1$ indifferently
$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.
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$?
With $y_j = 1$: $0 \le q_j \le 20$; with $y_j = 0$: $0 \le q_j \le 5$
With $y_j = 1$: only $q_j = 5$ or $q_j = 20$; with $y_j = 0$: only $q_j = 0$
With $y_j = 1$: $5 \le q_j \le 20$; with $y_j = 0$: only $q_j = 0$
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.
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?
The integrality of $y_j$
Nothing: the objective also imposes the threshold
The threshold: with $y_j = 1$ the values $0 < q_j < \ell$ remain allowed, that is, lots smaller than the minimum
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$.
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?
$w = 3$; in the relaxation $w = 8/3$
$w = 3$; in the relaxation $w = 3$
$w = 2$; in the relaxation $w = 8/3$
$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.)
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?
$w = \lfloor Q/c \rfloor$
$w = \lfloor Q/c \rfloor + 1$
$w = Q/c$
$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.
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?
When $z$ appears with a positive coefficient in an objective to be minimised
Only if the objective is $\min \sum_j t_j x_j$
In any objective: the constraints already fix it
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.
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?
$4$
$9$
$6$
$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.
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**?
$z = 10$, $u = 6$, $z - u = 4$
$z = 10$, $u = 10$, $z - u = 0$
$z = 16$, $u = 0$, $z - u = 16$
$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.
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?
$u$ is no longer tied to the loads and grows without limit: $z - u$ goes to $-\infty$ and the model is unbounded
The model still minimises the spread, because $u$ settles at the minimum load
The model becomes a min-max
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.
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?
$-4$
$10$
$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.
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?
With $y = 0$ the constraint is not fully switched off and cuts feasible solutions, perhaps the optimal one
The model becomes unbounded
Nothing: a smaller $M$ only gives a tighter relaxation
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.
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?
$20$ variables and $10$ big-M constraints
$20$ variables and $20$ big-M constraints
$25$ variables and $20$ big-M constraints
$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$.
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?
$M = \max_j t_j$, the duration of the longest job
$M = t_i + t_j$, the sum of the two durations of the pair
$M = \sum_j t_j$, the total duration: no completion exceeds this value
$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.
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?
$y \ge x_1 + x_2 + x_3 + x_4 - 4$
$y \ge x_1 + x_2 + x_3 + x_4 - 3$
$y \ge x_1 + x_2 + x_3 + x_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$.
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?
Yes: the objective pushes $y$ to $1$ as soon as allowed, so the missing direction is imposed by the optimisation
Yes, but only if the problem is a minimisation
No: without that constraint the model becomes unbounded
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.
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?
That at least $3$ types are produced, each in quantity at least $\ell$
That at most $3$ types are produced
That exactly $3$ types are produced
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).
«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?
$\sum_j y_j > p$, that is, more types than required
$y_j = 0$ with $q_j > 0$: a type produced without being counted
$y_j = 1$ with $q_j = 0$: an «active» type without production, satisfying the count without producing anything
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.
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?
$8$
$100$
$6$
$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.)
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?
$8$ binaries and $8$ constraints
$4$ binaries and $6$ constraints
$16$ binaries and $8$ constraints
$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.
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?
$s^- = 8$, $s^+ = 8$
$s^- = 8$, $s^+ = 0$
$s^- = 58$, $s^+ = 50$
$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$.
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?
Removing the demand constraint, which makes the model feasible at no cost
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
Making the integer variables continuous
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.
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$?
$62$
$56$
$80$
$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$.)
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?
Always: the $\lambda$ are already a convex combination
Never: without binaries the model is not linear
When the function is concave and is minimised
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.
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?
Alldiff and binary expansion
Maximum variable and absolute value
Fixed cost ($q_j \le C_j y_j$) and minimum lot ($q_j \ge \ell y_j$)
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$.
Map of techniques: facing a new link between variables, which of these questions is **not** one of those to ask?
How strong is the relaxation of the chosen formulation?
Which direction of the link does the constraint impose and which (possibly) the objective?
How many lines of code are needed in gurobipy?
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.
Absolute value: $d \ge u - v$, $d \ge v - u$ linearises $d = |u - v|$ in which case?
Only if $u \ge v$
When $d$ is maximised
Always, in any objective
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.
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?
The values from $101$ to $127$ become feasible, which the problem does not allow
The model becomes infeasible
Negative values become feasible
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.
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$?
$n$ and $n\,m$
$n\,m$ and $m$
$m$ and $n\,m$
$m$ and $m$
Explanation. Aggregated: one constraint per resource. Disaggregated: one per object–resource pair. More rows, but a stronger relaxation.
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$?
The first constraint is active, the second switched off (if $M_2$ is large enough)
Both are switched off
The second is active, the first switched off
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.
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?
$x_2 + x_4 \ge 1$
$x_2 + x_4 \le 1$
$x_2 - x_4 \le 0$
$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".
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?
$\ub = 7$
$\ub = 3$
$\lb = 7$
$\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.
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?
Because one swimmer stays out and frees one degree of freedom
Because the hand-made dual solution is optimal for the dual
The matrix is that of an assignment, totally unimodular: the vertices of the relaxation are integer
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.
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?
The three cities are pairwise far apart: no hub can serve two of them, so at least three hubs are needed
Three hubs suffice to serve all the cities, so the optimum is three
Every hub can serve at most three cities, so there are at least three hubs
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$.
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?
$x_2 \le 50$
$-x_1 + x_2 - x_3 - x_4 \le 0$
$x_2 - x_1 - x_3 - x_4 \ge 0$
$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$.
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?
It is feasible and gives the upper bound $100 \cdot 5/32$
It is feasible, but the bound it gives is weak
It is not a feasible dual solution, and its value is not a bound
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.
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?
$\gamma \ge 0$
Free
$\gamma \in \{0,1\}$
$\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}$.
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?
Because they would make the solution with a queen in the corner infeasible
Because a queen in a corner cannot attack any other queen
Because those squares are already counted among the column constraints
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.
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?
One only: $\sum_{j \in T_i} y_j \ge x_i$
None: the limit on the number of tools suffices
$|T_i|$, one per tool: $x_i \le y_j$ for every $j \in T_i$
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".
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?
The range model is wrong, because a load cannot be $0$
The two models have different optimal solutions, because the values differ
Same optimal solutions and different optimal values: $9$ is the largest load, $0$ the difference
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.
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?
A big-M on the number of hours of each instrument
$\sum_i y_{di} \le 2$, to fix the count at two
$x_{dti} \ge y_{di}$ for every hour $t$ of the day
$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.
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?
A linear programme: the variables can be continuous without changing the optimum
A set packing with coefficients $1$ and $1/2$ and binary variables
A set partitioning with binary variables, one pattern per day
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.
Minimisation problem whose linear relaxation is exact, $\zlp = \zmilp = 9$, while a hand-made dual solution is worth $7$. Which statement is correct?
An exact relaxation also makes every constructive heuristic optimal
If a dual solution is worth less than $\zlp$, it is infeasible
That the relaxation is exact says nothing about the quality of a particular hand-made dual solution
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.
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?
The constraint $x_j \le M_j y_j$ alone, with binary $y_j$ and integer $x_j$
The constraint $x_j \le M_j y_j$ and a positive unit profit for type $j$
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$
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$.
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?
$18$
$28$
$10$
$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.
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?
$120$
$110$
$130$
$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.
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?
$x_j \le 1000\, y_j$
$y_j \le x_j$
$x_j \le D_j\, y_j$
$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.
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?
$x_t \le 160\, y_t$, with integer $y_t$
$160\, x_t \le 4\, y_t$, with integer $y_t$
$4\, x_t = 160\, y_t$, with continuous $y_t$
$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.
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?
$93$
$95$
$99$
$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.
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?
Because "within $1000$ miles" is a symmetric relation: $j \in S_i \iff i \in S_j$
Because there are as many candidate hubs as cities, and every square matrix is symmetric
Because every city covers itself, and the diagonal is made of $1$s
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.
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?
$37$
$125$
$36$
$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.
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$?
It equals $0$ in every optimal solution, because its coefficient is zero
It equals $1$ in every feasible solution, even with $x_3 = 0$
With $x_3 > 0$ it can be $0$, because the customer pays no set-up
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.
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"?
$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.
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?
$\ub = \tfrac{23000}{3}$
$\ub = 7800$
$\ub = 2000$
$\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.
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?
$22\,230$
$24\,000$
$420\,000$
$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.
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?
That the dual solution is the lowest among the three recipes (leather, hours, nails)
That the loafers solution uses up exactly the available leather
That the loafers solution is feasible and integer and that the dual solution is feasible
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.
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?
$\max(w_1, w_2) = |w_1 - w_2|$
$\max(w_1, w_2) = q - |w_1 - w_2|$
$\max(w_1, w_2) = q/2 + |w_1 - w_2|/2$
$\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.
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?
$465$
$510$
$400$
$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.
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?
$\beta_t$ free
$\beta_t \in \{0, 1\}$
$\beta_t \le 0$
$\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.
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?
$8$
$16$
$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.
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?
$\ub = 110$ (groups 1 and 3)
$\lb = 120$ (groups 2 and 4)
$\lb = 110$ (groups 1 and 3)
$\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.
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?
$\bar\alpha = 14$, $\ub = 112$
$\bar\alpha = 20$, $\lb = 160$
$\bar\alpha = 20$, $\ub = 160$
$\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».
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?
Neither: without one or the other the optimum stays $120$
The implication: without it the optimum rises to $130$ (groups 2 and 3)
Both cost $10$ euro each
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.
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?
$\lb = 13$
$\ub = 9$
$\ub = 7$
$\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$.
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)?
$9$
$13$
$10$
$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.
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?
$\lb = 99$; it is the value of the heuristic
$\ub = 93$; in a minimisation the dual gives an upper bound
$\lb = 93$; Paolo is the fastest both in backstroke and butterfly, but can swim only one stroke
$\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$.
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?
Because there are more swimmers than strokes
Because the times are integer
The constraint matrix is the assignment one, totally unimodular: all vertices of the relaxation are integer
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.
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?
Atlanta, Los Angeles, San Francisco
Atlanta, Los Angeles
Chicago, Los Angeles, Seattle
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.
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?
It is infeasible: Atlanta appears in four sets
The three cities are the largest; it gives $\lb = 3$, but the optimum could be $2$
Every hub covers at least one of the three; it gives $\ub = 3$
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$.
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)?
$(12, 15, 18, 25)$
$(2, 5, 2, 16)$
$(2, 5, 2, 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.
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?
$\ub = 25$
$\ub = 100/6$
$\ub = 100/3$
$\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$.
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?
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).
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|$?
about $2\%$
about $0.2\%$
$50$
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$).
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/200$, $1/400$, $1/200$
$1/200$ million for all three customers
$1/100$, $3/400$, $1/200$
$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$.
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$?
$5$; the MILP must still be solved to know whether it is optimal
$2$; customer 3's setup is paid anyway
$5$; but it is an upper bound, not a solution
$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.
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)?
$34$
$17$
$18$
$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}$.
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?
$\ub = 26$: the sum of the maxima per seminar
$\lb = 34$: in a maximisation the dual gives a lower bound
$\ub = 18$: it coincides with the optimum
$\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$.
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?
$14$
$12$
$10$
$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).
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?
$2$: $\lb = 2$
$4$: it is the optimum
$3$: $\ub = 3$
$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)$).
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)?
$2500$
$5200$
$2000$
$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.
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$?
$\lb = 2000$, gap $25\%$
$\lb = 2000$ (operation 1 only), gap $20\%$
$\lb = 3800$ (operations 1 and 3), gap $52\%$
$\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\%$).
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?
$21176$
$22286$
$18000$
$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$.
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$?
$(9, 9)$; the bound is $9$, so the solution is optimal
$(13, 5)$; the bound is $9$
$(9, 9)$; the bound is $7$, a gap remains
$(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$.
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?
Because balancing cannot be modelled with binary variables
Because with two workers all translations give the same model
Because the min-max model is the only linear one
«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.
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?
It is the heuristic's cost divided by the number of patterns
Every worker costs $100$ euro per week
Every unit of daily requirement costs at least $100$ euro, the cheapest cost of a full day
$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$.
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?
about $19.1\%$
about $33.5\%$
about $16.1\%$
$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$.
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?
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$.
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?
Hiring and paying workers only for the third-month peak costs more than storage at $3$ euro per pair
Because storage is free in the first month
Because the initial stock must be used up immediately
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.
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$?
$2$
$4$
$0$
$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$.
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?
It is wrong: the correct bound is $0$, so the optimum is $0$
It is an upper bound, not a lower bound
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$
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.
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?
The relaxation is integral, but the MILP optimum may be higher
Nothing: the MILP must be solved to confirm
The optimum is below $24000$, because the thresholds cut solutions
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.
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?
The integer optimum is actually $7$
The dual solution is wrong, because it is not worth $9$
That the relaxation is exact says nothing about the quality of a particular hand-built dual solution
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.
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?
Because the assignment constraints are equalities
It has a single family of variables, and availability is a capacity constraint, not an implication
Because all the costs $c_{jm}$ are strictly positive
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.
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?
Every used machine performs at most one job at a time
Every job goes on the used machine of minimum cost, within its availability
If a machine performs jobs then it is used, and a used machine does not exceed its availability
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$.
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?
With a continuous $y_m$, the constraints $y_m \le t_{jm} x_{jm}$ for every job, and $\min \sum_m y_m$
With a continuous $y_m$, the constraints $y_m \ge t_{jm} x_{jm}$ for every job, and $\min \sum_m y_m$
With a continuous $y_m$, the constraint $y_m \ge \sum_j t_{jm} x_{jm}$, and $\min \sum_m y_m$
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.
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?
Valid inequalities, satisfied by every feasible solution, that strengthen the relaxation
Redundant constraints, already implied by the maximum constraints $y_m \ge t_{jm} x_{jm}$
Constraints that preserve optimality but are not valid: the model admits $y_m > 0$ on an empty machine
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$.
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?
It holds in every optimal solution, because the setup consumes time
It is imposed by the constraints $x_j \le y_c$ in every feasible solution
There exists an optimum in which it holds, because $f_c$ may be zero
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.
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?
Different integer set, weaker relaxation
Nothing, not even in the linear relaxation
Same integer set, stronger relaxation
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.
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$"?
$z \le x_j + x_i - 1$
$x_j + x_i - z \le 1$
$x_j + x_i + z \le 2$
$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.
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?
They are needed to make the big-M $M = \sum_j t_j$ valid in the precedence constraints
They are valid, because a cycle of precedences is impossible, and they cut off the $1/2$ solutions of the relaxation
They preserve optimality but are not valid: they cut off some feasible sequences
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.
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$?
The constraints give $\tau_j \ge \max\{0, \kappa_j - d_j\}$, and the optimum brings equality
The constraints already give $\tau_j = \max\{0, \kappa_j - d_j\}$ in every feasible solution
A binary with big-M is needed to write the maximum of $0$ and $\kappa_j - d_j$
$\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.
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?
"$y_c = 1 \Rightarrow$ class complete" is imposed by the constraints; "class complete $\Rightarrow y_c = 1$" holds in every optimum
Both directions are imposed by the constraints $x_j \ge y_c$ in every feasible solution
Neither direction is guaranteed, by the constraints or by optimality
"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".
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?
$c_m > 0$ and the fact that setting $y_m = 0$ on an empty machine keeps the link satisfied ($0 \le 0$)
$c_m \ge 0$ and the fact that setting $y_m = 0$ on an empty machine keeps the link satisfied ($0 \le 0$)
The assignment constraints and total unimodularity of the matrix
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".
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?
That $u > 0$ and that the machine availability be saturated at the optimum
That setting $z = 0$ stays feasible (it frees $u$ minutes, no mixed pair is active) and that $z$ does not appear in the objective
The constraint $x_j + x_i - z \le 1$ read backwards, as "$z = 1 \Rightarrow$ mixed pair"
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".
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?
That every job meet its due date, $\kappa_j \le d_j$
That the optimal total tardiness be zero
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$
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$.
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?
$\zmilp \le 20$
$20 \le \zmilp \le 34$
$\zmilp \ge 34$
$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$.
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?
It must go on the cheapest machine, which remains profitable
It must be performed anyway, because every job has a positive revenue
Performing it never pays: it would require switching on a machine that costs more than it earns
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.
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$?
Because the jobs are optional: one chooses which to perform, and an unprofitable job stays out
Because the dual requires non-negative variables for those constraints
Because with "$=$" the linear relaxation would become integer
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.
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?
$9$
$4$
$10$
$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".
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?
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
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
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
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.
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?
Fix $x_{jm} = 1$, because the job must be assigned anyway
Fix $x_{jm} = 0$: the model shrinks and the relaxation does not worsen
Increase $a_m$ up to $t_{jm}$
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.
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?
Only that a switched-off machine does not work
That every switched-on machine performs at least one job
Both the availability of a switched-on machine and that a switched-off machine performs no jobs
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.
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?
They lower the value of the relaxation, because they add variables
They do not change the integer optimum (they are implied on integer points) but raise the value of the relaxation
They change the integer optimum, because they forbid feasible assignments
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.
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?
When the machine is already on for other jobs
When it would be the only job on its machine: its revenue does not pay for switching on
Always: a low-revenue job is never performed
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.
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$?
$y_m = \max_j t_{jm}$
$y_m \ge \sum_j t_{jm} x_{jm}$
$y_m \le t_{jm} x_{jm}$ for every job $j$
$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.
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?
They are valid inequalities, because no optimal solution violates them
They are cuts: they reduce the relaxation without removing integer solutions
They are wrong: they exclude the optimal solution
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.
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?
$y_c \le x_j$ for every $j$ in class $c$, and $\sum_j t_j x_j \le a$
$x_j \le y_c$, and $\sum_j t_j x_j \le a + \sum_c s_c y_c$
$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.
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?
It is necessary: without it the model is wrong
It is not valid (the model admits an activated empty class) but it preserves optimality: activating an empty class costs without yielding
It changes the optimum, because it forbids optimal solutions
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.
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?
Both, always, because it is an if and only if
«Two classes used ⇒ $z = 1$»: the objective prefers $z = 0$ (more time), so optimisation does not guarantee this direction
«$z = 1$ ⇒ two classes used»: without it the solver would set $z = 1$ to gain time
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.
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?
They are valid (a cycle of precedences is impossible in a sequence) and cut fractional solutions of the relaxation
They are necessary: without them the model admits integer cyclic sequences
They preserve optimality but are not valid
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.
Assignment with availabilities and constraints $\sum_m x_{jm} = 1$. A student adds $x_{jm} \le 1$ «to strengthen the relaxation». What is obtained?
An infeasible model
A different integer optimum
A stronger relaxation, because points with $x_{jm} > 1$ are removed
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.
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?
Early jobs would get $\tau_j < 0$ and «offset» the delays: net lateness would be minimised, not total tardiness
Nothing: $\tau_j$ is non-negative at the optimum anyway
The model becomes infeasible
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.
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?
It weakens the relaxation without changing the optimum
It allows a job on two machines
None: with binaries it is the same
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.
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?
It meets the customers' demand and imposes the capacity of the site
It imposes the capacity of the site and forces every installed site to ship something
It links shipments to installation (nothing leaves a closed site) and imposes the capacity of the site
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$.
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"?
It follows from the CNF of $y_{lc} \Rightarrow x_l$, which gives both directions
It holds in every optimum, because the distances are strictly positive
It is neither imposed nor guaranteed by optimality: nothing discourages an unused open site
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.
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$?
At most $m - 1$ strong sites installed for customer $c$
No strong site installed for customer $c$
At most one strong site installed for customer $c$
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.
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:
A valid inequality that strengthens the linear relaxation
Not valid (the model admits $z_j > 0$ with $y_j = 0$), but it preserves optimality
Necessary for the model to compute the cost correctly
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.
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)?
The integer optimum goes up, the relaxation does not change
Neither the integer optimum nor the relaxation changes
Both go up, because the model has more constraints
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).
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$"?
Nothing on the optimal value: opening one more site lengthens no distance
The problem becomes infeasible, because the extra sites stay empty
The linear relaxation becomes integer
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.
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?
It is imposed by the aggregated activation constraint in every feasible solution
It holds in every optimum whatever $f_j \ge 0$ is, because an empty hub is useless
It is not imposed by the constraints; if $f_j > 0$ it holds in every optimum, if $f_j = 0$ only in some optimum
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.
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?
That the customer have at least one candidate site with a strong signal
The constraint $\sum_l x_l \le k$ on the number of installed sites
$p_c > 0$ and the fact that $y_c$ appears only in those two constraints, which stay satisfied when it is raised
$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".
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?
$\ub = 13$
$\lb = 6$
$\lb = 13$
$\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.
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?
$13$
$15$
$18$
$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.
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$?
$4$
$26/5$
$6/5$
$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.
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?
$\sum_l y_{lc} \le d_c$ for every customer $c$
$\sum_l y_{lc} = d_c$ for every customer $c$
$\sum_c y_{lc} = d_c$ for every site $l$
$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.
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?
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
That the relaxation with it coincides with the relaxation with the disaggregated links
That it is satisfied by at least one optimal solution, even if it cuts off other feasible ones
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.
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?
It is valid only if every site has capacity $u_l \ge \sum_c d_c$
It is redundant even in the relaxation, because implied by the capacity constraint
It preserves the optimum but is not valid: it cuts off feasible shipments above $d_c$
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.
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?
Open all three sites to cover it
Lower the threshold $t$ for that customer
Nothing: the solver will find out by itself
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.
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?
For none: the constraint is always needed
For those with $|\mathscr{L}_c| \ge 2$
For those with $|\mathscr{L}_c| \le 1$: they cannot receive two strong signals
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.
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?
It is a valid inequality
It preserves optimality but is not valid: the model admits $z_j > 0$ with $y_j = 0$, which is never convenient when minimising
It excludes the optimum
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.
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?
Because it is false: a customer may receive more than its demand
Because it makes the model infeasible
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
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).
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?
$100$
$40$
$70$
$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.
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?
$x_t = 0 \Rightarrow y_t = 0$ is imposed; $y_t = 0 \Rightarrow x_t = 0$ holds in every optimum
$y_t = 0 \Rightarrow x_t = 0$ is imposed; $x_t = 0 \Rightarrow y_t = 0$ holds in every optimum
Both directions are imposed by the constraint $x_t \le M_t\, y_t$
$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".
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?
$y_t = m_0 + \sum_{j=1}^{t} z_j$, i.e. $z_t = y_t - y_{t-1}$ with $y_0 = m_0$
$z_t = y_t + y_{t-1}$ with $y_0 = m_0$
$y_t = z_t$ for every month $t$
$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.
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}$?
To the constraints on the available working hours
To the non-negativity of the $z_t$: the ban is hidden in the domain
To no constraint: the two formulations are not equivalent
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.
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?
$M_j = \max_i \lfloor b_i / a_{ij} \rfloor$ over the resources the type consumes
$M_j = \sum_i \lfloor b_i / a_{ij} \rfloor$ over the resources the type consumes
$M_j = \min_i \lfloor b_i / a_{ij} \rfloor$ over all resources, including those with $a_{ij} = 0$
$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.
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"?
$\sum_j y_j \le 2z$
$z \le y_1 + y_2$
$z \ge \sum_j y_j - 1$
$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.
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?
They do not always have the same linear relaxation: it must be checked case by case
They always have the same objective function, constants included
The one with fewer constraints always has the stronger linear relaxation
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.
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?
$\bar r \ge 0$ and the fact that raising $z$ to $1$ keeps $2z \le \sum_j y_j$ satisfied
$\bar r > 0$ and the fact that raising $z$ to $1$ keeps $2z \le \sum_j y_j$ satisfied
That the unit profits $\bar p_j$ of all types be positive
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.
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?
$x_1 - s_1 = d_1 + r_0$
$x_1 + s_1 = d_1 + r_0$
$x_1 - s_1 = d_1 - r_0$
$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.
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)?
A $70$, B $100$
A $50$, B $100$
A $60$, B $50$
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$.
"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?
$2$
$25$
$5/2$
$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.
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?
The integer optimum does not change and the linear relaxation gets stronger
The integer optimum changes, because larger quantities can be produced
The integer optimum does not change and the linear relaxation gets weaker
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.
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?
The correspondence $z_t = y_t - y_{t-1}$, one-to-one between integer solutions, preserving feasibility and the cost up to a constant
That the two formulations have the same number of variables and constraints
That the two linear relaxations have the same optimal value
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.
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?
The maximum producible quantity of type $j$ alone with the available resources
A large constant equal for all, for example $10^6$
The minimum quantity $\bar q_j$
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.
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?
No: the constraint allows the bonus with a single type
No: $z$ must be a general integer, not binary
Yes: the constraint forbids the bonus with fewer than two types, and the objective brings $z$ to $1$ as soon as allowed
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.
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?
If the reward is not taken with points, then it is taken with a contribution
The constraint forces every reward to be taken in one of the two ways
The constraint admits only the configurations $(1,0)$ and $(0,1)$
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.
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?
Because the pairwise constraints would give a different set of integer solutions
Because the pairwise constraints need auxiliary variables for every conflict
Because the per-item constraint always makes the linear relaxation integer
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.
"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)?
Both $3/2$
$\zlp = 3$ and $\zmilp = 1$
$\zlp = 3/2$ and $\zmilp = 1$
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.
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?
To make the linear relaxation of the model exact
To respect the upper limits on the intake of the nutrients
Without it, indicators with $x_i = 0$ would be switched on and the variety would be met by foods not eaten
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".
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?
$z_c \ge x_c$
$z_c \le x_c$, with no big-M
$x_c \le M z_c$, with $M$ the number of trees
$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.
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}$?
$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.
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}$?
The single constraint is weaker, because it is one instead of many
No difference, for any number of nationalities
The single constraint admits camps in which $c$ is outnumbered by another nationality
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.
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$?
Because the variable $z$ is free and the relaxation drives it to $-\infty$, then to $0$
Because the model has a single family of binary variables
With $x_i = 1/2$ every branch is split in half and the revenues of the two companies coincide on every product
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.
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?
The constraints already impose $y$ equal to the duration of the longest CD
At the optimum $z$ is $0$, because it is bounded only from above
Minimising $y - z$ is equivalent to minimising $y$ alone
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.
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?
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
A big-M equal to the largest height and the constraints $y_s \ge h_b\, x_{bs}$
The width constraints of the shelves and the coefficient $1 > 0$ of $y_s$ in the minimisation
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.
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,3\}$ and $\{3,4\}$, value $24$
$\{1\}$ and $\{2,4\}$, value $16$
$\{1,3\}$ and $\{2,4\}$, value $22$
$\{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.
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|$?
It spreads the bid's profit over its items: it stays feasible and gives a lower upper bound than without dividing
To always obtain the optimal dual solution
Without the division the dual solution would be infeasible
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.
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$
$3$
$9$
$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.
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?
On the value of the constructive heuristic, which is a lower bound in minimisation problems
On integrality: each branch goes wholly to one company, and product by product exact ties are limited
On a feasible dual solution of the relaxation with a positive value
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.
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)?
$3$ variables and $5$ constraints
$6$ variables and $5$ constraints
$6$ variables and $3$ constraints
$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$.
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?
In every feasible solution $c_i \le x_i \le d_i$, whatever $y_i$
The two constraints make $x_i$ integer, because $y_i$ is binary
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$
$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.
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?
The lights of colour $l$ bought are enough for those needed by the decorated trees
The number of boxes is at least the number of trees
Every box bought must be used on at least one tree
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.
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?
$18$
$12$
$9$
$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.
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}$?
Because then $y_s$ can be declared binary
Because $y_s = \max_b h_b x_{bs}$ would give an infeasible model
Because the pairwise constraints already impose equality in every feasible solution
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.
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?
$x_i + y_i \le 1$ for every $i$, and $\sum_i (a_i x_i + b_i y_i) \le p$
$x_i + y_i \le 2$ for every $i$, and $\sum_i (a_i + b_i)(x_i + y_i) \le p$
$x_i \le y_i$ for every $i$, and $\sum_i (a_i x_i + b_i y_i) \le p$
$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.
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?
Fix that reward to «taken»
Eliminate the mode with contribution, which is useless
Nothing: both modes remain necessary
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.
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?
$c_i y_i \le q_i \le d_i y_i$ for every $i$, and $\sum_i y_i \ge t$
$c_i \le q_i \le d_i$ for every $i$, and $\sum_i q_i \ge t$
$c_i y_i \le q_i \le d_i y_i$ for every $i$, and $\sum_i y_i \le t$
$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.
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?
The upper bounds on nutrients
The fact that quantities are in kilograms
The minimum lots for the chosen foods and the counting of different foods
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.
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?
$v_{bl} z_b \ge u_{cl} x_c$ for every $b$, $c$, $l$
$\sum_b v_{bl} z_b \ge \sum_c u_{cl} x_c$ for every colour $l$
$\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.
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$?
In both cases the optimum would stay the same
With $\ge q$ the optimum would decorate infinitely many trees
With $\le q$ the optimum would decorate nothing (zero cost); with $\ge q$ nothing would change, because decorating more costs more
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.
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?
They could not: continuous $x$ would always change the optimum
Because the problem is a minimisation
Because the number of boxes is already integer
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.
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?
$11$: one box per unit
$2$: the number of boxes is integer, so one rounds up
$11/10$: a bound is not rounded
$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.
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?
$\sum_j f_{ij} \ge \sum_j g_{ij}$ for every nationality $i$
$\sum_{i,j} f_{ij} \ge \sum_{i,j} g_{ij}$
$f_{ij} \ge g_{ij}$ for every nationality $i$ and camp $j$
$\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.
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?
$\ub = 23$, the sum of the capacities
$\ub = 46$, twice the capacities (girls and boys)
$\ub = 15$, the capacity of the largest camp
$\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$.
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?
Transportation, with integral relaxation
Number partitioning, NP-complete (one of Karp's twenty-one problems)
The assignment problem, solvable in polynomial time
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.
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?
$\min z$ with $z \le D_j$ and $z \le -D_j$ for every $j$
$\min z$ with $z \ge D_j$ and $z \ge -D_j$ for every product $j$
$\min z$ with $z \ge D_j$ for every $j$
$\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.
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$?
Because the linear relaxation is worth $1$
The two durations are integers with an odd sum, so they cannot be equal: the difference is at least $1$
Because each CD must contain at least one track
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.
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?
Because without it the model is unbounded
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
It is not needed: it can be dropped without changing the problem
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.
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?
By imposing $y_1 \ge y_2 \ge \dots \ge y_m$ on the shelf heights
By adding one more shelf
By fixing every book to a shelf before solving
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.
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?
Items can be split among several containers
The cost of a container is not fixed but depends on its content (the tallest book)
One maximises instead of minimising
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}$.
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:
Independent: there can be camps respecting one and violating the other
The first implies the second
Equivalent: one implies the other
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.
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?
The integrality of the units, which become fractional in transportation
Nothing: pure transportation has the same optimum
The availability constraints of the plants
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?
$25.0\%$
$20.0\%$
$37.3\%$
$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?
$46.8\%$
$31.9\%$
$40.6\%$
$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)?
$43.5\%$
$77.0\%$
$56.5\%$
$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)?
$11.1\%$
$12.5\%$
$88.9\%$
$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?
$\ub = 75$
$\ub = 76$
$\ub = \tfrac{301}{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?
$\lb = 42$
$\lb = 41$
$\lb = \tfrac{251}{6}$
$\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)$?
$(91, 40)$
$(40, 91)$
$(91, 38)$
$(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)$?
$(90, \tfrac{67}{2})$
$(\tfrac{67}{2}, 90)$
$(90, 28)$
$(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$?
$\zlp = \tfrac{105}{4}$, $\zmilp = 24$
$\zlp = \tfrac{105}{4}$, $\zmilp = 21$
$\zlp = 26$, $\zmilp = 24$
$\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$?
$\zlp = \tfrac{476}{11}$, $\zmilp = 42$
$\zlp = \tfrac{476}{11}$, $\zmilp = 40$
$\zlp = 43$, $\zmilp = 42$
$\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?
$13$
$43$
$24$
$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?
$15$
$34$
$22$
$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?
$\lb = 24$, $\ub = \tfrac{77}{2}$
$\lb = 20$, $\ub = \tfrac{77}{2}$
$\lb = 24$, $\ub = 39$
$\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?
$\lb = 19$, $\ub = 24$
$\lb = 12$, $\ub = 24$
$\lb = 19$, $\ub = 35$
$\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?
$\lb = 37$
$\lb = 4$
$\lb = 31$
$\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?
$\lb = 16$
$\lb = 3$
$\lb = 23$
$\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?
$(2, 3, 1)$
$(3, 2, 1)$
$(2, 3, 0)$
$(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, 2, 3)$
$(2, 1, 3)$
$(1, 2, 2)$
$(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, 2, 3, 4\}$
$\{1, 2, 3, 4, 5\}$
$\{2, 5\}$
$\{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, 2, 4\}$
$\{1, 2, 3, 4\}$
$\{1, 3, 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, 3, 4\}$
$\{1, 2, 3\}$
$\{1, 2, 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, 2\}$
$\{3, 4\}$
$\{2, 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)?
$\zmilp = 49$, gap $64.7\%$
$\zmilp = 49$, gap $2.0\%$
$\zmilp = 48$, gap $64.7\%$
$\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)?
$\zmilp = 36$, gap $68.0\%$
$\zmilp = 36$, gap $11.1\%$
$\zmilp = 32$, gap $68.0\%$
$\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)?
$11$
$30$
$6$
$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?
$25$
$24$
$27$
$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$?
$137 \le \zmilp \le 161$, gap $17.5\%$
$161 \le \zmilp \le 137$, gap $17.5\%$
$\zmilp = 137$, gap $0\%$
$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$?
$167 \le \zmilp \le 177$, gap $5.6\%$
$177 \le \zmilp \le 167$, gap $5.6\%$
$\zmilp = 177$, gap $0\%$
$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?
$5040$
$4805$
$7200$
$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?
$6732$
$6799$
$6120$
$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.
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$?
$\tfrac{50}{3}$
$11$
$50$
$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.
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$?
$\tfrac{44}{3}$
$11$
$44$
$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)$?
$(6, 5)$
$(7, 5)$
$(6, 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)$?
$(6, 5)$
$(7, 5)$
$(6, 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.
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)?
$8$
$10$
$7$
$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.
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)?
$14$
$16$
$13$
$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?
$6$
$4$
$7$
$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?
$7$
$6$
$5$
$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?
$11$
$10$
$14$
$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?
$26$
$18$
$30$
$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)$?
$(20, 14)$
$(14, 20)$
$(20, 38)$
$(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)$?
$(11, 9)$
$(9, 11)$
$(11, 19)$
$(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?
$30$
$28$
$21$
$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?
$20$
$17$
$15$
$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)?
$24$
$33$
$13$
$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)?
$16$
$23$
$14$
$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?
$(19, 18)$
$(18, 19)$
$(22, 18)$
$(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?
$(22, 21)$
$(21, 22)$
$(21, 21)$
$(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?
$x_{9} + x_{8} - x_{6} \ge 0$
$x_{9} - x_{6} \ge 0$ and $x_{8} - x_{6} \ge 0$
$x_{6} - x_{9} - x_{8} \ge 0$
$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?
$x_{8} - x_{3} \ge 0$ and $x_{1} - x_{3} \ge 0$
$x_{8} + x_{1} - x_{3} \ge 0$
$x_{3} - x_{8} \ge 0$ and $x_{3} - x_{1} \ge 0$
$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$?
$42$
$39$
$48$
$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$?
$34$
$29$
$35$
$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?
$5$
$3$
$6$
$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?
$6$
$2$
$7$
$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$?
$\beta = -1$
$\beta = 1$
$\beta = -2$
$\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$?
$\beta = 0$
$\beta = 1$
$\beta = -1$
$\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?
$15$
$20$
$21$
$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?
$15$
$20$
$21$
$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?
$8$
$51$
$2$
$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?
$5$
$35$
$1$
$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?
$48$
$16$
$62$
$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?
$68$
$51$
$85$
$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?
$3$
$2$
$\tfrac{8}{3}$
$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?
$3$
$2$
$\tfrac{27}{13}$
$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?
$30$
$41$
$49$
$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?
$25$
$11$
$14$
$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?
$24$
$8$
$22$
$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?
$19$
$8$
$17$
$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.
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$?
$35$
$\tfrac{407}{13}$
$38$
$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}$.
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$?
$24$
$\tfrac{250}{11}$
$26$
$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?
$y \ge x_{1} + x_{2} + x_{3} - 2$
$y \ge x_{1} + x_{2} + x_{3} - 3$
$3y \ge x_{1} + x_{2} + x_{3}$
$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?
$y \ge x_{1} + x_{2} + x_{3} - 2$
$y \ge x_{1} + x_{2} + x_{3} - 3$
$3y \ge x_{1} + x_{2} + x_{3}$
$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?
$(17, 9)$
$(9, 17)$
$(44, 24)$
$(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?
$(3, 16)$
$(16, 3)$
$(12, 45)$
$(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.
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?
$(16, 15, 1)$
$(\tfrac{31}{2}, \tfrac{31}{2}, 0)$
$(15, 16, 1)$
$(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.
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?
$(18, 17, 1)$
$(\tfrac{35}{2}, \tfrac{35}{2}, 0)$
$(17, 18, 1)$
$(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$?
$46$
$\tfrac{71}{2}$
$61$
$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$?
$94$
$\tfrac{426}{5}$
$59$
$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?
$110$
$170$
$210$
$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?
$175$
$185$
$200$
$-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?
$155$
$95$
$135$
$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?
$168$
$98$
$150$
$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?
$545$
$610$
$480$
$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?
$405$
$450$
$360$
$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$?
$130$
$140$
$180$
$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$?
$150$
$160$
$190$
$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?
$(92, 88)$
$(88, 92)$
$(99, 88)$
$(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?
$(83, 82)$
$(82, 83)$
$(96, 82)$
$(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?
$16$
$73$
$\tfrac{211}{225}$
$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?
$18$
$79$
$\tfrac{29}{25}$
$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?
$10$
$24$
$7$
$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?
$16$
$14$
$21$
$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?
$22$
$28$
$33$
$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?
$4$
$10$
$12$
$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$?
$23$
$17$
$14$
$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$?
$16$
$7$
$11$
$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?
$25$
$10$
$24$
$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?
$21$
$14$
$16$
$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)$?
$(25, 14)$
$(14, 25)$
$(38, 14)$
$(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)$?
$(28, 13)$
$(13, 28)$
$(37, 13)$
$(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?
$174$
$34$
$190$
$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?
$181$
$61$
$245$
$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$?
$94$
$234$
$34$
$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$?
$133$
$227$
$57$
$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?
$80$
$70$
$65$
$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?
$40$
$25$
$90$
$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.
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?
$160$
$140$
$220$
$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.
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?
$190$
$170$
$200$
$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$?
$80$
$95$
$130$
$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$?
$10$
$50$
$115$
$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?
$520$
$80$
$600$
$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?
$310$
$160$
$390$
$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?
$95$
$147$
$99$
$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?
$102$
$156$
$105$
$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)$?
$(7, \tfrac{53}{6})$
$(\tfrac{53}{6}, 7)$
$(7, 16)$
$(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)$?
$(33, \tfrac{75}{2})$
$(\tfrac{75}{2}, 33)$
$(33, 51)$
$(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?
$11$
$22$
$1$
$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?
$21$
$31$
$1$
$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?
$130$
$150$
$100$
$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?
$260$
$290$
$220$
$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.