← Back to the site

Question bank

583 fixed questions · 32 generated questions

Fixed questions (583)

Part: Problems (301)

1. Combinatorial optimization: definitions (48)

oc-f-001 · level facile · notes
How many distinct cyclic orderings do $n=6$ elements have, if a sequence, its rotations and its reverse are the same cyclic ordering?
  1. $64$
  2. $60$
  3. $720$
  4. $120$
Explanation. The number is $\frac{(n-1)!}{2}=\frac{5!}{2}=60$: the first element is fixed ($n$ rotations) and every sequence is identified with its reverse. $6!$ counts the orderings, $2^6$ the subsets.
oc-f-002 · level facile · notes
In a combinatorial optimization problem in maximization form, let $z(I)$ be the optimal value of instance $I$. The value $f(\bar S)$ of a feasible solution $\bar S$ is:
  1. a primal bound, i.e., a lower bound on $z(I)$
  2. a dual bound, i.e., an upper bound on $z(I)$
  3. a primal bound, i.e., an upper bound on $z(I)$
  4. a dual bound, i.e., a lower bound on $z(I)$
Explanation. A feasible solution gives a primal bound; in a maximization problem $f(\bar S)\le z(I)$, hence it is a lower bound. In minimization problems the roles are exchanged.
oc-f-003 · level facile · notes
For an instance of a combinatorial optimization problem in maximization form we know $\mathrm{LB}=16$ (value of a feasible solution) and $\mathrm{UB}=20$ (dual bound). What is the relative gap?
  1. $20\%$
  2. $4$
  3. $80\%$
  4. $25\%$
Explanation. The relative gap is $\frac{\mathrm{UB}-\mathrm{LB}}{|\mathrm{LB}|}=\frac{4}{16}=25\%$. The value $4$ is the absolute gap; dividing by $\mathrm{UB}$ gives $20\%$.
oc-f-004 · level teorema · notes
In a combinatorial optimization problem with objective function $f$, let $\beta$ be a dual bound on the optimal value $z(I)$ of an instance $I$ ($\beta\ge z(I)$ in maximization form, $\beta\le z(I)$ in minimization form). Which statement is correct?
  1. In maximization form $\lfloor\beta\rfloor$ is always a dual bound, even if $f$ does not take integer values
  2. If $f(S)\in\Z$ for every feasible solution $S$, in minimization form $\lfloor\beta\rfloor+1$ is also a dual bound
  3. If $f(S)\in\Z$ for every feasible solution $S$, in maximization form $\lfloor\beta\rfloor$ is also a dual bound
  4. If $f(S)\in\Z$ for every feasible solution $S$, in maximization form $\lceil\beta\rceil-1$ is also a dual bound
Explanation. With an integer objective, in a maximization problem $f(S)\le\beta$ implies $f(S)\le\lfloor\beta\rfloor$; in a minimization problem one rounds up, $\lceil\beta\rceil$. Without the integrality of $f$ the rounding is not allowed.
oc-f-005 · level facile · notes
In the knapsack problem (KP) with $n$ items and integer capacity $c$, an algorithm executes $\Theta(nc)$ steps. How is it classified with respect to the input size?
  1. Strongly polynomial, because it does not depend on the profits
  2. Pseudo-polynomial: polynomial in the value of $c$, not in the number of digits of $c$
  3. Polynomial: the number of steps is a polynomial in $n$ and $c$
  4. Exponential in $n$, because it examines the subsets of the items
Explanation. $c$ is written with $\log c$ digits: $\Theta(nc)$ is polynomial in the value of the largest number, not in the size of the instance. This is the definition of a pseudo-polynomial algorithm.
oc-f-061 · level facile · notes
For a combinatorial optimization problem in maximization form, with objective function $f$, what does its decision version ask?
  1. Whether all feasible solutions have value at least $k$, for a given integer $k$
  2. Whether some feasible solution has value at least $k$, for a given integer $k$
  3. What the optimal value $z(I)$ of the instance is
  4. To find a feasible solution of maximum value
Explanation. The decision version has a yes/no answer: «is there a solution with $f(S)\ge k$?». A solution of value at least $k$ is a certificate checkable in polynomial time.
oc-f-062 · level teorema · notes
An NP-hard problem is strongly NP-hard if it remains NP-hard even when all its numbers are bounded by a polynomial in the instance size. If $P\neq NP$, which statement is correct?
  1. A strongly NP-hard problem has no pseudo-polynomial algorithm
  2. A strongly NP-hard problem has no exact algorithm
  3. A strongly NP-hard problem has a pseudo-polynomial algorithm, but no polynomial one
  4. A strongly NP-hard problem is polynomial if its numbers are bounded by a polynomial
Explanation. With numbers bounded by a polynomial a pseudo-polynomial algorithm would become polynomial, and would solve a problem that is still NP-hard in that case. Exponential exact algorithms always exist (for example brute force).
oc-f-063 · level facile · notes
An NP-hard problem is weakly NP-hard if it admits a pseudo-polynomial algorithm (polynomial in the size and in the value of the largest number). Which of the following problems is only weakly NP-hard?
  1. Bin packing (BPP)
  2. Vertex coloring (VCP)
  3. The travelling salesman problem (TSP)
  4. The 0-1 knapsack problem (KP)
Explanation. The KP is solved by dynamic programming in $\Theta(nc)$, a pseudo-polynomial time; bin packing, coloring, maximum clique and the TSP are strongly NP-hard.
oc-f-064 · level facile · notes
The decisions of combinatorial optimization problems fall into five categories: IN/OUT, counting, assignment, ordering, configuration and partitioning. Which category does a bin packing solution (items in interchangeable bins of capacity $c$) belong to?
  1. Ordering: a permutation of the items
  2. Counting: a vector of integer quantities
  3. Configuration and partitioning: a partition of the items
  4. IN/OUT: a subset of the items
Explanation. The bins are interchangeable: only the grouping of the items matters, that is, a partition into groups respecting the capacity.
oc-f-065 · level facile · notes
In an assignment decision every element $i$ is assigned to exactly one of several distinct resources $j$ (for example tasks to different people). Which variables describe it naturally?
  1. A permutation $\sigma=(\sigma_1,\dots,\sigma_n)$ of the elements
  2. $x_{ij}\in\{0,1\}$, equal to $1$ if and only if $i$ goes to resource $j$, with $\sum_j x_{ij}=1$ for every $i$
  3. $x_i\in\{0,1\}$, equal to $1$ if and only if element $i$ is selected
  4. $x_i\in\Z_{\ge0}$, the number of units of element $i$ to use
Explanation. An assignment is a function from the elements to the resources: one binary variable per pair and one equality constraint per element. The others are the IN/OUT, counting and ordering variables.
oc-f-066 · level facile · notes
For $n=20$ elements four numbers of candidates are compared: $n^3$, the subsets $2^n$, the partitions $B(n)$ (Bell number) and the cyclic orderings $\frac{(n-1)!}{2}$. Which increasing order is correct?
  1. $n^3<2^n<B(n)<\frac{(n-1)!}{2}$
  2. $n^3<2^n<\frac{(n-1)!}{2}<B(n)$
  3. $2^n<n^3<B(n)<\frac{(n-1)!}{2}$
  4. $n^3<B(n)<2^n<\frac{(n-1)!}{2}$
Explanation. For $n=20$: $n^3=8000$, $2^n\approx 1.05\cdot10^6$, $B(n)\approx 5.17\cdot 10^{13}$ and $\frac{(n-1)!}{2}\approx 6.08\cdot10^{16}$. For small $n$ the order may differ (with $n=5$: $12<32<52$).
oc-f-067 · level facile · notes
Brute force for an IN/OUT problem evaluates all $2^n$ subsets of the $n$ elements. A computer evaluates $10^9$ of them per second. About how long does it take with $n=60$?
  1. About $18$ minutes
  2. About $13$ days
  3. About $36$ centuries
  4. About $36$ years
Explanation. $2^{60}\approx 1.15\cdot10^{18}$, hence about $1.15\cdot10^{9}$ seconds are needed, that is, about $36$ years. $18$ minutes and $13$ days are the times for $n=40$ and $n=50$: every $10$ more elements multiply the time by about one thousand.
oc-f-068 · level facile · notes
A combinatorial optimization problem is given by a ground set $\mathscr{U}=\{1,\dots,n\}$, a family $\mathcal{F}\subseteq 2^{\mathscr{U}}$ of feasible solutions and an objective function $f:\mathcal{F}\to\R$. Which property distinguishes it from a generic optimization problem?
  1. The family $\mathcal{F}$ contains all the subsets of $\mathscr{U}$
  2. The feasible solutions are vectors of real numbers
  3. $\mathscr{U}$ is finite, hence the feasible solutions are finitely many
  4. The objective function $f$ is linear in the decision variables
Explanation. Solutions are subsets of a finite set: there are at most $2^n$ of them, and an optimum always exists if $\mathcal{F}\ne\emptyset$. The objective may be any function and $\mathcal{F}$ describes the constraints.
oc-f-069 · level facile · notes
The 0-1 knapsack problem (items $\mathscr{U}=\{1,\dots,n\}$ with profits $p_j$, weights $w_j$, capacity $c$) is written as a combinatorial optimization problem with $f(S)=\sum_{j\in S}p_j$. What is the family $\mathcal{F}$ of feasible solutions?
  1. The subsets $S\subseteq\mathscr{U}$ with $\sum_{j\in S}p_j\le c$
  2. The subsets $S\subseteq\mathscr{U}$ with $\sum_{j\in S}w_j\le c$
  3. The subsets $S\subseteq\mathscr{U}$ with $\sum_{j\in S}w_j=c$
  4. All the $2^n$ subsets of $\mathscr{U}$
Explanation. The capacity constraint bounds the total weight, it does not fix it: $\mathcal{F}$ also contains the empty set. The equality describes subset sum.
oc-f-070 · level facile · notes
A set has $n=6$ elements. How many of its subsets have exactly $3$ elements, and how many subsets does it have in total?
  1. $20$ and $64$
  2. $120$ and $64$
  3. $20$ and $720$
  4. $18$ and $64$
Explanation. The subsets with $3$ elements are $\binom{6}{3}=20$; in total there are $\sum_k\binom{6}{k}=2^6=64$. $120=6\cdot5\cdot4$ counts the ordered triples, $720=6!$ the permutations.
oc-f-222 · level facile · notes
The decisions of combinatorial optimization problems fall into five categories (IN/OUT, counting, assignment, sequencing, configuration). One must decide how many operators to assign to each of $n$ shifts. To which category does the decision belong and what are its natural variables?
  1. Counting, with integer variables $x_j\in\Z_{\ge 0}$
  2. IN/OUT, with binary variables $x_j\in\{0,1\}$
  3. Sequencing, with a permutation $\sigma$ of the shifts
  4. Configuration, with a partition of the shifts into groups
Explanation. The decision is a discrete quantity for every shift: a vector of non-negative integers. A binary variable would only say whether the shift has operators or not.
oc-f-223 · level facile · notes
Among the decision categories of combinatorial optimization problems, assignment and configuration (partitioning) both have solutions that split the elements into classes. What distinguishes them?
  1. In assignment every element may stay unassigned, in partitioning it may not
  2. In assignment the classes all have the same cardinality, in partitioning they do not
  3. No difference: they are two names for the same category
  4. In assignment the resources are distinct (labelled classes), in partitioning the groups are interchangeable
Explanation. Distinct resources give a function from the elements to the resources ($m^n$ solutions); identical resources give partitions, counted by the Bell numbers.
oc-f-224 · level facile · notes
A facility location problem decides which facilities to open and to which open facility each customer is assigned. With respect to the five decision categories (IN/OUT, counting, assignment, sequencing, configuration), what does it combine?
  1. A counting decision (how many customers) and a sequencing decision (in which order to serve them)
  2. Only a configuration decision, because the facilities are identical
  3. An IN/OUT decision (which facilities to open) and an assignment decision (customers to facilities)
  4. Only a sequencing decision on the customers
Explanation. A real problem often combines several categories: opening is a yes/no choice per facility, then every customer goes to exactly one open facility.
oc-f-225 · level facile · notes
In the multiple knapsack problem (MKP) there are $m$ knapsacks of capacity $c_k$ and $n$ items of profit $p_j$ and weight $w_j$; every item goes into one knapsack or into none. To which decision category does the problem belong?
  1. Sequencing
  2. Assignment
  3. IN/OUT
  4. Partitioning
Explanation. The knapsacks are distinct resources (different capacities) and every item gets at most one knapsack: it is an assignment. It is not a partitioning because the knapsacks are not interchangeable.
oc-f-226 · level facile · notes
The bin packing problem (BPP) packs $n$ items of weight $w_j$ into the minimum number of identical bins of capacity $c$. To which decision category does it belong, and why?
  1. Partitioning: the bins are identical, so a solution is a partition of the items
  2. Assignment: every item gets a labelled bin
  3. IN/OUT: every item is selected or not
  4. Counting: one decides how many copies of each item to use
Explanation. Swapping the names of two identical bins does not change the solution: the distinct solutions are partitions. In the MKP, instead, the knapsacks are distinct.
oc-f-227 · level facile · notes
Before solving a combinatorial optimization problem one counts its candidate solutions. What does this number depend on?
  1. On the numerical values of the data, e.g., weights and capacities
  2. On the number of feasible solutions
  3. On the algorithm used to solve the problem
  4. Only on the combinatorial object of the solutions (subsets, orderings, partitions) and on $n$
Explanation. The candidates are all objects of the right type ($2^n$ subsets, $n!$ permutations, $B(n)$ partitions); the data only decide which ones are feasible.
oc-f-228 · level facile · notes
The Bell numbers count partitions: $B(0)=1$ and $B(n)=\sum_{k=0}^{n-1}\binom{n-1}{k}B(k)$. Knowing that $B(0),\dots,B(4)=1,1,2,5,15$, what is $B(5)$?
  1. $24$
  2. $60$
  3. $52$
  4. $31$
Explanation. $B(5)=\binom40\cdot1+\binom41\cdot1+\binom42\cdot2+\binom43\cdot5+\binom44\cdot15=1+4+12+20+15=52$. $31=2^5-1$ counts the non-empty subsets.
oc-f-229 · level teorema · notes
$n=4$ jobs are assigned to $m=2$ machines. If the machines are distinct there are $m^n=16$ assignments. If the machines are identical (swapping them does not change the solution), how many distinct solutions are there?
  1. $6$: the subsets of $2$ jobs
  2. $8$: the partitions of the $4$ jobs into at most $2$ blocks
  3. $16$: the number of assignments does not change
  4. $15$: all partitions, $B(4)$
Explanation. With interchangeable labels the solutions are the partitions into at most $m$ blocks: $1$ with one block and $7$ with two blocks ($16$ assignments, minus the $2$ with an empty machine, divided by $2$). $B(4)=15$ would also count partitions into $3$ or $4$ blocks.
oc-f-230 · level facile · notes
For $n=10$ elements four counts are compared: $n^3$, the subsets $2^n$, the partitions $B(n)$ (Bell number, $B(10)=115\,975$) and the cyclic orderings $(n-1)!/2$. Which is the largest?
  1. The cyclic orderings, $181\,440$
  2. The partitions, $115\,975$
  3. The subsets, $1\,024$
  4. $n^3=1\,000$
Explanation. $9!/2=181\,440>B(10)>2^{10}=1\,024>10^3$. For $n=5$, instead, the cyclic orderings are only $12$: they grow more slowly at first, then overtake all the others.
oc-f-231 · level facile · notes
For $n=5$ elements one compares $n^2$, the subsets $2^n$, the cyclic orderings $(n-1)!/2$ and the partitions $B(n)$, with $B(5)=52$. Which is the smallest?
  1. $n^2=25$
  2. The subsets, $32$
  3. The partitions, $52$
  4. The cyclic orderings, $12$
Explanation. $4!/2=12$. For small $n$ the factorial growth is not yet visible: already for $n=10$ the cyclic orderings are the most numerous.
oc-f-232 · level facile · notes
Brute force for an IN/OUT problem evaluates all $2^n$ subsets. A computer $1000$ times faster, in the same time, can handle about how many more elements?
  1. Twice as many elements
  2. About $3$, because $\log_{10}1000=3$
  3. About $10$, because $2^{10}=1024\approx 1000$
  4. $1000$ times more elements
Explanation. Multiplying the speed by $1000$ only compensates a factor $2^{10}$ in the number of candidates: $n$ grows by about $10$. A constant speed-up does not beat exponential growth.
oc-f-233 · level facile · notes
A computer evaluates $10^9$ candidate solutions per second and brute force enumerates the $2^n$ subsets of $n=50$ elements ($2^{50}\approx 1.13\cdot 10^{15}$). About how long does the enumeration take?
  1. About $36$ years
  2. About $13$ days
  3. About $1$ second
  4. About $18$ minutes
Explanation. $1.13\cdot10^{15}/10^9\approx1.13\cdot10^6$ seconds, i.e., about $13$ days. $1$ second corresponds to $n=30$, $18$ minutes to $n=40$, $36$ years to $n=60$.
oc-f-234 · level facile · notes
The size of an instance is the number of bits needed to write it. An instance contains $n$ integers, the largest of which is $M$. What is the order of its size?
  1. $n\log_2 M$
  2. $nM$
  3. $n+M$
  4. $n$, independently of $M$
Explanation. An integer $M$ is written with about $\log_2 M$ bits, not with $M$ symbols. This is why an $O(nM)$ algorithm is not polynomial in the size.
oc-f-235 · level teorema · notes
The class NP contains the decision problems whose «yes» instances have a certificate that can be verified in polynomial time. Why is the decision version of the 0-1 knapsack («is there a subset of weight at most $c$ and profit at least $k$?») in NP?
  1. Because a polynomial algorithm solves it
  2. Because the number of subsets is $2^n$, finite
  3. Because every «no» instance has a short certificate
  4. A subset satisfying both conditions is a certificate: weight and profit are summed in polynomial time
Explanation. Membership in NP only asks to verify a certificate of the «yes» instances quickly, not to find it. A polynomial algorithm would put it in P.
oc-f-340 · level ipotesi · notes
In a maximization problem the LP relaxation gives the dual bound $\beta=17.6$, and one wants to round it to $\lfloor\beta\rfloor=17$. Which assumption makes the rounding valid?
  1. That $\beta$ is positive
  2. That the gap is smaller than $1$
  3. That every feasible solution has an integer objective value (e.g., integer coefficients and integer variables)
  4. That the relaxation has a unique solution
Explanation. If $z(I)$ is integer and $z(I)\le17.6$, then $z(I)\le17$. With fractional objective values (e.g., profits $0.5$) the rounding might cut off the optimum.
oc-f-341 · level ipotesi · notes
The 0/1 knapsack is NP-hard but has a pseudo-polynomial algorithm $\Theta(nc)$; the TSP is strongly NP-hard. What can be said about a pseudo-polynomial algorithm for the TSP?
  1. It would make the TSP polynomial without consequences on P and NP
  2. It does not exist, unless P = NP: the problem stays hard even with small numbers, where pseudo-polynomial means polynomial
  3. It always exists, as for the knapsack
  4. It exists only for symmetric distances
Explanation. If the numbers are bounded by a polynomial in the size, a time polynomial in the numbers is polynomial in the size: for a strongly NP-hard problem this would give P = NP.
oc-f-358 · level facile · notes
In Definition 1.1 the family $\mathcal{F}\subseteq 2^{\mathscr{U}}$ of feasible solutions of a combinatorial optimization problem may be given by listing its elements. In the problems of the course (knapsack, bin packing, TSP, …) how is $\mathcal{F}$ given?
  1. By a rule, e.g., a capacity constraint: listing it would be impossible
  2. By an explicit list of the feasible subsets, read as input
  3. By the objective function: the subsets of positive value are feasible
  4. By a polyhedron in continuous variables, whose vertices are taken
Explanation. $\mathcal{F}$ usually has an exponential number of elements: it is described by the constraints of the problem, never by a list. Only in small teaching instances is it listed.
oc-f-359 · level facile · notes
In combinatorial optimization one distinguishes between a problem and an instance $I$ of it, and writes $z(I)$. Which statement is correct?
  1. The instance is a feasible solution of the problem; $z(I)$ is the value of that solution
  2. The problem is the decision version, the instance the optimization one; $z(I)$ is the threshold
  3. The instance fixes only $n$ and leaves the other data symbolic; $z(I)$ counts the feasible solutions
  4. The problem has symbolic data, the instance fixes the numbers; $z(I)$ is the optimal value of the instance
Explanation. An instance is obtained by fixing all the numbers of the problem (e.g., weights and capacities); $z(I)$ is the value of an optimal solution of it.
oc-f-360 · level facile · notes
In a sequencing decision one chooses the order in which $n$ elements are processed (every order is allowed). Which combinatorial object is a candidate solution and how many candidates are there?
  1. A partition of the $n$ elements: $B(n)$ candidates
  2. An ordered pair of elements: $n^2$ candidates
  3. A permutation of the $n$ elements: $n!$ candidates
  4. A subset of the $n$ elements: $2^n$ candidates
Explanation. A processing order is a sequence containing every element once: a permutation $\sigma=(\sigma_1,\dots,\sigma_n)$, and there are $n!$ permutations.
oc-f-361 · level facile · notes
Definition 1.1 describes a combinatorial optimization problem as the choice of a subset of a ground set $\mathscr{U}$. To fit a sequencing decision (a tour or a sequence) into this form, which ground set is used?
  1. The set of positions $1,\dots,n$ of the sequence
  2. The set of pairs of consecutive elements
  3. The set of elements to be ordered
  4. The set of all permutations of the elements
Explanation. A sequence is identified by the pairs (element, successor) it uses: the solution is the subset of these pairs. For an assignment, instead, the ground set is the set of pairs (element, resource).
oc-f-362 · level facile · notes
Among the application areas of combinatorial optimization, production planning includes for instance lot sizing. What are its typical decisions?
  1. What, when and how much to produce, with which resources
  2. The order and timing of the operations on single resources
  3. How to place a set of items into containers
  4. Where to open facilities and which customers each one serves
Explanation. The other three options are the typical decisions of other areas: scheduling, packing and facility location.
oc-f-363 · level facile · notes
In the application area of scheduling (order and timing of operations on resources, e.g., jobs on machines), which decision category always appears?
  1. Counting: how many copies of every operation to run
  2. IN/OUT: which operations to run and which to discard
  3. None: scheduling is a continuous problem
  4. Sequencing: the order of the operations on every resource
Explanation. Deciding the order of the operations is a sequencing decision; it is often combined with an assignment of the operations to the resources.
oc-f-364 · level facile · notes
The capacitated lot sizing problem (CLS) decides in which periods to activate production (setup) and how many units to produce in each period. Which decision categories does it involve?
  1. Assignment and partitioning of the periods
  2. Only IN/OUT (the periods in which one produces)
  3. IN/OUT (the setup periods) and counting (the quantities)
  4. Only sequencing (the order of the periods)
Explanation. The setup is a yes/no choice per period; the produced quantities are non-negative integers. The order of the periods is given, not decided.
oc-f-365 · level facile · notes
In an IN/OUT problem on $n$ elements the candidate solutions are the $2^n$ subsets. What is the relation between $2^n$ and the number $|\mathcal{F}|$ of feasible solutions?
  1. None: the two numbers can never be compared
  2. $|\mathcal{F}|\le 2^n$: the feasible ones are part of the candidates
  3. $|\mathcal{F}|\ge 2^n$: the constraints add new solutions
  4. $|\mathcal{F}|=2^n$: every subset is always feasible
Explanation. The constraints discard candidates without creating new ones: e.g., in an instance with $4$ elements only $11$ of the $16$ subsets may be feasible.
oc-f-366 · level facile · notes
For a set of $n=3$ elements, how many subsets, permutations and partitions (Bell number $B(3)$) are there, respectively?
  1. $8$, $6$ and $5$
  2. $8$, $6$ and $6$
  3. $6$, $6$ and $5$
  4. $8$, $3$ and $5$
Explanation. $2^3=8$, $3!=6$; the partitions of $\{1,2,3\}$ are $\{123\}$, $\{1|23\}$, $\{2|13\}$, $\{3|12\}$, $\{1|2|3\}$: $B(3)=5$.
oc-f-367 · level facile · notes
The $2^n$ subsets of $\{1,\dots,n\}$ correspond to the binary vectors $\vet{x}\in\{0,1\}^n$ ($x_j=1$ if and only if $j$ is in the subset). Geometrically, what are these vectors?
  1. The vertices of the simplex $\{\vet{x}\ge\vet{0}:\sum_j x_j\le 1\}$
  2. The integer points of the sphere of radius $\sqrt n$
  3. The edges of the unit hypercube $[0,1]^n$
  4. The vertices of the unit hypercube $[0,1]^n$
Explanation. For $n=2$ they are the $4$ vertices of the square, for $n=3$ the $8$ vertices of the cube. The simplex has only $n+1$ vertices.
oc-f-368 · level teorema · notes
Proposition 1.2 (a set of $n$ elements has $2^n$ subsets) is also proved via the identity $\sum_{k=0}^{n}\binom{n}{k}=2^n$. What does the term $\binom{n}{k}$ count in this proof?
  1. The partitions of the $n$ elements into $k$ blocks
  2. The ordered sequences of $k$ distinct elements
  3. The subsets with exactly $k$ elements
  4. The subsets with at most $k$ elements
Explanation. The subsets are grouped by cardinality $k=0,\dots,n$; those of cardinality $k$ are $\binom nk$. The ordered sequences of $k$ elements are $n!/(n-k)!$.
oc-f-369 · level facile · notes
A cyclic ordering places the elements on a circle: a sequence, its rotations and its reverse are the same ordering. For $n=4$ the distinct cyclic orderings are $(1,2,3,4)$, $(1,2,4,3)$ and $(1,3,2,4)$. Which of them coincides with the sequence $(2,1,4,3)$?
  1. None: it is a fourth cyclic ordering
  2. $(1,2,3,4)$: it is its reverse started from $2$
  3. $(1,2,4,3)$: it has the pair $4,3$ in the same order
  4. $(1,3,2,4)$: it is one of its rotations
Explanation. The adjacent elements in $(2,1,4,3)$, closing the circle, are $\{2,1\},\{1,4\},\{4,3\},\{3,2\}$: the same pairs as $(1,2,3,4)$, read backwards.
oc-f-370 · level teorema · notes
Proposition 1.3 says that $n\ge3$ elements have $(n-1)!/2$ distinct cyclic orderings (rotations and reverse do not count). Where do the factor $(n-1)!$ and the division by $2$ come from in the proof?
  1. The first element is fixed, the other $n-1$ are ordered; every cycle appears once per direction
  2. A random element is excluded; half of the remaining sequences are not cyclic
  3. $(n-1)!$ counts the inversions of the sequence; one divides by $2$ for the rotations
  4. The last element is fixed; every cycle has two ends, the first and the last
Explanation. Always starting from element $1$ removes the rotations: $(n-1)!$ sequences remain; each of them and its reverse, e.g., $(1,3,5,2,4)$ and $(1,4,2,5,3)$, give the same cycle.
oc-f-371 · level facile · notes
A partition of a finite set $A$ is a collection of non-empty, pairwise disjoint subsets whose union is $A$. Which collection is a partition of $A=\{1,2,3,4\}$?
  1. $\{\{1,2\},\{2,3\},\{4\}\}$
  2. $\{\{1,2\},\{3\}\}$
  3. $\{\{1,2,3,4\},\emptyset\}$
  4. $\{\{1,4\},\{2\},\{3\}\}$
Explanation. The second has non-disjoint blocks (element $2$ is in two blocks), the third does not cover element $4$, the fourth has an empty block.
oc-f-372 · level facile · notes
Brute force (maximization form) enumerates the candidates and updates the best solution $\bar S$ and its value $\LB$ only if $S$ is feasible and $f(S)>\LB$. If two feasible solutions have the same maximum value, which one does it return?
  1. Both, as the set of optimal solutions
  2. Neither: the tie makes it stop with an error
  3. The first one met in the enumeration order
  4. The last one met in the enumeration order
Explanation. With the strict inequality the second solution of equal value does not replace the first one. The returned value $z(I)=\LB$ is optimal anyway.
oc-f-373 · level facile · notes
Going from $n$ to $n+1$ elements, by which factor are the number $2^n$ of subsets and the number $(n-1)!/2$ of cyclic orderings multiplied?
  1. By $2$ both
  2. By $2$ the subsets, by $n$ the cyclic orderings
  3. By $2$ the subsets, by $n+1$ the cyclic orderings
  4. By $n$ the subsets, by $2$ the cyclic orderings
Explanation. $2^{n+1}/2^n=2$ and $\frac{n!/2}{(n-1)!/2}=n$: the factor of the cyclic orderings grows with $n$, which is why they soon overtake every exponential.
oc-f-374 · level facile · notes
Brute force enumerates the $(n-1)!/2$ cyclic orderings of $n=20$ elements. With a computer $1000$ times faster, in the same time, up to how many elements can one go?
  1. $22$: the work grows by $20\cdot21=420<1000$
  2. $30$: about $10$ more elements, as for subsets
  3. $21$: one extra element multiplies the work by $1000$
  4. $20$: no gain, the work is factorial
Explanation. From $n$ to $n+1$ the number is multiplied by $n$: $20\cdot21=420\le1000$, but $20\cdot21\cdot22=9240>1000$. The gain is only $2$ elements.

2. Knapsack problems (61)

oc-f-006 · level facile · notes
The subset sum problem (SSP) asks whether, given integers $w_1,\dots,w_n$ and $c$, some subset sums to exactly $c$. How is it obtained as a special case of the knapsack problem (KP: profits $p_j$, weights $w_j$, capacity $c$)?
  1. With $w_j=1$ for every $j$: the answer is yes if and only if the optimal value is $c$
  2. With $c=\sum_j w_j$: the answer is yes if and only if the optimal value is $\sum_j p_j$
  3. With $p_j=w_j$ for every $j$: the answer is yes if and only if the optimal value is $c$
  4. With $p_j=1$ for every $j$: the answer is yes if and only if the optimal value is $n$
Explanation. With $p_j=w_j$ the KP looks for the largest total weight not exceeding $c$; the subset sum problem asks whether the total weight $c$ can be reached exactly, i.e., whether the optimal value is $c$.
oc-f-007 · level facile · notes
In the multiple-choice knapsack problem (MCKP) the items, each with a profit and a weight, are partitioned into $q$ classes, and the knapsack has capacity $c$. Which constraint concerns the classes?
  1. All the items of a single class are chosen, without exceeding the capacity
  2. Exactly one item is chosen from every class, without exceeding the capacity
  3. At most one item is chosen from every class, without exceeding the capacity
  4. At least one item is chosen from every class, without exceeding the capacity
Explanation. In the MCKP exactly one item is selected from each class: confusing it with «at most one» is a typical mistake of the chapter.
oc-f-008 · level teorema · notes
In the knapsack problem (KP: profits $p_j$, weights $w_j$, capacity $c$, optimal value $z(I)$), let $\bar k$ be the largest integer such that the $\bar k$ lightest items weigh at most $c$ in total. Which statement is correct?
  1. Every feasible solution has at most $\bar k$ items, hence $z(I)$ is at most the sum of the $\bar k$ largest profits
  2. Every feasible solution has at most $\bar k$ items, hence $z(I)$ is at most the sum of the profits of the $\bar k$ lightest items
  3. Every optimal solution has exactly $\bar k$ items, hence $z(I)$ is the sum of the $\bar k$ largest profits
  4. Every feasible solution has at most $\bar k$ items, hence $z(I)$ is at least the sum of the $\bar k$ largest profits
Explanation. This is the cardinality bound: a feasible subset has at most $\bar k$ items, and any $\bar k$ items have total profit at most the $\bar k$ largest profits. It is a dual bound.
oc-f-009 · level facile · notes
Knapsack problem (KP) with capacity $c=9$, profits $p=(6,5,8,9,6,7)$ and weights $w=(2,3,6,7,5,9)$. The cardinality bound is the sum of the $\bar k$ largest profits, where $\bar k$ is the largest number of lightest items that fit together in the knapsack. What is its value?
  1. $11$
  2. $24$
  3. $15$
  4. $17$
Explanation. The two lightest items weigh $2+3=5\le 9$, the three lightest $2+3+5=10>9$: $\bar k=2$. The two largest profits are $9+8=17$. $15$ is the optimal value, not a bound; $11$ uses the profits of the lightest items.
oc-f-071 · level facile · notes
In the bounded knapsack problem (BKP) there are $n$ item types: type $j$ has profit $p_j$, weight $w_j$ and $b_j$ available copies; the capacity is $c$. What is the domain of the variable $x_j$, the number of chosen copies of type $j$?
  1. $x_j\in\{0,1,\dots,b_j\,w_j\}$
  2. $x_j\in\{0,1,\dots,b_j\}$
  3. $x_j\in\{0,1\}$
  4. $x_j\in\Z_{\ge0}$, without upper bound
Explanation. From $0$ to $b_j$ copies of type $j$ can be taken. With $b_j=1$ it is the 0/1 KP, without upper bound the unbounded knapsack.
oc-f-072 · level facile · notes
In the bounded knapsack problem (BKP) type $j$ has profit $p_j$, weight $w_j$ and $b_j$ available copies. How is a BKP instance transformed into an equivalent 0-1 knapsack (KP) instance?
  1. Type $j$ is replaced by $b_j$ identical items of profit $p_j$ and weight $w_j$
  2. Type $j$ is replaced by one item of profit $b_jp_j$ and weight $b_jw_j$
  3. Type $j$ is replaced by $b_j$ items of profit $p_j/b_j$ and weight $w_j/b_j$
  4. One item per type is kept and the capacity is multiplied by $\max_j b_j$
Explanation. Every copy becomes a 0/1 item: choosing $d$ copies is choosing $d$ of the $b_j$ identical items. A single aggregated item would only allow $0$ or $b_j$ copies.
oc-f-073 · level facile · notes
In the knapsack problem with setups (KPS) the items are partitioned into classes; an item of class $h$ can be chosen only if the class is activated ($y_h=1$), and the activation costs a profit $f_h$ and a weight $s_h$. Which objective is maximized?
  1. $\sum_j p_jx_j+\sum_h f_hy_h$
  2. $\sum_j p_jx_j-\sum_h f_h\sum_{j\in\mathscr{J}_h}x_j$
  3. $\sum_j p_jx_j-\sum_h s_hy_h$
  4. $\sum_j p_jx_j-\sum_h f_hy_h$
Explanation. The setup cost $f_h$ is paid once per activated class, not per item; the setup weight $s_h$ enters the capacity constraint $\sum_j w_jx_j+\sum_h s_hy_h\le c$.
oc-f-074 · level facile · notes
Knapsack with setups (KPS) with capacity $c=10$ and a single class, with setup cost $f=4$ and setup weight $s=3$; the class contains the items $(p_j,w_j)=(6,4)$ and $(5,3)$. What is the optimal value (profit minus setup cost)?
  1. $2$
  2. $1$
  3. $7$
  4. $11$
Explanation. Activating the class leaves $10-3=7$ units of capacity: both items fit, $6+5-4=7$. Without activating it the value is $0$. $11$ forgets the setup cost.
oc-f-075 · level facile · notes
Multidimensional knapsack (MDKP) with $2$ dimensions and capacities $\vet c=(5,4)$; the items have profit and weights $(p_j;w_{1j},w_{2j})$: $A=(4;3,1)$, $B=(3;2,3)$, $C=(3;2,1)$. A subset is feasible if in every dimension the total weight does not exceed the capacity. What is the optimal value?
  1. $4$
  2. $7$
  3. $10$
  4. $6$
Explanation. $\{A,B\}$ weighs $(5,4)$ and $\{A,C\}$ weighs $(5,2)$: both are worth $7$. $\{A,B,C\}$ weighs $(7,5)$ and is infeasible; $10$ ignores the capacities.
oc-f-076 · level facile · notes
In the multidimensional knapsack problem (MDKP) every item $j$ has a weight $w_{dj}$ in each of the $m$ dimensions and the knapsack a capacity $c_d$ per dimension; a chosen item consumes capacity in all dimensions. What is obtained with $m=1$?
  1. The 0-1 knapsack (KP)
  2. The multiple knapsack (MKP)
  3. The bounded knapsack (BKP)
  4. Subset sum (SSP)
Explanation. With a single dimension only one capacity constraint is left: it is the KP. In the multiple knapsack, instead, an item consumes the capacity of a single knapsack.
oc-f-077 · level facile · notes
Multiple-choice knapsack (MCKP: exactly one item per class is chosen, without exceeding the capacity) with $c=7$ and classes $\mathscr{J}_1=\{(3,2),(5,4)\}$, $\mathscr{J}_2=\{(4,3),(6,5)\}$, where every pair is $(p_j,w_j)$. What is the optimal value?
  1. $11$
  2. $7$
  3. $10$
  4. $9$
Explanation. The feasible pairs are $(3,2)+(4,3)$ ($7$, weight $5$), $(3,2)+(6,5)$ ($9$, weight $7$) and $(5,4)+(4,3)$ ($9$, weight $7$); $(5,4)+(6,5)$ weighs $9>7$. $11$ ignores the capacity.
oc-f-078 · level facile · notes
In the multiple knapsack problem (MKP) there are $m$ knapsacks of capacities $c_1,\dots,c_m$ and $n$ items with profit $p_j$ and weight $w_j$. Which statement describes the problem?
  1. The profit is maximized, and every item can be split among several knapsacks
  2. The profit is maximized, and every item goes into exactly one knapsack
  3. The profit of the inserted items is maximized, and every item goes into at most one knapsack
  4. All items are inserted, minimizing the number of knapsacks used
Explanation. In the MKP items may stay out; each one lies entirely in a single knapsack. Inserting all items minimizing the bins is bin packing.
oc-f-079 · level facile · notes
Multiple knapsack (MKP) with $2$ knapsacks of capacity $5$ and $5$ and items $(p_j,w_j)=(6,4),(5,3),(4,3),(3,2)$; every item goes into at most one knapsack. What are the optimal value and the value of the KP with a single knapsack of capacity $10$?
  1. $13$ and $15$
  2. $14$ and $15$
  3. $15$ and $15$
  4. $14$ and $14$
Explanation. With two knapsacks: $\{(6,4)\}$ and $\{(5,3),(3,2)\}$ give $14$; the three most profitable items weigh $4,3,3$ and cannot be split into two groups of weight at most $5$. With capacity $10$ the items $(6,4),(5,3),(4,3)$ fit: $15$, only an upper bound for the MKP.
oc-f-080 · level facile · notes
Subset sum (SSP): given the integers $w=(3,5,7,11)$ and $c=15$, is there a subset summing to exactly $15$?
  1. Yes: $\{3,5,7\}$
  2. Yes: $\{5,11\}$
  3. Yes: $\{3,11\}$
  4. No: the sum closest to $15$ is $14$
Explanation. $3+5+7=15$. Instead $5+11=16$ and $3+11=14$.
oc-f-081 · level facile · notes
Unbounded knapsack (UKP: unlimited copies of every type) with capacity $c=10$ and two types $(p_j,w_j)=(7,4)$ and $(5,3)$. What is the optimal value?
  1. $14$
  2. $12$
  3. $15$
  4. $17$
Explanation. One copy of $(7,4)$ and two of $(5,3)$ weigh $10$ and are worth $17$. Two copies of the most efficient type give $14$ (greedy), three of the second $15$; $12$ is the 0/1 KP.
oc-f-082 · level facile · notes
In the unbounded knapsack problem (UKP) the variable $x_j\in\Z_{\ge0}$ is the number of copies of type $j$ (integer weight $w_j\ge1$), with capacity $c$. Which upper bound holds anyway for $x_j$?
  1. $x_j\le n$, the number of types
  2. $x_j\le\lfloor c/p_j\rfloor$, because every copy is worth $p_j$
  3. $x_j\le\lfloor c/w_j\rfloor$, because every copy weighs $w_j$
  4. $x_j\le 1$, because every type is chosen once
Explanation. $x_j$ copies weigh $w_jx_j\le c$. This is why the UKP is a special case of the BKP with $b_j=\lfloor c/w_j\rfloor$.
oc-f-221 · level ipotesi · notes
In the 0-1 knapsack (capacity $c$), let $\bar k$ be the largest integer such that the $\bar k$ lightest items weigh in total at most $c$. Why does every feasible solution contain at most $\bar k$ items?
  1. Because the lightest items are also the most efficient
  2. Because the greedy by weight always finds the optimal solution
  3. Because every item weighs at most $c/\bar k$
  4. Any $\bar k+1$ items weigh at least as much as the $\bar k+1$ lightest ones, which already exceed $c$
Explanation. The sum of the weights of $\bar k+1$ items is minimum when they are the lightest, and by definition of $\bar k$ this sum exceeds $c$. Hence the cardinality bound: the sum of the $\bar k$ largest profits.
oc-f-236 · level facile · notes
Knapsack problems have items with weight $w_j$ and profit $p_j$ and maximize the total profit while respecting the capacities. In which member of the family are there $k$ capacities $c_d$ and does every item have a weight $w_{dj}$ for each of them?
  1. In the multidimensional knapsack (MDKP)
  2. In the multiple knapsack (MKP)
  3. In the bounded knapsack (BKP)
  4. In the multiple-choice knapsack (MCKP)
Explanation. The MDKP has one knapsack with several resources (e.g., weight and volume). The MKP has several knapsacks, each with a single capacity.
oc-f-237 · level facile · notes
In the knapsack family, the knapsack problem with setups (KPS) groups the items into classes $\mathscr{J}_h$. What distinguishes it from the 0/1 knapsack?
  1. Exactly one item per class must be chosen
  2. Every class has a knapsack with its own capacity
  3. Several copies of the items of the same class may be taken
  4. Every class used pays a setup cost $f_h$ and consumes a setup weight $s_h$
Explanation. In the KPS an item of class $h$ can be taken only if the class is activated, paying $f_h$ in the profit and $s_h$ in the capacity. «Exactly one per class» is the MCKP.
oc-f-238 · level facile · notes
In the bounded knapsack (BKP: at most $b_j$ identical copies of item $j$) the candidate solutions are counted as vectors $(x_1,\dots,x_n)$ of numbers of copies, with $0\le x_j\le b_j$. With $n=2$, $b_1=2$ and $b_2=3$, how many candidates are there?
  1. $6$
  2. $5$
  3. $12$
  4. $32$
Explanation. $(b_1+1)(b_2+1)=3\cdot4=12$. Treating the $5$ copies as distinct items would give $2^5=32$ subsets, counting the same solution several times.
oc-f-239 · level facile · notes
In the multiple-choice knapsack (MCKP) exactly one item is chosen from each of $q$ classes without exceeding the capacity $c$. With $q=3$ classes of $2$ items each, how many candidate solutions are there?
  1. $9$
  2. $8$
  3. $64$
  4. $6$
Explanation. One choice per class: $2\cdot2\cdot2=8$. The $2^6=64$ subsets of the $6$ items include choices with zero or two items of the same class.
oc-f-240 · level facile · notes
In the 0/1 knapsack (KP: items of profit $p_j$ and weight $w_j$, capacity $c$, at most one copy per item) one has $p=(10,7,6)$, $w=(5,4,3)$ and $c=8$. What is the optimal value?
  1. $16$
  2. $17$
  3. $13$
  4. $23$
Explanation. $\{1,3\}$ weighs $8\le c$ and is worth $16$; $\{1,2\}$ would be worth $17$ but weighs $9>8$; $\{2,3\}$ is worth $13$. Taking everything ($23$) violates the capacity.
oc-f-241 · level facile · notes
The 0/1 knapsack (KP) has $n$ items of profit $p_j$ and weight $w_j$ and capacity $c$. Which description corresponds to a feasible solution?
  1. A subset $S$ with $\sum_{j\in S}w_j=c$
  2. A vector of copies $x_j\in\Z_{\ge0}$ with $\sum_j w_jx_j\le c$
  3. A subset $S$ with $\sum_{j\in S}p_j\ge c$
  4. A subset $S$ of the items with $\sum_{j\in S}w_j\le c$
Explanation. Every item is taken at most once and only the capacity matters; weight equal to $c$ is the subset sum, integer copies are the unbounded knapsack.
oc-f-242 · level ipotesi · notes
In the 0/1 knapsack (KP: profits $p_j$, weights $w_j$, capacity $c$) one assumes $w_j\le c$ for every item. If the assumption is dropped and an item has $w_j>c$, what happens?
  1. The item must be split into parts of weight at most $c$
  2. The optimal value becomes the sum of all profits
  3. The item is in no feasible solution and can be removed without changing the optimal value
  4. The instance becomes infeasible
Explanation. With $w_j>c$ one has $x_j=0$ in every feasible solution: removing the item changes nothing, so the assumption is not restrictive. The instance stays feasible (the empty set always is).
oc-f-243 · level ipotesi · notes
In the 0/1 knapsack (KP: profits $p_j>0$, weights $w_j$, capacity $c$) one assumes $\sum_j w_j>c$. What would happen with $\sum_j w_j\le c$?
  1. The optimal value would be $0$
  2. Taking all items would be feasible and optimal: the instance is trivial
  3. No subset would be feasible
  4. The continuous relaxation would have a fractional item
Explanation. With positive profits, adding items always improves a solution; if all of them fit, the set of all items is optimal. The assumption only excludes these trivial cases.
oc-f-244 · level ipotesi · notes
In the subset sum (SSP: given integer weights $w_j$ and a target value $c$, one looks for a subset of weight exactly $c$) one assumes $\sum_j w_j\ge c$. What happens if the assumption is dropped?
  1. No subset can weigh $c$: the answer is «no» without computation
  2. The subset of all items is the solution
  3. It is enough to remove the heaviest item
  4. The problem becomes an unbounded knapsack
Explanation. Every subset weighs at most $\sum_j w_j<c$, so it cannot reach $c$. In the 0/1 knapsack the analogous assumption excluded instead the case in which everything fits.
oc-f-245 · level ipotesi · notes
In the bounded knapsack (BKP: at most $b_j$ copies of item $j$, capacity $c$) one assumes $b_j\,w_j\le c$. An item has $w_j=4$, $b_j=5$ and $c=13$. How is the instance brought back to the assumption without changing the optimal value?
  1. Remove the item
  2. Set $b_j=1$
  3. It cannot: the instance is infeasible
  4. Set $b_j=\lfloor c/w_j\rfloor=3$: more than $3$ copies do not fit anyway
Explanation. At most $\lfloor 13/4\rfloor=3$ copies fit in the knapsack, so the bound $b_j=5$ is never active and can be reduced to $3$.
oc-f-246 · level ipotesi · notes
In the unbounded knapsack (UKP: unlimited copies of every item, capacity $c$) let $\hat b_j=\lfloor c/w_j\rfloor$ and assume $\sum_j\hat b_j\,w_j>c$. Why does an instance with a single item always violate the assumption?
  1. Because with a single item the problem is infeasible
  2. Because $\hat b_1=1$ for every $c$
  3. Because $\hat b_1w_1=\lfloor c/w_1\rfloor w_1\le c$: the $\hat b_1$ copies all fit, and they are optimal
  4. Because a single item always has $w_1>c$
Explanation. With a single item the optimal solution takes $\lfloor c/w_1\rfloor$ copies: it is the trivial case that the assumption excludes.
oc-f-247 · level ipotesi · notes
In the multidimensional knapsack (MDKP: capacities $c_d$ and weights $w_{dj}$ for every dimension $d\in\mathscr{D}$) one wants to exclude the trivial case in which all items fit. Which assumption is the right one?
  1. $\sum_d\sum_j w_{dj}>\sum_d c_d$
  2. There is a dimension $d$ with $\sum_j w_{dj}>c_d$
  3. For every dimension $d$, $\sum_j w_{dj}>c_d$
  4. For every item $j$ there is $d$ with $w_{dj}>c_d$
Explanation. All items fit if and only if every dimension is respected; one violated dimension is therefore enough to exclude the trivial case. Asking it for every $d$ would exclude non-trivial instances.
oc-f-248 · level ipotesi · notes
In the multiple knapsack (MKP: knapsacks $k\in\mathscr{K}$ of capacity $c_k$, items of weight $w_j$) one assumes that every item, alone, fits in at least one knapsack. Which condition expresses it?
  1. $w_j\le\max_{k}c_k$ for every item $j$
  2. $w_j\le\min_{k}c_k$ for every item $j$
  3. $w_j\le\sum_k c_k$ for every item $j$
  4. $\sum_j w_j\le\max_k c_k$
Explanation. «There is $k$ with $w_j\le c_k$» is equivalent to $w_j\le\max_k c_k$. Asking for the minimum would exclude items fitting only in the large knapsacks; the sum of the capacities is not enough, because an item cannot be split among knapsacks.
oc-f-249 · level ipotesi · notes
In the multiple-choice knapsack (MCKP: exactly one item per class, capacity $c$) the instance is feasible if and only if $\sum_h\min_{j\in\mathscr{J}_h}w_j\le c$. With classes of weights $\{3,5\}$, $\{2,6\}$, $\{4\}$ and $c=8$, what can be concluded?
  1. The instance is feasible with the items of weight $3$, $2$ and $4$
  2. It is enough to choose two classes out of three
  3. The instance is feasible because every item has $w_j\le c$
  4. The instance is infeasible: even the lightest items weigh $3+2+4=9>8$
Explanation. The lightest choice takes the minimum of every class: if even this one exceeds $c$, no choice of one item per class fits. That every item fits alone is not enough.
oc-f-250 · level ipotesi · notes
In the knapsack with setups (KPS: an item of class $h$ can be taken only by activating the class, which consumes the setup weight $s_h$; capacity $c$) one assumes $w_j+s_h\le c$. A class has $s_h=4$, $c=10$ and contains an item with $w_j=7$. What can be concluded?
  1. The class must always be activated
  2. The instance is infeasible
  3. The item can never be selected and can be removed
  4. The item fits, because $w_j=7\le c$
Explanation. Taking the item requires activating the class: $7+4=11>10$. The right comparison is with $w_j+s_h$, not with $w_j$ alone.
oc-f-251 · level teorema · notes
Karp (1972) included the subset sum (SSP: is there a subset of weights $w_j$ summing exactly to $c$?) among the first $21$ NP-complete problems. What follows for the 0/1 knapsack (KP)?
  1. The KP is strongly NP-hard
  2. The KP is NP-hard, because it contains the SSP as the special case $p_j=w_j$
  3. The KP is in P, because its capacity is an inequality
  4. Nothing: KP and SSP are independent problems
Explanation. With $p_j=w_j$ and capacity $c$ the KP has optimal value $c$ if and only if the SSP answer is «yes»: a polynomial algorithm for the KP would solve the SSP. The KP has however a pseudo-polynomial algorithm, so it is not strongly NP-hard.
oc-f-252 · level facile · notes
Dantzig (1957) solved the continuous version of the 0/1 knapsack (variables $x_j\in[0,1]$) by sorting the items in an order that comes back in many bounds of the course. Which order?
  1. By non-increasing efficiency $p_j/w_j$
  2. By non-decreasing weight $w_j$
  3. By non-increasing profit $p_j$
  4. By increasing index $j$
Explanation. The knapsack is filled with the most efficient items, and the first one that does not fit is taken as a fraction: it is the optimal solution of the continuous relaxation.
oc-f-375 · level facile · notes
In the family of knapsack problems (KP, SSP, BKP, UKP, MDKP, MKP, MCKP, KPS) every item has a profit and a weight. In which member does the profit of every item coincide with its weight?
  1. In the multiple-choice knapsack problem (MCKP)
  2. In the subset sum problem (SSP)
  3. In the unbounded knapsack problem (UKP)
  4. In the multidimensional knapsack problem (MDKP)
Explanation. The SSP looks for a subset of weight exactly $c$: it is the case $p_j=w_j$ of the 0/1 knapsack, where maximizing the profit means filling the knapsack as much as possible.
oc-f-376 · level facile · notes
In the multiple knapsack problem (MKP) there are $m$ distinct knapsacks and $n$ items; every item goes into one knapsack or into none. How many candidate solutions are there, ignoring the capacities?
  1. $(m+1)^n$
  2. $m^n$
  3. $2^n\cdot m$
  4. $2^{nm}$
Explanation. Every item has $m+1$ choices: one of the $m$ knapsacks or none. $m^n$ forgets the choice «none»; $2^{nm}$ also counts the solutions with an item in several knapsacks.
oc-f-377 · level facile · notes
In the 0/1 knapsack problem (KP: items of profit $p_j$ and weight $w_j$, capacity $c$, the total profit is maximized) all profits are multiplied by $2$, leaving weights and capacity unchanged. What happens?
  1. The optimal solutions change, the optimal value doubles
  2. The optimal solutions stay the same, the optimal value does not change
  3. Some optimal solutions become infeasible
  4. The optimal solutions stay the same, the optimal value doubles
Explanation. Feasibility depends only on weights and capacity; the objective $\sum_{j\in S}2p_j$ is twice the original one for every $S$, so the order among the solutions does not change.
oc-f-378 · level ipotesi · notes
In the 0/1 knapsack problem (KP) one assumes (1) $\sum_j w_j>c$ and (2) $w_j\le c$ for every item. An instance has $c=10$ and weights $w=(4,7,12,3)$. How is it brought back to the assumptions?
  1. The weight $12$ is reduced to the value $c=10$ and the item is kept
  2. It cannot: the instance is infeasible
  3. The item of weight $12$ is removed; the remaining weights sum to $14>c$: both hold
  4. The item of weight $12$ is removed; the optimum is then to take all the others
Explanation. An item with $w_j>c$ belongs to no feasible solution, so it is removed without changing $z(I)$. Afterwards, $4+7+3=14>10$: assumption (1) still holds.
oc-f-379 · level facile · notes
The subset sum problem (SSP) asks whether there is a subset of integers $w_j$ summing to exactly $c$. With $w=(4,6,9,13)$, for which value of $c$ is the answer «no»?
  1. $c=17$
  2. $c=12$
  3. $c=10$
  4. $c=19$
Explanation. The reachable sums include $4+6=10$, $6+13=19$, $4+13=17$; for $12$ one would need $4+$an $8$ or $6+6$, and no subset sums to $12$.
oc-f-380 · level ipotesi · notes
In the subset sum problem (SSP: is there a subset of integer weights $w_j$ summing to exactly $c$?) one assumes $w_j\le c$ for every $j$. If an item has $w_j>c$, what happens?
  1. It belongs to no subset of sum $c$: it is removed without changing the answer
  2. The answer is certainly «no», because a weight exceeds $c$
  3. The answer is certainly «yes», since weight can be removed
  4. $w_j$ is replaced by $w_j-c$ and the item is kept
Explanation. With positive weights a subset containing $j$ sums to at least $w_j>c$. The item is useless, but the others may still sum to $c$.
oc-f-381 · level ipotesi · notes
In the subset sum problem (SSP) one assumes (1) $\sum_j w_j\ge c$ and (2) $w_j\le c$ for every $j$. An instance has $w=(4,6,9)$ and $c=20$. What can be said?
  1. It violates assumption (2), because $9+6+4$ exceeds $c$
  2. It satisfies both assumptions and the answer is «yes»
  3. It satisfies both assumptions and the answer is «no»
  4. It violates assumption (1): $\sum_j w_j=19<20$, so the answer is «no»
Explanation. Even taking all items one reaches $19$: no subset reaches $20$. Assumption (2) concerns single weights, and $9\le20$.
oc-f-382 · level facile · notes
In the bounded knapsack problem (BKP: $b_j$ copies of item $j$) the extended set is $\hat{\mathscr{I}}=\{(j,k):j\in\mathscr{I},\ k=1,\dots,b_j\}$ and a solution is an $S\subseteq\hat{\mathscr{I}}$. With $b=(3,2,2)$, how many elements does $\hat{\mathscr{I}}$ have and how is $S$ read?
  1. $7$; every pair $(j,k)$ in $S$ gives $k$ copies of item $j$
  2. $3$; $S$ says which items to take at least once
  3. $7$; the copies of item $j$ taken are the pairs $(j,k)$ in $S$
  4. $12$; the copies of item $j$ taken are the pairs $(j,k)$ in $S$
Explanation. $|\hat{\mathscr{I}}|=\sum_j b_j=3+2+2=7$ (not the product $12$). The pair $(j,k)$ is the $k$-th copy of item $j$: it is worth one copy, not $k$.
oc-f-383 · level ipotesi · notes
In the bounded knapsack problem (BKP: $b_j$ copies of item $j$, capacity $c$) one assumes $\sum_j b_j\,w_j>c$. If the assumption fails, what happens?
  1. The optimum takes a single copy of every item
  2. Taking all copies of all items is feasible and optimal
  3. The instance has no feasible solutions
  4. Every $b_j$ must be reduced to $\lfloor c/w_j\rfloor$
Explanation. If all the copies together weigh at most $c$, the solution «everything» is feasible and, with positive profits, no other solution beats it: the instance is trivial.
oc-f-384 · level teorema · notes
In the bounded knapsack problem (BKP, $b_j\ge1$ copies of item $j$) one makes the assumptions (1) $\sum_j b_jw_j>c$, (2) $w_j\le c$ for every $j$, (3) $b_jw_j\le c$ for every $j$. What logical relation is there among them?
  1. (3) implies (2), because $w_j\le b_jw_j$
  2. (2) implies (3), because $b_j\ge1$
  3. (1) implies (3)
  4. They are independent: none implies another
Explanation. With $b_j\ge1$ one has $w_j\le b_jw_j\le c$. The converse is false: $w_j=4$, $b_j=5$, $c=13$ satisfies (2) but not (3).
oc-f-385 · level facile · notes
In the unbounded knapsack problem (UKP) at most $\lfloor c/w_j\rfloor$ copies of item $j$ can be taken. With $c=10$ and weights $w=(3,4,5)$, how many vectors of copy numbers $(x_1,x_2,x_3)$ respect these single bounds?
  1. $12$
  2. $8$
  3. $1000$
  4. $36$
Explanation. $x_1\in\{0,\dots,3\}$, $x_2\in\{0,1,2\}$, $x_3\in\{0,1,2\}$: $4\cdot3\cdot3=36$. $12=3\cdot2\cdot2$ forgets the value $0$.
oc-f-386 · level ipotesi · notes
In the unbounded knapsack problem (UKP) let $\hat b_j=\lfloor c/w_j\rfloor$ be the maximum number of copies of item $j$ fitting in the knapsack; one assumes $w_j\le c$. If an item has $w_j>c$, what is $\hat b_j$ and what is done?
  1. $\hat b_j=\infty$: the copies are unlimited
  2. $\hat b_j=0$: the instance is infeasible
  3. $\hat b_j=0$: the item can never be taken and is removed
  4. $\hat b_j=1$: one copy of it is taken
Explanation. Not even one copy fits; the empty solution is still feasible, so the instance does not become infeasible: it suffices to remove the item.
oc-f-387 · level ipotesi · notes
In the unbounded knapsack problem (UKP) one assumes $\sum_j\hat b_j\,w_j>c$, with $\hat b_j=\lfloor c/w_j\rfloor$. Why does an instance with a single item ($n=1$) always violate this assumption, and what is its optimum?
  1. It never violates it; the optimum is found by dynamic programming
  2. $\lfloor c/w_1\rfloor\,w_1\le c$ always; the optimum takes $\lfloor c/w_1\rfloor$ copies
  3. $\lfloor c/w_1\rfloor\,w_1>c$ always; the optimum takes a single copy
  4. It violates it only if $w_1$ divides $c$; the optimum takes $c/w_1$ copies
Explanation. By definition of the floor $\lfloor c/w_1\rfloor\,w_1\le c$: all the possible copies fit together, so the instance is trivial.
oc-f-388 · level facile · notes
The multidimensional knapsack problem (MDKP) has $n$ items, $m$ dimensions with capacities $c_d$ and weights $w_{dj}$; every item is taken or not. In the natural model, how many binary variables and how many capacity constraints are there?
  1. $n$ binary variables and $m$ capacity constraints
  2. $n\cdot m$ binary variables and $m$ capacity constraints
  3. $n$ binary variables and a single capacity constraint
  4. $n\cdot m$ binary variables and $n$ assignment constraints
Explanation. One variable $x_j$ per item (the same item consumes capacity in all dimensions) and one constraint $\sum_j w_{dj}x_j\le c_d$ per dimension. The variables $x_{kj}$ and the assignment constraints belong to the MKP.
oc-f-389 · level ipotesi · notes
In the multidimensional knapsack problem (MDKP: capacity $c_d$ and weights $w_{dj}$ per dimension $d$) one assumes $w_{dj}\le c_d$ for every $d$ and every $j$. An item has $w_{1j}\le c_1$ but $w_{2j}>c_2$. What is done?
  1. It is kept: fitting in one dimension is enough
  2. It is kept if $w_{1j}+w_{2j}\le c_1+c_2$
  3. The instance is declared infeasible
  4. It is removed: it never fits in the knapsack
Explanation. A selected item consumes capacity in all dimensions: if it exceeds $c_2$ on its own, no solution containing it is feasible.
oc-f-390 · level ipotesi · notes
In the multidimensional knapsack problem (MDKP) one assumes that there is a dimension $d$ with $\sum_j w_{dj}>c_d$. An instance has $\vet c=(10,8)$, $\sum_j w_{1j}=9$ and $\sum_j w_{2j}=12$. Does the assumption hold?
  1. No: one needs $\sum_d\sum_j w_{dj}>\sum_d c_d$ and $21>18$ is not enough
  2. Yes: in dimension $1$ the total weight does not exceed the capacity
  3. Yes: in dimension $2$ the total weight exceeds the capacity
  4. No: it should be exceeded in all dimensions
Explanation. One dimension in which the items do not all fit is enough to make «take everything» infeasible; here it is dimension $2$ ($12>8$).
oc-f-391 · level facile · notes
In the multiple knapsack problem (MKP: $m$ knapsacks of capacity $c_k$, items of profit $p_j$ and weight $w_j$) and in bin packing (BPP: identical bins of capacity $c$) the items go into containers. What distinguishes them?
  1. None, if the capacities of the MKP knapsacks are equal
  2. MKP: an item may stay out; BPP: all items must be packed
  3. MKP: all items must be packed; BPP: an item may stay out
  4. In both the number of containers used is minimized
Explanation. The MKP chooses which items to load and where (maximum profit, given number of knapsacks); the BPP must pack every item and minimizes the bins.
oc-f-392 · level ipotesi · notes
In the multiple knapsack problem (MKP) one assumes that every item, on its own, fits in at least one knapsack: for every $j$ there is $k$ with $w_j\le c_k$. With capacities $(8,5)$, does an item of weight $6$ satisfy the assumption?
  1. Yes: it fits in knapsack $1$, and can go only there
  2. No: it should fit in all knapsacks
  3. No: it should be split between the two knapsacks
  4. Yes, and it can go into either of the two knapsacks
Explanation. The assumption asks for a single knapsack large enough ($6\le8$); $w_j\le\min_k c_k$ is not needed. The item does not fit in knapsack $2$.
oc-f-393 · level ipotesi · notes
In the multiple knapsack problem (MKP) one assumes (1) $\sum_j w_j>\sum_k c_k$ and (2) every item fits on its own in at least one knapsack. An instance has two knapsacks of capacity $5$ and three items of weight $4$. What holds?
  1. (1) fails, because every item fits in a knapsack
  2. (2) fails, because $4+4>5$
  3. Both fail
  4. Both hold: $12>10$ and $4\le5$
Explanation. (1) compares the total weight with the total capacity ($12>10$); (2) concerns one item at a time ($4\le5$). That two items together do not fit in a knapsack violates nothing.
oc-f-394 · level facile · notes
In the multiple-choice knapsack problem (MCKP) the items are divided into $q$ classes $\mathscr{J}_1,\dots,\mathscr{J}_q$ and the knapsack has capacity $c$. How many items does a feasible solution contain?
  1. At least $q$, at least one per class
  2. Any number, as long as they fit in the knapsack
  3. Exactly $q$, one per class
  4. At most $q$, at most one per class
Explanation. The multiple-choice constraint is an equality: $\sum_{j\in\mathscr{J}_h}x_j=1$ for every class. «At most one» would be a different constraint, allowing a class to be skipped.
oc-f-395 · level teorema · notes
In the multiple-choice knapsack problem (MCKP: exactly one item from each class $\mathscr{J}_h$, capacity $c$) the instance is feasible if and only if $\sum_h\min_{j\in\mathscr{J}_h}w_j\le c$. Why is the condition sufficient?
  1. Dynamic programming always finds a choice of weight at most $c$
  2. Choosing the lightest item in every class gives a choice that fits in the knapsack
  3. Every choice of one item per class weighs at least $\sum_h\min_{j}w_j$
  4. The optimal solution always uses the lightest item of every class
Explanation. The choice of the lightest items weighs exactly $\sum_h\min_j w_j\le c$. The second option is the reason why the condition is necessary.
oc-f-396 · level ipotesi · notes
In the multiple-choice knapsack problem (MCKP) exactly one item must be taken from each class $\mathscr{J}_h$, and one assumes $\mathscr{J}_h\neq\emptyset$ for every $h$. What happens if a class is empty?
  1. The instance is infeasible: nothing can be taken from that class
  2. The empty class is ignored and the rest is solved
  3. An item of profit and weight $0$ is added and the value does not change
  4. The optimal value is $0$, as for the empty knapsack
Explanation. The constraint «exactly one item from class $h$» cannot be satisfied with $\mathscr{J}_h=\emptyset$: no choice is feasible.
oc-f-397 · level facile · notes
Knapsack with setups (KPS): capacity $c=10$; class $1=\{1,2\}$ with setup cost $f_1=3$ and setup weight $s_1=2$; class $2=\{3\}$ with $f_2=4$, $s_2=1$; revenues $p=(5,4,6)$ and weights $w=(3,2,4)$. The setup of every class from which at least one item is taken is paid. Optimal value?
  1. $9$
  2. $4$
  3. $11$
  4. $6$
Explanation. $\{1,2\}$: weight $5+2=7$, value $9-3=6$. $\{1,3\}$: weight $7+3=10$, value $11-7=4$. $\{1,2,3\}$ weighs $9+3=12>10$. $9$ forgets the setup cost.
oc-f-398 · level ipotesi · notes
In the knapsack problem with setups (KPS) one assumes $w_j+s_h\le c$ for every item $j$ of class $h$ ($s_h$ = setup weight of the class). With $c=12$ and a class with $s_h=4$ and items of weight $9$, $7$, $8$, which items violate the assumption?
  1. The items of weight $9$ and $8$
  2. All three
  3. Only the item of weight $9$
  4. None, because all have weight at most $c$
Explanation. $9+4=13>12$, while $7+4=11$ and $8+4=12$ fit. $w_j\le c$ is not enough: taking $j$ activates the class and also consumes $s_h$.
oc-f-399 · level ipotesi · notes
Both in the KPS (knapsack with setups: a class is activated by taking at least one of its items) and in the MCKP (exactly one item per class) one assumes every class is non-empty. What would change with an empty class?
  1. In both problems the class could be ignored
  2. KPS: the class is never activated; MCKP: infeasible instance
  3. KPS: infeasible instance; MCKP: the class is ignored
  4. In both problems the instance would become infeasible
Explanation. The KPS does not force using every class: an empty class is never activated and can be removed. The MCKP forces one item per class, impossible if the class is empty.
oc-f-400 · level facile · notes
Ibarra and Kim (1975) gave the first fully polynomial-time approximation scheme (FPTAS) for the 0/1 knapsack. What does an FPTAS guarantee?
  1. For every $\varepsilon>0$, value $\ge(1-\varepsilon)z(I)$ in time polynomial in $n$ and $1/\varepsilon$
  2. For every $\varepsilon>0$, value $\ge(1-\varepsilon)z(I)$ in time polynomial in $n$ and exponential in $1/\varepsilon$
  3. The optimal solution in pseudo-polynomial time, i.e., polynomial in $n$ and $c$
  4. Value $\ge z(I)/2$ in linear time, for every instance
Explanation. The second option describes a PTAS that is not fully polynomial; the third is dynamic programming; the fourth a fixed-ratio approximation algorithm.
oc-f-401 · level facile · notes
Dantzig (1957) solved the continuous version of the 0/1 knapsack ($x_j\in[0,1]$) by sorting the items by non-increasing efficiency $p_j/w_j$ and filling the knapsack, with a fraction of the first item that does not fit. With $p=(10,9,4)$, $w=(5,6,4)$ and $c=8$, which value is obtained?
  1. $14$
  2. $19$
  3. $13$
  4. $14.5$
Explanation. Efficiencies $2$, $1.5$, $1$: item $1$ whole (weight $5$), then $3/6$ of item $2$: $10+4.5=14.5$. $14=10+4$ skips item $2$ instead of taking a fraction of it.

3. Packing problems (30)

oc-f-010 · level facile · notes
Bin packing (BPP): three items of weight $6$ must be packed into the minimum number of bins of capacity $c=10$. What are the weight bound $\left\lceil\sum_j w_j/c\right\rceil$ and the optimal value $z(I)$?
  1. Weight bound $1$, $z(I)=2$
  2. Weight bound $2$, $z(I)=3$
  3. Weight bound $2$, $z(I)=2$
  4. Weight bound $3$, $z(I)=3$
Explanation. $\lceil 18/10\rceil=2$, but two items of weight $6$ do not fit together: $3$ bins are needed. The weight bound is not always attained.
oc-f-011 · level facile · notes
In bin packing (BPP) $n$ items of weight $w_j$ must be packed into the minimum number of bins of capacity $c$. In cutting stock (CSP) item $j$ also has a demand $d_j\in\Z_{\ge1}$. How are the two problems related?
  1. The CSP asks to pack $d_j$ identical copies of item $j$; the BPP is the case $d_j=1$ for every $j$
  2. The CSP has bins of different capacities $d_j$; the BPP is the case with all capacities equal
  3. The CSP allows splitting an item into $d_j$ parts; the BPP is the case without splitting
  4. The CSP asks to fill $d_j$ bins with item $j$; the BPP is the case with a single bin
Explanation. The CSP asks to pack $d_j$ copies of every item $j$ into the minimum number of bins of capacity $c$; with $d_j=1$ for every $j$ it is the BPP. Items are not split and the capacity is unique.
oc-f-012 · level facile · notes
In bin packing (BPP) a solution is a partition of the $n$ items into bins, and the order of the bins does not matter. How many candidate partitions of $n$ items are there, before checking the capacities ($B(n)$ is the $n$-th Bell number)?
  1. $2^n$
  2. $n!$
  3. $\frac{(n-1)!}{2}$
  4. $B(n)$
Explanation. The partitions of a set of $n$ elements are $B(n)$ (Bell numbers); the order of the bins does not matter. $2^n$ counts the subsets, $n!$ the orderings.
oc-f-083 · level facile · notes
In bin packing (BPP) $n$ items of weight $w_j$ must be packed into the minimum number of bins of capacity $c$. Why is $w_j\le c$ assumed for every item?
  1. Otherwise the item fits in no bin and there are no feasible solutions
  2. Otherwise the weight bound $\lceil\sum_j w_j/c\rceil$ would not be an integer
  3. Otherwise two items could share the same bin
  4. Otherwise the number of bins could exceed $n$
Explanation. An item heavier than the capacity cannot be packed: the instance would have no solution. With $w_j\le c$ putting every item in its own bin is always feasible.
oc-f-084 · level facile · notes
Bin packing (BPP: minimum number of bins of capacity $c$) with $c=10$ and weights $w=(7,6,5,4,3,2)$. What is the optimal value $z(I)$?
  1. $4$
  2. $2$
  3. $6$
  4. $3$
Explanation. $\sum_j w_j=27$, hence at least $\lceil 2.7\rceil=3$ bins are needed; $\{7,3\}$, $\{6,4\}$, $\{5,2\}$ is a solution with $3$ bins, hence optimal.
oc-f-085 · level teorema · notes
In bin packing (weights $w_j$, capacity $c$, optimal value $z(I)$) the weight bound is $L_1=\left\lceil\sum_j w_j/c\right\rceil$. Which statement is correct?
  1. $L_1\ge z(I)$ for every instance, because it is rounded up
  2. $L_1\le z(I)$ only if all weights are smaller than $c/2$
  3. $L_1\le z(I)$ for every instance, and $L_1<z(I)$ is possible
  4. $L_1=z(I)$ for every instance
Explanation. $z(I)$ bins contain at most $z(I)\,c$ units of weight, hence $z(I)\ge\sum_jw_j/c$, rounded up because $z(I)$ is an integer. With three items of weight $6$ and $c=10$: $L_1=2<3=z(I)$.
oc-f-086 · level facile · notes
In bin packing with capacity $c$, two items of weight larger than $c/2$ never share a bin. With $c=10$ and weights $w=(6,6,7,2,2,2)$, which lower bound on the number of bins does this observation give, and which the weight bound $\lceil\sum_j w_j/c\rceil$?
  1. $6$ and $3$
  2. $3$ and $3$
  3. $3$ and $2$
  4. $2$ and $3$
Explanation. The three items of weight $6,6,7$ exceed $c/2=5$: $3$ different bins are needed. $\sum_jw_j=25$ and $\lceil 25/10\rceil=3$. Here the two bounds coincide, and $\{6,2,2\},\{6,2\},\{7\}$ is optimal.
oc-f-087 · level facile · notes
In bin packing a solution with $k$ bins can be written by giving every item the number $1,\dots,k$ of its bin. How many assignment vectors describe the same partition of the items, if all $k$ bins are non-empty?
  1. $k!$, one for every way of numbering the bins
  2. $2^k$, one for every subset of bins
  3. $k$, one for every starting bin
  4. $k^n$, one for every assignment of the $n$ items
Explanation. Renumbering the bins does not change the solution: every partition corresponds to $k!$ vectors. This is the symmetry that weakens the models with numbered bins.
oc-f-088 · level facile · notes
Bin packing (BPP: items of weight $w_j$ into the minimum number of bins of capacity $c$) is strongly NP-hard. What does this imply, if $P\neq NP$?
  1. There is no exact algorithm at all for the BPP
  2. There is an $O(nc)$ algorithm by DP, as for the knapsack
  3. Every instance with more than $50$ items is intractable
  4. There is no pseudo-polynomial algorithm, for example of time $O(nc)$
Explanation. Strongly NP-hard means it stays hard even with small numbers: an algorithm polynomial in $n$ and in the value of $c$ is not expected. Exponential exact algorithms exist, and many large instances are solved in practice.
oc-f-089 · level facile · notes
Cutting stock (CSP): rolls of length $c=10$; $d_1=5$ pieces of length $4$ and $d_2=4$ pieces of length $3$ are needed, and the number of cut rolls is minimized. What is the weight bound $\left\lceil\sum_j d_jw_j/c\right\rceil$?
  1. $5$
  2. $9$
  3. $4$
  4. $3$
Explanation. $\sum_j d_jw_j=5\cdot4+4\cdot3=32$ and $\lceil 3.2\rceil=4$. The bound is attained: two rolls $4+3+3$, one $4+4$ and one $4$. $9$ is the number of pieces.
oc-f-090 · level facile · notes
In cutting stock (CSP) $d_j$ identical copies of piece $j$ are needed, cut from rolls of length $c$. Why is a solution described by cutting patterns (how many copies of each type are cut from a roll)?
  1. Cutting patterns remove the length constraint $c$
  2. Copies of the same piece are identical: only how many each roll contains matters
  3. Cutting patterns allow cutting one piece from two rolls
  4. Cutting patterns make every roll different from the others
Explanation. Treating every copy as a distinct item multiplies the equivalent solutions; a pattern only states how many copies of each type the roll contains and satisfies $\sum_j a_jw_j\le c$.
oc-f-091 · level facile · notes
A cutting stock instance (pieces $j=1,\dots,n$ with demand $d_j$ and length $w_j$, rolls of length $c$) can be seen as bin packing with $\sum_j d_j$ items. What is the drawback of this transformation?
  1. The number of items grows with the values $d_j$, and identical copies create many symmetric solutions
  2. The resulting bin packing has an optimal value different from the CSP one
  3. The resulting bin packing has bins of different capacities
  4. The transformation works only if all $d_j$ equal $1$
Explanation. The transformation is correct (same optimal value), but the instance becomes large when the demands are large, and exchanging identical copies gives equivalent solutions.
oc-f-220 · level ipotesi · notes
In bin packing ($n$ items of weight $w_j$, bins of capacity $c$) every feasible solution uses at least $\lceil\sum_j w_j/c\rceil$ bins. Which facts are needed to prove it?
  1. Every item weighs at most $c/2$; and $k$ is integer
  2. The items are sorted by non-increasing weight; and every bin is full
  3. At most one bin is less than half full; and $k$ is integer
  4. A solution with $k$ bins has $\sum_j w_j\le kc$, since every bin carries at most $c$; and $k$ is integer
Explanation. Adding up the loads, $\sum_j w_j\le kc$, i.e., $k\ge\sum_j w_j/c$; since $k$ is integer it is rounded up. No assumption on the weights or on the order is needed.
oc-f-253 · level facile · notes
Packing problems put items of weight $w_j$ into identical bins of capacity $c$. What distinguishes the cutting stock (CSP) from bin packing (BPP)?
  1. In the CSP the packed weight is maximized
  2. In the CSP every bin receives at most one item
  3. In the CSP $d_j$ copies of item $j$ must be packed, in the BPP only one
  4. In the CSP the bins have different capacities
Explanation. The two problems have the same bins and the same objective (minimum number of bins); the CSP groups identical copies with a demand $d_j$.
oc-f-254 · level facile · notes
In packing problems ($n$ items of weight $w_j$, identical bins of capacity $c$, unlimited in number) what is the objective?
  1. Maximize the number of items packed with $m$ given bins
  2. Pack all items in the minimum number of bins
  3. Pack the largest weight into a single bin
  4. Minimize the free space of the last bin
Explanation. All items must be packed, no bin exceeds $c$, and the number of bins used is minimized. Maximizing the weight in one bin is a knapsack.
oc-f-255 · level ipotesi · notes
In bin packing (BPP: items of weight $w_j$, bins of capacity $c$) one assumes $w_j\le c$. In the 0/1 knapsack an item with $w_j>c$ can be removed. What happens instead in the BPP if an item has $w_j>c$?
  1. The instance is infeasible: all items must be packed and that item fits in no bin
  2. The item is removed without changing the optimal value
  3. The item occupies two bins
  4. The bound $\lceil\sum_j w_j/c\rceil$ becomes exact
Explanation. In the BPP every item must go into a bin, so a too heavy item makes the feasible set empty. In the knapsack, instead, an item may simply not be taken.
oc-f-256 · level ipotesi · notes
In bin packing (BPP: items of weight $w_j\le c$, bins of capacity $c$) one assumes $\sum_j w_j>c$. What happens if the assumption is dropped?
  1. The instance is infeasible
  2. The optimal value is $n$
  3. The bound $\lceil\sum_j w_j/c\rceil$ equals $0$
  4. All items fit in a single bin and the optimal value is $1$
Explanation. With $\sum_j w_j\le c$ one bin is enough, and it is the minimum possible with at least one item: the instance is trivial.
oc-f-257 · level facile · notes
In cutting stock (CSP: $d_j$ copies of item $j$ of weight $w_j$, bins of capacity $c$) one assumes $\sum_j d_jw_j>c$. With $c=10$, $w=(3,4)$ and $d=(2,1)$, does the assumption hold?
  1. Yes: $2+1=3$ copies are more than one
  2. No: because $w_2>c/3$
  3. No: $2\cdot3+1\cdot4=10\le c$, all copies fit in one bin
  4. Yes: $3+4=7$ and the copies do not count
Explanation. In the CSP the assumption concerns the weight of all required copies: $\sum_j d_jw_j=10$, so one bin is enough and the instance is trivial.
oc-f-258 · level facile · notes
Cutting stock (CSP) with bins of capacity $c=10$, weights $w=(4,5,3,6)$ and required copies $d=(2,1,3,1)$. What is the weight bound $\mathrm{LB}=\lceil\sum_j d_jw_j/c\rceil$?
  1. $7$
  2. $3$
  3. $2$
  4. $4$
Explanation. $\sum_j d_jw_j=8+5+9+6=28$, hence $\lceil 2.8\rceil=3$. Forgetting the copies gives $\lceil18/10\rceil=2$; $7$ is the number of copies.
oc-f-259 · level facile · notes
A cutting stock (CSP) instance requires $7$ copies overall, of $4$ different items. Counting identical copies as different items, the candidate solutions are the partitions of the $7$ copies. How many are there?
  1. $B(7)=877$
  2. $B(4)=15$
  3. $2^7=128$
  4. $7!=5040$
Explanation. The partitions of a set of $7$ elements are counted by the Bell number $B(7)=877$; this count is an overestimate, since swapping two identical copies does not change the solution.
oc-f-260 · level facile · notes
Johnson and coauthors (1974) analysed in the worst case the First Fit rule for bin packing (every item, in the given order, goes into the first bin where it fits). Which guarantee did they prove, with $z(I)$ the optimal number of bins?
  1. First Fit uses at most $z(I)+1$ bins
  2. First Fit is always optimal
  3. First Fit uses at most $\frac32 z(I)$ bins
  4. First Fit uses at most $\frac{17}{10}z(I)+2$ bins
Explanation. It is the classical result $\frac{17}{10}z(I)+2$; no polynomial heuristic can have absolute ratio better than $\frac32$, unless P = NP.
oc-f-402 · level facile · notes
In packing problems the $n$ items of weight $w_j\le c$ must all be packed into identical bins of capacity $c$, available in unlimited number. Why are $n$ bins always enough?
  1. They are not: sometimes more than $n$ bins are needed
  2. Because every item, on its own, fits in a bin
  3. Because any two items always fit together in a bin
  4. Because the optimal number of bins is always $\lceil n/2\rceil$
Explanation. With $w_j\le c$ the solution «one item per bin» is feasible, so $z(I)\le n$. Two items may not fit together (e.g., two weights larger than $c/2$).
oc-f-403 · level facile · notes
In a packing problem with bins of capacity $c$, all $n$ items have weight strictly larger than $c/2$. What is the minimum number of bins?
  1. $n$
  2. $\lceil n/2\rceil$
  3. $\lceil\sum_j w_j/c\rceil$
  4. $n-1$
Explanation. Two items of weight $>c/2$ together exceed the capacity: every bin holds only one of them. The weight bound $\lceil\sum_j w_j/c\rceil$ can be much lower, about $n/2$.
oc-f-404 · level ipotesi · notes
In bin packing (BPP: items of integer weight $w_j\ge1$, bins of capacity $c$) one assumes $w_j\le c$ for every item. Does an item with $w_j=c$ satisfy the assumption? What does it imply?
  1. No; the assumption requires $w_j<c$ and the item is removed
  2. Yes; it can share its bin with another item
  3. No; the instance becomes infeasible
  4. Yes; in every solution it occupies a bin on its own
Explanation. The assumption allows equality. Since the other weights are at least $1$, no other item fits in its bin.
oc-f-405 · level ipotesi · notes
In cutting stock (CSP: $d_j$ pieces of length $w_j$ are needed, cut from rolls of length $c$) one assumes $w_j\le c$. If a required piece is longer than a roll, what happens?
  1. The piece is cut from two rolls placed side by side
  2. Its length is reduced to $c$
  3. The instance is infeasible: all required pieces must be cut
  4. The piece is removed, like a too heavy item in the knapsack
Explanation. In packing problems every required copy must be packed: a piece with $w_j>c$ fits in no roll. In the knapsack, instead, an item can be left out.
oc-f-406 · level ipotesi · notes
In cutting stock (CSP) one assumes $\sum_j d_j\,w_j>c$ ($d_j$ required copies of the piece of length $w_j$, rolls of length $c$). With $c=10$, $w=(3,4)$ and $d=(3,1)$ one has $\sum_j w_j=7\le c$. Is the instance solved with one roll?
  1. No: the assumption fails and the instance is infeasible
  2. No: the copies weigh $13>10$, at least $2$ rolls are needed
  3. Yes: $\sum_j w_j=7\le10$, so everything fits in one roll
  4. Yes: the assumption fails, so the optimum is a single roll
Explanation. The assumption counts all required copies, not one piece per type: $13>10$, so one roll is not enough, and $\lceil13/10\rceil=2$.
oc-f-407 · level facile · notes
A cutting stock (CSP) instance requires $7$ copies in total; the partitions of the $7$ copies, counted as different items, are $B(7)=877$. Why does this number overestimate the truly different cutting plans?
  1. Swapping two identical copies of the same piece gives the same plan
  2. Many partitions have empty bins, which are not counted
  3. The Bell number also counts the orderings of the bins
  4. It does not: every partition is a different plan
Explanation. The copies of the same piece are indistinguishable: partitions differing only in which copy goes into which roll describe the same cut.
oc-f-408 · level facile · notes
Johnson and coauthors (1974) proved that First Fit (every item, in the given order, goes into the first bin where it fits) uses at most $\frac{17}{10}z(I)+2$ bins, where $z(I)$ is the optimum. If $z(I)=20$, how many bins can First Fit use at most?
  1. $34$
  2. $40$
  3. $22$
  4. $36$
Explanation. $\frac{17}{10}\cdot20+2=34+2=36$. $34$ forgets the additive term $+2$; $40$ is ratio $2$.
oc-f-409 · level teorema · notes
For First Fit in bin packing $FF(I)\le\frac{17}{10}z(I)+2$ holds for every instance $I$ ($z(I)$ = optimal number of bins). What does this guarantee say about the ratio $FF(I)/z(I)$?
  1. It is exactly $1.7$ on every instance
  2. It is at least $1.7$: First Fit is never optimal
  3. It is at most $1.7+2/z(I)$: close to $1.7$ when $z(I)$ is large
  4. It is at most $1.7$ for every instance, even with $z(I)=1$
Explanation. Dividing by $z(I)$: $FF/z\le1.7+2/z$. For small instances the term $2/z$ matters; the guarantee is an upper bound, and First Fit may also find the optimum.
oc-f-410 · level facile · notes
Garey, Graham, Ullman and Johnson analysed «in the worst case» simple packing rules such as First Fit. What does a worst-case analysis provide?
  1. The result of the rule on the largest known instance
  2. A guarantee valid on every instance, even the most unfavourable
  3. The average number of bins on random instances
  4. The maximum running time of the rule over all inputs
Explanation. The worst case bounds the number of bins of the rule with respect to the optimum over all instances; the average behaviour is a different analysis.

4. Coloring problems (26)

oc-f-013 · level teorema · notes
For a graph $G=(V,E)$ with $n$ vertices let $\omega(G)$ be the cardinality of a maximum clique, $\alpha(G)$ that of a maximum stable set and $\chi(G)$ the chromatic number (minimum number of colors of a vertex coloring). Which pair of inequalities holds for every graph?
  1. $\chi(G)\le\omega(G)$ and $\chi(G)\le\left\lceil n/\alpha(G)\right\rceil$
  2. $\omega(G)\le\chi(G)$ and $\chi(G)\le\left\lceil n/\alpha(G)\right\rceil$
  3. $\alpha(G)\le\chi(G)$ and $\omega(G)\le\chi(G)$
  4. $\omega(G)\le\chi(G)$ and $\left\lceil n/\alpha(G)\right\rceil\le\chi(G)$
Explanation. A clique needs pairwise different colors (clique bound); every color class is a stable set, with at most $\alpha(G)$ vertices, hence at least $\lceil n/\alpha(G)\rceil$ colors are needed. Both are dual bounds.
oc-f-014 · level ipotesi · notes
For a graph $G$ with $n$ vertices, let $\chi(G)$ be the chromatic number and $\alpha(G)$ the cardinality of a maximum stable set. Which facts are needed to prove the bound $\left\lceil n/\alpha(G)\right\rceil\le\chi(G)$?
  1. The graph contains a clique with $\chi(G)$ vertices; every stable set has at most $\alpha(G)$ vertices; $\chi(G)$ is an integer
  2. Every vertex has degree at most $\Delta(G)$ (maximum degree); there are at most $\Delta(G)+1$ color classes; $\chi(G)$ is an integer
  3. Every color class is a stable set, hence it has at most $\alpha(G)$ vertices; the classes cover the $n$ vertices; $\chi(G)$ is an integer
  4. Every color class is a clique, hence it has at most $\omega(G)$ vertices; the classes cover the $n$ vertices; $\chi(G)$ is an integer
Explanation. With $\chi(G)$ stable classes, each with at most $\alpha(G)$ vertices, we have $\chi(G)\,\alpha(G)\ge n$; since $\chi(G)$ is an integer, we round up.
oc-f-015 · level facile · notes
The Petersen graph has $n=10$ vertices, maximum cliques of $\omega(G)=2$ vertices and maximum stable sets of $\alpha(G)=4$ vertices. What do the clique bound $\omega(G)$ and the stable set bound $\lceil n/\alpha(G)\rceil$ give on the chromatic number $\chi(G)$?
  1. Clique bound $2$, stable set bound $5$: hence $\chi(G)\ge 5$
  2. Clique bound $2$, stable set bound $3$: hence $\chi(G)\ge 3$
  3. Clique bound $2$, stable set bound $2$: hence $\chi(G)\ge 2$
  4. Clique bound $4$, stable set bound $3$: hence $\chi(G)\ge 4$
Explanation. $\omega(G)=2$ and $\lceil 10/4\rceil=3$. The clique bound leaves a gap; the stable set bound closes it, because a coloring with $3$ colors exists.
oc-f-016 · level facile · notes
In the vertex coloring problem (VCP) on a graph $G$ every vertex gets a color, adjacent vertices get different colors, and the number of colors is minimum. A solution can be seen as:
  1. a partition of the vertices into stable sets, up to renaming the colors
  2. a partition of the vertices into cliques, up to renaming the colors
  3. a partition of the edges into matchings, up to renaming the colors
  4. a maximum stable set, plus a different color for every other vertex
Explanation. Every color class is a stable set (non-adjacent vertices can share a color); permuting the colors does not give different solutions.
oc-f-100 · level facile · notes
In vertex coloring (VCP) we minimize the number of colors, with different colors on adjacent vertices; $\chi(G)$ is the chromatic number and $\omega(G)$ the size of a maximum clique. For the cycle $C_5$ (5 vertices on a circle), what are $\omega(C_5)$, the bound $\lceil n/\alpha\rceil$ (with $\alpha=2$ the maximum stable set) and $\chi(C_5)$?
  1. $2$, $3$ and $3$
  2. $2$, $3$ and $2$
  3. $3$, $3$ and $3$
  4. $2$, $2$ and $3$
Explanation. $C_5$ has no triangle ($\omega=2$), has $\alpha=2$ and hence $\lceil 5/2\rceil=3$; an odd cycle cannot be colored with $2$ colors, and $3$ suffice: $\chi(C_5)=3$.
oc-f-101 · level facile · notes
In vertex coloring (VCP), a solution is a partition of the vertices into stable sets, up to renaming the colors. How many partitions does a set of $4$ vertices have, i.e., candidate solutions before checking the edges (Bell number $B(4)$)?
  1. $24$
  2. $256$
  3. $16$
  4. $15$
Explanation. $B(4)=15$: one part ($1$), two parts ($7$), three parts ($6$), four parts ($1$). $4^4=256$ counts the assignments of $4$ named colors, $4!=24$ the orderings, $2^4$ the subsets.
oc-f-102 · level facile · notes
In vertex coloring (VCP), for a graph $G$ we find by hand a clique with $3$ vertices and a feasible coloring with $4$ colors. What do we know about the chromatic number $\chi(G)$?
  1. $\chi(G)=3$: the clique bound always equals the chromatic number
  2. $4\le\chi(G)$: the coloring gives a lower bound, the clique an upper bound
  3. $3\le\chi(G)\le 4$: the clique gives a dual bound, the coloring a primal bound
  4. $\chi(G)=4$: a coloring found by hand is always optimal on small graphs
Explanation. The vertices of the clique need different colors, hence $\chi(G)\ge 3$; the coloring with $4$ colors proves $\chi(G)\le 4$. Without more information the chromatic number can be $3$ or $4$.
oc-f-103 · level facile · notes
In a simple graph $G=(V,E)$, the degree of a vertex is the number of its neighbours. A graph with $6$ vertices has degrees $(3,3,2,2,2,2)$. How many edges does it have?
  1. $15$
  2. $7$
  3. $14$
  4. $6$
Explanation. Every edge has two endpoints, so the sum of the degrees is $2m$: $14=2m$ and $m=7$. The value $15=\binom62$ is the number of edges of the complete graph.
oc-f-104 · level facile · notes
For a graph $G=(V,E)$ and a subset $S\subseteq V$, what is the induced subgraph $G[S]$?
  1. The graph with vertices $S$ and all the edges of $G$ with both endpoints in $S$
  2. The graph with vertices $S$ and all the edges of $G$ with at least one endpoint in $S$
  3. The graph with vertices $V\setminus S$ and all the edges of $G$ among these vertices
  4. The graph with vertices $S$ and only the edges of a spanning tree of $G$
Explanation. $G[S]$ keeps the vertices of $S$ and the edges of $G$ between two vertices of $S$. For example $S$ is a clique if and only if $G[S]$ is complete, and it is stable if and only if $G[S]$ has no edge.
oc-f-105 · level facile · notes
In vertex coloring (VCP), every color class is a stable set, so it has at most $\alpha(G)$ vertices. A graph has $n=9$ vertices and $\alpha(G)=2$. Which lower bound on the chromatic number $\chi(G)$ follows?
  1. $4$
  2. $7$
  3. $2$
  4. $5$
Explanation. With classes of at most $2$ vertices at least $\lceil 9/2\rceil=5$ classes are needed. The value $4$ forgets to round up, $2$ mistakes $\alpha$ for the bound.
oc-f-106 · level facile · notes
In vertex coloring (VCP), the wheel $W_5$ has a hub adjacent to all the $5$ vertices of a cycle $C_5$. What are the size $\omega(W_5)$ of a maximum clique and the chromatic number $\chi(W_5)$?
  1. $\omega=4$ and $\chi=4$
  2. $\omega=2$ and $\chi=3$
  3. $\omega=3$ and $\chi=4$
  4. $\omega=3$ and $\chi=3$
Explanation. The hub and two consecutive vertices of the cycle form a triangle, and there is no clique with $4$ vertices: $\omega=3$. The odd cycle needs $3$ colors and the hub a fourth one: $\chi=4>\omega$.
oc-f-107 · level facile · notes
In vertex coloring (VCP) of the complete graph $K_6$ ($6$ pairwise adjacent vertices), what is the chromatic number, and which bound certifies it?
  1. $5$, because the largest degree is $\Delta=5$
  2. $6$, certified by the clique bound $\omega(K_6)=6$
  3. $2$, because every graph with an edge has $\chi\ge 2$
  4. $3$, certified by the stable set bound $\lceil 6/2\rceil$
Explanation. All the vertices are adjacent, so $6$ different colors are needed: $\omega(K_6)=6\le\chi(K_6)\le 6$. The largest degree $5$ gives only the upper bound $\Delta+1=6$.
oc-f-261 · level facile · notes
In the vertex coloring problem (VCP) of a graph $G=(V,E)$ the two endpoints of every edge get different colors. What do the vertices with the same color form, and hence what does the VCP look for?
  1. A clique; the VCP looks for a partition of $V$ into the minimum number of cliques
  2. A stable set; the VCP looks for the largest stable set
  3. A path; the VCP looks for the longest path
  4. A stable set; the VCP looks for a partition of $V$ into the minimum number of stable sets
Explanation. Two vertices of the same color cannot be adjacent: every color class is a stable set. The minimum number of classes is the chromatic number $\chi(G)$.
oc-f-262 · level facile · notes
In a graph $G$ a clique is a set of pairwise adjacent vertices and a stable set a set of pairwise non-adjacent vertices. What is a stable set of $G$ in the complement graph $\overline G$ (same vertices, adjacent if and only if they are not in $G$)?
  1. A cycle of $\overline G$
  2. A set of isolated vertices of $\overline G$
  3. A clique of $\overline G$
  4. A stable set of $\overline G$
Explanation. Two non-adjacent vertices in $G$ are adjacent in $\overline G$: hence $\alpha(G)=\omega(\overline G)$. A single vertex is both a clique and a stable set.
oc-f-263 · level ipotesi · notes
In vertex coloring (VCP) one assumes that no vertex has its neighbourhood contained in that of another vertex. If instead $N(u)\subseteq N(v)$ with $u\ne v$, why can $u$ be removed without changing the chromatic number?
  1. Removing $u$ always decreases the chromatic number by one
  2. $u$ and $v$ are not adjacent, and every coloring of the rest of the graph extends by giving $u$ the color of $v$
  3. $u$ has smaller degree, so it always gets color $1$
  4. $u$ and $v$ are adjacent, so $u$ gets a new color
Explanation. If they were adjacent, $v\in N(u)\subseteq N(v)$, impossible in a simple graph. The neighbours of $u$ are neighbours of $v$, so none of them has the color of $v$: $u$ can take it.
oc-f-264 · level ipotesi · notes
In vertex coloring (VCP) one assumes that the graph has no isolated vertices ($\deg(v)\ge1$ for every $v$). Why is the assumption not restrictive?
  1. An isolated vertex can get any color already used, so it does not change the chromatic number (if the graph has at least one edge)
  2. An isolated vertex always requires a new color
  3. A graph with isolated vertices cannot be colored
  4. The isolated vertices always form a clique
Explanation. A vertex without neighbours has no conflicts: it is colored with color $1$. If the graph has no edges the optimal value is $1$.
oc-f-265 · level facile · notes
The Petersen graph has $n=10$ vertices, no triangle ($\omega(G)=2$) and stability number $\alpha(G)=4$; a coloring with $3$ colors is known. Using the clique bound $\omega(G)$ and the stable set bound $\lceil n/\alpha(G)\rceil$, what can be concluded?
  1. The clique bound gives $3$, hence $\chi(G)=3$
  2. The bounds give $2$, so a gap remains and $\chi(G)$ is unknown
  3. $\chi(G)=4$, because $\alpha(G)=4$
  4. The stable set bound gives $3$, which matches the coloring: $\chi(G)=3$
Explanation. $\omega(G)=2$ leaves a gap of $1$; $\lceil10/4\rceil=3$ closes the gap with the $3$-coloring.
oc-f-266 · level facile · notes
In vertex coloring (VCP) the candidate solutions are the partitions of $V$, counted by the Bell numbers $B(n)$. For a triangle ($n=3$, all vertices adjacent), how many candidates are there and how many are feasible?
  1. $5$ candidates, $3$ feasible
  2. $6$ candidates, $6$ feasible
  3. $5$ candidates, $1$ feasible (three singletons)
  4. $8$ candidates, $1$ feasible
Explanation. $B(3)=5$; every class with two vertices contains an edge, so only the partition into three singletons is feasible and $\chi=3$.
oc-f-267 · level ipotesi · notes
Brooks' theorem (1941): a connected graph that is neither complete nor an odd cycle can be colored with at most $\Delta$ colors ($\Delta$ = maximum degree). What does the cycle on $5$ vertices $C_5$ show?
  1. That $C_5$ needs $\Delta+2=4$ colors
  2. That the assumption «not an odd cycle» is needed: $\Delta=2$ but $\chi(C_5)=3$
  3. That the theorem also holds for odd cycles: $\chi(C_5)=2$
  4. That the connectivity assumption is needed: $C_5$ is not connected
Explanation. An odd cycle cannot be colored with $2$ colors, so it exceeds $\Delta=2$ by one; the complete graph $K_n$ also has $\chi=n=\Delta+1$.
oc-f-411 · level facile · notes
Some exams must be timetabled: two exams with common students cannot be in the same time slot, and the minimum number of slots is wanted. How is this modelled as vertex colouring?
  1. Vertices = exams, edges = pairs without common students, colours = slots
  2. Vertices = exams, edges = pairs with common students, colours = slots
  3. Vertices = slots, edges = exams, colours = students
  4. Vertices = students, edges = common exams, colours = slots
Explanation. The edges join the conflicting pairs; a colour class is a stable set, i.e., a group of exams without conflicts, and the minimum number of slots is $\chi(G)$.
oc-f-412 · level teorema · notes
In vertex colouring of $G$ the vertices of the same colour form a stable set. Let $\overline{G}$ be the complement (two vertices are adjacent in $\overline{G}$ if and only if they are not in $G$). What do those vertices form in $\overline{G}$, and what is colouring $G$ equivalent to?
  1. A clique; covering $\overline{G}$ with the minimum number of cliques
  2. A stable set; colouring $\overline{G}$ with the same colours
  3. A clique; finding a maximum clique of $\overline{G}$
  4. A cycle; finding a tour through the vertices of $\overline{G}$
Explanation. Vertices pairwise non-adjacent in $G$ are pairwise adjacent in $\overline{G}$. A colouring of $G$ is therefore a partition of the vertices of $\overline{G}$ into cliques.
oc-f-413 · level teorema · notes
In vertex colouring, if $N(u)\subseteq N(v)$ ($N(\cdot)$ = set of neighbours) for two distinct vertices, $u$ is removed and later receives the colour of $v$. Why are $u$ and $v$ non-adjacent, so that they can have the same colour?
  1. Because $N(u)\subseteq N(v)$ always implies $\deg(u)=\deg(v)$
  2. Because a graph without isolated vertices has no edges between nested neighbourhoods
  3. It is not true in general: it must be checked case by case
  4. Otherwise $v\in N(u)\subseteq N(v)$: $v$ would be adjacent to itself
Explanation. A simple graph has no loops, so $v\notin N(v)$. From $\{u,v\}\in E$ it would follow $v\in N(u)\subseteq N(v)$, a contradiction.
oc-f-414 · level facile · notes
The Petersen graph has $10$ vertices: $1,\dots,5$ form a cycle of $5$ vertices, and so do $6,\dots,10$ (plus other edges between the two cycles). Why does a stable set (pairwise non-adjacent vertices) have at most $4$ vertices?
  1. Every vertex has degree $3$, so a stable set has at most $10-3-3$ vertices
  2. The graph is $3$-colourable, so $\alpha\le\lceil10/3\rceil=4$
  3. A stable set takes at most $2$ vertices from each of the two cycles
  4. The graph has no triangles, so stable sets have at most $4$ vertices
Explanation. In a $5$-vertex cycle any three vertices include two adjacent ones. The absence of triangles bounds the cliques, not the stable sets; and $\chi=3$ would give $\alpha\ge\lceil10/3\rceil$, not $\le$.
oc-f-415 · level teorema · notes
Brooks' theorem (1941): a connected graph that is neither complete nor an odd cycle can be coloured with at most $\Delta$ colours ($\Delta$ = maximum degree). The Petersen graph is connected, all its vertices have degree $3$, and it is neither complete nor a cycle. What does the theorem give?
  1. $\chi(G)\le2$, because there are no triangles
  2. $\chi(G)\le3$, because $\Delta=3$
  3. $\chi(G)\le4$: the theorem does not apply to regular graphs
  4. $\chi(G)=3$: the theorem also gives the lower bound
Explanation. The theorem is an upper bound: $\chi\le\Delta=3$. That $\chi$ is exactly $3$ follows from a different lower bound (e.g., $\lceil n/\alpha\rceil=\lceil10/4\rceil$).
oc-f-416 · level ipotesi · notes
Brooks' theorem ($\chi(G)\le\Delta$ for a connected graph, $\Delta$ = maximum degree) excludes complete graphs and odd cycles. Why are these exceptions necessary?
  1. In both $\chi=\Delta+1$, so $\Delta$ colours are not enough
  2. In both $\chi<\Delta$, so the bound would be too weak
  3. They are the only graphs in which the maximum degree is undefined
  4. They are disconnected graphs, to which the theorem does not apply
Explanation. $K_n$ has $\Delta=n-1$ and $\chi=n$, an odd cycle $\Delta=2$ and $\chi=3$. Without the exceptions the theorem would be false: e.g., $K_4$ has maximum degree $3$ but needs $4$ colours; $C_5$ has degree $2$ but needs $3$ colours.
oc-f-417 · level facile · notes
Garey, Johnson and Stockmeyer (1976) proved that deciding whether $3$ colours suffice to colour a graph remains NP-complete even on planar graphs of maximum degree $4$. What follows, if $P\neq NP$?
  1. On planar graphs of degree $4$ one always has $\chi(G)\le3$
  2. On planar graphs colouring is solved in polynomial time
  3. Deciding whether $2$ colours suffice is NP-complete as well
  4. Not even there does a polynomial algorithm decide if $\chi(G)\le3$
Explanation. The difficulty remains even when the class of graphs is strongly restricted. Deciding whether $2$ colours suffice (bipartite graph) is instead easy.

5. Clique problems (32)

oc-f-017 · level teorema · notes
Let $\overline{G}$ be the complement of the graph $G$ (same vertices; two vertices are adjacent in $\overline{G}$ if and only if they are not adjacent in $G$), and let $\omega$ and $\alpha$ be the cardinalities of a maximum clique and of a maximum stable set. Which statement holds for every graph $G$ with $n$ vertices?
  1. $K$ is stable in $G$ if and only if $V\setminus K$ is a clique of $G$; hence $\omega(G)+\alpha(G)=n$
  2. $K$ is a clique of $G$ if and only if it is a stable set of $\overline{G}$; hence $\omega(G)=\alpha(\overline{G})$
  3. $K$ is a clique of $G$ if and only if it is a stable set of $G$; hence $\omega(G)=\alpha(G)$
  4. $K$ is a clique of $G$ if and only if it is a clique of $\overline{G}$; hence $\omega(G)=\omega(\overline{G})$
Explanation. The edges of $\overline{G}$ are the non-adjacent pairs of $G$: pairwise adjacent vertices in $G$ are pairwise non-adjacent in $\overline{G}$. Hence the MCP on $G$ is the MSSP on $\overline{G}$.
oc-f-018 · level facile · notes
A graph $G$ has $m=10$ edges. A clique of $k$ vertices contains $k(k-1)/2$ edges, hence the cardinality $\omega(G)$ of a maximum clique satisfies $\omega(G)(\omega(G)-1)/2\le m$. What is the smallest upper bound on $\omega(G)$ that follows?
  1. $5$
  2. $4$
  3. $6$
  4. $10$
Explanation. With $\omega=5$ we get $5\cdot 4/2=10\le 10$; with $\omega=6$ we would get $15>10$. Hence $\omega(G)\le 5$.
oc-f-019 · level facile · notes
A graph $G$ has $n=7$ vertices and $m=12$ edges. The complement $\overline{G}$ has the same vertices, and two vertices are adjacent in $\overline{G}$ if and only if they are not adjacent in $G$. How many edges does $\overline{G}$ have?
  1. $12$
  2. $30$
  3. $37$
  4. $9$
Explanation. $|\overline{E}|=\binom{n}{2}-m=21-12=9$: the edges of $\overline{G}$ are the pairs that are not edges of $G$.
oc-f-020 · level facile · notes
In a graph, a clique is a set of pairwise adjacent vertices. What is the difference between a maximal clique and a maximum clique?
  1. It is maximal if it contains a maximum clique; it is maximum if no vertex can be added to it
  2. They are synonyms: no vertex can be added to it and no clique has more vertices
  3. It is maximal if no vertex can be added to it; it is maximum if no clique has more vertices
  4. It is maximum if no vertex can be added to it; it is maximal if no clique has more vertices
Explanation. Every maximum clique is maximal, but not conversely: a maximal clique can be smaller than $\omega(G)$.
oc-f-092 · level teorema · notes
In the maximum clique problem (MCP) on a graph $G$, let $\Delta$ be the largest degree of a vertex and $\omega(G)$ the size of a maximum clique. Which bound holds for every graph, and why?
  1. $\omega(G)\ge\Delta+1$: a vertex of degree $\Delta$ and its neighbours form a clique
  2. $\omega(G)\le\Delta-1$: in a clique with $k$ vertices every vertex has at most $k-2$ neighbours
  3. $\omega(G)\le\Delta+1$: in a clique with $k$ vertices every vertex has at least $k-1$ neighbours
  4. $\omega(G)\le\Delta$: in a clique with $k$ vertices every vertex has at least $k$ neighbours
Explanation. A vertex of a clique $K$ is adjacent to the other $|K|-1$ vertices of $K$, hence $|K|-1\le\Delta$. The neighbours of a vertex are not pairwise adjacent in general, so they do not form a clique.
oc-f-093 · level facile · notes
In the maximum clique problem (MCP), $k^{\max}$ is the largest integer $k$ such that at least $k$ vertices have degree at least $k-1$, and $\omega(G)\le k^{\max}$. A graph has degrees $(4,3,3,2,2,1)$. What is $k^{\max}$?
  1. $2$
  2. $3$
  3. $5$
  4. $4$
Explanation. For $k=4$ we need $4$ vertices of degree at least $3$, but there are only $3$; for $k=3$ we need $3$ vertices of degree at least $2$, and there are $5$. Hence $k^{\max}=3$; the degree bound $\Delta+1$ would give $5$.
oc-f-094 · level teorema · notes
In the maximum clique problem (MCP), let $\Delta$ be the largest degree and $k^{\max}$ the largest $k$ such that at least $k$ vertices have degree at least $k-1$. How are the two upper bounds $k^{\max}$ and $\Delta+1$ on $\omega(G)$ related?
  1. $k^{\max}\le\Delta+1$ for every graph: the degree count bound is never weaker
  2. $k^{\max}\ge\Delta+1$ for every graph: the degree bound is never weaker
  3. $k^{\max}=\Delta+1$ for every graph: the two bounds always coincide
  4. They are not comparable: on some graphs one wins, on others the other
Explanation. If $k$ vertices have degree at least $k-1$, then $\Delta\ge k-1$; hence $k^{\max}\le\Delta+1$. For example with degrees $(4,3,3,2,2,1)$ we get $k^{\max}=3<5=\Delta+1$.
oc-f-095 · level facile · notes
In the maximum clique problem (MCP) on a graph with $n=10$ vertices, a candidate solution is any subset of the vertices, to be checked pair by pair afterwards. How many candidate solutions are there?
  1. $45$
  2. $3\,628\,800$
  3. $512$
  4. $1024$
Explanation. The subsets of $10$ vertices are $2^{10}=1024$. $\binom{10}{2}=45$ counts the pairs of vertices, $10!$ the orderings; $2^9$ forgets half of the subsets.
oc-f-096 · level facile · notes
The decision version of the maximum clique problem (MCP) asks whether a graph with $n$ vertices has a clique with $k$ vertices. What can be said if $k$ is a fixed constant (for example $k=3$: is there a triangle)?
  1. It is decided in $O(2^k n)$ steps, polynomial even when $k$ is part of the input
  2. It is decided in $O(n^2)$ steps for every $k$, checking all the pairs only once
  3. It is decided in $O(n^k k^2)$ steps, polynomial for fixed $k$; with $k$ part of the input it stays NP-complete
  4. It stays NP-complete even for $k=3$, because the number of subsets is $2^n$
Explanation. The subsets with $k$ vertices are $\binom nk\le n^k$, and each is checked in $O(k^2)$: polynomial for fixed $k$, but the exponent grows with $k$. With $k$ given in the input the problem is one of Karp's 21 NP-complete problems.
oc-f-097 · level facile · notes
In the maximum clique problem (MCP), the vertices of a graph $G$ are partitioned into $4$ stable sets (sets of pairwise non-adjacent vertices). What follows for the size $\omega(G)$ of a maximum clique?
  1. Nothing: stable sets give bounds only on the maximum stable set
  2. $\omega(G)\le 4$, because a clique contains at most one vertex of each stable set
  3. $\omega(G)\ge 4$, because a clique contains at least one vertex of each stable set
  4. $\omega(G)=4$, because the classes of a partition into stable sets are cliques
Explanation. Two vertices of the same stable set are not adjacent, so a clique takes at most one of them: $\omega(G)\le 4$. It is the coloring bound $\omega(G)\le\chi(G)$, since the partition is a coloring with $4$ colors.
oc-f-098 · level facile · notes
In the weighted variants of the maximum clique, every vertex $v$ has a weight $w_v$ and every edge $\{u,v\}$ a weight $r_{uv}$; $w(K)$ and $r(K)$ add up the weights of the vertices and of the edges of the clique $K$. For the triangle $K=\{1,2,3\}$ with $w=(3,5,2)$, $r_{12}=4$, $r_{13}=1$, $r_{23}=6$, what are $w(K)$ and $r(K)$?
  1. $w(K)=10$ and $r(K)=11$
  2. $w(K)=11$ and $r(K)=10$
  3. $w(K)=10$ and $r(K)=21$
  4. $w(K)=10$ and $r(K)=6$
Explanation. $w(K)=3+5+2=10$ and $r(K)=4+1+6=11$. The value $21$ adds vertices and edges together, $6$ takes only the heaviest edge.
oc-f-099 · level facile · notes
In the edge-weighted maximum clique problem (EWMCP) we look for a clique $K$ maximizing $r(K)$, the sum of the weights $r_{uv}$ of its edges. Why, with all the weights $r_{uv}=1$, is the EWMCP the maximum clique problem (MCP)?
  1. Because $r(K)=|K|$, the number of vertices of the clique
  2. Because $r(K)=2|K|$, since every vertex has two edges
  3. Because $r(K)=1$ for every clique, and all cliques are optimal
  4. Because $r(K)=\binom{|K|}{2}$, which grows with the number $|K|$ of vertices
Explanation. A clique with $k$ vertices has $\binom k2$ edges, and $\binom k2$ is increasing in $k$: maximizing $r(K)$ is the same as maximizing $|K|$.
oc-f-268 · level facile · notes
The family of clique problems includes the vertex-weighted maximum clique (VWMCP) and the edge-weighted one (EWMCP). What does the EWMCP maximize?
  1. The number of vertices of the clique
  2. The weight of the heaviest edge of the clique
  3. The total weight of the edges with both endpoints in the clique
  4. The total weight of the vertices of the clique
Explanation. In the EWMCP a clique with $k$ vertices counts the weights of its $\binom k2$ edges; in the VWMCP the vertex weights are summed.
oc-f-269 · level facile · notes
The clique number $\omega(G)$ is the largest number of pairwise adjacent vertices. What is obtained by solving the maximum clique problem on the complement graph $\overline G$?
  1. The maximum degree of $G$
  2. A maximum stable set of $G$, of cardinality $\alpha(G)$
  3. A maximum clique of $G$
  4. An optimal coloring of $G$
Explanation. The cliques of $\overline G$ are the stable sets of $G$: $\omega(\overline G)=\alpha(G)$. This is why the MSSP is as hard as the MCP.
oc-f-270 · level ipotesi · notes
For the maximum clique problem one considers instances with $1\le m<\binom n2$ ($m$ edges, $n$ vertices). Why do the two excluded cases not lose generality?
  1. With $m=0$ every vertex is a maximum clique ($\omega=1$); with $m=\binom n2$ the graph is complete ($\omega=n$)
  2. With $m=0$ the problem is infeasible; with $m=\binom n2$ there are no cliques
  3. With $m=0$ one has $\omega=0$; with $m=\binom n2$ one has $\omega=n-1$
  4. In both cases $\omega=2$
Explanation. The two extreme cases are solved by inspection: without edges any vertex, with the complete graph the whole $V$.
oc-f-271 · level facile · notes
A graph has $8$ vertices split into the pairs $\{1,5\},\{2,6\},\{3,7\},\{4,8\}$: the two vertices of a pair are not adjacent, all other pairs of vertices are. What is $\omega(G)$ and how many maximum cliques are there?
  1. $\omega(G)=4$, with a single maximum clique
  2. $\omega(G)=8$, with a single maximum clique
  3. $\omega(G)=2$, with $4$ maximum cliques
  4. $\omega(G)=4$, with $16$ maximum cliques
Explanation. A clique takes at most one vertex per pair; taking exactly one per pair gives a clique: $2^4=16$ cliques of $4$ vertices.
oc-f-272 · level facile · notes
To build a clique by hand one starts from a vertex of maximum degree and adds, one at a time, a vertex adjacent to all those already chosen, while possible. What does the resulting clique $K$ provide?
  1. Always a maximum clique
  2. The chromatic number $\chi(G)$
  3. A primal bound: $|K|\le\omega(G)$
  4. A dual bound: $|K|\ge\omega(G)$
Explanation. $K$ is a clique, hence feasible: in a maximization problem its value is a lower bound. It need not be maximum, because the choices are made one at a time.
oc-f-273 · level teorema · notes
For a fixed integer $k$, all $\binom nk$ subsets of $k$ vertices can be checked in $O(n^k k^2)$ steps, a polynomial in $n$. Why does this not contradict the NP-hardness of the maximum clique problem?
  1. It does contradict it: the problem is in P
  2. The exponent grows with $k$, and $k$ is part of the input: for $k$ of the order of $n$ the time is not polynomial
  3. Because $O(n^k k^2)$ is exponential even for fixed $k$
  4. Because checking a clique requires exponential time
Explanation. A polynomial algorithm must have a fixed exponent for all instances; here the exponent depends on $k$, which can grow with $n$.
oc-f-274 · level facile · notes
Håstad (1999) proved an inapproximability result for maximum clique ($n$ vertices, $\omega(G)$ clique number). Which one, unless NP is contained in randomized polynomial time?
  1. For every $\varepsilon>0$ no polynomial algorithm guarantees a clique of at least $\omega(G)/n^{1-\varepsilon}$ vertices
  2. No polynomial algorithm guarantees a clique of at least $\omega(G)/2$ vertices, but $\omega(G)/3$ is possible
  3. There is an FPTAS for maximum clique
  4. Every greedy algorithm guarantees $\omega(G)-1$ vertices
Explanation. A single-vertex clique already guarantees $\omega(G)/n$: the result says that one cannot do substantially better than this trivial ratio.
oc-f-275 · level facile · notes
In a vertex coloring of a graph $G$ every color class is a stable set. What is the link with the maximum stable set problem (MSSP)?
  1. The MSSP looks for the minimum number of colors
  2. The MSSP looks for the largest clique, which is a color class
  3. No link: the color classes are cliques
  4. The MSSP looks for the largest possible color class, of cardinality $\alpha(G)$
Explanation. Every stable set can be a color class; the largest one has $\alpha(G)$ vertices, which gives the bound $\chi(G)\ge\lceil n/\alpha(G)\rceil$.
oc-f-276 · level facile · notes
In the design of error-correcting codes one looks for a large set of pairwise «far» words (distance at least $d$). On which graph is this a maximum clique problem?
  1. On the complete graph of the words
  2. On the graph with an edge between words of different length
  3. On the graph with one word per vertex and an edge between two words at distance at least $d$
  4. On the graph with an edge between two words at distance less than $d$
Explanation. Pairwise compatible words must be pairwise adjacent: a clique. On the graph with the «close» edges it would be a stable set instead.
oc-f-418 · level facile · notes
A clique of a graph $G=(V,E)$ is a set of pairwise adjacent vertices. With $V=\{1,2,3,4\}$ and $E=\{\{1,2\},\{1,3\},\{2,3\},\{3,4\}\}$, which set is a clique?
  1. $\{1,2,3\}$
  2. $\{2,3,4\}$
  3. $\{1,3,4\}$
  4. $\{1,2,3,4\}$
Explanation. $\{1,2,3\}$ has the edges $12,13,23$. In $\{2,3,4\}$ the edge $\{2,4\}$ is missing, in $\{1,3,4\}$ the edge $\{1,4\}$; hence $\omega(G)=3$.
oc-f-419 · level facile · notes
A clique $K$ of a graph $G$ induces a complete graph. If $|K|=5$, how many edges of $G$ have both endpoints in $K$?
  1. $5$
  2. $20$
  3. $25$
  4. $10$
Explanation. All pairs of vertices of $K$ are edges: $\binom52=10$. $20=5\cdot4$ counts every edge twice.
oc-f-420 · level ipotesi · notes
For the maximum clique problem one considers graphs with $1\le m<\binom n2$ ($n$ vertices, $m$ edges). A graph has $n=5$ and $m=10$. Does it satisfy the assumption, and what is $\omega(G)$?
  1. No: the graph has no edges and $\omega(G)=1$
  2. Yes, and $\omega(G)$ must be computed by an algorithm
  3. No: the graph is complete and $\omega(G)=5$
  4. Yes, and $\omega(G)=4$ since an edge is missing
Explanation. $\binom52=10$: all possible edges are present, so $V$ is a clique. It is one of the two trivial cases excluded by the assumption.
oc-f-421 · level teorema · notes
Under the assumption $1\le m<\binom n2$ (at least one edge and at least one pair of non-adjacent vertices), which bounds hold for the clique number $\omega(G)$?
  1. $1\le\omega(G)\le n-1$
  2. $2\le\omega(G)\le n-1$
  3. $1\le\omega(G)\le n$
  4. $2\le\omega(G)\le n$
Explanation. An edge is a clique of $2$ vertices; a non-adjacent pair prevents $V$ from being a clique, so $\omega(G)<n$.
oc-f-422 · level teorema · notes
In the maximum clique problem, why does a graph with $\omega(G)=4$ have at least $2^4=16$ cliques, counting the empty set?
  1. Every subset of a clique is a clique
  2. Every vertex belongs to at least $4$ cliques
  3. The number of cliques is always $2^{\omega(G)}$
  4. Every clique is contained in a maximum clique
Explanation. Pairwise adjacent vertices remain so in every subset: the $2^4$ subsets of a maximum clique are cliques. The number of cliques may be larger.
oc-f-423 · level facile · notes
For the maximum clique on $n$ vertices, brute force lists all vertex subsets and checks whether each one is a clique, in $O(2^n\,n^2)$ steps. Where does the factor $n^2$ come from?
  1. From the number of edges of the complete graph
  2. From sorting the vertices by degree
  3. From computing the complement of the graph
  4. From checking the pairs of vertices of every subset
Explanation. A subset $S$ is a clique if each of its $\binom{|S|}2=O(n^2)$ pairs is an edge; the factor $2^n$ counts the subsets.
oc-f-424 · level teorema · notes
The decision version of maximum clique is NP-complete (Karp, 1972). Why does it follow that the maximum stable set problem (pairwise non-adjacent vertices) is NP-hard too?
  1. Every graph has $\alpha(G)=\omega(G)$, so the two problems coincide
  2. The stable set problem contains colouring as a special case
  3. $\alpha(G)=\omega(\overline{G})$, and $\overline{G}$ is built in polynomial time
  4. Every stable set is also a clique of the same graph
Explanation. A polynomial algorithm for maximum stable set, applied to $\overline{G}$, would give $\omega(G)$ in polynomial time; the reduction is the construction of the complement.
oc-f-425 · level facile · notes
Vertex-weighted maximum clique (VWMCP: the sum $w(K)$ of the vertex weights of the clique $K$ is maximized). A graph has $8$ vertices and all edges except the pairs $\{1,5\},\{2,6\},\{3,7\},\{4,8\}$; the weights are $w=(7,3,5,6,4,8,2,9)$. Optimal value?
  1. $21$
  2. $29$
  3. $30$
  4. $44$
Explanation. A clique takes at most one vertex per pair; the heaviest of each: $7+8+5+9=29$. $30=9+8+7+6$ uses vertices $4$ and $8$, which are not adjacent.
oc-f-426 · level teorema · notes
In the vertex-weighted maximum clique problem (VWMCP) the weights are $w_v\ge1$. Why is an optimal clique always maximal (no outside vertex is adjacent to all its vertices)?
  1. Otherwise that vertex is added and the weight strictly increases
  2. Because an optimal clique always coincides with a maximum clique
  3. Because the weights are integer
  4. It is not true: an optimal clique may be non-maximal
Explanation. With positive weights adding a feasible vertex increases $w(K)$. An optimal clique, however, need not have maximum cardinality.
oc-f-427 · level facile · notes
One wants to hold in parallel the maximum number of pairwise compatible exams (no common students). On which graph is this a maximum clique problem?
  1. On the graph with an edge between every pair of conflicting exams
  2. On the graph with a vertex per student and an edge per exam
  3. On the complete graph on the exams
  4. On the graph with an edge between every pair of compatible exams
Explanation. Pairwise compatible exams are a clique of the compatibility graph, i.e., a stable set of the conflict graph (its complement).
oc-f-428 · level teorema · notes
In a vertex colouring of a graph $G$ with $n$ vertices every colour class is a stable set. Which lower bound on $\alpha(G)$ (cardinality of a maximum stable set) follows, with $\chi(G)$ the chromatic number?
  1. $\alpha(G)\ge n-\chi(G)$
  2. $\alpha(G)\ge\lfloor\chi(G)/2\rfloor$
  3. $\alpha(G)\ge\lceil n/\chi(G)\rceil$
  4. $\alpha(G)\ge\chi(G)$
Explanation. The $\chi(G)$ classes cover the $n$ vertices: the largest has at least $\lceil n/\chi(G)\rceil$ vertices and is a stable set.

6. Routing problems (31)

oc-f-021 · level facile · notes
In the symmetric traveling salesman problem (TSP) ($d_{ij}=d_{ji}$) a tour visits every city once and returns to the start; two tours are equal if they use the same edges. How many distinct tours are there with $n=7$ cities?
  1. $5040$
  2. $2520$
  3. $360$
  4. $720$
Explanation. The tours are $\frac{(n-1)!}{2}=\frac{720}{2}=360$: neither the starting city nor the direction changes the tour. In the asymmetric case they would be $(n-1)!=720$.
oc-f-022 · level facile · notes
In the symmetric TSP with integer distances, let $a_i$ and $b_i$ be the two smallest distances from city $i$ to the others. In an instance with $5$ cities the sums $a_i+b_i$ are $5,7,6,8,9$. Which lower bound is obtained on the length $z(I)$ of the shortest tour?
  1. $17.5$
  2. $18$
  3. $35$
  4. $17$
Explanation. $z(I)\ge\left\lceil\frac12\sum_i(a_i+b_i)\right\rceil=\lceil 35/2\rceil=18$: every edge of the tour is counted by both its endpoints, and the lengths are integer.
oc-f-023 · level ipotesi · notes
In the symmetric TSP let $a_i$ and $b_i$ be the two smallest distances from city $i$ to the others and $z(I)$ the length of the shortest tour. Which facts are needed to prove $z(I)\ge\left\lceil\frac12\sum_{i}(a_i+b_i)\right\rceil$?
  1. In a tour every city has two edges, of length at least $a_i$ and $b_i$; every edge has two endpoints; distances are integer
  2. The triangle inequality, which allows shortcutting the tour; every edge has two endpoints; distances are integer
  3. A minimum spanning tree is shorter than the optimal tour; every edge has two endpoints; distances are integer
  4. In a tour every city has two edges; the nearest neighbour tour is optimal; distances are integer
Explanation. Summing over all the cities the lengths of their two tour edges counts every edge twice: $2z(I)\ge\sum_i(a_i+b_i)$; with integer distances we round up. The triangle inequality is not needed.
oc-f-024 · level facile · notes
In the TSP with distances $d_{ij}\ge 0$ between the cities, when is an instance called metric?
  1. When $d_{ij}\ge d_{ik}+d_{kj}$ for all triples of distinct cities $i,j,k$
  2. When $d_{ij}\le d_{ik}+d_{kj}$ for at least one triple of distinct cities $i,j,k$
  3. When $d_{ij}=d_{ji}$ for all pairs of distinct cities $i,j$
  4. When $d_{ij}\le d_{ik}+d_{kj}$ for all triples of distinct cities $i,j,k$
Explanation. The metric TSP requires the triangle inequality on all triples; holding for one triple is not enough, and symmetry alone is not enough.
oc-f-126 · level teorema · notes
In the asymmetric TSP (ATSP) the distance $d_{ij}$ from $i$ to $j$ may differ from $d_{ji}$, so a tour and its reverse are different solutions. How many distinct tours does an ATSP instance with $n=5$ cities have?
  1. $60$
  2. $24$
  3. $12$
  4. $120$
Explanation. Fixing the starting city leaves $(n-1)!=24$ orderings, and in the asymmetric case the direction matters. In the symmetric case one divides by $2$: $12$.
oc-f-127 · level facile · notes
In the TSP the length of the tour $(\sigma_1,\dots,\sigma_n)$ is $\sum_{k=1}^{n-1}d_{\sigma_k\sigma_{k+1}}+d_{\sigma_n\sigma_1}$. With $d_{12}=3$, $d_{23}=4$, $d_{34}=5$, $d_{41}=6$, how long is the tour $(1,2,3,4)$?
  1. $18$
  2. $12$
  3. $15$
  4. $21$
Explanation. $3+4+5+6=18$. The value $12$ forgets the return edge $d_{41}$, which is part of the tour.
oc-f-128 · level facile · notes
Symmetric TSP with $4$ cities: $d_{12}=2$, $d_{13}=5$, $d_{14}=4$, $d_{23}=3$, $d_{24}=6$, $d_{34}=1$. The nearest neighbour rule starts from city $1$, goes each time to the nearest unvisited city and finally returns to $1$. How long is the tour?
  1. $6$
  2. $14$
  3. $12$
  4. $10$
Explanation. $1\to2$ ($2$), $2\to3$ ($3$), $3\to4$ ($1$), return $4\to1$ ($4$): $10$. Without the return one gets $6$; the tour $(1,2,4,3)$ has length $14$.
oc-f-129 · level facile · notes
Symmetric TSP with $4$ cities: $d_{12}=2$, $d_{13}=5$, $d_{14}=4$, $d_{23}=3$, $d_{24}=6$, $d_{34}=1$. With $a_i,b_i$ the two smallest distances from city $i$, the lower bound is $\left\lceil\frac12\sum_i(a_i+b_i)\right\rceil$. What is it?
  1. $9$
  2. $5$
  3. $10$
  4. $20$
Explanation. The sums $a_i+b_i$ are $6,5,4,5$, total $20$, and half of it is $10$. The tour $(1,2,3,4)$ has length $10$: the bound proves it optimal.
oc-f-130 · level teorema · notes
In the TSP, a closed walk through all the cities that repeats some of them is turned into a tour by skipping the cities already visited (shortcuts). Under which assumption on the distances $d_{ij}$ is the resulting tour not longer than the closed walk?
  1. All distances equal, $d_{ij}=d$ for every pair
  2. The triangle inequality $d_{ij}\le d_{ik}+d_{kj}$ for all triples
  3. Symmetry $d_{ij}=d_{ji}$ for all pairs of cities
  4. Positive integer distances, $d_{ij}\in\Z_{\ge 1}$
Explanation. Skipping city $k$ replaces $d_{ik}+d_{kj}$ by $d_{ij}$, which is not larger by the triangle inequality; repeating for every skip the walk does not get longer. It is the key step of the double tree and Christofides algorithms.
oc-f-131 · level facile · notes
A TSP instance is metric if $d_{ij}\le d_{ik}+d_{kj}$ for all triples of distinct cities. On $3$ cities with $d_{12}=3$, $d_{23}=4$, $d_{13}=8$, is the instance metric?
  1. No: $d_{13}=8>d_{12}+d_{23}=7$
  2. Yes: all distances are positive
  3. Yes: $d_{12}+d_{13}\ge d_{23}$
  4. No: $d_{12}<d_{23}$
Explanation. One violating triple is enough: going from $1$ to $3$ through $2$ costs $7<8$. Positive distances are not enough, and the order between $d_{12}$ and $d_{23}$ does not matter.
oc-f-132 · level facile · notes
In the symmetric TSP with $n$ cities the distinct tours are $(n-1)!/2$. Why is listing all of them impossible already with $n=20$ cities?
  1. $2^{20}\approx 10^{6}$ tours: too many to store in a table
  2. $20^2=400$ tours, but each tour needs exponential time for its length
  3. $20!\approx 2\cdot 10^{18}$ tours: the division by $2$ does not apply to the symmetric case
  4. $19!/2\approx 6\cdot 10^{16}$ tours: even at a billion tours per second it takes about two years
Explanation. $(n-1)!/2$ with $n=20$ is about $6\cdot10^{16}$: at $10^9$ tours per second it takes $6\cdot10^7$ seconds, almost two years. The length of a tour is computed in linear time.
oc-f-133 · level facile · notes
A symmetric TSP instance ($d_{ij}=d_{ji}$) can be seen as an asymmetric TSP (ATSP) instance. How are the tours of the two problems related?
  1. The ATSP tours are $n$ times more, one for every starting city
  2. The ATSP has fewer tours, because some arcs cannot be travelled
  3. Every symmetric tour corresponds to two ATSP tours, one per direction, of the same length
  4. Every symmetric tour corresponds to one ATSP tour only, because the distances coincide
Explanation. In the ATSP the two directions are different solutions; with symmetric distances they have the same length. This is why the tours are $(n-1)!$ in the ATSP and $(n-1)!/2$ in the symmetric TSP.
oc-f-277 · level facile · notes
In the travelling salesman family the $n$ cities have distances $d_{ij}$. What characterizes the metric TSP with respect to the TSP?
  1. The distances are all equal to $1$ or $2$
  2. The tour may visit a city several times
  3. The distances are symmetric and satisfy the triangle inequality $d_{ik}\le d_{ij}+d_{jk}$
  4. The distances may differ in the two directions
Explanation. The metric TSP is a special case of the symmetric TSP; in the ATSP, instead, $d_{ij}$ may differ from $d_{ji}$.
oc-f-278 · level facile · notes
In the TSP a solution is a tour, i.e., a permutation $\sigma$ of the $n$ cities read as a closed route. For $\sigma=(1,3,2,4)$, which sum is the length $L(\sigma)$?
  1. $d_{13}+d_{24}$
  2. $d_{13}+d_{32}+d_{24}+d_{41}$
  3. $d_{13}+d_{32}+d_{24}$
  4. $d_{12}+d_{23}+d_{34}+d_{41}$
Explanation. The tour goes back to the starting city: the $n$ distances between consecutive cities are summed, including the last one $d_{41}$.
oc-f-279 · level ipotesi · notes
In the TSP (symmetric distances) the distinct tours of $n$ cities are $(n-1)!/2$, and one assumes $n\ge3$. Why is the problem already trivial with $n=3$?
  1. There is a single tour: $(3-1)!/2=1$
  2. There are $3!=6$ different tours
  3. With $3$ cities the distances are not symmetric
  4. With $3$ cities no tour exists
Explanation. With three cities the tour $1\to2\to3\to1$ and its reverse are the same tour, and rotations do not count. With fewer than three cities there is not even a closed route of distinct cities.
oc-f-280 · level ipotesi · notes
In the TSP one assumes $d_{ij}=d_{ji}$, and the distinct tours of $n$ cities are $(n-1)!/2$. If the symmetry assumption is dropped (ATSP), how many distinct tours must be considered?
  1. Always $(n-1)!/2$
  2. $n!$, because rotations count too
  3. $2^n$, one per subset of arcs
  4. $(n-1)!$: a tour and its reverse in general have different lengths
Explanation. Without symmetry travelling the tour backwards changes its length, so the two directions are no longer identified; rotations remain the same tour.
oc-f-281 · level facile · notes
Three cities have symmetric distances $d_{12}=3$, $d_{23}=4$ and $d_{13}=9$. Do the distances satisfy the triangle inequality required by the metric TSP?
  1. Yes, because $9\le 3\cdot4$
  2. No, because $d_{12}\ne d_{23}$
  3. No: $d_{13}=9>d_{12}+d_{23}=7$
  4. Yes, because they are symmetric
Explanation. The inequality $d_{ik}\le d_{ij}+d_{jk}$ must be checked for every triple; here going through city $2$ is shorter than the direct link.
oc-f-282 · level facile · notes
Christofides (1976) gave an approximation algorithm for the metric TSP (symmetric distances with the triangle inequality). Which ratio does it guarantee?
  1. $1+\varepsilon$ for every $\varepsilon>0$
  2. $\frac32$
  3. $2$
  4. $\frac43$
Explanation. Christofides' algorithm finds a tour at most $\frac32$ times the optimum; the double tree guarantees $2$. For the general TSP no constant ratio is possible, if P $\ne$ NP.
oc-f-429 · level facile · notes
The travelling salesman family includes the TSP (symmetric distances $d_{ij}=d_{ji}$), the metric TSP (symmetric and with the triangle inequality) and the asymmetric TSP (ATSP, $d_{ij}$ may differ from $d_{ji}$). Which inclusion between the instances is correct?
  1. TSP $\subseteq$ metric $\subseteq$ ATSP
  2. metric $\subseteq$ ATSP $\subseteq$ TSP
  3. metric $\subseteq$ TSP $\subseteq$ ATSP
  4. ATSP $\subseteq$ TSP $\subseteq$ metric
Explanation. Every metric instance is symmetric, and every symmetric instance is an ATSP instance with $d_{ij}=d_{ji}$: the ATSP is the most general case.
oc-f-430 · level facile · notes
A TSP instance is given by an $n\times n$ matrix of distances $d_{ij}$, but the diagonal entries $d_{ii}$ are not used. Why?
  1. Because the tour returns to the start without covering any distance
  2. A tour visits every city once and never goes from a city to itself
  3. Because they are always $0$ and do not change the length
  4. Because by symmetry $d_{ii}=d_{ii}$ carries no information
Explanation. A tour is a permutation $\sigma$: the consecutive pairs $(\sigma_k,\sigma_{k+1})$ and $(\sigma_n,\sigma_1)$ are always distinct cities.
oc-f-431 · level facile · notes
In the symmetric TSP a tour is a permutation $\sigma$ of the $n$ cities read as a closed route. How many different permutations describe the same tour?
  1. $2n$: start and direction
  2. $n$: one per starting city
  3. $2$: one per travel direction
  4. $n!$: all the permutations
Explanation. One can start from any of the $n$ cities and, by symmetry, travel the tour in both directions: $n!/(2n)=(n-1)!/2$ distinct tours.
oc-f-432 · level facile · notes
TSP with $5$ cities and distances $d_{12}=5$, $d_{25}=4$, $d_{35}=7$, $d_{34}=4$, $d_{14}=2$ (symmetric). The length of $\sigma=(\sigma_1,\dots,\sigma_n)$ is $L(\sigma)=\sum_{k=1}^{n-1}d_{\sigma_k\sigma_{k+1}}+d_{\sigma_n\sigma_1}$. What is $L(1,2,5,3,4)$?
  1. $20$
  2. $18$
  3. $24$
  4. $22$
Explanation. $d_{12}+d_{25}+d_{53}+d_{34}+d_{41}=5+4+7+4+2=22$. $20$ forgets the return $d_{41}$ from city $4$ to city $1$.
oc-f-433 · level ipotesi · notes
In the TSP the distances are assumed symmetric, $d_{ij}=d_{ji}$. Under this assumption, how is an instance with $n$ cities represented, and how many numbers are needed?
  1. An $n\times n$ matrix in which all entries are used: $n^2$ numbers
  2. A path touching the cities in order: $n-1$ numbers
  3. A complete undirected graph with one edge $d_{ij}$ per pair: $n(n-1)/2$ numbers
  4. A complete directed graph with one arc per ordered pair: $n(n-1)$ numbers
Explanation. With $d_{ij}=d_{ji}$ one number per unordered pair is enough. In the ATSP, instead, $n(n-1)$ distances are needed, one per ordered pair.
oc-f-434 · level facile · notes
To enumerate the distinct tours of the symmetric TSP one fixes city $1$ as start ($(n-1)!$ sequences $(1,\sigma_2,\dots,\sigma_n)$). Which rule keeps a single tour for every tour/reverse-tour pair?
  1. Keep only the sequences with $\sigma_2=2$
  2. Keep only the sequences with $\sigma_2<\sigma_n$
  3. Keep only the sequences with $\sigma_2<\sigma_3$
  4. Keep only the sequences ending with city $n$
Explanation. The reverse of $(1,\sigma_2,\dots,\sigma_n)$ is $(1,\sigma_n,\dots,\sigma_2)$: it swaps the second and the last city. Exactly one of the two has $\sigma_2<\sigma_n$.
oc-f-435 · level facile · notes
In the symmetric TSP with $n=6$ cities the instance is a complete graph, and a tour is a cycle through all cities. How many edges does a tour use, and how many edges does the complete graph have?
  1. $6$ edges out of $15$
  2. $5$ edges out of $15$
  3. $6$ edges out of $30$
  4. $12$ edges out of $36$
Explanation. A cycle on $n$ vertices has $n$ edges, including the return one; the complete graph has $\binom62=15$. $5$ would be the edges of a path.
oc-f-436 · level facile · notes
In the TSP the nearest neighbour rule builds a tour by always moving to the closest unvisited city. In terms of the bounds of a minimization problem, what does the tour found provide?
  1. A dual bound: a lower bound $\LB\le z(I)$
  2. The optimal value $z(I)$, if there are no ties
  3. No bound: it only serves as a starting point
  4. A primal bound: an upper bound $\UB\ge z(I)$
Explanation. Every tour is a feasible solution, so its length is at least the optimal one. To know how far it is, a lower bound is needed.
oc-f-437 · level teorema · notes
In the symmetric TSP let $a_i\le b_i$ be the two smallest distances from city $i$ to the others; the bound is $\LB=\big\lceil\frac12\sum_i(a_i+b_i)\big\rceil\le z(I)$. When does the bound (without rounding) coincide with the optimal length?
  1. When the distances satisfy the triangle inequality
  2. Never: the bound is always strictly smaller than $z(I)$
  3. When a tour uses at every city its two shortest edges
  4. When all distances between the cities are distinct
Explanation. A tour uses two edges per city, of length at least $a_i+b_i$; the sum counts every edge twice. Equality holds if the tour uses the two minimum edges everywhere.
oc-f-438 · level facile · notes
Asymmetric TSP (ATSP) with $3$ cities: $d_{12}=1$, $d_{23}=2$, $d_{31}=3$, $d_{21}=5$, $d_{32}=4$, $d_{13}=6$ ($d_{ij}$ = distance from $i$ to $j$). How long are the tour $1\to2\to3\to1$ and its reverse $1\to3\to2\to1$?
  1. $6$ and $12$
  2. $6$ and $15$
  3. $6$ and $6$
  4. $15$ and $6$
Explanation. $d_{12}+d_{23}+d_{31}=1+2+3=6$; $d_{13}+d_{32}+d_{21}=6+4+5=15$. In the ATSP a tour and its reverse are different solutions.
oc-f-439 · level facile · notes
The TSP is strongly NP-hard. What does this imply, if $P\neq NP$?
  1. There is no pseudo-polynomial algorithm (polynomial in $n$ and in the distances)
  2. There is no exact algorithm at all for the TSP, not even a slow one
  3. There is a pseudo-polynomial algorithm, as for the knapsack
  4. Instances with more than $20$ cities cannot be solved to optimality
Explanation. A strongly NP-hard problem stays hard even with small numbers. Exact algorithms exist (brute force, branch-and-bound) and solve even huge instances.
oc-f-440 · level facile · notes
The TSP instance pla85900, with $85\,900$ points, was solved to optimality with the Concorde code. What does it show, given that the distinct tours are $(n-1)!/2$?
  1. With fast enough computers all tours can be enumerated
  2. Real instances have only a few feasible tours
  3. The TSP is not NP-hard on geometric instances of this kind
  4. Modern exact algorithms exclude almost all tours without enumerating them
Explanation. $85\,899!/2$ tours cannot be enumerated by any computer; bounds and cuts allow whole families of them to be discarded without examining them.
oc-f-441 · level facile · notes
The optimal tour of pla85900 (length $142\,382\,641$) was «certified» in 2009. What does certifying the optimality of a tour mean in a minimization problem?
  1. Checking that the tour visits every city once
  2. Showing that no exchange of two edges shortens the tour
  3. Exhibiting a lower bound equal to the tour length: zero gap
  4. Repeating the computation with a second code and getting the same tour
Explanation. A tour gives $\UB$; with an $\LB=\UB$ no tour can be shorter. The absence of improving moves gives only a local optimum.

7. Scheduling problems (30)

oc-f-025 · level facile · notes
In scheduling on identical machines $P\,||\,C_{\max}$ one assigns $n$ jobs to $m$ identical machines minimizing the maximum load; a schedule is a partition of the jobs into at most $m$ sets. How many distinct schedules are there with $n=4$ and $m=2$?
  1. $8$
  2. $16$
  3. $7$
  4. $24$
Explanation. There are $m^n=16$ assignments, but renaming the machines gives the same schedule: the partitions are $S(4,1)+S(4,2)=1+7=8$.
oc-f-026 · level teorema · notes
In scheduling $P\,||\,C_{\max}$, $n$ jobs of integer duration $t_j$ are assigned to $m$ identical machines minimizing the makespan (maximum load); let $z(I)$ be the optimal makespan. Which lower bound is valid for every instance?
  1. $z(I)\ge\max_j t_j+\left\lceil\sum_j t_j/m\right\rceil$
  2. $z(I)\ge\min_j t_j+\left\lceil\sum_j t_j/m\right\rceil$
  3. $z(I)\ge\sum_j t_j-\max_j t_j$
  4. $z(I)\ge\max\left\{\max_j t_j,\ \left\lceil\sum_j t_j/m\right\rceil\right\}$
Explanation. The machine of the longest job has load at least $\max_j t_j$, and the maximum load is at least the average $\sum_j t_j/m$, rounded up. The sums are not valid: with $m=2$ and $t=(1,1)$ we have $z(I)=1$; with $m=3$ and $t=(1,1,1)$ we have $z(I)=1<3-1$.
oc-f-027 · level facile · notes
In bin packing (BPP) the items go into bins of capacity $c$; in scheduling $P\,||\,C_{\max}$ the jobs go onto $m$ identical machines. In what sense is one problem the «mirror» of the other?
  1. In both the number of bins (machines) is fixed and the maximum load is minimized; only the names of the data change
  2. In the BPP the number of bins is minimized; $P\,||\,C_{\max}$ is the case of the BPP with a single machine of capacity $c$
  3. In the BPP the capacity is fixed and the number of bins is minimized; in $P\,||\,C_{\max}$ the number of machines is fixed and the maximum load is minimized
  4. In the BPP the number of bins is fixed and the maximum load is minimized; in $P\,||\,C_{\max}$ the capacity is fixed and the number of machines is minimized
Explanation. Jobs and items, machines and bins correspond: in one problem the capacity is fixed, in the other the number of «bins», and the other quantity is optimized.
oc-f-117 · level facile · notes
In the three-field notation $\alpha\,|\,\beta\,|\,\gamma$ of parallel machine scheduling, the field $\alpha$ describes the machines: $P$, $Q$ or $R$. What does $Q\,||\,C_{\max}$ mean?
  1. Machines with different speeds $s_i$: job $j$ takes $t_j/s_i$ on machine $i$
  2. Identical machines: job $j$ takes $t_j$ on every machine
  3. Unrelated machines: job $j$ takes an arbitrary time $t_{ij}$ on machine $i$
  4. A fixed number of identical machines, not part of the input
Explanation. $P$ means identical machines, $Q$ uniform machines with speeds $s_i$ (times $t_j/s_i$), $R$ unrelated machines with arbitrary times $t_{ij}$; $C_{\max}$ in the third field is the makespan to minimize.
oc-f-118 · level facile · notes
In scheduling on identical machines $P\,||\,C_{\max}$ ($n$ jobs, $m$ machines), an assignment says on which machine every job goes. How many assignments are there with $n=5$ jobs and $m=3$ machines?
  1. $125$
  2. $15$
  3. $41$
  4. $243$
Explanation. Every job chooses one of the $3$ machines: $3^5=243$ assignments. Since the machines are identical, many assignments give the same schedule: the distinct schedules are $\sum_{k\le 3}S(5,k)=1+15+25=41$.
oc-f-119 · level facile · notes
In scheduling $P\,||\,C_{\max}$ the machines are identical, so a schedule is a partition of the jobs into at most $m$ sets; $S(n,k)$ is the Stirling number of the second kind (partitions of $n$ elements into $k$ sets). How many distinct schedules are there with $n=5$ and $m=2$?
  1. $15$
  2. $31$
  3. $16$
  4. $32$
Explanation. $S(5,1)+S(5,2)=1+15=16$. The assignments are $2^5=32$; every schedule using two machines corresponds to two assignments, and so does the one using a single machine ($1+15$ partitions).
oc-f-120 · level facile · notes
In scheduling $P\,||\,C_{\max}$ the load of a machine is the sum of the processing times of its jobs and the makespan is the largest load. Times $t=(5,3,4,2,6)$ on $m=3$ machines, with jobs $\{1,2\}$, $\{3,4\}$, $\{5\}$. What is the makespan?
  1. $6$
  2. $8$
  3. $20$
  4. $7$
Explanation. The loads are $5+3=8$, $4+2=6$ and $6$: the makespan is $8$. $20$ is the total load, $7=\lceil 20/3\rceil$ is the average lower bound, not the makespan of this schedule.
oc-f-121 · level teorema · notes
In scheduling $P\,||\,C_{\max}$ ($m=2$ identical machines) the processing times are $t=(4,4,3,3,2)$. The schedule $\{4,4\}$, $\{3,3,2\}$ has makespan $8$. What can be concluded with the lower bound $\max\{\max_j t_j,\lceil\sum_j t_j/m\rceil\}$?
  1. The bound is $8$, hence the schedule is optimal
  2. The bound is $4$, hence the schedule can be improved
  3. The bound is $8$, but a bound never proves optimality
  4. The bound is $16$, hence the schedule is infeasible
Explanation. $\sum_j t_j=16$ and $\lceil 16/2\rceil=8\ge\max_j t_j=4$: the bound is $8$. A schedule whose makespan equals a lower bound is optimal.
oc-f-122 · level facile · notes
In scheduling $P\,||\,C_{\max}$ with $m=2$ machines, every job is assigned, in the given order, to the least loaded machine (ties: the one with smaller index). Processing times in order $t=(3,5,2,4,6)$. Which makespan is obtained?
  1. $10$
  2. $9$
  3. $12$
  4. $11$
Explanation. Loads: $(3,0)\to(3,5)\to(5,5)\to(9,5)\to(9,11)$: makespan $11$. The schedule $\{6,4\}$, $\{5,3,2\}$ has makespan $10=\lceil 20/2\rceil$, so the rule does not give the optimum.
oc-f-123 · level facile · notes
Bin packing (BPP) asks for the minimum number of bins of capacity $C$; scheduling $P\,||\,C_{\max}$ asks for the minimum makespan with $m$ machines. How does the question «is there a schedule with makespan at most $C$?» read in bin packing terms?
  1. Is the weight bound $\lceil\sum_j t_j/C\rceil$ at most $C$?
  2. Is there a bin of capacity $C$ containing all the items?
  3. Do the items of weight $t_j$ fit into $m$ bins of capacity $C$?
  4. Do the items of weight $t_j$ fit into $C$ bins of capacity $m$?
Explanation. The machines are the bins, the makespan is the capacity: a schedule with makespan at most $C$ exists if and only if the jobs fit into $m$ bins of capacity $C$. In the BPP the capacity is fixed, in $P\,||\,C_{\max}$ the number of bins.
oc-f-124 · level teorema · notes
In scheduling $P\,||\,C_{\max}$, the lower bound $\mathrm{LB}=\max\{\max_j t_j,\lceil\sum_j t_j/m\rceil\}$ is always valid. With $m=2$ machines and three jobs of processing time $t=(2,2,2)$, what are $\mathrm{LB}$ and the optimal makespan $z(I)$?
  1. $\mathrm{LB}=4$ and $z(I)=4$: the bound rounds up to a multiple of $t_j$
  2. $\mathrm{LB}=3$ and $z(I)=4$: the bound is not always attained
  3. $\mathrm{LB}=3$ and $z(I)=3$: the bound is always attained
  4. $\mathrm{LB}=2$ and $z(I)=4$: the bound is the longest job
Explanation. $\lceil 6/2\rceil=3>2$, hence $\mathrm{LB}=3$; but jobs cannot be split, and one machine gets at least two jobs: $z(I)=4$. The bound is valid but not always attained.
oc-f-125 · level facile · notes
In parallel machine scheduling, what distinguishes $R\,||\,C_{\max}$ (unrelated machines) from $P\,||\,C_{\max}$ (identical machines)?
  1. In $R\,||\,C_{\max}$ the time $t_{ij}$ of job $j$ depends on machine $i$ arbitrarily
  2. In $R\,||\,C_{\max}$ the machines have speeds $s_i$ and job $j$ takes $t_j/s_i$
  3. In $R\,||\,C_{\max}$ the number of machines is fixed and not part of the input
  4. In $R\,||\,C_{\max}$ jobs can be interrupted and resumed on another machine
Explanation. $R$ means unrelated machines, with arbitrary times $t_{ij}$; the speeds $s_i$ are the case $Q$, and $P$ is the case $t_{ij}=t_j$ for every machine.
oc-f-283 · level facile · notes
In the three-field notation of parallel machine scheduling, what distinguishes $R\,||\,C_{\max}$ from $P\,||\,C_{\max}$?
  1. In $R$ the sum of the completion times is minimized
  2. In $R$ every job can be split among several machines
  3. In $R$ job $j$ requires a time $t_{jh}$ depending on the machine $h$; in $P$ it requires $t_j$ on every machine
  4. In $R$ the machines have different but proportional speeds
Explanation. $P$: identical machines; $Q$: machines with different speeds; $R$: unrelated times, arbitrary for every job-machine pair. The third field $C_{\max}$ is the same.
oc-f-284 · level ipotesi · notes
In $P\,||\,C_{\max}$ ($n$ jobs of duration $t_j$ on $m$ identical machines, the makespan is minimized) one assumes $n>m$. What happens if $n\le m$?
  1. The optimal makespan is $\sum_j t_j$
  2. Every job has a machine of its own and the optimal makespan is $\max_j t_j$
  3. The instance is infeasible
  4. The optimal makespan is $\sum_j t_j/m$
Explanation. With enough machines no job waits, and no solution does better than the longest job: the problem is trivial.
oc-f-285 · level facile · notes
Graham proved that greedy scheduling of any list of jobs on $m$ identical machines gives a makespan at most $2-\frac1m$ times the optimum, and the list sorted by non-increasing duration (LPT) at most $\frac43-\frac1{3m}$ times. What are the two ratios for $m=3$?
  1. $\frac53$ and $\frac{11}9$
  2. $\frac53$ and $\frac43$
  3. $2$ and $\frac43$
  4. $\frac32$ and $\frac{11}9$
Explanation. $2-\frac13=\frac53$ and $\frac43-\frac19=\frac{11}9$. The ratios without the term in $m$ are the limits for $m\to\infty$.
oc-f-442 · level facile · notes
In parallel machine scheduling the makespan $C_{\max}=\max_h L_h$ is minimized, where the load $L_h$ is the sum of the times of the jobs of machine $h$. Why does minimizing $C_{\max}$ push towards balancing the loads?
  1. Because every machine must receive the same number of jobs
  2. Because the makespan coincides with the average load of the machines
  3. Because with identical machines the loads are always all equal
  4. The sum of the loads is fixed: the maximum is low only if they are close
Explanation. Every schedule has $\sum_h L_h=\sum_j t_j$, hence $\max_h L_h\ge\sum_j t_j/m$, with equality only for equal loads. The number of jobs per machine does not matter.
oc-f-443 · level facile · notes
In $P\,||\,C_{\max}$ the jobs assigned to a machine are processed one after the other, without idle time. Does the order of the jobs on the same machine change the makespan?
  1. Yes: it pays to process the shortest jobs first
  2. It depends on the number of available machines $m$
  3. No: the load is the sum of the times, in any order
  4. Yes: it pays to process the longest jobs first
Explanation. A solution is just an assignment: machine $h$ finishes at time $L_h=\sum_{j\in J_h}t_j$. The order matters for other objectives, such as $\sum_j C_j$.
oc-f-444 · level facile · notes
In the three-field notation $\alpha\,|\,\beta\,|\,\gamma$ of scheduling ($\alpha$ = machines, $\beta$ = job characteristics, $\gamma$ = objective), which problem does $1\,|\,prec\,|\,\sum_j C_j$ denote?
  1. A single machine, no constraints, sum of tardiness
  2. A single machine, precedence constraints, sum of completion times
  3. One machine per job, precedence constraints, makespan
  4. Identical machines, release dates, sum of completion times
Explanation. $\alpha=1$: one machine; $\beta=prec$: precedences among the jobs; $\gamma=\sum_jC_j$: sum of completion times. The makespan would be $C_{\max}$.
oc-f-445 · level facile · notes
$P\,||\,C_{\max}$ with $m=3$ machines and times $t=(5,5,4,4,3,3,3)$. Which makespan does the assignment $\mathrm{mach}=(1,2,3,1,2,3,3)$ ($\mathrm{mach}_j$ = machine of job $j$) have?
  1. $10$
  2. $9$
  3. $8$
  4. $27$
Explanation. $J_1=\{1,4\}$: $9$; $J_2=\{2,5\}$: $8$; $J_3=\{3,6,7\}$: $4+3+3=10$. The makespan is the maximum load, $10$; $9=\lceil27/3\rceil$ is the lower bound.
oc-f-446 · level ipotesi · notes
In $P\,||\,C_{\max}$ one assumes $n>m$. In the limit case $n=m+1$ ($m=3$ machines, times $t=(7,6,2,3)$), what is the optimal makespan?
  1. $13$: the two longest jobs on the same machine
  2. $9$: the longest job together with a short one
  3. $6$: the average $\sum_j t_j/m$ of the loads
  4. $7$: the two shortest jobs together
Explanation. With $m+1$ jobs one machine gets two of them: it pays to pair the shortest ones ($2+3=5$); the makespan is $\max\{7,6,5\}=7$, equal to the lower bound $\max_j t_j$.
oc-f-447 · level ipotesi · notes
In $P\,||\,C_{\max}$ ($n$ jobs, $m$ identical machines) one assumes $n>m$. Why, under this assumption, does at least one machine process at least two jobs in every schedule?
  1. Because every machine must receive at least one job
  2. It is not true: a machine may stay empty
  3. By the pigeonhole principle: $n>m$ jobs on $m$ machines
  4. Because the optimal makespan always exceeds $\max_j t_j$
Explanation. If every machine had at most one job, there would be at most $m<n$ jobs. The optimal makespan may still equal $\max_j t_j$.
oc-f-448 · level teorema · notes
In $P\,||\,C_{\max}$ with $m=3$ identical machines, two optimal schedules (partitions of the jobs into $3$ non-empty sets) correspond to $12$ of the $3^n$ assignments $\mathrm{mach}$ (job $\to$ machine). Why $12$?
  1. Every schedule gives $6$ assignments, one per order of the jobs
  2. Every schedule with $3$ non-empty machines gives $3!=6$ assignments, renaming the machines
  3. Every schedule gives $3$ assignments, one per most loaded machine
  4. Every schedule gives $2^3$ assignments, one per subset of machines
Explanation. The $3!$ permutations of the machine labels give different assignments of the same schedule: $2\cdot6=12$.
oc-f-449 · level facile · notes
In $P\,||\,C_{\max}$ ($m=3$, times $t=(5,5,4,4,3,3,3)$) every job, in the given order, is assigned to the least loaded machine, obtaining makespan $11$. What does this first schedule by hand show?
  1. An upper bound, without knowing how far from optimal it is
  2. It proves that the optimal makespan is exactly $11$
  3. It shows that the optimal makespan is at least $11$
  4. It shows that the least loaded machine is always the optimal choice
Explanation. A feasible schedule bounds the optimum from above ($z(I)\le11$). The lower bound $\max\{5,\lceil27/3\rceil\}=9$ leaves a gap, and the optimal schedule has makespan $9$.
oc-f-450 · level teorema · notes
In $P\,||\,C_{\max}$ (integer times $t_j$, $m$ machines) the lower bound contains $\lceil\sum_j t_j/m\rceil$ instead of the average $\sum_j t_j/m$. Why can it be rounded up?
  1. Because the average of the loads is always an integer
  2. Because every machine always receives at least one job
  3. Because $\max_j t_j$ is an integer number as well
  4. The maximum load is at least the average and is an integer
Explanation. The makespan is a sum of integer times, hence an integer, and an integer not smaller than a real number $x$ is not smaller than $\lceil x\rceil$.
oc-f-451 · level facile · notes
Bin packing (BPP) and scheduling $P\,||\,C_{\max}$ put items/jobs into bins/machines. Which quantities do they fix and which do they minimize?
  1. Both fix the capacity and minimize the number of bins or machines
  2. Both fix the number of bins or machines and minimize the load
  3. BPP: fixes capacity, minimizes bins; $P\,||\,C_{\max}$: fixes machines, minimizes the maximum load
  4. BPP: fixes the bins and minimizes the capacity; $P\,||\,C_{\max}$: fixes the load and minimizes the machines
Explanation. The two problems swap what is given and what is optimized: the machines are bins of capacity $T$, and $T$ is the makespan to be minimized.
oc-f-452 · level facile · notes
In $P\,||\,C_{\max}$ there is a schedule with makespan at most $T$ if and only if the jobs (items of weight $t_j$) fit into $m$ bins of capacity $T$. With $m=2$ and $t=(6,5,4,3,2)$, what is the minimum $T$ for which they fit, i.e., the optimal makespan?
  1. $6$
  2. $10$
  3. $11$
  4. $20$
Explanation. $\lceil20/2\rceil=10$ is a lower bound, and $\{6,4\}$, $\{5,3,2\}$ fill two bins of capacity $10$: the minimum is $10$.
oc-f-453 · level teorema · notes
In $P\,||\,C_{\max}$ with $m=3$ machines, it is known that the jobs, as items of weight $t_j$, need at least $4$ bins of capacity $12$ in bin packing. What follows for the optimal makespan $z(I)$?
  1. No schedule has makespan $\le12$, so $z(I)\ge13$
  2. $z(I)=12$, because the capacity equals the makespan
  3. $z(I)\le12$, because $4$ bins suffice
  4. $z(I)\ge16=4\cdot12/3$
Explanation. Makespan $\le12$ on $3$ machines is equivalent to fitting into $3$ bins of capacity $12$, impossible if $4$ are needed. With integer times $z(I)\ge13$ follows.
oc-f-454 · level facile · notes
Graham (1966): processing any list of jobs greedily (every job to the least loaded machine) on $m$ identical machines, the makespan is at most $(2-\frac1m)$ times the optimum. With $m=3$ and optimal makespan $9$, how large can the greedy makespan be at most?
  1. $18$
  2. $12$
  3. $13$
  4. $15$
Explanation. $(2-\frac13)\cdot9=\frac53\cdot9=15$. $18$ uses ratio $2$; $12=\frac43\cdot9$ confuses it with the guarantee of the LPT rule.
oc-f-455 · level facile · notes
Graham (1969): the LPT rule (list sorted by non-increasing processing time, every job to the least loaded machine) has ratio $\frac43-\frac1{3m}$ on $m$ identical machines. What is the ratio with $m=2$?
  1. $\frac43$
  2. $\frac{11}{9}$
  3. $\frac76$
  4. $\frac32$
Explanation. $\frac43-\frac16=\frac86-\frac16=\frac76$. $\frac32=2-\frac12$ is the ratio of an arbitrary list with $m=2$; $\frac{11}9$ is LPT with $m=3$.
oc-f-456 · level teorema · notes
For $P\,||\,C_{\max}$ greedy on an arbitrary list has ratio $2-\frac1m$ and the LPT rule $\frac43-\frac1{3m}$. What happens to the two ratios when the number $m$ of machines grows?
  1. They stay constant, since they do not depend on $m$
  2. They grow towards $2$ and towards $\frac43$
  3. Both decrease towards $1$
  4. Both grow towards $2$
Explanation. The subtracted terms $\frac1m$ and $\frac1{3m}$ tend to $0$: the guarantees get worse with $m$, but stay below $2$ and below $\frac43$.

8. Lot sizing problems (43)

oc-f-028 · level facile · notes
Capacitated lot sizing (CLS): $5$ periods, production capacities $cap=(40,30,30,20,30)$, total demand $D=110$, setup costs $sc=(50,60,40,70,55)$ ($sc_t$ is paid if production occurs in period $t$). The combinatorial lower bound sums the $k$ smallest setup costs, where $k$ is the minimum number of periods whose capacities cover $D$. What is its value?
  1. $235$
  2. $275$
  3. $205$
  4. $145$
Explanation. The largest capacities give $40+30+30=100<110$ and $40+30+30+30=130\ge 110$: at least $k=4$ setups are needed. The $4$ smallest setup costs sum to $40+50+55+60=205$.
oc-f-029 · level facile · notes
In capacitated lot sizing (CLS) every period $t\in T$ has demand $d_t$, production capacity $cap_t$, setup cost $sc_t$ and final inventory $s_t$. What is uncapacitated lot sizing (ULS)?
  1. The CLS with a single period, i.e., $T=\{1\}$ and capacity $cap_1\ge d_1$
  2. The CLS in which the capacities are not binding, e.g., $cap_t\ge\sum_{u\in T}d_u$ for every $t$
  3. The CLS in which setups are free, i.e., $sc_t=0$ for every period $t\in T$
  4. The CLS in which inventory is forbidden, i.e., $s_t=0$ for every period $t\in T$
Explanation. In the ULS every period can produce as much as it wants; setup, variable and holding costs remain.
oc-f-030 · level facile · notes
In lot sizing (demand $d_t$, production $x_t$ and final inventory $s_t$ in every period $t$; the setup is paid when $x_t>0$), which statement is correct?
  1. Without capacities some optimal plan produces only with zero incoming inventory; with capacities it may not exist
  2. With or without capacities some optimal plan produces only with zero incoming inventory
  3. Without capacities every optimal plan produces in all periods with positive demand; with capacities not
  4. With or without capacities the production of a period can cover the demand of an earlier period
Explanation. The Wagner-Whitin property (zero-inventory ordering) holds without capacities; with capacities there are instances in which every optimal plan produces with positive inventory. Production never covers past demand.
oc-f-108 · level ipotesi · notes
In capacitated lot sizing (CLS: periods $t$ with demand $d_t$, capacity $cap_t$, setup cost $sc_t$ paid if we produce in $t$; zero initial stock), let $D=\sum_t d_t$. Why does every feasible plan have at least $k$ setups, with $k$ the minimum number of periods whose capacities cover $D$?
  1. Setup costs are positive, so an optimal plan uses the $k$ cheapest setup periods
  2. The final stock must be zero, so we produce exactly $d_t$ in every period with a setup
  3. We produce only in periods with a setup, at most $cap_t$ in each, and the total production must cover $D$
  4. Every period with positive demand needs a setup, and the periods with demand are at least $k$
Explanation. Without initial stock the total production is at least $D$, and the setup periods produce at most the sum of their capacities; hence at least $k$ setup periods are needed. The bound then adds the $k$ smallest setup costs.
oc-f-109 · level teorema · notes
In capacitated lot sizing (CLS), the combinatorial lower bound adds the $k$ smallest setup costs, where $k$ is the minimum number of periods whose capacities $cap_t$ cover the total demand $D$. How is $k$ computed?
  1. As $\lceil D/\min_t cap_t\rceil$, the number of periods with the minimum capacity needed
  2. Sorting the capacities in non-increasing order: $k$ is the smallest number of largest capacities summing to at least $D$
  3. Sorting the capacities in non-decreasing order: $k$ is the smallest number of smallest capacities summing to at least $D$
  4. Sorting the setup costs in non-decreasing order and adding the capacities of those periods until they cover $D$
Explanation. To get the minimum number of periods one takes the largest capacities. The bound is valid because every plan has at least $k$ setups, whose cost is at least the sum of the $k$ smallest costs, even if in different periods.
oc-f-110 · level facile · notes
In capacitated lot sizing (CLS) over $m$ periods, the combinatorial part of the decision is the choice of the setup periods (those in which we produce). With $m=6$ periods, how many choices are there, before checking the capacities?
  1. $64$
  2. $720$
  3. $36$
  4. $63$
Explanation. Every period has a setup or not: $2^6=64$ subsets. Only some of them are feasible, and each can carry many different production plans.
oc-f-111 · level facile · notes
Lot sizing over $3$ periods: demands $d=(3,2,4)$, setup cost $50$ in every period with production, cost $10$ per unit of stock at the end of a period, zero variable cost, non-binding capacities. What is the cost of the plan $x=(5,0,4)$, which produces in period $1$ also the demand of period $2$?
  1. $150$
  2. $100$
  3. $140$
  4. $120$
Explanation. Two setups ($100$) and a stock of $2$ units at the end of period $1$ ($20$): total $120$. The lot-for-lot plan $(3,2,4)$ costs $150$, with three setups and no stock.
oc-f-112 · level facile · notes
In capacitated lot sizing (CLS) the stock at the end of a period is $s_t=\sum_{u\le t}(x_u-d_u)$ (zero initial stock) and must be non-negative. With demands $d=(3,2,4)$ and capacity $5$ in every period, which plan $x$ is feasible?
  1. $x=(6,0,3)$
  2. $x=(3,2,3)$
  3. $x=(3,4,2)$
  4. $x=(2,3,4)$
Explanation. $(3,4,2)$ gives stocks $(0,2,0)$. $(2,3,4)$ has $s_1=-1$ (it produces late), $(6,0,3)$ exceeds the capacity $5$, $(3,2,3)$ leaves one unit of period $3$ uncovered.
oc-f-113 · level facile · notes
Lot sizing over $3$ periods with demands $d=(2,2,2)$, setup cost $sc_t=10$, variable cost $vc_t=1$ per unit produced and holding cost $hc_t=2$ per unit of stock at the end of a period. What is the cost of the plan $x=(4,0,2)$?
  1. $36$
  2. $30$
  3. $26$
  4. $34$
Explanation. Setups in periods $1$ and $3$: $20$; production of $6$ units: $6$; stocks $(2,0,0)$: $4$. Total $30$. Forgetting the stock gives $26$, charging a setup also in period $2$ gives $40$.
oc-f-114 · level facile · notes
In lot sizing with unsatisfied demand (LS-UD), part of the demand $d_{pt}$ of product $p$ in period $t$ may be left unsatisfied, at a penalty $cu_{pt}$ per unit. When is it convenient to leave a unit unsatisfied?
  1. When the penalty $cu_{pt}$ is lower than the cost of producing and holding that unit
  2. Never: the demand must always be met, the penalty only measures the service level
  3. When the penalty $cu_{pt}$ is higher than the cost of producing and holding that unit
  4. Only in the last period, because its demand creates no stock
Explanation. The model compares the penalty with the cost of serving the unit: if serving it costs more (setup, production, stock), paying $cu_{pt}$ is cheaper.
oc-f-115 · level facile · notes
In lot sizing with several products and setup times (MLS), the products $p\in P$ share the time $cap_t$ available in period $t$; a unit of $p$ takes $vt_{pt}$ units of time, and the setup of $p$ has a cost and a setup time. What changes with respect to the single-product CLS?
  1. Setups have no cost: only the production time $vt_{pt}$ is paid
  2. Every product has its own capacity, so the products are independent problems
  3. The demands of the products add up and the problem becomes a single-product CLS
  4. Setups consume capacity: more setups in a period leave less time for production
Explanation. With setup times the capacity of a period is shared by production and setups of the products: the products are not independent, and opening a setup also costs time.
oc-f-116 · level facile · notes
In lot sizing with overtime (LS-OT) normal working time costs $cw_t$ per unit up to $cap^{N}_t$ and overtime costs $co_t$ per unit up to $cap^{O}_t$, with $co_t>cw_t$. How much can be produced at most in period $t$, and when is overtime used?
  1. Up to $\max\{cap^{N}_t,cap^{O}_t\}$; only one of the two modes is chosen
  2. Without limit; overtime is paid only above the demand of the period
  3. Up to $cap^{N}_t+cap^{O}_t$; overtime only after normal time is used up
  4. Up to $cap^{N}_t$; overtime replaces normal time when it is cheaper
Explanation. The capacity is not fixed: it reaches $cap^{N}_t+cap^{O}_t$. Since overtime is more expensive, an optimal plan uses it only when normal time is exhausted.
oc-f-286 · level facile · notes
In lot sizing problems every period $t$ has demand $d_t$, setup cost $sc_t$, variable cost $vc_t$ and holding cost $hc_t$. Which trade-off must a production plan balance?
  1. Few setups (producing in advance) against little inventory (producing close to the demand)
  2. Maximum production against maximum demand
  3. Number of products against number of periods
  4. Capacity against variable cost, independently of the inventory
Explanation. Producing for several periods in a single setup saves $sc_t$ but keeps goods in stock paying $hc_t$; producing in every period does the opposite.
oc-f-287 · level facile · notes
In the lot sizing family, what do the variants LS-OT (overtime) and LS-UD (unmet demand) add to capacitated lot sizing (CLS)?
  1. LS-OT: several products; LS-UD: initial inventory
  2. LS-OT: no capacity; LS-UD: setup times
  3. LS-OT: backlogged demand at no cost; LS-UD: infinite capacity
  4. LS-OT: extra capacity at a higher cost; LS-UD: part of the demand lost with a penalty
Explanation. Both relax a constraint by paying a cost: overtime increases the capacity, unmet demand gives up part of the demand.
oc-f-288 · level ipotesi · notes
In capacitated lot sizing (CLS: demands $d_t$, capacities $cap_t$, zero initial inventory) one assumes $\sum_{u=1}^{t}cap_u\ge\sum_{u=1}^{t}d_u$ for every $t$. Why is the condition cumulative and not $cap_t\ge d_t$ period by period?
  1. Because unmet demand is recovered later
  2. Because the condition $cap_t\ge d_t$ always holds
  3. Because the demand of a period can also be covered by the production of earlier periods, kept in stock
  4. Because capacities can be moved to later periods
Explanation. With $d=(0,10)$ and $cap=(10,5)$ one has $cap_2<d_2$, but producing $10$ in period $1$ the plan is feasible. Production cannot come after the demand, however, so the sums up to every $t$ are needed.
oc-f-289 · level ipotesi · notes
In capacitated lot sizing (CLS) one assumes that the produced quantities are integer. With integer data, why does this assumption not change the optimal cost?
  1. Because the demands are all equal
  2. Once the setup periods are fixed, a min-cost flow problem remains, which has an integer optimal solution
  3. Because fractional quantities always cost more
  4. Because the setup cost is paid only for integer quantities
Explanation. With the setups fixed the residual problem has a network flow matrix, totally unimodular: with integer data an integer optimum exists.
oc-f-290 · level facile · notes
How are the variants of capacitated lot sizing (ULS, MLS, LS-SI, LS-OT, LS-UD) built with respect to the CLS?
  1. They keep the CLS data (periods, demands, costs) and change a single feature
  2. They are problems with completely different data
  3. They remove the setup costs
  4. They all add a second product
Explanation. Every definition reports only what changes: for instance the ULS removes the capacities, the MLS adds products sharing the time.
oc-f-291 · level facile · notes
In lot sizing with initial inventory (LS-SI) the quantity $si_p$ of product $p$ available at the start of the horizon is a decision, at cost $fc_p$ per unit. How does it differ from the CLS?
  1. In the LS-SI the final inventory must be positive
  2. In the LS-SI there are no setup costs
  3. In the LS-SI the initial inventory is a fixed datum
  4. In the CLS the initial inventory is fixed to zero; in the LS-SI it can be bought and pays $fc_p$ per unit
Explanation. The CLS assumes empty inventory at the start and at the end; the LS-SI turns the initial inventory into a variable with a unit cost.
oc-f-292 · level ipotesi · notes
Wagner and Whitin (1958) used a property of the optimal plans of uncapacitated lot sizing (ULS): one produces only when the inventory is empty. Why does the property fail in capacitated lot sizing (CLS)?
  1. Because in the CLS the final inventory is positive
  2. The property also holds in the CLS
  3. A low capacity may force production in advance, while there is still inventory
  4. Because in the CLS the setup costs are zero
Explanation. With $cap_t<d_t$ part of the demand of period $t$ must be produced earlier, even if the warehouse is not empty. Without the property the CLS is NP-hard.
oc-f-457 · level facile · notes
In lot sizing problems ($m$ periods, demand $d_t$, zero initial stock) a solution is a production plan $\vet{x}=(x_1,\dots,x_m)$. Once the quantities $x_t$ are fixed, what is determined?
  1. Nothing: demands and capacities must still be chosen
  2. The end-of-period stocks $s_t$ and the periods with a setup
  3. Only the periods with a setup; the stocks are free
  4. Only the stocks; the setups are chosen separately
Explanation. $s_t=\sum_{u\le t}(x_u-d_u)$ and there is a setup in $t$ if and only if $x_t>0$: the plan $\vet{x}$ determines the whole cost.
oc-f-458 · level facile · notes
In lot sizing problems every period $t$ has a holding cost $hc_t$. To which quantity does it apply?
  1. To the units in stock at the end of period $t$
  2. To the units produced in period $t$
  3. To the demand of period $t$
  4. To the average stock between the start and the end of period $t$
Explanation. The cost of a plan contains $\sum_t hc_t\,s_t(\vet{x})$, with $s_t$ the end-of-period stock; it is paid also in periods without production.
oc-f-459 · level facile · notes
Capacitated lot sizing over $4$ periods: demands $d=(2,3,1,2)$, capacity $5$ per period, zero initial stock. A plan $\vet{x}$ is feasible if $x_t\le 5$, the stocks $s_t=\sum_{u\le t}(x_u-d_u)$ are non-negative and $s_4=0$. Which plan is feasible?
  1. $(4,0,4,0)$
  2. $(2,0,6,0)$
  3. $(3,3,1,2)$
  4. $(2,4,0,2)$
Explanation. $(2,4,0,2)$ has stocks $(0,1,0,0)$. $(4,0,4,0)$ has $s_2=-1$ (it produces late); $(2,0,6,0)$ exceeds the capacity; $(3,3,1,2)$ leaves $s_4=1$.
oc-f-460 · level ipotesi · notes
In capacitated lot sizing (CLS) the stock at the end of the horizon is assumed to be zero, $s_m=0$. Why does the assumption not exclude optimal plans, with non-negative costs?
  1. Because a positive final stock violates the capacities
  2. Because the final stock is sold back at production cost
  3. Removing the leftover units at the end never increases the cost
  4. Because the demand of the last period is always the largest
Explanation. Producing units that nobody asks for adds variable and holding cost (and possibly setups): reducing them gives a plan that is not more expensive.
oc-f-461 · level facile · notes
In a capacitated lot sizing instance with $5$ periods, $8$ of the $32$ subsets of setup periods are feasible, but there are $94$ feasible plans. Why are the plans more than the setup choices?
  1. Because every plan is counted once per ordering of the periods
  2. For a setup choice the quantities can be distributed in several ways
  3. Because some plans have setups in periods without production
  4. Because the plans also count the infeasible setup choices
Explanation. Once the setup periods are fixed, how much to produce in each of them (respecting capacities and non-negative stocks) often leaves several choices.
oc-f-462 · level teorema · notes
In uncapacitated lot sizing ($m$ periods, zero initial stock, $d_t\ge1$) the plans that produce only when the stock is empty are $2^{m-1}$. Why $2^{m-1}$ and not $2^m$?
  1. Period $1$ must have a setup; the other $m-1$ are free
  2. The last period can never have a setup
  3. Half of the subsets of periods are infeasible because of the capacities
  4. Every plan is counted twice, once per direction
Explanation. With zero initial stock and $d_1\ge1$ one must produce in period $1$. Once the other setup periods are chosen, each one produces the demand up to the next setup.
oc-f-463 · level facile · notes
Capacitated lot sizing with capacity $4$ in every period and cumulative demands $D_t=\sum_{u\le t}d_u=(2,3,6,10,11)$. How many setups are needed at least in the first $4$ periods?
  1. $2$
  2. $4$
  3. $1$
  4. $3$
Explanation. In the first $4$ periods at least $10$ units must be produced, and every setup gives at most $4$: $\lceil10/4\rceil=3$ setups are needed.
oc-f-464 · level facile · notes
In lot sizing a plan is improved by merging: the demand $d_t$ of period $t$ is produced in period $t-1$ (which already has a setup), removing the setup of period $t$. With constant variable cost, when does it pay off?
  1. Always, because setups cost more than stocks
  2. When the holding cost $hc_{t-1}\,d_t$ exceeds the setup $sc_t$
  3. When the setup cost $sc_t$ exceeds the holding cost $hc_{t-1}\,d_t$
  4. When the demand $d_t$ exceeds the demand $d_{t-1}$
Explanation. One saves $sc_t$ and pays the stock of the $d_t$ anticipated units for one period; enough capacity in period $t-1$ is also needed.
oc-f-465 · level teorema · notes
In capacitated lot sizing the lower bound sums the $k$ smallest setup costs. If there are also variable costs $vc_t\ge0$, which term can be added keeping a valid bound ($D=\sum_t d_t$, zero initial and final stock)?
  1. $\sum_t vc_t\,cap_t$
  2. $D\cdot\min_t vc_t$
  3. $D\cdot\max_t vc_t$
  4. $\sum_t vc_t\,d_t$
Explanation. Every plan produces exactly $D$ units, each at a cost of at least $\min_t vc_t$. $\sum_t vc_t d_t$ is the variable cost of lot-for-lot: a plan anticipating production into cheaper periods spends less.
oc-f-466 · level facile · notes
Among the variants of capacitated lot sizing (ULS uncapacitated, MLS multi-product, LS-SI with initial stock, LS-OT with overtime, LS-UD with unmet demand), which one is solved in polynomial time?
  1. ULS
  2. MLS
  3. LS-OT
  4. LS-UD
Explanation. Without capacities the Wagner-Whitin property holds and dynamic programming solves the problem in polynomial time; with capacities the problem is NP-hard.
oc-f-467 · level facile · notes
The variants of capacitated lot sizing change one feature of the problem. Which variant removes a constraint instead of adding decisions?
  1. Lot sizing with initial stock (LS-SI)
  2. Lot sizing with overtime (LS-OT)
  3. Lot sizing with unmet demand (LS-UD)
  4. Uncapacitated lot sizing (ULS)
Explanation. The ULS makes the capacities non-binding. LS-SI decides the initial stock, LS-OT the overtime hours, LS-UD the demand not to serve.
oc-f-468 · level teorema · notes
Uncapacitated lot sizing (ULS) is the CLS with, for instance, $cap_t\ge\sum_{u\in T}d_u$ for every period. Why does this condition make the capacities non-binding (zero initial and final stock)?
  1. Because the stock can never exceed the capacity
  2. Because the setup costs become zero
  3. No feasible plan produces in a period more than the total demand
  4. Because every period must produce at least the total demand
Explanation. With $s_m=0$ the total production is $\sum_u d_u$, so $x_t\le\sum_u d_u\le cap_t$ in every plan: the constraint $x_t\le cap_t$ cuts nothing.
oc-f-469 · level facile · notes
In uncapacitated lot sizing there are optimal plans producing only when the stock is empty (Wagner-Whitin property). With demands $d=(2,3,1,2)$ and zero initial stock, which plan has this property?
  1. $(3,2,1,2)$
  2. $(5,0,3,0)$
  3. $(4,1,3,0)$
  4. $(5,0,2,1)$
Explanation. In $(5,0,3,0)$ production happens in $1$ and $3$, with stock $0$ at the start of both. In $(4,1,3,0)$ one produces in $2$ with stock $2$; in $(5,0,2,1)$ in $4$ with stock $1$; in $(3,2,1,2)$ in $2$ with stock $1$.
oc-f-470 · level facile · notes
In multi-product lot sizing with setup times (MLS) the products share the time $cap_t$ of the period, and every setup of product $p$ consumes $st_{pt}$ time units. What effect do the setup times have on the decisions?
  1. Every setup takes time: fewer setups and larger lots pay off
  2. None: the setup time just adds to the setup cost
  3. They reduce the variable cost of every unit produced
  4. They force producing every product in every period
Explanation. Besides costing $sc_{pt}$, a setup consumes capacity; fewer setups leave more time for production, at the price of more stock.
oc-f-471 · level facile · notes
Multi-product lot sizing with setup times (MLS): in a period with available time $cap_t=20$ one produces $5$ units of product $A$ ($1$ time unit each, setup of $3$) and $2$ units of product $B$ ($2$ time units each, setup of $4$). How much time is used?
  1. $9$
  2. $7$
  3. $12$
  4. $16$
Explanation. $A$: $5\cdot1+3=8$; $B$: $2\cdot2+4=8$; total $16\le20$. $9$ counts only production, $7$ only setups.
oc-f-472 · level facile · notes
In lot sizing with initial stock (LS-SI) the quantity $si_p$ of product $p$ available at the start is a decision, at cost $fc_p$ per unit. What does the stock at the end of period $t$ become ($x_{pu}$ production, $d_{pu}$ demand)?
  1. $s_{pt}=si_p\cdot\sum_{u\le t}(x_{pu}-d_{pu})$
  2. $s_{pt}=\sum_{u\le t}(x_{pu}-d_{pu})$, with $si_p$ only in the cost
  3. $s_{pt}=si_p+\sum_{u\le t}(x_{pu}-d_{pu})$
  4. $s_{pt}=\sum_{u\le t}(x_{pu}-d_{pu})-si_p$
Explanation. The initial stock adds to what is produced: the cumulative balance starts from $si_p$ instead of $0$.
oc-f-473 · level facile · notes
In lot sizing with initial stock (LS-SI) the initial stock $si_p$ is bought at cost $fc_p$ per unit. If $fc_p$ is enormously larger than every setup, production and holding cost, what does an optimal plan do?
  1. No feasible plan exists for that product
  2. It sets $si_p=0$, as in the problem without initial stock
  3. It buys the whole demand of the horizon as initial stock
  4. It buys only the demand of period $1$ as initial stock
Explanation. Every bought unit costs more than any way of producing it, and producing is always possible under the capacity assumptions: it pays not to buy.
oc-f-474 · level teorema · notes
In lot sizing with overtime (LS-OT) regular time costs $cw_t$ per unit up to $cap^N_t$ and overtime $co_t>cw_t$ per unit up to $cap^O_t$. Why does an optimal plan use overtime in period $t$ only if the regular time of $t$ is exhausted?
  1. Otherwise moving time from overtime to regular time would cost less
  2. Because overtime is available only in the last period
  3. Because the overtime capacity is always $cap^O_t\le cap^N_t$
  4. It is not true: overtime is used to anticipate production
Explanation. With free regular time, every unit of overtime can be replaced by a regular unit costing $cw_t<co_t$.
oc-f-475 · level facile · notes
Lot sizing with overtime (LS-OT): in a period regular time costs $2$ per unit up to $cap^N_t=8$, overtime $5$ per unit up to $cap^O_t=4$. $11$ time units are needed. What is the minimum cost of the working time?
  1. $22$
  2. $55$
  3. $40$
  4. $31$
Explanation. $8$ regular units ($16$) and $3$ of overtime ($15$): $31$. $22$ ignores the limit $cap^N_t=8$; $55$ pays everything as overtime.
oc-f-476 · level facile · notes
In lot sizing with unmet demand (LS-UD) part of the demand may stay unserved, with penalty $cu_{pt}$ per unit. If all penalties are enormously larger than the other costs, what does an optimal plan do?
  1. It leaves the demand of the last period unmet
  2. There is no optimal plan, the cost is unbounded
  3. It serves all the demand, as in the base problem
  4. It leaves all the demand of the horizon unmet
Explanation. Leaving a unit unserved costs more than producing it, and producing everything is possible under the capacity assumptions: the variant reduces to the base problem.
oc-f-477 · level facile · notes
Lot sizing with unmet demand (LS-UD): in the last period $3$ units of demand remain and there is no stock. The alternatives are a setup (cost $50$, zero variable cost, everything served) or leaving the $3$ units unserved (penalty $10$ per unit). Minimum cost?
  1. $0$
  2. $30$
  3. $50$
  4. $80$
Explanation. Serving costs $50$, not serving $3\cdot10=30$: the penalty pays off. $80$ adds the two alternatives.
oc-f-478 · level facile · notes
Capacitated lot sizing is NP-hard, while the uncapacitated case is solved by the Wagner-Whitin algorithm. What does the NP-hardness of the capacitated case imply, if $P\neq NP$?
  1. There is no polynomial algorithm for the capacitated case
  2. The capacitated case has no integer optimal solutions
  3. The uncapacitated case is NP-hard too
  4. The Wagner-Whitin algorithm also solves the capacitated case
Explanation. NP-hard means that a polynomial algorithm would give $P=NP$. The uncapacitated case stays polynomial: the capacities are the source of the difficulty.
oc-f-479 · level ipotesi · notes
The Wagner-Whitin property («produce only when the stock is empty») holds without capacities. Why can it fail with capacities?
  1. Because with capacities the setup costs become zero
  2. Because with capacities the final stock must be positive
  3. It does not fail: the property holds with capacities too
  4. Scarce capacity forces producing in advance with positive stock
Explanation. For instance with capacity $4$ the optimal plan $(3,0,4,4,0)$ produces in period $4$ with $1$ unit in stock, to cover a demand that period $4$ alone could not serve.
oc-f-480 · level facile · notes
In lot sizing ($x_t$ production in period $t$, $s_t$ end-of-period stock, $s_0=0$), how is the Wagner-Whitin property «produce only when the stock is empty» written?
  1. $s_t=0$ for every $t$
  2. $x_t\le d_t$ for every $t$
  3. $x_t\,s_{t-1}=0$ for every $t$
  4. $x_t\,s_t=0$ for every $t$
Explanation. If $x_t>0$ the incoming stock $s_{t-1}$ must be zero. $x_ts_t=0$ would forbid producing for future periods; $s_t=0$ everywhere is lot-for-lot.

Part: Formulations and their properties (241)

9. Formulations of knapsack problems (56)

oc-f-031 · level teorema · notes
In the knapsack problem (KP, weights $w_j\le c$) let $z(\mathrm{ILP}_{\mathrm{KP}})$ be the optimal value and $z(\mathrm{LP}_{\mathrm{KP}})$ that of the LP relaxation (with $0\le x_j\le 1$). Which statement on their ratio is correct?
  1. $z(\mathrm{LP}_{\mathrm{KP}})/z(\mathrm{ILP}_{\mathrm{KP}})\le \frac{3}{2}$ for every instance, and the value $\frac32$ is reached asymptotically
  2. $z(\mathrm{LP}_{\mathrm{KP}})/z(\mathrm{ILP}_{\mathrm{KP}})$ is unbounded: it grows with the number $n$ of items
  3. $z(\mathrm{LP}_{\mathrm{KP}})/z(\mathrm{ILP}_{\mathrm{KP}})\le 2$ for every instance, and the value $2$ is reached asymptotically for $c\to+\infty$
  4. $z(\mathrm{LP}_{\mathrm{KP}})/z(\mathrm{ILP}_{\mathrm{KP}})\le 2$ for every instance, and some instance has ratio exactly $2$
Explanation. Propositions 9.7 and 9.8: the ratio is at most $2$, and the family with $c=2\vartheta$ and two items of weight $\vartheta+1$ has ratio $\frac{2\vartheta}{\vartheta+1}\to 2$, without attaining it.
oc-f-032 · level ipotesi · notes
In the KP (weights $w_j\le c$), with the items sorted by non-increasing efficiency $p_j/w_j$, let $s$ be the split item (the first one that does not fit entirely) and $\mathit{rc}=c-\sum_{j<s}w_j$. Which facts are needed to prove $z(\mathrm{LP}_{\mathrm{KP}})\le 2\,z(\mathrm{ILP}_{\mathrm{KP}})$?
  1. Weak duality between $\mathrm{LP}_{\mathrm{KP}}$ and its dual; items sorted by non-decreasing weight; $w_s\le c$
  2. Items $1,\dots,s-1$ form a feasible solution; item $s$ alone is feasible ($w_s\le c$); $z(\mathrm{LP}_{\mathrm{KP}})\le\sum_{j<s}p_j+p_s$
  3. Items $1,\dots,s-1$ form an optimal solution; $\mathit{rc}<w_s$; $z(\mathrm{LP}_{\mathrm{KP}})\le\sum_{j<s}p_j+p_s$
  4. Profits are integer, hence $z(\mathrm{LP}_{\mathrm{KP}})$ is rounded down; item $s$ alone is feasible; $\mathit{rc}<w_s$
Explanation. The two lower bounds $\sum_{j<s}p_j\le z(\mathrm{ILP}_{\mathrm{KP}})$ and $p_s\le z(\mathrm{ILP}_{\mathrm{KP}})$, added, exceed $z(\mathrm{LP}_{\mathrm{KP}})=\sum_{j<s}p_j+p_s\,\mathit{rc}/w_s$. The integrality of the profits is needed for the Dantzig bound, not here.
oc-f-033 · level ipotesi · notes
In the KP (profits $p_j$, weights $w_j$, capacity $c$), with the items sorted by efficiency, let $s$ be the split item and $\mathit{rc}=c-\sum_{j<s}w_j$ the residual capacity. What is needed to prove that $\mathrm{UB}_{\mathrm{D}}=\sum_{j<s}p_j+\left\lfloor p_s\,\mathit{rc}/w_s\right\rfloor$ is an upper bound on the optimal value?
  1. The order by non-increasing efficiency, the formula of $z(\mathrm{LP}_{\mathrm{KP}})$ and integer profits
  2. The order by non-increasing efficiency, the formula of $z(\mathrm{LP}_{\mathrm{KP}})$ and integer weights
  3. The order by non-increasing profit, strong duality and integer profits
  4. The greedy solution, the item of maximum profit and integer profits
Explanation. $\mathrm{UB}_{\mathrm{D}}=\lfloor z(\mathrm{LP}_{\mathrm{KP}})\rfloor$: the formula of $z(\mathrm{LP}_{\mathrm{KP}})$ holds with the items sorted by efficiency, and rounding is allowed because $z(\mathrm{ILP}_{\mathrm{KP}})$ is an integer ($p_j\in\Z_{\ge1}$).
oc-f-034 · level facile · notes
Knapsack problem (KP) with capacity $c=9$; the item of maximum efficiency $p_j/w_j$ has $p_1=6$ and $w_1=2$. What is the relaxation $z(\mathrm{LP}\text{-}0_{\mathrm{KP}})$, which keeps the capacity constraint and only the constraints $x_j\ge 0$ (without $x_j\le 1$)?
  1. $6$
  2. $\frac{49}{3}$
  3. $54$
  4. $27$
Explanation. Without the constraints $x_j\le 1$ all the capacity goes to the most efficient item: $z=p_1\,c/w_1=6\cdot 9/2=27$. It is a much weaker bound than $z(\mathrm{LP}_{\mathrm{KP}})$.
oc-f-035 · level teorema · notes
In the KP let $D(\mathrm{LP}_{\mathrm{KP}})$ be the dual of the LP relaxation, with variable $\pi$ for the capacity constraint and $\mu_j$ for $x_j\le 1$. With the items sorted by non-increasing efficiency $p_j/w_j$ and $s$ the split item (the first one that does not fit entirely), which dual solution is optimal?
  1. $\tilde\pi=\frac{p_1}{w_1}$, $\tilde\mu_j=p_j-w_j\frac{p_1}{w_1}$ for $j<s$ and $\tilde\mu_j=0$ for $j\ge s$
  2. $\tilde\pi=0$, $\tilde\mu_j=p_j$ for $j<s$ and $\tilde\mu_j=0$ for $j\ge s$
  3. $\tilde\pi=\frac{p_s}{w_s}$, $\tilde\mu_j=p_j-w_j\frac{p_s}{w_s}$ for $j<s$ and $\tilde\mu_j=0$ for $j\ge s$
  4. $\tilde\pi=\frac{p_s}{w_s}$, $\tilde\mu_j=0$ for $j<s$ and $\tilde\mu_j=p_j-w_j\frac{p_s}{w_s}$ for $j\ge s$
Explanation. The capacity multiplier is the efficiency of the split item, and the items taken entirely have $\tilde\mu_j=p_j-w_j\,p_s/w_s\ge 0$ (Proposition 9.5). With $\tilde\pi=p_1/w_1$ the $\tilde\mu_j$ would be negative; with $\tilde\pi=0$ the dual constraints of items $j\ge s$ are violated.
oc-f-134 · level facile · notes
The $\mathrm{ILP}_{\mathrm{SSP}}$ model of subset sum maximizes $\sum_j w_jx_j$ subject to $\sum_j w_jx_j\le c$ and $x_j\in\{0,1\}$; the answer is yes if and only if the optimal value is $c$. With weights $w=(2,3,6,7,5,9)$ and $c=9$, what is $z(\mathrm{ILP}_{\mathrm{SSP}})$?
  1. $8$, hence the answer is no
  2. $32$, the sum of all the weights
  3. $7$, the largest weight fitting alone
  4. $9$, hence the answer is yes
Explanation. For example $\{2,7\}$, $\{3,6\}$ or $\{9\}$ sum to $9=c$, hence $z(\mathrm{ILP}_{\mathrm{SSP}})=9$ and the answer is yes.
oc-f-135 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{SSP}}$ model of subset sum (the KP with profits $p_j=w_j$, capacity $c$, and $\sum_j w_j>c$), why does the LP relaxation, with $0\le x_j\le 1$, not help to answer?
  1. The relaxation always equals $0$, because the split item is the first one
  2. The relaxation always equals $\sum_j w_j$, because no constraint is active
  3. All items have efficiency $1$, so the relaxation always equals $c$
  4. The relaxation is unbounded, because profits equal weights
Explanation. With $p_j/w_j=1$ for every item, the relaxation fills the knapsack fractionally and equals $c$: the bound $c$ does not distinguish yes-instances from no-instances.
oc-f-136 · level facile · notes
Bounded knapsack (BKP): the model has integer variables $x_j\in\{0,\dots,b_j\}$ (copies of item $j$). Capacity $c=9$, profits $p=(6,5,8,9,6,7)$, weights $w=(2,3,6,7,5,9)$, copies $b=(2,2,1,1,1,1)$. What is the optimal value?
  1. $17$
  2. $18$
  3. $15$
  4. $24$
Explanation. Two copies of item $1$ and item $5$ weigh $9$ and are worth $12+6=18$. With one copy per item (KP) one gets $15$, with unlimited copies (UKP) $24$ (four copies of item $1$).
oc-f-137 · level facile · notes
A bounded knapsack (BKP) with available copies $b=(2,2,1,1,1,1)$ can be rewritten as a 0-1 knapsack (KP) by replacing every item $j$ with $b_j$ identical items. How many binary variables does the resulting model have?
  1. $8$
  2. $6$
  3. $12$
  4. $64$
Explanation. The copies are $\sum_j b_j=2+2+1+1+1+1=8$. The $\mathrm{ILP}_{\mathrm{BKP}}$ model uses $6$ integer variables instead, one per item type.
oc-f-138 · level facile · notes
Unbounded knapsack (UKP): variables $x_j\in\Z_{\ge0}$, capacity $c=9$, profits $p=(6,5,8,9,6,7)$, weights $w=(2,3,6,7,5,9)$; item $1$ has the largest efficiency $p_j/w_j$, namely $3$. What are the optimal value and the LP relaxation $c\,p_1/w_1$?
  1. $27$ and $27$
  2. $24$ and $24$
  3. $18$ and $27$
  4. $24$ and $27$
Explanation. Four copies of item $1$ weigh $8$ and are worth $24$, and no combination does better; the relaxation uses $4.5$ copies and is worth $27$. $18$ is the value of the BKP with $b_1=2$.
oc-f-139 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{UKP}}$ model of the unbounded knapsack ($x_j\in\Z_{\ge0}$ copies of item $j$, weights $w_j$, capacity $c$) there is no explicit upper bound on the variables. Which bound is implied anyway by the capacity constraint?
  1. $x_j\le\lceil c/w_j\rceil$
  2. $x_j\le c$
  3. $x_j\le\lfloor c/w_j\rfloor$
  4. $x_j\le 1$
Explanation. From $w_jx_j\le\sum_i w_ix_i\le c$ and the integrality of $x_j$ we get $x_j\le\lfloor c/w_j\rfloor$: the UKP is a BKP with $b_j=\lfloor c/w_j\rfloor$.
oc-f-140 · level facile · notes
Multidimensional knapsack (MDKP) with capacities $c_1=10$, $c_2=12$: profits $p=(6,7,5,9)$, weights in dimension 1 $w_{1\cdot}=(4,5,3,7)$ and in dimension 2 $w_{2\cdot}=(6,4,5,3)$; every item is taken at most once. What is the optimal value?
  1. $21$
  2. $14$
  3. $13$
  4. $16$
Explanation. $\{3,4\}$ weighs $(10,8)$ and is worth $14$. $\{2,4\}$ would be worth $16$ but weighs $12>10$ in dimension 1; $21$ is obtained looking at dimension 2 only.
oc-f-141 · level facile · notes
In the multidimensional knapsack (MDKP) model, with one constraint $\sum_j w_{dj}x_j\le c_d$ per dimension $d$, all the constraints are added into a single one, $\sum_j(\sum_d w_{dj})x_j\le\sum_d c_d$. What does the optimal value of the resulting 0-1 knapsack give?
  1. An upper bound on the MDKP optimal value, because the new problem is a relaxation
  2. A lower bound on the MDKP optimal value, because the new problem is more constrained
  3. The MDKP optimal value, because the sum of the constraints is equivalent to them
  4. A feasible MDKP solution, because it respects the total capacity
Explanation. Every MDKP solution satisfies the sum of the constraints, so the new problem has more feasible solutions: its optimum is an upper bound. Its optimal solution may violate a single dimension.
oc-f-142 · level facile · notes
The $\mathrm{ILP}_{\mathrm{MKP}}$ model of the multiple knapsack has a binary variable $x_{jk}$ for every item $j$ and knapsack $k$, one capacity constraint per knapsack and one constraint $\sum_k x_{jk}\le 1$ per item. With $n=5$ items and $m=2$ knapsacks, how many variables and linear constraints does it have?
  1. $10$ variables and $10$ constraints
  2. $7$ variables and $10$ constraints
  3. $5$ variables and $2$ constraints
  4. $10$ variables and $7$ constraints
Explanation. The variables are $nm=10$; the constraints are $m=2$ capacity constraints plus $n=5$ assignment constraints, i.e., $7$ (not counting the variable domains).
oc-f-143 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{MKP}}$ model of the multiple knapsack ($x_{jk}=1$ if item $j$ goes into knapsack $k$), why is the constraint of every item $\sum_k x_{jk}\le 1$ and not $\sum_k x_{jk}=1$?
  1. The equality constraint would make the model non-linear
  2. The constraint is needed only for empty knapsacks
  3. An item may stay out of all the knapsacks
  4. An item may be split among several knapsacks
Explanation. As in the KP, we choose the items to insert: with the equality every item would have to be inserted, and the instance might have no feasible solution.
oc-f-144 · level facile · notes
Multiple-choice knapsack (MCKP): capacity $c=15$, classes $\mathscr{J}_1=\{1,2\}$, $\mathscr{J}_2=\{3,4\}$, $\mathscr{J}_3=\{5,6\}$, profits $p=(6,8,5,7,4,9)$, weights $w=(4,6,5,8,3,7)$; exactly one item per class is chosen. What is the optimal value?
  1. $20$
  2. $17$
  3. $15$
  4. $24$
Explanation. $\{1,4,5\}$ weighs $15$ and is worth $17$, as $\{2,3,5\}$ (weight $14$). $24=8+7+9$ takes the best item of each class ignoring the capacity; $\{1,3,5\}$ is worth $15$.
oc-f-145 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{MCKP}}$ model of the multiple-choice knapsack (classes $\mathscr{J}_1,\dots,\mathscr{J}_q$, $x_j=1$ if item $j$ is chosen) the class constraints are $\sum_{j\in\mathscr{J}_h}x_j=1$. What would change writing $\le 1$?
  1. A class could contribute nothing: another problem would be solved
  2. Nothing: in an optimum every class gives an item anyway, since profits are positive
  3. Two items of the same class could be chosen
  4. The model would become non-linear
Explanation. With $\le 1$ a class may stay empty, and if the knapsack is too small for all the classes the optimum leaves one empty: it is a different problem from the MCKP, which imposes exactly one item per class.
oc-f-146 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{KPS}}$ model of the knapsack with setups, $x_j=1$ if item $j$ is chosen and $y_h=1$ if class $h$ is activated (with setup cost $f_h$ and setup weight $s_h$). Which pair (objective, capacity) is correct?
  1. $\max\sum_j p_jx_j+\sum_h f_hy_h$ with $\sum_j w_jx_j\le c+\sum_h s_hy_h$
  2. $\max\sum_j p_jx_j-\sum_h f_hy_h$ with $\sum_j w_jx_j\le c$
  3. $\max\sum_j (p_j-f_h)x_j$ with $\sum_j (w_j+s_h)x_j\le c$
  4. $\max\sum_j p_jx_j-\sum_h f_hy_h$ with $\sum_j w_jx_j+\sum_h s_hy_h\le c$
Explanation. The setup of an activated class is paid once, in the profit ($-f_h$) and in the capacity ($+s_h$). The last option would pay it once for every chosen item.
oc-f-147 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{KPS}}$ model of the knapsack with setups ($x_j$ item chosen, $y_h$ class activated, $h(j)$ the class of item $j$), what are the constraints $x_j\le y_{h(j)}$ for?
  1. To impose that at most one class is activated
  2. To forbid activating a class without choosing items from it
  3. To forbid choosing an item without paying the setup of its class
  4. To impose that all the items of an activated class are chosen
Explanation. Without these constraints, since setups cost, the optimum would set $y_h=0$ and choose the items anyway. An activated but empty class is feasible, but not convenient.
oc-f-293 · level facile · notes
The ILP models of knapsack problems have the scheme $\max\{\sum_j p_jx_j:\sum_j w_jx_j\le c,\ x_j\in D_j\}$. In which problem is the domain $D_j=\Z_{\ge0}$?
  1. In the unbounded knapsack (UKP)
  2. In the 0/1 knapsack (KP)
  3. In the bounded knapsack (BKP)
  4. In the subset sum (SSP)
Explanation. $\Z_{\ge0}$ counts copies without limit. The KP and the SSP have $D_j=\{0,1\}$, the BKP $D_j=\{0,1,\dots,b_j\}$.
oc-f-294 · level facile · notes
In the ILP model of the multiple knapsack (MKP: $m$ knapsacks of capacity $c_k$, every item in at most one knapsack), which variables are used?
  1. Binary $x_j$, equal to $1$ if item $j$ is selected
  2. Integer $x_j$, the number of the knapsack of item $j$
  3. Binary $y_k$, equal to $1$ if knapsack $k$ is used
  4. Binary $x_{jk}$, equal to $1$ if item $j$ goes into knapsack $k$
Explanation. One needs to know in which knapsack the item goes, hence an extra index; the constraint $\sum_k x_{jk}\le1$ imposes at most one knapsack per item.
oc-f-295 · level facile · notes
Model $\mathrm{ILP}_{\mathrm{KP}}$ of the 0/1 knapsack with $c=9$, $p=(6,5,8,9,6,7)$ and $w=(2,3,6,7,5,9)$. Which vector is feasible and has the highest value among those proposed?
  1. $\vet x=(0,0,0,0,0,1)$, value $7$
  2. $\vet x=(1,1,0,0,0,0)$, value $11$
  3. $\vet x=(1,0,0,1,0,0)$, value $15$
  4. $\vet x=(1,1,1,0,0,0)$, value $19$
Explanation. $(1,0,0,1,0,0)$ weighs $2+7=9\le c$ and is worth $15$ (it is the optimum of the instance); $(1,1,1,0,0,0)$ weighs $11>9$; the others are feasible but worth less.
oc-f-296 · level facile · notes
The model $\mathrm{ILP}_{\mathrm{KP}}$ of the 0/1 knapsack with $n$ items has how many variables and how many linear constraints, besides the domain constraints $x_j\in\{0,1\}$?
  1. $2^n$ variables, one per subset
  2. $n$ binary variables and a single capacity constraint
  3. $n$ variables and $n$ capacity constraints
  4. $n^2$ variables and one constraint
Explanation. One variable per item and the constraint $\sum_j w_jx_j\le c$: the model is compact, even though the problem is NP-hard.
oc-f-297 · level teorema · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{KP}}$ of the 0/1 knapsack replaces $x_j\in\{0,1\}$ by $x_j\ge0$ (without $x_j\le1$); item $1$ is the most efficient. With $c=9$ and items $(p_j,w_j)=(6,2),(5,3),(8,6)$, what is $z(\mathrm{LP}\text{-}0_{\mathrm{KP}})$?
  1. $27$
  2. $\frac{49}{3}$
  3. $19$
  4. $11$
Explanation. Without $x_j\le1$ it pays to fill the knapsack with the most efficient item: $x_1=c/w_1=\frac92$ and $z=p_1c/w_1=27$, certified by the dual $\pi=p_1/w_1$. $\frac{49}{3}$ is the relaxation with $x_j\le1$.
oc-f-298 · level ipotesi · notes
The value $z(\mathrm{LP}\text{-}0_{\mathrm{KP}})=p_1c/w_1$ of the 0/1 knapsack relaxation with only the constraints $x_j\ge0$ is proved with the dual $\tilde\pi=p_1/w_1$. Which assumption on item $1$ is needed for $\tilde\pi$ to be dual feasible ($w_j\tilde\pi\ge p_j$ for every $j$)?
  1. That item $1$ has the maximum profit
  2. That item $1$ has the minimum weight
  3. None: it holds for any item
  4. That item $1$ has maximum efficiency: $p_1/w_1\ge p_j/w_j$ for every $j$
Explanation. $w_j\,p_1/w_1\ge p_j$ is equivalent to $p_1/w_1\ge p_j/w_j$. With an item not of maximum efficiency the value $p_1c/w_1$ would only be a feasible primal value, not the optimum.
oc-f-299 · level facile · notes
The LP relaxation $\mathrm{LP}_{\mathrm{KP}}$ of the 0/1 knapsack uses $0\le x_j\le1$. With $c=9$ and items, already sorted by non-increasing efficiency, $(p_j,w_j)=(6,2),(5,3),(8,6),(9,7)$, what is $z(\mathrm{LP}_{\mathrm{KP}})$?
  1. $27$
  2. $\frac{50}{3}$
  3. $\frac{49}{3}$
  4. $16$
Explanation. Items $1$ and $2$ fit (weight $5$, profit $11$); item $3$ is the split item with residual capacity $4$: $11+8\cdot\frac46=\frac{49}{3}$. $16$ is its rounding down (Dantzig bound).
oc-f-300 · level facile · notes
The efficiency of a knapsack item is $p_j/w_j$. With items $(p_j,w_j)=(9,7),(8,6),(5,3)$, what is the order by non-increasing efficiency?
  1. $3,1,2$
  2. $3,2,1$
  3. $1,2,3$
  4. $2,1,3$
Explanation. $5/3\approx1.67>8/6\approx1.33>9/7\approx1.29$. Sorting by profit ($1,2,3$) is a typical mistake.
oc-f-301 · level facile · notes
0/1 knapsack with $c=9$ and items sorted by non-increasing efficiency, of weights $w=(2,3,6,7)$. The split item $s$ is the first one not fitting entirely when adding the items in order, and the residual capacity is $\mathit{rc}=c-\sum_{j<s}w_j$. What are they?
  1. $s=3$, $\mathit{rc}=4$
  2. $s=2$, $\mathit{rc}=7$
  3. $s=3$, $\mathit{rc}=-2$
  4. $s=4$, $\mathit{rc}=3$
Explanation. $2+3=5\le9$, but $5+6=11>9$: item $3$ is the split item and $9-5=4$ units remain. The residual capacity is never negative.
oc-f-302 · level teorema · notes
For the 0/1 knapsack the ratio $z(\mathrm{LP}_{\mathrm{KP}})/z(\mathrm{ILP}_{\mathrm{KP}})$ is at most $2$. The instance with $c=2\vartheta$ and two items with $p_j=1$, $w_j=\vartheta+1$ shows that the bound is tight. What is the ratio for $\vartheta=4$?
  1. $2$
  2. $\frac45$
  3. $1$
  4. $\frac85$
Explanation. $c=8$: only one item fits, $z(\mathrm{ILP})=1$; the relaxation takes the second one for $\frac{8-5}{5}=\frac35$, hence $z(\mathrm{LP})=\frac85$. In general $\frac{2\vartheta}{\vartheta+1}\to2$.
oc-f-303 · level ipotesi · notes
The Dantzig bound of the 0/1 knapsack is $\UB_{\mathrm{D}}=\lfloor z(\mathrm{LP}_{\mathrm{KP}})\rfloor$. On which assumption does the rounding down rely?
  1. That the items are sorted by efficiency
  2. That the residual capacity is positive
  3. That the profits $p_j$ are integer, so every integer solution has integer value
  4. That the weights $w_j$ are integer
Explanation. If $z(\mathrm{ILP})$ is integer and at most $z(\mathrm{LP})$, it is at most $\lfloor z(\mathrm{LP})\rfloor$. With fractional profits the rounding would not be valid.
oc-f-304 · level teorema · notes
The Martello-Toth bound of the 0/1 knapsack is $\max\{\UB_0,\UB_1\}$: $\UB_0$ excludes the split item $s$ and fills $\mathit{rc}$ with the efficiency of item $s+1$, $\UB_1$ includes $s$ removing weight with the efficiency of item $s-1$. Why is it valid?
  1. Because $\UB_1\le\UB_0$ in every instance
  2. Every integer solution has $x_s=0$ or $x_s=1$, and $\UB_0$, $\UB_1$ are upper bounds in the two cases
  3. Because $\UB_0$ and $\UB_1$ are both feasible solutions
  4. Because $\max\{\UB_0,\UB_1\}$ always equals $z(\mathrm{ILP}_{\mathrm{KP}})$
Explanation. It is a disjunction on the fractional variable: the maximum of the bounds of the two cases bounds every integer solution, and it is at most the Dantzig bound.
oc-f-481 · level facile · notes
Among the ILP models of the knapsack problems (KP, SSP, BKP, UKP, MDKP, MKP, MCKP, KPS), which one has two families of binary variables, one for the items and one for the classes?
  1. The knapsack problem with setups (KPS)
  2. The multiple-choice knapsack problem (MCKP)
  3. The multiple knapsack problem (MKP)
  4. The multidimensional knapsack problem (MDKP)
Explanation. In the KPS $x_j$ says whether item $j$ is chosen and $y_h$ whether class $h$ is activated. The MCKP has classes but only the variables $x_j$; the MKP has two-index variables $x_{jk}$.
oc-f-482 · level facile · notes
Among the ILP models of the knapsack problems, which one has several capacity constraints weighing the same vector of variables $\vet{x}\in\{0,1\}^n$, one per dimension?
  1. The multiple knapsack problem (MKP)
  2. The bounded knapsack problem (BKP)
  3. The knapsack problem with setups (KPS)
  4. The multidimensional knapsack problem (MDKP)
Explanation. In the MDKP every dimension $d$ gives $\sum_j w_{dj}x_j\le c_d$ on the same $x_j$. In the MKP every knapsack has its own constraint, but on different variables $x_{jk}$.
oc-f-483 · level facile · notes
Model $\mathrm{ILP}_{\mathrm{KP}}$ of the 0/1 knapsack ($\max\sum_jp_jx_j$, $\sum_jw_jx_j\le c$, $x_j\in\{0,1\}$) with $c=9$ and weights $w=(2,3,6,7,5,9)$. Which vector is NOT feasible?
  1. $(0,1,1,0,0,0)$
  2. $(0,0,0,0,0,1)$
  3. $(1,1,0,0,1,0)$
  4. $(1,0,0,1,0,0)$
Explanation. $(1,1,0,0,1,0)$ weighs $2+3+5=10>9$. The others weigh $9$, $9$ and $9$: they satisfy the capacity constraint with equality.
oc-f-484 · level facile · notes
In the model $\mathrm{ILP}_{\mathrm{KP}}$ of the 0/1 knapsack $x_j\in\{0,1\}$ is replaced by $0\le x_j\le1$. What is obtained?
  1. A model without feasible solutions
  2. A relaxation: the optimum may take a fraction of an item
  3. An equivalent model, because the vertices are integer
  4. A more constrained model, with a smaller optimal value
Explanation. One obtains $\mathrm{LP}_{\mathrm{KP}}$: its optimal solution takes the critical item in part, so in general it is not integer and $z(\mathrm{LP}_{\mathrm{KP}})\ge z(\mathrm{ILP}_{\mathrm{KP}})$.
oc-f-485 · level facile · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{KP}}$ of the 0/1 knapsack has only $\sum_jw_jx_j\le c$ and $x_j\ge0$ (no bound $x_j\le1$); item $1$ has the largest efficiency $p_j/w_j$. Which solution is optimal?
  1. $x_1=c/w_1$ and $x_j=0$ for $j\neq1$
  2. $x_1=1$, then the other items by efficiency until full
  3. $x_j=c/\sum_k w_k$ for every $j$
  4. $x_j=1$ for all items that fit
Explanation. Without $x_j\le1$ it pays to spend the whole capacity on the most efficient item: value $p_1c/w_1$. Then taking the others by efficiency is the solution of $\mathrm{LP}_{\mathrm{KP}}$.
oc-f-486 · level teorema · notes
For the 0/1 knapsack one compares the model $\mathrm{ILP}_{\mathrm{KP}}$, the relaxation $\mathrm{LP}_{\mathrm{KP}}$ ($0\le x_j\le1$) and the relaxation $\mathrm{LP}\text{-}0_{\mathrm{KP}}$ ($x_j\ge0$). Which chain holds for the optimal values?
  1. $z(\mathrm{LP}_{\mathrm{KP}})\le z(\mathrm{ILP}_{\mathrm{KP}})\le z(\mathrm{LP}\text{-}0_{\mathrm{KP}})$
  2. $z(\mathrm{LP}\text{-}0_{\mathrm{KP}})\le z(\mathrm{LP}_{\mathrm{KP}})\le z(\mathrm{ILP}_{\mathrm{KP}})$
  3. $z(\mathrm{ILP}_{\mathrm{KP}})=z(\mathrm{LP}_{\mathrm{KP}})\le z(\mathrm{LP}\text{-}0_{\mathrm{KP}})$
  4. $z(\mathrm{ILP}_{\mathrm{KP}})\le z(\mathrm{LP}_{\mathrm{KP}})\le z(\mathrm{LP}\text{-}0_{\mathrm{KP}})$
Explanation. The feasible regions are nested: integers $\subseteq$ $[0,1]^n$ with capacity $\subseteq$ $\R_{\ge0}^n$ with capacity. In a maximization problem, a larger region gives a value that is not smaller.
oc-f-487 · level facile · notes
In the 0/1 knapsack the optimal solution of $\mathrm{LP}_{\mathrm{KP}}$ ($0\le x_j\le1$) is found by sorting the items by non-increasing efficiency $p_j/w_j$. Which items have a fractional value in that solution?
  1. At most two: the critical item and the next one
  2. None: the solution is always integer
  3. At most one: the critical item
  4. All those after the critical item
Explanation. The items before the critical item $s$ have $x_j=1$, those after it $x_j=0$, and $x_s=\mathit{rc}/w_s$ may be fractional.
oc-f-488 · level facile · notes
In the knapsack the efficiency of item $j$ is $p_j/w_j$. With items $(p_j,w_j)=(10,4),(8,3),(9,4),(5,2)$, which item comes last in the order by non-increasing efficiency?
  1. $(8,3)$
  2. $(9,4)$
  3. $(5,2)$
  4. $(10,4)$
Explanation. Efficiencies $2.5$, $2.67$, $2.25$, $2.5$: the last is $(9,4)$. Sorting by profit would put $(5,2)$ last, which has instead efficiency $2.5$.
oc-f-489 · level facile · notes
In the 0/1 knapsack the relaxation $\mathrm{LP}_{\mathrm{KP}}$ is solved by sorting the items by efficiency $p_j/w_j$. If two items have the same efficiency, is the optimal solution of $\mathrm{LP}_{\mathrm{KP}}$ unique?
  1. Not always: moving weight between them keeps the value
  2. Yes: the optimal solution of an LP is always unique
  3. Yes, if ties are broken by increasing index
  4. No: with equal efficiencies the relaxation is unbounded
Explanation. Moving $\delta$ units of weight from one item to the other, with the same efficiency, changes the profit by $0$: there may be other optimal solutions. The sorting rule picks one of them.
oc-f-490 · level facile · notes
0/1 knapsack with $c=10$ and items already sorted by non-increasing efficiency $(p_j,w_j)=(12,4),(9,3),(10,5),(4,4)$. The critical item $s$ is the first that does not fit entirely; $\mathit{rc}=c-\sum_{j<s}w_j$. What are $s$, $\mathit{rc}$ and $z(\mathrm{LP}_{\mathrm{KP}})=\sum_{j<s}p_j+\mathit{rc}\,p_s/w_s$?
  1. $s=3$, $\mathit{rc}=3$, $z=31$
  2. $s=3$, $\mathit{rc}=5$, $z=31$
  3. $s=4$, $\mathit{rc}=3$, $z=24$
  4. $s=3$, $\mathit{rc}=3$, $z=27$
Explanation. $4+3=7\le10$ but $7+5=12>10$: $s=3$, $\mathit{rc}=3$, $z=21+3\cdot\frac{10}5=27$. $31$ takes the critical item entirely.
oc-f-491 · level facile · notes
0/1 knapsack, items sorted by efficiency $(p_j,w_j)=(12,4),(9,3),(10,5),(4,4)$, $c=10$: critical item $s=3$, $\mathit{rc}=3$. Martello-Toth: $\UB_0=\sum_{j<s}p_j+\lfloor\mathit{rc}\,p_{s+1}/w_{s+1}\rfloor$, $\UB_1=\lfloor\sum_{j\le s}p_j-(w_s-\mathit{rc})\,p_{s-1}/w_{s-1}\rfloor$. What is $\UB_{\mathrm{MT}}=\max\{\UB_0,\UB_1\}$?
  1. $24$
  2. $31$
  3. $25$
  4. $27$
Explanation. $\UB_0=21+\lfloor3\cdot\frac44\rfloor=24$; $\UB_1=\lfloor31-2\cdot3\rfloor=25$; the maximum is $25$, better than Dantzig's bound $\lfloor27\rfloor=27$.
oc-f-492 · level facile · notes
The model $\mathrm{ILP}_{\mathrm{SSP}}$ of subset sum maximizes $\sum_jw_jx_j$ with $\sum_jw_jx_j\le c$, $x_j\in\{0,1\}$; the answer is «yes» if and only if the optimum equals $c$. With $w=(4,6,9,13)$ and $c=21$, what is the optimum and what is the answer?
  1. $17$: the answer is «no»
  2. $19$: the answer is «no»
  3. $21$: the answer is «yes»
  4. $22$: the answer is «yes»
Explanation. The sums at most $21$ are at most $4+6+9=19$ (also $6+13=19$); $9+13=22$ exceeds $c$. Since $19<21$, no subset sums to $21$.
oc-f-493 · level teorema · notes
Subset sum asks whether there is a subset of sum exactly $c$, but the model $\mathrm{ILP}_{\mathrm{SSP}}$ uses $\max\sum_jw_jx_j$ with the constraint $\sum_jw_jx_j\le c$ instead of the equality. Why this choice?
  1. The model is always feasible, and the optimum is compared with $c$
  2. Because an equality constraint is not linear
  3. Because with the equality the linear relaxation would always be integer
  4. Because the maximum is always $c$, so the answer is always «yes»
Explanation. With $\le$ the model always has solutions and its optimum says how close one gets to $c$: the answer is «yes» exactly when the optimum equals $c$. The equality is linear, but it would make the model infeasible for «no» answers.
oc-f-494 · level facile · notes
Bounded knapsack (BKP): $x_j\in\{0,\dots,b_j\}$ copies of item $j$. With $c=9$ and items $(p_j,w_j,b_j)=(6,2,2)$ and $(5,3,2)$, what is the linear relaxation, with $0\le x_j\le b_j$?
  1. $22$
  2. $17$
  3. $27$
  4. $61/3$
Explanation. Efficiencies $3$ and $5/3$: two copies of the first item (weight $4$, profit $12$), then $5/3$ copies of the second: $12+\frac53\cdot5=\frac{61}3$. $22$ would take two whole copies of the second, weighing $6>5$.
oc-f-495 · level facile · notes
In the model $\mathrm{ILP}_{\mathrm{BKP}}$ of the bounded knapsack the domain is $x_j\in\{0,1,\dots,b_j\}$. What is obtained by replacing it with $x_j\in\Z_{\ge0}$?
  1. The same problem, because the capacity already bounds the copies
  2. Subset sum (SSP), because the profits become the weights
  3. The unbounded knapsack (UKP): more than $b_j$ copies can be taken
  4. The 0/1 knapsack (KP): every item is taken at most once
Explanation. Removing the bound $b_j$ allows unlimited copies, bounded only by the capacity ($x_j\le\lfloor c/w_j\rfloor$). It coincides with the BKP only if $b_j\ge\lfloor c/w_j\rfloor$.
oc-f-496 · level facile · notes
Unbounded knapsack (UKP, $x_j\in\Z_{\ge0}$) with $c=10$ and two items $(p_j,w_j)=(7,4)$ and $(5,3)$. What are the linear relaxation ($x_j\ge0$) and the integer optimum?
  1. $16.7$ and $15$
  2. $17.5$ and $17$
  3. $17.5$ and $14$
  4. $17$ and $17$
Explanation. The relaxation uses only the most efficient item: $10\cdot\frac74=17.5$. Integer: $(7,4)+2\cdot(5,3)$ weighs $10$ and is worth $17$; two copies of $(7,4)$ are worth only $14$.
oc-f-497 · level teorema · notes
In the linear relaxation of the model $\mathrm{ILP}_{\mathrm{UKP}}$ of the unbounded knapsack ($\max\sum_jp_jx_j$, $\sum_jw_jx_j\le c$, $x_j\ge0$) the optimum uses only the item of maximum efficiency $p_j/w_j$. Why?
  1. Without upper bounds on the $x_j$, every unit of capacity yields more on that item
  2. Because in the unbounded knapsack the other items are infeasible
  3. Because the relaxation of an integer problem always has a single positive variable
  4. Because the most efficient item is also the lightest
Explanation. It is the same reasoning as for $\mathrm{LP}\text{-}0_{\mathrm{KP}}$: with only the capacity constraint, the value is $c\cdot\max_jp_j/w_j$.
oc-f-498 · level teorema · notes
The linear relaxation of the 0/1 knapsack is solved by sorting by efficiency $p_j/w_j$. Why does this method not apply to the linear relaxation of the multidimensional knapsack (MDKP, weights $w_{dj}$ and capacities $c_d$ per dimension)?
  1. Because the relaxation of the MDKP is always integer
  2. Because in the MDKP the variables are integer and not binary
  3. Because the relaxation of the MDKP is unbounded
  4. Every item has one weight per dimension: no single efficiency
Explanation. With $|\mathscr{D}|\ge2$ constraints the LP optimum may have several fractional variables and must be computed as a general LP (e.g., with the simplex method).
oc-f-499 · level facile · notes
In the model of the multidimensional knapsack (MDKP: one constraint $\sum_jw_{dj}x_j\le c_d$ per dimension $d$, $x_j\in\{0,1\}$) a dimension has $\sum_jw_{dj}\le c_d$. What can be done with its constraint?
  1. Turn it into an equality
  2. Remove it together with all items of that dimension
  3. Remove it: it cuts no binary vector
  4. Keep it: it is the tightest constraint
Explanation. Even taking all items that dimension is not saturated: the constraint is redundant. A single dimension with $\sum_jw_{dj}>c_d$ is enough for the problem not to be trivial.
oc-f-500 · level teorema · notes
In the model $\mathrm{ILP}_{\mathrm{MKP}}$ of the multiple knapsack ($x_{jk}=1$ if item $j$ goes into knapsack $k$) all $m$ knapsacks have the same capacity. A partition of the items into $m$ non-empty groups corresponds to how many solutions of the model?
  1. $2^m$: one per subset of knapsacks
  2. $m!$: one per permutation of the knapsacks
  3. $1$: the model distinguishes the groups
  4. $m$: one per knapsack
Explanation. With equal capacities the knapsacks are interchangeable: permuting the indices $k$ gives $m!$ equivalent solutions (symmetry), which slow down branch-and-bound.
oc-f-501 · level ipotesi · notes
In the model $\mathrm{ILP}_{\mathrm{MKP}}$ of the multiple knapsack the constraint of every item is $\sum_kx_{jk}\le1$. What would change by writing $\sum_kx_{jk}=1$?
  1. All items must be loaded: it may have no solution
  2. Nothing, because the optimum loads all items anyway
  3. An item could be put into two knapsacks
  4. The problem would become a 0/1 knapsack
Explanation. With the equality no item stays out; if the total weight exceeds the total capacity (an assumption of the MKP) the model has no solutions.
oc-f-502 · level facile · notes
The model $\mathrm{ILP}_{\mathrm{MCKP}}$ of the multiple-choice knapsack has $n$ items in $q$ classes. How many variables and how many linear constraints does it have, besides the domain constraints?
  1. $n\cdot q$ binary variables, $q$ constraints
  2. $n$ binary variables, $1$ constraint
  3. $n+q$ binary variables, $n$ constraints
  4. $n$ binary variables, $1+q$ constraints
Explanation. One $x_j$ per item; the capacity constraint and one constraint $\sum_{j\in\mathscr{J}_h}x_j=1$ per class.
oc-f-503 · level teorema · notes
In the multiple-choice knapsack (MCKP: exactly one item per class, capacity $c$) two items $a$ and $b$ of the same class have $p_a\le p_b$ and $w_a\ge w_b$. Can $a$ be removed without losing the optimum?
  1. Yes, but only when the two weights are equal
  2. No: every class must keep all its items
  3. Yes: swapping $a$ for $b$ keeps feasibility and profit
  4. No: $a$ might help to fill the knapsack better
Explanation. $a$ is dominated by $b$: it weighs at least as much as $b$ and yields at most as much as $b$. Every solution with $a$ has a solution with $b$ that is at least as good.
oc-f-504 · level teorema · notes
In the model $\mathrm{ILP}_{\mathrm{KPS}}$ of the knapsack with setups ($x_j\le y_h$ for every item $j$ of class $h$; setup cost $f_h\ge1$ and weight $s_h\ge1$) there is no constraint forbidding to activate a class without chosen items. Why is it not needed?
  1. It is needed: without it the model is wrong
  2. Activating it empty costs $f_h$ and uses $s_h$: never optimal
  3. Because $y_h\le x_j$ is already implied by $x_j\le y_h$
  4. Because every class must always be activated
Explanation. Setting $y_h=0$ in a class without chosen items improves the objective and frees capacity: no optimal solution has needlessly activated classes.
oc-f-505 · level teorema · notes
In the knapsack with setups the item-class link can be written with the disaggregated constraints $x_j\le y_h$ (one per item $j$ of class $h$) or the aggregated ones $\sum_{j\in\mathscr{J}_h}x_j\le|\mathscr{J}_h|\,y_h$ (one per class). Which formulation has the stronger linear relaxation?
  1. The disaggregated one: its solutions satisfy the aggregated one
  2. The aggregated one, because it has fewer constraints
  3. They have the same relaxation, because they describe the same integer solutions
  4. The aggregated one, because the coefficient $|\mathscr{J}_h|$ is larger
Explanation. Summing $x_j\le y_h$ over the class gives the aggregated constraint, not vice versa: e.g., $x=(1,0)$, $y_h=\frac12$ satisfies the aggregated one but not $x_1\le y_h$.

10. Formulations of packing problems (26)

oc-f-036 · level teorema · notes
Bin packing ($n$ items of weight $w_j$, bins of capacity $c$): $\mathrm{ILP}_{\mathrm{BPP}}$ has variables $y_b$ (bin $b$ used) and $x_{jb}$ (item $j$ in bin $b$), and $\mathrm{LP}_{\mathrm{BPP}}$ is its LP relaxation. Which statement is correct?
  1. $z(\mathrm{LP}_{\mathrm{BPP}})=\sum_j w_j/c$ and $z(\mathrm{LP}_{\mathrm{BPP}})/z(\mathrm{ILP}_{\mathrm{BPP}})\ge\frac12$, with $\frac12$ reached asymptotically
  2. $z(\mathrm{LP}_{\mathrm{BPP}})=\sum_j w_j/c$ and $z(\mathrm{LP}_{\mathrm{BPP}})=z(\mathrm{ILP}_{\mathrm{BPP}})$ for every instance with integer weights
  3. $z(\mathrm{LP}_{\mathrm{BPP}})=\sum_j w_j/c$ and $z(\mathrm{LP}_{\mathrm{BPP}})/z(\mathrm{ILP}_{\mathrm{BPP}})\ge\frac{10}{17}$, with $\frac{10}{17}$ reached asymptotically
  4. $z(\mathrm{LP}_{\mathrm{BPP}})=n/2$ and $z(\mathrm{LP}_{\mathrm{BPP}})/z(\mathrm{ILP}_{\mathrm{BPP}})\ge\frac12$, with $\frac12$ reached asymptotically
Explanation. Corollary 10.5 and Propositions 10.6–10.7: the value of the relaxation is the total weight divided by the capacity, and it is at least half of the integer optimum; the ratio $\frac12$ is attained as $c\to+\infty$.
oc-f-037 · level ipotesi · notes
In bin packing (capacity $c$), the LP relaxation of the model $\mathrm{ILP}_{\mathrm{BPP}}$ has value $z(\mathrm{LP}_{\mathrm{BPP}})=\sum_j w_j/c$. Which key fact is used to prove $z(\mathrm{LP}_{\mathrm{BPP}})/z(\mathrm{ILP}_{\mathrm{BPP}})\ge\frac12$?
  1. In an optimal solution every item has weight not exceeding $c/2$
  2. In an optimal solution the bins are sorted by non-increasing total weight
  3. The dual of the LP relaxation always has an integer optimal solution
  4. In an optimal solution at most one bin has total weight not exceeding $c/2$
Explanation. If two bins weighed at most $c/2$ each, their contents would fit in one bin, against optimality: so almost all the bins are more than half full and $\sum_j w_j/c$ exceeds about $z/2$.
oc-f-038 · level facile · notes
The bin packing model $\mathrm{ILP}_{\mathrm{BPP}}$ with $m$ available bins has $y_b=1$ if bin $b$ is used, $x_{jb}=1$ if item $j$ goes into bin $b$, and minimizes $\sum_b y_b$. Which statement is correct?
  1. $m$ must be at least the number of bins of an optimal solution; the constraints force $y_b=0$ for every empty bin
  2. $m$ must be at least $n$; permuting the bins gives solutions with different objective values
  3. $m$ must be at least the number of bins of an optimal solution; an empty bin may have $y_b=1$, but not in an optimum
  4. $m$ may be the weight bound $\lceil\sum_j w_j/c\rceil$; an empty bin may have $y_b=1$, but not in an optimum
Explanation. With $m$ too small the model may have no feasible solution; an empty bin may have $y_b=1$, but not in an optimal solution. Permuting the bins gives equivalent solutions (symmetry).
oc-f-148 · level facile · notes
The $\mathrm{ILP}_{\mathrm{BPP}}$ model of bin packing with $n$ items and $m$ available bins has binary variables $y_b$ (bin used) and $x_{jb}$ (item $j$ in bin $b$), constraints $\sum_b x_{jb}=1$ and $\sum_j w_jx_{jb}\le c\,y_b$. With $n=5$ and $m=3$, how many variables and linear constraints does it have?
  1. $18$ variables and $8$ constraints
  2. $15$ variables and $8$ constraints
  3. $18$ variables and $15$ constraints
  4. $8$ variables and $18$ constraints
Explanation. The variables are $m+nm=3+15=18$; the constraints are $n=5$ assignment and $m=3$ capacity constraints, i.e., $8$.
oc-f-149 · level facile · notes
Bin packing with capacity $c=10$ and three items of weight $6$. The LP relaxation of the $\mathrm{ILP}_{\mathrm{BPP}}$ model equals $\sum_j w_j/c$. What are $z(\mathrm{LP}_{\mathrm{BPP}})$, its round-up and the optimal value?
  1. $\frac95$, $2$ and $2$
  2. $3$, $3$ and $3$
  3. $\frac{18}{5}$, $4$ and $3$
  4. $\frac95$, $2$ and $3$
Explanation. $\sum_j w_j/c=18/10=9/5$ and $\lceil 9/5\rceil=2$; but two items of weight $6$ do not fit together, so $3$ bins are needed.
oc-f-150 · level teorema · notes
In bin packing ($n$ items of weight $w_j$, capacity $c$, $m$ available bins), which solution is optimal for the LP relaxation of the $\mathrm{ILP}_{\mathrm{BPP}}$ model (assignment variables $x_{jb}$, usage variables $y_b$, objective $\min\sum_b y_b$)?
  1. $\tilde x_{jb}=\frac1n$ for all $j,b$ and $\tilde y_b=\frac{\sum_j w_j}{nc}$ for all $b$
  2. $\tilde x_{j1}=1$ for all $j$ and $\tilde y_1=\frac{\sum_j w_j}{c}$, the other $\tilde y_b=0$
  3. $\tilde x_{jb}=\frac1m$ for all $j,b$ and $\tilde y_b=\frac{\sum_j w_j}{mc}$ for all $b$
  4. $\tilde x_{jb}=\frac1m$ for all $j,b$ and $\tilde y_b=1$ for all $b$
Explanation. Every item is split equally among the $m$ bins, and every $y_b$ equals the fractional load divided by $c$; the sum is $\sum_j w_j/c$. The last option has $\tilde y_1>1$ if the total weight exceeds $c$, so it violates $y_b\le 1$.
oc-f-151 · level teorema · notes
In bin packing the LP relaxation of the $\mathrm{ILP}_{\mathrm{BPP}}$ model equals $\sum_j w_j/c$. Which family of instances shows that the ratio $z(\mathrm{LP}_{\mathrm{BPP}})/z(\mathrm{ILP}_{\mathrm{BPP}})$ tends to $\frac12$ as $c\to+\infty$?
  1. $c$ items of weight $1$: the relaxation is $1$ and $1$ bin is needed
  2. Two items of weight $\frac c2+1$: the relaxation is $\frac{c+2}{c}\to 1$ and $2$ bins are needed
  3. Two items of weight $\frac c2$: the relaxation is $1$ and $2$ bins are needed
  4. One item of weight $c$: the relaxation is $1$ and $1$ bin is needed
Explanation. Two items of weight $\frac c2+1$ do not fit together, so $z(\mathrm{ILP})=2$, while $z(\mathrm{LP})=\frac{c+2}{c}$; the ratio $\frac{c+2}{2c}$ tends to $\frac12$. Two items of weight $\frac c2$ fit into one bin.
oc-f-152 · level teorema · notes
In bin packing, also the rounded bound $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil=\lceil\sum_j w_j/c\rceil$ has a ratio to the optimum tending to $\frac12$, as $n\to+\infty$. Which family of instances shows it?
  1. $n$ items of weight $\frac c2+1$: the bound is about $\frac n2$ and $n$ bins are needed
  2. $n$ items of weight $\frac c2$: the bound is $\frac n2$ and $\frac n2$ bins are needed
  3. $n$ items of weight $1$: the bound is $\lceil n/c\rceil$ and $n$ bins are needed
  4. $n$ items of weight $c$: the bound is $n$ and $n$ bins are needed
Explanation. Items heavier than $\frac c2$ go one per bin, so the optimum is $n$; their total weight divided by $c$ is a bit more than $\frac n2$, and the ratio tends to $\frac12$.
oc-f-153 · level facile · notes
In the LP relaxation of the $\mathrm{ILP}_{\mathrm{BPP}}$ bin packing model (constraints $\sum_b x_{jb}=1$ and $\sum_j w_jx_{jb}\le c\,y_b$, $0\le x,y\le 1$), why is the optimal value only $\sum_j w_j/c$?
  1. The $x_{jb}$ stay binary, but bins can be filled beyond their capacity
  2. The relaxation uses a single bin, of capacity $\sum_j w_j$
  3. The constraint $\sum_b x_{jb}=1$ is relaxed into $\sum_b x_{jb}\ge 0$
  4. Fractional $y_b$ pay only for the occupied part of a bin, as if the items were divisible
Explanation. With $y_b=\sum_j w_jx_{jb}/c$ the cost of a bin is proportional to its load: the relaxation measures only the total weight, and ignores that items cannot be split.
oc-f-154 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{CSP}}$ model of cutting stock, item $j$ has demand $d_j$ and the integer variable $x_{jb}$ counts its copies in bin $b$. Which constraint guarantees the demand?
  1. $\sum_j x_{jb}=d_j$ for every bin $b$
  2. $x_{jb}\le d_j\,y_b$ for all $j,b$
  3. $\sum_b x_{jb}=d_j$ for every item $j$
  4. $\sum_b x_{jb}=1$ for every item $j$
Explanation. The copies of item $j$ distributed among the bins must be exactly $d_j$. With $d_j=1$ the constraint becomes the assignment constraint of bin packing.
oc-f-155 · level facile · notes
Cutting stock with $n=4$ items, demands $d=(2,1,3,1)$ and $m=3$ available bins. The $\mathrm{ILP}_{\mathrm{CSP}}$ model uses one integer variable $x_{jb}$ per item and bin; the bin packing model on the copies uses one binary variable per copy and bin. How many assignment variables does each have?
  1. $21$ integer and $12$ binary
  2. $12$ integer and $21$ binary
  3. $12$ integer and $12$ binary
  4. $7$ integer and $21$ binary
Explanation. $\mathrm{ILP}_{\mathrm{CSP}}$: $nm=12$; bin packing on the $\sum_j d_j=7$ copies: $7\cdot 3=21$. The copies of an item are identical, and a single integer variable counts them.
oc-f-156 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{CSP}}$ model of cutting stock (items with demand $d_j$) the number $m$ of available bins must be fixed. Which value of $m$ is always valid?
  1. $m=\sum_j d_j$, or the number of bins of any feasible solution
  2. $m=n$, the number of distinct items, whatever the demands
  3. $m=\lceil\sum_j d_jw_j/c\rceil$, the weight bound
  4. $m=\max_j d_j$, the largest demand
Explanation. With one bin per copy every instance is solved, and the number of bins of a known solution is enough too. The weight bound is a lower bound: with $m$ smaller than the optimum the model has no solution.
oc-f-305 · level facile · notes
The bin packing ILP model uses $m$ potential bins, $x_{jb}=1$ if item $j$ goes into bin $b$ and $y_b=1$ if bin $b$ is used. What must hold for $m$?
  1. $m$ must equal the optimal value
  2. $m$ must be the lower bound $\lceil\sum_jw_j/c\rceil$
  3. $m$ can be anything, even smaller than the optimum
  4. $m$ must be an upper bound on the number of bins, e.g., $m=n$ or the value of a heuristic
Explanation. With $m$ smaller than the optimum the model would be infeasible; with $m$ large the model has more variables and more symmetry. A heuristic solution gives a valid value.
oc-f-306 · level facile · notes
In the bin packing ILP model (items $j$ of weight $w_j$, bins $b$ of capacity $c$) the capacity constraint reads $\sum_jw_jx_{jb}\le c\,y_b$. Why does $y_b$ appear on the right-hand side?
  1. To allow exceeding the capacity when $y_b=1$
  2. It is not needed: one could write $\le c$
  3. It links the use of the bin to the items: if $y_b=0$ no item can go into $b$
  4. To count full bins twice
Explanation. With $\le c$ the used bins would not be linked to the variables $y_b$, and the model would minimize $\sum_by_b$ by setting all $y_b=0$.
oc-f-307 · level teorema · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{BPP}}$ of bin packing (variables $x_{jb},y_b\ge0$) has optimal value $\sum_jw_j/c$. With weights $w=(7,6,5,4,3,3)$ and $c=10$, which integer lower bound on the number of bins follows?
  1. $\frac{14}{5}$
  2. $3$
  3. $2$
  4. $6$
Explanation. $\sum_jw_j=28$, hence $z(\mathrm{LP}\text{-}0)=2.8$ and, since the number of bins is integer, at least $\lceil2.8\rceil=3$. $\frac{14}{5}$ is the unrounded value.
oc-f-308 · level facile · notes
In bin packing, summing the constraints $\sum_jw_jx_{jb}\le c\,y_b$ over all bins and using $\sum_bx_{jb}=1$, one obtains an inequality valid for every solution of the LP relaxation. Which one?
  1. $\sum_by_b\ge\sum_jw_j/c$
  2. $\sum_by_b\le\sum_jw_j/c$
  3. $\sum_by_b\ge n$
  4. $\sum_by_b\ge\max_jw_j/c$
Explanation. $c\sum_by_b\ge\sum_b\sum_jw_jx_{jb}=\sum_jw_j$. It is the weight bound; a solution attaining it, for instance with the $y_b$ concentrated on the first bins, is optimal.
oc-f-309 · level teorema · notes
For bin packing $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil/z(\mathrm{ILP}_{\mathrm{BPP}})\ge\frac12$, with $z(\mathrm{LP}_{\mathrm{BPP}})=\sum_jw_j/c$. On which fact does the proof rely?
  1. In an optimal solution every bin is full
  2. Every item weighs at least $c/2$
  3. The LP relaxation always has an integer solution
  4. In an optimal solution at most one bin has load at most $c/2$, otherwise two would be merged
Explanation. If two bins had load $\le c/2$, their content would fit into one. Hence almost all loads are $>c/2$ and $\sum_jw_j$ exceeds about $zc/2$.
oc-f-310 · level ipotesi · notes
In the proof of $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil\ge\frac12 z(\mathrm{ILP}_{\mathrm{BPP}})$ for bin packing one uses that at most one bin has load $\le c/2$. Why does the property apply to an optimal solution and not to any solution?
  1. Because only an optimal solution uses bins of capacity $c$
  2. There is no difference: it holds for every solution
  3. Any solution may have many almost empty bins, which an optimal solution would have merged
  4. Because in any solution the loads exceed $c$
Explanation. Putting every item into a different bin is feasible and may have all loads small; the merging argument requires optimality.
oc-f-506 · level facile · notes
The ILP models of packing problems use a set $\mathscr{B}=\{1,\dots,m\}$ of usable bins. Why is it necessary to fix an upper bound $m$ on the number of bins?
  1. Because with more than $m$ bins the relaxation is unbounded
  2. Because $m$ is the optimal value, known in advance
  3. To have finitely many variables; $m\ge z(I)$ keeps an optimum
  4. Because the problem asks to use exactly $m$ bins
Explanation. The variables are indexed over the bins; $m=n$ always suffices (one item per bin), and a smaller value that is still $\ge z(I)$, e.g., from a heuristic, gives a smaller model.
oc-f-507 · level facile · notes
In the ILP models of packing problems $x_{jb}=1$ if item $j$ goes into bin $b$. Which constraint guarantees that every item is packed into exactly one bin?
  1. $\sum_j w_jx_{jb}\le c$ for every bin $b$
  2. $\sum_{b\in\mathscr{B}}x_{jb}=1$ for every item $j$
  3. $\sum_{j}x_{jb}=1$ for every bin $b$
  4. $\sum_{b\in\mathscr{B}}x_{jb}\le1$ for every item $j$
Explanation. The assignment constraint is written per item. With $\le1$ an item could stay out, as in the multiple knapsack; the capacity constraint bounds the load, not the assignment.
oc-f-508 · level teorema · notes
In the ILP model of bin packing the bins are identical, so permuting the indices $b$ gives equivalent solutions. What is the effect of adding the constraints $y_b\ge y_{b+1}$ for $b=1,\dots,m-1$ ($y_b=1$ if bin $b$ is used)?
  1. It removes symmetric solutions, but not the optimal value
  2. It makes the model invalid, because it excludes optimal solutions
  3. It makes the linear relaxation integer
  4. None: these constraints are already implied by the model
Explanation. Every solution can be renumbered so that the used bins are $1,\dots,k$: the value does not change, and branch-and-bound explores fewer equivalent solutions.
oc-f-509 · level facile · notes
Model $\mathrm{ILP}_{\mathrm{BPP}}$ ($\min\sum_by_b$, $\sum_bx_{jb}=1$, $\sum_jw_jx_{jb}\le c\,y_b$): weights $w=(6,5,4)$, $c=10$, $m=3$. Why is the solution $x_{11}=x_{31}=1$, $x_{22}=1$, $y=(1,0,1)$ infeasible?
  1. Bin $1$ exceeds the capacity $c$
  2. Item $2$ is assigned to two bins
  3. Bin $3$ is activated but empty
  4. In bin $2$ the load $5$ exceeds $c\,y_2=0$
Explanation. $y_2=0$ sets the capacity of bin $2$ to zero, but item $2$ is assigned to it. An activated empty bin $3$ is feasible, just not optimal; bin $1$ carries $6+4=10$.
oc-f-510 · level facile · notes
In the model $\mathrm{ILP}_{\mathrm{BPP}}$ of bin packing ($y_b=1$ if bin $b$ is used, $\sum_by_b$ is minimized), can a solution have $y_b=1$ for a bin without items?
  1. No, because $\sum_bx_{jb}=1$ forbids it
  2. Yes, and it is optimal if all the other bins are full
  3. Yes, but it is not optimal: set $y_b=0$
  4. No, the capacity constraint forbids it
Explanation. No constraint forces an activated bin to contain items; but its $y_b$ can be set to zero, reducing the objective by $1$.
oc-f-511 · level teorema · notes
In the linear relaxation of the bin packing model (constraints $\sum_jw_jx_{jb}\le c\,y_b$, objective $\min\sum_by_b$, continuous variables), why does every capacity constraint hold with equality at an optimal solution?
  1. It is not true: the capacity constraints are always slack
  2. If it were slack, $y_b$ could be reduced, lowering the objective
  3. Because every bin must be full in the integer solution
  4. Because the variables $x_{jb}$ are all equal to $1/m$
Explanation. $y_b$ appears only in its constraint and in the objective with a positive coefficient: at the optimum $y_b=\sum_jw_jx_{jb}/c$, and summing over $b$ gives $\sum_jw_j/c$.
oc-f-512 · level facile · notes
In bin packing the linear relaxation of the model $\mathrm{ILP}_{\mathrm{BPP}}$ is $\sum_jw_j/c$. To which combinatorial bound does $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil$ correspond?
  1. To the weight bound $\lceil\sum_jw_j/c\rceil$
  2. To the number of items heavier than $c/2$
  3. To the number of bins of First Fit
  4. To the number of items $n$
Explanation. The relaxation sees nothing but the total weight: rounded up, it is the weight bound of Chapter 3, which does not count, e.g., the items that cannot stay together.
oc-f-513 · level teorema · notes
Cutting stock (demand $d_j$ of item $j$) can be modelled as bin packing on the extended set of the $\sum_jd_j$ copies, or with integer variables $x_{jb}$ (number of copies of $j$ in bin $b$). What does the second model gain?
  1. A linear relaxation that is always integer
  2. The possibility of not cutting all required copies
  3. A number of available bins that is no longer needed
  4. Fewer variables and no symmetries among identical copies
Explanation. Identical copies, treated as different items, multiply variables and equivalent solutions; counting them with one integer per (item, bin) pair avoids both.

11. Formulations of coloring problems (19)

oc-f-039 · level teorema · notes
The vertex coloring model $\mathrm{ILP}_{\mathrm{VCP}}$ has $x_{vc}=1$ if vertex $v$ takes color $c$, $y_c=1$ if color $c$ is used, and the constraints $x_{uc}+x_{vc}\le y_c$ for every edge $\{u,v\}$. What is its LP relaxation value $z(\mathrm{LP}_{\mathrm{VCP}})$ on a graph with at least one edge (at least $2$ available colors)?
  1. $\omega(G)$, the cardinality of a maximum clique
  2. $\lceil n/\alpha(G)\rceil$, with $\alpha(G)$ the maximum stable set size
  3. $2$, for every graph with at least one edge
  4. $\chi(G)$, the chromatic number of the graph
Explanation. Putting $\frac12$ on two colors for all the vertices is feasible and costs $2$; the dual solution on an edge $\{u,v\}$ certifies optimality. The bound is very weak: on the complete graph $\chi=n$.
oc-f-040 · level facile · notes
The vertex coloring model $\mathrm{ILP}_{\mathrm{VCP}}$ with $k$ available colors has the variables $x_{vc}$ (vertex $v$ takes color $c$) and $y_c$ (color $c$ is used). How many variables does it have for a graph with $n=5$ vertices and $k=5$?
  1. $35$
  2. $30$
  3. $25$
  4. $10$
Explanation. There are $k\cdot n=25$ variables $x_{vc}$ and $k=5$ variables $y_c$: $30$ in total. The value $k=n$ is always valid.
oc-f-041 · level facile · notes
In the vertex coloring model $\mathrm{ILP}_{\mathrm{VCP}}$ of $G$ (variables $x_{vc}$ and $y_c$ for $k$ available colors), what happens if $k$ is smaller than the chromatic number $\chi(G)$?
  1. The model has no feasible solution
  2. The model still finds a coloring with $\chi(G)$ colors
  3. The LP relaxation of the model becomes unbounded
  4. The optimal value becomes $k$, with two adjacent vertices of the same color
Explanation. With fewer than $\chi(G)$ colors no coloring is feasible: $k$ must be at least $\chi(G)$, and $k=n$ always works.
oc-f-157 · level facile · notes
The $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model with $k$ colors has one constraint $\sum_c x_{vc}=1$ per vertex and one constraint $x_{uc}+x_{vc}\le y_c$ per edge and color. How many linear constraints does it have for a graph with $n=5$ vertices, $m=6$ edges and $k=3$?
  1. $23$
  2. $11$
  3. $18$
  4. $30$
Explanation. $n=5$ assignment constraints plus $mk=18$ edge constraints: $23$. The value $11=n+m$ forgets that edge constraints are written for every color.
oc-f-158 · level teorema · notes
In the LP relaxation of the $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model (constraints $\sum_c x_{vc}=1$ and $x_{uc}+x_{vc}\le y_c$), why is the solution $x_{v1}=x_{v2}=\frac12$ for every vertex, $y_1=y_2=1$ and the rest zero feasible on every graph?
  1. Because the graph is bipartite, and two colors suffice also in the integer model
  2. Because every vertex has degree at most $2$ when the variables are fractional
  3. Because the edge constraints are relaxed into $x_{uc}+x_{vc}\ge 0$
  4. For every edge and color $x_{uc}+x_{vc}\le\frac12+\frac12=1=y_c$, and every vertex has total color $1$
Explanation. The two halves of color respect every edge constraint, whatever the graph; the value is $y_1+y_2=2$. This is why $z(\mathrm{LP}_{\mathrm{VCP}})=2$ on every graph with at least one edge.
oc-f-159 · level facile · notes
In vertex coloring, the LP relaxation of the $\mathrm{ILP}_{\mathrm{VCP}}$ model equals $2$ on every graph with at least one edge. What is the ratio $z(\mathrm{LP}_{\mathrm{VCP}})/z(\mathrm{ILP}_{\mathrm{VCP}})$ on the complete graph $K_{10}$?
  1. $1$
  2. $\frac1{10}$
  3. $\frac15$
  4. $\frac12$
Explanation. $\chi(K_{10})=10$ and the relaxation equals $2$: the ratio is $\frac{2}{10}=\frac15$. On large complete graphs the ratio tends to $0$: the bound is arbitrarily weak.
oc-f-160 · level teorema · notes
For the $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model two relaxations are compared: $\mathrm{LP}\text{-}0_{\mathrm{VCP}}$, with only $x,y\ge 0$, and $\mathrm{LP}_{\mathrm{VCP}}$, with also $x_{vc}\le 1$ and $y_c\le 1$. Which statement is correct, for a graph with at least one edge?
  1. $\mathrm{LP}\text{-}0_{\mathrm{VCP}}$ equals $2$ and $\mathrm{LP}_{\mathrm{VCP}}$ equals $\omega(G)$
  2. Both equal $2$: the upper bounds do not strengthen the relaxation
  3. $\mathrm{LP}\text{-}0_{\mathrm{VCP}}$ equals $1$ and $\mathrm{LP}_{\mathrm{VCP}}$ equals $2$
  4. $\mathrm{LP}\text{-}0_{\mathrm{VCP}}$ is unbounded and $\mathrm{LP}_{\mathrm{VCP}}$ equals $2$
Explanation. The same solution with two halves of color is optimal for both, with value $2$ (Corollaries 11.2 and 11.5): adding the upper bounds does not change the bound.
oc-f-161 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model with $k$ available colors (variables $x_{vc}$ and $y_c$), an optimal coloring with $q$ colors corresponds to how many optimal model solutions, if $k=q$?
  1. $q!$, one per permutation of the colors
  2. $1$, because the colors are numbered
  3. $2^q$, one per subset of colors
  4. $q^n$, one per assignment of the colors
Explanation. Renaming the colors gives another model solution with the same value: $q!$ equivalent solutions. This symmetry, as in bin packing, makes the model hard for branch-and-bound.
oc-f-162 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model the number $k$ of available colors must be fixed. Which choice is always valid and does not weaken the model needlessly?
  1. The size of a clique found by hand, because it is a lower bound
  2. The stable set bound $\lceil n/\alpha(G)\rceil$
  3. Always $k=2$, because the LP relaxation equals $2$
  4. The number of colors of a heuristic coloring, for example of $DSATUR$
Explanation. We need $k\ge\chi(G)$: the number of colors of a feasible coloring works, and a small $k$ reduces variables and symmetry. A lower bound may be smaller than $\chi(G)$ and make the model infeasible.
oc-f-163 · level facile · notes
The $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model and the $\mathrm{ILP}_{\mathrm{BPP}}$ bin packing model are assignment models. Which correspondence between the two is correct?
  1. Edge ↔ item, color ↔ bin, vertex constraints ↔ capacity constraints
  2. Vertex ↔ item, color ↔ bin, edge constraints ↔ assignment constraints
  3. Vertex ↔ item, color ↔ bin, edge constraints ↔ capacity constraints
  4. Vertex ↔ bin, color ↔ item, edge constraints ↔ assignment constraints
Explanation. A vertex receives a color as an item goes into a bin, and $y_c$ counts the colors as $y_b$ the bins; what can stay together is decided by the edges instead of the capacity.
oc-f-164 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{VCP}}$ coloring model ($x_{vc}=1$ if vertex $v$ has color $c$, $y_c=1$ if color $c$ is used), what do the constraints $x_{uc}+x_{vc}\le y_c$, written for every edge $\{u,v\}$ and color $c$, forbid?
  1. A color used by more than two vertices
  2. Two adjacent vertices with the same color, and using a color with $y_c=0$
  3. Two non-adjacent vertices with the same color
  4. A vertex with two different colors
Explanation. With $y_c=1$ at most one endpoint of the edge has color $c$; with $y_c=0$ neither does. One color per vertex is imposed by the constraints $\sum_c x_{vc}=1$.
oc-f-200 · level facile · notes
In vertex coloring the LP relaxation of the $\mathrm{ILP}_{\mathrm{VCP}}$ model equals $2$ on every graph with at least one edge. On which graphs does this bound equal the chromatic number $\chi(G)$?
  1. On all planar graphs, where $\chi(G)\le 4$
  2. On bipartite graphs with at least one edge, for example even cycles
  3. On complete graphs, where $\chi(G)=n$
  4. On odd cycles, where $\chi(G)=3$
Explanation. The bound is exact only when $\chi(G)=2$, i.e., on bipartite graphs with at least one edge. Already on an odd cycle it is $2<3$, and on $K_n$ it is $2<n$.
oc-f-311 · level teorema · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{VCP}}$ of the coloring model ($x_{vc}=1$ if vertex $v$ has color $c$, $y_c=1$ if color $c$ is used, constraints $x_{uc}+x_{vc}\le y_c$ on the edges) has optimal value $2$ for every graph with at least one edge. What does this say about the bound?
  1. It is as strong as the clique bound $\omega(G)$
  2. It holds only for bipartite graphs
  3. It is weak: it gives $\chi(G)\ge2$ even on graphs needing many colors
  4. It is exact: $\chi(G)=2$ for every graph
Explanation. Setting $x_{v1}=x_{v2}=\frac12$ and $y_1=y_2=1$ every constraint is satisfied whatever the graph: the relaxation does not see the structure of the edges.
oc-f-312 · level facile · notes
In the LP relaxation of the coloring model ($x_{vc}$, $y_c$, constraints $x_{uc}+x_{vc}\le y_c$ for every edge $\{u,v\}$ and color $c$, $\sum_cx_{vc}=1$) one sets $x_{v1}=x_{v2}=\frac12$ for every vertex. Which minimum values of $y_1$ and $y_2$ make the edge constraints feasible?
  1. $y_1=1$, $y_2=0$, with value $1$
  2. $y_1=y_2=1$, with value $2$
  3. $y_1=y_2=\frac12$, with value $1$
  4. $y_1=y_2=0$, with value $0$
Explanation. For an edge $\{u,v\}$: $x_{u1}+x_{v1}=\frac12+\frac12=1\le y_1$, and the same for color $2$. The value $y_1+y_2=2$ is the optimum of the relaxation.
oc-f-313 · level facile · notes
In the vertex coloring ILP model one fixes a number $k$ of available colors, with variables $x_{vc}$ and $y_c$ for $c=1,\dots,k$. Which value of $k$ guarantees that the model is feasible?
  1. An upper bound on $\chi(G)$, e.g., the number of colors of a heuristic or $n$
  2. The clique number $\omega(G)$
  3. The stability number $\alpha(G)$
  4. $k=2$
Explanation. With $k<\chi(G)$ there is no coloring with $k$ colors. $\omega(G)$ is a lower bound, not an upper bound.
oc-f-342 · level ipotesi · notes
In the coloring ILP model ($x_{vc}=1$ if vertex $v$ has color $c$, $y_c=1$ if color $c$ is used, $\sum_cy_c$ is minimized) the edge constraint is $x_{uc}+x_{vc}\le y_c$. What would happen writing $x_{uc}+x_{vc}\le1$ instead?
  1. Nothing: the two constraints are equivalent
  2. The model would become infeasible
  3. Two adjacent vertices could have the same color
  4. The $y_c$ would no longer be linked to the colors used: the model would set all $y_c=0$ and the optimal value would be $0$
Explanation. $x_{uc}+x_{vc}\le1$ still forbids conflicts, but does not force paying $y_c$ when the color is used; the constraint with $y_c$ does both (and linking constraints are needed for isolated vertices too).
oc-f-514 · level facile · notes
The ILP model of vertex colouring with $k$ available colours has one constraint $x_{uc}+x_{vc}\le y_c$ for every edge $\{u,v\}$ and every colour $c$. How many such constraints are there for a graph with $m$ edges?
  1. $m$
  2. $k$
  3. $n\cdot k$
  4. $m\cdot k$
Explanation. One constraint per (edge, colour) pair. The $n$ assignment constraints $\sum_cx_{vc}=1$ are a different family.
oc-f-515 · level teorema · notes
In the colouring model ($x_{vc}=1$ if vertex $v$ has colour $c$, $y_c=1$ if $c$ is used) the edge constraints are $x_{uc}+x_{vc}\le y_c$. For a triangle $\{u,v,w\}$ of $G$, what is the constraint $x_{uc}+x_{vc}+x_{wc}\le y_c$?
  1. Valid but implied by the three edge constraints
  2. Valid only if the triangle is a maximum clique
  3. Valid and stronger than the three edge constraints
  4. Invalid: it excludes feasible colourings
Explanation. A clique has at most one vertex per colour, so the constraint is valid. The fractional solution $x=\frac12$ with $y_c=1$ satisfies the edge constraints but not this one ($\frac32>1$).
oc-f-516 · level facile · notes
The linear relaxation of the colouring model is $2$ on every graph with at least one edge. On the complete graph $K_5$, what does the comparison with the clique bound $\omega(G)$ show?
  1. Both give $2$: $K_5$ needs two colours
  2. Relaxation $2$, clique bound $5=\chi(K_5)$: it is weak
  3. Both give $5$: the relaxation is exact on complete graphs
  4. The relaxation gives $5$ and the clique bound $2$
Explanation. The fractional solution with $x_{vc}=\frac12$ on two colours and $y_1=y_2=1$ stays feasible on $K_5$ too; the $5$-vertex clique instead forces $5$ colours.

12. Formulations of clique problems (37)

oc-f-042 · level teorema · notes
In the maximum clique problem (MCP) on $G$ with $n$ vertices, the edge formulation $\mathrm{ILP}_{\mathrm{MCP}}$ maximizes $\sum_v x_v$ with $x_u+x_v\le 1$ for the non-adjacent pairs; $\mathrm{LP}_{\mathrm{MCP}}$ is its LP relaxation and $\omega(G)$ the optimal value. Which statement holds for every graph?
  1. $z(\mathrm{LP}_{\mathrm{MCP}})\le 2\,\omega(G)$, hence the ratio is at most $2$
  2. $z(\mathrm{LP}_{\mathrm{MCP}})\ge n/2$, hence the ratio $z(\mathrm{LP}_{\mathrm{MCP}})/\omega(G)$ is unbounded
  3. $z(\mathrm{LP}_{\mathrm{MCP}})\le n/2$, hence the ratio $z(\mathrm{LP}_{\mathrm{MCP}})/\omega(G)$ is at most $n/4$
  4. $z(\mathrm{LP}_{\mathrm{MCP}})=\omega(G)$, hence the LP relaxation is always exact
Explanation. The point $x_v=\frac12$ satisfies all the constraints $x_u+x_v\le 1$: the bound is at least $n/2$ even when $\omega(G)=2$.
oc-f-043 · level facile · notes
In the maximum clique problem (MCP) on a graph $G$, the edge formulation uses $x_v=1$ if vertex $v$ is in the clique and constraints $x_u+x_v\le 1$. On which pairs of vertices are they written?
  1. On every pair of non-adjacent vertices of $G$, i.e., on every edge of $\overline{G}$
  2. On every pair of adjacent vertices of $G$, i.e., on every edge of $G$
  3. On every pair of distinct vertices, adjacent or not in $G$
  4. On every pair of vertices at distance exactly two in $G$
Explanation. Two non-adjacent vertices cannot belong to the same clique. Written on the edges of $G$, the same constraints would describe the stable sets of $G$.
oc-f-044 · level ipotesi · notes
In the maximum clique problem on $G$, let $\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}}$ be the LP relaxation of the formulation with the clique inequalities ($\sum_{v\in S}x_v\le 1$ for every maximal stable set $S$). What is used to prove $\omega(G)\le z(\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}})\le\chi(G)$?
  1. It is a relaxation of the problem; its dual is the LP relaxation of the edge formulation; strong duality
  2. The point $x_v=\frac12$ is feasible; the graph is perfect; strong duality
  3. The $DSATUR$ algorithm is optimal; $\omega(G)=\alpha(\overline{G})$; weak duality
  4. It is a relaxation of the problem; its dual is the LP relaxation of a coloring model on the stable sets; weak duality
Explanation. The dual has one variable per stable set: an optimal coloring is an integer feasible solution of value $\chi(G)$, and by weak duality $z(\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}})\le\chi(G)$.
oc-f-165 · level facile · notes
In the maximum clique problem, the LP relaxation $\mathrm{LP}_{\mathrm{MCP}}$ of the edge formulation ($x_u+x_v\le 1$ for every non-adjacent pair, $0\le x_v\le 1$) always admits the point $x_v=\frac12$. On a cycle with $n=10$ vertices (maximum clique $\omega=2$), which bound does this point give?
  1. $z(\mathrm{LP}_{\mathrm{MCP}})\ge 10$, against $\omega=2$
  2. $z(\mathrm{LP}_{\mathrm{MCP}})\ge\frac52$, against $\omega=2$
  3. $z(\mathrm{LP}_{\mathrm{MCP}})\ge 5$, against $\omega=2$
  4. $z(\mathrm{LP}_{\mathrm{MCP}})\ge 2$, equal to $\omega$
Explanation. The point $x_v=\frac12$ satisfies every constraint and is worth $\frac n2=5$. On large sparse graphs the relaxation stays at least $\frac n2$ while $\omega$ is small: the ratio is unbounded.
oc-f-166 · level teorema · notes
In the maximum clique problem on $G$ ($x_v=1$ if vertex $v$ is in the clique), let $Q$ be a stable set of $G$ (pairwise non-adjacent vertices). Why is the clique inequality $\sum_{v\in Q}x_v\le 1$ valid?
  1. It holds only for perfect graphs, where $\omega(G)=\chi(G)$
  2. A clique contains at most one vertex of a stable set
  3. A stable set contains at most one vertex of every maximum clique
  4. It is the sum of the constraints $x_u+x_v\le 1$ on the pairs of $Q$
Explanation. Two vertices of $Q$ are not adjacent, so they cannot be in the same clique. Adding the pair constraints gives $\sum_{v\in Q}x_v\le\frac{|Q|}2$, weaker for $|Q|\ge 3$.
oc-f-167 · level facile · notes
In the maximum clique problem, the formulation with clique inequalities has $\sum_{v\in S}x_v\le 1$ for every maximal stable set $S$ of $G$. On the cycle $C_5$ (maximum clique $2$, chromatic number $3$) the maximal stable sets are the $5$ pairs of non-adjacent vertices. What is the LP relaxation value?
  1. $\frac52$
  2. $2$
  3. $3$
  4. $5$
Explanation. The point $x_v=\frac12$ satisfies the $5$ inequalities and is worth $\frac52$; adding the $5$ inequalities (every vertex is in two pairs) gives $2\sum_v x_v\le 5$. Hence $2\le\frac52\le 3$.
oc-f-168 · level facile · notes
In the maximum clique problem, why does the formulation with one inequality $\sum_{v\in S}x_v\le 1$ per maximal stable set $S$ not need the constraints $x_u+x_v\le 1$ on non-adjacent pairs?
  1. Because the pair constraints are already implied by the bounds $x_v\le 1$
  2. Because non-adjacent pairs are edges of the graph, and edges give no constraint
  3. Because the number of maximal stable sets is always smaller than the number of pairs
  4. Every non-adjacent pair lies in a maximal stable set, whose inequality implies that of the pair
Explanation. A non-adjacent $\{u,v\}$ is a stable set, so it lies in a maximal one $S$, and $x_u+x_v\le\sum_{w\in S}x_w\le 1$ with $x\ge 0$. Maximal stable sets may instead be exponentially many.
oc-f-169 · level facile · notes
The edge formulation of the maximum clique writes $x_u+x_v\le 1$ for every pair of non-adjacent vertices of $G$. How many such constraints does it have for a graph with $n=6$ vertices and $m=9$ edges?
  1. $15$
  2. $36$
  3. $6$
  4. $9$
Explanation. The non-adjacent pairs are the edges of the complement: $\binom62-m=15-9=6$. The $9$ edges of $G$ give no constraint.
oc-f-170 · level facile · notes
For the maximum stable set problem (MSSP) on $G$, with $x_v=1$ if vertex $v$ is in the set, the same formulation as for the maximum clique is used, written on another graph. What are the constraints?
  1. $x_u+x_v=1$ for every edge $\{u,v\}$ of $G$
  2. $x_u+x_v\le 1$ for every edge $\{u,v\}$ of $G$
  3. $x_u+x_v\le 1$ for every non-adjacent pair of $G$
  4. $x_u+x_v\ge 1$ for every edge $\{u,v\}$ of $G$
Explanation. A stable set of $G$ is a clique of $\overline G$: the clique constraints on $\overline G$ are the non-adjacent pairs of $\overline G$, i.e., the edges of $G$. $x_u+x_v\ge 1$ would describe an edge cover.
oc-f-171 · level facile · notes
In the maximum clique problem, the dual of the LP relaxation with clique inequalities is the LP relaxation of a coloring model with one variable $y_Q$ per stable set $Q$. On a graph with $\omega(G)=4$ and $\chi(G)=5$, in which interval does the relaxation $z(\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}})$ lie?
  1. In $[4,5]$
  2. In $[\frac52,4]$
  3. In $[5,+\infty)$
  4. It equals exactly $4$
Explanation. The relaxation is an upper bound on $\omega(G)=4$, and by weak duality it is at most the value of every dual solution, in particular of a coloring with $\chi(G)=5$ colors.
oc-f-172 · level facile · notes
In the vertex-weighted maximum clique problem (VWMCP: weight $w_v>0$ for every vertex) the $\mathrm{ILP}^{\mathrm{VW}}_{\mathrm{MCP}}$ model is obtained from the edge formulation of the maximum clique. What changes?
  1. Only the constraints, which become $w_ux_u+w_vx_v\le 1$
  2. One variable per edge is added, with weight $w_u+w_v$
  3. The constraints are written on the edges of $G$ instead of the non-adjacent pairs
  4. Only the objective function, which becomes $\max\sum_v w_vx_v$
Explanation. The feasible solutions are still the cliques of $G$: only the weight of a vertex in the objective changes. With $w_v=1$ we get back the maximum clique model.
oc-f-173 · level facile · notes
In the $\mathrm{ILP}^{\mathrm{EW}}_{\mathrm{MCP}}$ model of the edge-weighted maximum clique (weights $r_{uv}>0$), the binary variable $y_{uv}$ is $1$ if both endpoints of the edge are in the clique, and $\sum r_{uv}y_{uv}$ is maximized. Why are the constraints $y_{uv}\le x_u$ and $y_{uv}\le x_v$ enough?
  1. Because the constraint $y_{uv}\ge x_u+x_v-1$ would make the model infeasible
  2. Because every edge already has a constraint $x_u+x_v\le 1$ in the model
  3. With positive weights, in an optimum $y_{uv}$ takes the largest allowed value, $\min\{x_u,x_v\}$
  4. Because $y_{uv}=x_ux_v$ is already linear when the variables are binary
Explanation. The two constraints impose $y_{uv}=1\Rightarrow x_u=x_v=1$; the opposite implication is not needed, since leaving $y_{uv}=0$ with both endpoints chosen is never optimal with $r_{uv}>0$.
oc-f-314 · level facile · notes
In the maximum clique ILP models, with $x_v=1$ if vertex $v$ is in the clique, on which pairs of vertices are the conflict constraints $x_u+x_v\le1$ written?
  1. Only on the pairs of vertices of maximum degree
  2. On the non-edges of $G$, i.e., on the edges of the complement $\overline G$
  3. On the edges of $G$
  4. On all pairs of vertices
Explanation. Two non-adjacent vertices cannot both be in the clique. Written on the edges of $G$, the same constraints select stable sets.
oc-f-315 · level ipotesi · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{MCP}}$ of maximum clique replaces $x_v\in\{0,1\}$ by $x_v\ge0$ and keeps $x_u+x_v\le1$ on the non-edges. If a vertex is adjacent to all others, what happens without the bounds $x_v\le1$?
  1. The vertex appears in no constraint and the relaxation is unbounded
  2. The vertex is always worth $\frac12$
  3. The relaxation becomes infeasible
  4. Nothing: the bounds $x_v\le1$ are always implied
Explanation. A universal vertex has no non-edges, so $x_v$ can grow without limit. In the other cases $x_u+x_v\le1$ already implies $x_v\le1$.
oc-f-316 · level facile · notes
In the LP relaxation of the non-edge formulation of maximum clique ($x_u+x_v\le1$ for every non-edge, $x_v\ge0$), the vector $x_v=\frac12$ for every vertex is always feasible. On a graph with $7$ vertices, with no vertex adjacent to all others, which upper bound does this vector give at least?
  1. $1$
  2. $7$
  3. $\omega(G)$ exactly
  4. $\frac72$: the relaxation is worth at least $n/2$, a weak bound
Explanation. $\frac12+\frac12=1$ satisfies every conflict constraint, so $z(\mathrm{LP})\ge n/2$ even when $\omega(G)$ is small: the bound grows with $n$, not with the clique.
oc-f-317 · level facile · notes
In the edge-weighted maximum clique (EWMCP) one maximizes the sum of the weights $w_{uv}$ of the edges with both endpoints in the clique. How is the product $x_ux_v$ linearized in the ILP model?
  1. With an integer variable $y_{uv}=x_u+x_v$
  2. No linearization is needed: one uses $\sum w_{uv}x_ux_v$
  3. With a variable $y_{uv}\in\{0,1\}$ per edge and the constraints $y_{uv}\le x_u$, $y_{uv}\le x_v$
  4. With the constraint $x_u+x_v\le1$ on every edge
Explanation. With positive weights the maximization pushes $y_{uv}$ to $1$, and the two constraints allow it only if both endpoints are in the clique.
oc-f-318 · level facile · notes
How does the ILP model of the vertex-weighted maximum clique (VWMCP, weights $w_v>0$) differ from that of maximum clique?
  1. The constraints are written on the edges instead of the non-edges
  2. Only the objective changes, $\max\sum_vw_vx_v$; the non-edge constraints stay
  3. Variables for every edge are needed
  4. The constraints become $x_u+x_v\le w_u+w_v$
Explanation. The set of cliques does not depend on the weights: only what is maximized changes.
oc-f-517 · level facile · notes
ILP formulation of maximum clique: $\max\sum_vx_v$ with $x_u+x_v\le1$ for every pair of non-adjacent vertices. With $V=\{1,2,3,4\}$ and $E=\{\{1,2\},\{1,3\},\{2,3\},\{3,4\}\}$, which vector is feasible?
  1. $(1,0,1,1)$
  2. $(1,1,0,1)$
  3. $(1,1,1,0)$
  4. $(0,1,1,1)$
Explanation. The non-edges are $\{1,4\}$ and $\{2,4\}$. $(1,1,1,0)$ does not violate them; $(0,1,1,1)$ violates $\{2,4\}$, $(1,0,1,1)$ violates $\{1,4\}$, $(1,1,0,1)$ violates both.
oc-f-518 · level facile · notes
In the ILP formulation of maximum clique the conflict constraints $x_u+x_v\le1$ are written on the non-edges of $G$. If $G$ is complete, how many conflict constraints are there and what is the optimum?
  1. No constraints; the model is unbounded
  2. No constraints; the optimum takes all $n$ vertices
  3. $\binom n2$ constraints; the optimum is $1$
  4. $n$ constraints; the optimum is $n-1$
Explanation. A complete graph has no non-edges; with $x_v\in\{0,1\}$ the optimum is $\vet x=\vet 1$, $\omega(G)=n$. The model is not unbounded because the variables are binary.
oc-f-519 · level facile · notes
In the maximum clique models the constraints can be written on the cliques of the complement $\overline{G}$: $\sum_{v\in Q}x_v\le1$. Read on the graph $G$, what is the set $Q$?
  1. A stable set of $G$
  2. A clique of $G$
  3. A cycle of $G$
  4. The neighbourhood of a vertex of $G$
Explanation. Vertices pairwise adjacent in $\overline{G}$ are pairwise non-adjacent in $G$: a clique of $G$ contains at most one of them.
oc-f-520 · level facile · notes
In the edge formulation of maximum clique, for a non-edge $\{u,v\}$ the constraint is $x_u+x_v\le1$. Which implication does it model, for binary variables?
  1. $x_u=0\Rightarrow x_v=1$ (and the converse)
  2. $x_u=1$ if and only if $x_v=0$
  3. $x_u=x_v$ for every non-edge
  4. $x_u=1\Rightarrow x_v=0$ (not the converse)
Explanation. At most one of the two endpoints is chosen; $x_u=x_v=0$ stays feasible, so $x_u=0$ does not force $x_v=1$.
oc-f-521 · level teorema · notes
The edge formulation $\mathrm{ILP}_{\mathrm{MCP}}$ of maximum clique has $x_v\in\{0,1\}$ and $x_u+x_v\le1$ for every non-edge. Why does every feasible solution correspond to a clique?
  1. Because every chosen vertex has maximum degree
  2. Because the constraint imposes $x_u+x_v=1$ on the edges
  3. Two chosen vertices are never a non-edge
  4. Because the objective maximizes the number of vertices
Explanation. If $x_u=x_v=1$ then $\{u,v\}$ is not a non-edge, i.e., it is an edge: the chosen vertices are pairwise adjacent, regardless of the objective.
oc-f-522 · level facile · notes
The relaxation $\mathrm{LP}\text{-}0_{\mathrm{MCP}}$ of maximum clique has $x_u+x_v\le1$ on the non-edges and only $x_v\ge0$. On a star (centre $1$ adjacent to $2,3,4$, which are not adjacent to each other), what is its value?
  1. $3$: the three non-adjacent leaves
  2. $+\infty$: the centre is in no constraint
  3. $2$: the centre together with a leaf
  4. $3/2$: half of the three leaves
Explanation. Vertex $1$ is adjacent to all others, so $x_1$ is bounded by no conflict constraint: without $x_v\le1$ the relaxation is unbounded.
oc-f-523 · level teorema · notes
The dual of $\mathrm{LP}\text{-}0_{\mathrm{MCP}}$ ($\max\sum_vx_v$, $x_u+x_v\le1$ on the non-edges, $x\ge0$) has a variable $\pi_{uv}\ge0$ for every non-edge and the constraints $\sum_{u:\{u,v\}\in\overline{E}}\pi_{uv}\ge1$. Which problem is it?
  1. A fractional cover of the vertices by edges of $\overline{G}$
  2. A fractional colouring of the vertices of $G$
  3. A fractional stable set of $\overline{G}$
  4. A shortest path between two vertices of $\overline{G}$
Explanation. Every vertex must receive weight at least $1$ from the edges of $\overline{G}$ touching it, and the total weight is minimized: it is a fractional edge cover.
oc-f-524 · level teorema · notes
In the linear relaxation $\mathrm{LP}_{\mathrm{MCP}}$ of the edge formulation ($x_u+x_v\le1$ on the non-edges, $0\le x_v\le1$), why is $z(\mathrm{LP}_{\mathrm{MCP}})\ge n/2$ on every graph with $n$ vertices?
  1. Because every graph has a clique of $n/2$ vertices
  2. Because half of the vertices have degree at least $n/2$
  3. Because the dual has value $n/2$
  4. The vector $x_v=\frac12$ is always feasible
Explanation. Every constraint gives $\frac12+\frac12=1$: the point is feasible and worth $n/2$. That is why the bound can be arbitrarily weak, while $\omega(G)$ may be $2$.
oc-f-525 · level facile · notes
On the cycle $C_5$ ($\omega(C_5)=2$) the linear relaxation of the edge formulation of maximum clique is $\frac52$. Which integer dual bound follows, and why is it allowed?
  1. $\frac52$: a bound cannot be rounded
  2. $2$: because the relaxation is always integer
  3. $\lfloor\frac52\rfloor=2$: the ILP optimum is integer
  4. $\lceil\frac52\rceil=3$: one always rounds up
Explanation. In a maximization problem with integer optimum, $\omega(G)\le z(\mathrm{LP})$ implies $\omega(G)\le\lfloor z(\mathrm{LP})\rfloor$. Here the rounded bound coincides with $\omega(C_5)$.
oc-f-526 · level facile · notes
The maximum clique formulation with clique inequalities has one constraint $\sum_{v\in Q}x_v\le1$ for every maximal clique $Q$ of the complement $\overline{G}$. Why, in practice, are these inequalities added only when violated?
  1. Because they are not valid for all cliques
  2. They can be up to $3^{n/3}$
  3. Because almost all of them are redundant
  4. Because they make the relaxation unbounded
Explanation. Moon and Moser showed graphs with $3^{n/3}$ maximal cliques: writing them all is impossible, so the ones violated by the current fractional solution are separated.
oc-f-527 · level teorema · notes
In maximum clique, the relaxation $\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}}$ has $\sum_{v\in Q}x_v\le1$ for every maximal stable set $Q$ of $G$. Given a colouring of $G$ with $k$ colours, why is $z(\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}})\le k$?
  1. One sums the $k$ constraints of the colour classes
  2. Because every clique has at most $k$ vertices
  3. Because the colouring has $k$ classes of equal cardinality
  4. Because the relaxation is always integer
Explanation. Every class lies in a maximal stable set, and the classes cover all vertices once: the sum of the constraints bounds $\sum_vx_v$. It is the duality with fractional colouring.
oc-f-528 · level teorema · notes
In maximum clique one compares the relaxation $\mathrm{LP}_{\mathrm{MCP}}$ (constraints $x_u+x_v\le1$ on the non-edges) and $\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}}$ (constraints $\sum_{v\in Q}x_v\le1$ on the maximal stable sets $Q$ of $G$), both with $0\le x_v\le1$. Why is $z(\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}})\le z(\mathrm{LP}_{\mathrm{MCP}})$?
  1. Because $\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}}$ has fewer constraints
  2. Because the two relaxations always have the same value
  3. Because $\mathrm{LP}_{\mathrm{MCP}}$ has integer variables
  4. Every non-edge lies in a maximal stable set
Explanation. If $\{u,v\}\subseteq Q$, from $\sum_{w\in Q}x_w\le1$ and $x\ge0$ one gets $x_u+x_v\le1$: the region of $\mathrm{LP}^{\mathrm{CL}}_{\mathrm{MCP}}$ is contained in the other, and in a maximization the value does not grow.
oc-f-529 · level facile · notes
Maximum stable set (MSSP) with $x_v=1$ if vertex $v$ is chosen and $x_u+x_v\le1$ for every edge $\{u,v\}$ of $G$. The graph is a triangle $\{1,2,3\}$ plus an isolated vertex $4$. Which vector is optimal?
  1. $(0,0,0,1)$
  2. $(1,1,1,1)$
  3. $(1,0,0,1)$
  4. $(1,1,0,1)$
Explanation. At most one vertex of the triangle is taken; the isolated vertex has no constraints: $\alpha(G)=2$. $(1,1,0,1)$ violates the edge $\{1,2\}$; $(0,0,0,1)$ is feasible but worth $1$.
oc-f-530 · level teorema · notes
For maximum stable set on $G$ ($x_v=1$ if $v$ is chosen) one adds the inequalities $\sum_{v\in K}x_v\le1$ for every clique $K$ of $G$. Why are they valid?
  1. They are not valid: they exclude feasible stable sets
  2. A stable set contains at most one vertex of every clique
  3. Because every clique is also a stable set
  4. Because every vertex belongs to a single clique
Explanation. Two vertices of a clique are adjacent, so they cannot be together in a stable set. They are the clique inequalities of maximum clique, read on the complement.
oc-f-531 · level facile · notes
On the complete graph $K_4$ two linear relaxations of maximum stable set are compared: with only the edge constraints $x_u+x_v\le1$, or with the clique inequality $\sum_{v}x_v\le1$. What are their values ($0\le x_v\le1$)?
  1. $2$ with the edges, $1$ with the clique
  2. $1$ in both cases, as $\alpha(K_4)$
  3. $2$ in both cases, with $x=\frac12$
  4. $4$ with the edges, $1$ with the clique
Explanation. With only the edges $x_v=\frac12$ is feasible and worth $2$; the clique inequality immediately gives $\sum_vx_v\le1=\alpha(K_4)$.
oc-f-532 · level facile · notes
The model $\mathrm{ILP}^{\mathrm{EW}}_{\mathrm{MCP}}$ of edge-weighted maximum clique has one variable $x_v$ per vertex and one variable $y_{uv}$ per edge. How many binary variables does it have on a graph with $n$ vertices and $m$ edges?
  1. $n$
  2. $n\cdot m$
  3. $n+\binom n2$
  4. $n+m$
Explanation. The $y_{uv}$ are needed only on the edges of $G$, where a weight is collected; on the non-edges the conflict constraints on the $x$ suffice.
oc-f-533 · level facile · notes
Vertex-weighted maximum clique ($\max\sum_vw_vx_v$, $x_u+x_v\le1$ on the non-edges). With $E=\{\{1,2\},\{1,3\},\{2,3\},\{3,4\}\}$ and weights $w=(1,2,2,4)$, what is the optimum?
  1. $8$
  2. $9$
  3. $6$
  4. $5$
Explanation. The maximal cliques are $\{1,2,3\}$ (weight $5$) and $\{3,4\}$ (weight $6$). $\{2,3,4\}$, of weight $8$, is not a clique: $2$ and $4$ are not adjacent.
oc-f-534 · level teorema · notes
The clique inequalities $\sum_{v\in Q}x_v\le1$ ($Q$ a stable set of $G$) strengthen the maximum clique formulation. Do they remain valid in the vertex-weighted model ($\max\sum_vw_vx_v$)?
  1. No: they must be multiplied by the weights $w_v$
  2. Yes: the solutions are still the cliques of $G$
  3. No: with weights a clique may contain two vertices of a stable set
  4. Yes, but only if all weights are equal
Explanation. The weighted model changes only the objective; a constraint valid for all cliques of $G$ stays valid whatever the weights.
oc-f-535 · level teorema · notes
In the edge-weighted clique model ($\max\sum r_{uv}y_{uv}$, $y_{uv}\le x_u$, $y_{uv}\le x_v$, weights $r_{uv}>0$) the constraint $y_{uv}\ge x_u+x_v-1$ is missing. Why is it not needed?
  1. With $r_{uv}>0$ the optimum sets $y_{uv}=1$ whenever $x_u=x_v=1$
  2. Because it is implied by $y_{uv}\le x_u$ and $y_{uv}\le x_v$
  3. Because $y_{uv}$ always equals $x_ux_v$ in the relaxation
  4. It is needed: without it the model overestimates the weight
Explanation. The present constraints prevent counting a weight without both endpoints; counting it when both are there always pays, since $r_{uv}>0$. Without the constraint the model can only underestimate, and never at the optimum.
oc-f-536 · level facile · notes
Edge-weighted maximum clique: one maximizes the sum of the weights $r_{uv}$ of the edges with both endpoints in the clique. With edges $r_{12}=3$, $r_{13}=4$, $r_{23}=5$, $r_{34}=10$ (no other edge), what is the optimum?
  1. $10$
  2. $22$
  3. $15$
  4. $12$
Explanation. $\{1,2,3\}$ collects $3+4+5=12$; $\{3,4\}$ only $10$. $15=r_{23}+r_{34}$ would require $\{2,3,4\}$, which is not a clique.

13. Formulations of routing problems (33)

oc-f-045 · level facile · notes
In the MTZ (Miller-Tucker-Zemlin) model of the TSP with $n=6$ cities ($x_{ij}=1$ if arc $(i,j)$ is in the tour), city $1$ is the start and every other city $i$ has a position variable $u_i$. How many MTZ constraints link the $u_i$ to the arcs?
  1. $30$
  2. $26$
  3. $36$
  4. $20$
Explanation. The MTZ constraints are written for the ordered pairs of cities different from city $1$: $(n-1)(n-2)=5\cdot 4=20$. The DFJ model would have $2^{n-1}-n=26$ subtour elimination constraints.
oc-f-046 · level teorema · notes
For the TSP ($x_{ij}=1$ if arc $(i,j)$ is in the tour), the MTZ model eliminates subtours with position variables and $O(n^2)$ constraints, the DFJ model with one constraint for every proper subset of cities. Which statement is correct?
  1. Both are correct, and the two LP relaxations always have the same value
  2. Only DFJ is correct: MTZ admits integer solutions containing subtours
  3. Both are correct, and the LP relaxation of DFJ is stronger than that of MTZ
  4. Both are correct, and the LP relaxation of MTZ is stronger than that of DFJ
Explanation. Propositions 13.1 and 13.2: both models exclude the subtours. MTZ has few constraints but a weak relaxation (Proposition 13.3); DFJ has exponentially many constraints, generated when needed, and a stronger relaxation.
oc-f-047 · level facile · notes
In the DFJ model of the TSP ($x_{ij}=1$ if arc $(i,j)$ is in the tour, $\mathscr{V}$ set of cities) the subtour elimination constraints are $\sum_{i,j\in S}x_{ij}\le |S|-1$. Why are they not written for $S=\mathscr{V}$?
  1. City $1$ has no position variable and must be excluded from $S$
  2. A tour uses $|\mathscr{V}|$ arcs with endpoints in $\mathscr{V}$: the constraint would exclude every tour
  3. The constraint would be redundant: it is already implied by the degree constraints
  4. The constraint is already guaranteed by the MTZ constraints on the positions $u_i$
Explanation. The sets $S$ are proper subsets with at least two cities: for $S=\mathscr{V}$ the constraint would cut off all the feasible solutions.
oc-f-174 · level facile · notes
In the DFJ model of the TSP with $n$ cities, the subtour elimination constraints $\sum_{i,j\in S}x_{ij}\le|S|-1$ are written for the subsets $S$ excluding city $1$, with $|S|\ge 2$. How many are there for $n=5$?
  1. $26$
  2. $12$
  3. $11$
  4. $16$
Explanation. The subsets of $\{2,\dots,5\}$ with at least two cities are $2^{4}-1-4=11=2^{n-1}-n$. $16=2^4$ also counts the empty set and the singletons.
oc-f-175 · level facile · notes
In the MTZ model of the TSP, $u_i$ is the position of city $i\ne 1$ after leaving city $1$, and the constraint $u_i-u_j+(n-1)x_{ij}\le n-2$ is written for every pair of cities different from $1$. What does it impose when arc $(i,j)$ is in the tour ($x_{ij}=1$)?
  1. Nothing: the constraint is always satisfied
  2. $u_j\ge u_i+1$: city $j$ comes after city $i$
  3. $u_j\le u_i-1$: city $j$ comes before city $i$
  4. $u_j=n-1$: city $j$ is the last one
Explanation. With $x_{ij}=1$ the constraint becomes $u_i-u_j\le -1$. A subtour not through city $1$ would need strictly increasing positions along a cycle, which is impossible.
oc-f-176 · level facile · notes
In the MTZ model of the TSP ($1\le u_i\le n-1$ positions of the cities $i\ne 1$), why does the constraint $u_i-u_j+(n-1)x_{ij}\le n-2$ exclude nothing when $x_{ij}=0$?
  1. It becomes $u_i-u_j\le n-2$, always true because positions lie in $[1,n-1]$
  2. It becomes $u_i-u_j\le 0$, true because positions are increasing
  3. It becomes $u_i=u_j$, true because unvisited cities share a position
  4. It becomes $(n-1)\le n-2$, true for every $n$
Explanation. The difference of two positions in $[1,n-1]$ is at most $n-2$: the coefficient $n-1$ is the smallest big-M that excludes no tour.
oc-f-177 · level teorema · notes
In the LP relaxation of the MTZ model of the TSP, setting $u_i=1$ for every city $i\ne1$, the MTZ constraints become $(n-1)x_{ij}\le n-2$. What follows?
  1. Every feasible $x$ has $x_{ij}\in\{0,1\}$: the relaxation is exact
  2. The relaxation becomes infeasible for $n\ge 4$
  3. The relaxation coincides with that of the DFJ model
  4. Every $x$ satisfying the degree constraints with $x_{ij}\le\frac{n-2}{n-1}$ is feasible: the relaxation is weak
Explanation. With all positions equal the MTZ constraints only bound the $x_{ij}$ by $\frac{n-2}{n-1}$, a value close to $1$: almost all the solutions of the assignment relaxation remain feasible.
oc-f-178 · level facile · notes
In the TSP ($x_{ij}=1$ if arc $(i,j)$ is in the tour), the assignment relaxation keeps only the degree constraints (one arc leaves and one enters every city) with $x_{ij}\ge 0$. What can an integer solution of it contain?
  1. Cities with two outgoing arcs
  2. Arcs from a city to itself
  3. Several disjoint subtours covering all the cities
  4. Only one tour through all the cities
Explanation. The degree constraints describe an assignment: every city has a successor, and the integer solutions are sets of disjoint cycles. The MTZ or DFJ constraints are needed to remove subtours.
oc-f-179 · level facile · notes
For the TSP the MTZ model has $O(n^2)$ constraints and the DFJ model an exponential number, with a stronger LP relaxation. How is the DFJ model used in practice?
  1. Only the constraints of the subsets with two cities are written
  2. Subtour elimination constraints are added only when the current relaxation solution violates them
  3. All the constraints are written at the start, since the solver handles them in polynomial time
  4. The constraints are replaced by the MTZ constraints, which have the same relaxation
Explanation. With $2^{n-1}-n$ constraints the model cannot be written in full: the relaxation is solved, violated subtours are searched and their constraints added.
oc-f-180 · level facile · notes
In the $\mathrm{ILP}_{\mathrm{ATSP}}$ model of the asymmetric TSP ($x_{ij}=1$ if arc $(i,j)$ is in the tour, distances $d_{ij}$ and $d_{ji}$ different) with $n=4$ cities, two subtours $1\to2\to1$ and $3\to4\to3$ satisfy the degree constraints. Which constraint excludes them?
  1. $x_{34}+x_{43}\le 1$, the elimination constraint of $S=\{3,4\}$
  2. $x_{12}+x_{21}\ge 1$
  3. $x_{34}+x_{43}=2$
  4. $u_3-u_4+3x_{34}\le 2$ without position variables
Explanation. The subtour $3\to4\to3$ uses $2=|S|$ arcs inside $S=\{3,4\}$, while the constraint allows at most $|S|-1=1$. The ATSP model is the DFJ model with the arc distances.
oc-f-181 · level facile · notes
The metric TSP has distances satisfying the triangle inequality $d_{ij}\le d_{ik}+d_{kj}$. How does the integer linear programming model change with respect to the general TSP?
  1. A constraint $x_{ij}\le x_{ik}+x_{kj}$ is added for every triple of cities
  2. The subtour elimination constraints are dropped, useless on metric instances
  3. Continuous variables are used, because the relaxation is exact
  4. It does not: the triangle inequality is a property of the data, not a constraint
Explanation. The metric TSP has the same MTZ and DFJ models: the metric concerns the distances $d_{ij}$ of the objective, and helps approximation algorithms, not the formulation.
oc-f-201 · level facile · notes
In the MTZ and DFJ models of the TSP there is a binary variable $x_{ij}$ for every arc $(i,j)$, i.e., for every ordered pair of distinct cities, and two degree constraints per city (one arc leaves, one enters). With $n=6$ cities, how many variables $x_{ij}$ and degree constraints are there?
  1. $15$ variables and $6$ constraints
  2. $36$ variables and $12$ constraints
  3. $30$ variables and $6$ constraints
  4. $30$ variables and $12$ constraints
Explanation. The ordered pairs of distinct cities are $n(n-1)=30$; the degree constraints are $2n=12$. The unordered pairs are $15$, but the models use directed arcs.
oc-f-319 · level facile · notes
The TSP ILP models use $x_{ij}=1$ if the tour goes from city $i$ to city $j$, with the degree constraints (one outgoing and one incoming arc per city). Why are the degree constraints alone not enough?
  1. They admit arcs with $x_{ij}=\frac12$ even in the integer model
  2. They admit solutions made of several disjoint subtours
  3. They admit tours visiting a city twice
  4. They are satisfied by no tour
Explanation. With the degree constraints alone the model is an assignment: for instance $1\to2\to1$ and $3\to4\to5\to3$ satisfy them. Subtour elimination constraints (MTZ or DFJ) are needed.
oc-f-320 · level facile · notes
The TSP models on $n$ cities use the set of directed arcs $A=\{(i,j):i\ne j\}$, with one variable $x_{ij}$ per arc. How many arc variables are there?
  1. $n(n-1)$
  2. $\binom n2$
  3. $n^2$
  4. $(n-1)!/2$
Explanation. Every edge $\{i,j\}$ gives the two arcs $(i,j)$ and $(j,i)$, with the same cost in the symmetric case. $\binom n2$ is the number of edges, $(n-1)!/2$ the number of tours.
oc-f-321 · level facile · notes
The TSP has two classical ILP models: Miller-Tucker-Zemlin (MTZ), with position variables $u_i$, and Dantzig-Fulkerson-Johnson (DFJ), with one constraint per subset of cities. How do their sizes compare?
  1. Both have an exponential number of constraints
  2. MTZ has an exponential number of variables; DFJ $O(n^2)$
  3. They have the same size
  4. MTZ has $O(n^2)$ variables and constraints; DFJ has an exponential number of constraints
Explanation. DFJ writes a constraint for every proper subset of cities (about $2^n$); MTZ avoids subtours with $n$ position variables and $O(n^2)$ constraints.
oc-f-322 · level teorema · notes
On the reference TSP instance (optimal value $18$) the assignment relaxation is worth $16$, the MTZ one $17$ and the DFJ one $18$. Which general statement is consistent with these values?
  1. The DFJ relaxation always equals the optimum
  2. The three relaxations always give the same value
  3. The DFJ relaxation is stronger than the MTZ one, which is stronger than the assignment one
  4. The assignment relaxation is the strongest, because it is the smallest
Explanation. Adding constraints to a minimization relaxation can only raise its value; here DFJ closes the gap, but in general a gap remains even with DFJ.
oc-f-323 · level facile · notes
The DFJ model of the TSP has a subtour elimination constraint for every subset of cities, i.e., an exponential number of constraints. How is it used in practice?
  1. Only the assignment relaxation is solved
  2. The violated constraints are added only when needed, as cutting planes
  3. All constraints are written at the start
  4. They are replaced by the degree constraints
Explanation. One solves the model with few constraints, looks for a subtour (or a violated subset) in the solution and adds the corresponding constraint.
oc-f-343 · level ipotesi · notes
In the MTZ model of the TSP the position variables $u_i$ satisfy $u_i-u_j+n\,x_{ij}\le n-1$ for the arcs $(i,j)$ between cities different from the starting city $1$. Why do the constraints exclude the arcs touching city $1$?
  1. Because $u_1$ must equal $n$
  2. Along a tour positions increase by $1$ at every arc, and a cycle returning to the start would violate the constraint: imposed on city $1$ too it would exclude every tour
  3. Because city $1$ has no arcs
  4. To reduce the number of variables, with no effect on the feasible set
Explanation. With $x_{ij}=1$ the constraint gives $u_j\ge u_i+1$: on a closed cycle the inequalities contradict each other. Exempting city $1$ forbids only the subtours not containing it.
oc-f-537 · level facile · notes
In the ILP models of the TSP on $n$ cities ($x_{ij}=1$ if the tour goes from $i$ to $j$) the degree constraints ask that exactly one arc leaves every city and exactly one enters it. How many degree constraints are there?
  1. $n$
  2. $n(n-1)$
  3. $n^2$
  4. $2n$
Explanation. One outgoing constraint $\sum_jx_{ij}=1$ and one incoming constraint $\sum_ix_{ij}=1$ per city. $n(n-1)$ is the number of arc variables.
oc-f-538 · level facile · notes
The ILP models of the TSP use variables on directed arcs $x_{ij}$, even when the distances are symmetric. To how many solutions of the model does a tour of the symmetric TSP correspond?
  1. To $n$, one per start
  2. To $2n$, start and direction
  3. To $2$, one per direction
  4. To $1$, the same for both directions
Explanation. The starting city does not appear in the variables $x_{ij}$, the direction does: the tour and its reverse use opposite arcs, with the same length if $d_{ij}=d_{ji}$.
oc-f-539 · level facile · notes
The MTZ model of the TSP on $n$ cities has the arc variables $x_{ij}$ and the position variables $u_i$ for the cities other than city $1$. How many variables does it have in total?
  1. $n(n-1)$ arc and no position variables
  2. $n(n-1)$ arc and $n-1$ position variables
  3. $n^2$ arc and $n$ position variables
  4. $n(n-1)/2$ arc and $n-1$ position variables
Explanation. The directed arcs $(i,j)$ with $i\neq j$ are $n(n-1)$; city $1$ has no position. The DFJ model uses only the $n(n-1)$ arc variables.
oc-f-540 · level teorema · notes
In the MTZ model of the TSP the constraints $u_i-u_j+(n-1)x_{ij}\le n-2$ are written only for $i,j\neq1$. Why is city $1$ excluded?
  1. The tour returns to $1$: no cycle has always increasing positions
  2. Because city $1$ always has position $n$
  3. Because the constraints on $1$ are implied by the degree constraints
  4. To reduce the number of variables, for no other reason
Explanation. Positions grow along every travelled arc between cities other than $1$; on a closed cycle they cannot always grow. Excluding $1$ forbids every cycle not passing through $1$, i.e., every subtour.
oc-f-541 · level facile · notes
The MTZ and DFJ models of the TSP differ in the way they eliminate subtours. Which constraints do they have in common?
  1. The constraints on the positions $u_i$
  2. The subtour elimination constraints
  3. None: they are completely different models
  4. The degree constraints of every city
Explanation. Both have the objective $\sum d_{ij}x_{ij}$ and the degree constraints; MTZ adds the positions $u_i$, DFJ one constraint per subset of cities.
oc-f-542 · level facile · notes
In the DFJ model of the TSP there is one subtour elimination constraint for every $S\subseteq\mathscr{V}\setminus\{1\}$ with $|S|\ge2$, $2^{n-1}-n$ constraints in total. How many are there with $n=6$ cities?
  1. $57$
  2. $62$
  3. $26$
  4. $32$
Explanation. $2^5-6=26$: the $32$ subsets of $\{2,\dots,6\}$ minus the empty set and the $5$ singletons. $57=2^6-7$ would use all cities.
oc-f-543 · level teorema · notes
In the DFJ model the subtour elimination constraint for $S$ is $\sum_{i,j\in S}x_{ij}\le|S|-1$. Why does a subtour visiting exactly the cities of $S$ violate it?
  1. Because the cities of $S$ have degree $2$
  2. A cycle on $|S|$ cities uses $|S|$ arcs inside $S$
  3. Because a subtour has fewer than $|S|-1$ arcs
  4. Because a subtour violates the degree constraints
Explanation. A cycle touching all and only the cities of $S$ has $|S|$ arcs with both endpoints in $S$, one more than the bound $|S|-1$.
oc-f-544 · level teorema · notes
In the DFJ model the subtour elimination constraints are written only for the subsets $S$ not containing city $1$. Why are they enough?
  1. If the solution has several subtours, at least one avoids city $1$
  2. Because subtours always pass through city $1$
  3. Because subsets containing city $1$ give invalid constraints
  4. Because with city $1$ the constraints are infinitely many
Explanation. A solution of the degree constraints is a union of disjoint cycles; if there are at least two cycles, one of them avoids city $1$ and violates the constraint of its set of cities.
oc-f-545 · level facile · notes
The assignment relaxation of the TSP has only the degree constraints and $x_{ij}\ge0$. Why does adding the upper bounds $x_{ij}\le1$ not change it?
  1. Because the optimal solution is always a tour
  2. Because the distances are positive
  3. It does change it: without $x_{ij}\le1$ it is unbounded
  4. It follows from $\sum_jx_{ij}=1$ and $x\ge0$
Explanation. Every $x_{ij}$ is a non-negative term of a sum equal to $1$. The same holds for the MTZ and DFJ relaxations.
oc-f-546 · level facile · notes
The assignment relaxation of the TSP (degree constraints only) has an optimal solution that is a set of disjoint cycles. What is therefore obtained from its value?
  1. Always the length of the optimal tour
  2. A bound valid only for the metric TSP
  3. A lower bound, exact if the cycles form one tour
  4. An upper bound on the length of the optimal tour
Explanation. Removing the subtour constraints enlarges the region: in a minimization problem the value goes down. If the solution is already a tour, the bound is exact.
oc-f-547 · level facile · notes
In the MTZ model of the TSP with $n=5$ cities, the constraint is $u_i-u_j+4x_{ij}\le3$ ($u$ positions in $[1,4]$). What does it impose when $x_{ij}=1$, and when $x_{ij}=0$?
  1. $u_i+u_j\le3$; with $x_{ij}=0$ it becomes $u_i\le u_j$
  2. $u_j\ge u_i+1$; with $x_{ij}=0$ it becomes $u_i-u_j\le3$, always true
  3. $u_j=u_i+1$; with $x_{ij}=0$ it imposes $u_i=u_j$
  4. $u_j\le u_i-1$; with $x_{ij}=0$ it imposes nothing
Explanation. With $x_{ij}=1$: $u_i-u_j\le-1$. With $x_{ij}=0$: $u_i-u_j\le3=n-2$, satisfied by positions in $[1,4]$; that is why $n-1$ is the smallest valid big-M.
oc-f-548 · level teorema · notes
The MTZ model of the TSP has $O(n^2)$ variables and constraints, but its linear relaxation often gives a weak lower bound. Why?
  1. Many fractional solutions already satisfy the MTZ constraints
  2. Because the positions $u_i$ must be integer
  3. Because the MTZ relaxation is unbounded
  4. Because the MTZ constraints also cut feasible tours
Explanation. With fractional $x_{ij}$ the term $(n-1)x_{ij}$ is small and the constraints are satisfied with almost equal positions: the big-M weakens the relaxation.
oc-f-549 · level facile · notes
In the DFJ model of the TSP, the subtour elimination constraint for a set of two cities $S=\{i,j\}$ is $x_{ij}+x_{ji}\le1$. What does it forbid?
  1. Visiting $i$ right after $j$
  2. Using either of the two arcs
  3. Having $i$ and $j$ in the same tour
  4. The two-arc subtour $i\to j\to i$
Explanation. With $|S|=2$ the bound is $|S|-1=1$ inner arc: one of the two arcs may be used, not both.
oc-f-550 · level facile · notes
In the model $\mathrm{ILP}_{\mathrm{ATSP}}$ of the asymmetric TSP (distances $d_{ij}$ and $d_{ji}$ possibly different), how are a tour and the same tour travelled backwards represented?
  1. By different solutions but always of the same length
  2. The reverse tour is infeasible in the model
  3. By different solutions, of generally different lengths
  4. By the same solution of the model
Explanation. The reverse tour uses $(j,i)$ instead of $(i,j)$: it is feasible, but its length uses the distances $d_{ji}$.
oc-f-551 · level teorema · notes
The model $\mathrm{ILP}_{\mathrm{ATSP}}$ is the DFJ model with different distances on the two directions of every arc. Why does the correctness proof of the DFJ model hold unchanged?
  1. It does not: extra constraints are needed
  2. The distances appear only in the objective
  3. Because asymmetric distances satisfy the triangle inequality
  4. Because every ATSP instance is symmetric
Explanation. The distances appear only in the objective; the degree and subtour elimination constraints describe the same directed tours.

14. Formulations of scheduling problems (24)

oc-f-048 · level teorema · notes
Scheduling $P\,||\,C_{\max}$ ($n$ jobs of duration $t_j$, $m$ identical machines): the model $\mathrm{ILP}_{P\|C_{\max}}$ has variables $x_{ij}$ (job $j$ on machine $i$) and $C_{\max}\ge\sum_j t_jx_{ij}$ for every machine $i$. Which statement on its LP relaxation is correct?
  1. $z(\mathrm{LP}_{P\|C_{\max}})=\max_j t_j$, and the ratio to $z(\mathrm{ILP}_{P\|C_{\max}})$ is at least $\frac1m$, reached asymptotically
  2. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$, and it equals $z(\mathrm{ILP}_{P\|C_{\max}})$ for every instance with $m=2$
  3. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$, and the ratio to $z(\mathrm{ILP}_{P\|C_{\max}})$ is at least $\frac1m$, reached asymptotically
  4. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$, and the ratio to $z(\mathrm{ILP}_{P\|C_{\max}})$ is at least $\frac12$ for every $m$
Explanation. Propositions 14.1–14.3: assigning every job with value $\frac1m$ to every machine gives the average load; the bound ignores the longest job, and this is why $C_{\max}\ge t_j$ is added.
oc-f-049 · level ipotesi · notes
Scheduling $P\,||\,C_{\max}$ ($n$ jobs of duration $t_j$, $m$ identical machines), model $\mathrm{ILP}_{P\|C_{\max}}$ with assignment variables and LP relaxation $\mathrm{LP}_{P\|C_{\max}}$. Which facts suffice to prove $z(\mathrm{LP}_{P\|C_{\max}})/z(\mathrm{ILP}_{P\|C_{\max}})\ge\frac1m$?
  1. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$; $LPT$ is a $\left(\frac43-\frac1{3m}\right)$-approximation with respect to the relaxation
  2. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$; all jobs on one machine is feasible, hence $z(\mathrm{ILP}_{P\|C_{\max}})\le\sum_j t_j$
  3. $z(\mathrm{LP}_{P\|C_{\max}})=\sum_j t_j/m$; $z(\mathrm{ILP}_{P\|C_{\max}})\ge\max_j t_j$ and the makespan is integer
  4. $z(\mathrm{LP}_{P\|C_{\max}})=\max_j t_j$; all jobs on one machine is feasible, hence $z(\mathrm{ILP}_{P\|C_{\max}})\le\sum_j t_j$
Explanation. The ratio is at least $\frac{\sum_j t_j/m}{\sum_j t_j}=\frac1m$: only the value of the relaxation and a trivial upper bound on the integer optimum are needed.
oc-f-050 · level facile · notes
Scheduling $P\,||\,C_{\max}$ with $m=2$ identical machines and durations $t=(10,1,1,1)$. What are the LP relaxation value $z(\mathrm{LP}_{P\|C_{\max}})$ of the model with assignment variables $x_{ij}$ and makespan $C_{\max}$, and the optimal makespan?
  1. $\frac{13}{2}$ and $10$
  2. $\frac{13}{2}$ and $7$
  3. $10$ and $10$
  4. $13$ and $10$
Explanation. The relaxation is the average load $13/2$; the job of length $10$ forces $z(I)\ge 10$, which is attained. This is why the valid inequality $C_{\max}\ge t_j$ is added.
oc-f-182 · level facile · notes
The $\mathrm{ILP}_{P\|C_{\max}}$ model of scheduling on $m$ identical machines has binary variables $x_{jh}$ (job $j$ on machine $h$) and the continuous variable $C_{\max}$, with one assignment constraint per job and one load constraint per machine. With $n=6$ jobs and $m=3$, how many variables and constraints does it have?
  1. $19$ variables and $9$ constraints
  2. $18$ variables and $9$ constraints
  3. $19$ variables and $18$ constraints
  4. $9$ variables and $19$ constraints
Explanation. The variables are $nm+1=19$; the constraints are $n=6$ assignment and $m=3$ load constraints, i.e., $9$.
oc-f-183 · level facile · notes
In scheduling $P\,||\,C_{\max}$ the largest load $\max_h L_h$ is minimized, which is not a linear function. How does the $\mathrm{ILP}_{P\|C_{\max}}$ model (with $x_{jh}=1$ if job $j$ goes on machine $h$) linearize it?
  1. It minimizes $\sum_h\sum_j t_jx_{jh}$, the sum of the loads
  2. It minimizes a variable $C_{\max}$ with $C_{\max}\le\sum_j t_jx_{jh}$ for every machine $h$
  3. It minimizes $\sum_j t_jx_{j1}$, the load of the first machine
  4. It minimizes a variable $C_{\max}$ with $C_{\max}\ge\sum_j t_jx_{jh}$ for every machine $h$
Explanation. With $C_{\max}$ at least every load, the minimum of $C_{\max}$ is the largest load. The sum of the loads is constant, $\sum_j t_j$.
oc-f-184 · level teorema · notes
In the LP relaxation of the $\mathrm{ILP}_{P\|C_{\max}}$ model (jobs divisible among the $m$ identical machines, $x_{jh}\ge 0$), which solution is optimal and what is its value?
  1. $x_{jh}=\frac1m$ for all $j,h$, with value $\max_j t_j$
  2. $x_{jh}=\frac1n$ for all $j,h$, with value $\frac1n\sum_j t_j$
  3. $x_{jh}=\frac1m$ for all $j,h$, with value $\frac1m\sum_j t_j$
  4. $x_{j1}=1$ for all $j$, with value $\sum_j t_j$
Explanation. Splitting every job equally all machines have load $\frac1m\sum_j t_j$; no solution does better, because the loads sum to $\sum_j t_j$ and the maximum is at least the average.
oc-f-185 · level facile · notes
Scheduling $P\,||\,C_{\max}$ with $m=3$ identical machines and processing times $t=(9,2,2,2)$. The LP relaxation of the model with assignment variables equals $\frac13\sum_j t_j$. What are the relaxation and the optimal makespan?
  1. $15$ and $9$
  2. $5$ and $9$
  3. $5$ and $5$
  4. $9$ and $9$
Explanation. $\frac{15}{3}=5$; but the job of length $9$ cannot be split, so the makespan is at least $9$, and $\{9\},\{2,2\},\{2\}$ attains it.
oc-f-186 · level facile · notes
In scheduling $P\,||\,C_{\max}$ with $m$ machines, the LP relaxation of the model with assignment variables equals $\frac1m\sum_j t_j$. On which kind of instance is the ratio between the relaxation and the optimal makespan close to $\frac1m$?
  1. One very long job and a few short ones: the optimum is dominated by the long job
  2. Many short equal jobs: the loads balance almost perfectly
  3. Exactly $m$ jobs of equal length
  4. Jobs of length $1$, in a number multiple of $m$
Explanation. If a job of length $T$ dominates, the optimum is about $T$ and the relaxation about $\frac Tm$. With short equal jobs the relaxation is almost exact.
oc-f-187 · level teorema · notes
In the $\mathrm{ILP}_{P\|C_{\max}}$ scheduling model the inequalities $C_{\max}\ge t_j$ for every job $j$ and $C_{\max}\ge\lceil\sum_j t_j/m\rceil$ are added. Which statement is correct?
  1. They are valid only for the optimal schedule, so they may cut feasible schedules
  2. They are already implied by the LP relaxation, so the bound does not change
  3. They make every vertex of the LP relaxation integer
  4. They are valid for every integer schedule and strengthen the LP relaxation
Explanation. In an integer schedule job $j$ sits on one machine, whose load is at least $t_j$, and the maximum of integer loads is at least the rounded-up average. The LP relaxation instead can split jobs, and is worth only $\frac1m\sum_j t_j$.
oc-f-188 · level facile · notes
In the $\mathrm{ILP}_{P\|C_{\max}}$ model of scheduling on $m$ identical machines ($x_{jh}=1$ if job $j$ goes on machine $h$), how many integer solutions correspond to the same schedule, if the schedule uses all the $m$ machines?
  1. $2^m$, one per subset of machines
  2. $n!$, one per order of the jobs
  3. $m!$, one per permutation of the machines
  4. $1$, because the machines are numbered
Explanation. The machines are identical: swapping their names gives another model solution with the same makespan. This symmetry slows down branch-and-bound, as in bin packing.
oc-f-189 · level facile · notes
In scheduling $P\,||\,C_{\max}$ with $m=4$ machines, the ratio between the LP relaxation of the model with assignment variables and the optimal makespan is always at least $\frac1m$. If the relaxation equals $12$, what do we know about the optimal makespan $z(I)$?
  1. $z(I)\ge 48$
  2. $12\le z(I)\le 48$
  3. $z(I)=12$
  4. $3\le z(I)\le 12$
Explanation. The relaxation is a lower bound, so $z(I)\ge 12$; from the ratio at least $\frac14$ we get $z(I)\le 4\cdot 12=48$, i.e., the makespan of all jobs on one machine.
oc-f-190 · level facile · notes
The $\mathrm{ILP}_{P\|C_{\max}}$ scheduling model and the $\mathrm{ILP}_{\mathrm{BPP}}$ bin packing model are both assignment models. What distinguishes them?
  1. In bin packing the capacity is fixed and bins are counted; in scheduling the machines are fixed and the largest load is minimized
  2. In bin packing items can be split; in scheduling jobs cannot
  3. In bin packing the variables are continuous; in scheduling they are binary
  4. In bin packing the largest load is minimized; in scheduling the number of machines
Explanation. The same assignment constraints appear in both; bin packing minimizes $\sum_b y_b$ with capacity $c$, scheduling minimizes $C_{\max}$ with $m$ machines.
oc-f-324 · level teorema · notes
In the LP relaxation $\mathrm{LP}_{P\|C_{\max}}$ of the $P\,||\,C_{\max}$ model ($x_{jh}$ = job $j$ on machine $h$, $\sum_hx_{jh}=1$) the bounds $x_{jh}\le1$ are added. Why does the optimal value not change with respect to the relaxation with only $x_{jh}\ge0$?
  1. Because the bounds $x_{jh}\le1$ are violated by every solution
  2. Because the makespan does not depend on the $x_{jh}$
  3. From $\sum_hx_{jh}=1$ and $x_{jh}\ge0$ it already follows that $x_{jh}\le1$
  4. Because the optimal value is always $\max_jt_j$
Explanation. The bounds are implied, so the two relaxations coincide and are worth $\sum_jt_j/m$, with the solution $x_{jh}=1/m$.
oc-f-325 · level facile · notes
The LP relaxation of $P\,||\,C_{\max}$ is worth $\sum_jt_j/m$. With $m=3$ machines and times $t=(5,5,4,4,3,3,3)$, what is it worth and what is an optimal solution?
  1. $27$, with all jobs on machine $1$
  2. $9$, with $x_{jh}=\frac13$ for every job and machine
  3. $11$, with the assignment $(1,2,3,3,1,2,1)$
  4. $5$, with every job on one machine
Explanation. $\sum_jt_j=27$ and $27/3=9$: splitting every job into equal parts among the machines balances the loads perfectly. The integer optimum is larger.
oc-f-326 · level facile · notes
For the $P\,||\,C_{\max}$ model one considers the inequalities $C_{\max}\ge t_j$ for every job and $C_{\max}\ge\lceil\sum_jt_j/m\rceil$. Why are they valid?
  1. In every integer schedule job $j$ is on a machine of load at least $t_j$, and the maximum of the $m$ integer loads is at least their average rounded up
  2. Because the LP relaxation always satisfies them
  3. Because every machine has load exactly $\sum_jt_j/m$
  4. Because the jobs all have the same duration
Explanation. Both hold for every integer solution; added to the relaxation they strengthen it (the relaxation alone may have $C_{\max}<\max_jt_j$).
oc-f-327 · level ipotesi · notes
In the $P\,||\,C_{\max}$ model the constraints $\sum_jt_jx_{jh}\ge\sum_jt_jx_{j,h+1}$ (non-increasing loads) remove equivalent renumberings of the machines. Why are they called «optimality-preserving» and not «valid»?
  1. Because every feasible assignment satisfies them
  2. Because they also hold with unrelated machines ($R\,||\,C_{\max}$)
  3. Because they remove all optimal solutions
  4. They exclude some feasible assignments, but every schedule can be renumbered to satisfy them without changing the makespan, since the machines are identical
Explanation. A valid constraint excludes no feasible solution; these exclude some, but at least one optimal solution remains. With non-identical machines the renumbering would change the times.
oc-f-552 · level facile · notes
The ILP model of $P\,||\,C_{\max}$ has the variables $x_{jh}$ (job $j$ on machine $h$), the continuous variable $C_{\max}$, the constraints $\sum_hx_{jh}=1$ and $C_{\max}\ge\sum_jt_jx_{jh}$. With $n=4$ jobs and $m=2$ machines, how many constraints does it have, besides the domains?
  1. $4$: one for every job
  2. $2$: one for every machine
  3. $6$: jobs plus machines
  4. $8$: one per variable $x_{jh}$
Explanation. One assignment constraint per job and one load constraint per machine: $n+m=6$.
oc-f-553 · level facile · notes
In the model of $P\,||\,C_{\max}$ ($\min C_{\max}$, $C_{\max}\ge\sum_jt_jx_{jh}$ for every machine) an assignment has loads $(9,8,10)$ and $C_{\max}=12$ is set. What can be said?
  1. It is infeasible, because $12>\sum_jt_j/3$
  2. Feasible, not optimal: $C_{\max}$ can go down to $10$
  3. It is infeasible, because $C_{\max}$ must equal a load
  4. It is optimal, because $C_{\max}$ exceeds all loads
Explanation. The constraints only ask $C_{\max}\ge$ every load; minimizing, at the optimum $C_{\max}$ equals the maximum load.
oc-f-554 · level teorema · notes
In the model of $P\,||\,C_{\max}$ one fixes $C_{\max}=T$ (a constant) and removes the objective. Which problem is obtained?
  1. Is there a schedule with makespan $\le T$?
  2. Bin packing of capacity $T$ with the minimum number of bins
  3. The same problem, because $T$ is the optimum
  4. A problem that is always feasible, for every $T$
Explanation. The constraints $\sum_jt_jx_{jh}\le T$ and $\sum_hx_{jh}=1$ ask to place the jobs into $m$ bins of capacity $T$; for $T<z(I)$ there are no solutions.
oc-f-555 · level facile · notes
Model of $P\,||\,C_{\max}$ with $m=2$ machines and times $t=(4,3,2)$. What is the optimum of the ILP model?
  1. $7$
  2. $4.5$
  3. $9$
  4. $5$
Explanation. $\{4\}$ and $\{3,2\}$ have loads $4$ and $5$: $C_{\max}=5$. $4.5=\sum_jt_j/m$ is the linear relaxation, $7$ the makespan of $\{4,3\},\{2\}$.
oc-f-556 · level teorema · notes
The linear relaxation of the model of $P\,||\,C_{\max}$ (continuous variables $x_{jh}\ge0$) equals $\sum_jt_j/m$ and ignores the longest job $\max_jt_j$. Why?
  1. Because $\max_jt_j\le\sum_jt_j/m$ in every instance
  2. Because the relaxation is unbounded
  3. The jobs can be split among the machines
  4. Because the longest job always has $x_{jh}=0$
Explanation. With $x_{jh}=1/m$ every job is split into equal parts and every load equals $\sum_jt_j/m$; that is why the valid inequality $C_{\max}\ge t_j$ is added.
oc-f-557 · level facile · notes
The second linear relaxation of $P\,||\,C_{\max}$ adds $x_{jh}\le1$ to the first one ($\sum_hx_{jh}=1$, $x_{jh}\ge0$). What is its effect?
  1. It lowers the value, because it adds constraints
  2. None: $x_{jh}\le1$ follows from $\sum_hx_{jh}=1$ and $x\ge0$
  3. It raises the value to the maximum of $\max_jt_j$ and $\sum_jt_j/m$
  4. It makes the optimal solution integer
Explanation. Every $x_{jh}$ is a non-negative term of a sum equal to $1$: the two relaxations have the same region and the same value $\sum_jt_j/m$.
oc-f-558 · level teorema · notes
For the model of $P\,||\,C_{\max}$, $C_{\max}\ge t_j$ is a valid inequality, while the constraints on non-increasing loads $L_1\ge L_2\ge\dots\ge L_m$ preserve optimality. What is the difference?
  1. The first cuts no solution; the second do, but not all optima
  2. The first cuts optimal solutions; the second do not
  3. They are the same thing with two different names
  4. The first holds only in the linear relaxation
Explanation. Every integer schedule has makespan $\ge t_j$. A schedule with unordered loads violates the symmetry constraints, but renumbering the machines gives an equivalent one satisfying them.
oc-f-559 · level ipotesi · notes
In the $P\,||\,C_{\max}$ instance with $m=3$ and $t=(5,5,4,4,3,3,3)$ every optimal schedule has loads $(9,9,9)$, and the model has $12$ optimal solutions. How many of them do the symmetry constraints $L_1\ge L_2\ge L_3$ on the loads eliminate?
  1. All but $2$, one per schedule
  2. All but a single one
  3. Half of them, i.e., $6$ solutions
  4. None: the loads are equal
Explanation. The constraints compare the loads; with $9\ge9\ge9$ every permutation of the machines satisfies them: they eliminate renumberings only when the loads are distinct.

15. Formulations of lot sizing problems (46)

oc-f-051 · level facile · notes
Capacitated lot sizing (CLS) over $m$ periods: $x_t$ is the production, $y_t=1$ if the setup is paid in period $t$, $cap_t$ the capacity and $D_{t,m}=\sum_{u=t}^m d_u$ the residual demand. In the big-M formulation the link is $x_t\le M_t\,y_t$. Which value of $M_t$ is the strongest?
  1. $M_t=\min\{cap_t,\ D_{t,m}\}$
  2. $M_t=\max\{cap_t,\ D_{t,m}\}$
  3. $M_t=\min\{cap_t,\ D_{1,m}\}$
  4. $M_t=\min\{cap_t,\ d_t\}$
Explanation. The production of period $t$ exceeds neither the capacity nor the residual demand $D_{t,m}$: the smallest valid value gives the strongest relaxation. With $d_t$ feasible plans producing in advance would be cut off; $D_{1,m}\ge D_{t,m}$ is valid but weaker.
oc-f-052 · level teorema · notes
In the big-M formulation of capacitated lot sizing (CLS), the production $x_t$ and the setup variable $y_t\in\{0,1\}$ are linked by $x_t\le M_t\,y_t$. Which statement on the choice of $M_t$ is correct?
  1. Every valid value gives a correct model, and the larger $M_t$, the stronger the LP relaxation
  2. The value of $M_t$ changes the optimal value of the integer model, even among valid values
  3. A value smaller than the production of a feasible plan strengthens the model without excluding solutions
  4. Every valid value gives a correct model, and the smaller $M_t$, the stronger the LP relaxation
Explanation. In the relaxation $\tilde y_t=\tilde x_t/M_t$: a small $M_t$ makes the setups more expensive. A value that is too small, however, cuts off feasible plans, and one that is too large weakens the bound.
oc-f-053 · level facile · notes
For capacitated lot sizing (CLS) there are the big-M formulation (constraints $x_t\le M_t\,y_t$) and the shortest path formulation. What distinguishes the latter from the former?
  1. It describes the plans as paths in a network, without setup variables; the integer optimal value is lower
  2. It has fewer variables than the big-M one and the same LP relaxation; the integer optimal value is the same
  3. It describes the plans as paths in a network, without big-M; its relaxation is stronger, the integer optimal value is the same
  4. It describes the plans as paths in a network, without big-M; its relaxation is weaker, the integer optimal value is the same
Explanation. The two formulations have the same optimal value; they differ in the lower bound of the relaxation and in the size of the model.
oc-f-191 · level facile · notes
Capacitated lot sizing (CLS) over $4$ periods: demands $d=(20,10,30,15)$, capacity $cap_t=50$ in every period. In the big-M formulation, $x_t\le M_t\,y_t$ links production and setup, and the strong value is $M_t=\min\{cap_t,D_{t,4}\}$ with $D_{t,4}$ the demand of periods $t$ to $4$. What is $M_3$?
  1. $45$
  2. $50$
  3. $30$
  4. $75$
Explanation. $D_{3,4}=30+15=45<50$, hence $M_3=45$: an optimal plan does not produce more than the residual demand. $75=D_{1,4}$ is the total demand, valid but weaker.
oc-f-192 · level facile · notes
In the LP relaxation of the big-M lot sizing formulation ($x_t\le M_t\,y_t$, $0\le y_t\le 1$, setup cost $sc_t$ for $y_t$), a solution produces $x_t=10$ with $M_t=40$ and $sc_t=80$. How much setup does it pay in period $t$, at least?
  1. $80$
  2. $0$
  3. $320$
  4. $20$
Explanation. The constraint gives $y_t\ge x_t/M_t=\frac14$, and the relaxation chooses the minimum: $80\cdot\frac14=20$. This is why a large $M_t$ weakens the relaxation.
oc-f-193 · level facile · notes
In lot sizing models, with production $x_t$, demand $d_t$ and stock $s_t$ at the end of period $t$ ($s_0=0$), which constraint expresses the stock balance?
  1. $x_t=d_t$
  2. $s_{t-1}+d_t=x_t+s_t$
  3. $s_{t-1}+x_t=d_t+s_t$
  4. $s_t+x_t=d_t+s_{t-1}$
Explanation. Incoming stock plus production covers the demand of the period and the outgoing stock. With $s_t\ge 0$ production cannot serve earlier periods.
oc-f-194 · level facile · notes
In the shortest-path lot sizing formulation, the variable $zv_{tk}\ge 0$ is the fraction of the demand $D_{t,k}$ of periods $t,\dots,k$ produced in period $t$, and it is an arc from $t-1$ to $k$ in a network with nodes $0,\dots,m$. What does a path from node $0$ to node $m$ represent?
  1. The sequence of periods without a setup
  2. A plan producing only with zero incoming stock, one run per arc
  3. A lot-for-lot plan, with a setup in every period
  4. Any plan, even with late production
Explanation. Every arc $(t-1,k)$ produces in $t$ the demand of periods $t$ to $k$, and the path covers every period once. Plans that are not paths are combinations of paths with fractional $zv_{tk}$.
oc-f-195 · level facile · notes
In the shortest-path formulation of capacitated lot sizing, the link with the setup is $\sum_{k\ge t}zv_{tk}\le y_t$. What makes it stronger than the big-M link $x_t\le M_t\,y_t$?
  1. It has coefficient $1$ instead of a big-M: a fractional run pays a fraction of setup equal to the fraction of the run
  2. It imposes $y_t=1$ in every period with positive demand
  3. It uses continuous $y_t$ variables instead of binary ones
  4. It drops the capacities $cap_t$, which weaken the relaxation
Explanation. The sum of the $zv_{tk}$ leaving node $t-1$ is the fraction of runs produced in $t$, and the setup covers it fully; in the big-M link a small production pays only $x_t/M_t$.
oc-f-196 · level facile · notes
In uncapacitated lot sizing (ULS), with $D_{t,m}$ the demand of periods $t$ to the last one $m$, which value of $M_t$ is the strongest in the constraint $x_t\le M_t\,y_t$?
  1. $M_t=D_{1,m}$
  2. $M_t=d_t$
  3. $M_t=+\infty$
  4. $M_t=D_{t,m}$
Explanation. Without capacities the limit comes only from the residual demand: producing more than $D_{t,m}$ in period $t$ is useless. $M_t=d_t$ would exclude runs covering several periods.
oc-f-197 · level facile · notes
In lot sizing with several products and setup times (MLS), product $p$ takes $vt_{pt}$ units of time per unit produced and $st_{pt}$ units of time for the setup ($y_{pt}=1$). Which capacity constraint is correct in period $t$?
  1. $\sum_p x_{pt}\le cap_t\,y_{pt}$
  2. $\sum_p st_{pt}\,y_{pt}\le cap_t$
  3. $\sum_p(st_{pt}\,y_{pt}+vt_{pt}\,x_{pt})\le cap_t$
  4. $\sum_p vt_{pt}\,x_{pt}\le cap_t$
Explanation. The time of the period is consumed by production and setups. Forgetting $st_{pt}\,y_{pt}$ is a typical mistake: setups would look free in terms of time.
oc-f-198 · level facile · notes
In lot sizing with several products and setup times, the strong big-M value for product $p$ in period $t$ is $M_{pt}=\min\{\lfloor(cap_t-st_{pt})/vt_{pt}\rfloor,\ sd_{ptm}\}$, with $sd_{ptm}$ the residual demand of $p$. With $cap_t=10$, $st_{pt}=2$, $vt_{pt}=2$ and $sd_{ptm}=7$, what is it?
  1. $5$
  2. $4$
  3. $7$
  4. $10$
Explanation. After the setup $10-2=8$ time units remain, i.e., $\lfloor 8/2\rfloor=4$ units of product, less than the residual demand $7$. Forgetting the setup time would give $\lfloor 10/2\rfloor=5$.
oc-f-199 · level facile · notes
In the lot sizing model with overtime (LS-OT), $\mu_t$ is the normal time used (at most $cap^{N}_t$, cost $cw_t$) and $\nu_t$ the overtime (at most $cap^{O}_t$, cost $co_t$). Which constraint links working time to production and setups?
  1. $\sum_p(st_{pt}\,y_{pt}+vt_{pt}\,x_{pt})\le\mu_t+\nu_t$
  2. $\sum_p vt_{pt}\,x_{pt}\le cap^{N}_t$
  3. $\mu_t+\nu_t\le\sum_p x_{pt}$
  4. $\sum_p(st_{pt}\,y_{pt}+vt_{pt}\,x_{pt})\le\mu_t\,\nu_t$
Explanation. The capacity becomes a decision: the time used $\mu_t+\nu_t$ must cover production and setups, and its cost $cw_t\mu_t+co_t\nu_t$ enters the objective.
oc-f-328 · level facile · notes
In single-product lot sizing models, $x_t$ is the quantity produced, $s_t$ the inventory at the end of the period and $d_t$ the demand of period $t$. Which flow balance constraint links these quantities?
  1. $s_t+x_t=d_t+s_{t-1}$
  2. $x_t=d_t$
  3. $s_{t-1}+x_t\le d_t$
  4. $s_{t-1}+x_t=d_t+s_t$
Explanation. What enters the period (previous inventory plus production) leaves as satisfied demand or final inventory. The second constraint has the inventories swapped.
oc-f-329 · level facile · notes
Capacitated lot sizing (CLS) has a big-$M$ formulation and a shortest-path formulation. What do they have in common and how do they differ?
  1. They are the same model with different names
  2. The shortest-path formulation does not admit capacities
  3. They have the same integer optimal value, but LP relaxations of different value
  4. They have equal LP relaxations but different integer optimal values
Explanation. Both describe the same plans; the shortest-path formulation has a stronger relaxation, at the price of $O(m^2)$ variables.
oc-f-330 · level teorema · notes
In the LP relaxation of the big-$M$ formulation of capacitated lot sizing ($x_t\le M_ty_t$, $0\le y_t\le1$) an optimal solution has $y_t=x_t/M_t$. Which choice of $M_t$ gives the strongest bound, among the valid ones?
  1. $M_t$ very large, so as not to exclude solutions
  2. $M_t=\min\{cap_t,D_{t,m}\}$, the smallest valid value ($D_{t,m}$ = demand of the periods from $t$ to $m$)
  3. $M_t=D_{t,m}$, the remaining demand
  4. $M_t=cap_t$, the capacity
Explanation. The smaller $M_t$, the larger $y_t$ must be for the same production, and the more setup cost the relaxation pays. On the reference instance: $99.65$, $137.5$ and $157.5$.
oc-f-331 · level ipotesi · notes
In the big-$M$ formulation of capacitated lot sizing, $x_t\le M_ty_t$. What happens if $M_t$ is chosen smaller than $\min\{cap_t,D_{t,m}\}$ ($D_{t,m}$ = demand of the periods from $t$ to $m$)?
  1. The constraint may cut off feasible plans, even optimal ones: the model is no longer correct
  2. The relaxation becomes stronger and the model stays correct
  3. The model becomes unbounded
  4. Nothing changes
Explanation. An optimal plan may produce in $t$ up to $\min\{cap_t,D_{t,m}\}$; with a smaller $M_t$ that production is forbidden. The smallest valid value gives the strongest relaxation without losing solutions.
oc-f-332 · level facile · notes
On the reference instance of capacitated lot sizing the optimal value is $180$ and the strongest big-$M$ relaxation is worth $157.5$. What is the gap $\frac{180-\LB}{\LB}$?
  1. About $12.5\%$
  2. $22.5$
  3. About $5.9\%$
  4. About $14.3\%$
Explanation. $\frac{22.5}{157.5}\approx0.143$. Dividing by $180$ instead of $\LB$ gives $12.5\%$; $5.9\%$ is the gap of the shortest-path formulation ($\LB=170$).
oc-f-333 · level teorema · notes
On the reference instance of capacitated lot sizing the relaxation of the shortest-path formulation is worth $170$, which is the optimal cost of the same problem without capacities. How is this explained?
  1. Because the integer optimal value is $170$
  2. By chance: there is no link
  3. In the relaxation the capacity constraints act only on the quantities and a convex combination of plans satisfies them
  4. Because the shortest-path formulation ignores the setup costs
Explanation. The shortest-path relaxation describes the uncapacitated part well (it is a shortest path), but the capacities remain weak.
oc-f-334 · level facile · notes
The model of lot sizing with initial inventory (LS-SI) starts from the multi-product model. What changes?
  1. The setup variables become continuous
  2. The constants $s_{p0}=0$ become variables $si_p\ge0$, with the cost $fc_p\,si_p$ in the objective
  3. The capacity constraints are removed
  4. A mandatory final inventory is added
Explanation. The initial inventory enters the balance of the first period and is paid for; the other constraints are those of the multi-product model.
oc-f-355 · level facile · notes
From which model do the ILP models of the lot sizing variants (initial inventory, overtime, unmet demand) start, and what do they add?
  1. From the multi-product model with setup times; they add a few variables and their costs, leaving the other constraints unchanged
  2. From a completely new model for every variant
  3. From the uncapacitated model, removing the setups
  4. From the bin packing model
Explanation. Every variant changes a single feature: for instance the initial inventory replaces the constant $s_{p0}=0$ with a variable paid $fc_p$ per unit.
oc-f-356 · level facile · notes
In lot sizing with unmet demand (LS-UD) the variable $\varepsilon_{pt}\in\Z_{\ge0}$ is the unmet demand of product $p$ in period $t$, with penalty $cu_{pt}$ per unit. How does the flow balance constraint change?
  1. $s_{p,t-1}+x_{pt}=d_{pt}+s_{pt}+\varepsilon_{pt}$
  2. $x_{pt}+\varepsilon_{pt}\le cap_t$
  3. $s_{pt}=\varepsilon_{pt}$
  4. $s_{p,t-1}+x_{pt}+\varepsilon_{pt}=d_{pt}+s_{pt}$
Explanation. The demand $d_{pt}$ is covered by inventory, production and an unmet part, paid $cu_{pt}\varepsilon_{pt}$ in the objective.
oc-f-357 · level ipotesi · notes
In lot sizing with unmet demand the penalty $cu_{pt}$ per lost unit enters the objective. What happens if the penalty is smaller than the cost of producing and holding that unit?
  1. The penalty has no effect
  2. The optimal plan still produces all the demand
  3. The optimal plan prefers to leave that demand unmet
  4. The model becomes infeasible
Explanation. The model chooses the cheapest way to cover every unit: with a low penalty giving up is cheaper; in practice $cu_{pt}$ is set high enough.
oc-f-560 · level facile · notes
The big-$M$ models of lot sizing have, for every period $t$, the production $x_t$, the stock $s_t$ and the setup $y_t$. Of which type are these variables?
  1. All binary, like the setups
  2. $x_t$ binary, $s_t$ and $y_t$ integer
  3. All continuous and non-negative
  4. $x_t$ and $s_t$ integer, $y_t$ binary
Explanation. Quantities and stocks are numbers of units (non-negative integers); the setup is a yes/no decision.
oc-f-561 · level facile · notes
In lot sizing models the flow balance is $s_{t-1}+x_t=d_t+s_t$. With $s_2=3$, $x_3=4$ and $d_3=5$, what is $s_3$?
  1. $12$
  2. $-2$
  3. $2$
  4. $7$
Explanation. $s_3=s_2+x_3-d_3=3+4-5=2$: the incoming stock plus the production covers the demand, and the rest goes to the next period.
oc-f-562 · level facile · notes
For capacitated lot sizing there are the big-$M$ formulation and the shortest path formulation. What does the second one replace?
  1. The objective function, with the length of a tour
  2. The production and stock variables, with the arcs of a network
  3. The setup variables, with continuous variables
  4. The capacity constraint, with a path constraint
Explanation. The variables $zv_{tk}$ are arcs from node $t-1$ to node $k$: producing in $t$ the demand of periods $t,\dots,k$. The setups $y_t$ remain.
oc-f-563 · level facile · notes
The big-$M$ model of capacitated lot sizing over $m$ periods has balance constraints, capacity constraints and linking constraints $x_t\le M_ty_t$. How many does it have in each family?
  1. $m$ in each family
  2. $m$ balance, a single capacity, $m$ linking
  3. $m^2$ linking, $m$ for the others
  4. One per family
Explanation. Every period has its own balance, its own capacity and its own link between production and setup.
oc-f-564 · level teorema · notes
In the big-$M$ model of capacitated lot sizing the strong value $M_t=\min\{cap_t,D_{t,m}\}$ is used ($D_{t,m}$ demand of periods $t$ to $m$). What happens to the capacity constraint $x_t\le cap_t$?
  1. It becomes tighter
  2. It must become an equality
  3. It must be rewritten as $x_t\le D_{t,m}$
  4. It becomes redundant
Explanation. $x_t\le M_ty_t\le cap_t$: with $M_t\le cap_t$ and $y_t\le1$ the link already implies the capacity; keeping it is useful only with values of $M_t$ larger than $cap_t$.
oc-f-565 · level teorema · notes
In single-product lot sizing, why can the quantities $x_t$ be made integer without changing the optimal cost, once the setups $y_t$ are fixed?
  1. Because the stocks are zero at the optimum
  2. Because the linear relaxation is always integer
  3. A minimum-cost flow remains, with integer optimum
  4. Because the demands are always even
Explanation. With the setup periods fixed, balances and capacities are the constraints of a network with integer data; with several products and times $vt_{pt}>1$ the argument no longer holds.
oc-f-566 · level facile · notes
In the big-$M$ formulation of lot sizing the link between production and setup is $x_t\le M_ty_t$, with $y_t\in\{0,1\}$. What does it impose?
  1. $x_t=M_ty_t$ in every period
  2. $y_t=0\Rightarrow x_t=0$; otherwise $x_t\le M_t$
  3. $x_t=0\Rightarrow y_t=0$ in every period
  4. $y_t=1\Rightarrow x_t=M_t$ in every period
Explanation. Without setup there is no production; with the setup one produces up to $M_t$. The converse ($x_t=0\Rightarrow y_t=0$) is not imposed, but holds at the optimum because the setup costs.
oc-f-567 · level facile · notes
Capacitated lot sizing over $4$ periods with demands $d=(20,10,30,15)$. In the model with $M_t=D_{t,4}$ (demand of periods $t$ to $4$), what is $M_2$?
  1. $55$
  2. $75$
  3. $10$
  4. $45$
Explanation. $D_{2,4}=10+30+15=55$. $75$ is the total demand $D_{1,4}$, $10$ only the demand of period $2$, $45=D_{3,4}$.
oc-f-568 · level facile · notes
In the linear relaxation of the big-$M$ formulation of lot sizing $y_t=x_t/M_t$ holds at the optimum. If $x_3=4$, $M_3=10$ and the setup cost is $sc_3=50$, how much setup cost does period $3$ pay in the relaxation?
  1. $50$
  2. $0$
  3. $12.5$
  4. $20$
Explanation. $y_3=4/10=0.4$, so $0.4\cdot50=20$ is paid instead of $50$: this discount on setups is what makes the bound weak.
oc-f-569 · level teorema · notes
In the optimal solution of the linear relaxation of the big-$M$ formulation of lot sizing $y_t=x_t/M_t$ holds. In which periods is $y_t$ integer?
  1. Only in the first period of the plan
  2. In no period of the plan
  3. Only where $x_t=0$ or $x_t=M_t$
  4. In all periods of the plan
Explanation. $y_t=0$ if nothing is produced and $y_t=1$ if exactly $M_t$ is produced; every intermediate quantity gives a fractional setup.
oc-f-570 · level facile · notes
In the shortest path formulation of lot sizing the arc $zv_{tk}$ produces in period $t$ the demand of periods $t,\dots,k$, with cost $cv_{tk}=vc_tD_{t,k}+\sum_{s=t+1}^{k}\sum_{u=t}^{s-1}hc_ud_s$. With $vc=0$, $hc_u=1$ and $d=(2,1,3)$, what is $cv_{13}$?
  1. $6$
  2. $7$
  3. $4$
  4. $9$
Explanation. The demand $d_2=1$ stays in stock one period, $d_3=3$ two periods: $1+6=7$. The demand of period $1$ does not go to stock; $4=1+3$ counts a single period for each.
oc-f-571 · level facile · notes
In the shortest path formulation of lot sizing the nodes are $0,1,\dots,m$ and the variable $zv_{tk}$ is the arc from node $t-1$ to node $k$. What does a path from node $0$ to node $m$ represent?
  1. A plan that produces only when the stock is empty
  2. A lot-for-lot plan, with a setup in every period
  3. Any plan, even with positive stock at the setup
  4. The sequence of periods without setup
Explanation. Every arc $(t-1,k)$ produces in $t$ exactly the demand of periods $t,\dots,k$, at empty stock; lot-for-lot is just the path made of one-period arcs.
oc-f-572 · level facile · notes
The shortest path formulation of lot sizing over $m$ periods has one variable $zv_{tk}$ for every pair $1\le t\le k\le m$. How many are there, and how many production variables does the big-$M$ formulation have instead?
  1. $m$ versus $m$
  2. $m^2$ versus $m(m+1)/2$
  3. $2^m$ versus $m$
  4. $m(m+1)/2$ versus $m$
Explanation. The pairs $t\le k$ are $\binom m2+m=m(m+1)/2$: the shortest path formulation is larger, but its relaxation is stronger.
oc-f-573 · level facile · notes
In the linear relaxation of the shortest path formulation of the reference capacitated lot sizing instance (optimum $180$), the setup of period $4$ is paid only for the fraction $\frac45$ and the bound is $170$. What does it show?
  1. That the shortest path formulation is wrong
  2. That the big-$M$ relaxation is stronger
  3. Even this bound has fractional setups and a gap
  4. That the optimal plan costs $170$
Explanation. With capacities the relaxation combines paths and pays part of a setup; the gap $180-170$ is closed only by branch-and-bound or cuts.
oc-f-574 · level facile · notes
In the multi-product lot sizing model (a set $P$ of products shares the time of every period), what happens when the capacity constraints are removed?
  1. The model becomes a single problem without setups
  2. It splits into $|P|$ single-product models
  3. The model becomes infeasible
  4. The products stay linked by the balance constraints
Explanation. The products interact only through the shared time of every period; balances and big-$M$ links concern one product at a time.
oc-f-575 · level facile · notes
In the multi-product lot sizing model ($|P|$ products, $m$ periods), how many capacity constraints are there, and how many flow balance constraints?
  1. $m$ capacity, $|P|\,m$ balance
  2. $|P|\,m$ capacity and $m$ balance constraints
  3. $|P|\,m$ for both families
  4. $m$ for both families
Explanation. The capacity belongs to the period, shared by all products; the balance belongs to every product in every period.
oc-f-576 · level facile · notes
In the uncapacitated lot sizing model the link is $x_t\le D_{t,m}\,y_t$, with $D_{t,m}$ the demand of periods $t$ to $m$. With demands $d=(3,2,4)$, what is the coefficient of $y_2$?
  1. $9$
  2. $2$
  3. $4$
  4. $6$
Explanation. $D_{2,3}=2+4=6$: with zero final stock, period $2$ never produces more than the demand of periods $2$ and $3$.
oc-f-577 · level facile · notes
The model $\mathrm{ILP}_{\mathrm{ULS}}$ of uncapacitated lot sizing over $m$ periods has the balances $s_{t-1}+x_t=d_t+s_t$ and the links $x_t\le D_{t,m}y_t$. How is it obtained from the capacitated model?
  1. By fixing all $y_t=1$
  2. By adding a total capacity constraint
  3. Without capacities and with $M_t=D_{t,m}$
  4. By removing the balance constraints
Explanation. Without capacities the strong value $\min\{cap_t,D_{t,m}\}$ becomes $D_{t,m}$; the model is also solved by the Wagner-Whitin DP.
oc-f-578 · level teorema · notes
In the shortest path formulation of multi-product lot sizing the variables $zv_{ptk}$ are continuous, and constraints making the quantities $x_{pt}$ integer are added. Why are they not needed with a single product and $vt_t=1$?
  1. They are always needed, even with one product
  2. With setups fixed, a flow with integer optimum remains
  3. Because with several products the demands are fractional
  4. Because the variables $zv_{ptk}$ are binary
Explanation. With $vt_{pt}>1$ fractional quantities use capacity better: without the integrality constraints the multi-product model is only a relaxation and its optimum may be lower than the optimal cost.
oc-f-579 · level facile · notes
The lot sizing model with initial stock replaces the constant $s_{p0}=0$ by a variable $si_p$, bought at cost $fc_p$. Do the strong big-$M$ values $M_{pt}$ of the multi-product model change?
  1. No: they stay those of the multi-product model
  2. Yes: $si_p$ is added to every $M_{pt}$
  3. Yes: they all become equal to $cap_t$
  4. Yes: $fc_p$ is subtracted from every $M_{pt}$
Explanation. The production of period $t$ stays bounded by the available time and the residual demand; the initial stock can only reduce the production needed.
oc-f-580 · level facile · notes
In the shortest path formulation of lot sizing with initial stock, the network of every product has extra arcs $w_{pt}\ge0$ from node $0$ to node $t$. What do they represent?
  1. The production of period $t$ without setup
  2. The unmet demand up to period $t$
  3. The overtime used in period $t$
  4. The initial stock for the first $t$ periods
Explanation. An arc $0\to t$ serves periods $1,\dots,t$ without producing, with the stock bought at the start; its cost contains $fc_p$ and the holding.
oc-f-581 · level facile · notes
In the lot sizing model with overtime the time of period $t$ is the regular time $\mu_t\le cap^N_t$ plus the overtime $\nu_t\le cap^O_t$. Which available time does the strong big-$M$ value use?
  1. $cap^O_t$
  2. $\max\{cap^N_t,cap^O_t\}$
  3. $cap^N_t+cap^O_t$
  4. $cap^N_t$
Explanation. With overtime production can use up to $cap^N_t+cap^O_t$ time units; keeping the fixed capacity $cap^N_t$ would cut feasible plans.
oc-f-582 · level facile · notes
Lot sizing with overtime: in a period $6$ units of product $A$ (time $1$ per unit, setup $2$) and $4$ of product $B$ (time $2$ per unit, setup $3$) are produced; the regular time is $cap^N_t=15$. How much overtime is needed?
  1. $5$
  2. $4$
  3. $0$
  4. $19$
Explanation. Total time $(6+2)+(8+3)=19$, of which $15$ regular: $4$ of overtime. Forgetting the setups one would get $14\le15$, i.e., no overtime.
oc-f-583 · level teorema · notes
In the lot sizing model with unmet demand, $\varepsilon_{pt}\le d_{pt}$ is the lost demand. Why do the big-$M$ values of the multi-product model remain valid?
  1. Losing demand, production can only decrease
  2. Because the penalty $cu_{pt}$ is always large
  3. Because at the optimum $\varepsilon_{pt}=0$
  4. They do not remain valid: they must be increased
Explanation. Losing demand reduces the residual demand to serve, so an upper bound on production stays one. With $\varepsilon=0$ the base model is recovered.

Part: Ad hoc algorithms (41)

16. Knapsack: branch-and-bound on the critical item (17)

oc-f-054 · level facile · notes
In branch-and-bound for the knapsack problem (integer profits), the best known solution has value $\mathrm{LB}=15$; a node has LP relaxation $z(\mathrm{LP}^k_{\mathrm{KP}})=\frac{47}{3}$ with a fractional solution. What is done with the node?
  1. It is branched on, because $\frac{47}{3}>15=\mathrm{LB}$
  2. It is pruned by integrality, and $\mathrm{LB}$ becomes $15$
  3. $\mathrm{LB}$ is updated to $\frac{47}{3}$ and the node is branched on
  4. It is pruned by bound, because $\lfloor 47/3\rfloor=15\le\mathrm{LB}$
Explanation. The profits are integer, so the bound of the node is $\lfloor z(\mathrm{LP}^k_{\mathrm{KP}})\rfloor$; comparing $\frac{47}{3}$ with $15$ without rounding would explore a useless node.
oc-f-055 · level facile · notes
In branch-and-bound for the knapsack problem, at node $k$ some items are fixed to $1$ ($\mathscr{I}^k_{\text{in}}$), others to $0$ ($\mathscr{I}^k_{\text{out}}$) and the rest are free ($\mathscr{I}^k$); $c(k)$ is the residual capacity and $p(k)$ the profit of the items fixed to $1$. How are the split item and $z(\mathrm{LP}^k_{\mathrm{KP}})$ computed?
  1. On the free items $\mathscr{I}^k$ with capacity $c(k)$, without adding constants
  2. On all the items of the instance with capacity $c$, without adding constants
  3. On the free items $\mathscr{I}^k$ with capacity $c(k)$, adding the constant $p(k)$
  4. On the free items $\mathscr{I}^k$ with capacity $c$, adding the constant $p(k)$
Explanation. The items of $\mathscr{I}^k_{\text{in}}$ use capacity and bring profit: $c(k)$ is the residual capacity and $p(k)$ their profit. Forgetting either is a typical mistake.
oc-f-056 · level teorema · notes
In branch-and-bound for the knapsack problem, at every node $k$ some variables are fixed to $0$ or $1$ and $\mathrm{LP}^k_{\mathrm{KP}}$ is the LP relaxation of the subproblem. Which statement on $\mathrm{LP}^k_{\mathrm{KP}}$ is correct?
  1. It is solved with Dantzig's formulas, and the solution always has two fractional variables
  2. It is solved with Dantzig's formulas, and the solution has at most one fractional variable
  3. It is solved with the simplex method, and the solution may have many fractional variables
  4. It is solved with DP on the residual capacity, and the solution is always integer
Explanation. Every node is a smaller linear KP: the free items sorted by efficiency are taken up to the split item, taken partially. This is why branching is on the variable of the split item.
oc-f-211 · level facile · notes
In the branch-and-bound for the 0-1 knapsack, the LP relaxation of a node, solved by Dantzig's formulas, has at most one fractional variable. On which variable does it branch, and with which constraints?
  1. On the first free variable: children with $x_j=0$, $x_j=\frac12$ and $x_j=1$
  2. On all free variables together
  3. On the variable of the split item $s$: children with $x_s\le 0$ (excluded) and $x_s\ge 1$ (taken)
  4. On the variable of largest profit: children with $x_j\le\frac12$ and $x_j\ge\frac12$
Explanation. The split item is the only fractional one; the two children exclude or take it, and the parent node is not solved again.
oc-f-212 · level facile · notes
In the branch-and-bound for the 0-1 knapsack, $c(k)$ is the residual capacity of node $k$ after the items fixed to $1$. What is done with a node with $c(k)<0$?
  1. The lower bound is updated with the profit $p(k)$
  2. It is pruned by infeasibility: the items fixed to $1$ already exceed the capacity
  3. It branches on the heaviest item fixed to $1$
  4. Its relaxation is solved with capacity $0$
Explanation. With $c(k)<0$ no choice of the free items makes the node feasible: its relaxation is infeasible and the node is closed.
oc-f-213 · level facile · notes
In the branch-and-bound for the 0-1 knapsack, at node $k$ the free items $\mathscr{I}^k$ weigh in total at most the residual capacity $c(k)$. What is done with the node?
  1. The relaxation is integer (all free items taken): it is pruned by integrality and the lower bound is possibly updated
  2. It branches on the most efficient free item
  3. It is pruned by infeasibility
  4. It is solved with the simplex, because Dantzig's formulas do not hold
Explanation. Without a split item the solution $\tilde x_j=1$ for every free item is integer and optimal for the node: it is a feasible KP solution, and the node needs no children.
oc-f-214 · level facile · notes
Branch-and-bound for the 0-1 knapsack with capacity $c=9$ and items sorted by non-increasing efficiency, $p=(10,7,6,4)$, $w=(5,4,3,3)$. At the node with $x_1$ fixed to $0$ (item $1$ excluded), the relaxation is solved on items $2,3,4$ with capacity $9$. What is $z(\mathrm{LP}^k_{\mathrm{KP}})$?
  1. $17$
  2. $\frac{71}{4}$
  3. $13$
  4. $\frac{47}{3}$
Explanation. Items $2$ and $3$ weigh $7$; item $4$ is the split item with $\mathit{rc}=2$: $7+6+4\cdot\frac23=\frac{47}{3}\approx 15.67$. $13$ forgets the fractional part.
oc-f-215 · level facile · notes
Branch-and-bound for the 0-1 knapsack with capacity $c=9$ and items sorted by non-increasing efficiency, $p=(10,7,6,4)$, $w=(5,4,3,3)$. At the node with $x_3$ fixed to $1$, the residual capacity is $c(k)=6$ and the fixed profit is $p(k)=6$; the relaxation is solved on the free items $1,2,4$. What is $z(\mathrm{LP}^k_{\mathrm{KP}})$?
  1. $\frac{47}{4}$
  2. $19$
  3. $\frac{71}{4}$
  4. $\frac{47}{3}$
Explanation. Item $1$ fits (weight $5$, residual $1$); item $2$ is the split item: $6+10+7\cdot\frac14=\frac{71}{4}=17.75$. Without the constant $p(k)$ one would get $\frac{47}{4}$.
oc-f-216 · level facile · notes
In the branch-and-bound for the 0-1 knapsack the nodes are extracted with the FIFO or LIFO rule. In which order are the two children of a node solved?
  1. In random order
  2. First the child with $x_s\le 0$ (split item excluded), then the one with $x_s\ge 1$
  3. First the child with $x_s\ge 1$, then the one with $x_s\le 0$
  4. First the child with the higher bound
Explanation. The fixed rule makes the run reproducible: nodes are numbered in the order in which they are solved, with the «down» branch before the «up» branch.
oc-f-217 · level teorema · notes
In the branch-and-bound for the 0-1 knapsack, the relaxation of a node may have several optimal solutions when some items have the same efficiency $p_j/w_j$. Which statement is correct?
  1. Dantzig's formulas give an optimal solution with at most one fractional variable, even if other optimal solutions have more
  2. Every optimal solution has exactly one fractional variable
  3. With equal efficiencies the relaxation becomes infeasible
  4. With equal efficiencies the simplex must be used
Explanation. With equal efficiencies capacity can be moved between items without changing the value, giving more fractional variables; the algorithm uses Dantzig's solution and branches on the only fractional one.
oc-f-218 · level facile · notes
In the branch-and-bound for the 0-1 knapsack with integer profits, which bound is used to prune a node, and which operation of the general algorithm is not needed?
  1. $\lceil z(\mathrm{LP}^k_{\mathrm{KP}})\rceil$; no branching is needed
  2. $z(\mathrm{LP}^k_{\mathrm{KP}})$ without rounding; no lower bound is needed
  3. $p(k)$; no relaxation is needed
  4. $\lfloor z(\mathrm{LP}^k_{\mathrm{KP}})\rfloor$; no simplex is needed, since every node is solved by Dantzig's formulas
Explanation. With integer profits every solution in the subtree is worth at most $\lfloor z(\mathrm{LP}^k)\rfloor$, and the node is pruned if this does not exceed the lower bound; a node relaxation is a continuous knapsack, solved by a scan.
oc-f-219 · level facile · notes
In the branch-and-bound for the 0-1 knapsack (integer profits), what is the bound at the root, where no variable is fixed?
  1. The sum of all profits
  2. Martello and Toth's bound, always
  3. Dantzig's bound $\mathrm{UB}_{\mathrm{D}}=\lfloor z(\mathrm{LP}_{\mathrm{KP}})\rfloor$
  4. The value of the greedy by efficiency
Explanation. At the root the relaxation is $\mathrm{LP}_{\mathrm{KP}}$ and its round-down is Dantzig's bound. The greedy gives the initial lower bound instead.
oc-f-335 · level facile · notes
Branch-and-bound for the 0/1 knapsack with $c=9$ and items sorted by efficiency $(p_j,w_j)=(6,2),(5,3),(8,6),(9,7),(6,5),(7,9)$. At the root the split item is $3$. What is the LP relaxation of the child with $x_3=1$?
  1. $\frac{113}{7}$
  2. $14$
  3. $\frac{47}{3}$
  4. $\frac{49}{3}$
Explanation. With $x_3=1$ capacity $3$ and profit $8$ remain: item $1$ fits (capacity $1$, profit $14$), then $\frac13$ of item $2$: $14+\frac53=\frac{47}3$. The root is worth $\frac{49}3$, the child with $x_3=0$ $\frac{113}7$.
oc-f-336 · level ipotesi · notes
In branch-and-bound for the 0/1 knapsack one branches on the split item $s$ of the LP relaxation solution of the node. What would happen branching on a variable that already equals $0$ or $1$ in the relaxation?
  1. The algorithm would find the optimum immediately
  2. One of the two children would have the same relaxed solution as the parent, and the bound would not improve
  3. Both children would be infeasible
  4. The tree would have fewer nodes
Explanation. Branching on the only fractional variable removes it in both children; on a variable already integer one child repeats the parent.
oc-f-344 · level facile · notes
Branch-and-bound for the 0/1 knapsack with $c=9$ and items, already sorted by non-increasing efficiency, $(p_j,w_j)=(6,2),(5,3),(8,6),(9,7),(6,5),(7,9)$. At the root the LP relaxation is solved with Dantzig's formulas. What are the split item, the value of the relaxation and the integer upper bound?
  1. Split item $4$, $z=\frac{113}{7}$, $\UB=16$
  2. Split item $3$, $z=\frac{49}{3}$, $\UB=16$
  3. Split item $2$, $z=11$, $\UB=11$
  4. Split item $3$, $z=\frac{49}{3}$, $\UB=17$
Explanation. Items $1$ and $2$ fit (weight $5$); item $3$ does not fit entirely: $11+8\cdot\frac46=\frac{49}{3}\approx16.33$, and with integer profits $\UB=\lfloor\frac{49}3\rfloor=16$.
oc-f-345 · level facile · notes
Branch-and-bound for the 0/1 knapsack with $c=9$ and items, already sorted by non-increasing efficiency, $(p_j,w_j)=(6,2),(5,3),(8,6),(9,7),(6,5),(7,9)$, branching on the split item $3$. What is the LP relaxation of the child with $x_3=0$?
  1. $\frac{113}{7}$
  2. $\frac{47}{3}$
  3. $\frac{49}{3}$
  4. $15$
Explanation. Without item $3$: items $1$ and $2$ (weight $5$, profit $11$), then $\frac47$ of item $4$: $11+\frac{36}{7}=\frac{113}{7}\approx16.14$. $\frac{47}3$ is the child with $x_3=1$.
oc-f-346 · level teorema · notes
In branch-and-bound for the 0/1 knapsack on an instance with optimal value $15$, the incumbent is worth $15$ and a node has LP relaxation $\frac{47}{3}\approx15.67$. What happens to the node, if the profits are integer?
  1. It is branched, because $\frac{47}3>15$
  2. It is pruned by infeasibility
  3. It becomes the new incumbent
  4. It is pruned by bound: $\lfloor\frac{47}3\rfloor=15$ does not exceed the incumbent
Explanation. With integer profits the subtree cannot give more than $\lfloor15.67\rfloor=15$: comparing the unrounded value with the incumbent would explore useless nodes.

17. Vertex coloring: the DSATUR branch-and-bound (24)

oc-f-057 · level facile · notes
In DSATUR branch-and-bound for vertex coloring, the best known coloring (incumbent) uses $\mathrm{UB}=4$ colors. Every node $k$ is a partial coloring using $q(k)$ colors. When is node $k$ pruned?
  1. When $q(k)\ge 3$
  2. When $q(k)\ge 4$ and all vertices are colored
  3. When $q(k)\ge 4$
  4. When $q(k)>4$
Explanation. The number of colors is an integer: a node that already uses $\mathrm{UB}$ colors cannot lead to a coloring with fewer colors. The rule $q(k)>\mathrm{UB}$ is a typical mistake.
oc-f-058 · level facile · notes
In DSATUR branch-and-bound for vertex coloring, every node $k$ is a partial coloring with $q(k)$ colors, and branching is on the uncolored vertex with the largest number of distinct colors among its neighbors (saturation degree). Which children are created?
  1. Only one, with the smallest color compatible with the vertex
  2. One for every already used color compatible with the vertex, plus one with the new color $q(k)+1$
  3. One for every already used color compatible with the vertex, without the new color $q(k)+1$
  4. One for every color $1,\dots,\mathrm{UB}-1$, even if not yet used at the node
Explanation. The colors not used yet are equivalent: the first new color is enough, otherwise the tree would contain symmetric copies of the same coloring. The child with the new color is always created.
oc-f-059 · level teorema · notes
In DSATUR branch-and-bound for vertex coloring, every node gives the chosen vertex an already used color or a single new color. Which statement on the complete tree, without pruning, is correct?
  1. Every partition of the vertices into stable sets is the set of color classes of exactly one leaf
  2. Every partition of the vertices into stable sets appears in $q!$ leaves, one for every permutation of the colors
  3. The leaves are only the optimal colorings, because the others are discarded by the branching
  4. Some partitions of the vertices into stable sets appear in no leaf of the tree
Explanation. This is the no-symmetry property: with a single child for the new color, every VCP solution is enumerated once, up to renaming the colors; this is why the algorithm is exact.
oc-f-060 · level facile · notes
In DSATUR branch-and-bound for vertex coloring (a minimization problem), where do the first upper bound $\mathrm{UB}$ and the lower bound $\mathrm{LB}$ on the chromatic number come from?
  1. $\mathrm{UB}$ from a greedily found clique, $\mathrm{LB}$ from the $DSATUR$ heuristic
  2. $\mathrm{UB}$ from the LP relaxation, $\mathrm{LB}$ from the $DSATUR$ heuristic
  3. $\mathrm{UB}$ from the number of vertices $n$, $\mathrm{LB}$ from the maximum degree $\Delta(G)$
  4. $\mathrm{UB}$ from the $DSATUR$ heuristic, $\mathrm{LB}$ from a greedily found clique
Explanation. The VCP is a minimization problem: a coloring gives the upper bound, a clique the lower bound ($\omega(G)\le\chi(G)$). The vertices of the clique get different colors from the start.
oc-f-202 · level facile · notes
In the DSATUR branch-and-bound for coloring, node $k$ uses $q(k)$ colors; for the uncolored vertex $v$, $\mathit{sat}_k(v)$ is the number of distinct colors among its neighbours and $F_k(v)$ the set of already used colors that $v$ can take. With $q(k)=4$ and $\mathit{sat}_k(v)=3$, how many children does the node have if it branches on $v$?
  1. $5$: one per color from $1$ to $5$
  2. $2$: the only allowed used color and the new color $5$
  3. $1$: only the only allowed used color
  4. $4$: one per used color
Explanation. $|F_k(v)|=q(k)-\mathit{sat}_k(v)=1$, and the child with the new color $q(k)+1$ is added: $2$ children. Colors $q(k)+2,\dots$ would give symmetric copies.
oc-f-203 · level facile · notes
In the DSATUR branch-and-bound for coloring, on which vertex does node $k$ branch, and why?
  1. On the uncolored vertex of maximum saturation degree: it is the most constrained and has the fewest children
  2. On the uncolored vertex of minimum degree, the easiest to color
  3. On the vertex of smallest index, to have a fixed order
  4. On a random vertex, to diversify the search
Explanation. The most saturated vertex has $|F_k(v)|+1$ children, the fewest possible; ties go to the one with more uncolored neighbours, then the smallest index.
oc-f-204 · level facile · notes
In the DSATUR branch-and-bound, a clique $K=\{k_1,\dots,k_r\}$ found greedily is pre-colored at the root, with color $i$ on vertex $k_i$. What is it for?
  1. It gives the initial upper bound, better than that of $DSATUR$
  2. It guarantees that the optimal coloring uses exactly $r$ colors
  3. It only speeds up the computation of the degrees
  4. It gives the lower bound $r$ and removes the symmetry of the first $r$ colors, whose names are arbitrary
Explanation. The vertices of a clique have different colors in every coloring, so at least $r$ colors are needed; fixing their names excludes no solution up to renaming the colors.
oc-f-205 · level facile · notes
In the DSATUR branch-and-bound, the $DSATUR$ heuristic gives the upper bound $\mathrm{UB}$ and a greedy clique $K$ the lower bound $|K|$. What happens if $\mathrm{UB}=|K|$ already at the root?
  1. A larger clique is searched, because the bounds cannot coincide
  2. $\mathrm{UB}$ is decreased by one and the search restarts
  3. The algorithm stops: the $DSATUR$ coloring is optimal
  4. The whole tree is explored anyway for confirmation
Explanation. Lower and upper bounds coincide, hence $\chi(G)=\mathrm{UB}$: no branching is needed.
oc-f-206 · level facile · notes
In the DSATUR branch-and-bound, a node $k$ with all vertices colored and $q(k)<\mathrm{UB}$ colors is a new incumbent solution. What is done next with the list of open nodes?
  1. Remove the nodes with $q<\mathrm{UB}$, now useless
  2. Set $\mathrm{UB}\leftarrow q(k)$ and remove the nodes with $q\ge\mathrm{UB}$
  3. Empty the list: the first complete coloring is optimal
  4. Nothing changes: nodes are checked only when extracted
Explanation. With the new $\mathrm{UB}$ the nodes already using at least $\mathrm{UB}$ colors cannot lead to better solutions. If $\mathrm{UB}=|K|$ the search ends.
oc-f-207 · level facile · notes
In the DSATUR branch-and-bound, how is the tree explored and in which order are the children of a node extracted?
  1. Depth first (stack list); children are evaluated by increasing color and the one with the smallest color is extracted first
  2. Breadth first (queue list); the child with the new color is extracted first
  3. By best bound; the node with most colors is extracted
  4. At random, to diversify
Explanation. Depth-first search reaches complete colorings early and hence new upper bounds; the smallest color first tries not to add colors.
oc-f-208 · level teorema · notes
Why is the DSATUR branch-and-bound for coloring an exact algorithm, although it prunes nodes?
  1. Because $DSATUR$ is optimal and branch-and-bound confirms it
  2. Because it prunes only nodes with no vertex left to color
  3. Because the chromatic number always equals the maximum clique
  4. It prunes only nodes with $q(k)\ge\mathrm{UB}$, and every complete coloring below node $k$ uses at least $q(k)$ colors
Explanation. The colors of a node are never removed in its subtree, so $q(k)$ is a lower bound of the subtree; with integer values, no coloring with fewer than $\mathrm{UB}$ colors is lost.
oc-f-209 · level facile · notes
In the DSATUR branch-and-bound, Sewell's rule (1996) changes the choice of the branching vertex among those of maximum saturation degree. Which criterion does it use?
  1. It chooses the vertex with fewest uncolored neighbours
  2. It chooses a random vertex among the tied ones
  3. It chooses the vertex maximizing the number of feasible colors it shares with its uncolored neighbours
  4. It chooses the vertex of smallest index
Explanation. The rule aims at reducing the neighbours' options most: the chosen color removes options from many uncolored vertices, and the tree shrinks. PASS applies it only to some vertices, to limit its cost.
oc-f-210 · level facile · notes
The remarks on the DSATUR branch-and-bound cite Brélaz (1979), Sewell (1996) and PASS (San Segundo, 2012). What do the Sewell and PASS variants have in common?
  1. They remove the pre-coloring of the clique
  2. They change only the tie-breaking rule in the choice of the branching vertex, leaving bounds and pruning unchanged
  3. They replace pruning by bound with the LP relaxation
  4. They branch on colors instead of vertices
Explanation. The scheme stays Brélaz's: most saturated vertex, used colors plus one new color, pruning with $q(k)\ge\mathrm{UB}$. The variants choose better among tied vertices.
oc-f-337 · level facile · notes
In the DSATUR branch-and-bound for coloring a node is a partial coloring, with $q(k)$ colors used. Which condition must the partial coloring of a node satisfy?
  1. Every color is used only once
  2. The uncolored vertices form a clique
  3. Two adjacent colored vertices have different colors
  4. All vertices are colored
Explanation. The partial coloring is feasible on the colored vertices $V^k$; the uncolored vertices $U^k$ are colored going down the tree.
oc-f-338 · level ipotesi · notes
DSATUR branch-and-bound on the Petersen graph (no triangle, $\chi=3$): the initial lower bound is the size of a greedy clique and the upper bound the number of colors of $DSATUR$, $3$. Why does the algorithm not stop immediately?
  1. It stops immediately
  2. The largest clique has $2$ vertices: $\mathrm{LB}=2<\mathrm{UB}=3$, and the tree is needed to exclude a $2$-coloring
  3. Because $DSATUR$ finds no feasible coloring
  4. Because the lower bound equals $3$
Explanation. Without triangles the clique bound is weak; the exploration shows that no coloring with $2$ colors exists (there are odd cycles), hence $\chi=3$.
oc-f-339 · level teorema · notes
In the DSATUR branch-and-bound, a node with $q$ used colors branches on the most saturated vertex $v$ with one child for every used color allowed for $v$ and one child with the new color $q+1$. Why is a single child with a new color enough?
  1. The colors not yet used are interchangeable: giving $v$ color $q+1$ or $q+2$ produces equivalent colorings
  2. Because color $q+1$ is always optimal
  3. Because $v$ cannot get new colors
  4. To reduce the depth of the tree to $q$
Explanation. Renaming the colors does not change the number of colors: one child for every new color would generate symmetric subtrees.
oc-f-347 · level facile · notes
In the DSATUR branch-and-bound, for an uncolored vertex $v$ of node $k$ one defines the saturation degree $\mathit{sat}_k(v)$ and the set $F_k(v)$ of allowed colors among $1,\dots,q(k)$. Which relation holds between $|F_k(v)|$ and $\mathit{sat}_k(v)$?
  1. $|F_k(v)|=q(k)-\mathit{sat}_k(v)$
  2. $|F_k(v)|=\mathit{sat}_k(v)$
  3. $|F_k(v)|=q(k)+\mathit{sat}_k(v)$
  4. $|F_k(v)|=\deg(v)-\mathit{sat}_k(v)$
Explanation. The saturation counts the distinct colors among the colored neighbours: exactly those forbidden to $v$. The most saturated vertex has the fewest allowed colors, hence the fewest children.
oc-f-348 · level facile · notes
In the DSATUR branch-and-bound the tree is explored depth-first. How are the node list and the order of the children handled?
  1. The list is a queue; the children are evaluated in decreasing order of color
  2. The node with the best lower bound is always extracted
  3. The children are all generated at the end
  4. The list is a stack; the children are evaluated in increasing order of color and the child with the smallest color is extracted first
Explanation. Depth-first search quickly reaches complete colorings, which update $\UB$ and allow more pruning.
oc-f-349 · level teorema · notes
For the DSATUR branch-and-bound one proves that, without pruning, every partition of $V$ into stable sets appears as a leaf exactly once (up to renaming the colors). Why does this make the algorithm exact and symmetry-free?
  1. Because $DSATUR$ is already optimal
  2. Because the initial clique contains all vertices
  3. Every feasible solution is in the tree, and pruning removes only subtrees with at least $\UB$ colors; solutions do not repeat
  4. Because the tree always has a single level
Explanation. Existence: for every partition one follows a path giving every class its color. Uniqueness: two children put $v$ into different classes. The new-color rule avoids copies with permuted color names.
oc-f-350 · level facile · notes
DSATUR branch-and-bound on the Petersen graph: $DSATUR$ gives $\UB=3$ and the greedy clique is $\{1,2\}$. What does node $1$ contain, and why does it enter the list?
  1. $\mathit{col}(1)=1$, $q(1)=1$; it enters because $1<3$
  2. $\mathit{col}(1)=1$, $\mathit{col}(2)=2$, $q(1)=2$; it enters the list because $\LB=2<\UB=3$
  3. The complete coloring of $DSATUR$; it enters because it is optimal
  4. No colored vertex; it always enters
Explanation. The vertices of the initial clique get different, fixed colors: it is the way to remove the symmetry of the first colors. A node with $q\ge\UB$ would be pruned.
oc-f-351 · level facile · notes
In the DSATUR branch-and-bound on the Petersen graph with $\UB=3$, a node with $q=2$ colors branches on a vertex $v$: what happens to the child with the new color $q+1=3$?
  1. It is pruned by bound, since it uses $q=3\ge\UB$ colors
  2. It becomes the new incumbent
  3. It enters the list like the other children
  4. It is pruned by infeasibility
Explanation. A node can improve the incumbent only if it uses fewer than $\UB$ colors; with $3$ colors its subtree cannot give a coloring with $2$ colors.
oc-f-352 · level facile · notes
The DSATUR branch-and-bound goes back to Brélaz (1979); Sewell (1996) proposed a tie-breaking rule among the vertices of maximum saturation. What does it maximize?
  1. The degree of the vertex
  2. The number of colors already used
  3. The index of the vertex
  4. The number of allowed colors shared by the vertex and its uncolored neighbours
Explanation. Sewell's rule chooses the vertex whose coloring reduces its neighbours' choices the most; PASS (San Segundo, 2012) applies it only to some vertices, at a lower cost.
oc-f-353 · level facile · notes
In the DSATUR branch-and-bound the root pre-colors a greedy clique $K=\{k_1,\dots,k_r\}$ with colors $1,\dots,r$. What is it for, besides giving the lower bound $r$?
  1. It reduces the number of colors of the incumbent
  2. It makes pruning by bound unnecessary
  3. It removes the symmetry of the first colors: the $r!$ renamings of the clique colors give the same partition
  4. It guarantees that $DSATUR$ is optimal
Explanation. The vertices of a clique are in different classes in every coloring: fixing their colors loses no solution and cuts the symmetric trees.
oc-f-354 · level facile · notes
DSATUR branch-and-bound on the Petersen graph with $\LB=2$ and $\UB=3$: every node trying to use only colors $1$ and $2$ sooner or later reaches a vertex with no allowed color, and the children with color $3$ are pruned. What does the algorithm conclude when the list is empty?
  1. Nothing: another heuristic is needed
  2. That $\chi(G)=\UB=3$ and the $DSATUR$ coloring is optimal
  3. That $\chi(G)=2$
  4. That the graph cannot be colored
Explanation. Pruning removes only subtrees with at least $\UB$ colors; with the list empty no coloring with fewer than $3$ colors exists (the graph has odd cycles).

Generated questions (32)

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

1. Combinatorial optimization: definitions (2)

Example 1 · oc-g-co-gap · level facile · notes
Instance of a combinatorial optimization problem in minimization; a dual bound is $\mathrm{LB}=27$ and a feasible solution is worth $\mathrm{UB}=37$. The relative gap is $\frac{\mathrm{UB}-\mathrm{LB}}{|\mathrm{LB}|}$. What is it?
  1. $10$
  2. $\frac{10}{37}$
  3. $\frac{10}{27}$
  4. $\frac{37}{27}$
Explanation. $\frac{37-27}{27}=\frac{10}{27}$. $10$ is the absolute gap; dividing by $\mathrm{UB}$ gives $\frac{10}{37}$.
Example 2 · oc-g-co-gap · level facile · notes
Instance of a combinatorial optimization problem in maximization; a feasible solution is worth $\mathrm{LB}=36$ and a dual bound is $\mathrm{UB}=40$. The relative gap is $\frac{\mathrm{UB}-\mathrm{LB}}{|\mathrm{LB}|}$. What is it?
  1. $\frac{10}{9}$
  2. $4$
  3. $\frac{1}{10}$
  4. $\frac{1}{9}$
Explanation. $\frac{40-36}{36}=\frac{1}{9}$. $4$ is the absolute gap; dividing by $\mathrm{UB}$ gives $\frac{1}{10}$.
Example 1 · oc-g-co-count · level facile · notes
In the symmetric TSP with $n=7$ cities a tour visits every city once and returns to the start; two tours are equal if they use the same edges. How many distinct tours are there?
  1. $5040$
  2. $360$
  3. $720$
  4. $2520$
Explanation. The starting city is fixed and a tour is identified with its reverse: $\frac{(n-1)!}{2}=360$.
Example 2 · oc-g-co-count · level facile · notes
In the symmetric TSP with $n=8$ cities a tour visits every city once and returns to the start; two tours are equal if they use the same edges. How many distinct tours are there?
  1. $20160$
  2. $5040$
  3. $2520$
  4. $40320$
Explanation. The starting city is fixed and a tour is identified with its reverse: $\frac{(n-1)!}{2}=2520$.

2. Knapsack problems (2)

Example 1 · oc-g-kp-card · level facile · notes
0-1 knapsack with capacity $c=11$ and items $\begin{array}{c|cccccc}j & 1 & 2 & 3 & 4 & 5 & 6\\ \hline p_j & 8 & 10 & 4 & 9 & 11 & 11\\ w_j & 6 & 8 & 8 & 6 & 2 & 3\end{array}$. Let $\bar k$ be the largest integer such that the $\bar k$ lightest items weigh in total at most $c$; the cardinality bound is the sum of the $\bar k$ largest profits. What is it?
  1. $30$
  2. $41$
  3. $3$
  4. $32$
Explanation. The sorted weights give $\bar k=3$; the $3$ largest profits add up to $32$. Adding the profits of the lightest items ($30$) does not give an upper bound.
Example 2 · oc-g-kp-card · level facile · notes
0-1 knapsack with capacity $c=15$ and items $\begin{array}{c|cccccc}j & 1 & 2 & 3 & 4 & 5 & 6\\ \hline p_j & 6 & 6 & 6 & 10 & 12 & 9\\ w_j & 8 & 2 & 8 & 7 & 8 & 8\end{array}$. Let $\bar k$ be the largest integer such that the $\bar k$ lightest items weigh in total at most $c$; the cardinality bound is the sum of the $\bar k$ largest profits. What is it?
  1. $2$
  2. $16$
  3. $31$
  4. $22$
Explanation. The sorted weights give $\bar k=2$; the $2$ largest profits add up to $22$. Adding the profits of the lightest items ($16$) does not give an upper bound.
Example 1 · oc-g-kp-brute · level media · notes
0-1 knapsack (choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=17$ and items $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 10 & 13 & 4 & 11 & 14\\ w_j & 6 & 8 & 8 & 6 & 2\end{array}$. Which subset is the (unique) optimal solution?
  1. $\{1,4,5\}$
  2. $\{1,2,5\}$
  3. $\{5\}$
  4. $\{2,4,5\}$
Explanation. Listing the $2^5=32$ subsets, the optimum is $\{2,4,5\}$ with value $38$. The greedy by efficiency gives $\{1,4,5\}$ (value $35$).
Example 2 · oc-g-kp-brute · level media · notes
0-1 knapsack (choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=11$ and items $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 13 & 3 & 15 & 13 & 13\\ w_j & 4 & 3 & 9 & 2 & 4\end{array}$. Which subset is the (unique) optimal solution?
  1. $\{1,4,5\}$
  2. $\{3,4\}$
  3. $\{1,2,4\}$
  4. $\{2,4\}$
Explanation. Listing the $2^5=32$ subsets, the optimum is $\{1,4,5\}$ with value $39$. The greedy by efficiency gives $\{1,4,5\}$ (value $39$).

3. Packing problems (2)

Example 1 · oc-g-bpp-lb · level facile · notes
Bin packing (BPP): the items of weights $w=(9,3,4,2,2,4,6,3)$ must be packed into the minimum number of bins of capacity $c=10$. What is the weight bound $\left\lceil \sum_j w_j / c \right\rceil$?
  1. $4$
  2. $2$
  3. $5$
  4. $3$
Explanation. $\sum_j w_j=33$, hence $\lceil 33/10\rceil=4$. The value is rounded up because the number of bins is an integer.
Example 2 · oc-g-bpp-lb · level facile · notes
Bin packing (BPP): the items of weights $w=(5,6,9,8,3,3,4,11)$ must be packed into the minimum number of bins of capacity $c=12$. What is the weight bound $\left\lceil \sum_j w_j / c \right\rceil$?
  1. $3$
  2. $5$
  3. $4$
  4. $6$
Explanation. $\sum_j w_j=49$, hence $\lceil 49/12\rceil=5$. The value is rounded up because the number of bins is an integer.
Example 1 · oc-g-bpp-opt · level media · notes
Bin packing: items of weight $w=(7,5,7,6,7,7)$ to be packed into the minimum number of bins of capacity $c=10$. What is the optimal value $z(I)$?
  1. $5$
  2. $7$
  3. $4$
  4. $6$
Explanation. $z(I)=6$. The weight bound is $\lceil 39/10\rceil=4$ and First Fit in the given order uses $6$ bins: the first is a lower bound, the second an upper bound.
Example 2 · oc-g-bpp-opt · level media · notes
Bin packing: items of weight $w=(4,3,6,5,6,5)$ to be packed into the minimum number of bins of capacity $c=10$. What is the optimal value $z(I)$?
  1. $4$
  2. $5$
  3. $3$
  4. $2$
Explanation. $z(I)=3$. The weight bound is $\lceil 29/10\rceil=3$ and First Fit in the given order uses $4$ bins: the first is a lower bound, the second an upper bound.

4. Coloring problems (3)

Example 1 · oc-g-vcp-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,6\}$ and $E=\{\{1,6\},\{3,4\},\{3,6\},\{4,5\},\{4,6\},\{5,6\}\}$. For the chromatic number $\chi(G)$ the clique bound $\omega(G)$ (maximum clique) and the stable set bound $\lceil n/\alpha(G)\rceil$ ($\alpha(G)$ maximum stable set) hold. What are they, in this order?
  1. $4$, $2$
  2. $3$, $2$
  3. $3$, $1$
  4. $5$, $2$
Explanation. $\omega(G)=3$ and $\alpha(G)=4$, hence $\lceil 6/4\rceil=2$: $\chi(G)\ge3$. The largest degree gives instead the upper bound $\Delta+1=5$.
Example 2 · oc-g-vcp-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,6\}$ and $E=\{\{1,4\},\{1,5\},\{1,6\},\{2,3\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{4,5\}\}$. For the chromatic number $\chi(G)$ the clique bound $\omega(G)$ (maximum clique) and the stable set bound $\lceil n/\alpha(G)\rceil$ ($\alpha(G)$ maximum stable set) hold. What are they, in this order?
  1. $3$, $2$
  2. $2$, $2$
  3. $5$, $3$
  4. $3$, $3$
Explanation. $\omega(G)=3$ and $\alpha(G)=2$, hence $\lceil 6/2\rceil=3$: $\chi(G)\ge3$. The largest degree gives instead the upper bound $\Delta+1=5$.
Example 1 · oc-g-vcp-chi · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,6\}$ and $E=\{\{1,6\},\{3,4\},\{3,6\},\{4,5\},\{4,6\},\{5,6\}\}$. In vertex coloring adjacent vertices get different colors and the number of colors is minimized. What is the chromatic number $\chi(G)$?
  1. $4$
  2. $3$
  3. $2$
  4. $5$
Explanation. $\chi(G)=3$: a coloring with $3$ colors exists and none with fewer. The maximum clique has $3$ vertices; the greedy coloring with order $1,\dots,6$ uses $3$ colors.
Example 2 · oc-g-vcp-chi · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,6\}$ and $E=\{\{1,5\},\{2,3\},\{2,4\},\{2,5\},\{2,6\},\{3,4\},\{3,5\},\{4,6\},\{5,6\}\}$. In vertex coloring adjacent vertices get different colors and the number of colors is minimized. What is the chromatic number $\chi(G)$?
  1. $5$
  2. $3$
  3. $4$
  4. $2$
Explanation. $\chi(G)=3$: a coloring with $3$ colors exists and none with fewer. The maximum clique has $3$ vertices; the greedy coloring with order $1,\dots,6$ uses $3$ colors.
Example 1 · oc-g-vcp-full · level complessa · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,6\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{3,7\},\{4,5\},\{4,7\},\{5,6\}\}$. In vertex coloring (VCP), $\omega(G)$ is the clique number, $\alpha(G)$ the stability number and $\chi(G)$ the chromatic number; $\omega(G)$ and $\lceil n/\alpha(G)\rceil$ are lower bounds on $\chi(G)$. What are the three quantities?
  1. $\omega(G)=4$, $\lceil n/\alpha(G)\rceil=3$, $\chi(G)=3$
  2. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=1$, $\chi(G)=3$
  3. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=2$, $\chi(G)=4$
  4. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=2$, $\chi(G)=3$
Explanation. A maximum clique has $3$ vertices and a maximum stable set $4$, hence $\lceil 7/4\rceil=2$. A coloring with $3$ colors exists and none with fewer: $\chi(G)=3$.
Example 2 · oc-g-vcp-full · level complessa · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,2\},\{1,6\},\{1,7\},\{2,4\},\{3,6\},\{5,6\},\{5,7\},\{6,7\}\}$. In vertex coloring (VCP), $\omega(G)$ is the clique number, $\alpha(G)$ the stability number and $\chi(G)$ the chromatic number; $\omega(G)$ and $\lceil n/\alpha(G)\rceil$ are lower bounds on $\chi(G)$. What are the three quantities?
  1. $\omega(G)=4$, $\lceil n/\alpha(G)\rceil=3$, $\chi(G)=3$
  2. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=2$, $\chi(G)=4$
  3. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=2$, $\chi(G)=3$
  4. $\omega(G)=3$, $\lceil n/\alpha(G)\rceil=1$, $\chi(G)=3$
Explanation. A maximum clique has $3$ vertices and a maximum stable set $4$, hence $\lceil 7/4\rceil=2$. A coloring with $3$ colors exists and none with fewer: $\chi(G)=3$.

5. Clique problems (2)

Example 1 · oc-g-mcp-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,6\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{3,7\},\{4,5\},\{4,7\},\{5,6\}\}$. For the maximum clique $\omega(G)$ the degree bound $\Delta+1$ ($\Delta$ largest degree) and the bound $k^{\max}$, the largest $k$ such that at least $k$ vertices have degree at least $k-1$, hold. What are they, in this order?
  1. $5$, $5$
  2. $4$, $5$
  3. $4$, $4$
  4. $5$, $4$
Explanation. The degrees are $(1,1,4,3,3,4,2)$: $\Delta+1=5$ and $k^{\max}=4$, which is never weaker.
Example 2 · oc-g-mcp-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,2\},\{1,3\},\{1,4\},\{1,5\},\{1,6\},\{2,4\},\{3,4\},\{3,6\},\{3,7\},\{4,5\},\{5,7\}\}$. For the maximum clique $\omega(G)$ the degree bound $\Delta+1$ ($\Delta$ largest degree) and the bound $k^{\max}$, the largest $k$ such that at least $k$ vertices have degree at least $k-1$, hold. What are they, in this order?
  1. $6$, $5$
  2. $4$, $6$
  3. $6$, $4$
  4. $5$, $4$
Explanation. The degrees are $(5,2,4,4,3,2,2)$: $\Delta+1=6$ and $k^{\max}=4$, which is never weaker.
Example 1 · oc-g-mcp-omega · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,6\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{3,7\},\{4,5\},\{4,6\},\{4,7\},\{5,6\},\{5,7\}\}$. A clique is a set of pairwise adjacent vertices. How many vertices does a maximum clique have, i.e., what is $\omega(G)$?
  1. $3$
  2. $5$
  3. $6$
  4. $4$
Explanation. $\omega(G)=4$. The bounds $k^{\max}=4$ and $\Delta+1=6$ are only upper bounds; $3$ is the maximum stable set.
Example 2 · oc-g-mcp-omega · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,2\},\{1,4\},\{1,5\},\{1,6\},\{3,6\},\{5,6\},\{6,7\}\}$. A clique is a set of pairwise adjacent vertices. How many vertices does a maximum clique have, i.e., what is $\omega(G)$?
  1. $5$
  2. $4$
  3. $2$
  4. $3$
Explanation. $\omega(G)=3$. The bounds $k^{\max}=3$ and $\Delta+1=5$ are only upper bounds; $5$ is the maximum stable set.

6. Routing problems (2)

Example 1 · oc-g-tsp-lb · level facile · notes
Symmetric TSP with $5$ cities and distances $\begin{array}{c|ccccc} d_{ij} & 1 & 2 & 3 & 4 & 5\\ \hline 1 & - & 9 & 10 & 13 & 14\\ 2 & 9 & - & 3 & 13 & 10\\ 3 & 10 & 3 & - & 10 & 14\\ 4 & 13 & 13 & 10 & - & 2\\ 5 & 14 & 10 & 14 & 2 & -\end{array}$. With $a_i$ and $b_i$ the two smallest distances from city $i$ to the others, the lower bound is $\left\lceil\frac12\sum_i(a_i+b_i)\right\rceil$. What is it?
  1. $68$
  2. $19$
  3. $34$
  4. $35$
Explanation. $\sum_i(a_i+b_i)=68$, and half of it rounded up is $34$: every tour edge is counted by both endpoints.
Example 2 · oc-g-tsp-lb · level facile · notes
Symmetric TSP with $5$ cities and distances $\begin{array}{c|ccccc} d_{ij} & 1 & 2 & 3 & 4 & 5\\ \hline 1 & - & 7 & 13 & 6 & 3\\ 2 & 7 & - & 7 & 14 & 13\\ 3 & 13 & 7 & - & 11 & 14\\ 4 & 6 & 14 & 11 & - & 12\\ 5 & 3 & 13 & 14 & 12 & -\end{array}$. With $a_i$ and $b_i$ the two smallest distances from city $i$ to the others, the lower bound is $\left\lceil\frac12\sum_i(a_i+b_i)\right\rceil$. What is it?
  1. $37$
  2. $73$
  3. $38$
  4. $26$
Explanation. $\sum_i(a_i+b_i)=73$, and half of it rounded up is $37$: every tour edge is counted by both endpoints.
Example 1 · oc-g-tsp-opt · level media · notes
Symmetric TSP with $5$ cities and distances $\begin{array}{c|ccccc} d_{ij} & 1 & 2 & 3 & 4 & 5\\ \hline 1 & - & 5 & 15 & 6 & 6\\ 2 & 5 & - & 3 & 5 & 9\\ 3 & 15 & 3 & - & 12 & 10\\ 4 & 6 & 5 & 12 & - & 8\\ 5 & 6 & 9 & 10 & 8 & -\end{array}$. How long is the shortest tour $z(I)$ (closed route visiting every city once)?
  1. $29$
  2. $32$
  3. $31$
  4. $30$
Explanation. Listing the $12$ distinct tours, the shortest has length $30$. Nearest neighbour from city $1$ gives $32$, and the two-smallest-distances bound $29$.
Example 2 · oc-g-tsp-opt · level media · notes
Symmetric TSP with $5$ cities and distances $\begin{array}{c|ccccc} d_{ij} & 1 & 2 & 3 & 4 & 5\\ \hline 1 & - & 10 & 3 & 14 & 14\\ 2 & 10 & - & 10 & 9 & 14\\ 3 & 3 & 10 & - & 4 & 12\\ 4 & 14 & 9 & 4 & - & 11\\ 5 & 14 & 14 & 12 & 11 & -\end{array}$. How long is the shortest tour $z(I)$ (closed route visiting every city once)?
  1. $44$
  2. $42$
  3. $43$
  4. $38$
Explanation. Listing the $12$ distinct tours, the shortest has length $42$. Nearest neighbour from city $1$ gives $44$, and the two-smallest-distances bound $38$.

7. Scheduling problems (2)

Example 1 · oc-g-pcmax-bounds · level facile · notes
Scheduling $P\,||\,C_{\max}$: $m=3$ identical machines, times $t=(6,8,8,1,8,6)$, the makespan (maximum load) is minimized. The jobs are assigned in the order $1,\dots,6$, each to the machine with the smallest load (ties: smallest index), and the combinatorial lower bound $\max\{\max_j t_j,\lceil\sum_j t_j/m\rceil\}$ is used. Which interval is obtained for the optimal makespan $z(I)$?
  1. $12\le z(I)\le 15$
  2. $13\le z(I)\le 15$
  3. $13\le z(I)\le 37$
  4. $8\le z(I)\le 15$
Explanation. Lower bound: $\max\{8,\lceil 37/3\rceil\}=13$; the schedule built has makespan $15$, an upper bound. Hence $13\le z(I)\le 15$.
Example 2 · oc-g-pcmax-bounds · level facile · notes
Scheduling $P\,||\,C_{\max}$: $m=3$ identical machines, times $t=(9,7,6,8,8,2)$, the makespan (maximum load) is minimized. The jobs are assigned in the order $1,\dots,6$, each to the machine with the smallest load (ties: smallest index), and the combinatorial lower bound $\max\{\max_j t_j,\lceil\sum_j t_j/m\rceil\}$ is used. Which interval is obtained for the optimal makespan $z(I)$?
  1. $14\le z(I)\le 15$
  2. $13\le z(I)\le 15$
  3. $9\le z(I)\le 15$
  4. $14\le z(I)\le 40$
Explanation. Lower bound: $\max\{9,\lceil 40/3\rceil\}=14$; the schedule built has makespan $15$, an upper bound. Hence $14\le z(I)\le 15$.
Example 1 · oc-g-pcmax-opt · level media · notes
Scheduling $P\,||\,C_{\max}$: jobs of processing time $t=(6,7,9,3,3,5)$ on $m=3$ identical machines; the makespan is the largest load of a machine. What is the optimal makespan $z(I)$?
  1. $12$
  2. $13$
  3. $11$
  4. $14$
Explanation. $z(I)=12$. The lower bound $\max\{\max_jt_j,\lceil\sum_jt_j/m\rceil\}$ is $11$; $LPT$ gives $12$.
Example 2 · oc-g-pcmax-opt · level media · notes
Scheduling $P\,||\,C_{\max}$: jobs of processing time $t=(1,9,8,6,5,8)$ on $m=3$ identical machines; the makespan is the largest load of a machine. What is the optimal makespan $z(I)$?
  1. $15$
  2. $13$
  3. $16$
  4. $14$
Explanation. $z(I)=14$. The lower bound $\max\{\max_jt_j,\lceil\sum_jt_j/m\rceil\}$ is $13$; $LPT$ gives $14$.

8. Lot sizing problems (2)

Example 1 · oc-g-ls-cost · level facile · notes
Lot sizing over $4$ periods, zero initial stock: demand $d_t$, production $x_t$ of the plan, setup cost $sc_t$ (paid only if $x_t>0$), variable cost $vc_t$ per unit produced and cost $hc_t$ per unit of stock at the end of a period: $\begin{array}{c|cccc}t & 1 & 2 & 3 & 4\\ \hline d_t & 4 & 1 & 6 & 2\\ x_t & 5 & 0 & 6 & 2\\ sc_t & 14 & 17 & 5 & 5\\ vc_t & 2 & 1 & 2 & 0\\ hc_t & 3 & 2 & 1 & 1\end{array}$. What does the plan cost?
  1. $27$
  2. $49$
  3. $66$
  4. $46$
Explanation. Setups, production and stocks add up to $49$. Without holding costs one would get $46$; paying the setup in every period gives $66$.
Example 2 · oc-g-ls-cost · level facile · notes
Lot sizing over $4$ periods, zero initial stock: demand $d_t$, production $x_t$ of the plan, setup cost $sc_t$ (paid only if $x_t>0$), variable cost $vc_t$ per unit produced and cost $hc_t$ per unit of stock at the end of a period: $\begin{array}{c|cccc}t & 1 & 2 & 3 & 4\\ \hline d_t & 3 & 3 & 6 & 5\\ x_t & 12 & 0 & 0 & 5\\ sc_t & 18 & 18 & 17 & 7\\ vc_t & 0 & 2 & 1 & 2\\ hc_t & 1 & 2 & 3 & 3\end{array}$. What does the plan cost?
  1. $46$
  2. $56$
  3. $35$
  4. $91$
Explanation. Setups, production and stocks add up to $56$. Without holding costs one would get $35$; paying the setup in every period gives $91$.
Example 1 · oc-g-ls-lb · level facile · notes
Capacitated lot sizing (CLS) over $5$ periods with total demand $D=128$, production capacities $cap_t$ and setup costs $sc_t$ (paid in the periods with production), zero initial stock: $\begin{array}{c|ccccc}t & 1 & 2 & 3 & 4 & 5\\ \hline cap_t & 29 & 35 & 17 & 31 & 37\\ sc_t & 59 & 73 & 71 & 61 & 31\end{array}$. The combinatorial lower bound adds the $k$ smallest setup costs, with $k$ the minimum number of periods whose capacities cover $D$. What is it?
  1. $295$
  2. $264$
  3. $151$
  4. $222$
Explanation. With the largest capacities $k=4$ periods are needed; the $4$ cheapest setups add up to $222$. Using the smallest capacities overestimates $k$.
Example 2 · oc-g-ls-lb · level facile · notes
Capacitated lot sizing (CLS) over $5$ periods with total demand $D=104$, production capacities $cap_t$ and setup costs $sc_t$ (paid in the periods with production), zero initial stock: $\begin{array}{c|ccccc}t & 1 & 2 & 3 & 4 & 5\\ \hline cap_t & 24 & 23 & 25 & 35 & 39\\ sc_t & 72 & 34 & 73 & 63 & 68\end{array}$. The combinatorial lower bound adds the $k$ smallest setup costs, with $k$ the minimum number of periods whose capacities cover $D$. What is it?
  1. $276$
  2. $237$
  3. $165$
  4. $310$
Explanation. With the largest capacities $k=4$ periods are needed; the $4$ cheapest setups add up to $237$. Using the smallest capacities overestimates $k$.

9. Formulations of knapsack problems (5)

Example 1 · oc-g-kp-split · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=13$ and the following items: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 22 & 12 & 23 & 9 & 4\\ w_j & 6 & 8 & 6 & 2 & 4\end{array}$. With the items sorted by non-increasing efficiency $p_j/w_j$ (ties: smaller index) and inserted in this order, the split item $s$ is the first one that does not fit entirely and $\mathit{rc}$ is the capacity left free by the previous items. What are $s$ and $\mathit{rc}$?
  1. $s=2$, $\mathit{rc}=7$
  2. $s=3$, $\mathit{rc}=1$
  3. $s=1$, $\mathit{rc}=5$
  4. $s=2$, $\mathit{rc}=1$
Explanation. Order by efficiency $p_j/w_j$: $4,3,1,2,5$. The first item that does not fit entirely is $s=1$ and $\mathit{rc}=c-\sum_{j<s} w_j=5$. Typical mistakes: using the order of the indices, of the profits or of the weights.
Example 2 · oc-g-kp-split · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=20$ and the following items: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 21 & 9 & 29 & 29 & 13\\ w_j & 5 & 2 & 8 & 8 & 8\end{array}$. With the items sorted by non-increasing efficiency $p_j/w_j$ (ties: smaller index) and inserted in this order, the split item $s$ is the first one that does not fit entirely and $\mathit{rc}$ is the capacity left free by the previous items. What are $s$ and $\mathit{rc}$?
  1. $s=1$, $\mathit{rc}=4$
  2. $s=4$, $\mathit{rc}=5$
  3. $s=3$, $\mathit{rc}=13$
  4. $s=4$, $\mathit{rc}=3$
Explanation. Order by efficiency $p_j/w_j$: $2,1,3,4,5$. The first item that does not fit entirely is $s=4$ and $\mathit{rc}=c-\sum_{j<s} w_j=5$. Typical mistakes: using the order of the indices, of the profits or of the weights.
Example 1 · oc-g-kp-lp · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=12$ and items already sorted by non-increasing efficiency: $\begin{array}{c|cccc}j & 1 & 2 & 3 & 4\\ \hline p_j & 27 & 16 & 7 & 5\\ w_j & 7 & 6 & 4 & 4\end{array}$. What is $z(\mathrm{LP}_{\mathrm{KP}})$, the optimal value of the LP relaxation with $0\le x_j\le 1$?
  1. $\frac{121}{3}$
  2. $\frac{324}{7}$
  3. $43$
  4. $32$
Explanation. $s=2$, $\mathit{rc}=5$, hence $z(\mathrm{LP}_{\mathrm{KP}})=\sum_{j<s}p_j+p_s\,\mathit{rc}/w_s=27+16\cdot\frac{5}{6}=\frac{121}{3}$. The value $p_1 c/w_1$ is that of $\mathrm{LP}\text{-}0_{\mathrm{KP}}$, without the constraints $x_j\le 1$.
Example 2 · oc-g-kp-lp · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=15$ and items already sorted by non-increasing efficiency: $\begin{array}{c|cccc}j & 1 & 2 & 3 & 4\\ \hline p_j & 10 & 14 & 20 & 20\\ w_j & 2 & 4 & 7 & 7\end{array}$. What is $z(\mathrm{LP}_{\mathrm{KP}})$, the optimal value of the LP relaxation with $0\le x_j\le 1$?
  1. $46$
  2. $75$
  3. $64$
  4. $\frac{348}{7}$
Explanation. $s=4$, $\mathit{rc}=2$, hence $z(\mathrm{LP}_{\mathrm{KP}})=\sum_{j<s}p_j+p_s\,\mathit{rc}/w_s=44+20\cdot\frac{2}{7}=\frac{348}{7}$. The value $p_1 c/w_1$ is that of $\mathrm{LP}\text{-}0_{\mathrm{KP}}$, without the constraints $x_j\le 1$.
Example 1 · oc-g-kp-dantzig · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=15$ and the following items: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 30 & 20 & 10 & 21 & 32\\ w_j & 8 & 5 & 8 & 7 & 9\end{array}$. What is the Dantzig upper bound $\mathrm{UB}_{\mathrm{D}}$, the integer part of the LP relaxation value (with $0\le x_j\le 1$)?
  1. $57$
  2. $58$
  3. $52$
  4. $82$
Explanation. Order by efficiency: $2,1,5,4,3$; split item $s=5$, $\mathit{rc}=2$. $\mathrm{UB}_{\mathrm{D}}=50+\lfloor 32\cdot 2/9\rfloor=57$. The items must be sorted by efficiency, and the value is rounded down.
Example 2 · oc-g-kp-dantzig · level facile · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=20$ and the following items: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 17 & 10 & 23 & 22 & 15\\ w_j & 5 & 2 & 8 & 8 & 8\end{array}$. What is the Dantzig upper bound $\mathrm{UB}_{\mathrm{D}}$, the integer part of the LP relaxation value (with $0\le x_j\le 1$)?
  1. $64$
  2. $63$
  3. $58$
  4. $72$
Explanation. Order by efficiency: $2,1,3,4,5$; split item $s=4$, $\mathit{rc}=5$. $\mathrm{UB}_{\mathrm{D}}=50+\lfloor 22\cdot 5/8\rfloor=63$. The items must be sorted by efficiency, and the value is rounded down.
Example 1 · oc-g-kp-mt · level media · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=13$ and items already sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 7 & 19 & 18 & 14 & 4\\ w_j & 2 & 6 & 6 & 8 & 4\end{array}$. Let $s$ be the split item (the first one that does not fit entirely). What is the Martello-Toth upper bound $\mathrm{UB}_{\mathrm{MT}}=\max\{\mathrm{UB}_0,\mathrm{UB}_1\}$, where $\mathrm{UB}_0$ imposes $x_s=0$ and $\mathrm{UB}_1$ imposes $x_s=1$?
  1. $34$
  2. $42$
  3. $40$
  4. $41$
Explanation. $s=3$, $\mathit{rc}=5$; $\mathrm{UB}_0=26+\lfloor 5\cdot 14/8\rfloor=34$, $\mathrm{UB}_1=26+\lfloor 18-(6-5)\cdot 19/6\rfloor=40$, $\mathrm{UB}_{\mathrm{MT}}=\max\{\mathrm{UB}_0,\mathrm{UB}_1\}=40$ (Dantzig: $41$). The maximum is taken, not the minimum.
Example 2 · oc-g-kp-mt · level media · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=17$ and items already sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 10 & 14 & 22 & 14 & 4\\ w_j & 2 & 4 & 7 & 7 & 3\end{array}$. Let $s$ be the split item (the first one that does not fit entirely). What is the Martello-Toth upper bound $\mathrm{UB}_{\mathrm{MT}}=\max\{\mathrm{UB}_0,\mathrm{UB}_1\}$, where $\mathrm{UB}_0$ imposes $x_s=0$ and $\mathrm{UB}_1$ imposes $x_s=1$?
  1. $50$
  2. $58$
  3. $54$
  4. $51$
Explanation. $s=4$, $\mathit{rc}=4$; $\mathrm{UB}_0=46+\lfloor 4\cdot 4/3\rfloor=51$, $\mathrm{UB}_1=46+\lfloor 14-(7-4)\cdot 22/7\rfloor=50$, $\mathrm{UB}_{\mathrm{MT}}=\max\{\mathrm{UB}_0,\mathrm{UB}_1\}=51$ (Dantzig: $54$). The maximum is taken, not the minimum.
Example 1 · oc-g-kp-bounds-full · level complessa · notes
0/1 knapsack with capacity $c=15$ and items sorted by non-increasing efficiency $p_j/w_j$: $\begin{array}{c|cccccc}j & 1 & 2 & 3 & 4 & 5 & 6\\ \hline p_j & 17 & 14 & 18 & 13 & 6 & 3\\ w_j & 2 & 6 & 8 & 6 & 9 & 9\end{array}$. Let $s$ be the split item (the first one not fitting when adding the items in order) and $\mathit{rc}$ the residual capacity. The Dantzig bound is $\UB_{\mathrm{D}}=\sum_{j<s}p_j+\lfloor p_s\,\mathit{rc}/w_s\rfloor$; the Martello-Toth bound is $\max\{\UB_0,\UB_1\}$ with $\UB_0=\sum_{j<s}p_j+\lfloor\mathit{rc}\,p_{s+1}/w_{s+1}\rfloor$ and $\UB_1=\sum_{j<s}p_j+\lfloor p_s-(w_s-\mathit{rc})\,p_{s-1}/w_{s-1}\rfloor$. What are the two bounds and the optimal value $z$?
  1. $\UB_{\mathrm{D}}=47$, $\UB_{\mathrm{MT}}=46$, $z=44$
  2. $\UB_{\mathrm{D}}=46$, $\UB_{\mathrm{MT}}=61$, $z=44$
  3. $\UB_{\mathrm{D}}=46$, $\UB_{\mathrm{MT}}=46$, $z=45$
  4. $\UB_{\mathrm{D}}=46$, $\UB_{\mathrm{MT}}=46$, $z=44$
Explanation. $s=3$, $\mathit{rc}=7$, $\sum_{j<s}p_j=31$: $\UB_{\mathrm{D}}=46$, $\UB_0=46$, $\UB_1=46$, hence $\UB_{\mathrm{MT}}=46\le\UB_{\mathrm{D}}$. Enumeration gives $z=44$ (the greedy gives $44$).
Example 2 · oc-g-kp-bounds-full · level complessa · notes
0/1 knapsack with capacity $c=15$ and items sorted by non-increasing efficiency $p_j/w_j$: $\begin{array}{c|cccccc}j & 1 & 2 & 3 & 4 & 5 & 6\\ \hline p_j & 19 & 16 & 18 & 12 & 13 & 8\\ w_j & 2 & 3 & 6 & 7 & 8 & 7\end{array}$. Let $s$ be the split item (the first one not fitting when adding the items in order) and $\mathit{rc}$ the residual capacity. The Dantzig bound is $\UB_{\mathrm{D}}=\sum_{j<s}p_j+\lfloor p_s\,\mathit{rc}/w_s\rfloor$; the Martello-Toth bound is $\max\{\UB_0,\UB_1\}$ with $\UB_0=\sum_{j<s}p_j+\lfloor\mathit{rc}\,p_{s+1}/w_{s+1}\rfloor$ and $\UB_1=\sum_{j<s}p_j+\lfloor p_s-(w_s-\mathit{rc})\,p_{s-1}/w_{s-1}\rfloor$. What are the two bounds and the optimal value $z$?
  1. $\UB_{\mathrm{D}}=59$, $\UB_{\mathrm{MT}}=56$, $z=53$
  2. $\UB_{\mathrm{D}}=59$, $\UB_{\mathrm{MT}}=62$, $z=53$
  3. $\UB_{\mathrm{D}}=60$, $\UB_{\mathrm{MT}}=59$, $z=53$
  4. $\UB_{\mathrm{D}}=59$, $\UB_{\mathrm{MT}}=59$, $z=53$
Explanation. $s=4$, $\mathit{rc}=4$, $\sum_{j<s}p_j=53$: $\UB_{\mathrm{D}}=59$, $\UB_0=59$, $\UB_1=56$, hence $\UB_{\mathrm{MT}}=59\le\UB_{\mathrm{D}}$. Enumeration gives $z=53$ (the greedy gives $53$).

10. Formulations of packing problems (2)

Example 1 · oc-g-bpp-lp · level facile · notes
Bin packing with capacity $c=10$ and items of weight $w=(6,8,8,2,8)$. The LP relaxation $\mathrm{LP}_{\mathrm{BPP}}$ of the model with variables $y_b$ (bin used) and $x_{jb}$ (item $j$ in bin $b$) equals $\sum_j w_j/c$. What are $z(\mathrm{LP}_{\mathrm{BPP}})$ and the optimal integer value, in this order?
  1. $\frac{16}{5}$ and $4$
  2. $\frac{16}{5}$ and $5$
  3. $\frac{5}{2}$ and $4$
  4. $\frac{16}{25}$ and $4$
Explanation. $z(\mathrm{LP}_{\mathrm{BPP}})=32/10=\frac{16}{5}$ and the optimal value is $4$; the rounded relaxation, $4$, is only a lower bound.
Example 2 · oc-g-bpp-lp · level facile · notes
Bin packing with capacity $c=9$ and items of weight $w=(7,4,2,4,8)$. The LP relaxation $\mathrm{LP}_{\mathrm{BPP}}$ of the model with variables $y_b$ (bin used) and $x_{jb}$ (item $j$ in bin $b$) equals $\sum_j w_j/c$. What are $z(\mathrm{LP}_{\mathrm{BPP}})$ and the optimal integer value, in this order?
  1. $\frac{25}{9}$ and $3$
  2. $\frac{5}{9}$ and $3$
  3. $\frac{5}{2}$ and $3$
  4. $\frac{25}{9}$ and $4$
Explanation. $z(\mathrm{LP}_{\mathrm{BPP}})=25/9=\frac{25}{9}$ and the optimal value is $3$; the rounded relaxation, $3$, is only a lower bound.
Example 1 · oc-g-bpp-lpgap · level media · notes
Bin packing with capacity $c=16$ and $5$ items of weight $w=(12,12,9,12,11)$, all larger than $c/2$. The LP relaxation of the model equals $\sum_j w_j/c$. What is the ratio $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil/z(\mathrm{ILP}_{\mathrm{BPP}})$?
  1. $\frac{7}{10}$
  2. $\frac{4}{5}$
  3. $\frac{5}{4}$
  4. $\frac{1}{2}$
Explanation. Two items heavier than $c/2$ do not fit together, so the optimum is $5$; $\lceil 56/16\rceil=4$. The ratio $\frac{4}{5}$ is at least $\frac12$, as guaranteed.
Example 2 · oc-g-bpp-lpgap · level media · notes
Bin packing with capacity $c=14$ and $6$ items of weight $w=(8,8,9,10,10,9)$, all larger than $c/2$. The LP relaxation of the model equals $\sum_j w_j/c$. What is the ratio $\lceil z(\mathrm{LP}_{\mathrm{BPP}})\rceil/z(\mathrm{ILP}_{\mathrm{BPP}})$?
  1. $\frac{2}{3}$
  2. $\frac{9}{14}$
  3. $\frac{1}{2}$
  4. $\frac{3}{2}$
Explanation. Two items heavier than $c/2$ do not fit together, so the optimum is $6$; $\lceil 54/14\rceil=4$. The ratio $\frac{2}{3}$ is at least $\frac12$, as guaranteed.

14. Formulations of scheduling problems (2)

Example 1 · oc-g-pcmax-lp · level media · notes
Scheduling $P\,||\,C_{\max}$ with $m=3$ identical machines and times $t=(7,10,11,2,10)$. The model has binary variables $x_{jh}$ (job $j$ on machine $h$) and the variable $C_{\max}\ge\sum_jt_jx_{jh}$. What are the LP relaxation and the optimal makespan, in this order?
  1. $\frac{40}{3}$ and $17$
  2. $40$ and $17$
  3. $11$ and $17$
  4. $\frac{40}{3}$ and $14$
Explanation. The relaxation splits the jobs equally: $\sum_jt_j/m=\frac{40}{3}$. The optimal makespan, with indivisible jobs, is $17$.
Example 2 · oc-g-pcmax-lp · level media · notes
Scheduling $P\,||\,C_{\max}$ with $m=2$ identical machines and times $t=(11,4,2,5,11)$. The model has binary variables $x_{jh}$ (job $j$ on machine $h$) and the variable $C_{\max}\ge\sum_jt_jx_{jh}$. What are the LP relaxation and the optimal makespan, in this order?
  1. $\frac{33}{2}$ and $17$
  2. $33$ and $17$
  3. $11$ and $17$
  4. $\frac{33}{2}$ and $18$
Explanation. The relaxation splits the jobs equally: $\sum_jt_j/m=\frac{33}{2}$. The optimal makespan, with indivisible jobs, is $17$.
Example 1 · oc-g-pcmax-lpratio · level facile · notes
Scheduling $P\,||\,C_{\max}$ with $m=3$ identical machines and times $t=(22,3,3,1)$. The LP relaxation of the model with assignment variables equals $\frac1m\sum_jt_j$. What is the ratio between the relaxation and the optimal makespan?
  1. $\frac{29}{66}$
  2. $\frac{66}{29}$
  3. $\frac{1}{3}$
  4. $\frac{29}{22}$
Explanation. The job of length $22$ dominates: the optimal makespan is $22$, the relaxation $\frac{29}{3}$. The ratio $\frac{29}{66}$ is at least $\frac1m=\frac{1}{3}$, and gets close to it with one long job and short ones.
Example 2 · oc-g-pcmax-lpratio · level facile · notes
Scheduling $P\,||\,C_{\max}$ with $m=3$ identical machines and times $t=(27,1,1,2)$. The LP relaxation of the model with assignment variables equals $\frac1m\sum_jt_j$. What is the ratio between the relaxation and the optimal makespan?
  1. $\frac{31}{81}$
  2. $\frac{1}{3}$
  3. $\frac{81}{31}$
  4. $\frac{31}{27}$
Explanation. The job of length $27$ dominates: the optimal makespan is $27$, the relaxation $\frac{31}{3}$. The ratio $\frac{31}{81}$ is at least $\frac1m=\frac{1}{3}$, and gets close to it with one long job and short ones.

15. Formulations of lot sizing problems (2)

Example 1 · oc-g-ls-bigm · level facile · notes
Capacitated lot sizing (CLS) over $5$ periods, zero final stock: $\begin{array}{c|ccccc}t & 1 & 2 & 3 & 4 & 5\\ \hline d_t & 12 & 13 & 9 & 12 & 10\\ cap_t & 40 & 20 & 37 & 60 & 56\end{array}$. In the big-M formulation production and setup are linked by $x_t\le M_t\,y_t$, and the strongest valid value is $M_t=\min\{cap_t,\ D_{t,5}\}$, with $D_{t,5}$ the demand of periods $t$ to $5$. What is $M_4$?
  1. $56$
  2. $12$
  3. $22$
  4. $60$
Explanation. $D_{4,5}=22$ and $cap_4=60$, hence $M_4=22$. A larger value is valid but weakens the LP relaxation.
Example 2 · oc-g-ls-bigm · level facile · notes
Capacitated lot sizing (CLS) over $5$ periods, zero final stock: $\begin{array}{c|ccccc}t & 1 & 2 & 3 & 4 & 5\\ \hline d_t & 16 & 15 & 16 & 6 & 5\\ cap_t & 53 & 25 & 45 & 66 & 55\end{array}$. In the big-M formulation production and setup are linked by $x_t\le M_t\,y_t$, and the strongest valid value is $M_t=\min\{cap_t,\ D_{t,5}\}$, with $D_{t,5}$ the demand of periods $t$ to $5$. What is $M_4$?
  1. $6$
  2. $66$
  3. $11$
  4. $58$
Explanation. $D_{4,5}=11$ and $cap_4=66$, hence $M_4=11$. A larger value is valid but weakens the LP relaxation.
Example 1 · oc-g-ls-lpsetup · level facile · notes
In the LP relaxation of the big-M lot sizing formulation ($x_t\le M_t\,y_t$, $0\le y_t\le 1$, setup cost $sc_t\,y_t$) the production is $x_t=34$ with $sc_t=89$. How much setup does it pay at least, with $M_t=43$ and with $M_t=82$?
  1. $\frac{1462}{89}$ and $\frac{2788}{89}$
  2. $\frac{1513}{41}$ and $\frac{3026}{43}$
  3. $89$ and $89$
  4. $\frac{3026}{43}$ and $\frac{1513}{41}$
Explanation. The constraint gives $y_t\ge x_t/M_t$, and the relaxation pays $sc_t\,x_t/M_t$: $\frac{3026}{43}$ and $\frac{1513}{41}$. A larger big-M makes the relaxation pay less setup, i.e., weakens it.
Example 2 · oc-g-ls-lpsetup · level facile · notes
In the LP relaxation of the big-M lot sizing formulation ($x_t\le M_t\,y_t$, $0\le y_t\le 1$, setup cost $sc_t\,y_t$) the production is $x_t=12$ with $sc_t=27$. How much setup does it pay at least, with $M_t=35$ and with $M_t=87$?
  1. $\frac{324}{35}$ and $\frac{108}{29}$
  2. $\frac{140}{9}$ and $\frac{116}{3}$
  3. $27$ and $27$
  4. $\frac{108}{29}$ and $\frac{324}{35}$
Explanation. The constraint gives $y_t\ge x_t/M_t$, and the relaxation pays $sc_t\,x_t/M_t$: $\frac{324}{35}$ and $\frac{108}{29}$. A larger big-M makes the relaxation pay less setup, i.e., weakens it.

16. Knapsack: branch-and-bound on the critical item (2)

Example 1 · oc-g-kp-bb · level complessa · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=11$ and items sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 7 & 15 & 18 & 13 & 3\\ w_j & 2 & 5 & 6 & 8 & 3\end{array}$. In branch-and-bound every node $k$ is evaluated with the LP relaxation $\mathrm{LP}^k_{\mathrm{KP}}$; branching is on the split item $s$ of the root (node 2: $x_s\le 0$, node 3: $x_s\ge 1$), with $\mathrm{LB}=25$ (value of the greedy solution). A node with a fractional solution is pruned if $\lfloor z(\mathrm{LP}^k_{\mathrm{KP}})\rfloor\le\mathrm{LB}$, otherwise it enters the list $L$. After solving the root node, what are the values $z(\mathrm{LP}^k_{\mathrm{KP}})$ of nodes 2 and 3 and what happens to them?
  1. node 2: $\frac{57}{2}$, inserted in the list $L$; node 3: $16$, pruned by bound
  2. node 2: $\frac{57}{2}$, pruned by bound; node 3: $34$, pruned by bound
  3. node 2: $\frac{57}{2}$, inserted in the list $L$; node 3: $34$, inserted in the list $L$
  4. node 2: $\frac{57}{2}$, inserted in the list $L$; node 3: $\frac{93}{2}$, inserted in the list $L$
Explanation. Root: $z=34$, split item $s=3$. Node 2 ($x_{3}\le 0$): $\frac{57}{2}$. Node 3 ($x_{3}\ge 1$): $c(3)=5$, $p(3)=18$, $z=34$. A node is pruned by bound if $\lfloor z\rfloor\le\mathrm{LB}$; in node 3 the constant $p(3)$ and the reduced capacity must be used.
Example 2 · oc-g-kp-bb · level complessa · notes
0-1 knapsack problem (KP: choose a subset of items of maximum profit with total weight at most $c$) with capacity $c=16$ and items sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 10 & 14 & 20 & 20 & 13\\ w_j & 2 & 4 & 7 & 7 & 7\end{array}$. In branch-and-bound every node $k$ is evaluated with the LP relaxation $\mathrm{LP}^k_{\mathrm{KP}}$; branching is on the split item $s$ of the root (node 2: $x_s\le 0$, node 3: $x_s\ge 1$), with $\mathrm{LB}=44$ (value of the greedy solution). A node with a fractional solution is pruned if $\lfloor z(\mathrm{LP}^k_{\mathrm{KP}})\rfloor\le\mathrm{LB}$, otherwise it enters the list $L$. After solving the root node, what are the values $z(\mathrm{LP}^k_{\mathrm{KP}})$ of nodes 2 and 3 and what happens to them?
  1. node 2: $\frac{347}{7}$, inserted in the list $L$; node 3: $\frac{228}{7}$, pruned by bound
  2. node 2: $\frac{347}{7}$, inserted in the list $L$; node 3: $\frac{368}{7}$, inserted in the list $L$
  3. node 2: $\frac{347}{7}$, pruned by bound; node 3: $\frac{368}{7}$, pruned by bound
  4. node 2: $\frac{347}{7}$, inserted in the list $L$; node 3: $\frac{487}{7}$, inserted in the list $L$
Explanation. Root: $z=\frac{368}{7}$, split item $s=4$. Node 2 ($x_{4}\le 0$): $\frac{347}{7}$. Node 3 ($x_{4}\ge 1$): $c(3)=9$, $p(3)=20$, $z=\frac{368}{7}$. A node is pruned by bound if $\lfloor z\rfloor\le\mathrm{LB}$; in node 3 the constant $p(3)$ and the reduced capacity must be used.
Example 1 · oc-g-kp-bbdown · level facile · notes
Branch-and-bound for the 0-1 knapsack with capacity $c=17$ and items sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 17 & 13 & 18 & 14 & 4\\ w_j & 2 & 5 & 7 & 6 & 8\end{array}$. At the root the split item is $s=4$ (the first not fitting entirely). What is the LP relaxation of the child with $x_{4}=0$, solved by Dantzig's formulas on the other items?
  1. $\frac{380}{7}$
  2. $55$
  3. $49$
  4. $\frac{99}{2}$
Explanation. Without item $4$ the knapsack is filled with the others by efficiency: $\frac{99}{2}$. The child with $x_{4}=1$ is worth $\frac{380}{7}$ and the root $55$.
Example 2 · oc-g-kp-bbdown · level facile · notes
Branch-and-bound for the 0-1 knapsack with capacity $c=17$ and items sorted by non-increasing efficiency: $\begin{array}{c|ccccc}j & 1 & 2 & 3 & 4 & 5\\ \hline p_j & 19 & 14 & 11 & 16 & 7\\ w_j & 2 & 4 & 5 & 8 & 4\end{array}$. At the root the split item is $s=4$ (the first not fitting entirely). What is the LP relaxation of the child with $x_{4}=0$, solved by Dantzig's formulas on the other items?
  1. $51$
  2. $44$
  3. $\frac{278}{5}$
  4. $56$
Explanation. Without item $4$ the knapsack is filled with the others by efficiency: $51$. The child with $x_{4}=1$ is worth $\frac{278}{5}$ and the root $56$.

17. Vertex coloring: the DSATUR branch-and-bound (2)

Example 1 · oc-g-dsbb-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,6\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{3,7\},\{4,5\},\{4,7\},\{5,6\}\}$. In the DSATUR branch-and-bound, the lower bound is the size of a greedy clique (vertices by non-increasing degree, ties smallest index; a vertex enters if adjacent to all those already chosen) and the upper bound is the number of colors of $DSATUR$ (vertex of maximum saturation, ties: more uncolored neighbours, then smallest index; smallest free color). What are they, in this order?
  1. $3$, $4$
  2. $2$, $3$
  3. $4$, $3$
  4. $3$, $3$
Explanation. The greedy clique is $\{3,5,6\}$, hence $\mathrm{LB}=3$; $DSATUR$ uses $3$ colors, hence $\mathrm{UB}=3$. If the two values coincide, the algorithm stops at once.
Example 2 · oc-g-dsbb-bounds · level facile · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,2\},\{1,3\},\{1,4\},\{1,5\},\{1,6\},\{2,4\},\{3,4\},\{3,6\},\{3,7\},\{4,5\},\{5,7\}\}$. In the DSATUR branch-and-bound, the lower bound is the size of a greedy clique (vertices by non-increasing degree, ties smallest index; a vertex enters if adjacent to all those already chosen) and the upper bound is the number of colors of $DSATUR$ (vertex of maximum saturation, ties: more uncolored neighbours, then smallest index; smallest free color). What are they, in this order?
  1. $3$, $4$
  2. $2$, $3$
  3. $3$, $3$
  4. $4$, $3$
Explanation. The greedy clique is $\{1,3,4\}$, hence $\mathrm{LB}=3$; $DSATUR$ uses $3$ colors, hence $\mathrm{UB}=3$. If the two values coincide, the algorithm stops at once.
Example 1 · oc-g-dsbb-branch · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,6\},\{2,6\},\{3,4\},\{3,5\},\{3,6\},\{3,7\},\{4,5\},\{4,7\},\{5,6\}\}$. In the DSATUR branch-and-bound, the current node is the partial coloring $col(5)=1,\ col(3)=2,\ col(7)=1$ (the other vertices are uncolored), with $q=2$ colors. It branches on the uncolored vertex of maximum saturation degree (distinct colors among colored neighbours; ties: more uncolored neighbours, then smallest index), with one child per allowed used color plus one with the new color $q+1$. On which vertex does it branch and how many children does the node have?
  1. $v=4$, $1$
  2. $v=6$, $0$
  3. $v=6$, $2$
  4. $v=6$, $1$
Explanation. Vertex $6$ has saturation $2$, the largest; the allowed used colors are $q-2=0$, plus the new color: $1$ children.
Example 2 · oc-g-dsbb-branch · level media · notes
Graph $G=(V,E)$ with $V=\{1,\dots,7\}$ and $E=\{\{1,2\},\{1,3\},\{1,4\},\{1,5\},\{1,6\},\{2,4\},\{3,4\},\{3,6\},\{3,7\},\{4,5\},\{5,7\}\}$. In the DSATUR branch-and-bound, the current node is the partial coloring $col(4)=1,\ col(1)=2,\ col(6)=1$ (the other vertices are uncolored), with $q=2$ colors. It branches on the uncolored vertex of maximum saturation degree (distinct colors among colored neighbours; ties: more uncolored neighbours, then smallest index), with one child per allowed used color plus one with the new color $q+1$. On which vertex does it branch and how many children does the node have?
  1. $v=5$, $1$
  2. $v=3$, $1$
  3. $v=3$, $2$
  4. $v=3$, $0$
Explanation. Vertex $3$ has saturation $2$, the largest; the allowed used colors are $q-2=0$, plus the new color: $1$ children.