← Back to the site

Question bank

564 fixed questions · 47 generated questions

Fixed questions (564)

Part: Graphs (83)

1. Graphs (83)

no-f-001 · level facile · notes
An undirected graph $G=(V,E)$ has $7$ vertices, with degrees $\deg(v)$ (number of edges incident to $v$) equal to $3,3,2,2,2,1,1$. How many edges does $G$ have?
  1. $7$
  2. $14$
  3. $6$
  4. $8$
Explanation. By the handshake lemma $\sum_{v \in V}\deg(v)=2|E|$, since every edge counts in two degrees: the sum is $14$, so $|E|=7$. $14$ is the sum of the degrees, not the number of edges.
no-f-002 · level facile · notes
Let $G=(N,A)$ be a directed graph and $\mat{B}$ its node–arc incidence matrix (one row per node, one column per arc), with the convention of the course. What does the column of the arc $(4,3)$, with tail $4$ and head $3$, look like?
  1. $-1$ in row $4$, $+1$ in row $3$, $0$ elsewhere
  2. $+1$ in rows $3$ and $4$, $0$ elsewhere
  3. $+1$ in row $4$, $-1$ in row $3$, $0$ elsewhere
  4. $+1$ in row $4$ and in column $3$, $0$ elsewhere
Explanation. In the course the column of an arc has $+1$ in the row of the tail and $-1$ in the row of the head: $+1$ in row $4$, $-1$ in row $3$. The last option describes the adjacency matrix, which is $|N| \times |N|$.
no-f-003 · level facile · notes
A directed graph $G=(N,A)$ has $|N|=8$ nodes and $|A|=11$ arcs, and its underlying undirected graph (the arcs taken as edges) has $k=3$ connected components. What is the rank of the node–arc incidence matrix $\mat{B}$?
  1. $8$
  2. $5$
  3. $7$
  4. $8$ minus the number of cycles
Explanation. $\rank(\mat{B})=|N|-k=8-3=5$. The rank is never $|N|$, since the rows of each component add up to zero; $7=|N|-1$ holds only for a connected graph.
no-f-004 · level facile · notes
Let $G$ be an undirected graph with $n$ vertices and $m$ edges. A tree is a connected acyclic graph. Which condition is not enough to say that $G$ is a tree?
  1. $G$ is connected and $m=n-1$
  2. $G$ is acyclic and $m=n-1$
  3. $G$ is connected and acyclic
  4. $G$ has exactly $m=n-1$ edges
Explanation. Any two of «connected», «acyclic» and «$n-1$ edges» imply the third; $m=n-1$ alone does not: a triangle plus an isolated vertex has $4$ vertices and $3$ edges, but it is not a tree.
no-f-005 · level facile · notes
An acyclic undirected graph (a forest) has $n=10$ vertices and $m=7$ edges. How many connected components $k$ does it have?
  1. $3$
  2. $4$
  3. $7$
  4. $1$
Explanation. Every graph has $k \ge n-m$ components, with equality if and only if it is acyclic (each component is a tree with one vertex more than its edges): $k=10-7=3$.
no-f-006 · level facile · notes
In the generic search of a directed graph from a node $s$, every labelled node $j \neq s$ gets a predecessor $\mathit{pred}(j)$. Which search gives, in the predecessor tree, paths from $s$ with the minimum number of arcs to every reachable node?
  1. The depth-first search (DFS), with $\mathit{LIST}$ handled as a stack
  2. The breadth-first search (BFS), with $\mathit{LIST}$ handled as a queue
  3. Both searches, as long as the adjacency lists are sorted
  4. Neither of them, since the lengths of the arcs are needed
Explanation. In the BFS $\mathit{LIST}$ is a queue and the number of arcs of the tree path, $d(j)=d(\mathit{pred}(j))+1$, is the minimum possible. The DFS goes deep first and can give longer paths, whatever the order of the lists.
no-f-007 · level facile · notes
With the graph stored in adjacency lists, what is the running time of the generic search (from a node $s$) of a directed graph $G=(N,A)$?
  1. $O(|N|\,|A|)$
  2. $O(|N|^2)$
  3. $O(|N|+|A|)$
  4. $O(|A|\log|N|)$
Explanation. Every node is labelled and removed from the list of nodes to be examined $\mathit{LIST}$ at most once, and the pointer of the adjacency list $L(i)$ moves at most $\deg^+(i)$ times (the arcs leaving $i$): $O(|N|+|A|)$ in total.
no-f-008 · level facile · notes
In a directed graph $G=(N,A)$, let $R(i)$ be the set of the nodes reachable from $i$ by a directed path and $R'(i)$ the set of the nodes from which $i$ is reachable. What is the strongly connected component of $i$?
  1. $R(i) \cup R'(i)$
  2. $R(i)$
  3. $N \setminus R'(i)$
  4. $R(i) \cap R'(i)$
Explanation. $j$ is strongly connected to $i$ if $j \in R(i)$ and $i \in R(j)$, that is $j \in R'(i)$: the component is $R(i) \cap R'(i)$.
no-f-009 · level facile · notes
Let $T$ be a spanning tree of a connected undirected graph $G$, and $e$ an edge of $G$ that is not in $T$. How many cycles does the graph $T \cup \{e\}$ contain?
  1. Exactly one
  2. None
  3. At least two
  4. As many as the edges of $T$
Explanation. $T \cup \{e\}$ contains exactly one cycle, the fundamental cycle $C(T,e)$: the edge $e$ plus the unique path in $T$ between its endpoints.
no-f-010 · level facile · notes
How much space do the adjacency lists (for every node, the list of the heads of its leaving arcs) of a directed graph with $n$ nodes and $m$ arcs take?
  1. $O(n^2)$
  2. $O(n+m)$
  3. $O(n\,m)$
  4. $O(m^2)$
Explanation. The lists store one entry per arc plus the start of every list: $n+m$. The adjacency matrix takes $n^2$ and the incidence matrix $n\,m$.
no-f-011 · level media · notes
The directed graph with nodes $1,\dots,6$ has the arcs $(1,2)$, $(2,3)$, $(3,1)$, $(3,4)$, $(4,5)$, $(5,4)$, $(5,6)$. Two nodes $i,j$ are strongly connected if there are directed paths from $i$ to $j$ and from $j$ to $i$. How many strongly connected components does the graph have?
  1. $1$
  2. $2$
  3. $3$
  4. $6$
Explanation. The components are $\{1,2,3\}$ (cycle $1,2,3,1$), $\{4,5\}$ (cycle $4,5,4$) and $\{6\}$: from $4$ there is no way back to $3$, and no arc leaves $6$. The graph is weakly connected, which gives $1$ connected component, not strongly connected.
no-f-012 · level teorema · notes
Let $G=(N,A)$ be a directed graph whose underlying undirected graph has $k$ connected components, and $\mat{B}$ its node–arc incidence matrix. Which statement is correct?
  1. $\rank(\mat{B})=|N|$ if and only if $G$ is connected
  2. $\rank(\mat{B})=|A|-k$ for every directed graph
  3. $\rank(\mat{B})=|N|-k$ for every directed graph
  4. $\rank(\mat{B})=|N|-1$ for every directed graph
Explanation. This is the theorem on the rank of the incidence matrix: $\rank(\mat{B})=|N|-k$. The rows of each component add up to zero, so the rank is never $|N|$; $|N|-1$ holds only for $k=1$.
no-f-013 · level teorema · notes
Let $G=(N,A)$ be a directed graph with connected underlying undirected graph, and $\mat{B}$ its node–arc incidence matrix. Which statement on the columns of $\mat{B}$ is correct?
  1. $|N|-1$ columns are independent if and only if their arcs form a spanning tree
  2. $|N|-1$ columns are independent if and only if their arcs form a directed path
  3. Any $|N|-1$ columns of $\mat{B}$ are always linearly independent
  4. $\mat{B}$ has full row rank, that is, rank equal to $|N|$
Explanation. Corollary «bases of the incidence matrix»: in a connected graph the bases of $\mat{B}$ are exactly the spanning trees (they need not be directed); the rank is $|N|-1$ and one row is redundant.
no-f-014 · level teorema · notes
A leaf of a tree is a vertex of degree $1$. Which statement on the leaves of a tree with $n$ vertices is correct?
  1. Every tree with $n \ge 2$ vertices has exactly two leaves
  2. Every tree with $n \ge 2$ vertices has at least two leaves
  3. Every tree with $n \ge 3$ vertices has at least three leaves
  4. A tree with $n \ge 2$ vertices has leaves only if $n$ is even
Explanation. The endpoints of a path of maximum length have degree $1$: every tree with at least $2$ vertices has at least two leaves. A star with $n$ vertices has $n-1$ of them, a path exactly two.
no-f-015 · level ipotesi · notes
Let $G=(N,A)$ be a directed graph with $k$ connected components (of the underlying undirected graph) and incidence matrix $\mat{B}$. Which results are used to prove $\rank(\mat{B}) \ge |N|-k$?
  1. The handshake lemma and the total unimodularity of $\mat{B}$
  2. The lemma «columns of a cycle» and the correctness of the search
  3. Bellman's equations and the lemma «leaves» on trees
  4. A spanning forest with $|N|-k$ arcs and the lemma «columns of a forest»
Explanation. A spanning forest has $|N|-k$ arcs and the columns of the arcs of a forest are linearly independent: the rank is at least $|N|-k$. The columns of a cycle are used for the other direction of the corollary on bases, not for this inequality.
no-f-016 · level ipotesi · notes
In the generic search from $s$ every labelled node $j \neq s$ has a predecessor $\mathit{pred}(j)$. To prove that the arcs $(\mathit{pred}(j),j)$ form a tree on the labelled nodes, what is used?
  1. $\mathit{pred}(j)$ is labelled before $j$; a connected graph with $r$ nodes and $r-1$ arcs is a tree
  2. The BFS labels the nodes in non-decreasing order of $d$; the cut property
  3. The rank theorem for $\mat{B}$; the fact that $\mathit{LIST}$ is handled as a queue
  4. The adjacency lists are sorted; every tree with at least two nodes has two leaves
Explanation. Following the predecessors (always labelled earlier) one reaches $s$, so the $r-1$ arcs connect the $r$ labelled nodes and, by the characterization of trees, they form a tree. It holds for every search, not only for the BFS.
no-f-017 · level ipotesi · notes
The generic search from $s$ removes a node from the list $\mathit{LIST}$ when it has no admissible arcs left (arcs towards unlabelled nodes). In the proof that it labels all the nodes reachable from $s$, which fact gives the contradiction?
  1. The breadth-first search finds the paths with the minimum number of arcs
  2. The adjacency lists are sorted by increasing index of the head
  3. A node leaves $\mathit{LIST}$ only without admissible arcs, and labels stay
  4. The underlying undirected graph of the directed graph is connected
Explanation. If $i_t$ is the first unlabelled node of a path from $s$, the arc $(i_{t-1},i_t)$ stays admissible until the end, but $i_{t-1}$ has left $\mathit{LIST}$: a contradiction. No assumption on BFS, list order or connectivity is needed.
no-f-018 · level facile · notes
We traverse a cycle of the underlying undirected graph of a directed graph (arcs may be crossed in both directions). When is the arc $(i,j)$, with tail $i$ and head $j$, a backward arc of the cycle?
  1. When $i>j$
  2. When the cycle traverses it from the head $j$ to the tail $i$
  3. When its cost is negative
  4. When it is the last arc of the cycle
Explanation. An arc is forward if it is traversed from tail to head, backward otherwise: it depends on the direction of traversal, not on the indices or the costs.
no-f-019 · level facile · notes
An undirected graph $G=(V,E)$ has $k=4$ connected components. An edge $\{u,v\} \notin E$ is added, with $u$ and $v$ in the same component. What happens?
  1. The components become $3$ and no cycle appears
  2. The components become $5$
  3. The components stay $4$ and a cycle through $\{u,v\}$ appears
  4. The components stay $4$ and no cycle appears
Explanation. Lemma «adding an edge»: with $u,v$ in the same component, a path from $u$ to $v$ already exists and closes a cycle with $\{u,v\}$; the components do not change. Between different components, instead, $k$ drops by one and no cycle appears.
no-f-020 · level facile · notes
In a directed graph with node–arc incidence matrix $\mat{B}$, the arcs $C$ form a cycle of the underlying undirected graph. What can be said about the columns $\mat{B}_a$, $a \in C$?
  1. They are linearly dependent: with sign $+1$ on forward arcs and $-1$ on backward arcs they add up to $\vet{0}$
  2. They are linearly independent, since every column has one $+1$ and one $-1$
  3. They are dependent only if the cycle is directed, that is, with all arcs forward
  4. They are dependent only if the cycle has an even number of arcs
Explanation. Lemma «columns of a cycle»: $\varepsilon_t\mat{B}_{c_t}=\vet{e}_{v_{t-1}}-\vet{e}_{v_t}$ and the sum along the cycle telescopes to zero. It holds for every cycle, directed or not, of any length.
no-f-021 · level facile · notes
In a directed graph, a directed walk may repeat nodes, a directed path may not. The walk $1,3,2,4,3,5$ goes from $1$ to $5$. Which directed path from $1$ to $5$ is obtained by deleting the closed piece?
  1. $1,3,2,4,5$
  2. $1,2,4,3,5$
  3. $1,3,2,4,3$
  4. $1,3,5$
Explanation. Lemma «a walk contains a path»: node $3$ repeats, and deleting the closed piece $3,2,4,3$ leaves $1,3,5$, which uses only arcs of the walk. The other sequences use arcs the walk does not contain or do not end at $5$.
no-f-022 · level teorema · notes
In a directed graph, two nodes $i,j$ are strongly connected if there are directed paths from $i$ to $j$ and from $j$ to $i$. Which statement is correct?
  1. The relation is symmetric but not transitive, so the components may overlap
  2. The strongly connected components coincide with those of the underlying undirected graph
  3. It is an equivalence relation, so the strongly connected components partition the nodes
  4. It is an equivalence relation only if the graph is acyclic
Explanation. The relation is reflexive (path of length $0$), symmetric by definition and transitive (two paths in a row give a walk, which contains a path): the classes partition $N$. In an acyclic graph every class is a single node.
no-f-212 · level facile · notes
In an undirected graph $G=(V,E)$ every edge is a subset $\{u,v\}$ of two distinct vertices. With $n=|V|$, how many edges can $G$ have at most?
  1. $n^2$
  2. $n(n-1)$
  3. $n(n-1)/2$
  4. $n-1$
Explanation. The edges are the unordered pairs of distinct vertices: $\binom{n}{2}=n(n-1)/2$. $n(n-1)$ counts the ordered pairs, that is, the arcs of a simple directed graph; $n-1$ is the number of edges of a tree.
no-f-213 · level facile · notes
A directed graph $G=(N,A)$ has the arcs $(1,2)$, $(1,3)$, $(3,2)$, $(2,4)$, $(4,3)$. The outgoing star $\delta^+(i)$ contains the arcs with tail $i$, the incoming star $\delta^-(i)$ those with head $i$. What are $\deg^+(3)=|\delta^+(3)|$ and $\deg^-(3)=|\delta^-(3)|$?
  1. $\deg^+(3)=2$, $\deg^-(3)=1$
  2. $\deg^+(3)=1$, $\deg^-(3)=2$
  3. $\deg^+(3)=3$, $\deg^-(3)=0$
  4. $\deg^+(3)=1$, $\deg^-(3)=1$
Explanation. Only $(3,2)$ leaves node $3$, so $\deg^+(3)=1$; $(1,3)$ and $(4,3)$ enter it, so $\deg^-(3)=2$. Swapping tail and head gives the first option; $3$ is the degree in the underlying undirected graph.
no-f-214 · level teorema · notes
Let $G=(V,E)$ be an undirected graph with $m$ edges and degrees $\deg(v)$ (number of edges incident to $v$). Which statement is correct?
  1. $\sum_{v \in V}\deg(v)=m$, since every edge is counted once
  2. The number of vertices of even degree is always even
  3. $\sum_{v \in V}\deg(v)=2m$ only if $G$ is connected
  4. $\sum_{v \in V}\deg(v)=2m$, so the number of vertices of odd degree is even
Explanation. Every edge $\{u,v\}$ counts once in $\deg(u)$ and once in $\deg(v)$: the sum is $2m$ for every graph, connected or not. An even sum forces the odd degrees to be an even number; there is no constraint on the even degrees.
no-f-215 · level facile · notes
In an undirected graph a walk $v_0,v_1,\dots,v_k$ may repeat vertices, a path has distinct vertices, a cycle is a closed walk with $k \ge 3$ and $v_0,\dots,v_{k-1}$ distinct. In the graph with edges $\{1,2\},\{2,3\},\{3,1\},\{3,4\}$, what is the sequence $1,2,3,1$?
  1. A cycle of length $3$
  2. A path of length $3$
  3. A walk that is not closed
  4. A cycle of length $4$
Explanation. The sequence returns to $1$ after $k=3$ edges and $1,2,3$ are distinct: it is a cycle of length $3$. It is not a path, since $1$ appears twice; the length is the number of edges, not of written vertices.
no-f-216 · level ipotesi · notes
Lemma: if a graph has a walk from $u$ to $v$ (vertices may repeat), it also has a path from $u$ to $v$ (distinct vertices) with vertices of the walk. The proof chooses a walk from $u$ to $v$ of minimum length. Which argument concludes it?
  1. Every walk is already a path, since the graph is simple
  2. The graph is connected, so a path between two vertices always exists
  3. If a vertex appeared twice, removing the closed piece between its two occurrences would give a shorter walk
  4. The shortest walk is a tree, and a tree has a unique path
Explanation. In a walk of minimum length no vertex repeats: otherwise the closed piece between the two occurrences is removed and a shorter walk with the same endpoints is obtained. Connectivity of the graph is not needed, and a walk with repetitions is not a path even in a simple graph.
no-f-217 · level facile · notes
A graph is simple if it has no loops (edges $\{v,v\}$ or arcs $(i,i)$) and no parallel edges or arcs (two copies of the same pair). Which graph is not simple?
  1. A directed graph with the arcs $(1,2)$ and $(2,1)$
  2. An undirected graph with two copies of the edge $\{1,2\}$
  3. An undirected graph with an isolated vertex
  4. A directed graph without arcs
Explanation. Two copies of $\{1,2\}$ are parallel edges: the graph is a multigraph. The arcs $(1,2)$ and $(2,1)$ are different ordered pairs, so they are not parallel; isolated vertices and the absence of arcs do not matter.
no-f-218 · level facile · notes
In the network optimization module all directed graphs are simple (no loops, no parallel arcs). Which consequence of this convention do the notes use?
  1. Every node has at least one outgoing arc
  2. The number of arcs is at most $n-1$
  3. The underlying undirected graph is a tree
  4. An arc is identified by the pair $(i,j)$ of tail and head, and one can write $x_{ij}$, $c_{ij}$
Explanation. Without parallel arcs there is at most one arc for each ordered pair $(i,j)$, so the data of an arc are indexed by $ij$. Simplicity says nothing about outgoing arcs (beyond the bound $n(n-1)$) nor about the structure of the graph.
no-f-219 · level facile · notes
A simple directed graph (no loops $(i,i)$, no parallel arcs) has $n$ nodes. How many arcs can it have at most?
  1. $n(n-1)$
  2. $n(n-1)/2$
  3. $n^2$
  4. $2n$
Explanation. Every ordered pair $(i,j)$ with $i \neq j$ can be an arc, once: $n(n-1)$ arcs. $n(n-1)/2$ is the maximum for an undirected graph, $n^2$ would also count the loops.
no-f-220 · level facile · notes
The adjacency matrix $\mat{M}$ of a directed graph $G=(N,A)$ with $n$ nodes has $m_{ij}=1$ if $(i,j) \in A$ and $0$ otherwise. What does the sum of the entries of row $i$ of $\mat{M}$ count?
  1. The in-degree $\deg^-(i)$
  2. The number of nodes reachable from $i$
  3. The out-degree $\deg^+(i)$
  4. The number of arcs of the graph
Explanation. Row $i$ has a $1$ for every arc $(i,j)$ leaving $i$: the sum is $\deg^+(i)$. The in-degree is the sum of column $i$; reachable nodes need paths, not just arcs.
no-f-221 · level facile · notes
The adjacency lists of a directed graph store, for every node $i$, the list $L(i)$ of the heads of the arcs leaving $i$, sorted by increasing index. The graph has the arcs $(1,3)$, $(2,1)$, $(3,2)$, $(1,2)$, $(3,4)$. What is $L(1)$?
  1. $L(1)=(2)$
  2. $L(1)=(2,3)$
  3. $L(1)=(3,2)$
  4. $L(1)=(2,3,2)$
Explanation. The arcs leaving $1$ are $(1,3)$ and $(1,2)$; the sorted heads give $L(1)=(2,3)$. $(2)$ lists instead the nodes entering $1$; $(3,2)$ is not sorted.
no-f-222 · level facile · notes
Four representations of a directed graph with $n$ nodes and $m$ arcs are compared: adjacency matrix, node–arc incidence matrix, arc list, adjacency lists. How many entries does the node–arc incidence matrix store?
  1. $n^2$
  2. $2m$
  3. $n+m$
  4. $n\,m$
Explanation. The incidence matrix has one row per node and one column per arc: $n\,m$ entries. $n^2$ is the adjacency matrix, $2m$ the arc list (tail and head), $n+m$ the adjacency lists.
no-f-223 · level facile · notes
A directed graph with $n$ nodes is stored with the adjacency matrix $\mat{M}$ ($m_{ij}=1$ if $(i,j)$ is an arc). What does it cost to test whether $(i,j)$ is an arc, and to list the successors of $i$?
  1. $O(1)$ and $O(n)$
  2. $O(n)$ and $O(1)$
  3. $O(1)$ and $O(\deg^+(i))$
  4. $O(m)$ and $O(m)$
Explanation. The test reads the entry $m_{ij}$, in constant time; the successors require scanning the whole row $i$, of length $n$. $O(\deg^+(i))$ is the cost with adjacency lists, $O(m)$ with the arc list.
no-f-224 · level facile · notes
A directed graph is sparse when the number $m$ of arcs is much smaller than $n^2$, as in the networks of applications. Why do the notes use adjacency lists in network algorithms?
  1. Because they test an arc $(i,j)$ in time $O(1)$
  2. Because they are the only representation storing the capacities
  3. Because they take space $n+m$ and give the successors of $i$ in time $O(\deg^+(i))$
  4. Because they take space $O(n)$ whatever $m$ is
Explanation. With $m$ much smaller than $n^2$ the space $n+m$ is much less than $n^2$, and scanning the successors costs only $\deg^+(i)$: searches become linear. Testing an arc in $O(1)$ is the strength of the adjacency matrix, not of the lists.
no-f-225 · level facile · notes
Let $\mat{B}$ be the node–arc incidence matrix of a directed graph ($+1$ in the row of the tail, $-1$ in that of the head) and $\vet{x}$ a vector with a value $x_{ij}$ for every arc. What is component $i$ of $\mat{B}\vet{x}$?
  1. What enters $i$ minus what leaves it
  2. What leaves $i$ minus what enters it
  3. The sum of the values on the arcs incident to $i$
  4. The largest value on the arcs leaving $i$
Explanation. $(\mat{B}\vet{x})_i=\sum_{(i,j)}x_{ij}-\sum_{(j,i)}x_{ji}$: outgoing arcs have $+1$ in row $i$, incoming ones $-1$. It is the net outflow, which the conservation constraints set equal to the balance $b_i$.
no-f-226 · level facile · notes
A directed graph has the arcs $(1,2)$, $(1,3)$, $(2,3)$, $(3,4)$, and $\mat{B}$ is its node–arc incidence matrix ($+1$ in the tail, $-1$ in the head). With $x_{ij}=1$ on every arc, what is $\mat{B}\vet{x}$?
  1. $(2,1,1,1)'$
  2. $(-2,0,1,1)'$
  3. $(2,0,-1,-1)'$
  4. $(0,0,0,0)'$
Explanation. With all values equal to $1$, $(\mat{B}\vet{x})_i=\deg^+(i)-\deg^-(i)$: node $1$: $2-0$, node $2$: $1-1$, node $3$: $1-2$, node $4$: $0-1$. The components add up to $0$, as for every $\mat{B}\vet{x}$.
no-f-227 · level teorema · notes
Let $\mat{B}$ be the node–arc incidence matrix of a directed graph ($+1$ in the tail, $-1$ in the head of every arc) and $\vet{x}$ any vector of values on the arcs. Which statement is correct?
  1. The sum of the components of $\mat{B}\vet{x}$ is always $0$
  2. The sum of the components of $\mat{B}\vet{x}$ is $\sum x_{ij}$
  3. $\mat{B}\vet{x}=\vet{0}$ for every $\vet{x}$
  4. $\mat{B}\vet{x}=\vet{0}$ only if $\vet{x}=\vet{0}$
Explanation. Every column of $\mat{B}$ has one $+1$ and one $-1$, so the rows add up to zero and $\vet{1}'\mat{B}\vet{x}=0$: every unit leaving a node enters another one. $\mat{B}\vet{x}=\vet{0}$ does not hold for every $\vet{x}$, and a cycle gives nonzero solutions.
no-f-228 · level facile · notes
A directed graph $G=(N,A)$ is weakly connected if the underlying undirected graph (arcs taken as edges) is connected. The graph with nodes $1,2,3,4$ has the arcs $(1,2)$, $(3,2)$, $(3,4)$. What can be said?
  1. It is strongly connected
  2. It is not weakly connected, since $4$ does not reach $1$
  3. It is weakly connected but not strongly connected
  4. It has $4$ connected components
Explanation. The edges $\{1,2\},\{2,3\},\{3,4\}$ form a path, so the underlying graph is connected. It is not strongly connected: from $1$ only $2$ is reached. Weak connectivity ignores the directions of the arcs.
no-f-229 · level ipotesi · notes
Proposition: in a directed graph «being strongly connected» ($j$ reachable from $i$ and $i$ from $j$) is an equivalence relation, so the strongly connected components partition the nodes. Which result is needed for transitivity?
  1. Every node has at least one outgoing arc
  2. Every directed walk contains a directed path with the same endpoints
  3. The underlying undirected graph is connected
  4. Every tree has at least two leaves
Explanation. A path from $i$ to $j$ followed by one from $j$ to $h$ is only a walk (it may repeat nodes); the walk lemma extracts from it a path from $i$ to $h$. The other assumptions are not true in general or are not needed.
no-f-230 · level facile · notes
In an undirected graph $G=(V,E)$ a forest is an acyclic graph, a tree a connected acyclic graph, and a spanning tree of a connected $G$ is a tree $T=(V,F)$ with $F \subseteq E$. What distinguishes a spanning tree from any tree contained in $G$?
  1. It contains all the vertices of $G$
  2. It has minimum weight
  3. It contains all the edges of $G$
  4. It has exactly two leaves
Explanation. «Spanning» means that the tree touches all the vertices $V$ of $G$, so it has $|V|-1$ edges. Minimum weight concerns the minimum spanning tree; a tree with all the edges exists only if $G$ itself is a tree.
no-f-231 · level facile · notes
A spanning forest of an undirected graph $G$ is a forest with all the vertices of $G$ and the same connected components. A graph has $n=12$ vertices, $m=20$ edges and $k=3$ connected components. How many edges does each of its spanning forests have?
  1. $11$
  2. $17$
  3. $8$
  4. $9$
Explanation. Each component with $n_c$ vertices has a spanning tree with $n_c-1$ edges; in total $n-k=12-3=9$. $11=n-1$ holds only for a connected graph; $17=m-k$ and $8=m-n$ use the number of edges, which does not matter.
no-f-232 · level ipotesi · notes
Corollary: every connected undirected graph has a spanning tree. The proof removes, as long as there is one, an edge of a cycle. Why does removing that edge not disconnect the graph?
  1. Because the removed edge is the heaviest of the cycle
  2. Because the graph has at least $n$ edges
  3. Because the rest of the cycle still connects the two endpoints of the removed edge
  4. Because every vertex has degree at least $2$
Explanation. The endpoints $u,v$ of the removed edge stay connected along the rest of the cycle, so the components do not change. Weights do not matter (they are needed only for the minimum spanning tree); the number of edges and the degrees are not assumptions of the corollary.
no-f-233 · level teorema · notes
Let $G=(V,E)$ be an undirected graph with $n$ vertices. Which statement is equivalent to «$G$ is a tree» (connected and acyclic)?
  1. $G$ has $n-1$ edges
  2. Between every pair of vertices there is exactly one path
  3. Every vertex has degree at most $2$
  4. $G$ is connected and has at least $n-1$ edges
Explanation. A tree has a unique path between two vertices, and conversely: existence gives connectivity, uniqueness excludes cycles. $n-1$ edges alone are not enough; «degree at most $2$» describes paths and cycles; a connected graph always has at least $n-1$ edges.
no-f-234 · level facile · notes
Let $T$ be a spanning tree of a connected undirected graph $G$ with $n=7$ vertices and $m=11$ edges. Every edge $e \notin T$ forms with $T$ a fundamental cycle $C(T,e)$. How many fundamental cycles does $G$ have with respect to $T$?
  1. $5$
  2. $6$
  3. $4$
  4. $11$
Explanation. There is one fundamental cycle for every edge outside $T$: $m-(n-1)=11-6=5$. $6=n-1$ is the number of edges of $T$, $4=m-n$ forgets the $+1$.
no-f-235 · level facile · notes
In a directed graph, the spanning tree $T$ has the arcs $(1,2)$, $(1,3)$, $(2,4)$. The fundamental cycle of the arc $(4,3) \notin T$ is traversed in the direction of $(4,3)$: an arc of $T$ is forward if traversed from tail to head, backward otherwise. Which arcs of $T$ are backward?
  1. $(1,3)$
  2. $(1,2)$ and $(2,4)$
  3. $(1,2)$, $(1,3)$ and $(2,4)$
  4. None
Explanation. The cycle is $4,3,1,2,4$: from $3$ to $1$ it traverses $(1,3)$ from head to tail (backward), then $(1,2)$ and $(2,4)$ from tail to head (forward). The second option swaps the two directions.
no-f-236 · level ipotesi · notes
Lemma: if the arcs $F$ of a directed graph form a forest, their columns in the node–arc incidence matrix $\mat{B}$ are linearly independent. The proof is by induction on $|F|$. Which fact makes it possible to cancel one coefficient at each step?
  1. Every column of $\mat{B}$ adds up to zero
  2. The underlying graph is connected
  3. $\mat{B}$ is totally unimodular
  4. A tree with at least $2$ nodes has a leaf, whose row contains a single arc of $F$
Explanation. In the row of a leaf $\ell$ only the arc $a'$ incident to $\ell$ appears, so the zero combination gives $\lambda_{a'}=0$; removing $a'$ leaves a forest. The zero column sums are used for the rank $|N|-k$, not for this lemma; connectivity is not required.
no-f-237 · level facile · notes
The generic search of a directed graph from a source $s$ labels the reached nodes, records $\mathit{pred}(j)$ and keeps in $\mathit{LIST}$ the labelled nodes still to be processed. When is an arc $(i,j)$ called admissible?
  1. When $i$ and $j$ are both labelled
  2. When $i$ is labelled and $j$ is not
  3. When $j$ is labelled and $i$ is not
  4. When $(i,j)$ belongs to the predecessor tree
Explanation. An admissible arc leaves an already reached node and leads to a new one: traversing it labels $j$ with $\mathit{pred}(j)=i$. Arcs between two labelled nodes are no longer useful.
no-f-238 · level facile · notes
In the generic search of a directed graph from $s$, at every iteration a node $i$ of $\mathit{LIST}$ (list of the labelled nodes to be processed) is selected. What is done if $i$ has no admissible arcs (arcs to unlabelled nodes)?
  1. The label of $i$ is removed
  2. The search restarts from $i$
  3. $i$ is removed from $\mathit{LIST}$
  4. The node with the lowest index is labelled
Explanation. A node without admissible arcs cannot label anyone any more, so it leaves $\mathit{LIST}$ (and stays labelled: labels are never removed). The search ends when $\mathit{LIST}$ is empty.
no-f-239 · level teorema · notes
Let $R(s)$ be the set of nodes reachable from $s$ by a directed path. Which statement about the generic search from $s$ (BFS and DFS included) is correct?
  1. The BFS labels all of $R(s)$, the DFS may stop earlier
  2. At the end all the nodes of the graph are labelled
  3. The labelled nodes depend on the order of the adjacency lists
  4. At the end the labelled nodes are exactly those of $R(s)$
Explanation. Every labelled node is reachable (along the predecessor tree) and every reachable node gets labelled, whatever the selection rule. The order of the lists changes the tree and the labelling order, not the final set.
no-f-240 · level ipotesi · notes
Theorem: at the end of the generic search from $s$ every node reachable from $s$ is labelled. The proof takes the first unlabelled node $i_t$ of a path from $s$ and the previous node $i_{t-1}$, which is labelled. Which fact of the search gives the contradiction?
  1. A node leaves $\mathit{LIST}$ only when it has no admissible arcs, and labels are never removed
  2. The nodes are processed in the order in which they are labelled
  3. The adjacency lists are sorted by increasing index
  4. The graph has no directed cycles
Explanation. $i_{t-1}$ left $\mathit{LIST}$, but the arc $(i_{t-1},i_t)$ stayed admissible until the end since $i_t$ was never labelled: a contradiction. The FIFO order (BFS) and the order of the lists are not needed, and the graph may have cycles.
no-f-241 · level facile · notes
A directed graph with $n$ nodes is stored with the adjacency matrix $\mat{M}$ instead of adjacency lists. In what time does the generic search from a node $s$ run?
  1. $O(n+m)$, as with the lists
  2. $O(m \log n)$
  3. $O(n^2)$
  4. $O(n\,m)$
Explanation. With the matrix, the successors of a node are found by scanning a row of length $n$, and every node is processed once: $O(n^2)$. $O(n+m)$ needs adjacency lists, where scanning costs $\deg^+(i)$.
no-f-242 · level facile · notes
The directed graph with nodes $1,\dots,5$ has the (sorted) adjacency lists $L(1)=(2,3)$, $L(2)=(4)$, $L(3)=(4,5)$, $L(4)=(5)$, $L(5)=\emptyset$. In the BFS from $1$ ($\mathit{LIST}$ is a queue, the first unlabelled head is taken), let $d(j)$ be the number of arcs of the path from $1$ to $j$ in the predecessor tree. What is $d(5)$?
  1. $3$
  2. $2$
  3. $1$
  4. $4$
Explanation. The BFS labels $2,3$ from $1$, then $4$ from $2$, then $5$ from $3$: $\mathit{pred}(5)=3$ and $d(5)=d(3)+1=2$. $3$ is the length of the path $1,2,4,5$, which the BFS does not use.
no-f-243 · level ipotesi · notes
Proposition: in the predecessor tree of the BFS from $s$, $d(j)=d(\mathit{pred}(j))+1$ is the minimum number of arcs of a directed path from $s$ to $j$. Which property of the BFS is the core of the proof?
  1. The adjacency lists are sorted by increasing index
  2. The graph is acyclic
  3. The nodes are labelled in nondecreasing order of $d$, because $\mathit{LIST}$ is a queue
  4. Every node has at most one incoming arc
Explanation. With the queue the values $d$ in $\mathit{LIST}$ grow by at most $1$ and the nodes are labelled by nondecreasing $d$; hence $d(j) \le d(i)+1$ for every arc $(i,j)$, which gives minimality. The order of the lists and acyclicity are not needed.
no-f-244 · level facile · notes
The directed graph with nodes $1,\dots,5$ has the (sorted) adjacency lists $L(1)=(2,3)$, $L(2)=(4)$, $L(3)=(5)$, $L(4)=(3)$, $L(5)=\emptyset$. In the DFS from $1$ ($\mathit{LIST}$ is a stack: the last node is always processed, and the first unlabelled head is labelled), what is $\mathit{pred}(3)$?
  1. $1$
  2. $2$
  3. $5$
  4. $4$
Explanation. The DFS goes from $1$ to $2$, then to $4$, then from $4$ it labels $3$ before going back to $1$: $\mathit{pred}(3)=4$. $\mathit{pred}(3)=1$ is the result of the BFS, which labels $3$ right away from $1$.
no-f-245 · level facile · notes
The BFS ($\mathit{LIST}$ a queue) and the DFS ($\mathit{LIST}$ a stack) are run from the same source $s$ of a directed graph, with the same adjacency lists. What do they always have in common?
  1. The set of labelled nodes
  2. The predecessor tree
  3. The labelling order
  4. The depth of the predecessor tree
Explanation. Both label exactly $R(s)$, the nodes reachable from $s$. The trees differ in general: on the reference graph the DFS reaches node $6$ with $5$ arcs, the BFS with $3$.
no-f-246 · level facile · notes
In the DFS from $s$ on a directed graph ($\mathit{LIST}$ is a stack), when does the search go back to a node labelled earlier?
  1. After every traversed arc
  2. When it meets a node with a smaller index
  3. When the node on top of the stack has no admissible arcs and leaves $\mathit{LIST}$
  4. Never: the DFS does not go back
Explanation. The DFS always restarts from the last labelled node still in $\mathit{LIST}$; it goes back to the previous node of the stack only when that node has no more arcs to unlabelled nodes and is removed.
no-f-247 · level facile · notes
In an undirected graph with $n$ vertices and $m$ edges all the connected components are to be found with searches. How, and in what time?
  1. A search from every vertex, in time $O(n(n+m))$
  2. A single search from any vertex, in time $O(n+m)$
  3. A search in the graph and one in the reversed graph, in time $O(n+m)$
  4. A search from every vertex still unlabelled, in total time $O(n+m)$
Explanation. Each search from an unlabelled vertex labels its whole component; the searches touch every vertex and edge once, so the total is $O(n+m)$. A single search finds only one component; the reversed graph is needed for strongly connected components.
no-f-248 · level facile · notes
Let $G'$ be the reversed graph of a directed graph $G$ (every arc $(i,j)$ becomes $(j,i)$), $R(i)$ the nodes reachable from $i$ in $G$ and $R'(i)$ those reachable from $i$ in $G'$. What is $R(i) \cap R'(i)$?
  1. The set of nodes from which $i$ is reachable
  2. The strongly connected component of $i$
  3. The connected component of $i$ in the underlying undirected graph
  4. The empty set, if $G$ has cycles
Explanation. $R'(i)$ contains the nodes from which $i$ is reachable in $G$; the intersection contains the nodes reachable from $i$ that also reach $i$, that is, the strongly connected component $S(i)$. $R'(i)$ alone is the first option.
no-f-249 · level facile · notes
A search (BFS or DFS) is run from any vertex of a connected undirected graph with $n$ vertices. What do the edges $\{\mathit{pred}(j),j\}$ of the labelled vertices $j$ other than the source form?
  1. A spanning tree of the graph
  2. A minimum spanning tree
  3. A path touching all the vertices
  4. A forest with two components
Explanation. The search labels all $n$ vertices (the graph is connected) and the predecessors form a tree on the labelled vertices: a spanning tree. It is not of minimum cost (the search ignores weights) and in general it is not a path.
no-f-250 · level teorema · notes
Let $\mat{B}$ be the node–arc incidence matrix of a directed graph $G=(N,A)$ and $F \subseteq A$ a set of arcs. Which statement is correct?
  1. The columns of $F$ are independent if and only if $F$ is a spanning tree
  2. The columns of $F$ are independent if and only if $F$ is a path
  3. The columns of $F$ are independent if and only if $F$ contains no cycle (of the underlying undirected graph)
  4. The columns of $F$ are always independent, since every column has one $+1$ and one $-1$
Explanation. The columns of a forest are independent and those of a cycle dependent, so independence is equivalent to acyclicity. A spanning tree is the maximal case ($|N|-1$ columns, connected graph); a path is only an example of a forest.
no-f-251 · level facile · notes
A multigraph allows loops and parallel edges or arcs. Why is there no need, in the network optimization module, to consider parallel arcs $(i,j)$ with different costs?
  1. Because the costs must all be equal
  2. Because a multigraph has no feasible flows
  3. They can be made simple by splitting a parallel arc with an intermediate node
  4. Because parallel arcs always form a negative cycle
Explanation. A parallel arc $(i,j)$ is replaced by two arcs $(i,k)$, $(k,j)$ through a new node $k$: the graph becomes simple and every arc is still identified by its tail–head pair. Costs need not be equal, and two parallel arcs do not form a directed cycle.
no-f-252 · level facile · notes
The reference graph of the chapter on graphs has $n=6$ nodes and $m=9$ arcs. How many entries do its adjacency lists (one entry per node plus one per arc) and its arc list (tail and head of every arc) store?
  1. $36$ and $54$
  2. $15$ and $18$
  3. $18$ and $15$
  4. $9$ and $9$
Explanation. The adjacency lists take $n+m=15$ entries, the arc list $2m=18$. $36=n^2$ is the adjacency matrix and $54=n\,m$ the node–arc incidence matrix.
no-f-253 · level facile · notes
In a network, a value $x_{ij}$ on every arc respects flow conservation at node $i$ if what leaves $i$ minus what enters it equals the balance $b_i$. With $\mat{B}$ the node–arc incidence matrix, how are the constraints for all nodes written?
  1. $\mat{B}'\vet{x}=\vet{b}$
  2. $\mat{B}\vet{x} \le \vet{b}$
  3. $\vet{x}'\mat{B}=\vet{b}$
  4. $\mat{B}\vet{x}=\vet{b}$
Explanation. Row $i$ of $\mat{B}\vet{x}$ is the outflow minus the inflow of $i$, so conservation is $\mat{B}\vet{x}=\vet{b}$, one row per node. $\mat{B}'$ appears in the dual constraints, one row per arc.
no-f-254 · level teorema · notes
Let $T=(V,F)$ be a spanning tree of a connected graph $G=(V,E)$ and $e=\{u,v\} \in E \setminus F$. Which statement about the graph $(V,F \cup \{e\})$ is correct?
  1. It contains at least two cycles, one for each endpoint of $e$
  2. It is still a tree, with $n$ edges
  3. It contains exactly one cycle, made of $e$ and the unique path from $u$ to $v$ in $T$
  4. It contains a cycle only if $e$ is heavier than the edges of $T$
Explanation. Every cycle must use $e$ ($T$ is acyclic), and removing $e$ leaves a path from $u$ to $v$ in $T$, which is unique: the fundamental cycle is unique. A connected graph with $n$ vertices and $n$ edges is not a tree; weights do not matter.
no-f-255 · level facile · notes
BFS and DFS are two cases of the generic search of a directed graph from $s$, which at every step selects a node $i$ of the list $\mathit{LIST}$ of labelled nodes to be processed. What distinguishes them?
  1. The selected node: the BFS takes the first of $\mathit{LIST}$ (a queue), the DFS the last (a stack)
  2. The BFS uses adjacency lists, the DFS the adjacency matrix
  3. The BFS labels only the nodes close to $s$, the DFS all of them
  4. The BFS needs arc lengths, the DFS does not
Explanation. The only difference is the selection rule: queue (first in, first out) for the BFS, stack (last in, first out) for the DFS. Both label all reachable nodes, with any representation and without lengths.
no-f-256 · level facile · notes
In the generic search of a directed graph with adjacency lists sorted by increasing index, the selected node $i$ has several admissible arcs (arcs to unlabelled nodes). Which arc does the search traverse?
  1. A random one
  2. The one to the node with the largest index
  3. All of them, in a single step
  4. The first admissible one of the list $L(i)$, that is, to the unlabelled node of smallest index
Explanation. With sorted lists the search takes the first admissible arc of the list, so the result (order and tree) is unique. One iteration labels a single node.
no-f-257 · level facile · notes
In a directed graph the BFS from $s$ gives every labelled node $j$ the number $d(j)$ of arcs of the path from $s$ to $j$ in its predecessor tree. What is $d(j)$ with respect to the directed paths from $s$ to $j$?
  1. It is the maximum number of arcs of a path from $s$ to $j$
  2. It is the length of the shortest path with the lengths $c_{ij}$
  3. It has no relation with paths, it depends on the order of the lists
  4. It is the minimum number of arcs of a path from $s$ to $j$
Explanation. The BFS gives paths with the minimum number of arcs (shortest paths with all lengths equal to $1$). With general lengths Dijkstra or Bellman–Ford is needed; the order of the lists changes the tree, not the values $d(j)$.
no-f-258 · level facile · notes
The directed graph with nodes $1,\dots,4$ has the (sorted) adjacency lists $L(1)=(2,3)$, $L(2)=(3)$, $L(3)=(4)$, $L(4)=\emptyset$. In which order does the DFS from $1$ ($\mathit{LIST}$ a stack, first unlabelled head) label the nodes, and which tree does it get?
  1. $1,2,3,4$, with the tree $1,2,3,4$ (a path)
  2. $1,2,3,4$, with the arcs $(1,2),(1,3),(3,4)$
  3. $1,3,2,4$
  4. $1,2,4,3$
Explanation. The DFS goes from $1$ to $2$, from $2$ to $3$, from $3$ to $4$: order $1,2,3,4$ and tree $(1,2),(2,3),(3,4)$, a path. The arcs $(1,2),(1,3),(3,4)$ are the tree of the BFS, which has the same labelling order.
no-f-259 · level facile · notes
To find all the strongly connected components of a directed graph with $n$ nodes and $m$ arcs, the notes repeat, for a node of each component not yet found, a search in the graph and one in the reversed graph. How long does this method take in the worst case?
  1. $O(n+m)$
  2. $O(n(n+m))$
  3. $O(m \log n)$
  4. $O(n^2 m)$
Explanation. Each pair of searches costs $O(n+m)$ and is repeated at most $n$ times (once per component): $O(n(n+m))$. More refined algorithms get down to $O(n+m)$, but they are not those of the notes.
no-f-528 · level teorema · notes
A leaf of a tree is a vertex of degree $1$. Which statement about the leaves of a tree with $n \ge 2$ vertices is correct?
  1. It has at least two leaves; it has exactly two if and only if it is a path
  2. It has at most two leaves
  3. It has exactly $n/2$ leaves
  4. It may have no leaves if it is large
Explanation. The endpoints of a longest path are leaves, so there are at least two; a star with $n$ vertices has $n-1$. A tree with exactly two leaves is a path.
no-f-529 · level ipotesi · notes
Lemma: every tree with $n \ge 2$ vertices has at least two leaves (vertices of degree $1$). The proof takes a path of maximum length. Why are its endpoints leaves?
  1. Because the graph has $n-1$ edges
  2. Because the degrees add up to $2(n-1)$
  3. Because the path contains all vertices
  4. Another edge at an endpoint would lengthen the path or close a cycle
Explanation. If an endpoint had another neighbour: outside the path, the path would get longer; on the path, a cycle would close, impossible in a tree. The longest path does not necessarily touch all vertices.
no-f-530 · level teorema · notes
Let $G=(V,E)$ be an undirected graph with $k$ connected components and $e=\{u,v\} \notin E$. Which statement about the graph $(V,E \cup \{e\})$ is correct?
  1. It always has $k-1$ components
  2. It always has a cycle through $e$
  3. If $u,v$ are in different components it has $k-1$ components and no cycle through $e$; if in the same one it has $k$ components and a cycle through $e$
  4. It has $k+1$ components if $u,v$ are in the same component
Explanation. An edge between two components merges them without creating cycles; an edge inside a component closes a cycle with the existing path between $u$ and $v$. It is the lemma behind the counts on trees and forests and behind Kruskal.
no-f-531 · level ipotesi · notes
Corollary: a graph with $n$ vertices, $m$ edges and $k$ components has $k \ge n-m$, with equality if and only if it is acyclic. How is it proved?
  1. By induction on the vertices, removing a leaf
  2. By adding the edges one at a time starting from $n$ isolated vertices: each lowers the components by $1$ or by $0$, and by $0$ only if it closes a cycle
  3. With the handshake lemma
  4. With the rank theorem
Explanation. One starts with $n$ components; by the edge-addition lemma every edge removes at most one component, so $k \ge n-m$, and it removes exactly one when it closes no cycle.
no-f-532 · level teorema · notes
Let $\mat{B}$ be the node–arc incidence matrix of a directed graph and $C$ a set of arcs forming a cycle of the underlying undirected graph. Which statement is correct?
  1. The columns of $C$ are independent if the cycle is directed
  2. The columns of $C$ always add up to zero, without signs
  3. The columns of $C$ are independent if $|C| \ge 3$
  4. The columns of $C$ are dependent: with sign $+1$ on forward arcs and $-1$ on backward ones they add up to zero
Explanation. Going around the cycle, $\pm\mat{B}_c=\vet{e}_{v_{t-1}}-\vet{e}_{v_t}$ and the sum telescopes to zero. Without signs the sum is nonzero if the cycle has backward arcs.
no-f-533 · level ipotesi · notes
Corollary: for a directed graph with connected underlying graph, $n-1$ columns of the incidence matrix $\mat{B}$ are independent if and only if their arcs form a spanning tree. Which results are needed?
  1. Only the handshake lemma
  2. The lemma on the columns of a forest (independent) and the one on the columns of a cycle (dependent), plus «acyclic with $n-1$ edges $\Rightarrow$ tree»
  3. Total unimodularity of $\mat{B}$
  4. The correctness of breadth-first search
Explanation. A spanning tree is a forest, so its columns are independent; independent columns exclude cycles, and $n-1$ acyclic arcs form a tree. Total unimodularity is about determinants, not needed here.
no-f-534 · level teorema · notes
In the generic search of a directed graph from $s$ every labelled node $j \neq s$ has a predecessor $\mathit{pred}(j)$. Which statement is correct?
  1. The arcs $(\mathit{pred}(j),j)$ may form cycles in the DFS
  2. At every iteration the arcs $(\mathit{pred}(j),j)$ form a tree on the labelled nodes, with a directed path from $s$ to every labelled node
  3. The predecessor arcs form a tree only at the end of the search
  4. The predecessor tree contains all the nodes of the graph
Explanation. Every node is labelled after its predecessor, so tracing back the predecessors reaches $s$ without repetitions; $r$ nodes and $r-1$ connected arcs form a tree. It contains only the reachable nodes.
no-f-535 · level ipotesi · notes
Theorem: with adjacency lists the generic search takes time $O(|N|+|A|)$. Which device is essential in the proof?
  1. Every node keeps a pointer into its list $L(i)$ that moves forward and never back, because labels are never removed
  2. The lists are sorted
  3. A priority queue is used
  4. The graph is acyclic
Explanation. The pointer of node $i$ advances at most $\deg^+(i)$ times in total, and $\sum_i \deg^+(i)=|A|$; there are at most $2|N|$ iterations. The order of the lists only makes the result unique.
no-f-556 · level facile · notes
A directed graph has $n=6$ nodes and $m=9$ arcs. How many rows and columns does its node–arc incidence matrix $\mat{B}$ have, and how many nonzero entries?
  1. $6 \times 6$, with $9$ nonzero entries
  2. $9 \times 6$, with $9$ nonzero entries
  3. $6 \times 9$, with $9$ nonzero entries
  4. $6 \times 9$, with $18$ nonzero entries
Explanation. One row per node and one column per arc: $6 \times 9$. Every column has one $+1$ and one $-1$, so there are $2m=18$ nonzero entries. The $6 \times 6$ matrix is the adjacency matrix.
no-f-557 · level facile · notes
An undirected graph has the edges $\{1,2\}$, $\{1,3\}$, $\{2,3\}$, $\{3,4\}$. In the adjacency lists of an undirected graph every edge appears in the lists of both endpoints. What is the list $L(3)$?
  1. $(1,2,4)$
  2. $(4)$
  3. $(1,2)$
  4. $(1,2,3,4)$
Explanation. Vertex $3$ is adjacent to $1$, $2$ and $4$. $(4)$ would list only the neighbours with larger index, as if the edge were oriented from $3$.
no-f-558 · level facile · notes
A directed graph has the arcs $(1,2)$, $(2,3)$, $(3,1)$, $(3,4)$, $(4,5)$, $(5,4)$. The strongly connected components are the maximal sets of nodes pairwise reachable in both directions. How many are there?
  1. $1$
  2. $5$
  3. $2$
  4. $3$
Explanation. $\{1,2,3\}$ (cycle $1,2,3,1$) and $\{4,5\}$ (arcs $(4,5)$ and $(5,4)$): two components. From $4$ there is no way back to $3$, so the two components stay separate; the underlying graph is instead connected.
no-f-559 · level facile · notes
A directed graph with $|N|=6$ nodes has a connected underlying undirected graph, and $\mat{B}$ is its node–arc incidence matrix. At most how many columns of $\mat{B}$ can be chosen so that they are linearly independent?
  1. $6$
  2. $5$
  3. As many as there are arcs
  4. $4$
Explanation. The rank is $|N|-1=5$, and $5$ independent columns correspond to a spanning tree. $6$ columns always contain a cycle, so they are dependent.
no-f-560 · level facile · notes
In a directed graph with the arcs $(1,2)$, $(2,3)$, $(3,1)$, $(3,4)$, what is the sequence $1,2,3,1,2$?
  1. A directed walk of length $4$, not a path
  2. A directed path of length $4$
  3. A directed cycle
  4. A forbidden sequence, since it repeats arcs
Explanation. Every step follows an arc from tail to head, so it is a directed walk, of $4$ arcs; it repeats nodes $1$ and $2$, so it is not a path, and it does not return to its first node. Walks may repeat arcs.

Part: Trees and paths (112)

2. Minimum spanning trees (54)

no-f-023 · level facile · notes
Kruskal's algorithm for the minimum spanning tree scans the edges by increasing weight and builds a set $F$ of accepted edges. When does it accept the scanned edge $e_k$?
  1. When at least one of its two endpoints is not yet touched by $F$
  2. When it has minimum weight among the edges incident to the current vertex
  3. Always, as long as $F$ has fewer than $n-1$ edges
  4. When its endpoints are in different components of the graph $(V,F)$
Explanation. Kruskal accepts $e_k$ if and only if it joins two components of $(V,F)$, that is, it closes no cycle with $F$. An edge can be accepted even when both endpoints are already touched by $F$.
no-f-024 · level facile · notes
Prim's algorithm grows a tree on the vertices $S$ and keeps a label $d(u)$ for every $u \notin S$. The vertex $v$ enters $S$, and $u \notin S$ is adjacent to $v$ by an edge of weight $w_{vu}$. How is $d(u)$ updated?
  1. $d(u):=w_{vu}$ if $w_{vu}<d(u)$
  2. $d(u):=d(v)+w_{vu}$ if $d(v)+w_{vu}<d(u)$
  3. $d(u):=\max\{d(u),w_{vu}\}$
  4. $d(u):=w_{vu}$ in every case
Explanation. In Prim $d(u)$ is the minimum weight of an edge between $S$ and $u$: the single weight $w_{vu}$ is compared. With $d(v)+w_{vu}$ one gets Dijkstra's algorithm for shortest paths.
no-f-025 · level facile · notes
On a connected undirected graph with $n$ vertices and $m$ edges, what are the running times of Kruskal's algorithm (with a union–find structure) and of Prim's algorithm (labels in an array)?
  1. Kruskal $O(n^2)$, Prim $O(m\log n)$
  2. Kruskal $O(m\log n)$, Prim $O(n^2)$
  3. Kruskal $O(n+m)$, Prim $O(n+m)$
  4. Kruskal $O(n\,m)$, Prim $O(n^2)$
Explanation. Kruskal is dominated by the sorting of the edges, $O(m\log n)$; Prim makes $n-1$ selections, each in $O(n)$, for $O(n^2)$.
no-f-026 · level facile · notes
In a connected undirected graph with edge weights, the edge $e$ of a cycle $C$ is strictly heavier than all the other edges of $C$. What do we conclude on the minimum spanning trees (minimum total weight)?
  1. $e$ belongs to every minimum spanning tree
  2. $e$ belongs to at least one minimum spanning tree
  3. $e$ belongs to no minimum spanning tree
  4. Nothing, without knowing the weights of all the edges
Explanation. Cycle property: the strictly heaviest edge of a cycle is in no minimum spanning tree; removing it from a tree and replacing it with another edge of the cycle lowers the weight.
no-f-027 · level facile · notes
For a set of vertices $S$, the cut $\delta(S)$ is the set of edges with one endpoint in $S$ and one outside. The edge set $F$ is contained in a minimum spanning tree. Which edge can be added to $F$ while staying inside some minimum spanning tree?
  1. An edge of minimum weight among all the edges outside $F$
  2. An edge of minimum weight in a cut $\delta(S)$ with $F \cap \delta(S)=\emptyset$
  3. An edge of minimum weight in any cut $\delta(S)$
  4. An edge of maximum weight in a cycle of the graph
Explanation. Cut property: the lightest edge of a cut not crossed by $F$ extends $F$. If the cut is crossed by $F$ the guarantee is lost; the overall lightest edge may close a cycle with $F$.
no-f-028 · level facile · notes
In an undirected graph, $\delta(S)$ is the cut of the edges with one endpoint in $S$ and one outside. A cycle $C$ contains an edge of $\delta(S)$. What can be said about the number $|C \cap \delta(S)|$ of cycle edges in the cut?
  1. It is even, hence at least $2$
  2. It is exactly $1$
  3. It is odd
  4. It equals $|S|$
Explanation. Walking along the cycle, the side changes at every edge of the cut and the walk ends on the starting side: the crossings are even.
no-f-029 · level facile · notes
When does a connected undirected graph with edge weights have exactly one minimum spanning tree?
  1. Only if the graph itself is a tree
  2. Only if all the weights are positive
  3. Always, since Kruskal and Prim give the same tree
  4. Certainly when the weights are pairwise distinct
Explanation. With distinct weights the minimum spanning tree is unique. With ties other optima may exist, even though Kruskal and Prim return a single one; the sign of the weights does not matter.
no-f-030 · level facile · notes
In a weighted graph, the spanning tree $T$ weighs $20$. The edge $e \notin T$ weighs $5$, and the fundamental cycle of $e$ (the cycle of $T \cup \{e\}$) contains the edges of $T$ of weight $2$, $6$, $3$. What is the weight of the best tree obtained by adding $e$ and removing an edge of the cycle?
  1. $19$
  2. $22$
  3. $23$
  4. $25$
Explanation. By the exchange lemma $T \cup \{e\} \setminus \{f\}$ is a tree for every edge $f$ of the cycle; the best choice removes the heaviest one: $20+5-6=19$. Hence $T$ is not optimal.
no-f-031 · level facile · notes
Let $T$ be a spanning tree of a connected undirected graph. What is the fundamental cut of an edge $e=\{u,v\}$ of $T$?
  1. The set of the edges of $T$ sharing an endpoint with $e$
  2. The cycle created by adding $e$ to the tree $T$
  3. $\delta(S_e)$, where $S_e$ is the component of $T \setminus \{e\}$ that contains $u$
  4. $\delta(\{u\})$, the set of the edges incident to $u$
Explanation. Removing $e$ splits the tree into two components; the fundamental cut is $\delta(S_e)$, the edges of the graph between the two parts, and $e$ is the only edge of $T$ crossing it.
no-f-032 · level facile · notes
How many edges does a minimum spanning tree of a connected undirected graph with $12$ vertices and $30$ weighted edges have?
  1. $12$
  2. $11$
  3. $19$
  4. It depends on the edge weights
Explanation. Every spanning tree of a graph with $n$ vertices has $n-1=11$ edges, whatever the weights.
no-f-033 · level media · notes
In a weighted graph, $T$ is a minimum spanning tree. The edge $e \notin T$ weighs $7$, and the edges of $T$ in its fundamental cycle (the cycle of $T \cup \{e\}$) weigh $3$, $7$, $5$. Which statement is correct?
  1. $T$ is not optimal, because $e$ is not strictly the heaviest of its cycle
  2. $e$ belongs to no minimum spanning tree
  3. Another minimum spanning tree contains $e$
  4. $e$ belongs to every minimum spanning tree
Explanation. The cycle condition holds ($7 \ge 3,7,5$), so $T$ is optimal; but the cycle edge of weight $7$ ties with $e$: exchanging them gives another tree of the same weight containing $e$. Excluding $e$ would require the strict inequality.
no-f-034 · level teorema · notes
Let $T$ be a spanning tree of a connected graph with weights $w$, and for $e \notin T$ let $C(T,e)$ be the fundamental cycle of $e$ (the cycle of $T \cup \{e\}$). Which statement is correct?
  1. $T$ is optimal if and only if $w_e \ge w_f$ for every $e \notin T$ and every edge $f$ of $C(T,e)$
  2. $T$ is optimal if and only if $w_e \le w_f$ for every $e \notin T$ and every edge $f$ of $C(T,e)$
  3. $T$ is optimal if and only if it contains an edge of minimum weight of the graph
  4. $T$ is optimal if and only if $w_e \ge w_f$ for every $e \in T$ and every $f$ in the fundamental cut of $e$
Explanation. Cycle condition: every edge outside $T$ is the heaviest of its fundamental cycle (equivalently, every edge of $T$ is the lightest, not the heaviest, of its fundamental cut). Containing the lightest edge is necessary but not sufficient.
no-f-035 · level teorema · notes
Let $F$ be an edge set contained in a minimum spanning tree, and $\delta(S)$ the cut of the edges with one endpoint in $S$ and one outside. Which statement of the cut property is correct?
  1. For every cut $\delta(S)$, an edge of minimum weight in $\delta(S)$ extends $F$ within an optimal tree
  2. If $F \cap \delta(S)=\emptyset$, an edge of maximum weight in $\delta(S)$ extends $F$ within an optimal tree
  3. If $F \cap \delta(S)=\emptyset$, every edge of $\delta(S)$ extends $F$ within an optimal tree
  4. If $F \cap \delta(S)=\emptyset$ and $e$ has minimum weight in $\delta(S)$, $F \cup \{e\}$ lies in an optimal tree
Explanation. The cut property needs a cut not crossed by $F$ and the lightest edge of that cut. Without the assumption $F \cap \delta(S)=\emptyset$ the statement is false.
no-f-036 · level ipotesi · notes
In the proof of the cut property, the lightest edge $e$ of a cut $\delta(S)$ (not crossed by $F$) is added to an optimal tree $T^\star$ containing $F$ and exchanged with an edge $f$ of $T^\star$. Which results are used?
  1. The rank theorem for the incidence matrix and the correctness of Kruskal
  2. A cycle crosses a cut an even number of times, and the exchange lemma
  3. The lemma «leaves» on trees and the cycle property
  4. The uniqueness of the optimal tree with distinct weights and the correctness of Prim
Explanation. The fundamental cycle $C(T^\star,e)$ crosses $\delta(S)$ at $e$, hence also at another edge $f$, which is not in $F$; by the exchange lemma $T^\star \cup \{e\} \setminus \{f\}$ is a tree, not heavier because $w_e \le w_f$.
no-f-037 · level ipotesi · notes
In Prim's algorithm the label $d(v)$ of a vertex $v \notin S$ is the minimum weight of an edge between $S$ and $v$. To prove that Prim finds a minimum spanning tree, which results are combined?
  1. The cycle property and the rank theorem for the incidence matrix
  2. The correctness of Dijkstra's algorithm and Bellman's equations
  3. The meaning of the labels $d(v)$ and the correctness of the generic greedy algorithm
  4. The uniqueness of the optimal tree with distinct weights and the exchange lemma
Explanation. The labels give the lightest edge of the cut $\delta(S)$, which the current set $F$ does not cross: every step of Prim is a step of the generic greedy, correct by the cut property. Distinct weights are not needed.
no-f-038 · level ipotesi · notes
To prove that, with pairwise distinct weights, a connected graph has only one minimum spanning tree, assume by contradiction that there are two, $T_1 \neq T_2$. Which step is essential?
  1. Exchange the lightest edge $e$ of $T_1 \setminus T_2$ with a heavier edge of the cycle $C(T_2,e)$
  2. Show that Kruskal and Prim, on the same graph, return the same tree
  3. Show that a graph with distinct weights has only one spanning tree
  4. Use the total unimodularity of the incidence matrix of the graph
Explanation. The lightest edge $e$ of the symmetric difference of $T_1$ and $T_2$ lies, say, in $T_1 \setminus T_2$; the cycle $C(T_2,e)$ contains an edge $f \in T_2 \setminus T_1$ with $w_f>w_e$, and the exchange would give a tree lighter than $T_2$.
no-f-039 · level facile · notes
The generic greedy algorithm for the minimum spanning tree starts from $F=\emptyset$. What does it add to $F$ at every step ($\delta(S)$ is the cut of the edges with one endpoint in $S$ and one outside)?
  1. The lightest edge not yet scanned, in every case
  2. Any edge that closes no cycle with $F$
  3. An edge of minimum weight in a cut $\delta(S)$ not crossed by $F$
  4. The heaviest edge of a cycle of the graph
Explanation. The step chooses a cut $\delta(S)$ with $F \cap \delta(S)=\emptyset$ and adds an edge of minimum weight of that cut; Kruskal and Prim are two ways to choose the cut.
no-f-040 · level facile · notes
Prim's algorithm takes $O(n^2)$ time with the labels in an array and $O(m\log n)$ with the labels in a binary heap, on a graph with $n$ vertices and $m$ edges. On which kind of graph is the array better?
  1. On dense graphs, with $m$ of the order of $n^2$
  2. On sparse graphs, with $m$ of the order of $n$
  3. On trees, with $m=n-1$
  4. On no graph: the heap is always faster
Explanation. With $m$ of the order of $n^2$ the heap costs $O(n^2\log n)$ and the array $O(n^2)$, linear in the size of the graph. On sparse graphs, instead, $O(m\log n)$ is better.
no-f-041 · level facile · notes
In the complete graph with vertices $1,2,3,4,5$ (one edge for every pair), how many edges does the cut $\delta(S)$ with $S=\{1,2\}$ have, that is, the edges with one endpoint in $S$ and the other outside?
  1. $2$
  2. $3$
  3. $5$
  4. $6$
Explanation. Every vertex of $S$ is joined to the $3$ vertices outside $S$: $|\delta(S)|=|S|\,(5-|S|)=2 \cdot 3=6$. The edge $\{1,2\}$ is inside $S$ and does not count.
no-f-042 · level facile · notes
Kruskal scans the edges by increasing weight and accepts those that close no cycle with the already accepted edges $F$. On a connected graph with $n=8$ vertices, when can it stop without scanning the other edges?
  1. After scanning $n=8$ edges
  2. As soon as $F$ contains $n-1=7$ edges
  3. As soon as all the vertices are touched by $F$
  4. Never: it must scan all the edges
Explanation. A spanning tree has $n-1$ edges: with $|F|=7$ the graph $(V,F)$ is connected and every other edge would close a cycle. All vertices being touched is not enough, since $F$ may be a forest with several components.
no-f-198 · level facile · notes
The generic greedy algorithm for the minimum spanning tree adds at every step the lightest edge of a cut $\delta(S)$ not crossed by the edges chosen so far. Prim grows a single tree from the start vertex. Which cut does Prim use at every step?
  1. $\delta(S)$, with $S$ the component of an endpoint of the lightest unscanned edge
  2. $\delta(S)$, with $S$ the set of the vertices of the tree built so far
  3. The fundamental cut of the last edge added to the tree
  4. Any cut containing the lightest edge of the graph
Explanation. Prim chooses the lightest edge between the current tree and the rest, that is, of $\delta(S)$ with $S$ the vertices of the tree. The component of an endpoint of the lightest unscanned edge is the cut used by Kruskal.
no-f-199 · level facile · notes
In a connected undirected graph with $n$ vertices and weights $w_e$ of any sign, the same constant $k$ is added to the weight of every edge. What happens to the minimum spanning trees (minimum total weight)?
  1. They stay the same, since every tree grows by $(n-1)\,k$
  2. They change, since trees with more edges grow more
  3. They stay the same only if $k>0$
  4. They stay the same only if after the addition all weights are positive
Explanation. Every spanning tree has exactly $n-1$ edges, so its weight grows by $(n-1)\,k$: the order among the trees does not change, and negative weights are no problem. For shortest paths, instead, the same operation changes the solution.
no-f-260 · level facile · notes
In the minimum spanning tree (MST) problem on a connected undirected graph with weights $w_e$, a spanning tree of maximum weight is wanted instead. How is it obtained?
  1. It cannot be: Kruskal's algorithm works only for the minimum
  2. An MST is found and the lightest edges are removed
  3. An MST is found with weights $1/w_e$
  4. An MST is found with weights $-w_e$
Explanation. Maximizing $\sum w_e$ is the same as minimizing $\sum(-w_e)$, and negative weights are allowed in the MST problem. The weights $1/w_e$ do not preserve the order of the sums and are undefined for $w_e=0$.
no-f-261 · level facile · notes
$n$ offices must be connected by cables; $w_{uv}$ is the cost of the direct cable between offices $u$ and $v$, and two offices communicate if they are joined by a sequence of cables. Which problem gives the cheapest network?
  1. A minimum spanning tree
  2. A shortest path from one office to all the others
  3. A maximum flow between two offices
  4. A minimum cost assignment
Explanation. The network must connect all the vertices at minimum total cost: without cycles (they would be useless cables) it is a minimum spanning tree. The shortest path tree minimizes the distances from a source, not the total cost.
no-f-262 · level facile · notes
In single-linkage clustering, $n$ points are the vertices of a complete graph with weights $w_{uv}$ equal to the distances. How are the points split into $k$ groups with a minimum spanning tree $T$?
  1. The $k-1$ lightest edges are removed from $T$
  2. The $k$ vertices of largest degree in $T$ are taken
  3. The $k-1$ heaviest edges are removed from $T$
  4. Any $k$ edges are removed from $T$
Explanation. Removing $k-1$ edges from a tree leaves $k$ components; removing the heaviest ones keeps nearby points together. Removing the lightest would separate exactly the closest points; removing $k$ edges gives $k+1$ groups.
no-f-263 · level facile · notes
Minimum spanning trees appear as a subproblem of other optimization problems on graphs. For which problem do they give a lower bound (a bound below the optimal value)?
  1. The maximum flow problem
  2. The travelling salesman problem
  3. The shortest path problem
  4. The transportation problem
Explanation. Removing one edge from a Hamiltonian tour gives a spanning tree (a path), so the cost of a minimum spanning tree is a lower bound on the cost of the optimal travelling salesman tour.
no-f-264 · level ipotesi · notes
Theorem: a spanning tree $T$ is minimum if and only if the cycle condition holds ($w_e \ge w_f$ for every $e \notin T$ and every $f$ of the fundamental cycle $C(T,e)$). For (cycle)$\Rightarrow$(optimal) one takes an MST $T^\star$ with the largest number of edges in common with $T$. Which step leads to the contradiction?
  1. An exchange $T^\star \cup \{f\} \setminus \{e\}$ with $w_f \le w_e$ gives an MST with one more edge in common with $T$
  2. One shows that $T^\star$ has fewer than $n-1$ edges
  3. One shows that the weights of $T$ are distinct
  4. Prim's algorithm is applied to $T$
Explanation. With $e \in T^\star \setminus T$ and $f \in T \setminus T^\star$ in the fundamental cut of $e$, the exchange does not increase the weight (cycle condition for $e \notin T$) and increases the common edges: this contradicts the choice of $T^\star$. Distinct weights are not an assumption of the theorem.
no-f-265 · level facile · notes
To certify that a spanning tree $T$ of a weighted graph is minimum with the cycle condition, what is checked?
  1. That $T$ contains the lightest edge of the graph
  2. That every edge of $T$ is lighter than every edge outside $T$
  3. That every edge $e \notin T$ weighs at least as much as every edge of its fundamental cycle $C(T,e)$
  4. That $T$ has $n-1$ edges
Explanation. One check per outside edge is enough: $m-n+1$ fundamental cycles. Every tree edge lighter than every outside edge is sufficient but not necessary; $n-1$ edges only says that $T$ is a tree.
no-f-266 · level facile · notes
In a weighted graph, the spanning tree $T$ weighs $30$. The edge $e \notin T$ weighs $4$, and its fundamental cycle $C(T,e)$ contains the tree edges with weights $3$, $9$, $6$. What is the minimum weight of a tree $T \cup \{e\} \setminus \{f\}$, with $f$ in the cycle?
  1. $31$
  2. $25$
  3. $27$
  4. $28$
Explanation. The heaviest edge of the cycle, $f$ of weight $9$, is removed: $30+4-9=25$. Removing $3$ gives $31$, removing $6$ gives $28$. The improvement shows that $T$ violates the cycle condition.
no-f-267 · level teorema · notes
The generic greedy algorithm for the MST starts from $F=\emptyset$ and adds $n-1$ times the lightest edge of a cut $\delta(S)$ not crossed by $F$. Which statement is correct?
  1. $F$ is a minimum spanning tree only if the weights are distinct
  2. The cut must always be $\delta(\{s\})$ for a fixed vertex $s$
  3. At every iteration $F$ is contained in some minimum spanning tree
  4. The added edge may close a cycle with $F$
Explanation. By the cut property, adding the lightest edge of an uncrossed cut keeps $F$ inside an MST; at the end $|F|=n-1$ and $F$ is an MST, even with equal weights. The edge joins two components of $(V,F)$, so it closes no cycle.
no-f-268 · level ipotesi · notes
In the correctness of the generic greedy algorithm for the MST, why does a nonempty cut $\delta(S)$ not crossed by $F$ exist at every iteration with $|F|<n-1$?
  1. Because the weights are positive
  2. Because $(V,F)$ has at least two components, and $G$ is connected, so the cut of a component $S$ contains edges
  3. Because $F$ is a path
  4. Because every vertex has degree at least $2$
Explanation. A forest with $|F|<n-1$ edges has $n-|F| \ge 2$ components; for a component $S$ no edge of $F$ crosses $\delta(S)$, and $\delta(S) \neq \emptyset$ because $G$ is connected. The sign of the weights does not matter.
no-f-269 · level ipotesi · notes
To prove that Kruskal is correct one shows that every accepted edge $e_k=\{u,v\}$ is the lightest edge of the cut $\delta(S)$, with $S$ the component of $u$ in $(V,F)$. Which fact guarantees it?
  1. The weights are distinct
  2. The graph is complete
  3. $S$ contains vertex $1$
  4. Every edge of $\delta(S)$ examined before $e_k$ would have been accepted, so all edges of $\delta(S)$ come later and weigh at least $w_{e_k}$
Explanation. An edge of $\delta(S)$ examined earlier would have had its endpoints in different components (components only merge) and would have been accepted, crossing $\delta(S)$: absurd. So the edges of $\delta(S)$ follow $e_k$ in the weight order. Equal weights are allowed.
no-f-270 · level facile · notes
Kruskal keeps the components of $(V,F)$ with a union–find structure by labels: every vertex $v$ has a label $\mathit{comp}(v)$, and a merge relabels the vertices of the smaller component. At most how many times is a vertex relabelled?
  1. $\log_2 n$ times
  2. $n-1$ times
  3. Once
  4. $m$ times
Explanation. When a vertex is relabelled, its component joins one at least as large, so its size at least doubles; it never exceeds $n$, so at most $\log_2 n$ relabellings. Without union by size it can be $n-1$.
no-f-271 · level facile · notes
Kruskal on a weighted graph with $n$ vertices and $m$ edges takes $O(m\log n)$ with union–find. Which phase dominates the time?
  1. The merges of the components
  2. The tests $\mathit{comp}(u) \neq \mathit{comp}(v)$
  3. Building the adjacency lists
  4. Sorting the edges by weight
Explanation. Sorting costs $O(m\log m)=O(m\log n)$; the tests cost $O(1)$ each, $O(m)$ in all, and the merges $O(n\log n)$. With a faster union–find the bound stays $O(m\log n)$ because of sorting.
no-f-272 · level facile · notes
Kruskal on the graph with edges and weights $w_{12}=4$, $w_{13}=1$, $w_{23}=3$, $w_{24}=6$, $w_{34}=5$, $w_{35}=8$, $w_{45}=2$ ($w_{uv}$ is the weight of $\{u,v\}$) examines the edges by increasing weight. Which edge is the first to be rejected?
  1. $\{2,3\}$
  2. $\{1,2\}$
  3. $\{2,4\}$
  4. $\{3,5\}$
Explanation. Order: $\{1,3\}$ accepted, $\{4,5\}$ accepted, $\{2,3\}$ accepted, $\{1,2\}$ rejected, because $1$ and $2$ are already in the component $\{1,2,3\}$. $\{2,4\}$ is rejected later, when $\{3,4\}$ has joined everything.
no-f-273 · level facile · notes
Kruskal on a connected graph with $n$ vertices and $m$ edges stops as soon as $|F|=n-1$. Which statement about the edges that are never examined is correct?
  1. There are none: Kruskal always examines all $m$ edges
  2. They are the lightest edges of the graph
  3. They are the heaviest ones, and none of them is needed: the tree is already complete
  4. They are those closing cycles of length $3$
Explanation. The scan goes by increasing weight, so the unexamined edges are those after the last accepted one; with $n-1$ edges the tree is complete. On the weighted reference graph $\{3,5\}$ and $\{4,6\}$ are never examined.
no-f-274 · level facile · notes
In Kruskal every rejected edge $e=\{u,v\}$ has its endpoints already in the same component of $(V,F)$. What can be said about $e$ with respect to the cycle it closes with $F$?
  1. It is the lightest edge of the cycle
  2. The cycle has exactly $3$ edges
  3. It belongs anyway to some minimum spanning tree
  4. It is an edge of maximum weight of the cycle
Explanation. The other edges of the cycle are in $F$, accepted earlier, so not heavier than $e$: $e$ has maximum weight in the cycle, as the cycle property predicts. With distinct weights $e$ is in no MST.
no-f-275 · level facile · notes
Prim from $s=1$ on the graph with weights $w_{12}=4$, $w_{13}=1$, $w_{23}=3$, $w_{24}=6$, $w_{34}=5$, $w_{35}=8$, $w_{45}=2$ ($w_{uv}$ is the weight of $\{u,v\}$) adds at every step the lightest edge between the tree and the rest. Which is the third added edge?
  1. $\{3,4\}$
  2. $\{4,5\}$
  3. $\{1,2\}$
  4. $\{2,4\}$
Explanation. From $\{1\}$: $\{1,3\}$ ($1$); from $\{1,3\}$: $\{2,3\}$ ($3$); from $\{1,2,3\}$ the outgoing edges weigh $6,5,8$: $\{3,4\}$ is added. $\{4,5\}$ is Kruskal's second edge, but Prim reaches it only after $4$.
no-f-276 · level facile · notes
In Prim's algorithm every vertex $v$ outside the tree $S$ has the label $d(v)$, minimum weight of an edge between $S$ and $v$. Vertex $3$ enters $S$; $v \notin S$ has $d(v)=8$ and the edge $\{3,v\}$ weighs $5$. What does $d(v)$ become?
  1. $5$, since $w_{3v}=5<8$
  2. $13$, that is, $d(3)+w_{3v}$
  3. It stays $8$
  4. $3$
Explanation. Prim updates $d(v):=\min\{d(v),w_{3v}\}=5$, with $\mathit{pred}(v)=3$. Adding $d(3)+w_{3v}$ is Dijkstra's update for shortest paths, not Prim's.
no-f-277 · level facile · notes
On a connected graph with distinct weights Kruskal and Prim (from any vertex) are run. What do the two results have in common?
  1. The order in which the edges are added
  2. Nothing: they may give trees of different weight
  3. The number of examined edges
  4. The set of edges of the tree
Explanation. With distinct weights the MST is unique, so both algorithms give the same tree, in a different order: Kruskal grows a forest, Prim a single tree from $s$. On the reference graph $\{4,5\}$ is Kruskal's second edge and Prim's fourth.
no-f-278 · level teorema · notes
Prim's algorithm starts from $S=\{s\}$ and adds at every iteration the lightest edge of $\delta(S)$ (between $S$ and $V \setminus S$). Which statement is correct?
  1. Prim is correct only with nonnegative weights
  2. Prim is a case of the generic greedy algorithm with the cut $\delta(S)$, so it returns a minimum spanning tree
  3. Prim returns the shortest path tree from $s$
  4. Prim's result depends on the vertex $s$ even with distinct weights
Explanation. The cut $\delta(S)$ is not crossed by the chosen edges (they all lie inside $S$), so Prim is an instance of the generic greedy, correct with weights of any sign. With distinct weights the MST is unique and does not depend on $s$; the shortest path tree is a different object.
no-f-279 · level teorema · notes
Let $G$ be a connected undirected graph with edge weights. Which statement about the uniqueness of the minimum spanning tree (MST) is correct?
  1. If the weights are pairwise distinct, the MST is unique; with equal weights it may or may not be
  2. The MST is unique if and only if the weights are distinct
  3. If two edges have the same weight, there are at least two MSTs
  4. The MST is always unique, since Kruskal is deterministic
Explanation. Distinct weights are enough but not necessary: with equal weights the MST is unique if every outside edge is strictly heavier than the others of its fundamental cycle. Kruskal's determinism fixes one tree, it does not exclude others.
no-f-280 · level facile · notes
Let $T$ be an MST. The edge $e \in T$ weighs $5$, and the edges of its fundamental cut (the edges joining the two parts of $T \setminus \{e\}$) other than $e$ weigh $5$, $7$, $9$. What can be said about $e$?
  1. $e$ is in every MST
  2. $e$ is in no MST
  3. $T$ is not an MST
  4. $e$ is in $T$ but there is an MST without $e$
Explanation. Another edge $f$ of the fundamental cut weighs as much as $e$: $T \cup \{f\} \setminus \{e\}$ is a spanning tree of the same weight without $e$. $e$ is in every MST only if it is strictly lighter than all the other edges of the cut.
no-f-281 · level facile · notes
A graph with vertices $1,2,3$ has the edges $\{1,2\}$, $\{2,3\}$, $\{1,3\}$, all of weight $5$. How many minimum spanning trees does it have?
  1. $1$
  2. $3$
  3. $2$
  4. $6$
Explanation. Every pair of edges is a spanning tree of weight $10$, and there are $3$ pairs: three MSTs. With equal weights the uniqueness condition (every outside edge strictly heavier than its cycle) fails.
no-f-282 · level teorema · notes
Let $\delta(S)$ be a cut of a weighted connected graph (edges with one endpoint in $S$ and one outside). Which statement of the cut property is correct?
  1. If $e$ is strictly lighter than every other edge of $\delta(S)$, $e$ is in every MST
  2. The heaviest edge of $\delta(S)$ is in no MST
  3. Every edge of $\delta(S)$ is in some MST
  4. An MST contains exactly one edge of every cut
Explanation. An edge strictly lighter than all others of the cut is in every MST (with ties, only in some MST). The heaviest edge of a cut can be in an MST (if it is the only bridge); an MST can cross a cut several times.
no-f-283 · level facile · notes
Why does a connected undirected graph with weights $w_e$ always have a minimum spanning tree, even with negative weights?
  1. Because it has at least one spanning tree and finitely many of them
  2. Because negative weights can be ignored
  3. Because Prim always stops after $n$ iterations
  4. Because the problem is a maximum flow
Explanation. A connected graph has at least one spanning tree and finitely many, so the minimum exists. Unlike shortest paths, negative weights cause no trouble: a tree has no cycles to traverse repeatedly.
no-f-284 · level facile · notes
A company must connect $5$ plants by roads; the cost $w_{uv}$ of every direct road is known. The minimum spanning tree problem is solved. How many roads will be built?
  1. $5$
  2. $10$
  3. It depends on the costs
  4. $4$
Explanation. A spanning tree on $5$ vertices always has $5-1=4$ edges, whatever the costs. $10$ are all the possible pairs; $5$ would create a cycle, that is, a useless road.
no-f-285 · level teorema · notes
Kruskal's algorithm examines the edges by nondecreasing weight (ties in lexicographic order) and accepts those joining two components of $(V,F)$. Which statement is correct?
  1. Kruskal is correct only if the weights are distinct
  2. Kruskal stops with $|F|=n-1$ and $F$ is a minimum spanning tree
  3. Kruskal may stop with a forest of two trees even if $G$ is connected
  4. Kruskal gives the shortest path tree from vertex $1$
Explanation. Every accepted edge is the lightest of the cut of its component, so Kruskal is a case of the generic greedy: it ends with an MST even with equal weights. On a connected graph it never stops with two components.
no-f-286 · level facile · notes
The weights $w_e$ of a graph are replaced by $w_e^3$ (an increasing transformation). What happens to the tree returned by Kruskal?
  1. It changes, since large weights count more
  2. It stays the same, since Kruskal uses only comparisons between weights
  3. It stays the same only if the weights are positive
  4. It becomes a maximum spanning tree
Explanation. $w^3$ is increasing on all reals, so the order of the edges does not change, and Kruskal depends only on that order. The same holds for every increasing transformation.
no-f-287 · level facile · notes
Kruskal on the graph with weights $w_{12}=2$, $w_{13}=2$, $w_{23}=1$, $w_{34}=3$ ($w_{uv}$ is the weight of $\{u,v\}$; edges of equal weight are examined in lexicographic order) accepts which edges?
  1. $\{2,3\}$, $\{1,2\}$, $\{3,4\}$
  2. $\{2,3\}$, $\{1,3\}$, $\{3,4\}$
  3. $\{1,2\}$, $\{1,3\}$, $\{3,4\}$
  4. $\{2,3\}$, $\{1,2\}$, $\{1,3\}$
Explanation. Order: $\{2,3\}$, then $\{1,2\}$ (before $\{1,3\}$ by the lexicographic rule), accepted; $\{1,3\}$ closes a cycle and is rejected; $\{3,4\}$ accepted. With the other tie rule the second tree, of the same weight, would be obtained.
no-f-288 · level facile · notes
Prim from $s=4$ on the graph with weights $w_{12}=4$, $w_{13}=1$, $w_{23}=3$, $w_{24}=6$, $w_{34}=5$, $w_{45}=2$ ($w_{uv}$ is the weight of $\{u,v\}$) adds at every step the lightest edge between the tree and the rest. In which order do the vertices enter?
  1. $5,3,1,2$
  2. $5,2,3,1$
  3. $3,1,2,5$
  4. $5,3,2,1$
Explanation. From $\{4\}$: $\{4,5\}$ ($2$), $5$ enters; then $\{3,4\}$ ($5$) against $\{2,4\}$ ($6$): $3$ enters; then $\{1,3\}$ ($1$): $1$ enters; finally $\{2,3\}$ ($3$): $2$ enters. The last option adds $2$ before $1$, ignoring the edge of weight $1$.
no-f-289 · level ipotesi · notes
Theorem: with distinct weights the MST is unique. The proof assumes two MSTs $T_1 \neq T_2$ and takes the lightest edge $e$ of their symmetric difference, with $e \in T_1$. What is built?
  1. A negative cycle in $T_1$
  2. A cut with two edges of equal weight
  3. The tree $T_2 \cup \{e\} \setminus \{f\}$, with $f \in T_2 \setminus T_1$ in the cycle $C(T_2,e)$, lighter than $T_2$
  4. A third MST different from both
Explanation. $C(T_2,e)$ has an edge $f \notin T_1$, hence in the symmetric difference and heavier than $e$ (distinct weights); the exchange gives a tree of weight $w(T_2)+w_e-w_f<w(T_2)$, against the optimality of $T_2$. Without distinct weights one would only get $w_f \ge w_e$.
no-f-290 · level teorema · notes
Let $T$ be an MST of a weighted graph. Which statement characterizes the uniqueness of the MST, even with equal weights?
  1. $T$ is the unique MST if and only if the weights of $T$ are distinct
  2. $T$ is the unique MST if and only if no outside edge has the same weight as an edge of $T$
  3. $T$ is the unique MST if and only if every edge $e \notin T$ is strictly heavier than the other edges of $C(T,e)$
  4. $T$ is the unique MST if and only if it is a path
Explanation. An outside edge with a tie in its fundamental cycle gives, by an exchange, another MST; without ties no outside edge is in an MST. Equal weights between edges not in the same fundamental cycle do not matter.
no-f-561 · level teorema · notes
Let $T$ be a spanning tree of a connected graph with weights $w_e$; the fundamental cut of $e \in T$ is the set of edges joining the two parts of $T \setminus \{e\}$. Which condition is equivalent to «$T$ is a minimum spanning tree»?
  1. Every edge $e \in T$ weighs at most as much as every edge of its fundamental cut
  2. Every edge $e \in T$ is the lightest of the whole graph
  3. Every edge $e \notin T$ is lighter than some edge of its fundamental cycle
  4. $T$ contains the $n-1$ lightest edges
Explanation. It is the cut condition, equivalent to the cycle condition and to optimality. The third option describes instead a tree that an exchange can improve; the $n-1$ lightest edges may contain cycles.

3. Shortest paths (58)

no-f-043 · level facile · notes
A directed graph with cycles has lengths $d_{ij}$ on the arcs, one of them negative, and no directed cycle of negative length. Which algorithm correctly computes the distances (lengths of shortest paths) from a node $s$?
  1. Dijkstra's algorithm
  2. The Bellman–Ford algorithm
  3. The algorithm for acyclic graphs
  4. Dijkstra after adding the same positive constant to every length
Explanation. Dijkstra can fail with negative arcs, and adding a constant changes the shortest paths (a path with $k$ arcs grows by $k$ times the constant). The algorithm for acyclic graphs needs a topological order, which does not exist with cycles.
no-f-044 · level facile · notes
On a directed graph with $n$ nodes and $m \ge n-1$ arcs, what are, in order, the running times of Bellman–Ford, Dijkstra (labels in an array) and the algorithm for acyclic graphs?
  1. $O(n^2)$, $O(n\,m)$, $O(n+m)$
  2. $O(n+m)$, $O(n^2)$, $O(n\,m)$
  3. $O(n\,m)$, $O(m\log n)$, $O(n^2)$
  4. $O(n\,m)$, $O(n^2)$, $O(n+m)$
Explanation. Bellman–Ford makes at most $n$ passes of $O(m)$; Dijkstra makes $n$ selections of $O(n)$; in acyclic graphs every arc is scanned once, in topological order.
no-f-045 · level facile · notes
The LP model $\mathrm{SP}(s,t)$ sends one unit of flow from $s$ to $t$ at minimum cost, with lengths $d_{ij}$ and the incidence matrix of the course ($+1$ in the tail, $-1$ in the head). Let $\tilde{d}(i)$ be the distances from $s$. What are the dual constraints and the optimal potentials $\pi_i$?
  1. $\pi_i-\pi_j \le d_{ij}$, with $\pi_i=-\tilde{d}(i)$
  2. $\pi_j-\pi_i \le d_{ij}$, with $\pi_i=-\tilde{d}(i)$
  3. $\pi_i-\pi_j \ge d_{ij}$, with $\pi_i=\tilde{d}(i)$
  4. $\pi_i+\pi_j \le d_{ij}$, with $\pi_i=\tilde{d}(i)$
Explanation. The column of the arc $(i,j)$ has $+1$ at $i$ and $-1$ at $j$, so the dual constraint is $\pi_i-\pi_j \le d_{ij}$, and $\pi_i=-\tilde{d}(i)$ is optimal, up to a constant. The form $\pi_j-\pi_i \le d_{ij}$ with $\pi_i=\tilde{d}(i)$ belongs to the opposite convention.
no-f-046 · level facile · notes
A directed graph has lengths $d_{ij}$ of any sign. The potentials $\vet{\pi}$ are feasible: $\bar{c}_{ij}=d_{ij}-\pi_i+\pi_j \ge 0$ on every arc, with $\pi_s=0$ and $\pi_t=-9$. A path $P$ from $s$ to $t$ has all its arcs tight ($\bar{c}_{ij}=0$). What do we conclude?
  1. $P$ is a shortest path and its length is $d(P)=-9$
  2. $P$ is shortest only if the lengths are non-negative
  3. $P$ is a shortest path and its length is $d(P)=9$
  4. $d(P)=9$, but $P$ may not be a shortest path
Explanation. By the theorem on potentials as optimality certificate $d(P)=\pi_s-\pi_t=0-(-9)=9$, and every other path is at least $9$ long: $P$ is shortest and the graph has no negative cycle. Non-negative lengths are not needed.
no-f-047 · level facile · notes
The Bellman–Ford algorithm from $s$, on a graph with $n$ nodes, computes in pass $k$ the labels $d^k(j)$ from the $d^{k-1}$. The labels still change in pass $n$, that is $d^n \neq d^{n-1}$. What does it mean?
  1. More passes are needed: continue until pass $2n$
  2. A cycle of negative length is reachable from $s$
  3. Some node of the graph is not reachable from $s$
  4. The graph has a cycle, not necessarily negative
Explanation. Without reachable negative cycles $d^{n-1}=d^n=\tilde{d}$, since a path has at most $n-1$ arcs; a change in pass $n$ reveals a negative cycle reachable from $s$, read by following the predecessors backwards.
no-f-048 · level facile · notes
A topological order of a directed graph is a numbering of the nodes in which every arc $(i,j)$ goes from an earlier node to a later one. When does a directed graph have a topological order?
  1. When it is strongly connected
  2. When it has no arc of negative length
  3. Always, sorting the nodes by increasing index
  4. If and only if it has no directed cycle
Explanation. A topological order exists if and only if the graph has no directed cycle: along a cycle the arcs cannot all go forward. The lengths play no role.
no-f-049 · level facile · notes
The single-source model $\mathrm{SP}(s)$ sends one unit of flow from $s$ to every other node at minimum cost. The distances from $s=1$ in a graph with nodes $1,\dots,6$ are $\tilde{d}=(0,5,2,8,10,13)$. What is the optimal value $z(\mathrm{SP}(s))$?
  1. $38$
  2. $13$
  3. $45$
  4. $5$
Explanation. Every node receives its unit along a shortest path: $z(\mathrm{SP}(s))=\sum_{j \in N}\tilde{d}(j)=0+5+2+8+10+13=38$. $13$ is $z(\mathrm{SP}(1,6))$, the distance of node $6$ alone.
no-f-050 · level facile · notes
The LP model $\mathrm{SP}(s,t)$ (one unit of flow from $s$ to $t$, flows $x_{ij} \ge 0$ without upper bounds) is feasible, and the graph has a directed cycle of negative length not reachable from $s$. What can be said about the model?
  1. It has optimal value $\tilde{d}(t)$, since the cycle is not reachable
  2. It is infeasible
  3. It is unbounded
  4. It has an optimum, but not an integer one
Explanation. Adding to a feasible solution multiples of the incidence vector of the cycle keeps feasibility and the cost tends to $-\infty$: a negative cycle anywhere in the graph makes the model unbounded, even though Bellman–Ford from $s$ does not see it.
no-f-051 · level facile · notes
In the Bellman–Ford algorithm from $s$, what does the label $d^k(j)$ computed in pass $k$ represent?
  1. The minimum length of a path from $s$ to $j$ with exactly $k$ arcs
  2. The minimum length of a walk from $s$ to $j$ with at most $k$ arcs
  3. The distance $\tilde{d}(j)$ from $s$, for every pass $k \ge 1$
  4. The number of arcs of a shortest path from $s$ to $j$
Explanation. $d^k(j)$ is the minimum over all walks (which may repeat nodes) with at most $k$ arcs; without reachable negative cycles $d^{n-1}(j)=\tilde{d}(j)$.
no-f-052 · level facile · notes
Dijkstra's algorithm splits the nodes into permanent (final label) and temporary ones. The node $i$ has just become permanent. Which labels are updated right after ($\delta^+(i)$ are the arcs leaving $i$)?
  1. Those of all the successors of $i$, permanent ones included
  2. Those of all the temporary nodes, also those not adjacent to $i$
  3. Those of the temporary nodes with an arc towards $i$
  4. Only those of the temporary heads of the arcs of $\delta^+(i)$
Explanation. The arcs $(i,j) \in \delta^+(i)$ with $j$ temporary are scanned, and $d(j):=d(i)+d_{ij}$ if it improves; the label of a permanent node is final and is not touched again.
no-f-053 · level media · notes
A directed graph has the arcs with lengths $d_{12}=4$, $d_{13}=1$, $d_{32}=2$, $d_{24}=3$, $d_{34}=7$. With the potentials $\vet{\pi}=(\pi_1,\dots,\pi_4)=(0,-3,-1,-6)$, which of the listed arcs has a positive reduced cost $\bar{c}_{ij}=d_{ij}-\pi_i+\pi_j$?
  1. $(1,3)$
  2. $(3,2)$
  3. $(1,2)$
  4. $(2,4)$
Explanation. $\bar{c}_{12}=4-0-3=1$, $\bar{c}_{13}=1-0-1=0$, $\bar{c}_{32}=2+1-3=0$, $\bar{c}_{24}=3+3-6=0$, $\bar{c}_{34}=7+1-6=2$. The tight arcs $(1,3)$, $(3,2)$, $(2,4)$ form the shortest path $1,3,2,4$ of length $\pi_1-\pi_4=6$.
no-f-054 · level teorema · notes
Let (A1) be «every node is reachable from $s$» and (A2) «no negative cycle is reachable from $s$», and $\tilde{d}(j)$ the distances from $s$; $\delta^-(j)$ and $\delta^+(j)$ are the arcs entering and leaving $j$. Under (A1) and (A2), which form of Bellman's equations is correct?
  1. $\tilde{d}(j)=\max_{(i,j) \in \delta^-(j)}\{\tilde{d}(i)+d_{ij}\}$ for $j \neq s$, and $\tilde{d}(s)=0$
  2. $\tilde{d}(j)=\min_{(i,j) \in \delta^-(j)}\{\tilde{d}(i)+d_{ij}\}$ for $j \neq s$, and $\tilde{d}(s)=0$
  3. $\tilde{d}(j)=\min_{(j,k) \in \delta^+(j)}\{\tilde{d}(k)+d_{jk}\}$ for $j \neq s$, and $\tilde{d}(s)=0$
  4. $\tilde{d}(j)=\min_{(i,j) \in \delta^-(j)} d_{ij}$ for $j \neq s$, and $\tilde{d}(s)=0$
Explanation. The distance of $j$ comes from the best predecessor: minimum over $\delta^-(j)$ of $\tilde{d}(i)+d_{ij}$. The maximum is that of the forward pass of the critical path method; the last form recalls Prim's labels.
no-f-055 · level teorema · notes
Dijkstra's algorithm from $s$ makes permanent, at every step, the temporary node with the smallest label $d$; $\tilde{d}$ are the distances from $s$ and $d_{ij}$ the lengths. Which statement on its correctness is correct?
  1. If $d_{ij} \ge 0$ on every arc, every permanent node $i$ has $d(i)=\tilde{d}(i)$
  2. If there are no negative cycles, at the end $d=\tilde{d}$, also with negative arcs
  3. If the graph is acyclic, at the end $d=\tilde{d}$, with lengths of any sign
  4. If $d_{ij} \ge 0$, every temporary node $j$ has $d(j)=\tilde{d}(j)$ at every step
Explanation. The theorem needs non-negative lengths: then the permanent labels are the distances. With a negative arc Dijkstra can fail even without negative cycles or on an acyclic graph; the temporary labels are only the minima over paths with permanent inner nodes.
no-f-056 · level teorema · notes
The Bellman–Ford algorithm from $s$, on a graph with $n$ nodes, computes the labels $d^k$ pass after pass and stops at the first pass $k$ with $d^k=d^{k-1}$. Which statement on its correctness is correct?
  1. If the graph has no cycles, already after the first pass $d^{1}=\tilde{d}$
  2. If no negative cycle is reachable from $s$, it stops after exactly $n$ passes
  3. If the lengths are non-negative, already after two passes $d^{2}=\tilde{d}$
  4. If no negative cycle is reachable from $s$, $d^{n-1}=\tilde{d}$ and it stops at a pass $k \le n$
Explanation. A path has at most $n-1$ arcs, so $d^{n-1}=\tilde{d}$; the algorithm stops at the first pass without changes, which is at most the $n$-th, often earlier. The other claims fail on long paths.
no-f-057 · level ipotesi · notes
The LP model $\mathrm{SP}(s,t)$ sends one unit of flow from $s$ to $t$; its dual $D(\mathrm{SP}(s,t))$ has the constraints $\pi_i-\pi_j \le d_{ij}$ and the objective $\max\,\pi_s-\pi_t$. To prove that $\pi_i=-\tilde{d}(i)$ is optimal for the dual, what is used?
  1. The correctness of Dijkstra and the non-negativity of the lengths $d_{ij}$
  2. The total unimodularity of the incidence matrix and the integrality of the vertices
  3. Bellman's equations, for dual feasibility, and weak duality
  4. The max-flow min-cut theorem applied to the network with capacities $1$
Explanation. Bellman's equations give $\tilde{d}(j) \le \tilde{d}(i)+d_{ij}$, that is $\pi_i-\pi_j \le d_{ij}$; the dual value $\pi_s-\pi_t=\tilde{d}(t)$ equals the cost of the shortest path, so by weak duality both solutions are optimal. The lengths may have any sign.
no-f-058 · level ipotesi · notes
In the proof that the node $i$ made permanent by Dijkstra has $d(i)=\tilde{d}(i)$, one considers a path $P$ from $s$ to $i$ and its first temporary node $h$. Where is the assumption $d_{ij} \ge 0$ on the lengths used?
  1. To guarantee that the graph is acyclic
  2. To say that the part of $P$ after $h$ is at least $0$ long
  3. To guarantee that every node is reachable from $s$
  4. To have a topological order of the nodes
Explanation. The part of $P$ up to $h$ is at least $d(h)$ long and the rest, with non-negative lengths, at least $0$; hence $d(P) \ge d(h) \ge d(i)$, since $i$ has the smallest temporary label.
no-f-059 · level ipotesi · notes
Bellman's equations say $\tilde{d}(s)=0$ and $\tilde{d}(j)=\min_{(i,j) \in \delta^-(j)}\{\tilde{d}(i)+d_{ij}\}$ for $j \neq s$. Let (A1) be «every node is reachable from $s$» and (A2) «no negative cycle is reachable from $s$». What is needed to prove them?
  1. Non-negative lengths and the correctness of Dijkstra's algorithm
  2. An acyclic graph and a topological order of it
  3. A connected graph and the rank theorem for the incidence matrix
  4. (A1), (A2), «walks and paths» and the optimality of subpaths
Explanation. (A1) makes the distances finite and (A2) gives $\tilde{d}(s)=0$; the inequality $\le$ comes from the lemma «walks and paths», the equation from the last arc of a shortest path, whose subpath up to the second-to-last node is shortest.
no-f-060 · level facile · notes
In a directed graph without negative cycles reachable from $s$, the path $P=s,a,b,c,t$ is a shortest path from $s$ to $t$. What can be said about the subpath $s,a,b$?
  1. It is shortest only if the lengths are non-negative
  2. It may be longer than another path from $s$ to $b$
  3. It is a shortest path from $s$ to $b$
  4. It is shortest only if $b$ is the middle node of $P$
Explanation. Lemma «optimality of subpaths»: a shorter path from $s$ to $b$, followed by $b,c,t$, would give a walk from $s$ to $t$ shorter than $P$, hence a shorter path. It holds for lengths of any sign.
no-f-061 · level facile · notes
In a directed graph with $n$ nodes, every node is reachable from $s$ and no negative cycle is reachable from $s$. How many arcs does a shortest path tree have (a tree in which the path from $s$ to every node is a shortest path)?
  1. $n-1$
  2. $n$
  3. As many as the arcs of the graph
  4. It depends on the arc lengths
Explanation. The shortest path tree is a spanning tree: one arc $(\mathit{pred}(j),j)$ for every node $j \neq s$, hence $n-1$ arcs. The lengths decide which arcs, not how many.
no-f-062 · level facile · notes
The labels $d(j)$ of a directed graph with lengths $d_{ij}$ are finite, with $d(s)=0$; for every $j \neq s$ there is a path from $s$ to $j$ of length $d(j)$. Which extra condition guarantees that the $d(j)$ are the distances from $s$?
  1. $d(j) \ge d(i)+d_{ij}$ for every arc $(i,j)$
  2. $d(j) \le d(i)$ for every arc $(i,j)$
  3. $d_{ij} \ge 0$ for every arc $(i,j)$
  4. $d(j) \le d(i)+d_{ij}$ for every arc $(i,j)$
Explanation. Optimality conditions for labels: with $d(j) \le d(i)+d_{ij}$ the potentials $\pi_i=-d(i)$ are feasible and every path from $s$ to $j$ is at least $d(j)$ long; the path of length $d(j)$ is therefore shortest. The sign of the lengths does not matter.
no-f-063 · level facile · notes
On an acyclic directed graph with the nodes numbered in topological order, the algorithm for acyclic graphs scans the nodes in that order and, for every leaving arc $(i,j)$, sets $d(j):=d(i)+d_{ij}$ if it improves. Which lengths does it allow?
  1. Only non-negative lengths, like Dijkstra
  2. Lengths of any sign
  3. Only integer lengths
  4. Negative lengths only on the arcs leaving $s$
Explanation. An acyclic graph has no cycles, hence no negative cycles; when a node is processed all its predecessors are already final, and the label is the distance whatever the sign of the lengths.
no-f-064 · level facile · notes
With the temporary labels in a binary heap, every selection of the minimum and every decrease of a label cost $O(\log n)$. What does Dijkstra's algorithm then cost on a graph with $n$ nodes and $m$ arcs?
  1. $O(n^2)$
  2. $O(n\,m)$
  3. $O((n+m)\log n)$
  4. $O(n+m)$
Explanation. There are at most $n$ selections and at most $m$ decreases, each in $O(\log n)$: $O((n+m)\log n)$, better than $O(n^2)$ (labels in an array) on sparse graphs.
no-f-291 · level facile · notes
A directed graph has the arcs with lengths $d_{12}=7$, $d_{13}=2$, $d_{32}=3$, $d_{24}=3$, $d_{34}=9$. What is the minimum length of a directed path from $1$ to $4$?
  1. $10$
  2. $8$
  3. $11$
  4. $5$
Explanation. The paths from $1$ to $4$ are $1,2,4$ ($10$), $1,3,4$ ($11$) and $1,3,2,4$ ($2+3+3=8$): the minimum is $8$. The path with fewest arcs is not necessarily the shortest.
no-f-292 · level facile · notes
In a directed graph with lengths $d_{ij}$ on the arcs and source $s$, let $\tilde{d}(j)$ be the distance of $j$ (minimum length of a directed path from $s$ to $j$, $+\infty$ if $j$ is not reachable). Node $5$ is not reachable from $s$. What is $\tilde{d}(5)$?
  1. $0$
  2. $-\infty$
  3. It is undefined
  4. $+\infty$
Explanation. By convention the distance of an unreachable node is $+\infty$: there is no path, and the minimum over an empty set of lengths is $+\infty$. $-\infty$ would rather signal a reachable negative cycle.
no-f-293 · level facile · notes
The single-source shortest path problem asks for a shortest directed path from $s$ to every node; the $s$–$t$ problem only from $s$ to one node $t$. How are the two related?
  1. A single-source algorithm solves the $s$–$t$ problem for all $t$ at once
  2. The $s$–$t$ problem is harder, since it fixes the destination
  3. They are equivalent only on acyclic graphs
  4. The single-source problem is solved with $n-1$ separate runs
Explanation. The distances from $s$ to all nodes include the one to $t$, and the algorithms of the chapter (Dijkstra, Bellman–Ford) compute them in one run. $n-1$ runs are not needed.
no-f-294 · level facile · notes
In a directed graph with lengths $d_{ij}$ the length of a walk is the sum of the lengths of its arcs. How long is the walk $1,3,2,4,3,5$ with $d_{13}=2$, $d_{32}=3$, $d_{24}=3$, $d_{43}=1$, $d_{35}=8$?
  1. $5$
  2. $14$
  3. $17$
  4. $13$
Explanation. $2+3+3+1+8=17$. The walk repeats node $3$: removing the cycle $3,2,4,3$ (length $7$) leaves the path $1,3,5$ of length $10$.
no-f-295 · level facile · notes
A negative cycle is a directed cycle of negative total length. The graph has the arcs $(2,3)$, $(3,4)$, $(4,2)$ with $d_{23}=4$, $d_{34}=-6$, $d_{42}=1$. Is it a negative cycle?
  1. Yes: $4-6+1=-1<0$
  2. No: it contains two positive arcs
  3. Yes, because it contains a negative arc
  4. No: a cycle cannot have negative length
Explanation. The sum counts: $4-6+1=-1$, so the cycle is negative. A negative arc alone is not enough (with $d_{42}=3$ the sum would be $1$), and the number of positive arcs does not matter.
no-f-296 · level teorema · notes
Let (A1) «every node is reachable from $s$» and (A2) «no negative cycle is reachable from $s$», in a directed graph with lengths $d_{ij}$. Which statement is correct?
  1. Under (A1) every walk from $s$ to $j$ is longer than a path from $s$ to $j$
  2. Without (A2) the distance $\tilde{d}(j)$ is always $-\infty$ for every $j$
  3. Under (A2), for every walk $W$ from $s$ to $j$ there is a path $P$ from $s$ to $j$ with arcs of $W$ and $d(P) \le d(W)$
  4. Under (A2) every walk is a path
Explanation. Removing from $W$ a cycle, of length $\ge 0$ by (A2), does not lengthen the walk: repeating, a path is reached. Without (A2) a negative cycle makes unbounded only the walks to the nodes reachable from that cycle.
no-f-297 · level facile · notes
A directed graph has a negative cycle $C$ reachable from $s$, and node $j$ is reachable from the cycle. What happens to the lengths of the walks (which may repeat nodes and arcs) from $s$ to $j$?
  1. They are all positive
  2. Their minimum equals $d(C)$
  3. They coincide with the lengths of the paths
  4. They can be negative and arbitrarily large in absolute value
Explanation. Going around $C$ $k$ times shortens the walk by $k\,|d(C)|$, without bound. This is why the algorithms of the chapter, with a reachable negative cycle, detect it instead of computing the distances.
no-f-298 · level ipotesi · notes
Lemma: if no negative cycle is reachable from $s$, every walk $W$ from $s$ to $j$ contains a path $P$ with $d(P) \le d(W)$. The proof removes a cycle $C$ from $W$. Where is the assumption on negative cycles used?
  1. To have $d(C) \ge 0$, hence $d(W)-d(C) \le d(W)$
  2. To guarantee that $W$ has at least one arc
  3. To guarantee that $j$ is reachable from $s$
  4. To have all lengths nonnegative
Explanation. The cycle $C$ is reachable from $s$ along $W$, so $d(C) \ge 0$ and removing it does not lengthen the walk. Single arc lengths may be negative; reachability of $j$ is given by $W$ itself.
no-f-299 · level facile · notes
The directed graph has the cycles $2,4,3,2$ with lengths $d_{24}=3$, $d_{43}=1$, $d_{32}=3$ and $3,5,4,3$ with $d_{35}=8$, $d_{54}=2$, $d_{43}=1$. Which value of $d_{54}$, instead of $2$, makes a cycle negative?
  1. $-3$
  2. $-8$
  3. $-10$
  4. $0$
Explanation. The cycle $3,5,4,3$ has length $8+d_{54}+1$, negative if $d_{54}<-9$: with $-10$ it is $-1$. With $-3$ it is $6$, with $-8$ it is $1$; the cycle $2,4,3,2$ does not use $d_{54}$.
no-f-300 · level facile · notes
With lengths $d_{12}=4$, $d_{13}=1$, $d_{32}=2$, $d_{24}=3$ and labels $d=(0,3,1,6)$ (for nodes $1,\dots,4$), the potentials $\pi_i=-d(i)$ and the reduced costs $\bar{c}_{ij}=d_{ij}-\pi_i+\pi_j$ are used. What is $\bar{c}_{12}$, and what does it indicate?
  1. $1$: the arc $(1,2)$ is not tight and lies on no shortest path
  2. $0$: the arc is tight
  3. $-1$: the labels violate the conditions
  4. $7$: it is the length of the path $1,2$ plus $d(2)$
Explanation. $\bar{c}_{12}=d_{12}+d(1)-d(2)=4+0-3=1>0$: the arc is not tight, and a path using it is longer than the minimum ($2$ is reached with $3$ along $1,3,2$).
no-f-301 · level ipotesi · notes
Theorem: if the potentials $\vet{\pi}$ are feasible ($\bar{c}_{ij}=d_{ij}-\pi_i+\pi_j \ge 0$ on every arc) and all arcs of a path $P$ from $s$ to $t$ are tight ($\bar{c}_{ij}=0$), then $P$ is shortest. Which identity carries the proof?
  1. $d(P)=\sum_{(i,j) \in P}\pi_j$
  2. Bellman's equations $\tilde{d}(j)=\min_i\{\tilde{d}(i)+d_{ij}\}$
  3. Strong duality of linear programming
  4. The telescoping sum $d(Q)=\sum_{(i,j) \in Q}\bar{c}_{ij}+\pi_s-\pi_t$ for every path $Q$ from $s$ to $t$
Explanation. Along a path the potentials cancel: $d(Q) \ge \pi_s-\pi_t=d(P)$ since the reduced costs are $\ge 0$ and those of $P$ are zero. Strong duality is not needed (it is the weak-duality argument), nor knowing the distances.
no-f-302 · level teorema · notes
In a directed graph with lengths $d_{ij}$ there are feasible potentials $\vet{\pi}$, that is, $\bar{c}_{ij}=d_{ij}-\pi_i+\pi_j \ge 0$ on every arc. What can be concluded about cycles?
  1. The graph is acyclic
  2. The graph has no negative cycles, since the length of every cycle is the sum of its reduced costs
  3. The graph has at least one cycle of length zero
  4. Nothing: tight arcs are also needed
Explanation. On a cycle the potentials cancel completely: $d(C)=\sum_{(i,j) \in C}\bar{c}_{ij} \ge 0$. So feasible potentials certify the absence of negative cycles, but the graph may have cycles.
no-f-303 · level facile · notes
The LP model $\mathrm{SP}(s,t)$ of the shortest path uses a flow $x_{ij} \ge 0$ on every arc and the conservation constraints «outflow minus inflow equals $b_i$». Which balances $b_i$ are used?
  1. $b_s=-1$, $b_t=1$, $b_i=0$ elsewhere
  2. $b_s=n-1$, $b_i=-1$ elsewhere
  3. $b_s=1$, $b_t=-1$, $b_i=0$ elsewhere
  4. $b_i=0$ for every node
Explanation. A path from $s$ to $t$ sends one unit: it leaves $s$ ($b_s=1$) and enters $t$ ($b_t=-1$), the other nodes pass it on. $b_s=n-1$ is the single-source model; the first option reverses the signs.
no-f-304 · level facile · notes
In the LP model $\mathrm{SP}(s,t)$ ($\min \sum d_{ij}x_{ij}$, flow conservation with $b_s=1$, $b_t=-1$, $x \ge 0$), what is the incidence vector $\vet{x}^P$ of a path $P$ from $s$ to $t$?
  1. $x^P_{ij}=1$ on the arcs of $P$, $0$ elsewhere: a feasible solution of value $d(P)$
  2. $x^P_{ij}=d_{ij}$ on the arcs of $P$
  3. A dual solution of the model
  4. $x^P_{ij}=1$ on all arcs leaving the nodes of $P$
Explanation. Sending the unit along $P$ respects conservation at every node, and the cost is $\sum_{(i,j) \in P}d_{ij}=d(P)$. The dual solutions are the potentials $\pi_i$.
no-f-305 · level facile · notes
The LP model $\mathrm{SP}(s,t)$ is written in matrix form as $\min\{\vet{d}'\vet{x} : \mat{B}\vet{x}=\vet{b},\ \vet{x} \ge \vet{0}\}$. What is $\mat{B}$?
  1. The adjacency matrix of the graph
  2. The matrix of the lengths $d_{ij}$
  3. An $n \times n$ identity matrix
  4. The node–arc incidence matrix, with $+1$ in the tail and $-1$ in the head of every arc
Explanation. The conservation constraints are one row per node: row $i$ of $\mat{B}\vet{x}$ is the outflow minus the inflow of $i$. The adjacency matrix is $n \times n$ and does not give the constraints.
no-f-306 · level ipotesi · notes
The LP model $\mathrm{SP}(s,t)$ has fractional feasible solutions (for instance half a unit on two paths). Why is its optimal value nevertheless the length of a shortest path?
  1. Because the solver always rounds the solution
  2. Because the incidence vector of a shortest path and the potentials $\pi_i=-\tilde{d}(i)$ have the same value, optimal by weak duality
  3. Because fractional flows violate conservation
  4. Because the graph is acyclic
Explanation. Under (A1)–(A2) $\vet{x}^P$ of a shortest path is primal feasible with value $\tilde{d}(t)$, and $\pi_i=-\tilde{d}(i)$ is dual feasible with value $\pi_s-\pi_t=\tilde{d}(t)$: equal values, so both optimal. Fractional solutions exist but are not better.
no-f-307 · level teorema · notes
Let (A1) «every node is reachable from $s$» and (A2) «no negative cycle is reachable from $s$». Which statement about the LP model $\mathrm{SP}(s,t)$ and its dual $\max\{\pi_s-\pi_t : \pi_i-\pi_j \le d_{ij}\}$ is correct?
  1. Under (A1)–(A2) $z(\mathrm{SP}(s,t))=\tilde{d}(t)$ and $\pi_i=-\tilde{d}(i)$ is optimal for the dual
  2. The dual is always unbounded
  3. $z(\mathrm{SP}(s,t))=\tilde{d}(t)$ even with a reachable negative cycle
  4. The dual has optimum $\pi_i=\tilde{d}(i)$
Explanation. With the course's signs the optimal potentials are $\pi_i=-\tilde{d}(i)$: $\pi_s-\pi_t=\tilde{d}(t)$ and $\pi_i-\pi_j \le d_{ij}$ is $\tilde{d}(j) \le \tilde{d}(i)+d_{ij}$. With a reachable negative cycle (and $t$ reachable from it) the primal is unbounded.
no-f-308 · level facile · notes
In the single-source model $\mathrm{SP}(s)$ the source sends one unit to each of the other $n-1$ nodes ($b_s=n-1$, $b_i=-1$). What is the optimal value, if (A1) and (A2) hold?
  1. $\max_j \tilde{d}(j)$
  2. $(n-1)\,\tilde{d}(t)$
  3. $\sum_{j \in N}\tilde{d}(j)$
  4. $\sum_{(i,j) \in A} d_{ij}$
Explanation. The optimal flow is the sum of the incidence vectors of the $n-1$ paths of the shortest path tree, so it costs $\sum_j \tilde{d}(j)$. It is neither the largest distance nor the sum of all lengths.
no-f-309 · level facile · notes
In the shortest path tree from $s=1$ of a graph with $5$ nodes, the arc $(1,3)$ leads to nodes $3$, $2$ and $4$ (their tree paths pass through $3$). In the optimal solution of the model $\mathrm{SP}(s)$ ($b_1=4$, $b_i=-1$ elsewhere), what is $x_{13}$?
  1. $1$
  2. $3$
  3. $4$
  4. $\tilde{d}(3)$
Explanation. On a tree arc $(i,j)$ one unit passes for every node of $T_j$, the set of nodes whose path passes through $j$: here $T_3=\{3,2,4\}$, so $x_{13}=3$. $1$ is the value in the model $\mathrm{SP}(s,t)$.
no-f-310 · level ipotesi · notes
Proposition: the flow $x_{ij}=|T_j|$ on the arcs of a shortest path tree is optimal for $\mathrm{SP}(s)$ and $\pi_i=-\tilde{d}(i)$ for its dual. Which tool concludes the proof once the two solutions are shown feasible with the same value?
  1. Weak duality
  2. Total unimodularity of $\mat{B}$
  3. Dijkstra's algorithm
  4. The max-flow min-cut theorem
Explanation. A feasible primal and a feasible dual solution with the same value are both optimal by weak duality. Total unimodularity guarantees integer vertices, but here optimality is proved directly.
no-f-311 · level facile · notes
A topological order of a directed graph is an ordering of the nodes in which every arc goes from an earlier node to a later one. The graph has the arcs $(1,3)$, $(3,2)$, $(1,2)$, $(2,4)$. Which ordering is topological?
  1. $1,2,3,4$
  2. $3,1,2,4$
  3. $1,2,4,3$
  4. $1,3,2,4$
Explanation. One needs $1$ before $3$ and $2$, $3$ before $2$, $2$ before $4$: only $1,3,2,4$. In $1,2,3,4$ the arc $(3,2)$ goes backward.
no-f-312 · level teorema · notes
The algorithm for acyclic graphs examines the nodes in topological order and, for every outgoing arc $(i,j)$, sets $d(j):=d(i)+d_{ij}$ if it improves. Which statement is correct?
  1. It works only with nonnegative lengths
  2. It takes time $O(n^2)$ like Dijkstra
  3. It works with lengths of any sign and takes time $O(n+m)$
  4. It also works on graphs with cycles, if the lengths are positive
Explanation. When $i$ is examined all its predecessors are already final (the topological order puts them first), so $d(i)=\tilde{d}(i)$ whatever the sign of the lengths; every arc is examined once. A graph with cycles has no topological order.
no-f-313 · level facile · notes
The acyclic graph with nodes in topological order $1,2,3,4$ has the arcs with lengths $d_{12}=2$, $d_{13}=5$, $d_{23}=-4$, $d_{24}=6$, $d_{34}=1$. What is the distance $\tilde{d}(4)$ from $s=1$?
  1. $6$
  2. $-1$
  3. $8$
  4. $3$
Explanation. In topological order: $d(2)=2$, $d(3)=\min\{5,2-4\}=-2$, $d(4)=\min\{2+6,-2+1\}=-1$. $6$ ignores the negative arc (it goes through $1,3,4$), $8$ uses $1,2,4$.
no-f-314 · level facile · notes
Bellman–Ford computes, in pass $k$, $d^k(j)=\min\{d^{k-1}(j),\ \min_{(i,j)}\{d^{k-1}(i)+d_{ij}\}\}$. With $d^2(2)=5$, $d^2(5)=10$, $d^2(4)=10$ and the arcs entering $4$ $(2,4)$ with $d_{24}=3$ and $(5,4)$ with $d_{54}=-3$, what is $d^3(4)$?
  1. $10$
  2. $8$
  3. $2$
  4. $7$
Explanation. $d^3(4)=\min\{10,\ 5+3,\ 10-3\}=\min\{10,8,7\}=7$, with predecessor $5$. $8$ forgets the arc $(5,4)$; $2=d^2(2)-3$ attaches the length of $(5,4)$ to the wrong node.
no-f-315 · level facile · notes
On a graph with $n=6$ nodes, Bellman–Ford from $s$ produces in pass $5$ the same labels as in pass $4$ ($d^5=d^4$). What does the algorithm do?
  1. It stops: the labels are the distances, since from now on they would not change
  2. It runs pass $6$ anyway to check for negative cycles
  3. It declares a negative cycle
  4. It restarts from $d^0$ with another source
Explanation. Each pass depends only on the previous one, so $d^5=d^4$ implies $d^k=d^4$ for every $k \ge 4$: no negative cycle, and $d^4=\tilde{d}$. In the notes' example it stops after $5$ passes instead of $6$.
no-f-316 · level facile · notes
On a graph with $n=6$ nodes, Bellman–Ford from $s$ runs all $n$ passes, and in pass $6$ a label still decreases ($d^6 \neq d^5$). What is concluded?
  1. That more passes are needed to converge
  2. That the graph is not connected
  3. That there is a negative cycle reachable from $s$
  4. That the labels $d^6$ are the distances
Explanation. Without reachable negative cycles shortest paths have at most $n-1$ arcs and $d^{n-1}=d^n$. An improvement in pass $n$ certifies a negative cycle, found by tracing back the predecessors.
no-f-317 · level ipotesi · notes
Theorem: if in pass $n$ of Bellman–Ford a label changes, there is a negative cycle reachable from $s$. Which fact, valid without reachable negative cycles, makes the test correct?
  1. The lengths are nonnegative
  2. Every shortest path has at most $n-1$ arcs, and $d^k(j)$ is the minimum length of a walk with at most $k$ arcs
  3. The graph has a topological order
  4. Every node has at most $n-1$ incoming arcs
Explanation. $d^k(j)$ is the shortest walk with at most $k$ arcs; without reachable negative cycles the minimum is attained by a path, with at most $n-1$ arcs, so $d^n=d^{n-1}$. Bellman–Ford requires neither nonnegative lengths nor acyclicity.
no-f-318 · level facile · notes
Dijkstra from $s=1$ with $d_{12}=7$, $d_{13}=2$, $d_{32}=3$, $d_{24}=3$, $d_{35}=8$, $d_{54}=2$, $d_{46}=5$, $d_{56}=7$, $d_{43}=1$ makes permanent at every step the temporary node with the smallest label. In which order do the nodes become permanent?
  1. $1,3,2,4,5,6$
  2. $1,3,5,2,4,6$
  3. $1,2,3,4,5,6$
  4. $1,3,2,5,4,6$
Explanation. Labels: after $1$, $d(2)=7$, $d(3)=2$; after $3$, $d(2)=5$, $d(5)=10$; after $2$, $d(4)=8$; after $4$, $d(6)=13$; then $5$ ($10$) and $6$ ($13$). Order $1,3,2,4,5,6$ with $\tilde{d}=(0,5,2,8,10,13)$.
no-f-319 · level facile · notes
In Dijkstra the node $i$ just made permanent has $d(i)=10$; the arc $(i,j)$ has $d_{ij}=7$ and the temporary node $j$ has $d(j)=13$. What does the algorithm do on $j$?
  1. It sets $d(j):=17$ and $\mathit{pred}(j):=i$
  2. It sets $d(j):=7$
  3. It leaves $d(j)=13$, since $10+7=17>13$
  4. It makes $j$ permanent right away
Explanation. The update is $d(j):=\min\{d(j),d(i)+d_{ij}\}=\min\{13,17\}=13$: no change. Setting $d(j):=d_{ij}$ is Prim's update.
no-f-320 · level facile · notes
At the end of Dijkstra from $s$ (nonnegative lengths), what do the arcs $(\mathit{pred}(j),j)$ of the reachable nodes $j \neq s$ form?
  1. A minimum spanning tree
  2. A shortest path tree from $s$
  3. A path touching all the nodes
  4. The set of tight arcs, which may contain cycles
Explanation. Every $\mathit{pred}(j)$ gives the last arc of a shortest path to $j$, and the arcs form a tree rooted at $s$ whose paths are shortest. It is not in general a minimum spanning tree (Prim and Dijkstra differ).
no-f-321 · level ipotesi · notes
The proof of correctness of Dijkstra uses $d_{ij} \ge 0$ in a single place. Which one?
  1. To guarantee that every node is reachable from $s$
  2. To guarantee that the graph is acyclic
  3. To say that the part of a path after its first temporary node has length $\ge 0$
  4. To bound the time by $O(n^2)$
Explanation. The path $P$ to the selected node $i$ leaves the permanent nodes at a temporary node $h$ with $d(h) \ge d(i)$; the rest of $P$ has length $\ge 0$ only if lengths are nonnegative. A negative arc breaks exactly this step.
no-f-322 · level facile · notes
In the graph with arcs $d_{12}=2$, $d_{13}=3$, $d_{32}=-2$ and $s=1$, Dijkstra makes $2$ permanent with $d(2)=2$, then $3$ with $d(3)=3$, and ignores the arc $(3,2)$ because $2$ is already permanent. What is the true distance $\tilde{d}(2)$?
  1. $1$
  2. $2$
  3. $-2$
  4. $5$
Explanation. The path $1,3,2$ has length $3-2=1<2$: Dijkstra fails because it made $2$ permanent before seeing the negative arc. Bellman–Ford, which allows negative lengths, finds $\tilde{d}(2)=1$.
no-f-323 · level facile · notes
A directed graph has some negative lengths but no negative cycle, and the distances from $s$ are wanted. Which algorithm of the notes is used if the graph has cycles?
  1. Dijkstra, since without negative cycles it is correct
  2. The algorithm for acyclic graphs
  3. Prim
  4. Bellman–Ford
Explanation. Dijkstra can fail with a single negative arc, even without negative cycles; the algorithm for acyclic graphs needs a topological order, which does not exist if the graph has cycles. Bellman–Ford allows negative lengths and detects negative cycles.
no-f-324 · level facile · notes
At the end of Bellman–Ford from $s=1$ (no negative cycles) the predecessors are $\mathit{pred}(2)=3$, $\mathit{pred}(3)=1$, $\mathit{pred}(4)=5$, $\mathit{pred}(5)=3$, $\mathit{pred}(6)=4$. What is the shortest path from $1$ to $6$?
  1. $1,3,2,4,6$
  2. $1,3,5,4,6$
  3. $1,2,4,6$
  4. $6,4,5,3,1$
Explanation. Trace back the predecessors: $6,4,5,3,1$, and read the path backwards: $1,3,5,4,6$. The last option is the predecessor sequence not reversed.
no-f-325 · level facile · notes
In Dijkstra from $s$ (nonnegative lengths) a node is temporary until it is chosen, then permanent. When an arc $(i,j)$ leaving the just-chosen node $i$ ends at an already permanent node $j$, what does the algorithm do?
  1. It updates $d(j)$ if $d(i)+d_{ij}<d(j)$
  2. It makes $j$ temporary again
  3. It declares a negative cycle
  4. It ignores it: the label of $j$ is already final
Explanation. With nonnegative lengths $d(j) \le d(i) \le d(i)+d_{ij}$ for a permanent node $j$, so the arc cannot improve it and is ignored. With negative arcs this is exactly where Dijkstra fails.
no-f-497 · level ipotesi · notes
Proposition: if no negative cycle is reachable from $s$, at the end of Bellman–Ford the arcs $(\mathit{pred}(j),j)$ form a shortest path tree. The proof shows that every arc $(p,j)$ with $p=\mathit{pred}(j)$ is tight, $d(j)=d(p)+d_{pj}$. Which fact gives the inequality $d(j) \ge d(p)+d_{pj}$?
  1. The lengths are nonnegative
  2. In the pass where $d(j)$ last decreased it was $d^{k-1}(p)+d_{pj}$, and labels never increase
  3. The graph is acyclic
  4. Every node has a single incoming arc
Explanation. When $j$ got the predecessor $p$, $d(j)=d^{k-1}(p)+d_{pj} \ge d(p)+d_{pj}$ since $d(p)$ can only decrease afterwards; the other inequality comes from Bellman's equations. Bellman–Ford allows negative lengths and cycles.

Part: Flows (225)

4. Network flow models (52)

no-f-065 · level facile · notes
In a flow network every node $i$ has a balance $b_i$, and flow conservation requires outflow minus inflow equal to $b_i$. Node $i$ has balance $b_i=-4$. What kind of node is it?
  1. A supply node
  2. A transshipment node
  3. A demand node
  4. A dummy node
Explanation. $b_i>0$ means a supply node, $b_i<0$ a demand node, $b_i=0$ a transshipment node: with $b_i=-4$ the node must receive $4$ net units.
no-f-066 · level facile · notes
In a flow network, two arcs leave node $i$ with flows $3$ and $2$, and one arc enters $i$ with flow $4$. Conservation requires outflow minus inflow equal to the balance $b_i$. For which $b_i$ does conservation hold at $i$?
  1. $b_i=1$
  2. $b_i=-1$
  3. $b_i=9$
  4. $b_i=0$
Explanation. Outflow minus inflow: $3+2-4=1=b_i$. The opposite sign comes from swapping outflow and inflow, $9$ from adding all the flows.
no-f-067 · level facile · notes
A network with balances $b_i$, capacities $u_{ij}$ and zero lower bounds is balanced, that is $\sum_{i \in N} b_i=0$ (total supply equal to total demand). What can be said about its set of feasible flows?
  1. It is always nonempty
  2. It is nonempty if all the capacities are positive
  3. It always contains the zero flow
  4. It may be empty: balance is necessary, not sufficient
Explanation. A network with a feasible flow is balanced, but not conversely: a cut may have too little capacity to carry out the supply of the nodes inside it (cut condition). The zero flow is feasible only with $\vet{b}=\vet{0}$.
no-f-068 · level facile · notes
In a network without lower bounds, the node set $S$ has total balance $\sum_{i \in S} b_i=7$ (net supply to be carried out of $S$), and the arcs leaving $S$ have total capacity $5$. What do we conclude?
  1. Every feasible flow sends exactly $5$ units out of $S$
  2. The network has no feasible flow
  3. The network is not balanced
  4. A dummy node must be added inside $S$
Explanation. The cut condition requires $\sum_{i \in S} b_i \le u(\delta^+(S))-l(\delta^-(S))=5-0$: with $7>5$ no feasible flow exists.
no-f-069 · level facile · notes
The minimum cost flow model $\mathrm{MCF}$ has bounds $\vet{l} \le \vet{x} \le \vet{u}$ and costs $\vet{c}$. The substitution $\vet{x}=\vet{l}+\vet{x}'$ gives an equivalent model with zero lower bounds. How are the optimal values of the two models related?
  1. They are equal
  2. They differ by the constant $\vet{c}'\vet{u}$
  3. They differ by the constant $\vet{c}'\vet{l}$
  4. The second is only a lower bound on the first
Explanation. $\vet{c}'\vet{x}=\vet{c}'\vet{x}'+\vet{c}'\vet{l}$ for every flow: the optimal solutions correspond and the values differ by the constant $\vet{c}'\vet{l}$, which must be added back at the end.
no-f-070 · level facile · notes
An unbalanced minimum cost flow instance has supply nodes with $b=5$ and $b=4$ and demand nodes with $b=-3$ and $b=-4$: supply exceeds demand. A dummy node $d$ is added, with an arc $(i,d)$ from every supply node. What are the balance $b_d$ and the cost of the arcs $(i,d)$?
  1. $b_d=-2$, arcs of cost $0$
  2. $b_d=2$, arcs of cost $0$
  3. $b_d=-2$, arcs costing the largest cost
  4. $b_d=-9$, arcs of cost $0$
Explanation. The excess is $e=5+4-3-4=2$; the dummy node has $b_d=-e=-2$ and receives the unused supply along zero-cost arcs. A positive cost would charge the unused supply.
no-f-071 · level facile · notes
When is an integer matrix $\mat{M}$ (not necessarily square) called totally unimodular?
  1. When it is square with determinant $\pm 1$
  2. When every entry is $0$, $+1$ or $-1$
  3. When it has full row rank
  4. When every square submatrix has determinant $0$, $+1$ or $-1$
Explanation. The definition concerns all the square submatrices, of every order $k \ge 1$. Entries in $\{0,\pm 1\}$ are only the case $k=1$, and they are not enough.
no-f-072 · level facile · notes
A network has integer balances, lower bounds and (finite) capacities and fractional costs, and the minimum cost flow LP model $\mathrm{MCF}$ is feasible. What can be said about its optimal solutions?
  1. An integer one exists only if the costs are integer too
  2. An integer one exists, whatever the costs
  3. They are all integer, whatever the costs
  4. Branch-and-bound is needed to find an integer one
Explanation. The incidence matrix is totally unimodular: with integer $\vet{b}$, $\vet{l}$, $\vet{u}$ every vertex is integer, and the minimum is attained at a vertex. The costs do not matter; non-integer optima may also exist (between two optimal vertices).
no-f-073 · level facile · notes
With potentials $\pi$ on the nodes, the reduced cost of the arc $(i,j)$, with tail $i$ and head $j$, is $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. The arc has cost $c_{ij}=4$, and $\pi_i=10$, $\pi_j=7$. What is $\bar{c}_{ij}$?
  1. $1$
  2. $7$
  3. $-1$
  4. $21$
Explanation. $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=4-10+7=1$: $-\pi$ of the tail and $+\pi$ of the head. With the signs swapped one gets $7$.
no-f-074 · level facile · notes
In the minimum cost flow model with $\vet{0} \le \vet{x} \le \vet{u}$, let $\vet{x}$ be a feasible flow and $\vet{\pi}$ potentials, with reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. Which condition on every arc certifies that $\vet{x}$ is optimal?
  1. $\bar{c}_{ij}>0 \Rightarrow x_{ij}=u_{ij}$ and $\bar{c}_{ij}<0 \Rightarrow x_{ij}=0$
  2. $\bar{c}_{ij} \ge 0$ on every arc, whatever the flow $\vet{x}$
  3. $\bar{c}_{ij}>0 \Rightarrow x_{ij}=0$ and $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$
  4. $x_{ij}>0 \Rightarrow \bar{c}_{ij}>0$ and $x_{ij}=0 \Rightarrow \bar{c}_{ij}<0$
Explanation. Arcs with positive reduced cost must be empty, arcs with negative reduced cost saturated: this is the reduced cost certificate, with $\alpha_{ij}=\max\{0,-\bar{c}_{ij}\}$ in the dual.
no-f-075 · level facile · notes
The minimum cost flow model $\mathrm{MCF}$ (balances, capacities and costs on a directed graph) has many special cases. Which of these problems is not a special case of $\mathrm{MCF}$ in the course?
  1. The shortest path from $s$ to $t$
  2. The minimum spanning tree
  3. The maximum flow from $s$ to $t$
  4. The transportation problem
Explanation. Shortest path, maximum flow, transportation and assignment are $\mathrm{MCF}$ models with special balances, capacities and costs; the minimum spanning tree is a problem on undirected graphs, solved by Kruskal and Prim.
no-f-076 · level media · notes
A network with nodes $1,\dots,6$ has balances $\vet{b}=(5,2,0,-3,0,-4)$ and a single positive lower bound, $l_{32}=1$ on the arc $(3,2)$. With the substitution $\vet{x}=\vet{l}+\vet{x}'$ the lower bounds become zero. What are the new balances $\vet{b}'=\vet{b}-\mat{B}\vet{l}$ ($\mat{B}$: $+1$ in the tail, $-1$ in the head)?
  1. $(5,1,1,-3,0,-4)$
  2. $(5,2,0,-3,0,-4)$
  3. $(5,3,1,-3,0,-4)$
  4. $(5,3,-1,-3,0,-4)$
Explanation. The tail $3$ has already sent $l_{32}=1$ and the head $2$ has already received it: $b'_3=0-1=-1$, $b'_2=2+1=3$. The other options swap the signs, forget an endpoint or ignore the bound.
no-f-077 · level teorema · notes
Let $\mat{B}$ be the node–arc incidence matrix of a directed graph with $n$ nodes and $m$ arcs (every column has one $+1$ in the tail and one $-1$ in the head). Which statement on the total unimodularity of $\mat{B}$ is correct?
  1. $\mat{B}$ is totally unimodular only if the graph is acyclic
  2. $\mat{B}$ is totally unimodular for every directed graph
  3. $\mat{B}$ is totally unimodular only if the graph is bipartite
  4. $\mat{B}$ is totally unimodular only if $n=m$ and $\det(\mat{B})=\pm 1$
Explanation. Every column of $\mat{B}$ has one $+1$ and one $-1$, and by induction every square submatrix has determinant $0$ or $\pm 1$, whatever the directed graph. $\mat{B}$ is $n \times m$, in general not square.
no-f-078 · level teorema · notes
Let $\vet{x}$ be a vector satisfying flow conservation, $\mat{B}\vet{x}=\vet{b}$, and $\vet{\pi} \in \R^n$ potentials, with reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. Which identity is correct?
  1. $\sum_{(i,j) \in A} c_{ij}x_{ij}=\sum_{(i,j) \in A} \bar{c}_{ij}x_{ij}+\sum_{i \in N} b_i\pi_i$
  2. $\sum_{(i,j) \in A} c_{ij}x_{ij}=\sum_{(i,j) \in A} \bar{c}_{ij}x_{ij}-\sum_{i \in N} b_i\pi_i$
  3. $\sum_{(i,j) \in A} c_{ij}x_{ij}=\sum_{(i,j) \in A} \bar{c}_{ij}x_{ij}$
  4. $\sum_{(i,j) \in A} \bar{c}_{ij}x_{ij}=\sum_{i \in N} b_i\pi_i$
Explanation. From $c_{ij}=\bar{c}_{ij}+\pi_i-\pi_j$ and conservation, $\sum(\pi_i-\pi_j)x_{ij}=\sum_i \pi_i b_i$: the cost is the reduced cost plus $\vet{b}'\vet{\pi}$.
no-f-079 · level ipotesi · notes
The polyhedron of feasible flows is $\{\vet{x} : \mat{B}\vet{x}=\vet{b},~\vet{l} \le \vet{x} \le \vet{u}\}$, with $\mat{B}$ the incidence matrix and $\vet{b}$, $\vet{l}$, $\vet{u}$ integer. In the proof that its vertices are integer, which steps are needed?
  1. The max-flow min-cut theorem and the Ford–Fulkerson algorithm
  2. The network simplex and Phase 0 with the artificial arcs
  3. Independent columns for the arcs between bounds, Cramer and total unimodularity
  4. Strong duality and complementary slackness
Explanation. At a vertex the columns of the arcs with $l_a<\bar{x}_a<u_a$ are independent; the reduced system has integer data, and by Cramer's rule each entry is $\det(\mat{M}_a)/\det(\mat{M})$ with $\det(\mat{M})=\pm 1$ by total unimodularity.
no-f-080 · level ipotesi · notes
The lemma «flow across a cut» says: if $\vet{x}$ satisfies conservation, $x(\delta^+(S))-x(\delta^-(S))=\sum_{i \in S} b_i$ for every node set $S$. To prove that a network with a feasible flow is balanced ($\sum_i b_i=0$), what suffices?
  1. The lemma «flow across a cut» with $S=N$
  2. The total unimodularity of the incidence matrix
  3. The cut condition for every set $S$
  4. The max-flow min-cut theorem
Explanation. With $S=N$ no arc leaves or enters $S$, so $\sum_{i \in N} b_i=0$; equivalently, the rows of the incidence matrix add up to zero.
no-f-081 · level ipotesi · notes
For the $\mathrm{MCF}$ model with $\vet{0} \le \vet{x} \le \vet{u}$, the dual has variables $\pi_i$ and $\alpha_{ij} \ge 0$ and constraints $\pi_i-\pi_j-\alpha_{ij} \le c_{ij}$. The duality gap is $\sum(\bar{c}_{ij}+\alpha_{ij})x_{ij}+\sum\alpha_{ij}(u_{ij}-x_{ij})$, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. Why is it non-negative?
  1. Because the costs $c_{ij}$ are non-negative
  2. Because the incidence matrix is totally unimodular
  3. Because the potentials are normalized with $\pi_n=0$
  4. Because of the dual constraints, of $\alpha_{ij} \ge 0$ and of $0 \le x_{ij} \le u_{ij}$
Explanation. The dual constraint gives $\bar{c}_{ij}+\alpha_{ij} \ge 0$; with $\alpha_{ij} \ge 0$ and the bounds of the primal flow all terms are non-negative. Neither non-negative costs nor a normalization are needed.
no-f-082 · level facile · notes
A flow vector $\vet{x}$ satisfies conservation at every node (outflow minus inflow equal to the balance $b_i$). For a node set $S$ with $\sum_{i \in S} b_i=6$, what is $x(\delta^+(S))-x(\delta^-(S))$, the flow leaving $S$ minus the flow entering it?
  1. $0$
  2. $6$
  3. $-6$
  4. It depends on the arc capacities
Explanation. Adding up the conservation equations of the nodes of $S$ the inner arcs cancel: the net outflow of $S$ is the total balance of its nodes, $6$.
no-f-083 · level facile · notes
In the LP model $\mathrm{MCF}$ of the minimum cost flow on a network $G=(N,A)$ with balances, lower bounds, capacities and costs, how many variables and how many conservation constraints are there?
  1. One variable per node and one constraint per arc
  2. One variable per arc and one constraint per arc
  3. One variable per arc and one constraint per node
  4. One variable per node and one constraint per node
Explanation. The variable $x_{ij}$ is the flow on the arc $(i,j)$; the conservation constraint of node $i$ requires outflow minus inflow equal to $b_i$. The arcs give the bounds $l_{ij} \le x_{ij} \le u_{ij}$ instead.
no-f-084 · level facile · notes
In an unbalanced minimum cost flow instance the total supply exceeds the total demand, $\sum_{i \in N} b_i>0$. How is the constraint of a supply node $i$ ($b_i>0$) written?
  1. Outflow minus inflow $\le b_i$
  2. Outflow minus inflow $= b_i$
  3. Outflow minus inflow $\ge b_i$
  4. Outflow $\le b_i$, without counting the inflow
Explanation. Every demand must be met, while a supply node sends at most $b_i$ net units: constraint $\le b_i$. With the dummy node, which absorbs the unused supply, the constraint becomes an equation again.
no-f-085 · level facile · notes
The undirected triangle with vertices $1,2,3$ has the vertex–edge incidence matrix $\mat{M}$ with rows $(1,1,0)$, $(1,0,1)$, $(0,1,1)$, and $\det(\mat{M})=-2$. What is the only solution of $\mat{M}\vet{y}=\vet{1}$, $\vet{y} \ge \vet{0}$?
  1. $(1,0,0)$
  2. $(1,1,1)$
  3. $(0,1,0)$
  4. $(\frac{1}{2},\frac{1}{2},\frac{1}{2})$
Explanation. $\mat{M}$ is nonsingular, so the solution is unique: $(\frac{1}{2},\frac{1}{2},\frac{1}{2})$, a fractional vertex with integer data. $\mat{M}$ is not totally unimodular: in the incidence matrices of directed graphs this cannot happen.
no-f-086 · level teorema · notes
An unbalanced instance ($\sum_i b_i=e>0$) is balanced by adding a dummy node $d$ with $b_d=-e$ and zero-cost arcs $(i,d)$ from the supply nodes. Which statement on the balanced network is correct?
  1. Its optimum is smaller than that of the unbalanced instance, since the arcs cost $0$
  2. Its feasible flows, restricted to $A$, are the solutions of the original instance, with the same cost
  3. It is equivalent only if every supply node sends all of its supply $b_i$
  4. It has feasible flows even when the original instance has none
Explanation. Proposition «the dummy node»: $x_{id}$ measures the unused supply of node $i$, and the correspondence keeps feasibility and cost, since the arcs $(i,d)$ cost zero.
no-f-200 · level media · notes
A minimum cost flow network has nodes $1,2,3$ with balances $\vet{b}=(4,0,-4)$ and the arcs $(1,2)$: cost $1$, capacity $3$; $(2,3)$: cost $2$, capacity $3$; $(1,3)$: cost $5$, infinite capacity. What is the minimum cost of a feasible flow?
  1. $14$
  2. $12$
  3. $20$
  4. $9$
Explanation. The path $1,2,3$ costs $3$ per unit but carries at most $3$ units; the remaining unit goes on the arc $(1,3)$: $3 \cdot 3+1 \cdot 5=14$. $12$ ignores the capacities, $20$ sends everything on $(1,3)$, $9$ forgets the last unit.
no-f-201 · level facile · notes
In the network with nodes $1,2,3$ and arcs $(1,2)$ (cost $1$), $(2,3)$ (cost $2$), $(1,3)$ (cost $5$), take the potentials $\vet{\pi}=(5,4,0)$. What are the reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$ of the arcs $(1,2)$, $(2,3)$, $(1,3)$, in this order?
  1. $(2,6,10)$
  2. $(0,2,0)$
  3. $(0,-2,0)$
  4. $(-8,-2,0)$
Explanation. $\bar{c}_{12}=1-5+4=0$, $\bar{c}_{23}=2-4+0=-2$, $\bar{c}_{13}=5-5+0=0$. With a flow that saturates $(2,3)$ and lies between the bounds on the other two arcs, these potentials certify optimality. $(2,6,10)$ swaps the signs of the potentials.
no-f-202 · level facile · notes
The shortest path from $s$ to $t$ is written as a minimum cost flow model, with costs equal to the lengths and infinite capacities (conservation: outflow minus inflow equal to $b_i$). Which balances are used?
  1. $b_s=-1$, $b_t=1$, $b_i=0$ elsewhere
  2. $b_s=1$, $b_t=-1$, $b_i=0$ elsewhere
  3. $b_s=n-1$, $b_i=-1$ for every other node
  4. $b_i=1$ for every node other than $t$
Explanation. One unit leaves $s$ and enters $t$: $b_s=1$, $b_t=-1$. The balance $b_s=n-1$ with $-1$ elsewhere is that of the single-source model.
no-f-203 · level facile · notes
A flow on a network with nodes $1,2,3$ has $x_{12}=2$, $x_{13}=4$, $x_{32}=1$ (no other arc). Conservation requires, at every node, outflow minus inflow equal to the balance $b_i$. For which balances $\vet{b}=(b_1,b_2,b_3)$ does the flow satisfy conservation?
  1. $(-6,3,3)$
  2. $(6,-3,3)$
  3. $(6,3,-3)$
  4. $(6,-3,-3)$
Explanation. Node $1$: $2+4=6$ leave; node $2$: $2+1=3$ enter, hence $-3$; node $3$: $1$ leaves and $4$ enter, hence $-3$. The balances add up to zero, as in every network with a feasible flow.
no-f-326 · level facile · notes
In a network every node $i$ has a balance $b_i$: it is a supply node if $b_i>0$, a demand node if $b_i<0$, a transshipment node if $b_i=0$. The network has $\vet{b}=(5,2,0,-3,0,-4)$. Which nodes are transshipment nodes?
  1. $4$ and $6$
  2. $1$ and $2$
  3. $3$ and $5$
  4. None
Explanation. The nodes with $b_i=0$ are $3$ and $5$: they pass on everything they receive. $1$ and $2$ supply $7$ units, $4$ and $6$ demand them.
no-f-327 · level facile · notes
In a network with lower bounds $l_{ij}$, capacities $u_{ij}$ and balances $b_i$, when is a flow $\vet{x}$ feasible?
  1. If it respects conservation at every node and $l_{ij} \le x_{ij} \le u_{ij}$ on every arc
  2. If it respects conservation at every node, even with negative flows
  3. If $x_{ij} \le u_{ij}$ on every arc and the cost is minimum
  4. If the outflow of the supply nodes is at most $b_i$
Explanation. Feasible means conservation ($\mat{B}\vet{x}=\vet{b}$) plus bounds on the arcs; the cost does not matter (optimality is a further requirement). The «at most $b_i$» constraint concerns only unbalanced instances.
no-f-328 · level facile · notes
In a network the demand node $j$ has $b_j=-4$. With the conservation constraint «outflow minus inflow equals $b_j$», what must happen at $j$?
  1. $4$ more units leave than enter
  2. No flow enters or leaves
  3. Exactly $4$ units enter, whatever leaves
  4. $4$ more units enter than leave
Explanation. Outflow minus inflow $=-4$ means that the inflow exceeds the outflow by $4$: the node keeps $4$ units. Other units may also pass through, entering and leaving.
no-f-329 · level facile · notes
A flow respects conservation at every node of a network with balances $\vet{b}=(5,2,0,-3,0,-4)$. For $S=\{1,2,3\}$, the arcs leaving $S$ carry $8$ units in total. How much do the arcs entering $S$ carry?
  1. $7$
  2. $1$
  3. $15$
  4. $0$
Explanation. By the cut lemma $x(\delta^+(S))-x(\delta^-(S))=\sum_{i \in S}b_i=5+2+0=7$, so $x(\delta^-(S))=8-7=1$. $15$ adds instead of subtracting.
no-f-330 · level ipotesi · notes
Lemma: if $\vet{x}$ respects conservation at every node, for every $S \subseteq N$ we have $x(\delta^+(S))-x(\delta^-(S))=\sum_{i \in S}b_i$. The proof adds up the constraints of the nodes of $S$. What happens to an arc with both endpoints in $S$?
  1. It appears once with sign $+$
  2. It must be excluded explicitly from the sum
  3. It appears with $+x_{ij}$ in the row of the tail and $-x_{ij}$ in that of the head, and cancels
  4. It makes the sum differ from $\sum_{i \in S}b_i$
Explanation. Internal arcs cancel, those of $\delta^+(S)$ stay with $+$ and those of $\delta^-(S)$ with $-$. The lemma uses neither bounds nor costs: it holds for every vector respecting conservation.
no-f-331 · level facile · notes
In a network, $\delta^+(S)$ are the arcs with tail in $S$ and head outside, $\delta^-(S)$ those with head in $S$ and tail outside. The graph has the arcs $(1,2)$, $(1,3)$, $(2,4)$, $(3,2)$, $(4,3)$. For $S=\{1,2,3\}$, what are $\delta^+(S)$ and $\delta^-(S)$?
  1. $\delta^+(S)=\{(2,4)\}$, $\delta^-(S)=\{(4,3)\}$
  2. $\delta^+(S)=\{(4,3)\}$, $\delta^-(S)=\{(2,4)\}$
  3. $\delta^+(S)=\{(1,2),(1,3)\}$, $\delta^-(S)=\emptyset$
  4. $\delta^+(S)=\{(2,4),(4,3)\}$, $\delta^-(S)=\emptyset$
Explanation. The only node outside $S$ is $4$: $(2,4)$ leaves $S$, $(4,3)$ enters it. The arcs $(1,2)$, $(1,3)$, $(3,2)$ have both endpoints in $S$.
no-f-332 · level facile · notes
The minimum cost flow model $\mathrm{MCF}$ on a network with $n$ nodes and $m$ arcs has one variable $x_{ij}$ per arc and one conservation constraint per node. How many variables and equations does it have?
  1. $n$ variables and $m$ equations
  2. $n+m$ variables and $n$ equations
  3. $m$ variables and $m$ equations
  4. $m$ variables and $n$ equations
Explanation. One variable per arc ($m$) and one conservation equation per node ($n$), plus the bounds $l_{ij} \le x_{ij} \le u_{ij}$. The reference network has $9$ variables and $6$ equations.
no-f-333 · level facile · notes
In the $\mathrm{MCF}$ model of a network, node $2$ has the incoming arc $(1,2)$, the outgoing arc $(2,4)$ and the incoming arc $(3,2)$, and balance $b_2=2$. What is its conservation constraint?
  1. $x_{12}+x_{24}+x_{32}=2$
  2. $-x_{12}+x_{24}-x_{32}=2$
  3. $x_{12}-x_{24}+x_{32}=2$
  4. $x_{24}=2$
Explanation. Outflow minus inflow: $x_{24}-x_{12}-x_{32}=2$. The third option is inflow minus outflow, that is, the constraint with reversed signs.
no-f-334 · level teorema · notes
Let $G$ be a network with balances $b_i$, lower bounds $l_{ij}$ and capacities $u_{ij}$, and for $F \subseteq A$ let $u(F)$, $l(F)$ be the sums of capacities and lower bounds. Which condition is necessary for a feasible flow to exist?
  1. $\sum_{i \in S}b_i \le u(\delta^+(S))-l(\delta^-(S))$ for every $S \subseteq N$
  2. $\sum_{i \in S}b_i \ge u(\delta^+(S))$ for every $S$
  3. $\sum_{i \in S}b_i=0$ for every $S$
  4. $b_i \le u(\delta^+(i))$ only for the supply nodes
Explanation. The net supply of $S$ must leave on $\delta^+(S)$, at most $u(\delta^+(S))$, while $\delta^-(S)$ brings back into $S$ at least $l(\delta^-(S))$. Zero balance holds for $S=N$, not for every $S$; checking single nodes only is not enough.
no-f-335 · level facile · notes
In the substituted network that removes the lower bounds one sets $\vet{b}'=\vet{b}-\mat{B}\vet{l}$ and $u'_{ij}=u_{ij}-l_{ij}$. The arc $(3,2)$ has $l_{32}=1$, $u_{32}=2$; all other lower bounds are zero, and $b_3=0$, $b_2=2$. What are $b'_3$, $b'_2$, $u'_{32}$?
  1. $b'_3=1$, $b'_2=1$, $u'_{32}=2$
  2. $b'_3=0$, $b'_2=2$, $u'_{32}=1$
  3. $b'_3=-1$, $b'_2=3$, $u'_{32}=1$
  4. $b'_3=1$, $b'_2=3$, $u'_{32}=3$
Explanation. The forced unit is sent in advance: the tail $3$ has one unit less to send ($b'_3=0-1=-1$), the head $2$ one unit less to receive ($b'_2=2+1=3$), and the arc one unit less capacity ($u'_{32}=1$).
no-f-336 · level ipotesi · notes
Proposition: $\vet{x}'=\vet{x}-\vet{l}$ is a one-to-one correspondence between the feasible flows of the network with lower bounds and those of the substituted network ($\vet{b}'=\vet{b}-\mat{B}\vet{l}$, $\vet{u}'=\vet{u}-\vet{l}$). Which fact makes the transformation of the conservation constraints correct?
  1. Total unimodularity of $\mat{B}$
  2. The fact that costs are nonnegative
  3. The fact that the network is acyclic
  4. Linearity: $\mat{B}\vet{x}=\vet{b}$ if and only if $\mat{B}(\vet{x}-\vet{l})=\vet{b}-\mat{B}\vet{l}$
Explanation. The translation by $\vet{l}$ is linear and invertible: conservation and bounds transform exactly, and the cost changes by the constant $\vet{c}'\vet{l}$. Sign of costs, acyclicity and total unimodularity are not needed.
no-f-337 · level facile · notes
The lower bounds of a network are removed with the substituted network. The only positive bound is $l_{32}=1$, with cost $c_{32}=2$, and the optimal value of the substituted network is $58$. What is the optimal value of the original network?
  1. $60$
  2. $58$
  3. $56$
  4. $59$
Explanation. The costs differ by the constant $\vet{c}'\vet{l}=c_{32}l_{32}=2$, to be added: $58+2=60$. $59$ adds only $l_{32}$, forgetting the cost.
no-f-338 · level facile · notes
In an unbalanced instance the supply nodes have $b_1=5$, $b_2=4$ and the demand nodes $b_4=-3$, $b_6=-4$. It is balanced with a dummy node $7$ and arcs $(1,7)$, $(2,7)$ of cost $0$ and infinite capacity. What is $b_7$?
  1. $2$
  2. $-2$
  3. $-9$
  4. $-7$
Explanation. The excess is $e=\sum_i b_i=9-7=2$, and the dummy node absorbs it as a demand: $b_7=-2$. The flow on $(i,7)$ is the supply not shipped by node $i$.
no-f-339 · level facile · notes
A square submatrix of the node–arc incidence matrix $\mat{B}$ has in every column exactly one $+1$ and one $-1$. What is its determinant?
  1. $+1$
  2. $-1$
  3. $0$
  4. It depends on the order of the columns
Explanation. The rows add up to the zero vector, so they are linearly dependent and the determinant is $0$. It is the third case of the proof that $\mat{B}$ is totally unimodular.
no-f-340 · level ipotesi · notes
Theorem: the node–arc incidence matrix $\mat{B}$ is totally unimodular. The proof, by induction on the size $k$ of a submatrix $\mat{M}$, distinguishes three cases. Which property of $\mat{B}$ makes them exhaustive?
  1. $\mat{B}$ has rank $n-1$
  2. Every column of $\mat{B}$ has exactly one $+1$ and one $-1$, so every column of $\mat{M}$ has at most two nonzero entries
  3. Every row of $\mat{B}$ has at most two nonzero entries
  4. $\mat{B}$ is square
Explanation. A column of $\mat{M}$ is zero, or has a single $\pm1$ (Laplace expansion and induction), or all have $+1$ and $-1$ (rows summing to zero, determinant $0$). Rows may have many nonzero entries, and $\mat{B}$ is not square in general.
no-f-341 · level teorema · notes
Let $P=\{\vet{x} : \mat{B}\vet{x}=\vet{b},\ \vet{l} \le \vet{x} \le \vet{u}\}$ be the flow polyhedron of a network. Which statement about integrality is correct?
  1. Every point of $P$ is integer if $\vet{b}$ is integer
  2. The vertices of $P$ are integer only if the costs are also integer
  3. The vertices of $P$ are integer only if the network is acyclic
  4. If $\vet{b}$, $\vet{l}$ are integer and $\vet{u}$ is integer or $+\infty$, every vertex of $P$ is integer
Explanation. Total unimodularity of $\mat{B}$ makes the vertices integer with integer data; the costs do not matter (they decide which vertex is optimal, not where the vertices are). Interior points of $P$ may be fractional.
no-f-342 · level facile · notes
The maximum flow problem from $s$ to $t$ is written as a minimum cost flow model $\mathrm{MCF}$ with all balances zero and zero costs on the arcs. What is added?
  1. A dummy node with balance $-1$
  2. Balances $b_s=1$, $b_t=-1$
  3. Costs $c_{ij}=-1$ on all arcs
  4. The arc $(t,s)$ with cost $-1$ and infinite capacity: the flow on it is the value sent
Explanation. With the return arc $(t,s)$ of cost $-1$ the model minimizes $-x_{ts}$, that is, maximizes the flow coming back from $t$ to $s$, equal to the value sent from $s$ to $t$. Balances $1,-1$ give the shortest path.
no-f-343 · level facile · notes
The assignment problem is written as a special case of the minimum cost flow model. Which special data does it have?
  1. A single supply node and a single demand node
  2. Arcs from $P$ to $D$ with $|P|=|D|$, balances $b_i=1$ for $i \in P$ and $b_j=-1$ for $j \in D$
  3. Zero balances and a return arc
  4. Capacities $u_{ij}=1$ and arbitrary balances
Explanation. Assignment is a transportation problem with unit supplies and demands and $|P|=|D|$; the integer vertices of the polyhedron are exactly the assignments. A single supply and demand node give a path or a flow.
no-f-344 · level facile · notes
In the optimal solution of a minimum cost flow model with $\vet{0} \le \vet{x} \le \vet{u}$, every arc is empty ($x_{ij}=0$), saturated ($x_{ij}=u_{ij}$) or free ($0<x_{ij}<u_{ij}$). Which property do the free arcs have in a basic solution?
  1. They all have negative reduced cost
  2. They all leave the source
  3. They form at least one cycle
  4. They form no cycle (they are a forest)
Explanation. The columns of the free arcs of a vertex are linearly independent, so they contain no cycle; in the reference network the five free arcs form a spanning tree. Free arcs have zero reduced cost.
no-f-345 · level facile · notes
An integer optimal flow has been found for a network with integer balances, capacities and bounds. Which result guarantees that a vertex-based LP solver returns an integer flow, without integrality constraints?
  1. The integer vertices theorem (total unimodularity of $\mat{B}$)
  2. Dijkstra's theorem
  3. The cut condition
  4. The handshake lemma
Explanation. With integer data every vertex of the flow polyhedron is integer, and the simplex returns an optimal vertex: no integrality constraints. The cut condition concerns feasibility.
no-f-346 · level facile · notes
In a minimum cost flow network the arc $(i,j)$ has cost $c_{ij}=3$ and capacity $u_{ij}=4$, and carries $x_{ij}=4$ in the optimal flow. With optimal potentials $\pi_i=13$, $\pi_j=7$, what is the reduced cost $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, and is it consistent with optimality?
  1. $9$: consistent, the arc is saturated
  2. $-3$: consistent, a saturated arc may have negative reduced cost
  3. $-3$: not consistent, $\bar{c}_{ij} \ge 0$ would be needed
  4. $0$: the arc is free
Explanation. $\bar{c}_{ij}=3-13+7=-3<0$, and an arc with negative reduced cost must be saturated: $x_{ij}=u_{ij}=4$ is consistent. Only arcs with $\bar{c}_{ij}>0$ must be empty.
no-f-347 · level facile · notes
To certify an optimal flow one imposes zero reduced cost, $\pi_i-\pi_j=c_{ij}$, on the free arcs, which form a spanning tree, with $\pi_6=0$. The arcs $(4,6)$ and $(5,4)$ are free, with $c_{46}=5$, $c_{54}=5$. What are $\pi_4$ and $\pi_5$?
  1. $\pi_4=-5$, $\pi_5=-10$
  2. $\pi_4=5$, $\pi_5=10$
  3. $\pi_4=5$, $\pi_5=5$
  4. $\pi_4=5$, $\pi_5=0$
Explanation. $\pi_4=\pi_6+c_{46}=5$ and $\pi_5=\pi_4+c_{54}=10$: the potential is the cost of the tree path to node $6$. The first option reverses the sign of $\pi_i-\pi_j=c_{ij}$.
no-f-348 · level facile · notes
In the optimality certificate of a flow with $\vet{0} \le \vet{x} \le \vet{u}$, the dual has value $\sum_i b_i\pi_i-\sum_{(i,j)}u_{ij}\alpha_{ij}$, with $\alpha_{ij}=\max\{0,-\bar{c}_{ij}\}$. If $\sum_i b_i\pi_i=86$ and the saturated arcs with negative reduced cost have $u_{ij}\alpha_{ij}$ equal to $12$ and $14$, what is the dual value?
  1. $86$
  2. $112$
  3. $72$
  4. $60$
Explanation. $86-(12+14)=60$, equal to the cost of the flow: the gap is zero and the flow is optimal. $112$ adds instead of subtracting; $72$ subtracts only one term.
no-f-349 · level teorema · notes
For the model $\mathrm{MCF}$ with $\vet{0} \le \vet{x} \le \vet{u}$ let $\vet{x}$ be feasible and $\vet{\pi}$ potentials, with reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. Which set of conditions guarantees that $\vet{x}$ is optimal?
  1. $\bar{c}_{ij} \ge 0$ on all arcs
  2. $\bar{c}_{ij}=0$ on all arcs with positive flow
  3. $\bar{c}_{ij}>0 \Rightarrow x_{ij}=0$ and $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$
  4. $x_{ij}=u_{ij}$ on all arcs with $\bar{c}_{ij}>0$
Explanation. These are the complementary slackness conditions: arcs with positive reduced cost empty, negative saturated, free only with zero reduced cost. With capacities one cannot require $\bar{c} \ge 0$ everywhere: a saturated arc may have $\bar{c}<0$.
no-f-350 · level facile · notes
In an optimal minimum cost flow, the arc $(3,2)$ has reduced cost $\bar{c}_{32}=c_{32}-\pi_3+\pi_2=2>0$ with respect to the optimal potentials. What is $x_{32}$ in every optimal flow?
  1. $0$
  2. $u_{32}$
  3. $2$
  4. Any value between $0$ and $u_{32}$
Explanation. By complementary slackness an arc with positive reduced cost is empty in every optimal solution: sending flow on it would increase the cost. Arcs with negative reduced cost are instead saturated.
no-f-498 · level facile · notes
A flow network is balanced if $\sum_{i \in N} b_i=0$ (total supply equal to total demand). Which network with balances $\vet{b}$ is balanced?
  1. $\vet{b}=(5,2,-3,-3)$
  2. $\vet{b}=(4,0,0,4)$
  3. $\vet{b}=(5,2,0,-3,0,-4)$
  4. $\vet{b}=(1,1,1,-2)$
Explanation. $5+2+0-3+0-4=0$. The other sums are $1$, $8$ and $1$. Being balanced is necessary for a feasible flow, but not sufficient.

5. Maximum flow (56)

no-f-087 · level facile · notes
In the maximum flow problem, the residual network $G(\vet{x})$ of a flow $\vet{x}$ has, for every arc $(i,j)$, a forward and a backward arc with positive residual capacities $r$. The arc $(i,j)$ has capacity $u_{ij}=7$ and flow $x_{ij}=5$. Which arcs does it give in $G(\vet{x})$?
  1. $(i,j)$ with $r_{ij}=2$ and $(j,i)$ with $r_{ji}=5$
  2. $(i,j)$ with $r_{ij}=2$ and $(j,i)$ with $r_{ji}=7$
  3. Only $(i,j)$, with $r_{ij}=2$
  4. $(i,j)$ with $r_{ij}=5$ and $(j,i)$ with $r_{ji}=2$
Explanation. The forward arc has $r_{ij}=u_{ij}-x_{ij}=2$, the backward arc $r_{ji}=x_{ij}=5$: only the flow already sent can be sent back, not the capacity.
no-f-088 · level facile · notes
An augmenting path from $s$ to $t$ in the residual network uses the backward arc $(j,i)$, which corresponds to the arc $(i,j)$ of the network. What happens to the flow $x_{ij}$ when augmenting along the path by $\delta$?
  1. It increases by $\delta$
  2. It does not change
  3. It decreases by $\delta$
  4. It becomes $u_{ij}-\delta$
Explanation. Along a backward arc part of the flow already sent is undone: $x_{ij}:=x_{ij}-\delta$, and $\delta \le r_{ji}=x_{ij}$ guarantees $x_{ij} \ge 0$.
no-f-089 · level facile · notes
In the maximum flow problem from $s$ to $t$, a feasible flow has value $v=6$ and an $s$–$t$ cut (a set $S$ with $s \in S$, $t \notin S$) has capacity $9$. Let $\tilde{v}$ be the maximum flow value. What can be concluded?
  1. The maximum flow value is $\tilde{v}=9$
  2. The maximum flow value lies between $6$ and $9$
  3. The given flow is not maximum
  4. The given cut is not minimum
Explanation. By weak duality every flow value is at most every cut capacity: $6 \le \tilde{v} \le 9$. Without more information neither the flow nor the cut is certainly optimal or non-optimal.
no-f-090 · level facile · notes
The Ford–Fulkerson algorithm augments the flow along paths from $s$ to $t$ of the residual network and has stopped with a maximum flow, since $t$ is no longer reachable. How is a minimum $s$–$t$ cut read?
  1. Taking the saturated arcs of the final flow
  2. Taking the arcs with zero flow
  3. Taking $S=\{s\}$, the source alone
  4. Taking as $S$ the nodes reachable from $s$ in the residual network
Explanation. In the residual network of the final flow the nodes reachable from $s$ form $S$, and $(S,N \setminus S)$ is a minimum cut. The saturated arcs do not form a cut in general.
no-f-091 · level facile · notes
For the $s$–$t$ cut $(S,N \setminus S)$ of a capacitated network, the forward arcs (from $S$ to $N \setminus S$) have capacities $3$ and $4$ and the only backward arc (from $N \setminus S$ to $S$) has capacity $2$. What is the cut capacity $u(S,N \setminus S)$?
  1. $7$
  2. $9$
  3. $5$
  4. $2$
Explanation. The capacity of a cut adds up only the forward arcs, from $S$ to $N \setminus S$: $3+4=7$. Adding the backward arc too gives $9$, subtracting it gives $5$.
no-f-092 · level facile · notes
The Ford–Fulkerson algorithm starts from the zero flow and augments along paths of the residual network. With integer capacities and a maximum flow of value $\tilde{v}=40$, on a network with $n$ nodes and $m$ arcs, at most how many augmentations does it make?
  1. $n\,m$
  2. $n-1$
  3. $40$
  4. $2^{40}$
Explanation. With integer capacities each augmentation raises the value by at least $1$: at most $\tilde{v}=40$ augmentations. The bound is pseudopolynomial; the bound $n\,m$ is that of Edmonds–Karp.
no-f-093 · level facile · notes
The Ford–Fulkerson algorithm looks for augmenting paths from $s$ to $t$ in the residual network with any search. What distinguishes the Edmonds–Karp algorithm from Ford–Fulkerson with the depth-first search?
  1. It uses the residual network without the backward arcs
  2. It finds the paths with the breadth-first search, hence with the fewest arcs
  3. It always augments the flow by $1$ unit at a time
  4. It chooses the path with the largest bottleneck
Explanation. Edmonds–Karp is Ford–Fulkerson with the BFS ($\mathit{LIST}$ a queue): the paths have the minimum number of arcs, and there are at most $n\,m$ augmentations for any capacities.
no-f-094 · level facile · notes
A matching of a bipartite graph $H=(V_1 \cup V_2,E)$ is a set of edges without common endpoints. The network of $H$ has the arcs $(s,i)$, $i \in V_1$, $(i,j)$ for every edge, $(j,t)$, $j \in V_2$, all with capacity $1$, and the maximum flow value is $4$. What do we conclude?
  1. $H$ has exactly $4$ edges
  2. $V_1$ has exactly $4$ vertices
  3. Every matching of $H$ has $4$ edges
  4. A maximum matching of $H$ has $4$ edges
Explanation. The maximum number of edges of a matching is the maximum flow value; an integer maximum flow gives a maximum matching, $M=\{\{i,j\} : \tilde{x}_{ij}=1\}$.
no-f-095 · level facile · notes
In a directed graph the minimum number of arcs whose removal leaves no directed path from $s$ to $t$ is $3$. Two paths are arc-disjoint if they share no arc. What does Menger's theorem say?
  1. The maximum number of pairwise arc-disjoint paths from $s$ to $t$ is $3$
  2. The paths from $s$ to $t$ are $3$ in all
  3. Every path from $s$ to $t$ has exactly $3$ arcs
  4. There are $3$ paths from $s$ to $t$ with pairwise no inner node in common
Explanation. The maximum number of arc-disjoint paths from $s$ to $t$ equals the minimum number of arcs whose removal separates $t$ from $s$: both are $3$. It is the max-flow min-cut theorem with capacities $1$.
no-f-096 · level facile · notes
In the maximum flow problem on a network with source $s$, sink $t$ and arc capacities, what is the value $v$ of a feasible flow?
  1. The sum of the flows on all the arcs of the network
  2. The flow leaving $s$ minus the flow entering $s$
  3. The flow on the most loaded arc of the network
  4. The sum of the capacities of the arcs leaving $s$
Explanation. The value is the net outflow of the source, equal to the net inflow of the sink and to the net flow across every $s$–$t$ cut.
no-f-097 · level media · notes
Ford–Fulkerson stops: in the residual network of the final flow the nodes reachable from $s$ are $S=\{s,a,b\}$. The arcs of the network from $S$ to $N \setminus S$ have capacities $4$, $2$, $3$, and one arc of the network from $N \setminus S$ to $S$ has capacity $5$. What is the maximum flow value?
  1. $14$
  2. $4$
  3. $9$
  4. It cannot be said without the flow
Explanation. At the stop the forward arcs of the cut are saturated and the backward arcs empty, so $v=u(S,N \setminus S)=4+2+3=9$, and the cut is minimum. The capacity of the backward arc does not count.
no-f-098 · level teorema · notes
Let $\vet{x}$ be a feasible flow from $s$ to $t$ of value $v$, and $G(\vet{x})$ its residual network. Which statement of the max-flow min-cut theorem is correct?
  1. $\vet{x}$ is maximum if and only if $G(\vet{x})$ has no path from $s$ to $t$, if and only if $v$ is the capacity of a cut
  2. $\vet{x}$ is maximum if and only if it saturates all the arcs leaving the source $s$
  3. $\vet{x}$ is maximum if and only if the saturated arcs form an $s$–$t$ cut
  4. The maximum flow value equals the maximum capacity of an $s$–$t$ cut
Explanation. The three conditions (maximum flow, no augmenting path, value equal to a cut capacity) are equivalent, and $\tilde{v}$ is the minimum, not the maximum, capacity of a cut.
no-f-099 · level teorema · notes
The Edmonds–Karp algorithm is Ford–Fulkerson with the augmenting paths found by the breadth-first search. On a network with $n$ nodes, $m \ge n-1$ arcs and maximum flow $\tilde{v}$, which statement is correct?
  1. It needs integer capacities and makes at most $\tilde{v}$ augmentations
  2. It makes at most $n-1$ augmentations, one per node other than $s$
  3. It terminates only if the capacities are rational
  4. For any non-negative capacities it makes at most $n\,m$ augmentations, in $O(n\,m^2)$ time
Explanation. With the BFS the distances in the residual network never decrease and every arc is critical at most $n/2$ times: at most $n\,m$ augmentations, for any real capacities. The bound $\tilde{v}$ with integer capacities is that of Ford–Fulkerson.
no-f-100 · level ipotesi · notes
In the max-flow min-cut theorem, (b) says «$G(\vet{x})$ has no path from $s$ to $t$» and (c) «$v=u(S,N \setminus S)$ for some $s$–$t$ cut». In the proof of (b) $\Rightarrow$ (c), how is $S$ chosen and what is used?
  1. $S=\{s\}$, and strong LP duality
  2. $S$ = nodes reachable from $s$ in $G(\vet{x})$, and the lemma «flow across a cut»
  3. $S$ = nodes incident to saturated arcs, and total unimodularity
  4. $S=N \setminus \{t\}$, and the Edmonds–Karp algorithm
Explanation. With $S$ the nodes reachable from $s$, an unsaturated arc from $S$ to $N \setminus S$, or a backward one carrying flow, would make a node outside $S$ reachable. Hence the net flow across the cut, which is $v$, equals $u(S,N \setminus S)$.
no-f-101 · level ipotesi · notes
The Ford–Fulkerson algorithm augments the flow, starting from zero, along paths of the residual network, by the bottleneck $\delta$ (minimum residual capacity of the path). To prove that it terminates when the capacities are integer, which fact is used?
  1. The breadth-first search finds shortest paths
  2. The distances in the residual network never decrease
  3. Every arc is critical at most $n/2$ times
  4. The flow stays integer, so $\delta \ge 1$, and the value is at most $\tilde{v}$
Explanation. With an integer flow the residual capacities are integer, every $\delta$ is a positive integer and the value is bounded by the maximum $\tilde{v}$: at most $\tilde{v}$ augmentations. The other facts belong to the proof of Edmonds–Karp.
no-f-102 · level facile · notes
A feasible flow from $s$ to $t$ has value $v=8$. For an $s$–$t$ cut $(S,N \setminus S)$, the arcs from $S$ to $N \setminus S$ carry $11$ units in total. How much flow do the arcs from $N \setminus S$ to $S$ carry in total?
  1. $0$
  2. $19$
  3. $3$
  4. $8$
Explanation. Lemma «flow across a cut»: $v=x(\delta^+(S))-x(\delta^-(S))$, so $x(\delta^-(S))=11-8=3$. The net flow across every $s$–$t$ cut is the flow value.
no-f-103 · level facile · notes
A feasible flow from $s$ to $t$ has value $v=10$. In the residual network there is an augmenting path from $s$ to $t$ with residual capacities $4$, $2$, $7$ (one of them backward). Augmenting along the path by the bottleneck $\delta$, what is the new flow value?
  1. $12$
  2. $23$
  3. $14$
  4. $10$, since there is a backward arc
Explanation. The bottleneck is the minimum residual capacity, $\delta=2$; by the lemma «augmentation» the new flow is feasible and has value $v+\delta=12$, even if the path uses backward arcs.
no-f-104 · level facile · notes
With integer capacities, Ford–Fulkerson takes $O((n+m)\,\tilde{v})$ time, and $\tilde{v} \le (n-1)\,U$ where $U$ is the largest capacity. Why is this bound not polynomial in the size of the instance?
  1. Because $n+m$ can be exponential in $n$
  2. Because with integer capacities the algorithm may not terminate
  3. Because the number of paths from $s$ to $t$ can be exponential
  4. Because it grows with the value $U$, not with its digits $\log U$
Explanation. The running time is pseudopolynomial: doubling the digits of the capacities can multiply the number of augmentations. Edmonds–Karp removes the dependence on $U$ with at most $n\,m$ augmentations.
no-f-105 · level facile · notes
In a network with source $s$, sink $t$ and all capacities integer, what can be said about the maximum flows?
  1. Every maximum flow has all entries integer
  2. There is a maximum flow with all entries integer
  3. An integer maximum flow exists only if the capacities are even
  4. The maximum value may be fractional
Explanation. Corollary «integrality»: Ford–Fulkerson, starting from the zero flow, always augments by integer amounts and returns an integer maximum flow. Fractional maximum flows may exist as well.
no-f-106 · level teorema · notes
In the Edmonds–Karp algorithm a residual arc $(i,j)$ is critical in an augmentation if it has the minimum residual capacity of the path; $d_{\vet{x}}(i)$ is the minimum number of arcs from $s$ to $i$ in the residual network of $\vet{x}$. Which statement is correct?
  1. An arc can be critical at most once in the whole run
  2. Between two times $(i,j)$ is critical, $d(i)$ stays the same
  3. If $(i,j)$ is critical at $\vet{x}$ and again at $\vet{y}$, then $d_{\vet{y}}(i) \ge d_{\vet{x}}(i)+2$
  4. If $(i,j)$ is critical at $\vet{x}$ and again at $\vet{y}$, then $d_{\vet{y}}(i) \le d_{\vet{x}}(i)-2$
Explanation. Lemma «critical arcs»: between the two times an augmentation used the opposite arc $(j,i)$, and with non-decreasing distances $d(i)$ grows by at least $2$. Since $d(i) \le n-1$, every arc is critical at most about $n/2$ times.
no-f-204 · level facile · notes
In the LP model of the maximum flow on a network with source $s$, sink $t$ and capacities $u_{ij}$, the flow value $v$ is maximized. Which constraint holds at every node $i \notin \{s,t\}$?
  1. Flow leaving $i$ equal to flow entering $i$
  2. Outflow minus inflow equal to $v$
  3. Zero flow entering $i$
  4. Flow leaving $i$ equal to the sum of the leaving capacities
Explanation. Intermediate nodes conserve flow; only $s$ has net outflow $v$ and only $t$ net inflow $v$. The capacities give the constraints $0 \le x_{ij} \le u_{ij}$ on the arcs.
no-f-351 · level facile · notes
In the maximum flow problem from a source $s$ to a sink $t$, with capacities $u_{ij}$ on the arcs, which constraint does not hold for a feasible flow?
  1. $0 \le x_{ij} \le u_{ij}$ on every arc
  2. Conservation at every node other than $s$ and $t$
  3. Conservation also at $s$ and $t$
  4. The zero flow is feasible
Explanation. At $s$ and $t$ conservation is not imposed: the net outflow of $s$ is the value $v$ and the net inflow of $t$ is also $v$. The zero flow, of value $0$, is always feasible.
no-f-352 · level facile · notes
In the maximum flow problem from a source $s$ to a sink $t$, with capacities $u_{ij}$ on the arcs, the arcs $(1,2)$ with $x_{12}=3$ and $(1,3)$ with $x_{13}=4$ leave the source $s=1$, and no arc enters it. What is the value of the flow?
  1. $7$
  2. $4$
  3. $3$
  4. It cannot be told without the flows at $t$
Explanation. The value is the net outflow of the source: $3+4-0=7$. By the cut lemma it is also the net inflow of $t$, so there is no need to look at $t$.
no-f-353 · level facile · notes
The LP model of the maximum flow has variables $x_{ij}$ on the arcs and a variable $v$, the value. What kind of variable is $v$, and what is maximized?
  1. $v \ge 0$ integer; $\sum x_{ij}$ is maximized
  2. $v$ free; $v$ is maximized
  3. $v \le \sum u_{ij}$; $-\sum x_{ij}$ is minimized
  4. $v$ binary; $v$ is maximized
Explanation. The objective is $\max v$, with $v$ free (the constraints decide its sign) and the constraints «net outflow of $s$ equal to $v$», «net inflow of $t$ equal to $v$». Maximizing $\sum x_{ij}$ would reward flows going around cycles.
no-f-354 · level facile · notes
In the LP model of the maximum flow the source constraint is «outflow of $s$ minus inflow equals $v$». What is the constraint of the sink $t$?
  1. Outflow of $t$ minus inflow equals $v$
  2. Outflow of $t$ minus inflow equals $0$
  3. Inflow of $t$ at most $v$
  4. Outflow of $t$ minus inflow equals $-v$
Explanation. The sink absorbs the value: its net outflow is $-v$. With $0$ the model would impose conservation at $t$ too, and the only possible flow would have value zero.
no-f-355 · level facile · notes
The LP model of the maximum flow ($\max v$, conservation with $v$ at $s$ and $-v$ at $t$, $0 \le x_{ij} \le u_{ij}$) is a case of the minimum cost flow model. How can this be seen?
  1. By adding the arc $(t,s)$ with cost $-1$ and infinite capacity, whose flow is $v$, with zero balances
  2. By setting $b_s=1$, $b_t=-1$ and zero costs
  3. By setting all costs equal to $1$
  4. It is not a case of minimum cost flow
Explanation. With the return arc $(t,s)$ all nodes conserve flow, and $\min -x_{ts}$ is equivalent to $\max v$. Balances $1,-1$ would send exactly one unit.
no-f-356 · level teorema · notes
Which statement about the LP model of the maximum flow with finite capacities $u_{ij}$ is correct?
  1. It may be unbounded if the network has cycles
  2. It may be infeasible if the capacities are small
  3. It always has an optimal solution: the zero flow is feasible and $v$ is bounded by the capacity of every cut
  4. It has an optimal solution only if $s$ reaches $t$
Explanation. The zero flow is feasible, and $v \le u(S,N \setminus S)$ for every $s$–$t$ cut, so the value is bounded and an optimum exists. If $t$ is not reachable the optimum still exists and equals $0$.
no-f-357 · level facile · notes
In a network with source $s$ and sink $t$, a network with $n=6$ nodes has how many $s$–$t$ cuts $(S,N \setminus S)$ with $s \in S$, $t \notin S$?
  1. $64$
  2. $16$
  3. $6$
  4. $30$
Explanation. Each of the $n-2=4$ nodes other than $s$ and $t$ can be in $S$ or outside: $2^4=16$ cuts. $2^6=64$ counts all subsets of nodes, without fixing $s$ and $t$.
no-f-358 · level facile · notes
In maximum flow, the residual network of a flow $\vet{x}$ has the forward arc $(i,j)$ with capacity $u_{ij}-x_{ij}$ if positive, and the backward arc $(j,i)$ with capacity $x_{ij}$ if positive. An arc $(2,4)$ has $u_{24}=3$ and $x_{24}=3$. Which residual arcs does it generate?
  1. $(2,4)$ with capacity $3$
  2. $(2,4)$ with capacity $0$ and $(4,2)$ with capacity $3$
  3. None
  4. Only $(4,2)$, with capacity $3$
Explanation. A saturated arc cannot carry more flow, so it gives no forward arc; it gives the backward arc $(4,2)$, since up to $3$ units can be removed. Arcs of zero residual capacity are not in the residual network.
no-f-359 · level facile · notes
Ford–Fulkerson augments the flow along a path $P$ of the residual network by $\delta$, the minimum residual capacity on $P$. The path $1,3,4,6$ has residual capacities $4,2,3$, and its residual arc $(3,4)$ is the backward arc of the network arc $(4,3)$. What happens after the augmentation?
  1. $\delta=2$; $x_{13}$ and $x_{46}$ grow by $2$ and $x_{43}$ decreases by $2$
  2. $\delta=4$; all flows of the path grow by $4$
  3. $\delta=2$; $x_{43}$ also grows by $2$
  4. $\delta=3$; $x_{43}$ decreases by $3$
Explanation. The bottleneck is $\min\{4,2,3\}=2$. On forward arcs the flow grows, on the backward arc the flow of the original arc $(4,3)$ decreases: this is how Ford–Fulkerson corrects earlier choices.
no-f-360 · level facile · notes
Ford–Fulkerson with integer capacities stops after five augmentations with bottlenecks $\delta=2,1,2,1,1$, starting from the zero flow. What is the value of the maximum flow?
  1. $5$
  2. $2$
  3. $7$
  4. $6$
Explanation. Each augmentation increases the value by $\delta$: $2+1+2+1+1=7$. $5$ is the number of augmentations, not the value.
no-f-361 · level facile · notes
Ford–Fulkerson has stopped: in the residual network of the final flow only the nodes $S=\{1,2\}$ are reachable from $s=1$. The network arcs from $S$ to the other nodes are $(1,3)$ with $u_{13}=4$ and $(2,4)$ with $u_{24}=3$. What is concluded?
  1. The flow is not maximum yet
  2. The maximum flow is $4$
  3. The maximum flow is $3$
  4. $(S,N \setminus S)$ is a minimum cut and the maximum flow is $7$
Explanation. Without residual paths from $s$ to $t$ the forward arcs of the cut are saturated and the backward ones empty: $v=u(S,N \setminus S)=4+3=7$, and the cut is minimum by the max-flow min-cut theorem.
no-f-362 · level facile · notes
In Ford–Fulkerson an augmentation uses a backward residual arc $(j,i)$, corresponding to the network arc $(i,j)$ with positive flow. What does it mean in terms of the original flow?
  1. Flow is sent in the opposite direction on $(i,j)$, which becomes negative
  2. Flow is removed from $(i,j)$, rerouting units that used to travel on that arc
  3. The capacity of $(i,j)$ is increased
  4. A new arc $(j,i)$ is created in the network
Explanation. Decreasing $x_{ij}$ by $\delta$ reroutes $\delta$ units that reached $j$ from $i$ towards the rest of the augmenting path. The flow stays between $0$ and $u_{ij}$; the network does not change.
no-f-363 · level facile · notes
In the network with arcs $(1,2)$, $(1,3)$, $(2,4)$, $(3,4)$ of capacity $M$ and $(2,3)$ of capacity $1$ (with $s=1$, $t=4$), Ford–Fulkerson allows any augmenting path. In the worst case, how many augmentations can it make?
  1. $2$
  2. $4$
  3. $2M$
  4. $M$
Explanation. Alternating $1,2,3,4$ and $1,3,2,4$ (which uses $(2,3)$ backward) every bottleneck is $1$, and the maximum value $2M$ needs $2M$ augmentations. With the paths $1,2,4$ and $1,3,4$ two augmentations suffice.
no-f-364 · level facile · notes
Ford–Fulkerson with integer capacities takes time $O((n+m)\,\tilde{v})$, where $\tilde{v}$ is the maximum value. Why is this time called pseudopolynomial?
  1. Because it depends on the numerical value $\tilde{v}$, which can be exponential in the length of the data
  2. Because it is polynomial only on acyclic graphs
  3. Because it does not depend on $n$
  4. Because it holds only on average
Explanation. The number of augmentations is bounded by $\tilde{v}$, which grows with the value of the capacities and not with the number of bits to write them: with $M=10^6$ two million augmentations may be needed. Edmonds–Karp removes this dependence.
no-f-365 · level ipotesi · notes
Theorem: with integer capacities Ford–Fulkerson stops after at most $\tilde{v}$ augmentations. Which fact is needed to count the augmentations?
  1. Every augmenting path has at most $n-1$ arcs
  2. The residual network has at most $2m$ arcs
  3. Distances in the residual network do not decrease
  4. Flow and residual capacities stay integer, so every augmentation increases the value by at least $1$
Explanation. Starting from the zero flow and with integer capacities, every $\delta$ is a positive integer: the value grows by at least $1$ and does not exceed $\tilde{v}$. Nondecreasing distances are used for Edmonds–Karp; with irrational capacities the argument fails.
no-f-366 · level facile · notes
In the network with arcs $(1,2)$, $(1,3)$, $(2,4)$, $(3,4)$ of capacity $M$ and $(2,3)$ of capacity $1$ ($s=1$, $t=4$), how many augmentations does Edmonds–Karp (paths with the minimum number of arcs) make?
  1. $2$
  2. $2M$
  3. $3$
  4. $M+1$
Explanation. The BFS first finds $1,2,4$ and then $1,3,4$, both with $2$ arcs and bottleneck $M$: two augmentations and value $2M$. The path $1,2,3,4$ has $3$ arcs and is never chosen.
no-f-367 · level ipotesi · notes
Lemma: in Edmonds–Karp the distances $d_{\vet{x}}(i)$ (minimum number of arcs from $s$ to $i$ in the residual network) do not decrease from one augmentation to the next. Which fact about the arcs entering the residual network is the core of the proof?
  1. They are arcs towards the sink $t$
  2. They are reverses of arcs of the augmenting path, which goes by increasing distance: they go from distance $k+1$ to $k$
  3. They always have residual capacity $1$
  4. They are arcs of the original network
Explanation. An augmentation creates only arcs $(j,i)$ reversing arcs $(i,j)$ of the BFS path, with $d(j)=d(i)+1$: an arc going down one level shortens no path from $s$. Residual capacities are arbitrary.
no-f-368 · level facile · notes
Edmonds–Karp on the reference network of the chapter augments along $1,2,4,6$ ($\delta=3$), $1,3,5,6$ ($\delta=3$) and $1,3,5,4,6$ ($\delta=1$). What is observed about the number of arcs of the paths?
  1. It decreases at every augmentation
  2. It is always $3$
  3. It never decreases: $3,3,4$
  4. It grows by one at every augmentation
Explanation. Distances in the residual network do not decrease, so neither does the length of the augmenting path: $3,3,4$. It need not grow at every step: several augmentations can have the same length.
no-f-369 · level facile · notes
In Edmonds–Karp an arc of the augmenting path is critical if its residual capacity equals the bottleneck $\delta$. What happens to it after the augmentation?
  1. It leaves the residual network, since its residual capacity becomes $0$
  2. Its residual capacity doubles
  3. It becomes a backward arc of the sink
  4. It stays in the residual network with capacity $\delta$
Explanation. The residual capacity drops by $\delta$, hence to zero: the arc leaves, and the opposite arc appears (or grows). Counting how often an arc can be critical gives the $O(nm)$ bound on augmentations.
no-f-370 · level facile · notes
On the reference network of the chapter Ford–Fulkerson with depth-first search makes $5$ augmentations, Edmonds–Karp (breadth-first search) $3$. What do the two final results have in common?
  1. The same augmenting paths
  2. The same number of critical arcs
  3. The same flow on every arc, necessarily
  4. The same value, the maximum value $\tilde{v}$
Explanation. Both stop with a maximum flow, hence with the same value ($\tilde{v}=7$ on that network); the flows on single arcs may differ, since the maximum flow is not unique in general.
no-f-371 · level facile · notes
Many combinatorial problems are solved as maximum flows in a network built for the purpose. What guarantees that the maximum flow found by Ford–Fulkerson corresponds to a combinatorial object (a matching, paths)?
  1. The fact that the network is acyclic
  2. Strong duality
  3. Integrality: with integer capacities there is an integer maximum flow, and Ford–Fulkerson finds it
  4. Uniqueness of the maximum flow
Explanation. With unit capacities an integer flow has values $0$ or $1$ on the arcs, and it reads as a set of edges or of paths. The maximum flow is not unique in general, and application networks may have cycles.
no-f-372 · level facile · notes
One wants to know how many arcs must be cut, at least, to disconnect $t$ from $s$ in a directed graph. Which flow problem is solved?
  1. The maximum flow from $s$ to $t$ with all capacities equal to $1$
  2. The shortest path from $s$ to $t$ with lengths $1$
  3. The minimum cost flow with balances $1,-1$
  4. The minimum spanning tree
Explanation. With unit capacities the capacity of a cut is the number of its forward arcs, and the minimum cut equals the maximum flow (Menger). The shortest path counts the arcs of a path, not the arcs to cut.
no-f-373 · level facile · notes
In a network built for a maximum flow application, what are the added source $s$ and sink $t$ for, joined by arcs of capacity $1$ to the nodes of two groups $V_1$ and $V_2$?
  1. To make the network acyclic
  2. To give a cost to the nodes
  3. To double the value of the flow
  4. To limit to $1$ the flow through every node of $V_1$ and $V_2$
Explanation. The arc $(s,i)$ of capacity $1$ lets at most one unit into $i \in V_1$, the arc $(j,t)$ lets at most one out of $j \in V_2$: so every node is used at most once, as in a matching.
no-f-374 · level teorema · notes
Which statement about the link between the max-flow min-cut theorem and its combinatorial applications is correct?
  1. It holds only for networks with all capacities equal to $1$
  2. With unit capacities it gives min–max theorems, such as «maximum number of arc-disjoint paths = minimum number of arcs separating $s$ from $t$»
  3. It gives the maximum size of an independent set in every graph
  4. It requires the graph to be bipartite
Explanation. The theorem holds for any capacities; with unit capacities and integrality it gives Menger's theorem and the correspondence between matchings and flows in bipartite graphs. It does not solve problems such as maximum independent set in general graphs.
no-f-375 · level facile · notes
In a bipartite graph with $V_1=\{a,b,c\}$, $V_2=\{x,y\}$ and edges $\{a,x\}$, $\{b,x\}$, $\{b,y\}$, $\{c,y\}$, a matching is a set of edges with no common endpoints. What is the maximum number of edges of a matching?
  1. $2$
  2. $3$
  3. $4$
  4. $1$
Explanation. $\{a,x\},\{b,y\}$ is a matching with $2$ edges, and there cannot be more since $|V_2|=2$. $3=|V_1|$ and $4=|E|$ ignore the constraint on the endpoints.
no-f-376 · level ipotesi · notes
Proposition: the maximum number of edges of a matching of a bipartite graph $H$ is the maximum value $\tilde{v}$ of a flow in the network of $H$ (arcs $(s,i)$, $(i,j)$, $(j,t)$ of capacity $1$). To read a matching from a maximum flow, which fact is needed?
  1. The bipartite graph has $|V_1|=|V_2|$
  2. The maximum flow is unique
  3. The capacities of the arcs $(i,j)$ are infinite
  4. There is an integer maximum flow, with values $0$ or $1$, and conservation makes every node use at most one edge
Explanation. A fractional flow (for instance $1/2$ on two edges) does not read as a matching: integrality is needed, guaranteed with integer capacities. Neither $|V_1|=|V_2|$ nor uniqueness is needed.
no-f-377 · level facile · notes
In the network of a bipartite graph (arcs $s \to V_1$, $V_1 \to V_2$, $V_2 \to t$, capacity $1$) an integer maximum flow has $x_{ij}=1$ on the arcs $(a,y)$, $(b,x)$, $(c,z)$ between $V_1$ and $V_2$. What does it represent?
  1. Three paths from $a$ to $z$
  2. A minimum cut of capacity $3$
  3. The matching $\{a,y\},\{b,x\},\{c,z\}$ with $3$ edges
  4. A spanning tree of the network
Explanation. The edges with flow $1$ between the two sides form a matching, and its number of edges is the value of the flow. The minimum cut is a set of network arcs, not of graph edges.
no-f-378 · level teorema · notes
Let $s \neq t$ be two nodes of a directed graph. Which statement of Menger's theorem (arc version) is correct?
  1. The maximum number of node-disjoint paths from $s$ to $t$ is the minimum number of arcs to remove
  2. The maximum number of pairwise arc-disjoint paths from $s$ to $t$ is the minimum number of arcs whose removal separates $t$ from $s$
  3. Every connected graph has two arc-disjoint paths from $s$ to $t$
  4. The number of arc-disjoint paths is the out-degree of $s$
Explanation. It is the max-flow min-cut theorem with capacities $1$. Arc-disjoint paths may share nodes; the out-degree of $s$ is only an upper bound.
no-f-379 · level facile · notes
A directed graph has the arcs $(1,2)$, $(1,3)$, $(2,3)$, $(2,4)$, $(3,4)$. At most how many pairwise arc-disjoint paths from $1$ to $4$ are there?
  1. $2$
  2. $3$
  3. $1$
  4. $5$
Explanation. $1,2,4$ and $1,3,4$ are arc-disjoint; a third path would have to leave $1$ on a third arc, but $\deg^+(1)=2$. The cut $\{(1,2),(1,3)\}$ has $2$ arcs, so the maximum is $2$.
no-f-380 · level ipotesi · notes
In the proof of Menger's theorem, from an integer flow of value $\tilde{v}$ with $x_{ij} \in \{0,1\}$ one extracts $\tilde{v}$ arc-disjoint paths by walking along arcs with flow $1$. Why can the walk, having entered a node $i \notin \{s,t\}$, always continue?
  1. Because every node has out-degree at least $2$
  2. Because the graph is acyclic
  3. By flow conservation: at $i$ there is an outgoing arc with flow $1$ not used yet
  4. Because the flow is maximum
Explanation. At $i$ the walk has used one incoming arc more than outgoing ones, and conservation guarantees an outgoing arc with flow not yet used. Maximality is needed only to get $\tilde{v}$ paths.
no-f-381 · level facile · notes
Ford–Fulkerson with depth-first search (lists by increasing index), on the network with arcs $(1,2)$, $(1,3)$, $(2,4)$, $(3,4)$ of capacity $M \ge 2$ and $(2,3)$ of capacity $1$ ($s=1$, $t=4$), finds the paths $1,2,3,4$, then $1,2,4$, $1,3,2,4$ and $1,3,4$. What are the bottlenecks?
  1. $M$, $M$, $1$, $1$
  2. $1$, $1$, $1$, $1$
  3. $1$, $M$, $1$, $M$
  4. $1$, $M-1$, $1$, $M-1$
Explanation. The first path is limited by $(2,3)$: $\delta=1$; then $(1,2)$ has residual $M-1$; $1,3,2,4$ uses $(2,3)$ backward with residual $1$; finally $(1,3)$ has residual $M-1$. Total $2M$ in four augmentations.
no-f-382 · level facile · notes
At the end of Edmonds–Karp on the reference network of the chapter, the distances in the residual network from $s=1$ are $d(1)=0$, $d(2)=1$ and $+\infty$ for the other nodes. Which minimum cut is read?
  1. $S=\{1\}$
  2. $S=\{1,2\}$
  3. $S=\{1,2,3,4,5\}$
  4. None: the algorithm is not finished
Explanation. The nodes reachable in the final residual network form the side $S$ of a minimum cut: $S=\{1,2\}$, since $t=6$ is not reachable. Its capacity is the maximum value, $7$.
no-f-562 · level teorema · notes
In the maximum flow problem from $s$ to $t$ with capacities $u_{ij}$, let $u(S,N \setminus S)$ be the capacity of an $s$–$t$ cut (sum of the capacities of the arcs from $S$ to $N \setminus S$). Which statement is correct for every feasible flow of value $v$ and every $s$–$t$ cut?
  1. $v \ge u(S,N \setminus S)$
  2. $v=u(S,N \setminus S)$
  3. $v \le u(S,N \setminus S)$, so the maximum flow does not exceed the minimum cut
  4. $v \le u(S,N \setminus S)$ only for the minimum cut
Explanation. By the cut lemma $v=x(\delta^+(S))-x(\delta^-(S)) \le u(\delta^+(S))-0$: it is weak duality, valid for every flow–cut pair. Equality holds only for a maximum flow and a minimum cut.
no-f-563 · level ipotesi · notes
Lemma: for every feasible flow from $s$ to $t$ of value $v$ and every $s$–$t$ cut $(S,N \setminus S)$, $v=x(\delta^+(S))-x(\delta^-(S))$. Which fact is needed to prove it?
  1. Flow conservation at the nodes of $S$ other than $s$: adding the constraints of the nodes of $S$ leaves only the net outflow of $s$
  2. The capacities are integer
  3. The flow is maximum
  4. The cut is minimum
Explanation. The constraints of the nodes of $S$ are added (balance $v$ for $s$, $0$ for the others): internal arcs cancel and the arcs crossing the cut remain. The lemma holds for every feasible flow and every cut.
no-f-564 · level ipotesi · notes
Lemma: augmenting a feasible flow by $\delta$ (the minimum residual capacity) along an augmenting path from $s$ to $t$ of the residual network gives a feasible flow of value $v+\delta$. Why does conservation still hold at the internal nodes of the path?
  1. Because $\delta$ is integer
  2. Because the path has no backward arcs
  3. Because the path is the shortest
  4. Because every internal node gains $\delta$ (or gives back $\delta$ less) on the path arc entering it and passes on as much on the one leaving it
Explanation. At an internal node the net effect of the two residual arcs of the path is zero, whether they are forward (flow $+\delta$) or backward (flow $-\delta$ on the opposite arc). At $s$ the outflow grows by $\delta$.

6. Minimum cost flow (45)

no-f-107 · level facile · notes
In minimum cost flow, the residual network $G(\vet{x})$ has a backward arc $(j,i)$ for every arc $(i,j)$ that can be decreased. The arc $(i,j)$ has bounds $l_{ij}=1$, $u_{ij}=6$, cost $c_{ij}=4$ and flow $x_{ij}=3$. What residual capacity and cost does the backward arc have?
  1. $(j,i)$ with $r_{ji}=3$ and cost $4$
  2. $(j,i)$ with $r_{ji}=3$ and cost $-4$
  3. $(j,i)$ with $r_{ji}=2$ and cost $4$
  4. $(j,i)$ with $r_{ji}=2$ and cost $-4$
Explanation. The backward arc has residual capacity $x_{ij}-l_{ij}=3-1=2$ (the flow cannot go below the lower bound) and cost $-c_{ij}=-4$: decreasing $x_{ij}$ saves $c_{ij}$ per unit.
no-f-108 · level facile · notes
A feasible flow costs $80$. In its residual network the directed cycle $W$ has cost $c(W)=-3$ (sum of the residual costs) and residual capacity $r(W)=2$ (minimum of the residual capacities). What does the flow augmented along $W$ by $\theta=r(W)$ cost?
  1. $74$
  2. $77$
  3. $86$
  4. $78$
Explanation. Augmenting along a cycle changes the cost by $\theta\,c(W)=2 \cdot (-3)=-6$: the new cost is $74$. $77$ forgets to multiply by $\theta$, $86$ gets the sign wrong.
no-f-109 · level facile · notes
Let $\vet{x}$ be a feasible flow of the minimum cost flow model $\mathrm{MCF}$ on a network $G$, and $G(\vet{x})$ its residual network (forward arcs of cost $c_{ij}$, backward arcs of cost $-c_{ij}$). When is $\vet{x}$ optimal?
  1. When every arc of the network has zero reduced cost
  2. When the network $G$ has no directed cycle of negative cost
  3. If and only if $G(\vet{x})$ has no directed cycle of negative cost
  4. When it saturates the cheapest arcs of the network
Explanation. Negative cycle optimality: a negative cycle of $G(\vet{x})$ would improve the flow, and without negative cycles every other flow costs at least as much. The residual network counts, not $G$.
no-f-110 · level facile · notes
The minimum cost flow model $\mathrm{MCF}$ on a network $G$ with capacities $u_{ij}$ (possibly $+\infty$) and costs $c_{ij}$ is feasible. When is it unbounded (cost tending to $-\infty$)?
  1. If and only if $G$ has a directed cycle of negative cost
  2. If and only if $G$ has a directed cycle of negative cost with all capacities $u_{ij}=+\infty$
  3. If and only if some arc has negative cost and infinite capacity
  4. If and only if the residual network of a feasible flow has a negative cycle
Explanation. A negative cycle with a finite capacity can be used only a bounded number of times; a negative directed cycle with all capacities infinite is needed. A negative cycle in the residual network only says that the flow is not optimal.
no-f-111 · level facile · notes
Let $\vet{x}$ be an optimal flow of the minimum cost flow model (bounds $l_{ij} \le x_{ij} \le u_{ij}$) and $\vet{\pi}$ the potentials that certify it, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. On an arc with $l_{ij}<x_{ij}<u_{ij}$, what is $\bar{c}_{ij}$?
  1. It is positive
  2. It is negative
  3. It can have any sign
  4. It is zero, $\bar{c}_{ij}=0$
Explanation. By complementary slackness $\bar{c}_{ij}>0 \Rightarrow x_{ij}=l_{ij}$ and $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$: an arc strictly between its bounds has $\bar{c}_{ij}=0$.
no-f-112 · level facile · notes
The cycle canceling algorithm looks for negative cycles in the residual network $G(\vet{x})$ with Bellman–Ford. Why does it start it with $d^0(j)=0$ for every node $j$, instead of from a single source node?
  1. To find also the negative cycles not reachable from a single node
  2. To have all lengths non-negative
  3. Because $G(\vet{x})$ is always acyclic
  4. To reduce the number of passes to $1$
Explanation. Starting from all the nodes is like adding a node $r$ joined to all of them by zero-cost arcs: every negative cycle of $G(\vet{x})$ becomes reachable. From a single node the unreachable cycles would be missed.
no-f-113 · level facile · notes
In successive shortest paths, after Dijkstra (on the reduced costs) from the chosen excess node, every potential is updated by $\pi_i:=\pi_i-\min\{d(i),d(t)\}$, where $t$ is the chosen deficit node. Node $i$ has $\pi_i=5$ and $d(i)=7$, and $d(t)=4$. What is the new $\pi_i$?
  1. $\pi_i=-2$
  2. $\pi_i=9$
  3. $\pi_i=1$
  4. $\pi_i=12$
Explanation. $\pi_i:=5-\min\{7,4\}=5-4=1$: the nodes farther than $t$ decrease by $d(t)$ only. $-2$ uses $d(i)$, $9$ and $12$ get the sign wrong.
no-f-114 · level facile · notes
To decide whether a balanced network has a feasible flow one builds the auxiliary network: super source $s$ with arcs $(s,i)$ of capacity $b_i$ to the supply nodes, super sink $t$ with arcs $(i,t)$ of capacity $-b_i$. The total supply is $D=12$ and the maximum flow from $s$ to $t$ is $10$. What do we conclude?
  1. The maximum flow restricted to the original arcs is a feasible flow
  2. The network has no feasible flow
  3. The network has a feasible flow of cost $10$
  4. A dummy node with balance $-2$ must be added
Explanation. The network has a feasible flow if and only if the maximum flow of the auxiliary network has value $D$, that is, it saturates all the new arcs: with $10<12$ none exists.
no-f-115 · level facile · notes
The cycle canceling algorithm starts from a feasible flow and, while the residual network has a negative cycle, augments along it by its residual capacity. With integer data it starts from a flow of cost $80$, and the optimum is $60$. At most how many iterations does it make?
  1. $60$
  2. $80$
  3. $n\,m$
  4. $20$
Explanation. With integer data every cancellation lowers the cost by at least $1$: at most $\vet{c}'\vet{x}^0-z(\mathrm{MCF})=80-60=20$ iterations.
no-f-116 · level facile · notes
The successive shortest path algorithm sends flow along shortest paths of the residual network, whose arcs have costs $c^x_{ij}$ ($c_{ij}$ forward, $-c_{ij}$ backward). Why is Dijkstra run on the reduced costs $c^x_{ij}-\pi_i+\pi_j$ and not on the costs $c^x_{ij}$?
  1. Because backward arcs can have negative costs, reduced costs cannot
  2. Because the reduced costs are always integer
  3. To find the negative cycles of the residual network
  4. Because the costs $c^x_{ij}$ are not defined on backward arcs
Explanation. Backward arcs cost $-c_{ij}$, and Dijkstra with negative lengths can fail. The potentials make the lengths non-negative without changing the shortest paths.
no-f-117 · level facile · notes
A pseudoflow satisfies the arc bounds but not necessarily conservation; the imbalance of node $i$ is $e_i=b_i-(\text{outflow}-\text{inflow})$. Node $i$ has balance $b_i=5$, sends out $3$ units and receives nothing. What is $e_i$, and what kind of node is it?
  1. $e_i=-2$, a deficit node
  2. $e_i=3$, an excess node
  3. $e_i=2$, an excess node
  4. $e_i=8$, an excess node
Explanation. $e_i=5-(3-0)=2>0$: $i$ has still to send $2$ units, it is an excess node. A deficit node has $e_i<0$.
no-f-118 · level media · notes
A feasible flow $\vet{x}$ has the residual arcs (with costs $c^x$) $(1,2)$: $3$, $(2,3)$: $-1$, $(3,1)$: $-1$, $(2,1)$: $-3$. With the potentials $\vet{\pi}=(0,-3,-2)$ and reduced costs $c^x_{ij}-\pi_i+\pi_j$, which statement is correct?
  1. All the reduced costs of the residual network are $\ge 0$: $\vet{x}$ is optimal
  2. The arc $(2,3)$ has negative reduced cost: $\vet{x}$ is not optimal
  3. The arc $(2,1)$ has negative reduced cost: $\vet{x}$ is not optimal
  4. The residual network has a negative cycle: $\vet{x}$ is not optimal
Explanation. Reduced costs: $(1,2)$: $3-0-3=0$; $(2,3)$: $-1+3-2=0$; $(3,1)$: $-1+2+0=1$; $(2,1)$: $-3+3+0=0$. All $\ge 0$, so $\vet{x}$ is optimal; indeed the cycles $1,2,3,1$ and $1,2,1$ cost $1$ and $0$.
no-f-119 · level teorema · notes
Let $\vet{x}$ be a feasible flow of the minimum cost flow model, and $G(\vet{x})$ its residual network with costs $c^x_{ij}$. Which statement of reduced cost optimality is correct?
  1. $\vet{x}$ is optimal if and only if some $\vet{\pi}$ has $c_{ij}-\pi_i+\pi_j \ge 0$ on every arc of the network $G$
  2. $\vet{x}$ is optimal if and only if some $\vet{\pi}$ has $c^x_{ij}-\pi_i+\pi_j=0$ on every arc of $G(\vet{x})$
  3. $\vet{x}$ is optimal if and only if some $\vet{\pi}$ has $c^x_{ij}-\pi_i+\pi_j \ge 0$ on every arc of $G(\vet{x})$
  4. $\vet{x}$ is optimal if and only if $\vet{\pi}=\vet{0}$ gives non-negative reduced costs on $G(\vet{x})$
Explanation. The condition concerns the arcs of the residual network, with the costs $c^x_{ij}$. On the arcs of $G$ it reads: $\bar{c}_{ij}>0 \Rightarrow x_{ij}=l_{ij}$, $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$; $\bar{c} \ge 0$ on the whole network is not needed.
no-f-120 · level teorema · notes
A circulation on a directed graph $H=(N,F)$ is a vector $\vet{y} \ge \vet{0}$ with outflow equal to inflow at every node. Let $\vet{y} \neq \vet{0}$ be a circulation with $p$ arcs where $y_a>0$. Which statement is correct?
  1. $\vet{y}$ is a sum of at most $p$ positive multiples of directed cycles with arcs where $y_a>0$
  2. $\vet{y}$ is the incidence vector of a single directed cycle of $H$
  3. $\vet{y}$ is a sum of flows along paths from a source to a sink
  4. $\vet{y}$ is a sum of exactly $p$ positive multiples of directed cycles
Explanation. Decomposition lemma: find a cycle of arcs with $y>0$, subtract the minimum $\theta_1$ and repeat; every step zeroes at least one arc, so there are $k \le p$ cycles, integer if $\vet{y}$ is integer.
no-f-121 · level ipotesi · notes
We want to prove that a feasible flow $\vet{x}$ whose residual network $G(\vet{x})$ has no negative cycle is optimal, by comparing it with another feasible flow $\vet{x}'$. Which results are used?
  1. The total unimodularity of the incidence matrix and Cramer's rule
  2. The max-flow min-cut theorem on the auxiliary network
  3. Bellman's equations with an added node $r$ and zero-cost arcs
  4. The difference of the two flows is a circulation on $G(\vet{x})$, which decomposes into cycles
Explanation. One has $\vet{c}'\vet{x}'=\vet{c}'\vet{x}+\sum_h\theta_h\,c(W_h)$ with cycles $W_h$ of $G(\vet{x})$ and $\theta_h>0$ (lemmas «difference of two flows» and «decomposition into cycles»); without negative cycles the sum is $\ge 0$. Bellman's equations are used for the theorem with potentials instead.
no-f-122 · level ipotesi · notes
Reduced cost optimality says: $\vet{x}$ is optimal if and only if some $\vet{\pi}$ has $c^x_{ij}-\pi_i+\pi_j \ge 0$ on every arc of the residual network $G(\vet{x})$. In the «only if» part ($\vet{x}$ optimal), how are the potentials built?
  1. With the distances $d(i)$ in $G(\vet{x})$ from an added node $r$, joined to all at cost $0$: $\pi_i=-d(i)$
  2. Setting $\pi_i=0$ for every node, since $\vet{x}$ is optimal
  3. Solving the dual model with the network simplex
  4. Setting $\pi_i$ equal to the balance $b_i$ of every node
Explanation. An optimal flow has no negative cycle in $G(\vet{x})$, so the distances from $r$ are finite; Bellman's equations give $d(j) \le d(i)+c^x_{ij}$, that is $c^x_{ij}-\pi_i+\pi_j \ge 0$ with $\pi=-d$.
no-f-123 · level facile · notes
The successive shortest path algorithm starts from a pseudoflow and at every iteration sends $\delta \ge 1$ units from an excess node to a deficit node. It is applied to a network with integer data and total supply $D=15$. At most how many iterations does it make?
  1. $n\,m$
  2. $15$
  3. $n-1$
  4. It depends on the arc costs
Explanation. Every iteration reduces the sum of the positive imbalances by $\delta \ge 1$, and the sum starts at $D$: at most $D=15$ iterations.
no-f-124 · level facile · notes
In the residual network $G(\vet{x})$ of a flow, the directed cycle $W$ has three arcs with residual costs $2$, $-5$, $1$ and residual capacities $4$, $3$, $6$. What are the cost $c(W)$ (sum of the costs) and the residual capacity $r(W)$ (minimum of the capacities)?
  1. $c(W)=-2$, $r(W)=6$
  2. $c(W)=8$, $r(W)=3$
  3. $c(W)=-2$, $r(W)=13$
  4. $c(W)=-2$, $r(W)=3$
Explanation. $c(W)=2-5+1=-2$ and $r(W)=\min\{4,3,6\}=3$: the cycle is negative, and augmenting by $\theta=3$ lowers the cost by $6$.
no-f-125 · level facile · notes
A circulation on a directed graph is a vector $\vet{y} \ge \vet{0}$ on the arcs with outflow equal to inflow at every node. On the graph with arcs $(1,2)$, $(2,3)$, $(3,1)$, $(2,1)$, which vector $(y_{12},y_{23},y_{31},y_{21})$ is a circulation?
  1. $(1,1,1,1)$
  2. $(3,1,1,2)$
  3. $(2,1,2,1)$
  4. $(1,2,1,0)$
Explanation. Node $1$: out $y_{12}$, in $y_{31}+y_{21}$; node $2$: out $y_{23}+y_{21}$, in $y_{12}$; node $3$: out $y_{31}$, in $y_{23}$. With $(3,1,1,2)$: $3=1+2$, $1+2=3$, $1=1$. It is the sum of the cycles $1,2,3,1$ (once) and $1,2,1$ (twice).
no-f-126 · level facile · notes
A balanced network with zero lower bounds has balances $\vet{b}=(4,3,-2,-5)$. The auxiliary network adds the super source $s$, with an arc $(s,i)$ of capacity $b_i$ to every supply node, and the super sink $t$, with an arc $(i,t)$ of capacity $-b_i$ from every demand node. What must the maximum flow be for the network to have a feasible flow?
  1. $14$
  2. $0$
  3. $7$
  4. $5$
Explanation. It must saturate all the new arcs: the value must be the total supply $D=4+3=7$, which equals the total demand $2+5$. $14$ adds supplies and demands.
no-f-127 · level teorema · notes
Let $\vet{x}$ and $\vet{x}'$ be two feasible flows of the same network, and $G(\vet{x})$ the residual network of $\vet{x}$ with costs $c^x_{ij}$. Which statement on their difference is correct?
  1. $\vet{x}'-\vet{x}$ is always a non-negative vector on the arcs of the network
  2. The difference, written on the arcs of $G(\vet{x})$, is a circulation $\vet{y}$ and $\vet{c}'\vet{x}'-\vet{c}'\vet{x}=\sum c^x_{ij}y_{ij}$
  3. The difference is a flow from a source to a sink of $G(\vet{x})$
  4. The difference is a circulation on $G(\vet{x})$ only if the two flows have the same cost
Explanation. Lemma «difference of two flows»: increases go on forward arcs, decreases on backward arcs; equal balances give a circulation, and its cost with the $c^x$ is the difference of the costs.
no-f-383 · level facile · notes
In minimum cost flow, the arc $(1,2)$ has $l_{12}=0$, $u_{12}=4$, cost $c_{12}=2$ and flow $x_{12}=3$. Which arcs does it generate in the residual network $G(\vet{x})$, with which residual capacities $r$ and costs $c^x$?
  1. Only $(1,2)$, with $r=1$ and $c^x=2$
  2. $(1,2)$ with $r=3$, $c^x=2$ and $(2,1)$ with $r=1$, $c^x=-2$
  3. $(1,2)$ with $r=1$, $c^x=2$ and $(2,1)$ with $r=3$, $c^x=-2$
  4. $(1,2)$ with $r=1$, $c^x=2$ and $(2,1)$ with $r=3$, $c^x=2$
Explanation. Forward, $u-x=1$ units remain at cost $2$; backward, $x-l=3$ units can be removed, saving $2$ each: cost $-2$. The last option forgets the sign of the backward cost.
no-f-384 · level facile · notes
A circulation (outflow equal to inflow at every node, values $\ge 0$) has $y_{12}=3$, $y_{23}=3$, $y_{31}=2$, $y_{34}=1$, $y_{41}=1$. How does it decompose into directed cycles?
  1. $2$ times the cycle $1,2,3,1$ plus $1$ time the cycle $1,2,3,4,1$
  2. $3$ times the cycle $1,2,3,1$
  3. $1$ time the cycle $1,2,3,1$ plus $2$ times the cycle $1,2,3,4,1$
  4. It does not decompose: it is not a circulation
Explanation. The cycle $1,2,3,1$ can be taken $\min\{3,3,2\}=2$ times; what remains is $y_{12}=y_{23}=y_{34}=y_{41}=1$, the cycle $1,2,3,4,1$. Check: $3$ units enter node $3$ and $2+1$ leave.
no-f-385 · level facile · notes
In the residual network of a feasible flow there is the cycle $W$ with residual costs $-5$, $2$, $1$ and residual capacities $3$, $1$, $4$. By how much does the cost drop when augmenting along $W$ by the largest possible amount?
  1. By $6$
  2. By $8$
  3. By $4$
  4. By $2$: $\theta=r(W)=1$ and $c(W)=-2$
Explanation. $c(W)=-5+2+1=-2$ and $\theta=r(W)=\min\{3,1,4\}=1$: the cost drops by $\theta\,|c(W)|=2$. $6$ uses the capacity $3$ of the first arc, ignoring the bottleneck; $8$ and $4$ add absolute values or only the negative costs.
no-f-386 · level facile · notes
A balanced network has balances $\vet{b}=(5,2,0,-3,0,-4)$. In the auxiliary network (super source $s$ joined to the supply nodes, super sink $t$ joined to the demand nodes) the maximum flow from $s$ to $t$ is $6$. What is concluded?
  1. The network has a feasible flow of cost $6$
  2. The network has no feasible flow, since $6<7$
  3. A dummy node must be added
  4. The network has a feasible flow, since $6 \ge 4$
Explanation. A feasible flow exists if and only if the maximum flow saturates the arcs leaving $s$, that is, equals the total supply $D=5+2=7$. With $6$ one unit of supply cannot reach the demand.
no-f-387 · level ipotesi · notes
Proposition: a balanced network with $\vet{l}=\vet{0}$ has a feasible flow if and only if the maximum flow of the auxiliary network equals the total supply $D$. For the direction «maximum flow $D$ $\Rightarrow$ feasible flow», which fact is needed?
  1. The maximum flow is unique
  2. The costs are nonnegative
  3. With value $D$ every arc $(s,i)$ and $(i,t)$ is saturated, so conservation at the original nodes gives exactly the balances $b_i$
  4. The original network is acyclic
Explanation. The value $D$ is the total capacity of the arcs leaving $s$, so they are all saturated; so are the arcs into $t$ (total capacity $D$, balanced network). Then at every node the net flow on the original arcs is $b_i$. Costs do not matter.
no-f-388 · level facile · notes
The cycle-canceling algorithm (Klein) starts from a feasible flow. What does it do at every iteration?
  1. It finds a negative cycle $W$ of the residual network and augments along $W$ by $r(W)$, the minimum residual capacity
  2. It finds a shortest path from an excess node to a deficit node
  3. It adds an arc to the spanning tree
  4. It removes from the flow a cycle of positive cost
Explanation. Augmenting by $r(W)$ saturates an arc of $W$, which leaves the residual network: the cycle is canceled and the cost drops by $r(W)\,|c(W)|$. Shortest paths from excesses to deficits are the successive shortest path algorithm.
no-f-389 · level facile · notes
When does the cycle-canceling algorithm stop, and why is the final flow optimal?
  1. After $n-1$ iterations, by the Bellman–Ford theorem
  2. When every arc is saturated
  3. When the residual network has no more negative cycles, which is the optimality condition
  4. When the cost becomes negative
Explanation. A feasible flow is optimal if and only if its residual network has no negative cycles: the algorithm stops exactly there. The number of iterations depends on the data, not on $n$.
no-f-390 · level facile · notes
In the cycle-canceling algorithm, why does an iteration augment along the negative cycle $W$ by exactly $r(W)$ and not less?
  1. Because then the cost stays the same
  2. Because a smaller augmentation is not feasible
  3. Because $r(W)$ is always $1$
  4. Because then an arc of $W$ is saturated and leaves the residual network: the cycle is canceled
Explanation. Any $\theta \le r(W)$ gives a cheaper feasible flow; with $\theta=r(W)$ the saving is largest and the cycle disappears from the residual network. With integer data $r(W)$ is a positive integer, not necessarily $1$.
no-f-391 · level teorema · notes
Which statement about the link between cycle canceling and the negative cycle optimality theorem is correct?
  1. The algorithm is correct only if the network is acyclic
  2. The algorithm follows the theorem: a negative cycle improves the flow, and its absence certifies optimality
  3. The algorithm requires nonnegative costs
  4. The algorithm finds the optimum only if it starts from the zero flow
Explanation. The theorem says that $\vet{x}$ is optimal if and only if $G(\vet{x})$ has no negative cycles; the algorithm cancels negative cycles as long as there are any. It starts from any feasible flow, with costs of any sign.
no-f-392 · level facile · notes
To look for a negative cycle in the residual network $G(\vet{x})$, which may not be reachable from a given node, Bellman–Ford is run from a new node $r$ joined to every node by an arc of cost $0$. Which labels does the first pass give?
  1. $+\infty$ to every node except $r$
  2. $0$ to every node
  3. The minimum cost of an arc entering each node
  4. $-\infty$ to the nodes of a negative cycle
Explanation. The arcs $(r,j)$ of cost $0$ give $d(j)=0$ to every node right away, and the table is written from there with $d^0(j)=0$. This way every negative cycle is reachable from $r$.
no-f-393 · level teorema · notes
Bellman–Ford on the residual network $G(\vet{x})$ with $n$ nodes starts from $d^0(j)=0$ for every $j$. Which statement is correct?
  1. $G(\vet{x})$ has a negative cycle if and only if $d^1 \neq d^0$
  2. If $d^n=d^{n-1}$ the flow $\vet{x}$ is not optimal
  3. $d^k(j)$ is the minimum cost of a path from $1$ to $j$
  4. $G(\vet{x})$ has a negative cycle if and only if $d^n \neq d^{n-1}$; if $d^k=d^{k-1}$, $\pi_i=-d^k(i)$ gives nonnegative reduced costs
Explanation. $d^k(j)$ is the minimum cost of a walk with at most $k$ arcs ending at $j$ (possibly empty, of cost $0$). A change in pass $n$ certifies a negative cycle; stability gives potentials certifying optimality.
no-f-394 · level facile · notes
Bellman–Ford on the residual network with $n=6$ nodes gives $d^6(4)<d^5(4)$. How is a negative cycle found?
  1. The predecessors are read backwards starting from node $4$, one row per pass from $6$ to $1$: the walk found contains a negative cycle
  2. The cycle is formed by the nodes with negative label
  3. The cycle is the cheapest arc entering $4$
  4. One restarts from $d^0$ with source $4$
Explanation. The reconstructed walk has $n=6$ arcs on $6$ nodes, so it repeats a node; the cycle it contains is negative. A negative label is not enough: negative arcs without negative cycles also give negative labels.
no-f-395 · level ipotesi · notes
Theorem: with integer balances, capacities and costs, cycle canceling stops after at most $\vet{c}'\vet{x}^0-z(\mathrm{MCF})$ iterations ($\vet{x}^0$ initial flow). Which fact is needed to count the iterations?
  1. Every iteration cancels an arc of the network
  2. Every negative cycle has at most $n$ arcs
  3. Flows stay integer, so $r(W) \ge 1$ and $c(W) \le -1$: the cost drops by at least $1$ at every iteration
  4. Distances in the residual network do not decrease
Explanation. With integer data $r(W)$ is a positive integer and $c(W)$ a negative integer, so every iteration lowers the cost by at least $1$; the cost cannot go below the optimum. Nondecreasing distances concern Edmonds–Karp.
no-f-396 · level facile · notes
Cycle canceling, in Step 0, also checks whether the model is unbounded. When is a minimum cost flow instance with a feasible flow unbounded?
  1. When some cost is negative
  2. When the network has a directed cycle
  3. When there is a negative-cost cycle made of arcs of infinite capacity
  4. When the total supply exceeds the demand
Explanation. Along a negative cycle of arcs with $u_{ij}=+\infty$ flow can be sent without limit, lowering the cost to $-\infty$. A negative cost or any cycle is not enough.
no-f-397 · level facile · notes
Cycle canceling starts from a feasible flow of cost $80$ and stops with an optimal flow of cost $60$. With integer data, at most how many iterations did it make?
  1. $60$
  2. $80$
  3. $140$
  4. $20$
Explanation. Every iteration lowers the cost by at least $1$, so at most $80-60=20$ iterations. In the notes' example far fewer are needed, since every cycle lowers the cost by more than $1$.
no-f-398 · level facile · notes
In an iteration of cycle canceling, the negative cycle found has cost $c(W)=-6$ and residual capacity $r(W)=2$. The current flow costs $80$. What does the flow cost after the iteration?
  1. $68$
  2. $74$
  3. $78$
  4. $92$
Explanation. The new cost is $80+r(W)\,c(W)=80-12=68$. $74$ augments by one unit only; $92$ gets the sign wrong.
no-f-399 · level facile · notes
On the reference network of the chapter, if cycle canceling starts from the flow found in Step 0 with the maximum flow (which is already optimal), what happens?
  1. It runs $n$ iterations anyway
  2. It stops at the first run of Bellman–Ford, which finds no negative cycle
  3. It finds a cycle of cost $0$ and cancels it
  4. It declares the model unbounded
Explanation. If the initial flow is already optimal the residual network has no negative cycles, and the first Bellman–Ford search certifies it. This is why the notes show the algorithm from a more expensive flow.
no-f-400 · level facile · notes
A pseudoflow respects $\vet{l} \le \vet{x} \le \vet{u}$ but may violate conservation; the imbalance of node $i$ is $e_i=b_i-(\text{outflow}-\text{inflow})$. Node $2$ has $b_2=2$, outflow $3$ and inflow $0$. What is $e_2$?
  1. $5$
  2. $1$
  3. $-3$
  4. $-1$
Explanation. $e_2=2-(3-0)=-1$: the node has sent one unit more than its supply, and is now in deficit. The imbalances of all nodes add up to $0$.
no-f-401 · level facile · notes
Successive shortest paths, starting from $\vet{x}=\vet{0}$, send $\delta=3$ units on a path of cost $7$, then $2$ on one of cost $8$, then $1$ on one of cost $10$ and $1$ on one of cost $13$. What does the final flow cost?
  1. $60$
  2. $38$
  3. $47$
  4. $7$
Explanation. The cost grows by $\delta\,c(P)$ at every iteration: $21+16+10+13=60$. $38$ adds the path costs without multiplying by $\delta$; $47$ stops at the third iteration.
no-f-402 · level facile · notes
In successive shortest paths, what is the amount $\delta$ sent along the shortest path $P$ from the excess node $s$ to the deficit node $t$?
  1. $\delta=e_s$
  2. $\delta=r(P)$
  3. $\delta=\min\{e_s,\,-e_t,\,r(P)\}$
  4. $\delta=1$ always
Explanation. One cannot send more than the excess of $s$, more than the deficit of $t$, nor more than the minimum residual capacity of the path. With integer data $\delta \ge 1$, but not always $1$.
no-f-403 · level facile · notes
In successive shortest paths the paths are found by Dijkstra on the reduced costs $c^x_{ij}-\pi_i+\pi_j$, and the reduced cost of the path is $d(t)$. The path $P$ from $s$ to $t$ has $d(t)=4$, with $\pi_s=0$ and $\pi_t=-6$. What is its true cost $c(P)$?
  1. $4$
  2. $-2$
  3. $6$
  4. $10$
Explanation. Along the path the potentials cancel: $d(t)=c(P)-\pi_s+\pi_t$, so $c(P)=4+0+6=10$. The reduced cost is not the true cost when the potentials are nonzero.
no-f-404 · level teorema · notes
The successive shortest path algorithm keeps a pseudoflow and potentials with nonnegative reduced costs on the residual network. Which statement is correct?
  1. Every iteration lowers the cost of the pseudoflow
  2. It also works with negative cycles in the initial residual network
  3. When all imbalances are zero the pseudoflow is an optimal feasible flow
  4. It needs an initial feasible flow
Explanation. Nonnegative reduced costs on $G(\vet{x})$ certify optimality as soon as the pseudoflow becomes feasible. The cost grows at every iteration (flow is sent), and one starts from a pseudoflow, for instance $\vet{0}$, without negative cycles.
no-f-405 · level facile · notes
In the cycle-canceling algorithm, why can an iteration not use a negative cycle of residual capacity $r(W)=+\infty$ after Step 0?
  1. Because the residual network never has arcs of infinite capacity
  2. Because Step 0 has already ruled out negative cycles made only of infinite-capacity arcs, that is, the unbounded case
  3. Because Bellman–Ford does not find cycles with infinite arcs
  4. Because the costs are all positive
Explanation. Step 0 checks the negative cycles of the graph of the arcs with $u_{ij}=+\infty$: if there is one the model is unbounded and the algorithm stops. Otherwise every negative cycle of the residual network has an arc of finite capacity, and $r(W)<+\infty$.
no-f-406 · level facile · notes
In cycle canceling the Bellman–Ford search on the residual network with $n=6$ nodes gives $d^6 \neq d^5$, and tracing back the predecessors gives a walk of $6$ arcs. Why does it surely contain a cycle?
  1. Because every walk contains a cycle
  2. Because the residual network is strongly connected
  3. Because $6$ arcs touch $7$ node positions on only $6$ nodes: a node repeats
  4. Because the first arc has negative cost
Explanation. A walk with $n$ arcs visits $n+1$ nodes (with repetitions), so it repeats at least one, and the piece between the two occurrences is a cycle, which the Proposition shows to be negative.

7. Transportation and assignment (72)

no-f-128 · level facile · notes
In the transportation problem the origins $i \in P$ have supplies $a_i$ and the destinations $j \in D$ demands $d_j$; we ship $x_{ij} \ge 0$ from $i$ to $j$, without capacities, meeting supplies and demands exactly. When does an instance have a feasible solution?
  1. When all the costs $c_{ij}$ are non-negative
  2. If and only if it is balanced, $\sum_{i \in P} a_i=\sum_{j \in D} d_j$
  3. When origins and destinations are equally many
  4. Always, since there are no arc capacities
Explanation. Adding up the origin constraints and the destination constraints gives the same sum of the variables: balance is necessary; and it is sufficient, for example with $x_{ij}=a_i d_j/S$, where $S$ is the total supply.
no-f-129 · level facile · notes
A balanced transportation instance has $m=3$ origins and $n=4$ destinations; a cell $(i,j)$ of the table corresponds to the variable $x_{ij}$. How many cells does a basis of the $\mathrm{TP}$ model have?
  1. $7$
  2. $12$
  3. $6$
  4. $4$
Explanation. A basis is a spanning tree of the complete bipartite network with $m+n=7$ nodes: it has $m+n-1=6$ cells, even if some of them are $0$ (degenerate basis). $12=m\,n$ are all the cells.
no-f-130 · level facile · notes
The transportation model $\mathrm{TP}$ of a balanced instance with $m$ origins and $n$ destinations has one constraint per origin (supply) and one per destination (demand). What is the rank of these $m+n$ constraints?
  1. $m+n-1$
  2. $m+n$
  3. $m\,n$
  4. $\min\{m,n\}$
Explanation. The complete bipartite network is connected, so its incidence matrix has rank $m+n-1$; each constraint is implied by the others.
no-f-131 · level facile · notes
For an initial transportation solution, at every step a cell is filled as much as possible and a row or a column is crossed out. The north-west corner rule picks the top-left active cell, the minimum cost rule the cheapest active cell. What is the difference?
  1. The first always gives an optimal solution
  2. The second may give a non-basic solution
  3. The first fills one cell per row, the second one per column
  4. The first ignores the costs; both give a basic solution
Explanation. Both fill one cell and cross out one line per step, so they give a basic feasible solution with $m+n-1$ cells; the north-west corner does not look at the costs, and usually starts farther from the optimum.
no-f-132 · level facile · notes
In the potential method of the course the basic cells have $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$, with $\pi_i$ for origin $i$ and $\pi_j$ for destination $j$. Many textbooks use the u-v method instead, with $u_i+v_j=c_{ij}$ on the basic cells. How are $u$, $v$ and $\pi$ related?
  1. $u_i=-\pi_i$ and $v_j=\pi_j$
  2. $u_i=\pi_i$ and $v_j=-\pi_j$
  3. $u_i=\pi_i$ and $v_j=\pi_j$
  4. There is no relation: the reduced costs are different
Explanation. From $\pi_i-\pi_j=c_{ij}$ on the basic cells, $u_i=\pi_i$ for the origins and $v_j=-\pi_j$ for the destinations: the reduced costs are the same, only the potentials of the destinations change sign.
no-f-133 · level facile · notes
In the potential method for transportation, the entering cell closes with the basic cells a cycle with alternating signs: the $+$ cells increase by $\theta$, the $-$ cells decrease by $\theta$. The $-$ cells hold $40$, $15$, $25$ and the $+$ cells (the entering one excluded) $10$, $5$. What is the step $\theta$?
  1. $5$
  2. $40$
  3. $15$
  4. $0$
Explanation. $\theta$ is the largest step that makes no cell negative, that is, the minimum over the $-$ cells only: $\min\{40,15,25\}=15$. The $+$ cells increase and do not limit the step.
no-f-134 · level facile · notes
In the potential method for transportation the current basic solution costs $440$. The cell $e$ with reduced cost $\bar{c}_e=-3$ enters, and the step along its cycle is $\theta=10$. What does the new basic solution cost?
  1. $410$
  2. $437$
  3. $470$
  4. $430$
Explanation. The cost changes by $\theta\,\bar{c}_e=10 \cdot (-3)=-30$: $440-30=410$. With $\theta=0$ (degenerate pivot) only the basis would change.
no-f-135 · level facile · notes
A transportation instance has total supply $70$ and total demand $55$. The balanced model requires supply equal to demand. How is the instance balanced, without changing its optimal solutions?
  1. Add a dummy origin with supply $15$
  2. Reduce all the supplies proportionally
  3. Add a dummy destination with demand $15$ and costs equal to the largest cost
  4. Add a dummy destination with demand $15$ and zero costs
Explanation. With more supply than demand a dummy destination absorbs the excess $70-55=15$, at zero cost; a dummy origin is needed when the demand exceeds the supply.
no-f-136 · level facile · notes
The assignment model $\mathrm{AP}$ assigns $n$ workers to $n$ jobs with $x_{ij} \in \{0,1\}$, every row and every column adding up to $1$. Why does its LP relaxation ($x_{ij} \ge 0$) have an optimal solution that is an assignment?
  1. Because the costs $c_{ij}$ are integer
  2. Because it is a transportation model with $a_i=d_j=1$, with integer vertices
  3. Because the constraint $x_{ij} \le 1$ is imposed explicitly
  4. It is not true: branch-and-bound is always needed
Explanation. The relaxation is a transportation instance with unit supplies and demands; its vertices are integer by total unimodularity, and an integer solution with rows and columns adding up to $1$ is a permutation matrix.
no-f-137 · level facile · notes
We want an assignment of $n$ workers to $n$ jobs of maximum profit, with profits $p_{ij}$ and largest profit $p_{\max}$. The Hungarian algorithm minimizes non-negative costs. With which costs $c_{ij}$ is it run?
  1. $c_{ij}=p_{ij}$
  2. $c_{ij}=1/p_{ij}$
  3. $c_{ij}=p_{\max}-p_{ij}$
  4. $c_{ij}=p_{ij}-p_{\max}$
Explanation. Minimizing $-p_{ij}$ is the same as maximizing the profits, and $c_{ij}=p_{\max}-p_{ij}$ gives the same optimum (every assignment changes by the constant $n\,p_{\max}$) with non-negative costs.
no-f-138 · level facile · notes
In a reduced $4 \times 4$ matrix (non-negative entries) some zeros are independent if no two of them lie in the same row or column. The maximum number of independent zeros is $3$. What is the minimum number of lines (rows or columns) covering all the zeros?
  1. $3$
  2. $4$
  3. $2$
  4. It depends on where the zeros are
Explanation. By the theorem of König and Egerváry the maximum number of independent zeros equals the minimum number of lines covering the zeros: $3$.
no-f-139 · level facile · notes
In Step 3 of the Hungarian algorithm on an $n \times n$ matrix with $n=5$, the zeros are covered by $k=3$ lines and the smallest uncovered entry is $\delta=2$. By how much does the dual value $\sum_{i \in P}\pi_i-\sum_{j \in D}\pi_j$, a lower bound on the cost of every assignment, grow?
  1. $2$
  2. $4$
  3. $6$
  4. $10$
Explanation. Step 3 increases the dual value by $\delta\,(n-k)=2\,(5-3)=4$.
no-f-140 · level facile · notes
In Step 3 of the Hungarian algorithm the zeros of the reduced matrix are covered by the minimum number of lines, and $\delta$ is the smallest uncovered entry. How does the reduced matrix change?
  1. $\delta$ is subtracted from all the entries
  2. $\delta$ is subtracted from the covered entries
  3. $\delta$ is added to the uncovered entries
  4. $\delta$ is subtracted from the uncovered ones and added to those covered twice
Explanation. The uncovered entries drop by $\delta$ (at least one new zero appears), those covered by a row and a column grow by $\delta$, the others stay the same.
no-f-141 · level media · notes
The cost matrix of a $3 \times 3$ assignment has rows $(4,2,5)$, $(3,6,4)$, $(7,5,3)$. Step 0 of the Hungarian algorithm subtracts from every row its minimum, then from every column its minimum. What is the resulting dual value, that is, the sum of the subtracted minima?
  1. $7$
  2. $9$
  3. $8$
  4. $10$
Explanation. Row minima: $2,3,3$ (sum $8$). Matrix: $(2,0,3)$, $(0,3,1)$, $(4,2,0)$; every column already has a zero, so no column reduction. The value is $8$, and the assignment $(1,2),(2,1),(3,3)$ costs $2+3+3=8$: it is optimal.
no-f-142 · level teorema · notes
In transportation, let $\bar{\vet{x}}$ be the basic feasible solution of the basis $T$, with potentials $\vet{\pi}$ such that $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the cells of $T$. Which statement of the optimality criterion is correct?
  1. If $\bar{c}_{ij} \ge 0$ for every cell, $\bar{\vet{x}}$ is optimal and $\vet{\pi}$ is optimal for the dual $D(\mathrm{TP})$
  2. If $\bar{c}_{ij} \le 0$ for every cell, $\bar{\vet{x}}$ is optimal and $\vet{\pi}$ is optimal for the dual $D(\mathrm{TP})$
  3. If $\bar{c}_{ij} \ge 0$ for every cell, $\bar{\vet{x}}$ is always the unique optimal solution
  4. $\bar{\vet{x}}$ is optimal if and only if none of its basic cells is $0$
Explanation. With $\bar{c} \ge 0$ every feasible solution costs at least $\sum a_i\pi_i-\sum d_j\pi_j$, which is the cost of $\bar{\vet{x}}$. Uniqueness needs $\bar{c}_{ij}>0$ on all the nonbasic cells.
no-f-143 · level teorema · notes
The transportation model $\mathrm{TP}$ has $m$ origins and $n$ destinations; every cell $(i,j)$ corresponds to an arc of the complete bipartite network. Which statement on its bases is correct?
  1. Every set of $m+n-1$ cells is a basis of the model
  2. A basis has $m\,n$ cells, one for every origin–destination pair
  3. A basis has several basic solutions, one for each order of the leaves
  4. $m+n-1$ cells form a basis if and only if their arcs form a spanning tree
Explanation. The bases are the spanning trees of the complete bipartite network; the basic solution is found leaf by leaf, it is unique and integer when supplies and demands are integer. A set of cells with a cycle is not a basis.
no-f-144 · level ipotesi · notes
The optimality criterion of the potential method says: if $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j \ge 0$ on every cell and $\bar{c}_{ij}=0$ on the basic cells, the basic solution $\bar{\vet{x}}$ is optimal. Which facts are used in the proof?
  1. The total unimodularity of the constraint matrix and Cramer's rule
  2. Cost $=\sum \bar{c}_{ij}x_{ij}+\sum a_i\pi_i-\sum d_j\pi_j$, $\bar{c} \ge 0$, $\vet{x} \ge \vet{0}$, weak duality
  3. The theorem of König and Egerváry on independent zeros
  4. The termination of the potential method when $\theta>0$
Explanation. For $\bar{\vet{x}}$ the term $\sum \bar{c}_{ij}\bar{x}_{ij}$ is zero, for every other $\vet{x} \ge \vet{0}$ it is $\ge 0$: $\bar{\vet{x}}$ is optimal; $\vet{\pi}$ is feasible for the dual with the same value, hence optimal by weak duality.
no-f-145 · level ipotesi · notes
The potential method for transportation lets a cell with $\bar{c}_e<0$ enter and moves $\theta$ units along its cycle. To prove that it terminates when $\theta>0$ at every iteration, which results are used?
  1. The max-flow min-cut theorem on the bipartite network
  2. The north-west corner rule and the minimum cost rule
  3. The theorem of König and Egerváry on independent zeros
  4. The cost drops by $\theta\,|\bar{c}_e|>0$, a basis has one solution, the bases are finitely many
Explanation. A basis visited twice would have two different costs, which is impossible since the basic solution is unique; the bases are finitely many, so the method stops, and at the end the optimality criterion applies.
no-f-146 · level facile · notes
An uncapacitated network with costs $c_{ij} \ge 0$ has supply, demand and transshipment nodes. It is reduced to a transportation problem between supply and demand nodes. Which cost is used between origin $i$ and destination $j$?
  1. The cost $c_{ij}$ of the arc $(i,j)$, or $+\infty$ if it is missing
  2. The largest cost of a path from $i$ to $j$
  3. The distance $\tilde{d}(i,j)$, length of a shortest path from $i$ to $j$
  4. The number of arcs of a path from $i$ to $j$
Explanation. Proposition «transshipment as transportation»: without capacities every unit is best sent along a shortest path, so the cost of the pair $(i,j)$ is the distance $\tilde{d}(i,j)$ with lengths $c_{ij}$.
no-f-147 · level facile · notes
The north-west corner rule, on a balanced transportation instance with $m=3$ origins and $n=5$ destinations, fills one cell and crosses out one row or column per step. After how many steps does it stop?
  1. $7$
  2. $8$
  3. $15$
  4. $5$
Explanation. Theorem «the initial solution is basic»: it stops after $m+n-1=7$ steps, with a basis of $7$ cells (some may be $0$). $15=m\,n$ are all the cells.
no-f-148 · level facile · notes
In the potential method the nonbasic cell $e$ closes a unique cycle with the basic cells; starting from $e$ the signs alternate $+,-,+,-,\dots$. How many $+$ cells and $-$ cells does every row or column touched by the cycle contain?
  1. Two $+$ cells and no $-$ cell
  2. One $+$ cell and one $-$ cell
  3. Any number, as long as it is even
  4. A single cell, $+$ or $-$
Explanation. Lemma «the cycle of a nonbasic cell»: the cycle enters and leaves every line with two consecutive cells of opposite sign, so moving $\theta$ along the cycle leaves supplies and demands unchanged.
no-f-149 · level facile · notes
In the Hungarian algorithm the reduced matrix has entries $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j \ge 0$, and the dual value is $\sum_{i}\pi_i-\sum_{j}\pi_j=17$. An assignment uses only cells with $\bar{c}_{ij}=0$. What do we conclude?
  1. It costs $0$, since it uses only zeros of the reduced matrix
  2. It costs at least $17$, but it may not be optimal
  3. It is optimal only if it is the unique assignment of zeros
  4. It costs $17$ and it is optimal, also for the LP relaxation
Explanation. Corollary «zero-cost assignments are optimal»: the cost of every assignment is $\sum \bar{c}_{ij}x_{ij}+17$, and with $\bar{c} \ge 0$ none costs less than $17$. Zero is the reduced cost, not the cost.
no-f-150 · level facile · notes
In a $3 \times 3$ matrix with non-negative entries the zeros are in the cells $(1,1)$, $(1,2)$, $(2,1)$, $(3,3)$. Zeros are independent if no two of them lie in the same row or column. At most how many independent zeros can be chosen?
  1. $3$
  2. $2$
  3. $4$
  4. $1$
Explanation. For example $(1,2)$, $(2,1)$, $(3,3)$: three zeros in different rows and columns, that is, an assignment of zero reduced cost. With $3$ rows no more can be chosen.
no-f-407 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the network associated with $m$ origins and $n$ destinations has an arc from every origin to every destination. How many nodes and arcs does it have?
  1. $m+n$ nodes and $m\,n$ arcs
  2. $m\,n$ nodes and $m+n$ arcs
  3. $m+n$ nodes and $m+n-1$ arcs
  4. $m+n+2$ nodes and $m\,n+m+n$ arcs
Explanation. One node per origin and one per destination; one arc per origin–destination pair: the complete bipartite network. $m+n-1$ is the number of cells of a basis, not of arcs.
no-f-408 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the origins are numbered $1,\dots,m$ and the destinations $m+1,\dots,m+n$. With $m=3$ and $n=4$, what are the destinations called?
  1. $1,2,3,4$
  2. $0,1,2,3$
  3. $4,5,6,7$
  4. $3,4,5,6$
Explanation. The destinations follow the origins: $m+1=4$ up to $m+n=7$. This gives every node its own number, and later its own potential $\pi_v$.
no-f-409 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, which constraints does the model $\mathrm{TP}$ of a balanced instance have?
  1. $\sum_j x_{ij} \le a_i$ and $\sum_i x_{ij} \ge d_j$, with integer $x_{ij}$
  2. $\sum_j x_{ij}=a_i$ for every origin, $\sum_i x_{ij}=d_j$ for every destination, $x_{ij} \ge 0$
  3. $\sum_j x_{ij}=1$ and $\sum_i x_{ij}=1$
  4. $x_{ij} \le \min\{a_i,d_j\}$ and nothing else
Explanation. Every origin ships all its supply and every destination receives all its demand; the $x_{ij}$ are continuous and nonnegative (integrality comes from total unimodularity). The equations with $1$ are assignment.
no-f-410 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the transportation table has one row per origin and one column per destination, with the supplies in the last column and the demands in the last row. When is a vector $\vet{x} \ge \vet{0}$ written in the table feasible?
  1. When every cell has value at most $\min\{a_i,d_j\}$
  2. When the sum of all cells is the total supply
  3. When it has exactly $m+n-1$ positive cells
  4. When every row adds up to its supply and every column to its demand
Explanation. The constraints of the model are exactly the row and column sums. The total sum alone is not enough; $m+n-1$ cells characterize bases, not feasibility.
no-f-411 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, three warehouses have supply $30$ each and four shops demands $10$, $25$, $15$, $40$. Is the instance balanced?
  1. Yes: total supply and total demand are both $90$
  2. No: the supply is $30$ and the demand $90$
  3. No: there are more shops than warehouses
  4. Yes, but only if all costs are equal
Explanation. Balanced means total supply equal to total demand: $3 \cdot 30=90=10+25+15+40$. The number of origins and destinations and the costs do not matter.
no-f-412 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, a solution has $x_{14}=10$, $x_{15}=20$, $x_{25}=5$ and costs $c_{14}=1$, $c_{15}=9$, $c_{25}=4$ (the other used cells are not in question). What do these three cells cost?
  1. $14$
  2. $35$
  3. $210$
  4. $200$
Explanation. The cost is $\sum c_{ij}x_{ij}$: $1 \cdot 10+9 \cdot 20+4 \cdot 5=10+180+20=210$. $35$ adds the quantities, $14$ the costs.
no-f-413 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, why are neither transshipment nodes nor arc capacities needed in the transportation problem?
  1. Because the costs are all positive
  2. Because every arc goes directly from an origin to a destination, and the amounts are limited only by supplies and demands
  3. Because solutions are always degenerate
  4. Because the destinations have unit demand
Explanation. The network is complete bipartite: a unit goes from an origin to a destination along a single arc. The only limitations are the row and column sums. Demands are arbitrary (unit only in assignment).
no-f-414 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the total supply is $100$ and the total demand $90$, and every origin may ship less than its supply. What is added to balance the instance?
  1. A dummy origin with supply $10$
  2. A dummy destination with demand $100$
  3. All supplies are reduced by $10\%$
  4. A dummy destination with demand $10$ and cost $0$ from every origin
Explanation. The dummy destination collects the unused supply, $100-90=10$, at cost $0$: the amount it receives from $i$ is the unused supply of $i$. A dummy origin is needed when supply is short.
no-f-415 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the total demand ($120$) exceeds the total supply ($100$), and every unit of unmet demand of destination $j$ costs a penalty $p_j$. How is the instance balanced?
  1. With a dummy destination of demand $20$
  2. With a dummy origin of supply $20$ and cost $p_j$ in its cell $(\cdot,j)$
  3. With a dummy origin of supply $20$ and cost $0$ in every cell, always
  4. It cannot be: the instance is infeasible
Explanation. The dummy origin «supplies» the missing demand, $120-100=20$; sending a unit to $j$ from the dummy origin means leaving it unmet, at cost $p_j$. Cost $0$ is used only if there are no penalties.
no-f-416 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, an instance with excess supply has been balanced with the dummy destination $8$ (cost $0$). In the optimal solution $x_{18}=10$ and $x_{28}=x_{38}=0$. What does it mean?
  1. Destination $8$ receives $10$ units at cost $10$
  2. Origins $2$ and $3$ are unused
  3. Origin $1$ does not ship $10$ units of its supply, origins $2$ and $3$ ship everything
  4. The solution is infeasible
Explanation. The amount sent to the dummy destination is the unused supply: origin $1$ keeps $10$, the others ship all their supply. The cost of those cells is $0$.
no-f-417 · level teorema · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, with total supply larger than demand and origins shipping «at most» their supply, a dummy destination is added with demand equal to the excess and costs $0$. Which statement is correct?
  1. The solutions of the two instances correspond with the same cost: it is the dummy node of the minimum cost flow model
  2. The balanced instance has strictly smaller optimal cost
  3. The dummy node makes the instance degenerate, so it cannot be solved
  4. The dummy destination must have positive cost, otherwise it receives everything
Explanation. With costs $0$ the dummy destination absorbs only the unused supply, and the cost does not change; it is the dummy node of the chapter on flow models, as a column of the table. It does not receive «everything»: its demand is only the excess.
no-f-418 · level facile · notes
A transshipment network without capacities, with costs $c_{ij} \ge 0$, is reduced to a transportation instance between the supply nodes and the demand nodes. Which costs are used in the table?
  1. The costs $c_{ij}$ of the direct arcs, $+\infty$ if the arc is missing
  2. The number of arcs of the shortest path
  3. The distances $\tilde{d}(i,j)$ of the shortest paths from $i$ to $j$
  4. The sum of all costs of the arcs leaving $i$
Explanation. Without capacities every unit travels along a shortest path, and only the distance between origin and destination matters. Using only direct arcs would ignore the routes through transshipment nodes.
no-f-419 · level ipotesi · notes
Proposition: a transshipment network with costs $c_{ij} \ge 0$ has the same optimal value as the transportation instance with costs $\tilde{d}(i,j)$ (distances). Which assumption is essential for the reduction?
  1. The arcs have no capacities: every unit can follow a shortest path without limits
  2. The network is acyclic
  3. Every node is a supply or demand node
  4. The balances are all equal
Explanation. With capacities two units could not always use the same shortest path, and distances would not be enough. Nonnegative costs ensure the distances exist; transshipment nodes are allowed and the network may have cycles.
no-f-420 · level facile · notes
In a transshipment network without capacities the distance from supply node $1$ to demand node $6$ is $\tilde{d}(1,6)=13$, along the path $1,3,2,4,6$. In the solution of the equivalent transportation instance $y_{16}=2$. Which flow corresponds?
  1. $2$ units on every arc leaving $1$
  2. $13$ units on the arc $(1,6)$
  3. $1$ unit on each of two paths from $1$ to $6$
  4. $2$ units along the path $1,3,2,4,6$, of cost $2 \cdot 13=26$
Explanation. The $y_{16}$ units are sent along a shortest path from $1$ to $6$: every arc of the path carries $2$ more units, and the cost is $y_{16}\tilde{d}(1,6)$. The arc $(1,6)$ might not exist.
no-f-421 · level ipotesi · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, a basic feasible solution (basic cells forming a spanning tree of the bipartite network) is a vertex of the polyhedron of the model $\mathrm{TP}$. Which fact makes it integer when supplies and demands are integer?
  1. There are at most $m+n-1$ basic cells
  2. The system of the basic cells is solved from the leaves of the tree, one cell at a time, with only sums and differences of $a_i$ and $d_j$
  3. The costs are integer
  4. The potential method rounds the amounts
Explanation. A leaf of the tree is a row or column with a single basic cell, which gets all the residual supply or demand; going on this way every amount is a sum and difference of integers. Costs do not matter for vertices.
no-f-422 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the initial solution algorithm fills a cell with the largest possible amount and crosses out a row or a column. When the residual supply $\bar{a}_i$ and the residual demand $\bar{d}_j$ run out together, what does it cross out?
  1. Both, the row and the column
  2. Only the column
  3. Neither
  4. Only the row (if another row is active); the column stays with residual demand $0$
Explanation. Crossing out a single line guarantees that the solution has $m+n-1$ basic cells (a spanning tree): a later cell of the column gets the amount $0$, and the solution is degenerate. Crossing out both would give one cell less.
no-f-423 · level teorema · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, which statement about the initial basic feasible solution algorithm (northwest corner or minimum cost rule) is correct?
  1. It stops after $m+n-1$ steps, and the filled cells form a basis: a spanning tree of the bipartite network
  2. It always gives an optimal solution with the minimum cost rule
  3. It always gives a nondegenerate solution
  4. It fills $m\,n$ cells
Explanation. Every step crosses out exactly one line, the last one two: $m+n-1$ steps and cells, forming a spanning tree. The minimum cost rule usually gives a better solution, but not an optimal one; the solution may be degenerate.
no-f-424 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, in an instance with $m=4$ origins and $n=6$ destinations, how many basic cells does a basic feasible solution built by the northwest corner rule have?
  1. $10$
  2. $9$
  3. $24$
  4. $6$
Explanation. A basis has $m+n-1=9$ cells, some possibly with amount $0$ (degeneracy). $24=m\,n$ is the number of all cells, $10=m+n$ the number of constraints.
no-f-425 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, with supplies $a=(30,30,30)$ and demands $d=(10,25,15,40)$ (destinations $4,5,6,7$), the northwest corner rule starts from the cell $(1,4)$ and moves right or down. Which are the first three filled cells and their amounts?
  1. $(1,4)=10$, $(1,5)=25$, $(1,6)=15$
  2. $(1,4)=30$, $(2,4)=0$, $(2,5)=25$
  3. $(1,4)=10$, $(1,5)=20$, $(2,5)=5$
  4. $(1,4)=10$, $(2,4)=20$, $(2,5)=5$
Explanation. $(1,4)$ takes $\min\{30,10\}=10$ and crosses out column $4$; $(1,5)$ takes the $20$ units left in row $1$ and crosses out the row; $(2,5)$ takes the $5$ still missing in column $5$. The first option exceeds the supply of row $1$.
no-f-426 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, why is the northwest corner solution often expensive?
  1. Because it ignores the costs: it chooses the cells only by their position in the table
  2. Because it is not basic
  3. Because it does not respect the demands
  4. Because it uses more than $m+n-1$ cells
Explanation. The rule only moves right or down, without looking at $c_{ij}$: in the notes' example it sends $20$ units on the cell $(1,5)$ of cost $9$, and costs $440$ against $170$ for the minimum cost rule. It is still a basic feasible solution.
no-f-427 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, with $a=(20,15)$ and $d=(10,10,15)$, which solution does the northwest corner rule give (cells $(i,j)$ with $i \in \{1,2\}$, $j \in \{3,4,5\}$)?
  1. $x_{13}=10$, $x_{14}=10$, $x_{25}=15$
  2. $x_{13}=20$, $x_{24}=10$, $x_{25}=5$
  3. $x_{13}=10$, $x_{15}=10$, $x_{24}=10$, $x_{25}=5$
  4. $x_{13}=10$, $x_{14}=10$, $x_{24}=0$, $x_{25}=15$
Explanation. $(1,3)=10$ crosses out column $3$; $(1,4)=10$ exhausts row $1$ and column $4$ together: only the row is crossed out, and $(2,4)$ gets $0$; finally $(2,5)=15$. There are $m+n-1=4$ cells, one zero: a degenerate solution.
no-f-428 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the minimum cost rule chooses at every step the cheapest cell among the active rows and columns. If two cells have the same minimum cost, which one does it choose by the convention of the notes?
  1. The one with the smaller row (and with equal rows the smaller column)
  2. The one with the largest amount
  3. The one with the larger column
  4. A random one
Explanation. In the notes' example $(1,4)$ and $(3,5)$ both cost $1$, and $(1,4)$ comes first because its row is smaller. The rule makes the result unique.
no-f-429 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, with $a=(20,15)$, $d=(10,10,15)$ and costs $c_{13}=4$, $c_{14}=1$, $c_{15}=3$, $c_{23}=2$, $c_{24}=5$, $c_{25}=6$, which is the first cell chosen by the minimum cost rule, and how much does it get?
  1. $(2,3)$, $10$ units
  2. $(1,3)$, $10$ units
  3. $(1,4)$, $10$ units
  4. $(1,4)$, $20$ units
Explanation. The cheapest cell is $(1,4)$ with cost $1$; it gets $\min\{a_1,d_4\}=\min\{20,10\}=10$ and column $4$ is crossed out. $20$ exceeds the column's demand.
no-f-430 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, on the reference instance of the chapter the northwest corner rule gives cost $440$ and the minimum cost rule $170$. What can be said about the optimal cost $z^\star$?
  1. $z^\star=170$
  2. $z^\star=440$
  3. $z^\star \ge 440$
  4. $z^\star \le 170$: both are feasible solutions, hence upper bounds
Explanation. Every feasible solution gives an upper bound on the minimum, so $z^\star \le \min\{440,170\}=170$. Whether the minimum cost solution is optimal must be checked with the potentials.
no-f-431 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, in the potential method the basic cells have zero reduced cost, $\pi_i-\pi_j=c_{ij}$, with $\pi_7=0$ (last destination). The basic cells $(2,7)$ and $(2,5)$ have $c_{27}=2$, $c_{25}=4$. What are $\pi_2$ and $\pi_5$?
  1. $\pi_2=-2$, $\pi_5=2$
  2. $\pi_2=2$, $\pi_5=-2$
  3. $\pi_2=2$, $\pi_5=6$
  4. $\pi_2=2$, $\pi_5=2$
Explanation. $\pi_2=\pi_7+c_{27}=2$ and $\pi_5=\pi_2-c_{25}=-2$. The third option adds instead of subtracting for a destination; the first reverses all signs.
no-f-432 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the dual of the model $\mathrm{TP}$ has a free potential $\pi_v$ for every node and constraints $\pi_i-\pi_j \le c_{ij}$. What is its objective function?
  1. $\min \sum_i a_i\pi_i+\sum_j d_j\pi_j$
  2. $\max \sum_{i,j} c_{ij}\pi_i$
  3. $\max \sum_i \pi_i-\sum_j \pi_j$
  4. $\max \sum_i a_i\pi_i-\sum_j d_j\pi_j$
Explanation. The destination constraints are written $-\sum_i x_{ij}=-d_j$, so the right-hand side for $\pi_j$ is $-d_j$: $\max \sum_i a_i\pi_i-\sum_j d_j\pi_j$. The third option is the assignment case $a_i=d_j=1$.
no-f-433 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, with the potentials $\pi_3=6$ (origin $3$) and $\pi_5=-2$ (destination $5$) and the cost $c_{35}=1$, what is the reduced cost $\bar{c}_{35}=c_{35}-\pi_3+\pi_5$, and what does it indicate?
  1. $9$: the cell is not convenient
  2. $-5$: the cell is convenient
  3. $-7$: the cell is a candidate to enter the basis
  4. $0$: the cell is basic
Explanation. $\bar{c}_{35}=1-6-2=-7<0$: moving flow onto $(3,5)$ lowers the cost by $7$ per unit, so the basis is not optimal and $(3,5)$ may enter. $9$ gets the sign of $\pi_5$ wrong.
no-f-434 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, in the potential method the cell $(3,5)$ enters, with $\bar{c}_{35}=-7$. Its cycle is $(3,5)^+,(2,5)^-,(2,7)^+,(3,7)^-$, with $\bar{x}_{25}=5$ and $\bar{x}_{37}=30$. The solution costs $440$. What is $\theta$, and what does the new solution cost?
  1. $\theta=5$, cost $405$
  2. $\theta=30$, cost $230$
  3. $\theta=5$, cost $475$
  4. $\theta=10$, cost $370$
Explanation. $\theta$ is the minimum over the cells with a minus sign: $\min\{5,30\}=5$, and $(2,5)$ leaves. The cost changes by $\theta\,\bar{c}_{35}=-35$: $440-35=405$. $475$ gets the sign wrong.
no-f-435 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, in an iteration of the potential method the reduced costs of the nonbasic cells are $-5$, $-4$, $-7$, $7$, $-2$, $9$. With the most negative reduced cost rule, which cell enters?
  1. The one with reduced cost $9$
  2. The one with reduced cost $-5$, the first negative one
  3. None: there are positive reduced costs
  4. The one with reduced cost $-7$
Explanation. The cell with the most negative reduced cost, $-7$, enters, promising the largest saving per unit. The basis would be optimal only if all reduced costs were $\ge 0$.
no-f-436 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, the potential method stops when all reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$ of the cells are $\ge 0$. What does it guarantee then?
  1. That the solution is unique
  2. That the current basic solution is optimal, since the potentials are dual feasible with the same value
  3. That no cell has amount $0$
  4. That the potentials are all nonnegative
Explanation. With $\bar{c} \ge 0$ the potentials satisfy $\pi_i-\pi_j \le c_{ij}$, and the basic cells have $\bar{c}=0$: primal and dual have the same value, so both are optimal. Uniqueness needs strictly positive reduced costs outside the basis.
no-f-437 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, in the potential method a cell enters, and on its cycle a cell with minus sign has amount $0$ (a degenerate basis). What happens?
  1. The method stops: the solution is optimal
  2. The cost decreases by $|\bar{c}_e|$
  3. $\theta=0$: the basis changes but the solution and the cost stay the same (degenerate pivot)
  4. The solution becomes infeasible
Explanation. With $\theta=0$ no amount changes: one cell enters and the cell with amount $0$ leaves. It is a degenerate pivot; the new basis may lead to improving pivots.
no-f-438 · level facile · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, when is a basic feasible solution of the transportation problem called degenerate?
  1. When a basic cell has amount $0$
  2. When it has fewer than $m+n-1$ basic cells
  3. When two cells have the same cost
  4. When a nonbasic reduced cost is zero
Explanation. A basis always has $m+n-1$ cells; it is degenerate if some of them equal $0$, for instance when a row and a column run out together in the northwest corner rule. Zero nonbasic reduced costs indicate multiple optima.
no-f-439 · level teorema · notes
In the transportation problem with origins $i$ (supplies $a_i$), destinations $j$ (demands $d_j$) and unit costs $c_{ij}$, which statement about termination of the potential method with degeneracy is correct?
  1. Degeneracy makes it impossible to find the optimum
  2. Every pivot lowers the cost, even if degenerate
  3. With degeneracy the method always stops in $m+n-1$ pivots
  4. Without degeneracy every pivot strictly lowers the cost; with degenerate pivots ($\theta=0$) rules that prevent cycling are needed
Explanation. With $\theta>0$ the cost drops by $\theta|\bar{c}_e|$ and no basis repeats; with $\theta=0$ the cost stays the same and in theory bases could repeat. The notes show examples where degenerate pivots still lead to the optimum.
no-f-440 · level facile · notes
In the assignment problem there are $n$ workers and $n$ jobs, and $c_{ij}$ is the cost of assigning worker $i$ to job $j$. How many feasible assignments (every worker one job, every job one worker) are there with $n=4$?
  1. $16$
  2. $24$
  3. $4$
  4. $256$
Explanation. An assignment is a permutation of the jobs: $4!=24$. $16=n^2$ is the number of cells, $256=4^4$ would allow giving the same job to several workers.
no-f-441 · level teorema · notes
The assignment model $\mathrm{AP}$ has variables $x_{ij} \in \{0,1\}$ and constraints «every row adds up to $1$», «every column adds up to $1$». Which statement about its linear relaxation ($0 \le x_{ij}$ instead of $x_{ij} \in \{0,1\}$) is correct?
  1. The relaxation always has a fractional optimum
  2. The relaxation has an integer optimal vertex, that is, an assignment, since it is a transportation problem with supplies and demands $1$
  3. The relaxation is unbounded
  4. The relaxation has the same value only if the costs are distinct
Explanation. The relaxation is a transportation model (totally unimodular constraint matrix and integer right-hand sides), so its vertices are integer: an optimal vertex is an assignment. Fractional optima may exist, but they are not better.
no-f-442 · level facile · notes
A $3 \times 3$ assignment instance has costs with rows $(4,2,5)$, $(3,6,4)$, $(7,5,3)$ (rows = workers, columns = jobs). What does the assignment worker $1 \to$ job $2$, $2 \to 1$, $3 \to 3$ cost?
  1. $8$
  2. $10$
  3. $9$
  4. $7$
Explanation. $c_{12}+c_{21}+c_{33}=2+3+3=8$. It is also the minimum: every row uses its smallest entry, and the three minima are in different columns.
no-f-443 · level facile · notes
The linear relaxation of the $n \times n$ assignment is a transportation problem with supplies and demands $1$. How many basic cells with value $0$ does each of its basic feasible solutions have?
  1. $0$
  2. $n$
  3. $n-1$
  4. $2n-1$
Explanation. A basis has $2n-1$ cells, but an assignment has only $n$ cells with value $1$: the other $n-1$ basic cells are $0$. Every basic solution is therefore degenerate.
no-f-444 · level facile · notes
Why is the potential method not well suited to assignment, even though it solves its linear relaxation?
  1. Because every basis is degenerate, and many pivots have $\theta=0$ without improving the cost
  2. Because it does not find integer solutions
  3. Because it requires positive costs
  4. Because an initial solution cannot be built
Explanation. With $n-1$ basic zeros, many pivots move $\theta=0$: in the notes' example $4$ of the $6$ pivots are degenerate. This is why the Hungarian algorithm is used.
no-f-445 · level facile · notes
The northwest corner rule is applied to a $4 \times 4$ assignment instance (supplies and demands $1$). Which solution is obtained?
  1. The cells $(1,1)$, $(1,2)$, $(1,3)$, $(1,4)$ with value $1$
  2. A solution with $4$ basic cells, all equal to $1$
  3. A fractional solution
  4. The diagonal with value $1$, plus $3$ basic cells with value $0$
Explanation. Every cell $(i,i)$ exhausts row and column together: the row is crossed out, and the cell below, $(i+1,i)$, enters with $0$. One gets the diagonal and $3$ basic zeros: $2n-1=7$ cells.
no-f-446 · level ipotesi · notes
In the linear relaxation of assignment every basic solution has $n-1$ zero basic cells. Which general fact about transportation bases explains it?
  1. Bases have $m\,n$ cells
  2. A basis always has $m+n-1$ cells (a spanning tree), whatever the supplies and demands
  3. The reduced costs of the basic cells are positive
  4. Basic cells lie on the diagonal
Explanation. The number of basic cells depends only on $m$ and $n$ ($m+n-1=2n-1$), while the cells with positive value in an assignment are $n$. The difference, $n-1$, are basic zeros.
no-f-447 · level facile · notes
In assignment, $3$ is subtracted from all the entries of row $2$ of the cost matrix. What happens to the optimal assignments?
  1. They change: row $2$ is now more convenient
  2. They change only if an entry becomes negative
  3. Their cost decreases by $3 \cdot n$
  4. They stay the same: every assignment uses exactly one entry of row $2$, so it costs $3$ less
Explanation. Every assignment takes exactly one entry of row $2$, so all costs drop by $3$ and the order does not change. It is the potential change $\pi_2=3$.
no-f-448 · level facile · notes
After Step 0 of the Hungarian algorithm (row and column reduction) the reduced matrix has all entries $\ge 0$ and the dual value is $8$. An assignment uses only cells with reduced entry $0$. What is concluded?
  1. It costs $0$
  2. It is optimal and costs $8$
  3. It is feasible but not necessarily optimal
  4. It costs at least $8$, but another iteration is needed
Explanation. The cost of an assignment is the sum of its reduced costs plus the dual value: $0+8=8$, and no assignment can cost less since the reduced costs are $\ge 0$. The true cost is not $0$.
no-f-449 · level teorema · notes
Let $\bar{c}$ be an $n \times n$ matrix with nonnegative entries. Which statement of the König–Egerváry theorem is correct?
  1. The maximum number of independent zeros (never two in the same row or column) equals the minimum number of lines (rows or columns) covering all the zeros
  2. The number of zeros equals the number of lines
  3. The zeros are always covered by $n$ lines and never fewer
  4. The maximum number of independent zeros is always $n$
Explanation. It is a min–max theorem, like max-flow min-cut: independent zeros as a matching in the bipartite network of the zeros, lines as a cover. With fewer than $n$ independent zeros, fewer than $n$ lines suffice.
no-f-450 · level facile · notes
In a $3 \times 3$ matrix with nonnegative entries the zeros are in the cells $(1,1)$, $(2,1)$, $(3,1)$, $(3,2)$. What is the minimum number of lines (rows or columns) covering all the zeros?
  1. $1$
  2. $3$
  3. $4$
  4. $2$
Explanation. Column $1$ covers three zeros and row $3$ (or column $2$) the fourth: $2$ lines. By König–Egerváry the maximum number of independent zeros is also $2$, for instance $(1,1)$ and $(3,2)$.
no-f-451 · level ipotesi · notes
Theorem: in the Hungarian algorithm, Step 3 (subtract the minimum $\delta$ of the uncovered entries, add it to those covered twice) keeps $\bar{c} \ge 0$ and increases the dual value. Why does the dual value grow?
  1. Because $\delta$ is always $1$
  2. Because the uncovered rows outnumber the covered columns: with $k<n$ lines, the dual grows by $(n-k)\,\delta>0$
  3. Because a row is added to the matrix
  4. Because the independent zeros decrease
Explanation. $\pi_i$ grows by $\delta$ for uncovered rows and $\pi_j$ by $\delta$ for covered columns; the dual $\sum\pi_i-\sum\pi_j$ gains $\delta$ per uncovered row and loses $\delta$ per covered column, $(n-k)\,\delta$ in total. $\delta$ is any positive number.
no-f-452 · level facile · notes
In Step 0 of the Hungarian algorithm on a $4 \times 4$ instance the row minima are $2,1,2,1$ and, after subtracting them, the column minima are $0,2,0,0$. What is the lower bound (dual value) on the cost of every assignment?
  1. $6$
  2. $2$
  3. $4$
  4. $8$
Explanation. The dual value is the sum of all subtracted amounts: $2+1+2+1+2=8$, and every assignment costs at least that much. $6$ forgets the column reduction.
no-f-453 · level facile · notes
In an iteration of the Hungarian algorithm on a $4 \times 4$ matrix $3$ independent zeros are found, covered by $3$ lines, and the minimum uncovered entry is $\delta=1$. How does the dual value change after Step 3?
  1. It stays the same
  2. It grows by $1$
  3. It grows by $3$
  4. It decreases by $1$
Explanation. The dual value grows by $(n-k)\,\delta=(4-3) \cdot 1=1$. This is how the algorithm progresses: the lower bound rises until $n$ independent zeros are found.
no-f-454 · level facile · notes
In the transportation problem with supplies $a=(30,30,30)$ (origins $1,2,3$) and demands $d=(10,25,15,40)$ (destinations $4,5,6,7$), the northwest corner rule fills the cell $(3,7)$ last. With what amount?
  1. $40$
  2. $30$
  3. $10$
  4. $0$
Explanation. At the end only row $3$, with supply $30$, and column $7$ are active; column $7$ still needs $40-10=30$ units (the first $10$ come from row $2$): $x_{37}=30$, and row and column are crossed out together.
no-f-455 · level facile · notes
In the Hungarian algorithm for the $n \times n$ assignment, when does the algorithm stop?
  1. When the minimum uncovered entry is $0$
  2. After $n$ iterations
  3. When all entries of the reduced matrix are $0$
  4. When a maximum set of independent zeros of the reduced matrix has $n$ elements: it is an optimal assignment
Explanation. $n$ independent zeros form an assignment of zero reduced cost, optimal since the reduced costs are $\ge 0$. The number of iterations depends on the data.

Part: The network simplex (74)

8. The network simplex (74)

no-f-151 · level facile · notes
In the network simplex a tree structure $(T,L,U)$ splits the arcs into: $T$ (spanning tree), $L$ (outside the tree, at the lower bound $0$) and $U$ (outside the tree, at capacity $u_{ij}$). An arc of $U$ has flow $u_{ij}>0$. Is it a basic arc?
  1. No: the basic variables are the arcs of $T$, and $U$ is nonbasic
  2. Yes, because its flow is positive
  3. Yes, as long as its capacity is finite
  4. Only if the tree solution is degenerate
Explanation. The basic arcs are those of $T$, even with flow $0$ or $u_{ij}$; the arcs of $L$ and $U$ are nonbasic, fixed at $0$ or at their capacity.
no-f-152 · level facile · notes
In the network simplex for minimum cost flow, with structure $(T,L,U)$ ($L$: nonbasic arcs at $0$, $U$: nonbasic arcs at capacity) and reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, which arcs are eligible to enter the basis?
  1. The arcs of $L$ with $\bar{c}_{ij}>0$ and those of $U$ with $\bar{c}_{ij}<0$
  2. All the arcs with $\bar{c}_{ij}<0$, wherever they are
  3. The arcs of $L$ with $\bar{c}_{ij}<0$ and those of $U$ with $\bar{c}_{ij}>0$
  4. The arcs of $T$ with $\bar{c}_{ij} \neq 0$
Explanation. An arc of $L$ is worth increasing if $\bar{c}_{ij}<0$, an arc of $U$ is worth decreasing if $\bar{c}_{ij}>0$. The first option is the test of a maximization; the arcs of $T$ have $\bar{c}_{ij}=0$.
no-f-153 · level facile · notes
In the pivot of the network simplex the entering arc $e=(k,l)$ closes a cycle with the tree $T$, oriented so that the flow of $e$ moves away from its bound. The entering arc is in $U$ (nonbasic, at capacity). How is the cycle oriented?
  1. In the direction of $e$, from $k$ to $l$
  2. Against $e$, because its flow must decrease
  3. From the root of the tree towards node $k$
  4. So that the apex of the cycle is node $k$
Explanation. An arc of $U$ enters by decreasing its flow: the cycle traverses it backwards. If $e \in L$ the cycle goes in the direction of $e$.
no-f-154 · level facile · notes
The potentials of a tree $T$ with root $n$ have $\pi_n=0$ and $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$. The path from $i$ to the root traverses the arc $(i,a)$ (cost $4$) from tail to head, then the arc $(n,a)$ (cost $6$) from head to tail. What is $\pi_i$?
  1. $10$
  2. $2$
  3. $-10$
  4. $-2$
Explanation. $\pi_i$ is the cost of the tree path from $i$ to $n$, with $+c_{ij}$ for the arcs traversed from tail to head and $-c_{ij}$ for the others: $4-6=-2$. Check: $\pi_a=-6$ from $c_{na}-\pi_n+\pi_a=0$, and $\pi_i=c_{ia}+\pi_a=-2$.
no-f-155 · level facile · notes
Let $\vet{\pi}$ be the potentials of a spanning tree $T$ ($\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$). What does the reduced cost $\bar{c}_{kl}$ of an arc $(k,l)$ outside the tree represent?
  1. The cost of the fundamental cycle of $(k,l)$, traversed in the direction of $(k,l)$
  2. The cost of the tree path from $k$ to the root
  3. The residual capacity of the fundamental cycle of $(k,l)$
  4. The change of the dual value when $(k,l)$ enters
Explanation. The cost of a cycle does not change when the costs are replaced by the reduced costs; the tree arcs have $\bar{c}_{ij}=0$, so only $\bar{c}_{kl}$ remains (lemma «the cost of a cycle»).
no-f-156 · level facile · notes
In the pivot of the network simplex $\theta$ units move along the cycle of the entering arc; the blocking arcs are those reaching a bound with step $\theta$, and the apex is the first node shared by the paths to the root. If several arcs are blocking, which one leaves the tree?
  1. The first blocking arc met starting from the apex
  2. The blocking arc with the smallest index
  3. The blocking arc with the largest cost
  4. The last blocking arc met traversing the cycle from the apex
Explanation. The leaving arc rule chooses the last blocking arc from the apex, in the direction of the cycle: it keeps the tree strongly feasible and prevents cycling.
no-f-157 · level facile · notes
In the network simplex (root $n$, $\pi_n=0$) the arc $e=(k,l)$ with reduced cost $\bar{c}_{kl}$ enters and the arc $f \neq e$ leaves. Which potentials change after the pivot?
  1. All of them, by the same amount $\bar{c}_{kl}$
  2. Only the potentials $\pi_k$ and $\pi_l$
  3. Only those of the part cut off by $f$ without the root, by $\pm\bar{c}_{kl}$
  4. None, if the pivot is degenerate
Explanation. Removing $f$ splits the tree into $R$ (with the root) and $S$; the potentials of $R$ stay, those of $S$ change by $-\bar{c}_{kl}$ if $l \in S$ and by $+\bar{c}_{kl}$ if $k \in S$, also in a degenerate pivot.
no-f-158 · level facile · notes
In the pivot of the network simplex the step $\theta$ is the largest flow that can be moved along the cycle of the entering arc without violating the bounds. We get $\theta=+\infty$. What do we conclude on the minimum cost flow model?
  1. The current tree solution is optimal
  2. It is unbounded: the cycle is directed, negative and with infinite capacities
  3. It is infeasible: no feasible flow exists
  4. The pivot is degenerate and the basis does not change
Explanation. A backward arc or an arc with finite capacity would give a finite $\theta$: all the arcs of the cycle are forward with $u_{ij}=+\infty$, and the cost of the cycle is $-|\bar{c}_{kl}|<0$.
no-f-159 · level facile · notes
Phase 0 of the network simplex adds an artificial arc between every node and the root, of cost $c^0=1$ (the original arcs cost $0$), and starts by sending $|b_i|$ units on the artificial arc of every node. A network has balances $\vet{b}=(5,2,0,-3,0,-4)$. What does the initial tree cost?
  1. $14$
  2. $7$
  3. $0$
  4. $6$
Explanation. The initial cost is $\sum_i |b_i|=5+2+0+3+0+4=14$. $7$ counts only the supplies (or only the demands).
no-f-160 · level facile · notes
Phase 0 of the network simplex minimizes the flow on the artificial arcs (cost $1$ on them, $0$ on the original arcs of the network $G$). It ends with optimal value $z_0=3$. What do we conclude?
  1. Continue with the original costs from the final tree
  2. The minimum cost flow model is unbounded
  3. A dummy node with balance $-3$ must be added
  4. The network $G$ has no feasible flow
Explanation. $G$ has a feasible flow if and only if $z_0=0$: with $z_0>0$ some units stay on the artificial arcs in every solution.
no-f-161 · level facile · notes
In the network simplex for minimum cost flow, a pivot with an entering arc of reduced cost $\bar{c}_{kl}=-4$ (from the set $L$) has step $\theta=3$. How does the cost of the tree solution change?
  1. It grows by $12$
  2. It decreases by $12$
  3. It decreases by $4$
  4. It does not change
Explanation. The cost drops by $\theta\,|\bar{c}_{kl}|=3 \cdot 4=12$; it would not change only with $\theta=0$ (degenerate pivot).
no-f-162 · level facile · notes
A feasible tree structure $(T,L,U)$ with root $n$ may have degenerate tree arcs, with $x_{ij}=0$ or $x_{ij}=u_{ij}$. When is it strongly feasible?
  1. When no tree arc is degenerate
  2. When all the tree arcs point towards the root
  3. When the arcs with $x_{ij}=0$ point towards the root and those with $x_{ij}=u_{ij}$ away from it
  4. When the set $U$ of arcs at capacity is empty
Explanation. Equivalently every node can push a positive amount of flow to the root along the tree; a nondegenerate structure always is, but the definition allows degenerate arcs oriented the right way.
no-f-163 · level media · notes
In the network simplex the current potentials are $\vet{\pi}=(7,5,6,2,3,0)$, root $6$. The arc $(k,l)=(2,5)$ enters with $\bar{c}_{25}=-2$; removing the leaving arc, the part of the tree without the root is $S=\{2,4\}$. The potentials of $S$ change by $+\bar{c}_{kl}$ if $k \in S$, by $-\bar{c}_{kl}$ if $l \in S$. What are the new potentials?
  1. $(7,3,6,0,3,0)$
  2. $(7,7,6,4,3,0)$
  3. $(5,3,4,0,1,0)$
  4. $(7,3,6,2,3,0)$
Explanation. Here $k=2 \in S$, so $\pi_2=5-2=3$, $\pi_4=2-2=0$; the others stay. Check: $\bar{c}_{25}$ becomes $c_{25}-3+3=0$, since it was $c_{25}-5+3=-2$.
no-f-164 · level teorema · notes
Let $(T,L,U)$ be a feasible tree structure ($L$: nonbasic arcs at $0$, $U$: nonbasic arcs at capacity), with potentials $\vet{\pi}$ and reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$. Which statement on the tree solution is correct?
  1. It is optimal if $\bar{c}_{ij} \ge 0$ on all the arcs of $L \cup U$
  2. It is optimal if $\bar{c}_{ij} \le 0$ on the arcs of $L$ and $\bar{c}_{ij} \ge 0$ on those of $U$
  3. It is optimal only if it is not degenerate, whatever the reduced costs
  4. It is optimal if $\bar{c}_{ij} \ge 0$ on the arcs of $L$ and $\bar{c}_{ij} \le 0$ on those of $U$
Explanation. By the lemma «cost and reduced cost» $\vet{c}'\vet{y}-\vet{c}'\vet{x}=\sum \bar{c}_{ij}(y_{ij}-x_{ij}) \ge 0$: on $L$ $y \ge 0=x$ and $\bar{c} \ge 0$, on $U$ $y \le u=x$ and $\bar{c} \le 0$. With strict inequalities it is the unique optimum.
no-f-165 · level teorema · notes
In the minimum cost flow model on a connected network with $n$ nodes the redundant constraint of node $n$ is removed; a basis is a set of independent columns (arcs) as many as the rank. Which statement on the bases is correct?
  1. A basis is a set of $n$ arcs without cycles
  2. $n-1$ arcs form a basis if and only if they form a spanning tree
  3. A basis is a directed path from a supply node to a demand node
  4. The bases are the sets of arcs with positive flow
Explanation. The columns of a tree are independent, those of a cycle dependent; a leaf other than $n$ gives a row with a single $\pm 1$, and by induction the basis matrix is triangular with determinant $\pm 1$.
no-f-166 · level teorema · notes
The network simplex can make degenerate pivots ($\theta=0$). The leaving arc rule chooses the last blocking arc from the apex of the cycle. Which statement on the finiteness of the algorithm is correct?
  1. It always terminates, with any rule for choosing the leaving arc
  2. It can never make degenerate pivots, so it terminates
  3. With a strongly feasible initial structure and that rule it terminates, for any choice of the entering arc
  4. It terminates only if the arc with the largest $|\bar{c}_{ij}|$ always enters
Explanation. With strongly feasible trees and the last-blocking-arc rule, a degenerate pivot lowers the potentials of a part of the tree, and no structure repeats; the entering arc rule is free.
no-f-167 · level ipotesi · notes
In the proof of the optimality of a tree solution $\vet{x}$ its cost is compared with that of another feasible flow $\vet{y}$, writing $\vet{c}'\vet{y}-\vet{c}'\vet{x}=\sum_{(i,j) \in A}\bar{c}_{ij}(y_{ij}-x_{ij})$. Which result gives this identity?
  1. The lemma «cost and reduced cost», applied to two flows with the same balances
  2. The max-flow min-cut theorem
  3. The total unimodularity of the incidence matrix
  4. The cycle decomposition lemma
Explanation. $\vet{c}'\vet{x}=\bar{\vet{c}}'\vet{x}+\vet{b}'\vet{\pi}$ for every $\vet{x}$ with $\mat{B}\vet{x}=\vet{b}$; subtracting the two identities, the term $\vet{b}'\vet{\pi}$ cancels.
no-f-168 · level ipotesi · notes
In the pivot of the network simplex the new flow is $\vet{x}'=\vet{x}+\theta\vet{x}^C$, where $\vet{x}^C$ is $+1$ on the cycle arcs traversed forward, $-1$ on those traversed backward and $0$ elsewhere. Why does $\vet{x}'$ keep the balances, $\mat{B}\vet{x}'=\vet{b}$?
  1. Because $\theta$ is the minimum of the residual capacities of the cycle
  2. Because the current tree is strongly feasible
  3. Because the columns of a cycle, with these signs, add up to zero: $\mat{B}\vet{x}^C=\vet{0}$
  4. Because the potential of the root is zero
Explanation. The signed incidence vector of the cycle is in the null space of $\mat{B}$ (lemma «columns of a cycle»); $\theta$ is used to respect the bounds instead, and the lemma «the cost of a cycle» to compute the change of cost.
no-f-169 · level ipotesi · notes
Phase 0 applies the network simplex to the network with the artificial arcs, with costs $c^0=1$ on the artificial arcs and $0$ on the original ones, starting from the tree of the artificial arcs. To prove that it terminates and does not stop for unboundedness, what is used?
  1. The max-flow min-cut theorem and the cut condition
  2. The initial tree is strongly feasible, and with costs $c^0 \ge 0$ there are no negative cycles
  3. The network with the artificial arcs is acyclic
  4. The original problem has at least one feasible flow
Explanation. Finiteness comes from the theorem on strongly feasible trees; with non-negative costs no cycle has negative cost, so $\theta=+\infty$ cannot occur. Whether the network is feasible is what Phase 0 decides, not an assumption.
no-f-170 · level facile · notes
A connected network with $n$ nodes is balanced, $\sum_i b_i=0$. The network simplex removes from the constraints $\mat{B}\vet{x}=\vet{b}$ the row of node $n$. Why can it be removed without changing the set of solutions?
  1. Because node $n$ has balance $b_n=0$
  2. Because node $n$ is a leaf of the tree
  3. Because the rows of $\mat{B}$ add up to zero, so row $n$ follows from the others
  4. Because row $n$ of $\mat{B}$ is zero
Explanation. Every column has one $+1$ and one $-1$, so the rows add up to zero; with $\sum_i b_i=0$ the constraint of node $n$ is minus the sum of the others. The rank stays $n-1$.
no-f-171 · level facile · notes
In the network simplex with a strongly feasible structure, the pivot cycle is traversed from the apex $w$: tree path from $w$ to $p$, entering arc, path from $q$ to $w$. The pivot is degenerate ($\theta=0$). Where are the blocking arcs?
  1. All on the path from $w$ to $p$, before the entering arc
  2. All on the path from $q$ to $w$, after the entering arc
  3. One of them is always the entering arc itself
  4. They are spread at random along the cycle
Explanation. Lemma «degenerate pivots»: by strong feasibility the entering arc and the arcs from $q$ up to the apex have positive residual capacity, so with $\theta=0$ the blocking arcs lie on the part from $w$ to $p$.
no-f-172 · level facile · notes
Phase 0 ends with $z_0=0$ (no flow on the artificial arcs) and Phase 0 reduced costs $\bar{c}^0_{ij}$. The network simplex continues with the original costs from the final tree. Which arcs are allowed to enter?
  1. All the original arcs, with any $\bar{c}^0_{ij}$
  2. Only the artificial arcs
  3. Only the arcs with $\bar{c}^0_{ij}>0$
  4. Only the arcs with $\bar{c}^0_{ij}=0$
Explanation. Proposition «from Phase 0 to the network simplex»: the arcs with $\bar{c}^0_{ij} \neq 0$ stay «frozen» at their bound, and this guarantees that the flow on the artificial arcs stays zero in every flow met.
no-f-173 · level facile · notes
The tree solution of an uncapacitated network is computed by removing one leaf $\ell \neq n$ at a time: the arc of the leaf carries its residual balance $\hat{b}_\ell$. A leaf with $\hat{b}_\ell=3$ is the head of its arc $(j,\ell)$. What is the flow on the arc?
  1. $3$
  2. $-3$
  3. $0$
  4. $6$
Explanation. If the arc enters the leaf, $x_{j\ell}=-\hat{b}_\ell=-3$: the leaf should send $3$ units but can only receive them, and the tree structure is not feasible. If the arc left the leaf it would be $+3$.
no-f-205 · level facile · notes
In an uncapacitated network the network simplex lets an arc of $L$ (flow $0$) with $\bar{c}_{kl}=-3$ enter; the cycle of the entering arc, oriented as the arc, has two backward arcs with flows $4$ and $2$, and the others forward. The tree solution costs $50$. What does it cost after the pivot?
  1. $38$
  2. $47$
  3. $44$
  4. $56$
Explanation. Without capacities only backward arcs block: $\theta=\min\{4,2\}=2$, and the cost drops by $\theta\,|\bar{c}_{kl}|=6$, to $44$. $38$ uses $\theta=4$, $47$ forgets $\theta$, $56$ gets the sign wrong.
no-f-206 · level facile · notes
In an uncapacitated network (all $u_{ij}=+\infty$) the network simplex lets an arc of $L$ enter and moves $\theta$ units along its cycle, oriented as the entering arc. Which arcs of the cycle can limit $\theta$?
  1. Only the forward arcs
  2. Only the backward arcs, which lose flow
  3. Only the entering arc
  4. All the arcs of the cycle
Explanation. Forward arcs increase and, without capacities, never reach a bound; backward arcs decrease and block when they reach $0$. If the cycle has no backward arc, $\theta=+\infty$ and the model is unbounded.
no-f-207 · level facile · notes
In a capacitated network, the cycle of a network simplex pivot (oriented as the flow moves) has a forward arc with $x=2$, $u=5$, a backward arc with $x=4$, and a forward arc with $x=1$, $u=2$. What is the step $\theta$?
  1. $1$
  2. $2$
  3. $4$
  4. $3$
Explanation. A forward arc can grow by $u_{ij}-x_{ij}$, a backward arc decrease by $x_{ij}$: $\theta=\min\{5-2,\,4,\,2-1\}=1$. $2$ ignores the capacities of the forward arcs, $3$ looks only at the first arc.
no-f-208 · level facile · notes
In the network simplex a pivot is degenerate: the step is $\theta=0$, because a blocking tree arc is already at its bound. What changes after the pivot?
  1. Flow, cost and tree all stay the same
  2. The cost drops by $|\bar{c}_{kl}|$
  3. The flow changes but the cost stays the same
  4. The tree and the potentials change, not the flow or the cost
Explanation. With $\theta=0$ no flow moves, so the cost stays; but the entering arc replaces the leaving arc in the tree, and the potentials of the cut-off part change. This is why a rule against cycling is needed.
no-f-209 · level teorema · notes
A tree structure $(T,L,U)$ on a network with $n$ nodes and $m$ arcs is a spanning tree $T$ plus a partition of the other arcs into $L$ (at $0$) and $U$ (at capacity). Which statement on the termination of the network simplex is correct?
  1. It always stops after at most $n-1$ pivots
  2. If every pivot has $\theta>0$ it stops, since the cost always drops and the structures are finitely many
  3. It stops only if the network is uncapacitated
  4. If every pivot has $\theta>0$ it stops after at most $m$ pivots
Explanation. A structure determines its solution and hence its cost; with $\theta>0$ the cost drops by $\theta|\bar{c}_{kl}|>0$ and no structure repeats. There are at most $\binom{m}{n-1}2^{m-n+1}$ structures, a finite but not small number.
no-f-210 · level facile · notes
An iteration of the network simplex for minimum cost flow, from a feasible tree structure $(T,L,U)$, consists of some steps. In which order are they carried out?
  1. Cycle and step $\theta$, then potentials, then entering arc
  2. Leaving arc, then entering arc, then potentials
  3. Potentials and reduced costs, entering arc, cycle with $\theta$ and leaving arc, update
  4. Potentials, update of the tree, then choice of the entering arc
Explanation. The potentials give the reduced costs, which say which arcs are eligible; the entering arc defines the cycle, the ratio test gives $\theta$ and the leaving arc, then flow, tree and potentials are updated. If no arc is eligible the solution is optimal.
no-f-211 · level facile · notes
In the network simplex, given a basis $T$ (spanning tree), the bound status splits the nonbasic arcs into $L$ (flow $0$) and $U$ (flow equal to the capacity $u_{ij}$, with $0<u_{ij} \le +\infty$). Which arcs can be in $U$?
  1. Only the arcs with negative cost
  2. All the nonbasic arcs
  3. Only the arcs belonging to a cycle of the tree
  4. Only the nonbasic arcs with finite capacity
Explanation. An arc with $u_{ij}=+\infty$ cannot sit at its capacity, so it is in $L$. The cost does not matter for the status: it only decides whether the arc is worth entering.
no-f-456 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), a basis is a set of $n-1$ arcs with independent columns in the incidence matrix without the row of node $n$. With $n=6$ nodes and $m=9$ arcs, how many arcs are nonbasic?
  1. $5$
  2. $6$
  3. $3$
  4. $4$
Explanation. The basis has $n-1=5$ arcs, so $m-(n-1)=4$ arcs are nonbasic, split between $L$ (flow $0$) and $U$ (flow at capacity).
no-f-457 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), why is the conservation constraint of node $n$ removed?
  1. Because the rows of the incidence matrix and the balances add up to zero: that constraint is implied by the others
  2. Because node $n$ has no arcs
  3. Because node $n$ always has zero balance
  4. Because then the matrix becomes square
Explanation. With $\sum_i b_i=0$ every constraint is a combination of the others, and the rank is $n-1$: removing one row leaves a matrix of full row rank. The matrix stays $(n-1) \times m$, not square.
no-f-458 · level facile · notes
In the simplex method with bounds, for a minimization problem, when is a nonbasic variable at its upper bound a convenient entering variable?
  1. When its reduced cost is negative
  2. When its reduced cost is zero
  3. When its reduced cost is positive: decreasing it lowers the cost
  4. Never: only variables at the lower bound enter
Explanation. A variable at its upper bound can only decrease; decreasing it lowers the cost if the reduced cost is positive. Variables at the lower bound are instead convenient with negative reduced cost.
no-f-459 · level facile · notes
In the simplex method with bounds, what does the ratio test decide when a variable enters?
  1. The largest step keeping all basic variables within their bounds, and which variable leaves
  2. The reduced cost of the entering variable
  3. Which nonbasic variable enters
  4. The new simplex multipliers
Explanation. The entering variable moves until a basic variable (or the entering one itself) reaches a bound; that variable leaves. In the network simplex the ratio test becomes the computation of $\theta$ along the cycle.
no-f-460 · level facile · notes
How do the revised simplex method (with matrices) and the network simplex for minimum cost flow correspond?
  1. Not at all: the network simplex is a different combinatorial algorithm
  2. The network simplex solves only the transportation problem
  3. The network simplex uses the same matrices, explicitly inverted
  4. Bases are spanning trees, multipliers are potentials computed along the tree, the ratio test is a shift along a cycle
Explanation. The network simplex performs exactly the operations of the bounded simplex, without matrices: everything is computed on the tree. The potential method for transportation is a special case.
no-f-461 · level teorema · notes
In the bounded simplex for a minimization problem, with nonbasic variables at the lower bound ($L$) or the upper bound ($U$), which condition certifies the optimality of a basic feasible solution?
  1. All reduced costs are $\ge 0$
  2. The reduced costs are $\ge 0$ on the variables of $L$ and $\le 0$ on those of $U$
  3. The reduced costs are $\le 0$ on the variables of $L$ and $\ge 0$ on those of $U$
  4. All basic variables are strictly between their bounds
Explanation. No nonbasic variable can reduce the cost: those in $L$ can only increase (reduced cost $\ge 0$ needed), those in $U$ only decrease ($\le 0$ needed). «All $\ge 0$» is the case without upper bounds.
no-f-462 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), with integer balances and capacities, why is every tree solution integer?
  1. Because the costs are integer
  2. Because the basis matrix of a spanning tree has determinant $\pm 1$ (triangular with $\pm 1$ on the diagonal)
  3. Because the algorithm rounds the flows
  4. Because the network is acyclic
Explanation. The basis of a spanning tree is solved by substitution from the leaves, with only sums and differences of balances and capacities: with integer data the flows are integer. Costs affect the potentials, not the flows.
no-f-463 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), why, if every pivot has $\theta>0$, does the algorithm stop after finitely many pivots?
  1. Because every pivot adds an arc to the tree
  2. Because the potentials grow at every pivot
  3. Because the number of arcs in $U$ decreases
  4. Because every pivot strictly lowers the cost, so no tree structure repeats, and there are finitely many structures
Explanation. A structure $(T,L,U)$ determines the solution and the cost; with strictly decreasing cost one never returns to a structure already seen, and there are finitely many. With degenerate pivots the rule of strongly feasible trees is needed.
no-f-464 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), Step 1 of the algorithm looks for an eligible entering arc. Which arcs are candidates?
  1. The tree arcs with zero reduced cost
  2. All arcs with negative reduced cost
  3. The arcs of $L$ with $\bar{c}_{ij}<0$ and the arcs of $U$ with $\bar{c}_{ij}>0$
  4. The arcs of $U$ with $\bar{c}_{ij}<0$
Explanation. An arc at flow $0$ is convenient if increasing it costs less ($\bar{c}<0$), a saturated arc if decreasing it saves ($\bar{c}>0$). An arc of $U$ with $\bar{c}<0$ is already in the right position.
no-f-465 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), the «second system» of the revised simplex, $\mat{M}_T\vet{d}=\mat{M}_e$ for the entering arc $e=(k,l)$, is solved on the tree. What is $\vet{d}$?
  1. The vector of potentials
  2. The incidence vector of the tree path from $k$ to $l$, with $\pm 1$ according to the direction of the arcs
  3. The vector of reduced costs
  4. The flow of the tree solution
Explanation. $d_a=+1$ on the arcs of the path from $k$ to $l$ traversed from tail to head, $-1$ on the others, $0$ outside: increasing $x_e$ by $t$ changes the basic variables by $-t\,\vet{d}$, that is, sends flow along the fundamental cycle.
no-f-466 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), the «first system» of the revised simplex, $\vet{\pi}'\mat{M}_T=\vet{c}_T'$, gives what in the language of networks?
  1. The flow on the tree arcs
  2. The cycle of the entering arc
  3. The step $\theta$ of the pivot
  4. The potentials, with $\pi_i-\pi_j=c_{ij}$ on the tree arcs and $\pi_n=0$
Explanation. The column of $(i,j)$ has $+1$ in row $i$ and $-1$ in row $j$ (without row $n$), so the equation of the arc is $\pi_i-\pi_j=c_{ij}$: zero reduced cost on the basic arcs. It is solved along the tree from the root.
no-f-467 · level facile · notes
The potential method for the transportation problem and the network simplex: how are they related?
  1. The potential method is the network simplex on the bipartite graph of origins and destinations
  2. They are independent algorithms with different optimality criteria
  3. The network simplex is a special case of the potential method
  4. The potential method uses trees, the network simplex does not
Explanation. The basic cells of transportation form a spanning tree of the bipartite network, and potentials, reduced costs and cycles are those of the network simplex. Transportation is the special case.
no-f-468 · level ipotesi · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), the second system $\mat{M}_T\vet{d}=\mat{M}_e$ is solved with the tree path from $k$ to $l$ ($e=(k,l)$ entering). Which result of the chapter on graphs justifies it?
  1. The handshake lemma
  2. The lemma on the columns of a cycle: on the cycle formed by $e$ and the path, the combination of the columns with coefficients $\pm 1$ is zero
  3. The correctness of the BFS
  4. The integer vertices theorem
Explanation. The columns of a cycle, with signs given by the direction of traversal, add up to zero: this expresses $\mat{M}_e$ as a combination of the columns of the tree path, with coefficients $\pm 1$.
no-f-469 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), without capacities, the initial structure sends the $5$ units of node $1$ along $1,3,5,4$ and the $2$ of node $2$ along $(2,4)$; node $4$ has $b_4=-3$ and forwards the rest to node $6$. What is $x_{46}$?
  1. $7$
  2. $3$
  3. $2$
  4. $4$
Explanation. $5+2=7$ units enter $4$, $3$ stay (the demand), so $x_{46}=7-3=4$, equal to the demand of node $6$. $7$ forgets the demand of $4$.
no-f-470 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), without capacities ($U=\emptyset$), when does the algorithm stop with an optimal solution?
  1. When all arcs of $L$ have $\bar{c}_{ij} \ge 0$
  2. When all tree arcs have positive flow
  3. When the cost stops decreasing for two pivots
  4. When $L$ is empty
Explanation. Without saturated arcs optimality only requires nonnegative reduced costs on the arcs at flow $0$; on the tree arcs $\bar{c}=0$. A degenerate pivot does not change the cost but does not certify optimality.
no-f-471 · level teorema · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), a feasible tree structure is strongly feasible if from every node a positive amount of flow can be sent to the root along the tree. Which statement is correct?
  1. Every feasible structure is strongly feasible
  2. If the leaving arc is the last blocking arc of the cycle traversed from the apex, the new structure stays strongly feasible
  3. A strongly feasible structure never has degenerate pivots
  4. Strong feasibility requires all tree flows to be positive
Explanation. With the last blocking arc rule strong feasibility is preserved, and this rules out cycling. Degenerate pivots may still occur; tree arcs with flow $0$ are allowed if they point towards the root.
no-f-472 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), with potentials $\vet{\pi}=(12,10,12,5,10,0)$ and cost $c_{56}=3$, the arc $(5,6)$ is in $U$ (saturated). What is $\bar{c}_{56}=c_{56}-\pi_5+\pi_6$, and is it an eligible entering arc?
  1. $-7$: no, an arc of $U$ enters only with $\bar{c}>0$
  2. $-7$: yes, since it is negative
  3. $13$: yes
  4. $7$: yes, since it is positive
Explanation. $\bar{c}_{56}=3-10+0=-7$. For a saturated arc it pays to decrease the flow only if $\bar{c}>0$; with $\bar{c}<0$ the arc is already in its optimal position.
no-f-473 · level facile · notes
In the network simplex for minimum cost flow (connected network with $n$ nodes, balances $b_i$ summing to zero, capacities $u_{ij}$, costs $c_{ij}$), the arc $(1,3) \in U$ with $\bar{c}_{13}=2>0$ enters, and its flow decreases along the cycle. The step is $\theta=0$ because a blocking tree arc already has zero residual capacity. What changes?
  1. The cost drops by $2$
  2. Nothing: another entering arc is chosen
  3. The flow changes but the cost does not
  4. The tree (hence the potentials), while flow and cost stay the same
Explanation. In a degenerate pivot one arc enters and a blocking arc leaves, but no flow moves: the cost stays $63$. The new potentials may make the next pivot nondegenerate.
no-f-499 · level facile · notes
In Phase 0 of the network simplex the auxiliary network adds the artificial node $r$ and, for every node $i$, the artificial arc $(i,r)$ if $b_i \ge 0$ or $(r,i)$ if $b_i<0$. Which tree structure does Phase 0 start from?
  1. The tree of the artificial arcs, with all original arcs in $L$ (flow $0$)
  2. Any spanning tree of the original network
  3. The shortest path tree from $r$
  4. All original arcs in $U$
Explanation. The artificial arcs form a star centred at $r$, a spanning tree of $G^0$: every node sends or receives its balance on them. Phase 0 then minimizes the flow on these arcs.
no-f-500 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), which statement about computing the tree solution is correct?
  1. A linear system is solved by Gaussian elimination, with no shortcut
  2. The flows of $U$ are fixed, the residual balances computed, then one leaf $\ell \neq n$ at a time is removed: its tree arc carries $\pm$ the residual balance of $\ell$
  3. All supplies are sent to the root along the tree, ignoring $U$
  4. The flow on the tree arcs is always positive
Explanation. A leaf has a single tree arc, which must carry its residual balance (with the sign given by the arc's direction); the balance passes to the neighbour. Tree flows may be zero (degeneracy) or out of bounds (infeasible structure).
no-f-501 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), which statement about the potentials of a spanning tree $T$ is correct?
  1. They exist only if $T$ is a path
  2. They are unique only if the costs are distinct
  3. They coincide with the shortest path distances from $n$
  4. They exist and are unique; $\pi_i$ is the cost of the tree path from $i$ to $n$, with $+c_{ij}$ on arcs traversed forward and $-c_{ij}$ backward
Explanation. The $n-1$ equations $\pi_i-\pi_j=c_{ij}$ on the tree arcs and $\pi_n=0$ have a unique solution, computed along the tree from the root; they are the simplex multipliers of the basis. They are not distances: backward arcs count with a minus sign.
no-f-502 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), let $C$ be the fundamental cycle of the arc $(k,l) \notin T$, traversed in the direction of $(k,l)$, and $c(C)$ its cost (forward arcs with $+c_{ij}$, backward with $-c_{ij}$). Which statement is correct?
  1. $c(C)=\bar{c}_{kl}$: the reduced cost of the nonbasic arc is the cost of its fundamental cycle
  2. $c(C)=c_{kl}$
  3. $c(C)=0$ for every cycle
  4. $c(C)=\pi_k-\pi_l$
Explanation. On every cycle the potentials cancel, so $c(C)$ is the signed sum of the reduced costs; those of the tree arcs are zero and $\bar{c}_{kl}$ remains. It is the saving (or cost) per unit sent along the cycle.
no-f-503 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Lemma: the cost of the fundamental cycle of $(k,l)$ is $\bar{c}_{kl}$. Which fact, besides the cancellation of the potentials along the cycle, is needed to conclude?
  1. The costs are nonnegative
  2. The cycle is directed
  3. The tree arcs have zero reduced cost, by definition of the potentials
  4. The arc $(k,l)$ is in $L$
Explanation. The signed sum of the reduced costs on the cycle contains $\bar{c}_{kl}$ and the reduced costs of the tree arcs, which are zero. The lemma holds for every fundamental cycle, directed or not, and for $(k,l)$ in $L$ or $U$.
no-f-504 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), in a pivot $\theta$ units are moved along the cycle $C$ of the entering arc $e=(k,l)$ (in the direction of $e$ if $e \in L$, opposite if $e \in U$). Which statement is correct?
  1. The cost changes by $\theta\,\bar{c}_{kl}$ in every case, so it grows if $e \in U$
  2. The new flow violates conservation at the nodes of the cycle
  3. The new flow is feasible only if $\theta=1$
  4. The new flow is feasible and the cost decreases by $\theta\,|\bar{c}_{kl}|$
Explanation. Moving flow along a cycle preserves the balances; with $\theta$ at most the minimum residual capacity the bounds stay respected. The direction is chosen so that the cycle costs $-|\bar{c}_{kl}|$ per unit, both for $e \in L$ and $e \in U$.
no-f-505 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), $e=(k,l)$ enters and $f \neq e$ leaves; removing $f$ from the tree leaves the components $R$ (with the root $n$) and $S$. Which statement about updating the potentials is correct?
  1. All potentials change by the same amount
  2. Only $\pi_k$ and $\pi_l$ change
  3. The potentials of $R$ stay the same, those of $S$ all change by $-\bar{c}_{kl}$ (if $l \in S$) or by $+\bar{c}_{kl}$ (if $k \in S$)
  4. They are recomputed from scratch because the tree changed
Explanation. Nodes of $R$ reach the root by the same path; those of $S$ now reach it through $e$, and a uniform shift makes the reduced cost of $e$ zero. There is no need to recompute everything.
no-f-506 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Proposition: after a pivot ($e=(k,l)$ enters, $f$ leaves) the potentials of the nodes of the component $S$ of $T \setminus \{f\}$ without the root all change by $\mp\bar{c}_{kl}$. Which fact justifies that this shift is enough?
  1. The potentials of the new tree are unique, and the shift gives zero reduced cost on all arcs of the new tree
  2. The costs are integer
  3. The leaving arc is always adjacent to the root
  4. The pivot is nondegenerate
Explanation. Arcs inside $S$ or inside $R$ keep zero reduced cost (both endpoints move together), and $e$, between $R$ and $S$, becomes zero with the right shift: by uniqueness these are the potentials of $T'$. It also holds for degenerate pivots.
no-f-507 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the pivot step is $\theta=+\infty$. Which statement is correct?
  1. The structure is degenerate and another entering arc is needed
  2. The model is unbounded: the cycle is directed, its arcs have infinite capacity and it costs $-|\bar{c}_{kl}|<0$
  3. The current solution is optimal
  4. The entering arc is in $U$
Explanation. $\theta=+\infty$ means no arc blocks: all arcs of the cycle are forward with infinite capacity, and sending $t$ units lowers the cost by $t\,|\bar{c}_{kl}|$ without limit. An arc of $U$ has finite capacity, so it blocks.
no-f-508 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Theorem: if $\bar{c}_{ij} \ge 0$ on $L$ and $\bar{c}_{ij} \le 0$ on $U$, the tree solution is optimal; if the inequalities are strict, it is the unique optimum. What more is needed for uniqueness?
  1. That the flow is integer
  2. That every other feasible flow differs on some nonbasic arc, where a strict inequality makes the cost grow
  3. That the tree is a path
  4. That all costs are positive
Explanation. The cost of another flow $\vet{y}$ exceeds that of $\vet{x}$ by $\sum \bar{c}_{ij}(y_{ij}-x_{ij})$ over the nonbasic arcs; with strict inequalities every deviation costs something, and a flow equal outside the tree coincides on the tree too.
no-f-509 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the structure is strongly feasible and the pivot cycle is traversed from the apex $w$: path $P$ from $w$ to an endpoint of $e$, the arc $e$, path $Q$ from the other endpoint to $w$. Which statement is correct?
  1. The blocking arcs always lie on $Q$
  2. A degenerate pivot cannot happen
  3. If $\theta=0$, all blocking arcs lie on $P$; the arcs of $Q$ and $e$ have positive residual capacity
  4. If $\theta=0$, the blocking arc is $e$
Explanation. With strong feasibility flow can be sent to the root from every node, so along $Q$ (towards the apex) there is positive residual capacity; and $e$ has residual capacity $u_{kl}>0$. A block at $\theta=0$ can only come from $P$.
no-f-510 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Theorem: starting from a strongly feasible structure and using as leaving arc the last blocking arc of the cycle traversed from the apex, no structure repeats. In degenerate pivots, what guarantees progress?
  1. The cost, which always drops
  2. The number of arcs in $U$, which grows
  3. The lexicographic order of the entering arcs
  4. A measure on the potentials (their sum) that strictly decreases in degenerate pivots
Explanation. In a degenerate pivot the cost does not change, so another monotone quantity is needed: with the leaving arc rule the potentials of the nodes that change decrease, and their sum strictly decreases. The entering rule can be any.
no-f-511 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Phase 0 applies the network simplex to the auxiliary network (artificial arcs to or from the artificial root $r$, of cost $1$; original arcs of cost $0$). Which statement is correct?
  1. The original network has a feasible flow if and only if the optimal value of Phase 0 is $z_0=0$
  2. Phase 0 finds an optimal flow of the original network
  3. Phase 0 may cycle forever
  4. If $z_0>0$ the original network is unbounded
Explanation. With $z_0=0$ no flow passes on the artificial arcs, and the flow restricted to the original arcs is feasible; with $z_0>0$ no feasible flow exists (infeasibility, not unboundedness). The true optimum is sought afterwards, with the original costs.
no-f-512 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Theorem: Phase 0 stops after finitely many pivots. Which fact about the initial tree of artificial arcs guarantees it?
  1. It is a path
  2. All its flows are positive
  3. It is strongly feasible, and the capacities of the auxiliary network are positive: the finiteness theorem applies
  4. It has zero cost
Explanation. Every node sends or receives its balance on the artificial arc to the root, in the right direction: the initial structure is strongly feasible, and the leaving arc rule prevents cycling. Flows may be zero (zero balances).
no-f-513 · level teorema · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Phase 0 has ended with $z_0=0$, and one continues with the original costs on the auxiliary network, letting enter only arcs with zero Phase 0 reduced cost. Which statement is correct?
  1. One must restart from a tree of original arcs only
  2. The artificial arcs may receive positive flow
  3. The result is optimal only if no artificial arc is in the tree
  4. Every flow met has zero flow on the artificial arcs, and an optimal flow of the original network is obtained (or it is found to be unbounded)
Explanation. Arcs with zero Phase 0 reduced cost cannot bring flow back onto the artificial arcs (which would cost), so the flow stays in the original network. Artificial arcs with flow $0$ may stay in the tree.
no-f-514 · level ipotesi · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$ with $\pi_n=0$; reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), Corollary: with integer balances and capacities every tree solution is integer; with integer costs the potentials are integer too. Which fact is needed for the potentials?
  1. Total unimodularity holds only for flows
  2. The capacities are integer
  3. The flows are integer
  4. The potentials are computed along the tree from the root with $\pi_i=\pi_j \pm c_{ij}$: only sums and differences of costs
Explanation. Starting from $\pi_n=0$ every potential is the signed cost of the tree path to the root, so it is integer if the costs are. Capacities and flows do not enter the computation of the potentials.
no-f-536 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), when is a tree structure feasible?
  1. When all reduced costs are nonnegative
  2. When the tree is a path
  3. When its tree solution satisfies $0 \le x_{ij} \le u_{ij}$ on the arcs of $T$
  4. When $U$ is empty
Explanation. Nonbasic flows are fixed ($0$ on $L$, $u_{ij}$ on $U$) and tree flows are determined by conservation: the structure is feasible if the latter are within bounds. Reduced costs concern optimality.
no-f-537 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the arc $(1,3) \in U$ has capacity $u_{13}=4$, and node $1$ has balance $b_1=5$. Before computing the tree flows, what is the residual balance $\hat{b}_1=b_1-\sum_{(1,j) \in U}u_{1j}+\sum_{(j,1) \in U}u_{j1}$, if no other arc of $U$ touches node $1$?
  1. $1$
  2. $9$
  3. $5$
  4. $-4$
Explanation. The $4$ units on the saturated arc $(1,3)$ already leave node $1$: $5-4=1$ unit remains to be sent along the tree. $9$ adds instead of subtracting.
no-f-538 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the tree has the arcs $(4,5)$ with $c_{45}=5$ and $(3,4)$ with $c_{34}=2$, and the root is $5$. What are $\pi_4$ and $\pi_3$?
  1. $\pi_4=-5$, $\pi_3=-7$
  2. $\pi_4=5$, $\pi_3=7$
  3. $\pi_4=5$, $\pi_3=3$
  4. $\pi_4=5$, $\pi_3=2$
Explanation. On a tree arc $\pi_i-\pi_j=c_{ij}$: $\pi_4=\pi_5+5=5$ and $\pi_3=\pi_4+2=7$, the cost of the path $3,4,5$. $\pi_3=2$ forgets to add the potential of $4$.
no-f-539 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the arcs eligible to enter have reduced costs: $(1,2) \in L$ with $\bar{c}=-3$, $(2,4) \in U$ with $\bar{c}=5$, $(3,5) \in L$ with $\bar{c}=-4$. With the rule of the notes (largest $|\bar{c}_{ij}|$), which arc enters?
  1. $(1,2)$
  2. $(3,5)$, the most negative
  3. None: there is a positive reduced cost
  4. $(2,4)$
Explanation. Absolute values are compared: $|5|>|-4|>|-3|$, so $(2,4)$ enters, and its flow will decrease. Looking only at negative reduced costs works when $U$ is empty.
no-f-540 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), the pivot cycle (oriented as the flow shift) has forward arcs with residual capacities $u_{ij}-x_{ij}$ equal to $3$ and $5$, and backward arcs with flows $x_{ij}$ equal to $2$ and $4$. What is $\theta$?
  1. $3$
  2. $4$
  3. $2$
  4. $5$
Explanation. $\theta$ is the minimum residual capacity along the cycle: forward one can increase by at most $u_{ij}-x_{ij}$, backward decrease by at most $x_{ij}$: $\min\{3,5,2,4\}=2$. Looking only at forward arcs gives $3$.
no-f-541 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), an arc with $\bar{c}_{kl}=-3$ enters, the step is $\theta=2$, and the current solution costs $80$. What does the new solution cost?
  1. $86$
  2. $74$
  3. $77$
  4. $78$
Explanation. The cost changes by $\theta\,\bar{c}_{kl}=2 \cdot (-3)=-6$: $80-6=74$. $77$ uses $\bar{c}$ without $\theta$; $86$ gets the sign wrong.
no-f-542 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), in a feasible tree structure a tree arc has flow $0$. When does the structure stay strongly feasible?
  1. If that arc points towards the root
  2. If that arc points away from the root
  3. Never: strong feasibility requires positive flows on the tree
  4. Always
Explanation. From every node positive flow must be sendable to the root along the tree: an empty arc must be traversed forward, so it must point towards the root. A saturated arc must instead point away from the root.
no-f-543 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), in Phase 0 the auxiliary network adds the artificial node $r$ and, for every node $i$, the artificial arc $(i,r)$ if $b_i \ge 0$ or $(r,i)$ if $b_i<0$. With balances $\vet{b}=(5,2,0,-3,0,-4)$, what is the initial value of Phase 0 (total flow on the artificial arcs)?
  1. $7$
  2. $0$
  3. $5$
  4. $14$
Explanation. Every node sends or receives its balance on its own artificial arc: $5+2+0+3+0+4=14$. $7$ counts only the supplies (or only the demands).
no-f-544 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), in Step 3 of the algorithm the pivot step turns out to be $\theta=+\infty$. What does the algorithm return?
  1. The current solution, optimal
  2. That the problem is unbounded
  3. That the problem is infeasible
  4. A degenerate structure to restart from
Explanation. With $\theta=+\infty$ the cycle of the entering arc is directed, of infinite capacity and negative cost: the cost drops without limit. Infeasibility is discovered instead in Phase 0.
no-f-545 · level facile · notes
In the network simplex for minimum cost flow (tree structure $(T,L,U)$: $T$ spanning tree, $L$ nonbasic arcs at flow $0$, $U$ nonbasic arcs at capacity; root $n$, $\pi_n=0$; $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$), without capacities ($U=\emptyset$), the entering arc $(k,l) \in L$ closes a cycle with the tree; the flow increases on the arcs of the cycle in the direction of $(k,l)$ and decreases on the others. Which arcs can block the step $\theta$?
  1. Only the arcs of the cycle in the direction of $(k,l)$
  2. Only the entering arc
  3. Only the arcs traversed backward, whose flow decreases
  4. All arcs of the cycle
Explanation. Without capacities a forward arc can grow without limit; only backward arcs block, when their flow reaches $0$. If there are none, $\theta=+\infty$.

Part: Project management (70)

9. Project management (70)

no-f-174 · level facile · notes
In the critical path method the forward pass computes the earliest starts $\mathit{ES}_j$ and the earliest finishes $\mathit{EF}_j=\mathit{ES}_j+d_j$. Activity $j$ has three immediate predecessors with $\mathit{EF}=7$, $12$, $9$. What is $\mathit{ES}_j$?
  1. $7$
  2. $12$
  3. $28$
  4. $9$
Explanation. $j$ can start only when all its predecessors are finished: $\mathit{ES}_j=\max \mathit{EF}_i=12$. The minimum is the typical mistake; the sum ignores that the predecessors run in parallel.
no-f-175 · level facile · notes
In the critical path method the backward pass computes the latest finishes $\mathit{LF}_j$ and the latest starts $\mathit{LS}_j=\mathit{LF}_j-d_j$ that do not delay the project. Activity $j$, of duration $d_j=4$, has two immediate successors with $\mathit{LS}=20$ and $17$. What are $\mathit{LF}_j$ and $\mathit{LS}_j$?
  1. $\mathit{LF}_j=20$, $\mathit{LS}_j=16$
  2. $\mathit{LF}_j=17$, $\mathit{LS}_j=21$
  3. $\mathit{LF}_j=37$, $\mathit{LS}_j=33$
  4. $\mathit{LF}_j=17$, $\mathit{LS}_j=13$
Explanation. $\mathit{LF}_j=\min \mathit{LS}_k=17$ (it must finish before the most urgent successor starts) and $\mathit{LS}_j=\mathit{LF}_j-d_j=13$.
no-f-176 · level facile · notes
The total slack of an activity is $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$, the free slack is $\mathit{FS}_j=\min_k \mathit{ES}_k-\mathit{EF}_j$ over the successors $k$. Activity $j$ has $\mathit{ES}_j=5$, $\mathit{LS}_j=9$, duration $3$, and its successors have $\mathit{ES}=10$ and $\mathit{ES}=12$. What are $\mathit{TS}_j$ and $\mathit{FS}_j$?
  1. $\mathit{TS}_j=4$, $\mathit{FS}_j=2$
  2. $\mathit{TS}_j=4$, $\mathit{FS}_j=4$
  3. $\mathit{TS}_j=2$, $\mathit{FS}_j=4$
  4. $\mathit{TS}_j=4$, $\mathit{FS}_j=0$
Explanation. $\mathit{TS}_j=9-5=4$; $\mathit{EF}_j=5+3=8$ and $\mathit{FS}_j=\min\{10,12\}-8=2$. Always $\mathit{FS}_j \le \mathit{TS}_j$.
no-f-177 · level facile · notes
In a project, the total slack $\mathit{TS}_j$ is the largest delay of $j$ that does not lengthen the project, the free slack $\mathit{FS}_j$ the largest one that moves the earliest start of no successor. Activity $j$ has $\mathit{TS}_j=5$ and $\mathit{FS}_j=2$, and it is delayed by $3$ units. What happens?
  1. The project becomes $3$ units longer
  2. The project becomes $1$ unit longer
  3. The project does not become longer, but some successor must move
  4. Nothing: no other activity moves
Explanation. A delay up to $\mathit{TS}_j=5$ does not delay the project; one beyond $\mathit{FS}_j=2$ moves some successor. With $3$ we are between the two slacks.
no-f-178 · level facile · notes
The project network has one node for every activity, plus the dummy nodes START and FINISH (duration $0$), and one arc for every precedence. A project has $14$ activities. How many nodes does its project network have?
  1. $14$
  2. $16$
  3. $15$
  4. $28$
Explanation. One node per activity plus START (node $0$) and FINISH (node $n+1$): $14+2=16$.
no-f-179 · level facile · notes
A schedule of a project gives every activity a start $t_j$ with $t_j \ge t_i+d_i$ for every precedence ($i$ before $j$), with durations $d_i>0$. The precedences contain a cycle: $1$ before $2$, $2$ before $3$, $3$ before $1$. What can be said?
  1. The minimum duration is the sum of the durations of the cycle
  2. The critical path method ignores the arc that closes the cycle
  3. The cycle becomes a critical path of the project
  4. The project has no schedule at all
Explanation. A schedule exists if and only if the project network is acyclic: adding up the constraints along the cycle would give $0 \ge \sum d_i>0$.
no-f-180 · level facile · notes
In the project network the length of a path from START to FINISH is the sum of the durations of its activities (START and FINISH last $0$). The durations are $d_1=4$, $d_3=2$, $d_5=6$. How long is the path START$,1,3,5,$FINISH?
  1. $12$
  2. $8$
  3. $6$
  4. $14$
Explanation. $4+2+6=12$. The maximum length of a path from START to FINISH is the minimum project duration.
no-f-181 · level facile · notes
A project has minimum duration $T=20$. Activity $j$ has total slack $\mathit{TS}_j=3$ (largest delay that does not lengthen the project), and its duration grows by $\delta=5$, with no other change. How long does the project last now?
  1. $25$
  2. $20$
  3. $22$
  4. $23$
Explanation. $T'=T+\max\{0,\delta-\mathit{TS}_j\}=20+2=22$: the first $3$ units of delay are absorbed by the slack.
no-f-182 · level facile · notes
A path from START to FINISH is critical if it has maximum length $T$; an activity is critical if $\mathit{TS}_j=0$; the arc $(i,j)$ is tight if $\mathit{ES}_j=\mathit{EF}_i$. A path goes only through critical activities. Is it necessarily critical?
  1. Yes, always
  2. No: it is critical if and only if all its arcs are tight
  3. Yes, as long as it contains the largest number of activities
  4. No: a critical path must contain all the critical activities
Explanation. A path is critical if and only if it is made of tight arcs. With two critical paths, a path crossing them can go only through critical activities without being critical.
no-f-183 · level facile · notes
A project has two critical paths (paths from START to FINISH of maximum length $T$), and an activity lying on only one of them is shortened by one week. How does the minimum duration $T$ change?
  1. It decreases by one week
  2. It decreases by half a week
  3. It increases, because the critical path changes
  4. It does not change
Explanation. To shorten the project every critical path must become shorter: the other critical path still has length $T$.
no-f-184 · level facile · notes
A project is a sequence of $10$ pairs of parallel activities: every activity of a pair has as immediate predecessors the two activities of the previous pair. How many paths from START to FINISH are there in the project network?
  1. $2^{10}=1024$
  2. $20$
  3. $10$
  4. $100$
Explanation. At every pair one of the two activities is chosen: $2^{10}$ paths. This is why the critical path method does not list the paths, but computes the maximum length in $O(n+m)$.
no-f-185 · level facile · notes
The LP model $\mathrm{PD}$ of the minimum duration minimizes $t_{n+1}-t_0$ subject to $t_j-t_i \ge d_i$ on the arcs of the project network. What does its dual $D(\mathrm{PD})$ represent?
  1. A shortest path from START to FINISH
  2. A maximum flow from START to FINISH
  3. One unit of flow from START to FINISH along a path of maximum length
  4. A minimum spanning tree
Explanation. The dual maximizes $\sum d_i x_{ij}$ with a unit flow from START to FINISH: it is the longest path model, with optimal value $T$.
no-f-186 · level media · notes
A project has minimum duration $T=13$ and two critical paths (of maximum length), START$,1,4,6,8,$FINISH and START$,1,5,7,8,$FINISH; the other paths are at most $11$ long. Which change reduces $T$?
  1. Shortening activity $5$ by $1$
  2. Shortening activity $8$ by $1$
  3. Shortening activity $4$ by $1$
  4. Shortening a non-critical activity by $1$
Explanation. Only an activity common to all the critical paths shortens the project: $1$ and $8$ lie on both, $4$ and $5$ on one only. Shortening $8$ by $1$ makes both critical paths $12$ long, the others stay $\le 11$, and $T=12$.
no-f-187 · level teorema · notes
The forward pass computes the earliest starts $\mathit{ES}_j$; a schedule is a vector of starts $\vet{t}$ with $t_0=0$ that respects the precedences. Which statement on the earliest times is correct?
  1. $\mathit{ES}_j$ is the maximum length from START to $j$, and every schedule has $t_j \ge \mathit{ES}_j$
  2. $\mathit{ES}_j$ is the minimum length of a path from START to $j$
  3. $\mathit{ES}_j$ is the maximum length of a path from $j$ to FINISH
  4. $\mathit{ES}_j$ is the maximum length from START to $j$, and every schedule has $t_j \le \mathit{ES}_j$
Explanation. The forward pass computes longest paths from START; $\mathit{ES}$ is the earliest schedule, so every schedule has $t_j \ge \mathit{ES}_j$. The maximum length from $j$ to FINISH is $T-\mathit{LS}_j$.
no-f-188 · level teorema · notes
In a project of minimum duration $T$, let $L_j$ be the maximum length of a path from START to FINISH through activity $j$, and $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$ its total slack. Which statement is correct?
  1. $\mathit{TS}_j=L_j$ for every activity $j$
  2. $\mathit{TS}_j=T+L_j$ for every activity $j$
  3. $\mathit{TS}_j=\mathit{FS}_j$ for every activity $j$
  4. $\mathit{TS}_j=T-L_j$, zero if and only if $j$ is critical
Explanation. $L_j=\mathit{ES}_j+(T-\mathit{LS}_j)=T-\mathit{TS}_j$: the total slack is how much the longest path through $j$ lacks to become critical. The free slack may be smaller.
no-f-189 · level teorema · notes
The LP model $\mathrm{PD}$ minimizes the duration $t_{n+1}-t_0$ of a schedule; its dual $D(\mathrm{PD})$ sends one unit of flow from START to FINISH maximizing $\sum d_i x_{ij}$. Which statement is correct ($T$ minimum duration)?
  1. In general $z(\mathrm{PD})<z(D(\mathrm{PD}))$
  2. $z(\mathrm{PD})=z(D(\mathrm{PD}))=T$, and every critical path is optimal for the dual
  3. Among the schedules, only $\mathit{ES}$ is optimal for $\mathrm{PD}$
  4. The dual has optimal value equal to the sum of all the durations
Explanation. $\mathit{ES}$ and $\mathit{LS}$ have value $T$, the incidence vector of a critical path has value $L(P)=T$: by weak duality they are all optimal.
no-f-190 · level ipotesi · notes
In a project of minimum duration $T$, $L_j$ is the maximum length of a path from START to FINISH through activity $j$, and $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$. To prove that $\mathit{TS}_j=T-L_j$, which results are used?
  1. The total unimodularity of the $\mathrm{PD}$ model
  2. The max-flow min-cut theorem
  3. $\mathit{ES}_j$ and $T-\mathit{LS}_j$ are the maximum lengths from START to $j$ and from $j$ to FINISH
  4. The proposition on the free slack
Explanation. A path from START to FINISH through $j$ is a path to $j$ followed by one from $j$: taking the longest ones (theorems on earliest and latest times), $L_j=\mathit{ES}_j+T-\mathit{LS}_j=T-\mathit{TS}_j$.
no-f-191 · level ipotesi · notes
A path $P=i_0,\dots,i_k$ from START to FINISH is critical if $L(P)=T$; the arc $(i,j)$ is tight if $\mathit{ES}_j=\mathit{EF}_i$. In the proof that $P$ is critical if and only if all its arcs are tight, what is used?
  1. The telescoping sum $\sum(\mathit{ES}_{i_{s+1}}-\mathit{EF}_{i_s})=T-L(P)$, with terms $\ge 0$
  2. Menger's theorem on disjoint paths
  3. The fact that the free slack of every activity is zero
  4. The uniqueness of the optimal solution of the $\mathrm{PD}$ model
Explanation. Along the path the earliest times cancel in pairs and $T-L(P)$ remains; every term is $\ge 0$ by the forward pass, and a sum of non-negative terms is zero if and only if every term is zero.
no-f-192 · level ipotesi · notes
The theorem «minimum project duration» ($T=\mathit{ES}_{n+1}$, length of a longest path) holds under (H1) «deterministic durations» and (H2) «unlimited resources». What are the two assumptions for?
  1. To guarantee that the project network is acyclic
  2. To make the activity durations integer
  3. To guarantee a unique critical path
  4. (H1) fixes the path lengths; (H2) leaves the precedences as the only constraints
Explanation. With deterministic durations and no resource constraints, the minimum duration is the length of a longest path; acyclicity is needed instead for the existence of a schedule.
no-f-193 · level facile · notes
The critical path method computes a topological order, the forward pass, the backward pass and the slacks. What is its running time on a project network with $n$ activities and $m$ arcs?
  1. $O(n^2)$
  2. $O(n+m)$
  3. $O(n\,m)$
  4. $O(2^n)$
Explanation. Each of the four phases scans every arc a constant number of times: $O(n+m)$, even though the paths may be exponentially many.
no-f-194 · level facile · notes
A schedule of a project is a vector of starts $\vet{t}=(t_0,\dots,t_{n+1})$ with $t_0=0$ and $t_j \ge t_i+d_i$ for every arc $(i,j)$ of the project network. Activity $2$ (duration $d_2=5$) is the only predecessor of activity $4$, and $t_2=3$. Which start of $4$ is feasible?
  1. $t_4=3$
  2. $t_4=5$
  3. $t_4=9$
  4. $t_4=7$
Explanation. We need $t_4 \ge t_2+d_2=3+5=8$: among the options only $t_4=9$ respects the precedence. Starting at $t_4=5$ confuses the duration with the finishing time.
no-f-195 · level facile · notes
In a project a path from START to FINISH has length $L(P)=23$ (sum of the durations of its activities). A schedule $\vet{t}$ respects all the precedences, and $t_{n+1}$ is the start of FINISH, that is, the end of the project. What can be said about $t_{n+1}$?
  1. $t_{n+1} \ge 23$
  2. $t_{n+1}=23$
  3. $t_{n+1} \le 23$
  4. Nothing, without knowing the other paths
Explanation. Lemma «every path bounds the duration»: adding up the constraints $t_{i_{s+1}} \ge t_{i_s}+d_{i_s}$ along the path gives $t_{n+1} \ge L(P)=23$, since the activities of the path run one after the other.
no-f-196 · level teorema · notes
The backward pass computes the latest starts $\mathit{LS}_j$ for a project of minimum duration $T$. Which statement on the latest times is correct?
  1. $\mathit{LS}_j$ is the maximum length of a path from START to $j$
  2. Every schedule, even longer than $T$, has $t_j \le \mathit{LS}_j$
  3. $T-\mathit{LS}_j$ is the maximum length from $j$ to FINISH, and schedules of duration $\le T$ have $t_j \le \mathit{LS}_j$
  4. $T-\mathit{LS}_j$ is the minimum length of a path from $j$ to FINISH
Explanation. Theorem «latest times»: $\mathit{LS}$ is the latest schedule of duration $T$, and the longest tail from $j$ to FINISH is $T-\mathit{LS}_j$. A schedule longer than $T$ may start $j$ later.
no-f-197 · level facile · notes
The Gantt chart of a schedule $\vet{t}$ has one row per activity, with a bar from $t_j$ to $t_j+d_j$. In the chart of the earliest schedule, activity $j$ has $\mathit{ES}_j=4$, $d_j=3$ and $\mathit{LF}_j=10$. Where does its bar go?
  1. From $4$ to $10$
  2. From $7$ to $10$
  3. From $0$ to $3$
  4. From $4$ to $7$
Explanation. The bar goes from $\mathit{ES}_j=4$ to $\mathit{EF}_j=4+3=7$; the stretch from $7$ to $\mathit{LF}_j=10$ is the total slack ($3$), drawn separately in the chart.
no-f-474 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, on which two assumptions is the method based?
  1. Random durations and limited resources
  2. Deterministic durations and a single worker
  3. (H1) deterministic durations, without interruptions; (H2) unlimited resources, so independent activities in parallel
  4. Cyclic precedences and integer durations
Explanation. With (H1) every activity lasts exactly $d_j$; with (H2) activities not linked by precedences may run together. So the precedences are the only constraints of a schedule.
no-f-475 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, activity $5$ has the immediate predecessors $2$ and $3$, which end at times $9$ and $12$. When can activity $5$ start at the earliest?
  1. At time $12$
  2. At time $9$
  3. At time $21$
  4. At time $10.5$
Explanation. An activity with several immediate predecessors starts only when all of them have ended: $\max\{9,12\}=12$. The minimum, the sum or the average do not respect all precedences.
no-f-476 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, three kinds of information are needed to describe a project. Which ones?
  1. The activities, the costs and the profits
  2. The resources, the shifts and the deadlines
  3. The critical path, the slacks and the Gantt chart
  4. The activities, the precedences (immediate predecessors) and the durations
Explanation. They are the input data of the method; critical path, slacks and Gantt chart are its results. Costs and resources do not enter the basic model, by (H2).
no-f-477 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in the activity network every arc $(i,j)$ is a precedence and has length $d_i$, the duration of the tail. Which arcs connect the dummy nodes START (node $0$) and FINISH (node $n+1$)?
  1. An arc from START to every activity and from every activity to FINISH
  2. Arcs from START to the activities without predecessors and from the activities without successors to FINISH
  3. A single arc from START to FINISH
  4. None: the dummy nodes have no arcs
Explanation. START precedes the activities without predecessors and FINISH follows those without successors; START and FINISH have duration $0$. Joining them to every activity would add useless arcs.
no-f-478 · level ipotesi · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, Proposition: a project has a schedule ($t_j \ge t_i+d_i$ for every precedence $(i,j)$) if and only if the activity network is acyclic. For «schedule $\Rightarrow$ acyclic», what is done with a cycle $i_0,\dots,i_k=i_0$?
  1. The constraints of its arcs are added up: the times cancel and $0 \ge \sum d_{i_s}>0$ remains, a contradiction
  2. Dijkstra is applied to the cycle
  3. One shows that the cycle contains START
  4. One shows that the durations of the cycle are zero
Explanation. Adding the constraints $t_{i_{s+1}}-t_{i_s} \ge d_{i_s}$ along the cycle gives $0$ on the left and a sum of positive durations on the right. Positive durations are essential; START and FINISH are not on cycles.
no-f-479 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, a schedule assigns the starts $t_j$ with $t_0=0$ and $t_j \ge t_i+d_i$ for every precedence. The precedence $(2,4)$ has $d_2=5$ and $t_2=3$. Which start of $4$ is feasible?
  1. $t_4=5$
  2. $t_4=3$
  3. $t_4=7$
  4. $t_4=9$
Explanation. Activity $2$ ends at time $t_2+d_2=8$, so $t_4 \ge 8$ is needed: only $9$ works. $5$ compares with the duration instead of the end.
no-f-480 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, why is the duration of every schedule at least the length of every path from START to FINISH (sum of the durations of its activities)?
  1. Because the activities of a path cannot run in parallel by (H2)
  2. Because the path is critical
  3. Because along the path every activity starts after the end of the previous one: the constraints added up give $t_{n+1} \ge L(P)$
  4. Because the durations are integer
Explanation. Adding $t_j-t_i \ge d_i$ along the path the intermediate times cancel and $t_{n+1}-t_0 \ge L(P)$ remains. It holds for every path, critical or not; by (H2) activities of different paths may instead run in parallel.
no-f-481 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, the forward pass computes $\mathit{ES}_j=\max_i \mathit{EF}_i$ over the immediate predecessors and $\mathit{EF}_j=\mathit{ES}_j+d_j$. Activity $6$ has predecessors $3$ ($\mathit{EF}_3=10$) and $4$ ($\mathit{EF}_4=14$), and $d_6=5$. What are $\mathit{ES}_6$ and $\mathit{EF}_6$?
  1. $\mathit{ES}_6=10$, $\mathit{EF}_6=15$
  2. $\mathit{ES}_6=14$, $\mathit{EF}_6=19$
  3. $\mathit{ES}_6=24$, $\mathit{EF}_6=29$
  4. $\mathit{ES}_6=14$, $\mathit{EF}_6=14$
Explanation. $\mathit{ES}_6=\max\{10,14\}=14$ and $\mathit{EF}_6=14+5=19$. The minimum would give a start before $4$ ends; the sum makes no sense in time.
no-f-482 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, the backward pass computes $\mathit{LF}_j=\min_k \mathit{LS}_k$ over the immediate successors and $\mathit{LS}_j=\mathit{LF}_j-d_j$. Activity $3$ has successors $5$ ($\mathit{LS}_5=16$) and $6$ ($\mathit{LS}_6=12$), and $d_3=4$. What are $\mathit{LF}_3$ and $\mathit{LS}_3$?
  1. $\mathit{LF}_3=12$, $\mathit{LS}_3=8$
  2. $\mathit{LF}_3=16$, $\mathit{LS}_3=12$
  3. $\mathit{LF}_3=12$, $\mathit{LS}_3=16$
  4. $\mathit{LF}_3=28$, $\mathit{LS}_3=24$
Explanation. Activity $3$ must end in time for all successors: $\mathit{LF}_3=\min\{16,12\}=12$, and $\mathit{LS}_3=12-4=8$. With the maximum, activity $6$ would start late.
no-f-483 · level ipotesi · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, Theorem: $T-\mathit{LS}_j$ is the length of a longest path from $j$ to FINISH. Which fact makes the backward pass correct, node by node?
  1. The durations are integer
  2. The network has a single critical path
  3. The activities are independent by (H2)
  4. The reverse topological order: when $j$ is processed, all its successors already have their final times
Explanation. It is the same idea as (longest) paths in acyclic graphs: in reverse topological order the successors of $j$ come first, and $\mathit{LF}_j=\min_k \mathit{LS}_k$ uses values already computed. There may be several critical paths.
no-f-484 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in what time does the whole method (topological order, forward and backward passes, slacks) run on a network with $n+2$ nodes and $m$ arcs?
  1. $O(n^2 m)$
  2. $O(m \log n)$
  3. $O(n+m)$
  4. $O(2^n)$
Explanation. Every step examines every node and every arc a constant number of times: linear time $O(n+m)$. It is the cost of paths in acyclic graphs.
no-f-485 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, Step 0 looks for a topological order by removing at each step a node without incoming arcs. What is concluded if nodes remain that all have incoming arcs?
  1. The precedences contain a cycle: the project has no schedule
  2. The project has infinite duration but one can go on
  3. The node with fewest incoming arcs is chosen and one goes on
  4. The project has several critical paths
Explanation. A graph in which every node has an incoming arc contains a cycle (walking backwards a node repeats), and with a cycle of precedences no schedule exists. The method stops.
no-f-486 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in Step 3 the tight arcs, those with $\mathit{ES}_j=\mathit{EF}_i$, are marked. What are they for?
  1. To compute the minimum duration $T$
  2. To find the activities with positive free slack
  3. To find a topological order
  4. The critical paths are exactly the paths of tight arcs from START to FINISH
Explanation. On a tight arc activity $j$ starts as soon as $i$ ends: a path of tight arcs from START to FINISH has length $T$, so it is critical, and conversely. $T$ comes from the forward pass.
no-f-487 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in the Gantt chart of the earliest schedule, what does a dashed box from $\mathit{EF}_j$ to $\mathit{LF}_j$ next to the bar of a noncritical activity show?
  1. Its total slack: how far it can slip without delaying the project
  2. The duration of the activity
  3. The period in which the activity is suspended
  4. Its free slack
Explanation. $\mathit{LF}_j-\mathit{EF}_j=\mathit{LS}_j-\mathit{ES}_j=\mathit{TS}_j$, the total slack. The free slack may be smaller: it is about not delaying the successors.
no-f-488 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in the Gantt chart of the earliest schedule, three activities start in the same week. Which assumption makes this possible?
  1. (H1), deterministic durations
  2. That the three activities are critical
  3. (H2), unlimited resources: activities without precedences between them may run in parallel
  4. That the network is acyclic
Explanation. Without resource limits several teams work in parallel; with limited resources different scheduling models would be needed. The three activities need not be critical.
no-f-489 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in the Gantt chart of the earliest schedule the bars of the critical activities form an uninterrupted chain from $0$ to $T$. What does it mean?
  1. That the critical activities all run together
  2. That the critical activities have positive slack
  3. That the project can be shortened by moving them
  4. That a delay of any of them delays the project
Explanation. Critical activities have zero total slack and follow each other without pauses along a path of length $T$: every delay propagates to FINISH. To shorten the project their durations must be reduced.
no-f-490 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, the LP model $\mathrm{PD}$ of the minimum duration has one variable $t_j$ per node. What is its objective function?
  1. $\max \sum_j t_j$
  2. $\min t_{n+1}-t_0$
  3. $\min \sum_j t_j$
  4. $\min \sum_j d_j t_j$
Explanation. One minimizes the time between the start of the project (START) and FINISH, with the constraints $t_j-t_i \ge d_i$ on the precedences. Minimizing $\sum_j t_j$ gives the earliest schedule, not just the duration.
no-f-491 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, in the LP model $\mathrm{PD}$ ($\min t_{n+1}-t_0$, constraints $t_j-t_i \ge d_i$), what sign do the variables $t_j$ have?
  1. $t_j \ge 0$
  2. $t_j \in \{0,1\}$
  3. $t_j \le T$
  4. Free: only differences matter, and shifting all times changes nothing
Explanation. Constraints and objective depend only on differences of times; the variables are free. This is why the dual equations have right-hand sides given by the objective coefficients.
no-f-492 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, the earliest schedule ($t_j=\mathit{ES}_j$) is a solution of the LP model $\mathrm{PD}$. What can be said?
  1. It is optimal, with value $T=\mathit{ES}_{n+1}$
  2. It is feasible but not optimal
  3. It is infeasible
  4. It is optimal only if there is a single critical path
Explanation. The forward pass gives a schedule (constraints respected) of duration $\mathit{ES}_{n+1}=T$, the minimum. The latest schedule is optimal too; uniqueness of the critical path does not matter.
no-f-493 · level teorema · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, Which statement about the LP model $\mathrm{PD}$ of the minimum duration ($\min t_{n+1}-t_0$, $t_j-t_i \ge d_i$ on every precedence, free $t$) is correct?
  1. It is unbounded if there are activities in parallel
  2. It has an optimal solution if and only if the network is acyclic, and the optimal value is the length of a longest path from START to FINISH
  3. It always has an optimal solution, even with cycles of precedences
  4. Its optimal value is the sum of all durations
Explanation. With a cycle the model is infeasible (no schedule); with an acyclic network the optimal value is $T$, the length of a critical path. The sum of all durations holds only if the activities are in series.
no-f-494 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, the dual of the model $\mathrm{PD}$ has variables $x_{ij} \ge 0$ on the arcs, flow conservation with $b_0=1$, $b_{n+1}=-1$ and objective $\max \sum d_i x_{ij}$. What is an integer optimal solution?
  1. An earliest schedule
  2. The incidence vector of a critical path: one unit from START to FINISH along a longest path
  3. A shortest path tree
  4. A flow with one unit on every arc
Explanation. The dual sends one unit from START to FINISH maximizing the length: it is the longest path problem, and the integer optimal solutions are critical paths. By strong duality the value is $T$.
no-f-495 · level ipotesi · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, Theorem: the optimal value of $\mathrm{PD}$ and that of its dual (longest path from START to FINISH) are both $T$. Which pair of feasible solutions proves it directly?
  1. The latest schedule and a spanning tree
  2. Any two schedules
  3. The zero flow and the earliest schedule
  4. The earliest schedule, of duration $T$, and the incidence vector of a critical path, of length $T$: by weak duality they are optimal
Explanation. A feasible primal and a feasible dual solution with the same value are optimal by weak duality. The zero flow violates $b_0=1$; a tree is not a dual solution.
no-f-496 · level facile · notes
In the critical path method (CPM) for a project of activities with durations $d_j$ and precedences, a project with minimum duration $T=13$ has two critical paths, START$,1,4,6,8,$FINISH and START$,2,5,7,8,$FINISH, and every path from START to FINISH goes through activity $8$. How long does the project last if $d_8$ decreases by $1$ (with $d_8>1$)?
  1. $13$, since there is a second critical path
  2. $11$, since two paths get shorter
  3. $12$
  4. $13-\mathit{TS}_8$
Explanation. Every path goes through $8$, so all of them get $1$ shorter and the longest is $12$. The second critical path blocks the gain only when it does not contain the shortened activity; $\mathit{TS}_8=0$ since $8$ is critical.
no-f-515 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), which statement about the earliest starts is correct?
  1. $\mathit{ES}_j$ is the length of a shortest path from START to $j$
  2. $\mathit{ES}_j$ depends on the chosen topological order
  3. $\mathit{ES}_j$ is the length of a longest path from START to $j$, and every schedule has $t_j \ge \mathit{ES}_j$
  4. $\mathit{ES}_j=\mathit{LS}_j$ for every activity
Explanation. An activity waits for the predecessor finishing last, so $\mathit{ES}_j$ is a longest path; and no schedule can start $j$ earlier. The topological order changes the order of computation, not the values.
no-f-516 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), Theorem: every schedule $\vet{t}$ has $t_j \ge \mathit{ES}_j$ for every node. The proof is by induction on the topological order. Which step carries it?
  1. If $t_i \ge \mathit{ES}_i$ for the immediate predecessors $i$ of $j$, then $t_j \ge \max_i(t_i+d_i) \ge \max_i \mathit{EF}_i=\mathit{ES}_j$
  2. The durations are integer
  3. The earliest schedule is unique
  4. The network has a single critical path
Explanation. The constraints $t_j \ge t_i+d_i$ and the inductive hypothesis on the predecessors, which come first in the topological order, give the claim. Integrality and uniqueness of critical paths are not needed.
no-f-517 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), which statement about the minimum duration of the project is correct?
  1. $T$ is the sum of all durations
  2. $T=\mathit{ES}_{n+1}$, the length of a longest path from START to FINISH, and it is attained by the earliest schedule
  3. $T$ is the largest duration of an activity
  4. $T$ is the length of a shortest path from START to FINISH
Explanation. Every schedule lasts at least as long as every path, and the earliest schedule lasts exactly as long as the longest path. By (H2) parallel activities do not add up.
no-f-518 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), Theorem: the latest schedule $t_j=\mathit{LS}_j$ is a schedule of duration $T$. Which property of the backward pass guarantees the constraints $\mathit{LS}_k \ge \mathit{LS}_j+d_j$ on the precedences $(j,k)$?
  1. $\mathit{LS}_j \ge \mathit{ES}_j$
  2. $\mathit{LF}_j=\min_k \mathit{LS}_k$ over the successors, so $\mathit{LS}_j+d_j=\mathit{LF}_j \le \mathit{LS}_k$ for every successor $k$
  3. The durations are positive
  4. The network is acyclic
Explanation. The latest finish of $j$ does not exceed the latest start of any successor: that is exactly the precedence constraint for the latest schedule. Acyclicity is needed for the order to exist, not for this step.
no-f-519 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), let $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$ be the total slack and $\mathit{FS}_j=\min_k \mathit{ES}_k-\mathit{EF}_j$ (over the successors) the free slack. Which statement is correct?
  1. $\mathit{FS}_j \ge \mathit{TS}_j$ for every activity
  2. $\mathit{FS}_j=\mathit{TS}_j$ for every activity
  3. $\mathit{FS}_j>0$ implies that $j$ is critical
  4. $0 \le \mathit{FS}_j \le \mathit{TS}_j$: the free slack is the delay that moves the earliest start of no successor
Explanation. Delaying $j$ by $\mathit{FS}_j$ does not affect the successors, hence not the project: the free slack does not exceed the total one. They coincide, for instance, for activities directly preceding FINISH.
no-f-520 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), Proposition: $\mathit{FS}_j \le \mathit{TS}_j$. Which inequality between times proves it?
  1. $\mathit{ES}_k \ge \mathit{LS}_k$ for every successor
  2. $\mathit{EF}_j \ge \mathit{LF}_j$
  3. $\mathit{ES}_k \le \mathit{LS}_k$ for every successor $k$, so $\min_k \mathit{ES}_k \le \min_k \mathit{LS}_k=\mathit{LF}_j$
  4. $d_j \le T$
Explanation. $\mathit{FS}_j=\min_k \mathit{ES}_k-\mathit{EF}_j \le \mathit{LF}_j-\mathit{EF}_j=\mathit{TS}_j$, since every successor has earliest start not after its latest start.
no-f-521 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), an arc $(i,j)$ is tight if $\mathit{ES}_j=\mathit{EF}_i$. Which statement is correct?
  1. A path from START to FINISH is critical if and only if all its arcs are tight and its activities have zero total slack
  2. Every arc between two critical activities is tight
  3. A path of tight arcs has minimum length
  4. The tight arcs always form a tree
Explanation. On a critical path every activity starts as soon as the previous one ends, and all have zero slack; conversely a path of tight arcs from START to FINISH has length $T$. Two critical activities may be joined by a non-tight arc (on different critical paths).
no-f-522 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), the duration $d_j$ of an activity grows by $\delta>0$. Which statement about the new minimum duration $T'$ is correct?
  1. $T'=T+\delta$ always
  2. $T'=T$ always, thanks to the slacks
  3. $T'=T+\delta$ only if $j$ has zero free slack
  4. $T'=T+\max\{0,\,\delta-\mathit{TS}_j\}$
Explanation. The longest paths through $j$ have length $T-\mathit{TS}_j$ and grow by $\delta$; the project gets longer only by the part of $\delta$ exceeding the total slack. The total slack counts, not the free one.
no-f-523 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), Proposition: if $d_j$ decreases by $\delta<d_j$, then $T-\delta \le T' \le T$, and $T'=T$ if some critical path does not contain $j$. Which fact carries it?
  1. The free slacks do not change
  2. $T'$ is the maximum length of the paths, and the change alters by $-\delta$ only the paths through $j$
  3. The critical activities stay the same
  4. The network is a path
Explanation. A critical path without $j$ keeps length $T$, so $T'=T$; paths through $j$ get shorter by at most $\delta$, so $T' \ge T-\delta$. The critical activities may change.
no-f-524 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), the dual of the LP model $\mathrm{PD}$ is a flow of one unit from START to FINISH maximizing $\sum d_i x_{ij}$. Why does it have an integer optimal solution, that is, a path?
  1. Because the constraints are flow conservation with a totally unimodular incidence matrix and integer balances
  2. Because the durations are integer
  3. Because the dual has a single variable
  4. Because the network has a single critical path
Explanation. The flow polyhedron with integer balances has integer vertices; an integer flow of one unit on an acyclic network is a path. The durations (the costs) do not affect the integrality of the vertices.
no-f-525 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), which statement about the critical path method as an algorithm is correct?
  1. It is exponential, since it enumerates the paths
  2. It is linear, $O(n+m)$: it is the computation of longest paths in an acyclic graph, in both directions
  3. It needs the simplex method to compute $T$
  4. It also works with cyclic precedences
Explanation. The two passes are the acyclic-graph algorithm of the chapter on shortest paths, with maxima instead of minima; every node and arc is examined a constant number of times. With a cycle there is no topological order.
no-f-526 · level ipotesi · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), Theorem: $T=\mathit{ES}_{n+1}$ is the length of a longest path. Without assumption (H2) (unlimited resources), what would change?
  1. Nothing: resources never matter
  2. The network would become cyclic
  3. The durations would become random
  4. Two activities without precedences might not be able to run together, and $T$ could exceed the longest path
Explanation. With limited resources parallel activities compete, and a schedule may have to stagger them beyond what precedences require: the longest path stays only a lower bound.
no-f-527 · level teorema · notes
In the critical path method (durations $d_j$, activity network with START and FINISH, $T$ minimum duration, earliest starts and finishes $\mathit{ES}_j,\mathit{EF}_j$ and latest ones $\mathit{LS}_j,\mathit{LF}_j$), let $L_j$ be the maximum length of a path from START to FINISH through activity $j$. Which statement about the total slack $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$ is correct?
  1. $\mathit{TS}_j=L_j$
  2. $\mathit{TS}_j=T-d_j$
  3. $\mathit{TS}_j=T-L_j$: it is what the longest path through $j$ lacks to become critical
  4. $\mathit{TS}_j$ depends on the chosen schedule
Explanation. $\mathit{ES}_j$ is the longest path up to $j$ and $T-\mathit{LS}_j$ the one from $j$ to FINISH; their sum is $L_j$, so $\mathit{TS}_j=T-L_j$. It is defined by the earliest and latest times, not by a schedule.
no-f-546 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), a project has the activities $1$ ($d_1=3$, no predecessor), $2$ ($d_2=5$, no predecessor), $3$ ($d_3=2$, predecessors $1,2$). What is the minimum duration $T$?
  1. $7$
  2. $10$
  3. $5$
  4. $8$
Explanation. $1$ and $2$ run in parallel by (H2); $3$ starts at time $\max\{3,5\}=5$ and ends at $7$. $10$ adds all durations, as if the activities were in series.
no-f-547 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), in the activity network every arc $(i,j)$ has length $d_i$, the duration of the tail. Why the duration of the tail?
  1. By convention, without consequences
  2. Because the head always has duration $0$
  3. Because then the arcs have positive lengths
  4. Because the arc constraint is $t_j \ge t_i+d_i$: $j$ starts after $i$ has lasted $d_i$
Explanation. The precedence $(i,j)$ separates the starts of $i$ and $j$ by at least $d_i$; so the length of a path from START to FINISH is the sum of the durations of its activities. Arcs from START have length $0$.
no-f-548 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), an activity network has the paths from START to FINISH: $1,3,5$ ($d_1+d_3+d_5=14$), $1,4,5$ ($16$), $2,4,5$ ($13$). Which is the critical path and what is $T$?
  1. $1,3,5$ with $T=14$
  2. $2,4,5$ with $T=13$
  3. $1,4,5$ with $T=16$
  4. All of them, with $T=43$
Explanation. The critical path is the longest, $1,4,5$, and the minimum duration is its length, $16$. The shortest does not constrain the project; $43$ adds lengths of different paths.
no-f-549 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), in a network with paths $1,3,5$ ($14$), $1,4,5$ ($16$), $2,4,5$ ($13$) from START to FINISH, what is the total slack of activity $3$ (largest delay not lengthening the project)?
  1. $0$
  2. $2$
  3. $3$
  4. $16$
Explanation. The longest path through activity $3$ is $1,3,5$, of length $14$: $\mathit{TS}_3=T-L_3=16-14=2$. $3$ is the difference between the critical path and $2,4,5$, which does not pass through $3$.
no-f-550 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), activity $j$ has $\mathit{ES}_j=4$, $\mathit{EF}_j=9$, $\mathit{LS}_j=7$, and its immediate successors have earliest starts $10$ and $12$. What are the total slack $\mathit{TS}_j=\mathit{LS}_j-\mathit{ES}_j$ and the free slack $\mathit{FS}_j=\min_k \mathit{ES}_k-\mathit{EF}_j$?
  1. $\mathit{TS}_j=3$, $\mathit{FS}_j=1$
  2. $\mathit{TS}_j=1$, $\mathit{FS}_j=3$
  3. $\mathit{TS}_j=3$, $\mathit{FS}_j=3$
  4. $\mathit{TS}_j=5$, $\mathit{FS}_j=1$
Explanation. $\mathit{TS}_j=7-4=3$ and $\mathit{FS}_j=\min\{10,12\}-9=1$: $j$ can be delayed by $1$ without affecting the successors, by $3$ without affecting the project. $5=d_j$ is not a slack.
no-f-551 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), which activity is surely critical?
  1. The one with the longest duration
  2. The one with most successors
  3. The one starting first
  4. The one with $\mathit{ES}_j=\mathit{LS}_j$, that is, zero total slack
Explanation. Critical means zero total slack: every delay lengthens the project, and the activity lies on a critical path. Duration, number of successors and position are not enough.
no-f-552 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), the LP model $\mathrm{PD}$ has the constraint $t_j-t_i \ge d_i$ for the precedence $(i,j)$. With $d_2=4$ and the precedence $(2,5)$, which constraint appears?
  1. $t_5-t_2 \le 4$
  2. $t_2-t_5 \ge 4$
  3. $t_5-t_2 \ge 4$
  4. $t_5 \ge 4$
Explanation. Activity $5$ starts at least $d_2=4$ after the start of $2$: $t_5 \ge t_2+4$. With $\le$ one would require starting within $4$, which is not a precedence.
no-f-553 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), the forward pass processes the nodes in topological order. Why can an activity not be processed before its immediate predecessors?
  1. Because durations are integer
  2. Because the activity might be critical
  3. Because the backward pass forbids it
  4. Because $\mathit{ES}_j=\max_i \mathit{EF}_i$ uses the earliest finishes of the predecessors, which must already be known
Explanation. Every $\mathit{ES}_j$ depends on the values $\mathit{EF}_i$ of the predecessors; the topological order puts them all before $j$. It is the same idea as paths in acyclic graphs.
no-f-554 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), the project has minimum duration $T=20$. Activity $7$ precedes only FINISH and lasts $d_7=6$. What are $\mathit{LF}_7$ and $\mathit{LS}_7$?
  1. $\mathit{LF}_7=14$, $\mathit{LS}_7=8$
  2. $\mathit{LF}_7=26$, $\mathit{LS}_7=20$
  3. $\mathit{LF}_7=20$, $\mathit{LS}_7=14$
  4. $\mathit{LF}_7=20$, $\mathit{LS}_7=20$
Explanation. The backward pass starts from $\mathit{LF}_{\mathrm{FINISH}}=\mathit{LS}_{\mathrm{FINISH}}=T=20$; the only successor of $7$ is FINISH, so $\mathit{LF}_7=20$ and $\mathit{LS}_7=20-6=14$.
no-f-555 · level facile · notes
In the critical path method (activities with durations $d_j$ and immediate predecessors, nodes START and FINISH of duration $0$), the project has minimum duration $T=30$. Activity $j$, not critical, has total slack $\mathit{TS}_j=5$, and its duration grows by $3$. What is the new minimum duration?
  1. $33$
  2. $30$
  3. $35$
  4. $28$
Explanation. $T'=T+\max\{0,3-5\}=30$: the increase is absorbed by the total slack. The project would get longer only with an increase above $5$.

Generated questions (47)

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

1. Graphs (7)

Example 1 · no-g-bfs · level facile · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(2,3,4)$, $L(2)=(1)$, $L(3)=(2,6)$, $L(4)=(1)$, $L(5)=\emptyset$, $L(6)=(2,5)$. The generic search from $s=1$ keeps in $\mathit{LIST}$ the labelled nodes to be examined: it examines a node $i$ of $\mathit{LIST}$ and labels the first unlabelled head of the list $L(i)$, or removes $i$ from $\mathit{LIST}$ if there is none. In the breadth-first search (BFS) $i$ is always the first node of $\mathit{LIST}$ (a queue). In which order does the BFS label the nodes?
  1. $1,\,2,\,3,\,6,\,5,\,4$
  2. $1,\,2,\,3,\,4,\,6,\,5$
  3. $1,\,4,\,3,\,2,\,6,\,5$
  4. $1,\,2,\,3,\,4,\,5,\,6$
Explanation. The BFS always selects the first node of $\mathit{LIST}$ (a queue) and the first admissible arc of its list: order $1,\,2,\,3,\,4,\,6,\,5$. The order $1,\,2,\,3,\,6,\,5,\,4$ is that of the DFS, which selects the last node.
Example 2 · no-g-bfs · level facile · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(5)$, $L(2)=(3,4,6)$, $L(3)=\emptyset$, $L(4)=(1,6)$, $L(5)=(1,2,4)$, $L(6)=\emptyset$. The generic search from $s=1$ keeps in $\mathit{LIST}$ the labelled nodes to be examined: it examines a node $i$ of $\mathit{LIST}$ and labels the first unlabelled head of the list $L(i)$, or removes $i$ from $\mathit{LIST}$ if there is none. In the breadth-first search (BFS) $i$ is always the first node of $\mathit{LIST}$ (a queue). In which order does the BFS label the nodes?
  1. $1,\,5,\,2,\,4,\,3,\,6$
  2. $1,\,5,\,2,\,3,\,4,\,6$
  3. $1,\,5,\,4,\,2,\,6,\,3$
  4. $1,\,2,\,3,\,4,\,5,\,6$
Explanation. The BFS always selects the first node of $\mathit{LIST}$ (a queue) and the first admissible arc of its list: order $1,\,5,\,2,\,4,\,3,\,6$. The order $1,\,5,\,2,\,3,\,4,\,6$ is that of the DFS, which selects the last node.
Example 1 · no-g-dfs · level facile · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(2,3,4)$, $L(2)=(1)$, $L(3)=(2,6)$, $L(4)=(1)$, $L(5)=\emptyset$, $L(6)=(2,5)$. The generic search from $s=1$ keeps in $\mathit{LIST}$ the labelled nodes to be examined: it examines a node $i$ of $\mathit{LIST}$ and labels the first unlabelled head of the list $L(i)$, or removes $i$ from $\mathit{LIST}$ if there is none. In the depth-first search (DFS) $i$ is always the last node of $\mathit{LIST}$ (a stack). In which order does the DFS label the nodes?
  1. $1,\,2,\,3,\,4,\,6,\,5$
  2. $1,\,2,\,3,\,6,\,5,\,4$
  3. $2,\,5,\,6,\,3,\,4,\,1$
  4. $1,\,4,\,3,\,6,\,5,\,2$
Explanation. The DFS always selects the last node of $\mathit{LIST}$ (a stack) and the first admissible arc of its list; a node without admissible arcs leaves $\mathit{LIST}$. Labelling order $1,\,2,\,3,\,6,\,5,\,4$; $2,\,5,\,6,\,3,\,4,\,1$ is the order in which the nodes leave $\mathit{LIST}$.
Example 2 · no-g-dfs · level facile · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(5)$, $L(2)=(3,4,6)$, $L(3)=\emptyset$, $L(4)=(1,6)$, $L(5)=(1,2,4)$, $L(6)=\emptyset$. The generic search from $s=1$ keeps in $\mathit{LIST}$ the labelled nodes to be examined: it examines a node $i$ of $\mathit{LIST}$ and labels the first unlabelled head of the list $L(i)$, or removes $i$ from $\mathit{LIST}$ if there is none. In the depth-first search (DFS) $i$ is always the last node of $\mathit{LIST}$ (a stack). In which order does the DFS label the nodes?
  1. $1,\,5,\,2,\,3,\,4,\,6$
  2. $1,\,5,\,2,\,4,\,3,\,6$
  3. $3,\,6,\,4,\,2,\,5,\,1$
  4. $1,\,5,\,4,\,6,\,2,\,3$
Explanation. The DFS always selects the last node of $\mathit{LIST}$ (a stack) and the first admissible arc of its list; a node without admissible arcs leaves $\mathit{LIST}$. Labelling order $1,\,5,\,2,\,3,\,4,\,6$; $3,\,6,\,4,\,2,\,5,\,1$ is the order in which the nodes leave $\mathit{LIST}$.
Example 1 · no-g-rank · level facile · notes
The directed graph with nodes $1,\dots,7$ has the arcs $(2,4)$, $(4,7)$, $(5,1)$, $(5,6)$, $(7,2)$. What is the rank of its node–arc incidence matrix $\mat{B}$ (one row per node, one column per arc, $+1$ in the tail and $-1$ in the head)?
  1. $6$
  2. $7$
  3. $2$
  4. $4$
Explanation. The underlying undirected graph has $k=3$ connected components, so $\rank(\mat{B})=|N|-k=7-3=4$. $|N|-1$ holds only for a connected graph.
Example 2 · no-g-rank · level facile · notes
The directed graph with nodes $1,\dots,7$ has the arcs $(2,4)$, $(3,7)$, $(4,3)$, $(4,7)$, $(5,1)$. What is the rank of its node–arc incidence matrix $\mat{B}$ (one row per node, one column per arc, $+1$ in the tail and $-1$ in the head)?
  1. $6$
  2. $4$
  3. $7$
  4. $2$
Explanation. The underlying undirected graph has $k=3$ connected components, so $\rank(\mat{B})=|N|-k=7-3=4$. $|N|-1$ holds only for a connected graph.
Example 1 · no-g-strong-component · level media · notes
The directed graph with nodes $1,\dots,7$ has the arcs $(1,6)$, $(1,7)$, $(2,4)$, $(2,6)$, $(3,2)$, $(3,6)$, $(4,3)$, $(5,4)$, $(7,3)$, $(7,5)$. Two nodes $i,j$ are strongly connected if there are directed paths from $i$ to $j$ and from $j$ to $i$. What is the strongly connected component of node $2$, that is, the set of the nodes strongly connected to $2$?
  1. $\{2,3,4,6\}$
  2. $\{1,2,3,4,5,7\}$
  3. $\{2,3,4\}$
  4. $\{1,2,3,4,5,6,7\}$
Explanation. Nodes reachable from $2$: $R=\{2,3,4,6\}$; nodes from which $2$ is reachable: $R'=\{1,2,3,4,5,7\}$. The component is $R \cap R'=\{2,3,4\}$; $R$ alone, $R'$ alone or the union contain nodes with no way back.
Example 2 · no-g-strong-component · level media · notes
The directed graph with nodes $1,\dots,7$ has the arcs $(1,3)$, $(1,5)$, $(1,7)$, $(5,2)$, $(5,4)$, $(5,7)$, $(6,3)$, $(6,5)$, $(7,5)$, $(7,6)$. Two nodes $i,j$ are strongly connected if there are directed paths from $i$ to $j$ and from $j$ to $i$. What is the strongly connected component of node $6$, that is, the set of the nodes strongly connected to $6$?
  1. $\{2,3,4,5,6,7\}$
  2. $\{5,6,7\}$
  3. $\{1,5,6,7\}$
  4. $\{1,2,3,4,5,6,7\}$
Explanation. Nodes reachable from $6$: $R=\{2,3,4,5,6,7\}$; nodes from which $6$ is reachable: $R'=\{1,5,6,7\}$. The component is $R \cap R'=\{5,6,7\}$; $R$ alone, $R'$ alone or the union contain nodes with no way back.
Example 1 · no-g-net-outflow · level facile · notes
The directed graph with nodes $1,\dots,5$ has the arcs with the values $x_{13}=5$, $x_{15}=1$, $x_{21}=2$, $x_{23}=6$, $x_{34}=3$, $x_{35}=6$, $x_{42}=4$, $x_{54}=6$. Let $\mat{B}$ be its node–arc incidence matrix ($+1$ in the row of the tail, $-1$ in that of the head of every arc). What is component $5$ of the vector $\mat{B}\vet{x}$?
  1. $-1$
  2. $1$
  3. $13$
  4. $6$
Explanation. Row $5$ of $\mat{B}\vet{x}$ is what leaves the node minus what enters it: $6-7=-1$. The opposite sign gives inflow minus outflow.
Example 2 · no-g-net-outflow · level facile · notes
The directed graph with nodes $1,\dots,5$ has the arcs with the values $x_{12}=4$, $x_{14}=3$, $x_{25}=6$, $x_{31}=6$, $x_{42}=1$, $x_{43}=4$, $x_{45}=5$, $x_{51}=3$. Let $\mat{B}$ be its node–arc incidence matrix ($+1$ in the row of the tail, $-1$ in that of the head of every arc). What is component $2$ of the vector $\mat{B}\vet{x}$?
  1. $-1$
  2. $1$
  3. $11$
  4. $6$
Explanation. Row $2$ of $\mat{B}\vet{x}$ is what leaves the node minus what enters it: $6-5=1$. The opposite sign gives inflow minus outflow.
Example 1 · no-g-bfs-dist · level facile · notes
The directed graph with nodes $1,\dots,7$ has the adjacency lists (sorted by increasing index) $L(1)=(3,4,6)$, $L(2)=(1)$, $L(3)=(2,4)$, $L(4)=(1,3,5)$, $L(5)=\emptyset$, $L(6)=(1,7)$, $L(7)=\emptyset$. What is the minimum number of arcs of a directed path from node $1$ to node $5$ (as computed by the breadth-first search from $1$, which keeps the labelled nodes to examine in a queue)?
  1. $2$
  2. $3$
  3. $5$
  4. $1$
Explanation. In the BFS $d(j)=d(\mathit{pred}(j))+1$ is the minimum number of arcs: tracing back the predecessors from $5$ reaches $1$ in $2$ arcs. The DFS may give a longer path ($3$ arcs); the position in the labelling order is not a distance.
Example 2 · no-g-bfs-dist · level facile · notes
The directed graph with nodes $1,\dots,7$ has the adjacency lists (sorted by increasing index) $L(1)=(2,5,6,7)$, $L(2)=(7)$, $L(3)=\emptyset$, $L(4)=(3)$, $L(5)=(1,4)$, $L(6)=(1,3,4)$, $L(7)=(2)$. What is the minimum number of arcs of a directed path from node $1$ to node $3$ (as computed by the breadth-first search from $1$, which keeps the labelled nodes to examine in a queue)?
  1. $3$
  2. $6$
  3. $2$
  4. $1$
Explanation. In the BFS $d(j)=d(\mathit{pred}(j))+1$ is the minimum number of arcs: tracing back the predecessors from $3$ reaches $1$ in $2$ arcs. The DFS may give a longer path ($3$ arcs); the position in the labelling order is not a distance.
Example 1 · no-g-dfs-tree · level complessa · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(2,4,5)$, $L(2)=(4)$, $L(3)=(2)$, $L(4)=(5)$, $L(5)=(3,4,6)$, $L(6)=\emptyset$. The depth-first search (DFS) from $s=1$ keeps in a stack $\mathit{LIST}$ the labelled nodes to examine: it examines the last node $i$ of $\mathit{LIST}$, labels the first unlabelled head $j$ of $L(i)$ setting $\mathit{pred}(j)=i$, or removes $i$ from $\mathit{LIST}$ if there is none. What are the predecessors of nodes $2,\dots,6$?
  1. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(1,5,1,1,5)$
  2. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(3,5,5,1,5)$
  3. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(1,5,2,4,3)$
  4. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(1,5,2,4,5)$
Explanation. Labelling order $1,\,2,\,4,\,5,\,3,\,6$; predecessors $(1,5,2,4,5)$. When a node has no more admissible arcs the DFS goes back to the previous node of the stack, so the predecessor is not always the node labelled just before; the BFS would give $(1,5,1,1,5)$.
Example 2 · no-g-dfs-tree · level complessa · notes
The directed graph with nodes $1,\dots,6$ has the adjacency lists (sorted by increasing index) $L(1)=(5)$, $L(2)=(3,4,6)$, $L(3)=\emptyset$, $L(4)=(1,6)$, $L(5)=(1,2,4)$, $L(6)=\emptyset$. The depth-first search (DFS) from $s=1$ keeps in a stack $\mathit{LIST}$ the labelled nodes to examine: it examines the last node $i$ of $\mathit{LIST}$, labels the first unlabelled head $j$ of $L(i)$ setting $\mathit{pred}(j)=i$, or removes $i$ from $\mathit{LIST}$ if there is none. What are the predecessors of nodes $2,\dots,6$?
  1. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(5,2,2,1,4)$
  2. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(5,2,5,1,2)$
  3. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(5,2,5,1,4)$
  4. $(\mathit{pred}(2),\dots,\mathit{pred}(6))=(5,2,3,1,4)$
Explanation. Labelling order $1,\,5,\,2,\,3,\,4,\,6$; predecessors $(5,2,2,1,4)$. When a node has no more admissible arcs the DFS goes back to the previous node of the stack, so the predecessor is not always the node labelled just before; the BFS would give $(5,2,5,1,2)$.

2. Minimum spanning trees (5)

Example 1 · no-g-kruskal · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{16}=4$, $w_{23}=7$, $w_{24}=15$, $w_{25}=13$, $w_{34}=2$, $w_{35}=3$, $w_{45}=6$, $w_{46}=5$, $w_{56}=1$ (where $w_{uv}$ is the weight of $\{u,v\}$). What is the weight of a minimum spanning tree, that is, of minimum total weight?
  1. $15$
  2. $20$
  3. $19$
  4. $17$
Explanation. Kruskal accepts, by increasing weight, the edges joining two components: $\{5,6\}$, $\{3,4\}$, $\{3,5\}$, $\{1,6\}$, $\{2,3\}$, weight $17$. The sum of the $5$ smallest weights ($15$) ignores the cycles.
Example 2 · no-g-kruskal · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{13}=12$, $w_{16}=10$, $w_{24}=7$, $w_{25}=1$, $w_{34}=13$, $w_{35}=8$, $w_{36}=6$, $w_{45}=14$, $w_{46}=9$ (where $w_{uv}$ is the weight of $\{u,v\}$). What is the weight of a minimum spanning tree, that is, of minimum total weight?
  1. $32$
  2. $31$
  3. $40$
  4. $33$
Explanation. Kruskal accepts, by increasing weight, the edges joining two components: $\{2,5\}$, $\{3,6\}$, $\{2,4\}$, $\{3,5\}$, $\{1,6\}$, weight $32$. The sum of the $5$ smallest weights ($31$) ignores the cycles.
Example 1 · no-g-prim · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{12}=6$, $w_{13}=13$, $w_{14}=5$, $w_{15}=7$, $w_{16}=14$, $w_{24}=10$, $w_{26}=2$, $w_{36}=3$, $w_{45}=9$ ($w_{uv}$ is the weight of $\{u,v\}$). Prim's algorithm starts from $S=\{1\}$ and at every step inserts into $S$ the vertex outside $S$ joined to $S$ by the lightest edge. In which order does it insert the other vertices?
  1. $4,\,2,\,6,\,3,\,5$
  2. $4,\,2,\,5,\,6,\,3$
  3. $2,\,6,\,3,\,4,\,5$
  4. $4,\,2,\,5,\,3,\,6$
Explanation. Prim selects the vertex outside $S$ with minimum label and updates $d(u):=w_{vu}$ if $w_{vu}<d(u)$: order $4,\,2,\,6,\,3,\,5$. With $d(v)+w_{vu}$ (Dijkstra) one would get $4,\,2,\,5,\,6,\,3$.
Example 2 · no-g-prim · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{13}=12$, $w_{16}=10$, $w_{24}=7$, $w_{25}=1$, $w_{34}=13$, $w_{35}=8$, $w_{36}=6$, $w_{45}=14$, $w_{46}=9$ ($w_{uv}$ is the weight of $\{u,v\}$). Prim's algorithm starts from $S=\{1\}$ and at every step inserts into $S$ the vertex outside $S$ joined to $S$ by the lightest edge. In which order does it insert the other vertices?
  1. $6,\,3,\,5,\,2,\,4$
  2. $6,\,3,\,4,\,5,\,2$
  3. $2,\,5,\,3,\,6,\,4$
  4. $6,\,3,\,2,\,4,\,5$
Explanation. Prim selects the vertex outside $S$ with minimum label and updates $d(u):=w_{vu}$ if $w_{vu}<d(u)$: order $6,\,3,\,5,\,2,\,4$. With $d(v)+w_{vu}$ (Dijkstra) one would get $6,\,3,\,4,\,5,\,2$.
Example 1 · no-g-mst-exchange · level media · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{12}=6$, $w_{13}=13$, $w_{14}=5$, $w_{15}=7$, $w_{16}=14$, $w_{24}=10$, $w_{26}=2$, $w_{36}=3$, $w_{45}=9$ ($w_{uv}$ is the weight of $\{u,v\}$). The spanning tree $T=\{\{1,3\},\{1,5\},\{2,6\},\{3,6\},\{4,5\}\}$ weighs $34$. The edge $\{2,4\}$ is added to $T$ and one edge is removed so as to obtain a spanning tree again. What is the weight of the lightest tree obtained in this way?
  1. $31$
  2. $42$
  3. $34$
  4. $44$
Explanation. Only an edge of the fundamental cycle of $\{2,4\}$ can be removed, that is $\{1,3\}$, $\{1,5\}$, $\{2,6\}$, $\{3,6\}$, $\{4,5\}$ (exchange lemma); the heaviest is the best choice: $34+10-13=31$. The heaviest edge of $T$ may lie outside the cycle.
Example 2 · no-g-mst-exchange · level media · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{12}=3$, $w_{14}=9$, $w_{15}=11$, $w_{16}=7$, $w_{23}=14$, $w_{24}=5$, $w_{25}=1$, $w_{26}=12$, $w_{46}=13$ ($w_{uv}$ is the weight of $\{u,v\}$). The spanning tree $T=\{\{1,5\},\{1,6\},\{2,3\},\{2,4\},\{4,6\}\}$ weighs $50$. The edge $\{2,5\}$ is added to $T$ and one edge is removed so as to obtain a spanning tree again. What is the weight of the lightest tree obtained in this way?
  1. $46$
  2. $38$
  3. $37$
  4. $50$
Explanation. Only an edge of the fundamental cycle of $\{2,5\}$ can be removed, that is $\{1,5\}$, $\{1,6\}$, $\{2,4\}$, $\{4,6\}$ (exchange lemma); the heaviest is the best choice: $50+1-13=38$. The heaviest edge of $T$ may lie outside the cycle.
Example 1 · no-g-cut-lightest · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{14}=7$, $w_{16}=10$, $w_{24}=2$, $w_{25}=11$, $w_{26}=13$, $w_{35}=3$, $w_{36}=14$, $w_{45}=6$, $w_{46}=12$ ($w_{uv}$ is the weight of $\{u,v\}$). The generic greedy algorithm for the minimum spanning tree, with $F=\emptyset$, chooses the cut $\delta(S)$ with $S=\{1,3\}$ (the edges with one endpoint in $S$ and the other outside). Which edge does it add to $F$?
  1. $\{2,4\}$
  2. $\{1,4\}$
  3. $\{3,5\}$
  4. $\{3,6\}$
Explanation. It adds the minimum-weight edge of the cut: $\{3,5\}$, of weight $3$; by the cut property it lies in a minimum spanning tree. The lightest edge of the graph, $\{2,4\}$, does not cross $\delta(S)$.
Example 2 · no-g-cut-lightest · level facile · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{12}=3$, $w_{14}=9$, $w_{15}=11$, $w_{16}=7$, $w_{23}=14$, $w_{24}=5$, $w_{25}=1$, $w_{26}=12$, $w_{46}=13$ ($w_{uv}$ is the weight of $\{u,v\}$). The generic greedy algorithm for the minimum spanning tree, with $F=\emptyset$, chooses the cut $\delta(S)$ with $S=\{1,4\}$ (the edges with one endpoint in $S$ and the other outside). Which edge does it add to $F$?
  1. $\{1,2\}$
  2. $\{2,5\}$
  3. $\{2,4\}$
  4. $\{4,6\}$
Explanation. It adds the minimum-weight edge of the cut: $\{1,2\}$, of weight $3$; by the cut property it lies in a minimum spanning tree. The lightest edge of the graph, $\{2,5\}$, does not cross $\delta(S)$.
Example 1 · no-g-kruskal-run · level complessa · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{13}=13$, $w_{14}=1$, $w_{16}=10$, $w_{23}=15$, $w_{34}=14$, $w_{35}=5$, $w_{36}=7$, $w_{45}=12$, $w_{46}=2$, $w_{56}=6$ ($w_{uv}$ is the weight of $\{u,v\}$). Kruskal's algorithm examines the edges by increasing weight and accepts those joining two different components of the current forest. Which edges does it accept, in order?
  1. $\{1,4\}$, $\{4,6\}$, $\{5,6\}$, $\{3,5\}$, $\{2,3\}$
  2. $\{1,4\}$, $\{4,6\}$, $\{3,5\}$, $\{5,6\}$, $\{3,6\}$
  3. $\{1,4\}$, $\{4,6\}$, $\{5,6\}$, $\{3,6\}$, $\{2,3\}$
  4. $\{1,4\}$, $\{4,6\}$, $\{3,5\}$, $\{5,6\}$, $\{2,3\}$
Explanation. Kruskal accepts $\{1,4\}$, $\{4,6\}$, $\{3,5\}$, $\{5,6\}$, $\{2,3\}$ and rejects the edges closing a cycle; the $5$ lightest edges do not necessarily form a tree. Prim from $1$ adds the edges of the same tree in another order ($\{1,4\}$, $\{4,6\}$, $\{5,6\}$, $\{3,5\}$, $\{2,3\}$).
Example 2 · no-g-kruskal-run · level complessa · notes
The undirected graph with vertices $1,\dots,6$ has the edges with weights $w_{12}=12$, $w_{14}=7$, $w_{15}=10$, $w_{16}=4$, $w_{23}=15$, $w_{24}=6$, $w_{25}=2$, $w_{26}=13$, $w_{45}=3$, $w_{46}=14$ ($w_{uv}$ is the weight of $\{u,v\}$). Kruskal's algorithm examines the edges by increasing weight and accepts those joining two different components of the current forest. Which edges does it accept, in order?
  1. $\{1,6\}$, $\{1,4\}$, $\{4,5\}$, $\{2,5\}$, $\{2,3\}$
  2. $\{2,5\}$, $\{4,5\}$, $\{1,6\}$, $\{1,4\}$, $\{2,3\}$
  3. $\{2,5\}$, $\{4,5\}$, $\{1,6\}$, $\{2,4\}$, $\{1,4\}$
  4. $\{1,6\}$, $\{1,4\}$, $\{1,5\}$, $\{1,2\}$, $\{2,3\}$
Explanation. Kruskal accepts $\{2,5\}$, $\{4,5\}$, $\{1,6\}$, $\{1,4\}$, $\{2,3\}$ and rejects the edges closing a cycle; the $5$ lightest edges do not necessarily form a tree. Prim from $1$ adds the edges of the same tree in another order ($\{1,6\}$, $\{1,4\}$, $\{4,5\}$, $\{2,5\}$, $\{2,3\}$).

3. Shortest paths (6)

Example 1 · no-g-dijkstra · level facile · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{12}=9$, $d_{13}=4$, $d_{16}=8$, $d_{24}=3$, $d_{32}=1$, $d_{35}=1$, $d_{43}=9$, $d_{45}=2$, $d_{56}=7$, $d_{62}=1$, $d_{64}=6$ ($d_{ij}$ is the length of the arc $(i,j)$). The distance $\tilde{d}(j)$ is the minimum length of a directed path from $s=1$ to $j$. Which distances $\tilde{d}=(\tilde{d}(1),\dots,\tilde{d}(6))$ does Dijkstra's algorithm from $s=1$ compute?
  1. $(0,9,4,14,5,8)$
  2. $(0,9,4,12,5,8)$
  3. $(0,1,4,3,1,7)$
  4. $(0,5,4,8,5,8)$
Explanation. Dijkstra makes permanent the temporary node with the smallest label and updates $d(j):=d(i)+d_{ij}$ when it improves; a label can improve several times before it becomes permanent. Distances $(0,5,4,8,5,8)$.
Example 2 · no-g-dijkstra · level facile · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{12}=9$, $d_{13}=9$, $d_{14}=5$, $d_{16}=9$, $d_{25}=6$, $d_{26}=2$, $d_{35}=1$, $d_{42}=3$, $d_{62}=2$ ($d_{ij}$ is the length of the arc $(i,j)$). The distance $\tilde{d}(j)$ is the minimum length of a directed path from $s=1$ to $j$. Which distances $\tilde{d}=(\tilde{d}(1),\dots,\tilde{d}(6))$ does Dijkstra's algorithm from $s=1$ compute?
  1. $(0,9,9,5,15,9)$
  2. $(0,8,9,5,10,9)$
  3. $(0,9,9,5,10,9)$
  4. $(0,3,9,5,6,2)$
Explanation. Dijkstra makes permanent the temporary node with the smallest label and updates $d(j):=d(i)+d_{ij}$ when it improves; a label can improve several times before it becomes permanent. Distances $(0,8,9,5,10,9)$.
Example 1 · no-g-bellman-ford · level media · notes
The directed graph with nodes $1,\dots,5$ has the arcs with lengths $d_{12}=6$, $d_{14}=1$, $d_{24}=1$, $d_{31}=4$, $d_{32}=-1$, $d_{43}=8$, $d_{45}=1$, $d_{53}=2$. The Bellman–Ford algorithm from $s=1$ starts from $d^0=(0,+\infty,\dots,+\infty)$ and in pass $k$ sets $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$, using only the labels of the previous pass. What are the labels $d^2=(d^2(1),\dots,d^2(5))$?
  1. $(0,6,+\infty,1,+\infty)$
  2. $(0,3,4,1,2)$
  3. $(0,6,9,1,2)$
  4. $(0,6,4,1,2)$
Explanation. $d^k(j)$ is the minimum length of a walk from $s$ to $j$ with at most $k$ arcs: $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$, using only the labels of the previous pass. $d^1=(0,6,+\infty,1,+\infty)$, $d^2=(0,6,9,1,2)$.
Example 2 · no-g-bellman-ford · level media · notes
The directed graph with nodes $1,\dots,5$ has the arcs with lengths $d_{13}=8$, $d_{15}=-2$, $d_{21}=5$, $d_{34}=5$, $d_{42}=7$, $d_{45}=-2$, $d_{53}=4$. The Bellman–Ford algorithm from $s=1$ starts from $d^0=(0,+\infty,\dots,+\infty)$ and in pass $k$ sets $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$, using only the labels of the previous pass. What are the labels $d^2=(d^2(1),\dots,d^2(5))$?
  1. $(0,+\infty,2,13,-2)$
  2. $(0,+\infty,8,+\infty,-2)$
  3. $(0,14,2,7,-2)$
  4. $(0,20,2,7,-2)$
Explanation. $d^k(j)$ is the minimum length of a walk from $s$ to $j$ with at most $k$ arcs: $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$, using only the labels of the previous pass. $d^1=(0,+\infty,8,+\infty,-2)$, $d^2=(0,+\infty,2,13,-2)$.
Example 1 · no-g-dag · level facile · notes
The acyclic directed graph with nodes $1,\dots,6$ (topological order $1,2,\dots,6$) has the arcs with lengths $d_{12}=3$, $d_{13}=1$, $d_{24}=-2$, $d_{25}=-2$, $d_{26}=3$, $d_{34}=0$, $d_{35}=0$, $d_{36}=8$, $d_{45}=4$, $d_{56}=3$. What is the distance $\tilde{d}(6)$, that is, the minimum length of a directed path from $s=1$ to $6$?
  1. $8$
  2. $4$
  3. $9$
  4. $6$
Explanation. In acyclic graphs the nodes are scanned in topological order and each label is final when its node is processed, with lengths of any sign: $\tilde{d}=(0,3,1,1,1,4)$. Dijkstra can fail with negative arcs; the maximum gives the longest path.
Example 2 · no-g-dag · level facile · notes
The acyclic directed graph with nodes $1,\dots,6$ (topological order $1,2,\dots,6$) has the arcs with lengths $d_{12}=5$, $d_{14}=-3$, $d_{16}=6$, $d_{23}=-3$, $d_{24}=2$, $d_{25}=4$, $d_{26}=-2$, $d_{36}=-3$, $d_{45}=4$, $d_{46}=7$. What is the distance $\tilde{d}(6)$, that is, the minimum length of a directed path from $s=1$ to $6$?
  1. $4$
  2. $14$
  3. $-1$
  4. $6$
Explanation. In acyclic graphs the nodes are scanned in topological order and each label is final when its node is processed, with lengths of any sign: $\tilde{d}=(0,5,2,-3,1,-1)$. Dijkstra can fail with negative arcs; the maximum gives the longest path.
Example 1 · no-g-dijkstra-run · level complessa · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{12}=8$, $d_{13}=9$, $d_{14}=2$, $d_{15}=8$, $d_{16}=6$, $d_{21}=4$, $d_{35}=2$, $d_{43}=2$, $d_{56}=6$. Dijkstra's algorithm from $s=1$ makes permanent at every step the temporary node with the smallest label (ties: the smallest index) and updates $d(j):=d(i)+d_{ij}$ on the arcs leaving the node $i$ just made permanent, if it improves. In which order do the nodes become permanent, and what are the final distances $\tilde{d}=(\tilde{d}(1),\dots,\tilde{d}(6))$?
  1. order $1,\,4,\,6,\,2,\,5,\,3$; $\tilde{d}=(0,8,9,2,8,6)$
  2. order $1,\,4,\,3,\,5,\,6,\,2$; $\tilde{d}=(0,8,2,2,2,6)$
  3. order $1,\,4,\,3,\,5,\,6,\,2$; $\tilde{d}=(0,8,9,2,8,6)$
  4. order $1,\,4,\,3,\,5,\,6,\,2$; $\tilde{d}=(0,8,4,2,6,6)$
Explanation. With positive lengths the nodes become permanent in order of distance: order $1,\,4,\,3,\,5,\,6,\,2$, distances $(0,8,4,2,6,6)$. A label can improve several times before becoming permanent; keeping the first label found, or using $d_{ij}$ instead of $d(i)+d_{ij}$ (as in Prim), gives wrong results.
Example 2 · no-g-dijkstra-run · level complessa · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{12}=3$, $d_{15}=1$, $d_{23}=6$, $d_{24}=7$, $d_{26}=3$, $d_{41}=5$, $d_{46}=8$, $d_{51}=7$, $d_{52}=1$, $d_{54}=7$. Dijkstra's algorithm from $s=1$ makes permanent at every step the temporary node with the smallest label (ties: the smallest index) and updates $d(j):=d(i)+d_{ij}$ on the arcs leaving the node $i$ just made permanent, if it improves. In which order do the nodes become permanent, and what are the final distances $\tilde{d}=(\tilde{d}(1),\dots,\tilde{d}(6))$?
  1. order $1,\,5,\,2,\,6,\,4,\,3$; $\tilde{d}=(0,3,9,8,1,6)$
  2. order $1,\,5,\,2,\,6,\,3,\,4$; $\tilde{d}=(0,2,8,8,1,5)$
  3. order $1,\,5,\,2,\,6,\,3,\,4$; $\tilde{d}=(0,1,6,7,1,3)$
  4. order $1,\,5,\,2,\,6,\,3,\,4$; $\tilde{d}=(0,3,9,8,1,6)$
Explanation. With positive lengths the nodes become permanent in order of distance: order $1,\,5,\,2,\,6,\,3,\,4$, distances $(0,2,8,8,1,5)$. A label can improve several times before becoming permanent; keeping the first label found, or using $d_{ij}$ instead of $d(i)+d_{ij}$ (as in Prim), gives wrong results.
Example 1 · no-g-sp-violation · level facile · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{12}=6$, $d_{13}=3$, $d_{14}=9$, $d_{21}=3$, $d_{32}=4$, $d_{36}=1$, $d_{41}=2$, $d_{51}=5$, $d_{62}=7$, $d_{65}=6$. One wants to check whether the labels $d=(0,6,3,11,10,4)$ (for nodes $1,\dots,6$, with $d(1)=0$) are the distances from $s=1$. The optimality conditions require $d(j) \le d(i)+d_{ij}$ on every arc $(i,j)$. Which arc violates them?
  1. $(3,2)$
  2. $(2,1)$
  3. $(1,4)$
  4. $(6,5)$
Explanation. On the arc $(1,4)$: $d(4)=11>0+9$, so the label of $4$ is not the distance: going through that arc would do better. On the other arcs the inequality holds.
Example 2 · no-g-sp-violation · level facile · notes
The directed graph with nodes $1,\dots,6$ has the arcs with lengths $d_{15}=2$, $d_{23}=3$, $d_{24}=3$, $d_{26}=1$, $d_{41}=6$, $d_{46}=7$, $d_{51}=3$, $d_{52}=5$, $d_{54}=8$. One wants to check whether the labels $d=(0,7,10,10,4,8)$ (for nodes $1,\dots,6$, with $d(1)=0$) are the distances from $s=1$. The optimality conditions require $d(j) \le d(i)+d_{ij}$ on every arc $(i,j)$. Which arc violates them?
  1. $(1,5)$
  2. $(4,6)$
  3. $(2,4)$
  4. $(5,4)$
Explanation. On the arc $(1,5)$: $d(5)=4>0+2$, so the label of $5$ is not the distance: going through that arc would do better. On the other arcs the inequality holds.
Example 1 · no-g-bf-run · level complessa · notes
The directed graph with nodes $1,\dots,5$ has the arcs with lengths $d_{14}=3$, $d_{15}=7$, $d_{23}=9$, $d_{24}=6$, $d_{32}=-4$, $d_{42}=6$, $d_{43}=7$, $d_{53}=6$ (no negative cycle). Bellman–Ford from $s=1$ starts from $d^0=(0,\infty,\dots,\infty)$, computes $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$ and stops at the first pass $k$ with $d^k=d^{k-1}$. In which pass does it stop, and what are the distances $\tilde{d}$?
  1. pass $k=4$; $\tilde{d}=(0,6,10,3,7)$
  2. pass $k=4$; $\tilde{d}=(0,9,10,3,7)$
  3. pass $k=3$; $\tilde{d}=(0,6,10,3,7)$
  4. pass $k=5$; $\tilde{d}=(0,6,10,3,7)$
Explanation. The labels are $d^{1}=(0,+\infty,+\infty,3,7)$, $d^{2}=(0,9,10,3,7)$, $d^{3}=(0,6,10,3,7)$, $d^{4}=(0,6,10,3,7)$: pass $4$ repeats the previous one. Dijkstra, with the negative arc, would give $(0,9,10,3,7)$.
Example 2 · no-g-bf-run · level complessa · notes
The directed graph with nodes $1,\dots,5$ has the arcs with lengths $d_{12}=3$, $d_{13}=3$, $d_{23}=6$, $d_{24}=9$, $d_{32}=-5$, $d_{35}=3$, $d_{42}=9$, $d_{54}=7$ (no negative cycle). Bellman–Ford from $s=1$ starts from $d^0=(0,\infty,\dots,\infty)$, computes $d^k(j)=\min\{d^{k-1}(j),\min_{(i,j)}(d^{k-1}(i)+d_{ij})\}$ and stops at the first pass $k$ with $d^k=d^{k-1}$. In which pass does it stop, and what are the distances $\tilde{d}$?
  1. pass $k=4$; $\tilde{d}=(0,-2,3,7,6)$
  2. pass $k=4$; $\tilde{d}=(0,3,3,12,6)$
  3. pass $k=3$; $\tilde{d}=(0,-2,3,7,6)$
  4. pass $k=4$; $\tilde{d}=(0,-2,3,12,6)$
Explanation. The labels are $d^{1}=(0,3,3,+\infty,+\infty)$, $d^{2}=(0,-2,3,12,6)$, $d^{3}=(0,-2,3,7,6)$, $d^{4}=(0,-2,3,7,6)$: pass $4$ repeats the previous one. Dijkstra, with the negative arc, would give $(0,3,3,12,6)$.

4. Network flow models (3)

Example 1 · no-g-lower-bounds · level facile · notes
A network with nodes $1,\dots,5$ has the arcs $(1,2)$, $(1,3)$, $(1,5)$, $(2,3)$, $(3,4)$, $(5,3)$, $(5,4)$, balances $\vet{b}=(2,3,0,-4,-1)$ and the lower bounds $l_{23}=2$ and $l_{53}=2$ (the others are zero). With the substitution $\vet{x}=\vet{l}+\vet{x}'$, what are the balances $\vet{b}'=\vet{b}-\mat{B}\vet{l}$ ($\mat{B}$: incidence matrix, $+1$ in the tail and $-1$ in the head)?
  1. $(2,1,4,-4,-3)$
  2. $(2,5,-4,-4,1)$
  3. $(2,1,0,-4,-3)$
  4. $(2,3,4,-4,-1)$
Explanation. The tail of $(i,j)$ loses $l_{ij}$ units of balance and the head gains them: $\vet{b}'=(2,1,4,-4,-3)$.
Example 2 · no-g-lower-bounds · level facile · notes
A network with nodes $1,\dots,5$ has the arcs $(1,3)$, $(1,5)$, $(2,4)$, $(2,5)$, $(3,2)$, $(3,4)$, $(3,5)$, balances $\vet{b}=(5,3,0,-1,-7)$ and the lower bounds $l_{24}=2$ and $l_{15}=2$ (the others are zero). With the substitution $\vet{x}=\vet{l}+\vet{x}'$, what are the balances $\vet{b}'=\vet{b}-\mat{B}\vet{l}$ ($\mat{B}$: incidence matrix, $+1$ in the tail and $-1$ in the head)?
  1. $(3,1,0,1,-5)$
  2. $(7,5,0,-3,-9)$
  3. $(3,1,0,-1,-7)$
  4. $(5,3,0,1,-5)$
Explanation. The tail of $(i,j)$ loses $l_{ij}$ units of balance and the head gains them: $\vet{b}'=(3,1,0,1,-5)$.
Example 1 · no-g-reduced-costs · level facile · notes
The potentials are $\vet{\pi}=(10,8,8,0)$ and the arcs $(3,2)$, $(2,4)$, $(1,3)$ have costs $c_{32}=1$, $c_{24}=11$, $c_{13}=3$. What are their reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$ (convention of the course), in the same order?
  1. $(1,19,5)$
  2. $(1,3,1)$
  3. $(-15,3,-15)$
  4. $(-1,-3,-1)$
Explanation. $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$: $-\pi$ of the tail and $+\pi$ of the head. Result $(1,3,1)$.
Example 2 · no-g-reduced-costs · level facile · notes
The potentials are $\vet{\pi}=(7,11,4,0)$ and the arcs $(1,4)$, $(3,2)$, $(1,3)$ have costs $c_{14}=10$, $c_{32}=8$, $c_{13}=11$. What are their reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$ (convention of the course), in the same order?
  1. $(17,1,14)$
  2. $(3,-7,0)$
  3. $(-3,-15,-8)$
  4. $(3,15,8)$
Explanation. $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$: $-\pi$ of the tail and $+\pi$ of the head. Result $(3,15,8)$.
Example 1 · no-g-mcf-lower-bound · level media · notes
A network with nodes $1,\dots,5$ has balances $\vet{b}=(5,0,0,0,-5)$ (outflow minus inflow) and the arcs, with cost $c$, lower bound $l$ and capacity $u$: $(1,3):\ c=1,\ l=0,\ u=6$; $(2,1):\ c=7,\ l=0,\ u=3$; $(2,4):\ c=9,\ l=0,\ u=4$; $(3,2):\ c=7,\ l=2,\ u=6$; $(3,4):\ c=5,\ l=0,\ u=5$; $(3,5):\ c=5,\ l=0,\ u=6$; $(4,5):\ c=1,\ l=0,\ u=6$. What is the minimum cost $\sum c_{ij}x_{ij}$ of a feasible flow ($l_{ij} \le x_{ij} \le u_{ij}$ and conservation at every node)?
  1. $54$
  2. $30$
  3. $40$
  4. $68$
Explanation. With $\vet{x}=\vet{l}+\vet{x}'$ the arc $(3,2)$ starts with $2$ units (fixed cost $\vet{c}'\vet{l}=14$) and the balances become $\vet{b}-\mat{B}\vet{l}$; the problem without lower bounds costs $40$, so the optimum is $54$. Ignoring the lower bound gives $30$; sending flow only along forward arcs, without corrections, may not be optimal.
Example 2 · no-g-mcf-lower-bound · level media · notes
A network with nodes $1,\dots,5$ has balances $\vet{b}=(3,0,0,0,-3)$ (outflow minus inflow) and the arcs, with cost $c$, lower bound $l$ and capacity $u$: $(1,3):\ c=8,\ l=0,\ u=5$; $(1,4):\ c=6,\ l=0,\ u=4$; $(1,5):\ c=3,\ l=0,\ u=5$; $(3,2):\ c=6,\ l=0,\ u=5$; $(4,2):\ c=2,\ l=0,\ u=5$; $(4,5):\ c=7,\ l=1,\ u=4$; $(5,2):\ c=9,\ l=0,\ u=5$. What is the minimum cost $\sum c_{ij}x_{ij}$ of a feasible flow ($l_{ij} \le x_{ij} \le u_{ij}$ and conservation at every node)?
  1. $9$
  2. $19$
  3. $12$
  4. $26$
Explanation. With $\vet{x}=\vet{l}+\vet{x}'$ the arc $(4,5)$ starts with $1$ units (fixed cost $\vet{c}'\vet{l}=7$) and the balances become $\vet{b}-\mat{B}\vet{l}$; the problem without lower bounds costs $12$, so the optimum is $19$. Ignoring the lower bound gives $9$; sending flow only along forward arcs, without corrections, may not be optimal.

5. Maximum flow (5)

Example 1 · no-g-cut-capacity · level facile · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{12}=2$, $u_{13}=4$, $u_{25}=9$, $u_{26}=5$, $u_{35}=8$, $u_{45}=7$, $u_{61}=9$, $u_{64}=9$, $u_{65}=1$. What is the capacity $u(S,N \setminus S)$ of the cut with $S=\{1,3\}$?
  1. $10$
  2. $19$
  3. $14$
  4. $1$
Explanation. Only the forward arcs, from $S$ to $N \setminus S$, are added: $(1,2)$, $(3,5)$, for a total of $10$. The backward arcs ($(6,1)$) do not count.
Example 2 · no-g-cut-capacity · level facile · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{13}=3$, $u_{14}=8$, $u_{15}=5$, $u_{16}=7$, $u_{26}=6$, $u_{42}=9$, $u_{54}=1$, $u_{63}=2$, $u_{64}=2$. What is the capacity $u(S,N \setminus S)$ of the cut with $S=\{1,2,3,4\}$?
  1. $18$
  2. $23$
  3. $38$
  4. $13$
Explanation. Only the forward arcs, from $S$ to $N \setminus S$, are added: $(1,5)$, $(1,6)$, $(2,6)$, for a total of $18$. The backward arcs ($(5,4)$, $(6,3)$, $(6,4)$) do not count.
Example 1 · no-g-residual · level facile · notes
In the network with nodes $1,\dots,5$ ($s=1$, $t=5$) the arcs have capacity and flow $(1,2):\ u=7,\ x=3$; $(1,3):\ u=4,\ x=0$; $(1,4):\ u=6,\ x=0$; $(2,4):\ u=3,\ x=2$; $(2,5):\ u=8,\ x=1$; $(3,2):\ u=5,\ x=0$; $(3,5):\ u=7,\ x=2$; $(4,3):\ u=6,\ x=2$. What is the bottleneck $\delta$ (minimum residual capacity of its arcs) of the augmenting path $1,\,3,\,4,\,2,\,5$ of the residual network $G(\vet{x})$?
  1. $1$
  2. $2$
  3. $3$
  4. $4$
Explanation. Residual capacities along the path: $r_{13}=4$, $r_{34}=2$ (backward, $=x_{43}$), $r_{42}=2$ (backward, $=x_{24}$), $r_{25}=7$; the minimum is $\delta=2$. A backward arc has $r_{ji}=x_{ij}$, not $u_{ij}$.
Example 2 · no-g-residual · level facile · notes
In the network with nodes $1,\dots,5$ ($s=1$, $t=5$) the arcs have capacity and flow $(1,3):\ u=4,\ x=1$; $(1,4):\ u=9,\ x=0$; $(1,5):\ u=6,\ x=1$; $(2,5):\ u=9,\ x=1$; $(3,4):\ u=4,\ x=1$; $(3,5):\ u=9,\ x=0$; $(4,2):\ u=3,\ x=1$. What is the bottleneck $\delta$ (minimum residual capacity of its arcs) of the augmenting path $1,\,4,\,3,\,5$ of the residual network $G(\vet{x})$?
  1. $1$
  2. $3$
  3. $4$
  4. $9$
Explanation. Residual capacities along the path: $r_{14}=9$, $r_{43}=1$ (backward, $=x_{34}$), $r_{35}=9$; the minimum is $\delta=1$. A backward arc has $r_{ji}=x_{ij}$, not $u_{ij}$.
Example 1 · no-g-max-flow · level media · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{13}=4$, $u_{14}=9$, $u_{16}=3$, $u_{26}=6$, $u_{34}=8$, $u_{35}=4$, $u_{36}=1$, $u_{52}=8$, $u_{56}=8$, $u_{64}=4$. What is the maximum flow value $\tilde{v}$, that is, the largest net outflow of $s$ over the feasible flows?
  1. $16$
  2. $7$
  3. $18$
  4. $8$
Explanation. A maximum flow has value $\tilde{v}=7$; the minimum cut $S=\{1,4\}$ (nodes reachable from $s$ in the final residual network) has the same capacity. The cuts $\{s\}$ and $N \setminus \{t\}$ give only upper bounds, and the saturated arcs do not form a cut in general.
Example 2 · no-g-max-flow · level media · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{12}=9$, $u_{14}=4$, $u_{15}=9$, $u_{26}=2$, $u_{31}=5$, $u_{36}=5$, $u_{43}=8$, $u_{46}=6$, $u_{54}=5$. What is the maximum flow value $\tilde{v}$, that is, the largest net outflow of $s$ over the feasible flows?
  1. $22$
  2. $13$
  3. $17$
  4. $11$
Explanation. A maximum flow has value $\tilde{v}=11$; the minimum cut $S=\{1,2,5\}$ (nodes reachable from $s$ in the final residual network) has the same capacity. The cuts $\{s\}$ and $N \setminus \{t\}$ give only upper bounds, and the saturated arcs do not form a cut in general.
Example 1 · no-g-edmonds-karp · level complessa · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{12}=3$, $u_{13}=1$, $u_{14}=2$, $u_{23}=3$, $u_{24}=3$, $u_{26}=7$, $u_{36}=2$, $u_{45}=6$, $u_{46}=6$. The Edmonds–Karp algorithm is run from the zero flow (breadth-first search of the residual network, residual arcs leaving each node scanned by increasing index of the head, stop as soon as $t$ is labelled). What are, in order, the bottlenecks $\delta$ of the augmentations?
  1. $\delta=2,\,1,\,1,\,2$
  2. $\delta=3,\,1,\,2$
  3. $\delta=2,\,1,\,3$
  4. $\delta=3,\,2,\,1$
Explanation. Edmonds–Karp augments along paths with the fewest arcs, found by the breadth-first search: $\delta=3,\,1,\,2$, value $\tilde{v}=6$. The sequence $2,\,1,\,1,\,2$ is that of Ford–Fulkerson with the depth-first search.
Example 2 · no-g-edmonds-karp · level complessa · notes
The network with nodes $1,\dots,6$, $s=1$ and $t=6$, has the arcs with capacities $u_{14}=4$, $u_{15}=5$, $u_{16}=1$, $u_{24}=4$, $u_{26}=6$, $u_{32}=4$, $u_{43}=8$, $u_{46}=8$, $u_{52}=2$, $u_{54}=6$. The Edmonds–Karp algorithm is run from the zero flow (breadth-first search of the residual network, residual arcs leaving each node scanned by increasing index of the head, stop as soon as $t$ is labelled). What are, in order, the bottlenecks $\delta$ of the augmentations?
  1. $\delta=4,\,2,\,2,\,1,\,1$
  2. $\delta=1,\,4,\,4,\,1$
  3. $\delta=1,\,5,\,3,\,1$
  4. $\delta=1,\,4,\,2,\,3$
Explanation. Edmonds–Karp augments along paths with the fewest arcs, found by the breadth-first search: $\delta=1,\,4,\,2,\,3$, value $\tilde{v}=10$. The sequence $4,\,2,\,2,\,1,\,1$ is that of Ford–Fulkerson with the depth-first search.
Example 1 · no-g-ford-fulkerson · level complessa · notes
The network with source $s=1$ and sink $t=6$ has the arcs with capacities $u_{13}=1$, $u_{15}=5$, $u_{16}=3$, $u_{24}=6$, $u_{35}=5$, $u_{36}=5$, $u_{56}=2$, $u_{62}=3$, $u_{64}=6$. Ford–Fulkerson starts from the zero flow and, at every iteration, looks for a path from $1$ to $6$ in the residual network (forward arcs with capacity $u_{ij}-x_{ij}$, backward arcs with capacity $x_{ij}$) by depth-first search (the last node of the stack is examined, outgoing arcs by increasing head, stop as soon as $6$ is labelled) and augments by the bottleneck $\delta$. What is the sequence of the $\delta$?
  1. $3,\,1,\,2$
  2. $1,\,1,\,1,\,3$
  3. $3,\,2,\,1$
  4. $1,\,1,\,3$
Explanation. Sequence $1,\,1,\,1,\,3$, maximum value $6$. With breadth-first search (Edmonds–Karp) one gets $3,\,1,\,2$; without backward arcs the sequence is $1,\,1,\,3$ and the flow may not be maximum.
Example 2 · no-g-ford-fulkerson · level complessa · notes
The network with source $s=1$ and sink $t=6$ has the arcs with capacities $u_{12}=6$, $u_{14}=4$, $u_{15}=2$, $u_{16}=5$, $u_{25}=2$, $u_{36}=2$, $u_{43}=3$, $u_{46}=1$, $u_{54}=6$. Ford–Fulkerson starts from the zero flow and, at every iteration, looks for a path from $1$ to $6$ in the residual network (forward arcs with capacity $u_{ij}-x_{ij}$, backward arcs with capacity $x_{ij}$) by depth-first search (the last node of the stack is examined, outgoing arcs by increasing head, stop as soon as $6$ is labelled) and augments by the bottleneck $\delta$. What is the sequence of the $\delta$?
  1. $2,\,1,\,5$
  2. $5,\,1,\,2$
  3. $5,\,1,\,1,\,1$
  4. $5,\,2,\,1$
Explanation. Sequence $2,\,1,\,5$, maximum value $8$. With breadth-first search (Edmonds–Karp) one gets $5,\,1,\,2$; without backward arcs the sequence is $2,\,1,\,5$ and the flow may not be maximum.

6. Minimum cost flow (3)

Example 1 · no-g-mcf-optimality · level media · notes
A flow $\vet{x}$ (zero lower bounds) and the potentials $\vet{\pi}=(11,7,7,0)$ are given on the arcs $(3,2):\ c=2,\ u=8,\ x=1$; $(2,4):\ c=10,\ u=2,\ x=0$; $(1,3):\ c=2,\ u=2,\ x=2$; $(2,3):\ c=3,\ u=7,\ x=0$; $(3,4):\ c=7,\ u=3,\ x=1$. With the reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, which arc violates the complementary slackness conditions ($\bar{c}_{ij}>0 \Rightarrow x_{ij}=0$, $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$)?
  1. $(3,4)$
  2. $(2,3)$
  3. $(3,2)$
  4. $(2,4)$
Explanation. Reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$: $\bar{c}_{32}=2$, $\bar{c}_{24}=3$, $\bar{c}_{13}=-2$, $\bar{c}_{23}=3$, $\bar{c}_{34}=0$. Only $(3,2)$ has a nonzero reduced cost without sitting at the right bound.
Example 2 · no-g-mcf-optimality · level media · notes
A flow $\vet{x}$ (zero lower bounds) and the potentials $\vet{\pi}=(8,6,8,0)$ are given on the arcs $(3,2):\ c=2,\ u=8,\ x=4$; $(3,4):\ c=10,\ u=7,\ x=0$; $(2,3):\ c=1,\ u=6,\ x=6$; $(2,4):\ c=3,\ u=8,\ x=8$; $(1,3):\ c=2,\ u=8,\ x=0$. With the reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, which arc violates the complementary slackness conditions ($\bar{c}_{ij}>0 \Rightarrow x_{ij}=0$, $\bar{c}_{ij}<0 \Rightarrow x_{ij}=u_{ij}$)?
  1. $(2,3)$
  2. $(3,4)$
  3. $(2,4)$
  4. $(3,2)$
Explanation. Reduced costs $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$: $\bar{c}_{32}=0$, $\bar{c}_{34}=2$, $\bar{c}_{23}=3$, $\bar{c}_{24}=-3$, $\bar{c}_{13}=2$. Only $(2,3)$ has a nonzero reduced cost without sitting at the right bound.
Example 1 · no-g-residual-cycle · level facile · notes
A feasible flow $\vet{x}$ costs $118$. On the arcs $(4,3):\ c=6,\ u=6,\ x=0$; $(5,3):\ c=7,\ u=4,\ x=4$; $(1,5):\ c=9,\ u=6,\ x=5$; $(4,1):\ c=3,\ u=3,\ x=2$ (zero lower bounds), the residual network $G(\vet{x})$ contains the cycle $W=4,\,3,\,5,\,1,\,4$. What does the flow augmented along $W$ by $\theta=r(W)$, the minimum residual capacity of the arcs of $W$, cost?
  1. $105$
  2. $168$
  3. $79$
  4. $92$
Explanation. Forward arcs have cost $c_{ij}$ and residual capacity $u_{ij}-x_{ij}$, backward arcs cost $-c_{ij}$ and residual capacity $x_{ij}$: $c(W)=-13$, $r(W)=2$, new cost $118+2\cdot(-13)=92$.
Example 2 · no-g-residual-cycle · level facile · notes
A feasible flow $\vet{x}$ costs $120$. On the arcs $(4,5):\ c=8,\ u=6,\ x=1$; $(2,4):\ c=7,\ u=6,\ x=5$; $(1,2):\ c=1,\ u=6,\ x=5$; $(1,5):\ c=4,\ u=3,\ x=0$ (zero lower bounds), the residual network $G(\vet{x})$ contains the cycle $W=5,\,4,\,2,\,1,\,5$. What does the flow augmented along $W$ by $\theta=r(W)$, the minimum residual capacity of the arcs of $W$, cost?
  1. $140$
  2. $108$
  3. $84$
  4. $132$
Explanation. Forward arcs have cost $c_{ij}$ and residual capacity $u_{ij}-x_{ij}$, backward arcs cost $-c_{ij}$ and residual capacity $x_{ij}$: $c(W)=-12$, $r(W)=1$, new cost $120+1\cdot(-12)=108$.
Example 1 · no-g-ssp-cost · level media · notes
A network with nodes $1,\dots,5$ has balances $\vet{b}=(4,3,0,0,-7)$ (outflow minus inflow) and the arcs, with cost $c$ and capacity $u$ (zero lower bounds): $(1,2):\ c=5,\ u=4$; $(1,4):\ c=4,\ u=2$; $(1,5):\ c=3,\ u=2$; $(2,3):\ c=8,\ u=4$; $(2,4):\ c=2,\ u=4$; $(3,1):\ c=1,\ u=4$; $(3,5):\ c=5,\ u=4$; $(4,5):\ c=1,\ u=2$. The successive shortest path algorithm repeatedly sends flow from an excess node to a deficit node along a shortest path of the residual network (backward arcs included, with cost $-c_{ij}$). What does the final flow cost, that is, the minimum cost of a feasible flow?
  1. $61$
  2. $55$
  3. $21$
  4. $16$
Explanation. Successive shortest paths end with an optimal flow of cost $55$. Without backward arcs (no corrections) one gets $61$, ignoring capacities $21$.
Example 2 · no-g-ssp-cost · level media · notes
A network with nodes $1,\dots,5$ has balances $\vet{b}=(4,0,0,3,-7)$ (outflow minus inflow) and the arcs, with cost $c$ and capacity $u$ (zero lower bounds): $(1,3):\ c=2,\ u=5$; $(1,4):\ c=5,\ u=4$; $(2,3):\ c=9,\ u=5$; $(2,5):\ c=9,\ u=2$; $(3,5):\ c=3,\ u=4$; $(4,2):\ c=7,\ u=3$; $(4,3):\ c=1,\ u=5$; $(4,5):\ c=1,\ u=2$. The successive shortest path algorithm repeatedly sends flow from an excess node to a deficit node along a shortest path of the residual network (backward arcs included, with cost $-c_{ij}$). What does the final flow cost, that is, the minimum cost of a feasible flow?
  1. $42$
  2. $23$
  3. $38$
  4. $20$
Explanation. Successive shortest paths end with an optimal flow of cost $38$. Without backward arcs (no corrections) one gets $42$, ignoring capacities $23$.

7. Transportation and assignment (6)

Example 1 · no-g-northwest · level facile · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(20,25,35)$, destinations $4,\dots,7$ with demands $d=(5,20,10,45)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(9,3,4,1)$; row 2: $(2,5,7,6)$; row 3: $(5,3,1,6)$. What does the initial basic feasible solution built with the north-west corner rule cost?
  1. $250$
  2. $265$
  3. $455$
  4. $290$
Explanation. The north-west corner fills at every step the active cell with the smallest $i$ and $j$, with $\min\{\bar{a}_i,\bar{d}_j\}$, without looking at the costs: $x_{1,4}=5$, $x_{1,5}=15$, $x_{2,5}=5$, $x_{2,6}=10$, $x_{2,7}=10$, $x_{3,7}=35$, cost $455$.
Example 2 · no-g-northwest · level facile · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(20,35,20)$, destinations $4,\dots,7$ with demands $d=(5,15,30,25)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(8,6,9,7)$; row 2: $(6,8,8,2)$; row 3: $(9,9,7,7)$. What does the initial basic feasible solution built with the north-west corner rule cost?
  1. $520$
  2. $395$
  3. $570$
  4. $415$
Explanation. The north-west corner fills at every step the active cell with the smallest $i$ and $j$, with $\min\{\bar{a}_i,\bar{d}_j\}$, without looking at the costs: $x_{1,4}=5$, $x_{1,5}=15$, $x_{2,5}=0$, $x_{2,6}=30$, $x_{2,7}=5$, $x_{3,7}=20$, cost $520$.
Example 1 · no-g-transport-potentials · level media · notes
A transportation instance has origins $1,\dots,2$ with supplies $a=(10,35)$, destinations $3,\dots,5$ with demands $d=(20,20,5)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(8,1,8)$; row 2: $(2,3,1)$. The basis is that of the north-west corner, with the cells $(1,3)$, $(2,3)$, $(2,4)$, $(2,5)$. What are the potentials $(\pi_1,\dots,\pi_5)$ of the basis, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the basic cells and $\pi_5=0$?
  1. $(7,1,-1,-2,0)$
  2. $(7,1,1,2,0)$
  3. $(0,-6,-8,-9,-7)$
  4. $(-7,-1,1,2,0)$
Explanation. Start from $\pi_5=0$ and use $\pi_i-\pi_j=c_{ij}$ along the tree of the basic cells: $\vet{\pi}=(7,1,-1,-2,0)$. With the u-v convention ($u_i+v_j=c_{ij}$) the potentials of the destinations change sign.
Example 2 · no-g-transport-potentials · level media · notes
A transportation instance has origins $1,\dots,2$ with supplies $a=(20,35)$, destinations $3,\dots,5$ with demands $d=(10,5,40)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(4,8,8)$; row 2: $(6,9,7)$. The basis is that of the north-west corner, with the cells $(1,3)$, $(1,4)$, $(1,5)$, $(2,5)$. What are the potentials $(\pi_1,\dots,\pi_5)$ of the basis, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the basic cells and $\pi_5=0$?
  1. $(8,7,-4,0,0)$
  2. $(0,-1,-4,-8,-8)$
  3. $(8,7,4,0,0)$
  4. $(-8,-7,-4,0,0)$
Explanation. Start from $\pi_5=0$ and use $\pi_i-\pi_j=c_{ij}$ along the tree of the basic cells: $\vet{\pi}=(8,7,4,0,0)$. With the u-v convention ($u_i+v_j=c_{ij}$) the potentials of the destinations change sign.
Example 1 · no-g-transport-pivot · level complessa · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(25,30,35)$, destinations $4,\dots,6$ with demands $d=(30,5,55)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(8,6,6)$; row 2: $(8,1,8)$; row 3: $(2,3,1)$. Start from the north-west corner solution (cost $440$) and perform one iteration of the potential method ($\pi_6=0$; the cell with the most negative reduced cost enters). What are the entering cell, the step $\theta$ and the new cost?
  1. enters $(1,6)$, $\theta=20$, new cost $400$
  2. enters $(1,6)$, $\theta=5$, new cost $430$
  3. enters $(1,6)$, $\theta=20$, new cost $480$
  4. enters $(3,4)$, $\theta=5$, new cost $445$
Explanation. Potentials $\vet{\pi}=(8,8,1,0,7,0)$; the cell $(1,6)$ has $\bar{c}=-2$, the minimum. On its cycle $\theta$ is the minimum over the $-$ cells only: $\theta=20$, and the cost drops by $\theta\,|\bar{c}_e|$: $440-40=400$.
Example 2 · no-g-transport-pivot · level complessa · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(40,40,30)$, destinations $4,\dots,6$ with demands $d=(25,10,75)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(6,5,1)$; row 2: $(2,3,3)$; row 3: $(1,6,7)$. Start from the north-west corner solution (cost $535$) and perform one iteration of the potential method ($\pi_6=0$; the cell with the most negative reduced cost enters). What are the entering cell, the step $\theta$ and the new cost?
  1. enters $(3,4)$, $\theta=5$, new cost $480$
  2. enters $(3,4)$, $\theta=25$, new cost $260$
  3. enters $(3,4)$, $\theta=25$, new cost $810$
  4. enters $(2,4)$, $\theta=25$, new cost $385$
Explanation. Potentials $\vet{\pi}=(1,3,7,-5,-4,0)$; the cell $(3,4)$ has $\bar{c}=-11$, the minimum. On its cycle $\theta$ is the minimum over the $-$ cells only: $\theta=25$, and the cost drops by $\theta\,|\bar{c}_e|$: $535-275=260$.
Example 1 · no-g-assignment · level media · notes
The workers are $1,\dots,4$ and the jobs $5,\dots,8$; the cost matrix $c_{ij}$ has rows $(6,6,8,8)$, $(1,8,6,6)$, $(8,1,8,2)$, $(3,1,1,3)$. What does a minimum cost assignment cost?
  1. $16$
  2. $9$
  3. $10$
  4. $25$
Explanation. An optimal assignment is $(1,6)$, $(2,5)$, $(3,8)$, $(4,7)$, of cost $10$ (the Hungarian algorithm finds it). The greedy choice row by row costs $16$; the reduction of Step 0 gives only the lower bound $10$.
Example 2 · no-g-assignment · level media · notes
The workers are $1,\dots,4$ and the jobs $5,\dots,8$; the cost matrix $c_{ij}$ has rows $(7,7,3,6)$, $(5,1,2,3)$, $(3,1,6,7)$, $(3,5,8,7)$. What does a minimum cost assignment cost?
  1. $10$
  2. $14$
  3. $8$
  4. $21$
Explanation. An optimal assignment is $(1,7)$, $(2,8)$, $(3,6)$, $(4,5)$, of cost $10$ (the Hungarian algorithm finds it). The greedy choice row by row costs $14$; the reduction of Step 0 gives only the lower bound $10$.
Example 1 · no-g-hungarian-bound · level facile · notes
The workers are $1,\dots,4$ and the jobs $5,\dots,8$; the cost matrix $c_{ij}$ has rows $(6,6,8,8)$, $(1,8,6,6)$, $(8,1,8,2)$, $(3,1,1,3)$. In Step 0 of the Hungarian algorithm each row is reduced by its minimum, then each column of the result by its minimum. What is the resulting dual value $\sum_{i}\pi_i-\sum_{j}\pi_j$, a lower bound on the cost of every assignment?
  1. $9$
  2. $14$
  3. $10$
  4. $5$
Explanation. Sum of the row minima ($9$) plus sum of the column minima of the row-reduced matrix: $10$. The column minima are taken after the row reduction.
Example 2 · no-g-hungarian-bound · level facile · notes
The workers are $1,\dots,4$ and the jobs $5,\dots,8$; the cost matrix $c_{ij}$ has rows $(7,7,3,6)$, $(5,1,2,3)$, $(3,1,6,7)$, $(3,5,8,7)$. In Step 0 of the Hungarian algorithm each row is reduced by its minimum, then each column of the result by its minimum. What is the resulting dual value $\sum_{i}\pi_i-\sum_{j}\pi_j$, a lower bound on the cost of every assignment?
  1. $10$
  2. $8$
  3. $17$
  4. $9$
Explanation. Sum of the row minima ($8$) plus sum of the column minima of the row-reduced matrix: $10$. The column minima are taken after the row reduction.
Example 1 · no-g-min-cost-rule · level facile · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(20,25,35)$, destinations $4,\dots,7$ with demands $d=(5,20,10,45)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(9,3,4,1)$; row 2: $(2,5,7,6)$; row 3: $(5,3,1,6)$. The minimum cost rule fills at every step, with the largest possible amount, the cheapest cell among the active rows and columns (ties: smallest row, then smallest column), and crosses out the exhausted row or column. What does the initial solution it produces cost?
  1. $455$
  2. $290$
  3. $250$
  4. $265$
Explanation. Filled cells: $x_{1,7}=20$, $x_{3,6}=10$, $x_{2,4}=5$, $x_{3,5}=20$, $x_{2,7}=20$, $x_{3,7}=5$; cost $250$. The northwest corner rule, which ignores the costs, gives $455$.
Example 2 · no-g-min-cost-rule · level facile · notes
A transportation instance has origins $1,\dots,3$ with supplies $a=(20,35,20)$, destinations $4,\dots,7$ with demands $d=(5,15,30,25)$, and costs $c_{ij}$ (rows = origins, columns = destinations) row 1: $(8,6,9,7)$; row 2: $(6,8,8,2)$; row 3: $(9,9,7,7)$. The minimum cost rule fills at every step, with the largest possible amount, the cheapest cell among the active rows and columns (ties: smallest row, then smallest column), and crosses out the exhausted row or column. What does the initial solution it produces cost?
  1. $395$
  2. $520$
  3. $415$
  4. $570$
Explanation. Filled cells: $x_{2,7}=25$, $x_{1,5}=15$, $x_{2,4}=5$, $x_{3,6}=20$, $x_{2,6}=5$, $x_{1,6}=5$; cost $395$. The northwest corner rule, which ignores the costs, gives $520$.

8. The network simplex (5)

Example 1 · no-g-tree-solution · level facile · notes
An uncapacitated network has nodes $1,\dots,5$ and balances $\vet{b}=(-1,-3,-4,-2,10)$. The tree $T$ has the arcs $(2,1)$, $(4,2)$, $(4,5)$, $(5,3)$ (root $5$), and the arcs outside the tree are in $L$ with flow $0$. What are the flows on the arcs of $T$, in the given order?
  1. $(-1,-4,6,-4)$
  2. $(-1,-4,-6,-4)$
  3. $(1,4,-6,4)$
  4. $(1,3,-2,4)$
Explanation. Repeatedly remove a leaf $\ell \neq 5$: $x_a=\hat{b}_\ell$ if the arc leaves $\ell$, $x_a=-\hat{b}_\ell$ if it enters $\ell$, and $\hat{b}_\ell$ is added to the balance of the neighbour. Result $(1,4,-6,4)$ (the structure is not feasible).
Example 2 · no-g-tree-solution · level facile · notes
An uncapacitated network has nodes $1,\dots,5$ and balances $\vet{b}=(0,2,4,2,-8)$. The tree $T$ has the arcs $(4,1)$, $(5,1)$, $(5,2)$, $(5,3)$ (root $5$), and the arcs outside the tree are in $L$ with flow $0$. What are the flows on the arcs of $T$, in the given order?
  1. $(2,-2,-2,-4)$
  2. $(-2,2,2,4)$
  3. $(2,2,2,4)$
  4. $(2,0,-2,-4)$
Explanation. Repeatedly remove a leaf $\ell \neq 5$: $x_a=\hat{b}_\ell$ if the arc leaves $\ell$, $x_a=-\hat{b}_\ell$ if it enters $\ell$, and $\hat{b}_\ell$ is added to the balance of the neighbour. Result $(2,-2,-2,-4)$ (the structure is not feasible).
Example 1 · no-g-tree-potentials · level facile · notes
The spanning tree $T$ of a network with nodes $1,\dots,5$ has the arcs with costs $c_{21}=3$, $c_{42}=1$, $c_{45}=1$, $c_{53}=3$. What are the potentials $\vet{\pi}$ of the tree, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$ and root $\pi_5=0$?
  1. $(3,0,3,-1,0)$
  2. $(0,3,0,4,3)$
  3. $(-3,0,-3,1,0)$
  4. $(5,2,3,1,0)$
Explanation. $\pi_i$ is the cost of the tree path from $i$ to the root, with $+c_{ij}$ on the arcs traversed from tail to head and $-c_{ij}$ on the others: $\vet{\pi}=(-3,0,-3,1,0)$.
Example 2 · no-g-tree-potentials · level facile · notes
The spanning tree $T$ of a network with nodes $1,\dots,5$ has the arcs with costs $c_{41}=3$, $c_{51}=5$, $c_{52}=8$, $c_{53}=7$. What are the potentials $\vet{\pi}$ of the tree, with $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$ and root $\pi_5=0$?
  1. $(-5,-8,-7,-2,0)$
  2. $(5,8,7,2,0)$
  3. $(0,-3,-2,3,5)$
  4. $(5,8,7,8,0)$
Explanation. $\pi_i$ is the cost of the tree path from $i$ to the root, with $+c_{ij}$ on the arcs traversed from tail to head and $-c_{ij}$ on the others: $\vet{\pi}=(-5,-8,-7,-2,0)$.
Example 1 · no-g-network-simplex-pivot · level complessa · notes
An uncapacitated network has nodes $1,\dots,5$, balances $\vet{b}=(-5,-4,10,-4,3)$ and the arcs with costs $c_{12}=1$, $c_{14}=4$, $c_{23}=2$, $c_{24}=1$, $c_{31}=2$, $c_{34}=8$, $c_{51}=2$, $c_{52}=4$. The current tree is $T=\{(1,2),(3,1),(3,4),(5,1)\}$ (root $5$, the other arcs in $L$), with a tree solution of cost $54$. Perform one pivot of the network simplex (potentials with $\pi_5=0$, $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$; among the arcs of $L$ with $\bar{c}_{ij}<0$, the one with the largest $|\bar{c}_{ij}|$ enters). What are the entering arc, the leaving arc and the new cost?
  1. enters $(2,4)$, leaves $(1,2)$, cost $70$
  2. enters $(2,4)$, leaves $(3,4)$, cost $38$
  3. enters $(2,4)$, leaves $(3,4)$, cost $70$
  4. enters $(1,4)$, leaves $(3,4)$, cost $46$
Explanation. Potentials $\vet{\pi}=(-2,-3,0,-8,0)$; $(2,4)$ enters with $\bar{c}=-4$. The cycle, oriented as the entering arc, is blocked only by backward arcs: $\theta=4$, $(3,4)$ leaves, and the cost drops by $\theta\,|\bar{c}_{kl}|$ to $38$.
Example 2 · no-g-network-simplex-pivot · level complessa · notes
An uncapacitated network has nodes $1,\dots,5$, balances $\vet{b}=(7,1,3,-4,-7)$ and the arcs with costs $c_{14}=9$, $c_{15}=7$, $c_{24}=7$, $c_{25}=7$, $c_{31}=4$, $c_{32}=9$, $c_{34}=7$, $c_{54}=7$. The current tree is $T=\{(1,4),(1,5),(2,5),(3,2)\}$ (root $5$, the other arcs in $L$), with a tree solution of cost $112$. Perform one pivot of the network simplex (potentials with $\pi_5=0$, $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$; among the arcs of $L$ with $\bar{c}_{ij}<0$, the one with the largest $|\bar{c}_{ij}|$ enters). What are the entering arc, the leaving arc and the new cost?
  1. enters $(3,4)$, leaves $(1,5)$, cost $79$
  2. enters $(3,4)$, leaves $(1,5)$, cost $145$
  3. enters $(3,4)$, leaves $(3,2)$, cost $145$
  4. enters $(3,4)$, leaves $(3,2)$, cost $79$
Explanation. Potentials $\vet{\pi}=(7,7,16,-2,0)$; $(3,4)$ enters with $\bar{c}=-11$. The cycle, oriented as the entering arc, is blocked only by backward arcs: $\theta=3$, $(3,2)$ leaves, and the cost drops by $\theta\,|\bar{c}_{kl}|$ to $79$.
Example 1 · no-g-ns-reduced · level facile · notes
In the network simplex, the spanning tree $T$ of a network with nodes $1,\dots,5$ has the arcs with costs $c_{12}=7$, $c_{32}=8$, $c_{35}=5$, $c_{43}=9$. The tree potentials have $\pi_5=0$ and $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$. What is the reduced cost of the nonbasic arc $(4,5)$, whose cost is $c_{45}=1$?
  1. $15$
  2. $-13$
  3. $13$
  4. $1$
Explanation. Potentials $\vet{\pi}=(4,-3,5,14,0)$ (cost of the tree path to the root); hence $\bar{c}_{45}=1-(14)+(0)=-13$, the cost of the arc's fundamental cycle.
Example 2 · no-g-ns-reduced · level facile · notes
In the network simplex, the spanning tree $T$ of a network with nodes $1,\dots,5$ has the arcs with costs $c_{21}=9$, $c_{25}=5$, $c_{43}=7$, $c_{54}=7$. The tree potentials have $\pi_5=0$ and $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j=0$ on the arcs of $T$. What is the reduced cost of the nonbasic arc $(4,1)$, whose cost is $c_{41}=2$?
  1. $-1$
  2. $-5$
  3. $5$
  4. $13$
Explanation. Potentials $\vet{\pi}=(-4,5,-14,-7,0)$ (cost of the tree path to the root); hence $\bar{c}_{41}=2-(-7)+(-4)=5$, the cost of the arc's fundamental cycle.
Example 1 · no-g-ns-entering · level media · notes
In the network simplex for minimum cost flow, a network with nodes $1,\dots,5$ has the arcs with costs $c_{21}=3$, $c_{23}=7$, $c_{31}=4$, $c_{41}=6$, $c_{42}=1$, $c_{43}=6$, $c_{45}=1$, $c_{52}=4$, $c_{53}=3$. The current tree structure has $T=\{(2,1),(4,2),(4,5),(5,3)\}$ (root $5$, $\pi_5=0$), $L=\{(2,3),(3,1)\}$ (nonbasic at flow $0$) and $U=\{(4,1),(4,3),(5,2)\}$ (nonbasic at capacity). With $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, the eligible arc ($L$ with $\bar{c}_{ij}<0$, or $U$ with $\bar{c}_{ij}>0$) with the largest $|\bar{c}_{ij}|$ enters. Which arc enters?
  1. $(5,2)$
  2. $(2,3)$
  3. $(3,1)$
  4. $(4,1)$
Explanation. Potentials $\vet{\pi}=(-3,0,-3,1,0)$; nonbasic reduced costs: $\bar{c}_{23}=4$, $\bar{c}_{31}=4$, $\bar{c}_{41}=2$, $\bar{c}_{43}=2$, $\bar{c}_{52}=4$. $(5,2)$ enters. An arc of $U$ with $\bar{c}<0$ or of $L$ with $\bar{c}>0$ is already in its best position.
Example 2 · no-g-ns-entering · level media · notes
In the network simplex for minimum cost flow, a network with nodes $1,\dots,5$ has the arcs with costs $c_{13}=8$, $c_{15}=8$, $c_{21}=2$, $c_{24}=5$, $c_{32}=4$, $c_{34}=3$, $c_{35}=9$, $c_{41}=9$, $c_{54}=1$. The current tree structure has $T=\{(1,3),(2,1),(3,5),(4,1)\}$ (root $5$, $\pi_5=0$), $L=\{(1,5),(3,2),(3,4),(5,4)\}$ (nonbasic at flow $0$) and $U=\{(2,4)\}$ (nonbasic at capacity). With $\bar{c}_{ij}=c_{ij}-\pi_i+\pi_j$, the eligible arc ($L$ with $\bar{c}_{ij}<0$, or $U$ with $\bar{c}_{ij}>0$) with the largest $|\bar{c}_{ij}|$ enters. Which arc enters?
  1. $(5,4)$
  2. $(3,4)$
  3. $(2,4)$
  4. $(3,2)$
Explanation. Potentials $\vet{\pi}=(17,19,9,26,0)$; nonbasic reduced costs: $\bar{c}_{15}=-9$, $\bar{c}_{24}=12$, $\bar{c}_{32}=14$, $\bar{c}_{34}=20$, $\bar{c}_{54}=27$. $(2,4)$ enters. An arc of $U$ with $\bar{c}<0$ or of $L$ with $\bar{c}>0$ is already in its best position.

9. Project management (7)

Example 1 · no-g-project-duration · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). An activity starts when all its immediate predecessors are finished. What is the minimum project duration $T$, that is, the earliest time by which all the activities can be finished?
  1. $29$
  2. $14$
  3. $23$
  4. $43$
Explanation. Forward pass: $\mathit{ES}_j=\max \mathit{EF}_i$ over the immediate predecessors, $\mathit{EF}_j=\mathit{ES}_j+d_j$; $T=\mathit{ES}_{\mathrm{FINISH}}=29$, the length of the critical path $\text{START},2,3,5,6,7,\text{FINISH}$. With the minimum instead of the maximum one gets $14$.
Example 2 · no-g-project-duration · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=2$; predecessors: —), $2$ ($d_{2}=7$; predecessors: $1$), $3$ ($d_{3}=7$; predecessors: $2$), $4$ ($d_{4}=5$; predecessors: —), $5$ ($d_{5}=7$; predecessors: $3,4$), $6$ ($d_{6}=3$; predecessors: $2,4,5$), $7$ ($d_{7}=3$; predecessors: $4,5$). An activity starts when all its immediate predecessors are finished. What is the minimum project duration $T$, that is, the earliest time by which all the activities can be finished?
  1. $8$
  2. $26$
  3. $23$
  4. $34$
Explanation. Forward pass: $\mathit{ES}_j=\max \mathit{EF}_i$ over the immediate predecessors, $\mathit{EF}_j=\mathit{ES}_j+d_j$; $T=\mathit{ES}_{\mathrm{FINISH}}=26$, the length of the critical path $\text{START},1,2,3,5,6,\text{FINISH}$. With the minimum instead of the maximum one gets $8$.
Example 1 · no-g-critical-path · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). In the project network (nodes START and FINISH of duration $0$), which is the critical path, that is, the path from START to FINISH of maximum length (sum of the durations)?
  1. $\text{START},2,3,5,6,7,\text{FINISH}$
  2. $\text{START},2,3,4,\text{FINISH}$
  3. $\text{START},1,5,6,7,\text{FINISH}$
  4. $\text{START},2,3,5,7,\text{FINISH}$
Explanation. A critical path is a path from START to FINISH of maximum length (sum of the durations of its activities): here it is unique, of length $T=29$; all its arcs are tight, $\mathit{ES}_j=\mathit{EF}_i$.
Example 2 · no-g-critical-path · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=4$; predecessors: —), $2$ ($d_{2}=8$; predecessors: —), $3$ ($d_{3}=3$; predecessors: —), $4$ ($d_{4}=1$; predecessors: —), $5$ ($d_{5}=4$; predecessors: $1$), $6$ ($d_{6}=8$; predecessors: $5$), $7$ ($d_{7}=8$; predecessors: $1,4$). In the project network (nodes START and FINISH of duration $0$), which is the critical path, that is, the path from START to FINISH of maximum length (sum of the durations)?
  1. $\text{START},1,7,\text{FINISH}$
  2. $\text{START},1,5,6,\text{FINISH}$
  3. $\text{START},4,7,\text{FINISH}$
  4. $\text{START},2,\text{FINISH}$
Explanation. A critical path is a path from START to FINISH of maximum length (sum of the durations of its activities): here it is unique, of length $T=16$; all its arcs are tight, $\mathit{ES}_j=\mathit{EF}_i$.
Example 1 · no-g-slacks · level complessa · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=9$; predecessors: —), $2$ ($d_{2}=4$; predecessors: —), $3$ ($d_{3}=4$; predecessors: $1$), $4$ ($d_{4}=5$; predecessors: $1,2,3$), $5$ ($d_{5}=7$; predecessors: $3$), $6$ ($d_{6}=5$; predecessors: $4,5$), $7$ ($d_{7}=7$; predecessors: —), $8$ ($d_{8}=9$; predecessors: $3,7$). The total slack $\mathit{TS}_{2}=\mathit{LS}_{2}-\mathit{ES}_{2}$ is the largest delay of activity $2$ that does not lengthen the project; the free slack $\mathit{FS}_{2}$ is the largest delay that moves the earliest start of no successor. What are they?
  1. $\mathit{TS}_{2}=9,\ \mathit{FS}_{2}=11$
  2. $\mathit{TS}_{2}=11,\ \mathit{FS}_{2}=11$
  3. $\mathit{TS}_{2}=11,\ \mathit{FS}_{2}=9$
  4. $\mathit{TS}_{2}=11,\ \mathit{FS}_{2}=0$
Explanation. Forward pass: $\mathit{ES}_{2}=0$, $\mathit{EF}_{2}=4$, $T=25$; backward pass ($\mathit{LF}_j=\min \mathit{LS}_k$): $\mathit{LS}_{2}=11$. Hence $\mathit{TS}_{2}=\mathit{LS}_{2}-\mathit{ES}_{2}=11$ and $\mathit{FS}_{2}=\min_k \mathit{ES}_k-\mathit{EF}_{2}=9$.
Example 2 · no-g-slacks · level complessa · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=2$; predecessors: —), $2$ ($d_{2}=9$; predecessors: —), $3$ ($d_{3}=8$; predecessors: —), $4$ ($d_{4}=8$; predecessors: $2$), $5$ ($d_{5}=1$; predecessors: $1$), $6$ ($d_{6}=8$; predecessors: —), $7$ ($d_{7}=4$; predecessors: $5$), $8$ ($d_{8}=2$; predecessors: $1,7$). The total slack $\mathit{TS}_{1}=\mathit{LS}_{1}-\mathit{ES}_{1}$ is the largest delay of activity $1$ that does not lengthen the project; the free slack $\mathit{FS}_{1}$ is the largest delay that moves the earliest start of no successor. What are they?
  1. $\mathit{TS}_{1}=0,\ \mathit{FS}_{1}=8$
  2. $\mathit{TS}_{1}=8,\ \mathit{FS}_{1}=8$
  3. $\mathit{TS}_{1}=8,\ \mathit{FS}_{1}=0$
  4. $\mathit{TS}_{1}=13,\ \mathit{FS}_{1}=0$
Explanation. Forward pass: $\mathit{ES}_{1}=0$, $\mathit{EF}_{1}=2$, $T=17$; backward pass ($\mathit{LF}_j=\min \mathit{LS}_k$): $\mathit{LS}_{1}=8$. Hence $\mathit{TS}_{1}=\mathit{LS}_{1}-\mathit{ES}_{1}=8$ and $\mathit{FS}_{1}=\min_k \mathit{ES}_k-\mathit{EF}_{1}=0$.
Example 1 · no-g-pm-earliest · level facile · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). An activity can start only when all its immediate predecessors are finished, and the project starts at time $0$. What is the earliest start $\mathit{ES}_{4}$ of activity $4$?
  1. $6$
  2. $22$
  3. $14$
  4. $21$
Explanation. Forward pass: $\mathit{ES}_j=\max \mathit{EF}_i$ over the immediate predecessors, $\mathit{EF}_j=\mathit{ES}_j+d_j$. For activity $4$: $\mathit{ES}_{4}=\max\{6,14\}=14$. With the minimum one would get $6$.
Example 2 · no-g-pm-earliest · level facile · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=4$; predecessors: —), $2$ ($d_{2}=8$; predecessors: —), $3$ ($d_{3}=3$; predecessors: —), $4$ ($d_{4}=1$; predecessors: —), $5$ ($d_{5}=4$; predecessors: $1$), $6$ ($d_{6}=8$; predecessors: $5$), $7$ ($d_{7}=8$; predecessors: $1,4$). An activity can start only when all its immediate predecessors are finished, and the project starts at time $0$. What is the earliest start $\mathit{ES}_{7}$ of activity $7$?
  1. $1$
  2. $12$
  3. $4$
  4. $8$
Explanation. Forward pass: $\mathit{ES}_j=\max \mathit{EF}_i$ over the immediate predecessors, $\mathit{EF}_j=\mathit{ES}_j+d_j$. For activity $7$: $\mathit{ES}_{7}=\max\{4,1\}=4$. With the minimum one would get $1$.
Example 1 · no-g-pm-latest · level facile · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). The project must end within its minimum duration $T$. What is the latest start $\mathit{LS}_{1}$ of activity $1$, that is, the last time at which it can start without delaying the project?
  1. $0$
  2. $14$
  3. $8$
  4. $16$
Explanation. $T=29$. Backward pass: $\mathit{LF}_j=\min \mathit{LS}_k$ over the immediate successors, $\mathit{LS}_j=\mathit{LF}_j-d_j$: $\mathit{LF}_{1}=\min\{14,15\}=14$ and $\mathit{LS}_{1}=14-6=8$. With the maximum one would get $16$.
Example 2 · no-g-pm-latest · level facile · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=2$; predecessors: —), $2$ ($d_{2}=7$; predecessors: $1$), $3$ ($d_{3}=7$; predecessors: $2$), $4$ ($d_{4}=5$; predecessors: —), $5$ ($d_{5}=7$; predecessors: $3,4$), $6$ ($d_{6}=3$; predecessors: $2,4,5$), $7$ ($d_{7}=3$; predecessors: $4,5$). The project must end within its minimum duration $T$. What is the latest start $\mathit{LS}_{4}$ of activity $4$, that is, the last time at which it can start without delaying the project?
  1. $0$
  2. $16$
  3. $18$
  4. $11$
Explanation. $T=26$. Backward pass: $\mathit{LF}_j=\min \mathit{LS}_k$ over the immediate successors, $\mathit{LS}_j=\mathit{LF}_j-d_j$: $\mathit{LF}_{4}=\min\{16,23,23\}=16$ and $\mathit{LS}_{4}=16-5=11$. With the maximum one would get $18$.
Example 1 · no-g-pm-change · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). The duration of activity $1$ grows by $9$ (from $6$ to $15$). What is the new minimum duration of the project?
  1. $38$
  2. $29$
  3. $30$
  4. $37$
Explanation. Before the change $T=29$ and the total slack of the activity is $\mathit{TS}_{1}=8$. The new duration is $T+\max\{0,\delta-\mathit{TS}_{1}\}=29+1=30$: the delay is absorbed up to the total slack (not the free slack, $\mathit{FS}_{1}=8$).
Example 2 · no-g-pm-change · level media · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=4$; predecessors: —), $2$ ($d_{2}=8$; predecessors: —), $3$ ($d_{3}=3$; predecessors: —), $4$ ($d_{4}=1$; predecessors: —), $5$ ($d_{5}=4$; predecessors: $1$), $6$ ($d_{6}=8$; predecessors: $5$), $7$ ($d_{7}=8$; predecessors: $1,4$). The duration of activity $3$ grows by $14$ (from $3$ to $17$). What is the new minimum duration of the project?
  1. $30$
  2. $16$
  3. $29$
  4. $17$
Explanation. Before the change $T=16$ and the total slack of the activity is $\mathit{TS}_{3}=13$. The new duration is $T+\max\{0,\delta-\mathit{TS}_{3}\}=16+1=17$: the delay is absorbed up to the total slack (not the free slack, $\mathit{FS}_{3}=13$).
Example 1 · no-g-pm-two-changes · level complessa · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=6$; predecessors: —), $2$ ($d_{2}=6$; predecessors: —), $3$ ($d_{3}=8$; predecessors: $2$), $4$ ($d_{4}=8$; predecessors: $2,3$), $5$ ($d_{5}=1$; predecessors: $1,2,3$), $6$ ($d_{6}=8$; predecessors: $1,5$), $7$ ($d_{7}=6$; predecessors: $5,6$). At the same time the duration of activity $1$ grows by $9$ and that of activity $6$ decreases by $5$. What is the new minimum duration of the project?
  1. $33$
  2. $25$
  3. $24$
  4. $30$
Explanation. Before, $T=29$, with $\mathit{TS}_{1}=8$ and activity $6$ critical. The two changes interact, so the forward pass is redone with the new durations: the minimum duration is the maximum length of a path, $25$. Adding the separate effects is not enough.
Example 2 · no-g-pm-two-changes · level complessa · notes
A project has the activities (duration; immediate predecessors) $1$ ($d_{1}=4$; predecessors: —), $2$ ($d_{2}=8$; predecessors: —), $3$ ($d_{3}=3$; predecessors: —), $4$ ($d_{4}=1$; predecessors: —), $5$ ($d_{5}=4$; predecessors: $1$), $6$ ($d_{6}=8$; predecessors: $5$), $7$ ($d_{7}=8$; predecessors: $1,4$). At the same time the duration of activity $3$ grows by $14$ and that of activity $5$ decreases by $3$. What is the new minimum duration of the project?
  1. $17$
  2. $27$
  3. $13$
  4. $14$
Explanation. Before, $T=16$, with $\mathit{TS}_{3}=13$ and activity $5$ critical. The two changes interact, so the forward pass is redone with the new durations: the minimum duration is the maximum length of a path, $17$. Adding the separate effects is not enough.