July 01, 2026
Let \(G\) be an undirected multi-graph on \(n\) vertices, with a designated source vertex \(s\). We study Single-Source Mincut Sensitivity Oracles: compact data structures that, when queried with an edge \(e\), report those affected vertices whose mincut value to \(s\) changes upon the insertion or failure of \(e\).
Insertion queries were treated by Baswana, Gupta, and Knollmann [Algorithmica ’22], who showed an extremely compact oracle with only \(O(n)\) space. In this work, we consider edge failure queries, which are of even greater interest, but far more challenging. The current-best approaches give \(O(n^2)\) space: either using \(n-1\) fixed-pair oracles of \(O(n)\) space each, based on the Picard-Queyranne representation [MPS ’80], or using the \(O(n^2)\) space all-pairs oracle by Baswana and Pandey [SODA ’22].
Our key result is an optimal \(O(n)\) space single-source mincut sensitivity oracle for edge failure queries. It reports the set of affected vertices in \(O(n)\) time, thus matching the state-of-the-art bounds for the insertion case.
Additionally, we provide oracles with near-optimal query times at the cost of increasing the space to \(O(n^{1.5})\). They can determine if any given vertex is affected by an insertion/failure of an edge in \(O(\log n)\) time, or reports all affected vertices in amortized \(O(\log^3 n)\) time per vertex. Such oracles of subquadratic space were previously unknown, even for insertion.
Our main technical contribution is in establishing novel and intricate connections between two seemingly distant objects, representing two different families of mincuts. The first is the DAG representation of farthest mincuts to the source, which was the central tool introduced by Baswana, Gupta, and Knollmann. The second is the Connectivity Carcass for Steiner mincuts of Dinitz and Vainshtein [STOC ’94], which generalizes well-known cactus representations of global mincuts. Our work demonstrates the relatively unexplored potential of the carcass beyond its “obvious” Steiner mincuts scope.
Minimum cuts, or mincuts for short, are among the most ubiquitous concepts in graph theory and algorithms. Let \(G=(V,E)\) be an undirected multi-graph on \(n\) vertices and \(m\) edges. A minimum cut between a pair of vertices \(u,v \in V\), denoted \(u,v\)-mincut, is a set of edges of least cardinality whose removal disconnects \(u\) from \(v\). Compact representations and data structures for mincuts have been a major field of research. A prime example is the celebrated Gomory-Hu Tree [1], a compact tree structure of only \(O(n)\) space, that represents at least one \(u,v\)-mincut for every pair of vertices \(u,v\in V\). However, in many real-world settings, a basic static network undergoes small and commonly transient changes, such as temporary link failures. This motivates the vast practical and theoretical study of sensitivity oracles: compact data structures that can effectively report the new solution for a given graph problem once such a change occurs.
Sensitivity oracles for mincuts were first introduced by Picard and Queyranne in 1980 [2], and substantial advancement on them has been made in recent years [3]–[10]; here we only focus on results pertaining to undirected multi-graphs, which are most relevant to our context. The original setting considered by Picard and Queyranne was of a fixed pair of vertices \(s,t\), and showed an \(O(n)\) space structure that can determine whether the \(s,t\)-mincut value changes upon the failure (i.e., the deletion) or the insertion of any given edge. Recently, Bhanja [9] has shown that the oracle of [2] is tight in a very strong sense: an oracle that can support queries of two (or more) failing edges already requires (information-theoretically) \(\Omega(n^2)\) space. However, there remains a different intriguing avenue for improvement: going beyond a fixed “source-destination” pair of vertices.
The first result in this direction was by Baswana, Gupta, and Knollmann [3]. They showed an \(O(n)\) space oracle for edge insertions in the single-source setting: Given any inserted edge, it can determine all of the vertices whose mincut value to the distinguished source \(s\) is affected by the insertion. Their central structural insight is an \(O(n)\) space representation for the family of farthest mincuts to \(s\), called the Farthest Mincut DAG (directed acyclic graph); we briefly overview it in 3. However, their work did not address the arguably more important edge failure queries, which are considerably harder. Essentially, this is because supporting insertion queries reduces to efficient representations of only at most \(2(n-1)\) mincuts to the source (the nearest one and the farthest one from each vertex), while failure queries deal with all the mincuts to the source, whose number can be exponential. The “brute-force” approach to handle failure queries in the single-source setting is to store \(n-1\) oracles of [2], one for every pair in \(\{s\} \times V\setminus\{s\}\). A more sophisticated oracle of \(O(n^2)\) space, which in fact works for the most general all-pairs setting, was provided by [4], but this does not improve over the brute-force for the single-source case.
Our main result shows that compact single-source mincut sensitivity oracles of just \(O(n)\) space can also be achieved for edge failure queries:
Theorem 1. For any undirected multi-graph \(G = (V,E)\) on \(n\) vertices and \(m\) edges, with a designated source vertex \(s \in V\), there is an \(O(n)\) space data structure that, given a query edge \(e \in E\), can report all those vertices whose mincut value to \(s\) decreases upon failure of \(e\) within \(O(n)\) time.
Both the space and query time in 1 precisely match those of [3] for edge insertion queries. The query time is “worst-case optimal”, as there exist graphs (say a cycle) where failure of an edge can affect the mincuts to \(s\) of \(\Omega(n)\) vertices. However, one can hope for a better output-sensitive query time, as we will discuss shortly. The space is optimal even for the fixed-pair setting, and even in simple graphs: this easy information-theoretic space lower bound appears in 13.
Our oracle is obtained via intricate usage of the Connectivity Carcass [11]–[14]. The carcass, first announced by Dinitz and Vainshtein in 1994, is a data structure that compactly represents all Steiner mincuts of a given terminal set \(S \subseteq V\) — a Steiner mincut is one with minimum value among those cuts that separate at least one pair of terminals. However, this description barely conveys its complex interface, which unfortunately cannot be compressed into one short “blackbox” result. We do our best to provide a clean and succinct interface in 2.1, but it is nevertheless quite dense. Moreover, the inner workings of the carcass are also highly complicated. Only very recently, more than two decades after its original announcement, Baswana and Pandey [14] provided the first complete and formal treatment of this structure. Perhaps for these reasons, the full potential of the carcass for algorithmic applications seems relatively unexplored. The few existing applications [4], [9], [12] employ it in contexts where Steiner mincuts are either the main focus themselves, or of rather immediate relevance.
In our view, one of the central conceptual contributions of this paper is in demonstrating how the connectivity carcass can be effectively and neatly utilized for a problem which, on the face of it, seems to have little to do with terminal sets and Steiner mincuts. Surprisingly, the key to our solution is treating the vertices inside each node in the farthest mincut DAG as a terminal set. In each such node, we embed carefully chosen components of the corresponding carcass. These are utilized through a machinery that “translates” between the global view of mincuts to the source \(s\), through the DAG, and into the local views of the carcasses inside the nodes. This high-level intuition is explained in detail in the Technical Overview (3).
We complement our optimal space-oracle of 1 with a larger but still subquadratic \(O(n^{1.5})\) space oracle, whose query time guarantees are optimal up to logarithmic factors:
Theorem 2. For any undirected multi-graph \(G = (V,E)\) of \(n\) vertices and \(m\) edges with a designated source vertex \(s \in V\), there is an \(O(n^{1.5})\) space data structure supporting the following queries:
(One-Destination) Given a query of edge \(e \in E\) (resp., \(e \in V\times V\)) and destination vertex \(u \in V \setminus \{s\}\), it can report whether the \(u,s\)-mincut value changes upon failure (resp., insertion) of \(e\), within \(O(\log{n})\) time (resp., \(O(1)\) time).
(Output-Sensitive) Given a query of edge \(e \in E\) (resp., \(e \in V \times V\)), it can report all those vertices whose mincut value to \(s\) changes upon failure (resp., insertion) of \(e\), in amortized \(O(\log^3 n)\) time (resp., \(O(1)\) time) per reported vertex.
Near-optimal query complexities as above were not previously achieved, even for just edge insertion queries, by any oracle with \(o(n^2)\) space. It turns out that the key for these lies in supporting fast reachability queries in the farthest mincut DAG of [3]. In general, answering reachability queries in a DAG is believed to be inherently hard: the Reachability Conjecture [15], [16] states that reachability oracles for DAGs on \(n\) vertices and \(m\) edges require \(\tilde{\Omega}(n^2)\) space to achieve \(o(m)\) time queries, in the worst case.
Interestingly, the nice structural properties of farthest mincuts are “inherited” by their representing DAG, endowing it with a special structure. We show that this can be exploited to bypass the conjectured worst-case hardness, allowing us to design an \(O(n^{1.5})\) space oracle for constant time reachability queries. Combining this main ingredient with some more technical embellishments to the oracle of 1 results in the above 2. Moreover, the reachability oracle is the only “heavy” component: any improvement to its space would immediately yield the same improvement4 to 2. However, our approach seems hard to improve beyond \(O(n^{1.5})\) space; it would be very interesting if one could find a more compact oracle for reachability in the farthest mincut DAG, or provide evidence for hardness.
As an almost-immediate corollary of 2([item:faster-queries-reporting-all]), we get the following result in all-pairs setting5:
Theorem 3. For any undirected multi-graph \(G = (V,E)\) of \(n\) vertices and \(m\) edges, there is an \(O(n^{2.5})\) space data structure that, given a query edge \(e \in E\), can report all those pairs of vertices between which the mincut value decreases upon failure of \(e\), in amortized \(O(\log^3 n)\) time per reported pair.
We note that [4] stated an \(O(n^2)\) space oracle that reports all affected pairs by an edge failure in amortized \(O(1)\) time per pair. However, this specific statement seems inaccurate as their query time incurs an additive \(O(n)\) term (private communication with S. Baswana, 2026). Thus, our 2([item:faster-queries-reporting-all]) is the first to achieve near-optimal output-sensitive query time for edge failure queries in the all-pairs setting; for edge insertion queries, [3] gave \(O(n^2)\) space with optimal output-sensitive time.
We give a broader view of sensitivity oracles through the lens of closely related and central topics of dynamic algorithms and sparsifiers for mincuts. The dynamic algorithms aim to maintain information of mincuts where the graph changes over time due to edge updates (insertion/deletion). There exist many efficient partial/fully dynamic algorithms for fixed-pair mincuts [17]–[19] and global mincuts [20]–[22]. However, the first and only nontrivial algorithm for dynamically maintaining a Gomory-Hu tree (or all-pairs mincuts) was established very recently by Kenneth-Mordoch and Krauthgamer [23]. They design an algorithm that uses \(O(n^{1.5})\) space and achieves \(O(n^{1.5})\) update time. Their techniques are mostly based on the friendly cut sparsifier of [24], which is inherently restricted to unweighted simple graphs (without parallel edges). Also, there exist graph instances for which any such friendly cut sparsifier must occupy \(\Omega(n^{1.5})\) space. It is now interesting to explore whether this bottleneck can be broken to achieve better bounds, where our approach might turn out to be useful.
Sparsification, in general, is a powerful tool that helps us preserve properties of a graph in a relatively much smaller graph. Several classical sparsifiers for mincuts (or cuts in general) have been developed that sparsify the graph while the relevant cuts can be preserved approximately [25]–[27] or exactly [1], [24], [28], [29]. The space occupied by the exact mincut sparsifiers preserving all mincuts between every vertex pair [23], [28] is parameterized on the value \(\omega\) which is the maximum value of any \(s,t\)-mincut over all \(s,t \in V\), and they can achieve \(O(n)\) space only when \(\omega\) is constant.
A natural next step is to extend our results to the all-pairs setting. An intriguing open problem is whether one can obtain an \(O(n)\) space sensitivity oracle for all-pairs mincuts. Our results for the single-source setting seem to provide evidence in this direction, especially in light of recent efficient algorithmic reductions from all-pairs to single-source mincuts, e.g., in [30]–[32].
Another direction is weighted edge failures. In a sense, our oracles do work for weighted graphs: 1 gives an \(O(n)\) space data structure that, given an edge \(e \in E\), can determine all the vertices \(u\) such that \(e\) contributes to some \(u,s\)-mincut (and 2 works similarly). So, in the weighted setting, our “edge failure” query translates to determining whether the \(u,s\)-mincut value changes when the capacity (i.e., weight) of the edge is reduced by some \(\Delta \in (0,1]\) (assuming, by scaling, that weights are integral). Extending our oracles to handle a weighted edge failure which reduces its capacity to zero (or more generally, by an arbitrary amount) remains an interesting challenge. This is particularly intriguing as Baswana and Bhanja [6] recently extended the fixed-pair oracle of [2] to this weighted setting.
Throughout, we consider an unweighted, undirected, connected multi-graph \(G = (V,E)\) with \(n = |V|\) vertices and \(m = |E|\) edges, which has a designated source vertex \(s \in V\).
For \(A \subseteq V\), the capacity \(c(A)\) is the number of edges crossing from \(A\) to \(\overline{A} := V\setminus A\). Those edges are called the edge-set of the cut \(A\), or the contributing edges of \(A\). If \(\emptyset \neq X \subseteq A\) and \(\emptyset \neq Y \subseteq \overline{A}\), we say that \(A\) is an \((X,Y)\)-cut. An \((X,Y)\)-cut of smallest capacity is called \((X,Y)\)-mincut. The term \(X,Y\)-(min)cut refers to either an \((X,Y)\)-(min)cut or a \((Y,X)\)-(min)cut. When \(X,Y\) are singletons \(X=\{x\}\) and \(Y=\{y\}\), we may write \(x,y\)-(min)cut, and such shorthands for singletons apply to other notations as well. For \(S \subseteq V\), the (cut defined by) \(A\) is said to be an \(S\)-cut or a Steiner cut for \(S\) if \(S \cap A \neq \emptyset\) and \(S \cap \overline{A} \neq \emptyset\). An \(S\)-cut of smallest capacity is called \(S\)-mincut or a Steiner mincut for \(S\), and its capacity is denoted by \(\lambda_S\).
It is well-known that \(c(\cdot)\) satisfies submodularity: \(c(A) + c(B) \geq c(A \cap B) + c(A \cup B)\) for all \(A,B \subseteq V\). As \(G\) is undirected, this also implies posimodularity: \(c(A) + c(B) \geq c(A \setminus B) + c(B \setminus A)\) for all \(A,B \subseteq V\). Rather than using these inequalities directly, we will use their consequence on mincuts:
Lemma 1. Let \(S,T \subseteq V\), and suppose \(A\) is an \(S\)-mincut and \(B\) is a \(T\)-mincut.
(“Submodularity”) If one of \(A \cap B\) and \(A \cup B\) is an \(S\)-cut and the other is a \(T\)-cut, then the former is an \(S\)-mincut, the latter is a \(T\)-mincut, and no edge of \(G\) goes between \(A \setminus B\) and \(B \setminus A\).
(“Posimodularity”) If one of \(A \setminus B\) and \(B \setminus A\) is an \(S\)-cut and the other is a \(T\)-cut, then the former is an \(S\)-mincut, the latter is a \(T\)-mincut, and no edge of \(G\) goes between \(A \cap B\) and \(\overline{A \cup B}\).
Furthermore, the above also holds if we replace \(S\)-(min)cut by \(S_1,S_2\)-(min)cut, and/or replace \(T\)-(min)cut by \(T_1,T_2\)-(min)cut, for \(S_1, S_2, T_1, T_2 \subseteq V\).
Results of very similar flavor to 1 have been widely observed, e.g.in [2], [3], [5], [13], [29]. We give the short proof in 11. By submodularity, one sees that if \(A\) and \(B\) are both \((X,Y)\)-mincuts, then so are \(A \cap B\) and \(A \cup B\). This allows us to define farthest and nearest mincuts:
Definition 1. The farthest (resp., nearest) \((X,Y)\)-mincut, denoted \(\mathsf{Far}(X,Y)\) (resp., \(\mathsf{Near}(X,Y)\)), is the union (resp., intersection) of all \((X,Y)\)-mincuts. In other words, \(\mathsf{Far}(X,Y)\) (resp., \(\mathsf{Near}(X,Y)\)) is the unique \((X,Y)\)-mincut which contains (resp., is contained in) every other \((X,Y)\)-mincut.
Another lemma along these lines is concerned with three mincuts to the source \(s\). Again, this lemma has been essentially observed before, e.g.in [3], [13], [14], [33]. See 11 for the proof.
Lemma 2. Let \(a,b,c \in V \setminus \{s\}\). Let \(A,B,C\) be \((a,s)\)-mincut, \((b,s)\)-mincut, \((c,s)\)-mincut respectively. If \(a \notin B \cup C\), \(b \notin A \cup C\) and \(c \notin A \cup B\), then the intersection \(A \cap B \cap C\) is empty.
Here, we succinctly present the “must-knows” of the seminal Connectivity Carcass [11]–[13]. The carcass is a rich and complex structure; we strongly recommend referring to [14] for a simplified and comprehensive presentation. Our terminology differs slightly from theirs, mainly since we bypass the flesh component of the carcass. See 10.1 for an example demonstrating the carcass.
Let \(S \subseteq V\) be a distinguished set of vertices called terminals. Two vertices \(u,v \in V\) are \(S\)-equivalent if no \(S\)-mincut keeps \(u\) and \(v\) on different sides. We give unique identifiers to the \(S\)-equivalence classes, and denote by \(\phi_S (u)\) the identifier of \(u\)’s class, so \(\phi_S (u) = \phi_S (v)\) iff \(u,v\) are \(S\)-equivalent.
A partition of \(S\) into \(S_1,S_2\) is called a valid partition if there is some \(S\)-mincut \(C\) s.t.\(C \cap S = S_1\) and \(\overline{C} \cap S = S_2\), or equivalently if any \(S_1,S_2\)-mincut is an \(S\)-mincut. For a valid partition \(S_1,S_2\), we say that:
\(S_1,S_2\) distinguishes edge \(e \in E\) if there exists an \(S_1,S_2\)-mincut to which \(e\) is contributing.
\(S_1,S_2\) distinguishes vertex \(v \in V\) if there exists two \(S_1,S_2\)-mincuts, one keeping \(v\) on the side of \(S_1\), and the other keeping \(v\) on the side of \(S_2\).
Vertex \(v \in V\) is called stretched (w.r.t.\(S\)) if \(v\) is distinguished by some valid partition of \(S\), and non-stretched otherwise. All terminals are non-stretched, but a non-stretched vertex need not be a terminal.
The carcass is based on a cactus graph and related notions defined as follows:
Definition 2. A cactus is an undirected connected graph where no two cycles share a node.6 Edges/nodes in cycles are called cycle-edges/nodes; the rest are called tree-edges/nodes.
A canonical cut of the cactus is either one tree-edge or a pair of non-adjacent edges from the same cycle. Deleting the edges of such a cut leaves exactly two connected components, called its sides.
A proper path in the cactus is a simple path which shares at most one edge with any cycle. Given any two nodes in a cactus, either there is a unique proper path between them, or there is no such path. Hence, a proper path can be specified by its two endpoints.
The skeleton is a cactus that compactly stores all valid partitions (see [14]).
Theorem 4 (). There is an \(O(|S|)\) size cactus \(\mathcal{H}_S\) and a mapping7 \(\pi_S (\cdot)\) from \(S\) to nodes of \(\mathcal{H}_S\), called the skeleton of \(S\), such that valid partitions of \(S\) bijectively correspond to canonical cuts of \(\mathcal{H}_S\): Canonical cut \(C\) corresponds to the valid partition \(S_1,S_2\) such that \(S_1\) are the terminals mapped to one side of \(C\), and \(S_2\) are those mapped to its other side.
Further, \(\mathcal{H}_S\) has the following structural properties: Each empty node (i.e., without mapped terminals) has degree at least \(3\). Each cycle consists only of empty nodes of degree exactly \(3\), and has length at least \(4\). In particular, this implies that each edge of \(\mathcal{H}_S\) is contained in at least one canonical cut.
A canonical cut in \(\mathcal{H}_S\) is said to distinguish a vertex/edge if its corresponding valid partition distinguishes it. The projection mapping extends \(\pi_S (\cdot)\) to non-terminals and to edges, and provides a characterization of those canonical cuts distinguishing them (see [14]).
Theorem 5 (Vertex projections). Each vertex \(v \in V\) has a projection \(\pi_S (v)\) in \(\mathcal{H}_S\) such that:
If \(v\) is stretched, \(\pi_S (v)\) is the unique proper path in \(\mathcal{H}_S\) such that the canonical cuts distinguishing \(v\) are precisely those canonical cuts that contain an edge from \(\pi_S (v)\) (i.e., those that keep \(\pi_S (v)\)’s endpoints on different sides).
If \(v\) is non-stretched, \(\pi_S (v)\) is a tree-node of \(\mathcal{H}_S\). If \(v \in S\), this node coincides with the previous definition of \(\pi_S (v)\) from 4.
The following holds: Let \(C\) be a canonical cut corresponding to valid partition \(S_1,S_2\). If \(C\) keeps \(\pi_S (v)\) entirely on the side of \(S_1\), then every \(S_1,S_2\)-mincut keeps \(v\) with \(S_1\).
Theorem 6 (Edge projections). Let \(e = \{x,y\}\) be an edge such that \(\phi_S (x) \neq \phi_S (y)\). The projection \(\pi_S (e)\) of \(e\) is the unique proper path in \(\mathcal{H}_S\) with the following properties:
The canonical cuts of \(\mathcal{H}_S\) that distinguish \(e\) are precisely those that contain an edge from \(\pi_S (e)\) (i.e., those canonical cuts that keep \(\pi_S (e)\)’s endpoints on different sides).
The endpoint nodes of \(\pi_S (e)\) are labeled as the \(x\)-endpoint and the \(y\)-endpoint; \(\pi_S (x)\) and \(\pi_S (y)\) respectively form a prefix and a suffix of \(\pi_S (e)\) in the direction from the \(x\)-endpoint to the \(y\)-endpoint. 8
The following holds: Let \(C\) be a canonical cut corresponding to valid partition \(S_1,S_2\). If \(C\) keeps the \(x\)-endpoint of \(\pi_S (e)\) with \(S_1\) and its \(y\)-endpoint with \(S_2\), then every \(S_1,S_2\)-mincut to which \(e\) is contributing keeps \(x\) with \(S_1\) and \(y\) with \(S_2\). This is called the unidirectionality property.
We give a technical overview focusing on our main result, 1, structured as follows. We first explain the edge insertion oracle of [3], who introduced the farthest mincut DAG, and provide some basic insights towards supporting failure queries. Next, we introduce the key connecting link between the farthest mincut DAG and the connectivity carcass. Based on this link, we first discuss how the simpler skeleton component alone can yield a non-trivial \(O(m)\) space oracle with \(O(n)\) query time. Finally, we let carcass projections into the picture, and explain how these are used to obtain the \(O(n)\) space oracle.
Our starting point is the single-source mincuts oracle for edge insertion by [3]. Observe that insertion of edge \(e\) changes the \(u,s\)-mincut value if and only if \(e\) contributes to \(\mathsf{Near}(u,s)\) and to \(\mathsf{Far}(u,s)\). Thus, the problem reduces to efficiently representing \(\mathcal{N} = \{\mathsf{Near}(u,s)\}_{u \in V \setminus \{s\}}\) and \(\mathcal{F} = \{\mathsf{Far}(u,s)\}_{u \in V \setminus \{s\}}\).
Using sub/posimodularity, it is not hard to show that \(\mathcal{N}\) is a laminar family, and thus admits an \(O(n)\) size representation called the nearest mincut tree \(\mathcal{T}\): its nodes form a partition of \(V\) (where the root contains only \(s\)), such that, for each \(u \in V \setminus \{s\}\), \(\mathsf{Near}(u,s)\) has precisely those vertices found in descendants of the node containing \(u\). While \(\mathcal{F}\) may not be laminar, the central contribution of [3] was showing that it admits an analogous representation: the farthest mincut DAG \(\mathcal{D}\), stated in [thm:32baswana32et32al32DAG] below. Throughout the paper, we use ‘tree terminology’ for DAGs: the in-neighbors and out-neighbors of a node are its parents and children, respectively; its descendants are those nodes reachable from it, and its ancestors are those that can reach it; a strict ancestor/descendant is one that is not the node itself.
theoremfarthest There is a DAG \(\mathcal{D}\) whose nodes form a partition of \(V\), such that for every \(u \in V \setminus \{s\}\), \(\mathsf{Far}(u,s)\) consists precisely of those vertices found in descendants of the node containing \(u\) in \(\mathcal{D}\). Each node in \(\mathcal{D}\) has at most \(2\) parents, and thus \(\mathcal{D}\) has only \(O(n)\) edges. The source \(s\) is found alone in a source node \(\{s\}\) with no parents, that is an ancestor of all other nodes.
For each structure \(\mathcal{S} \in \{\mathcal{T}, \mathcal{D}\}\), let \(\mathcal{S}(u)\) be the node of \(\mathcal{S}\) that contains \(u\), \(\mathcal{S}^{\uparrow}(u)\) be the set of vertices in ancestors of \(\mathcal{S}(u)\), and \(\mathcal{S}_{\downarrow}(u)\) be the set of vertices in descendants of \(\mathcal{S}(u)\). So, for every \(u,w \in V \setminus \{s\}\), \[w \in \mathsf{Near}(u,s) \Leftrightarrow w \in \mathcal{T}_{\downarrow}(u) \Leftrightarrow u \in \mathcal{T}^{\uparrow}(w) \quad \text{and} \quad w \in \mathsf{Far}(u,s) \Leftrightarrow w \in \mathcal{D}_{\downarrow}(u) \Leftrightarrow u \in \mathcal{D}^{\uparrow}(w).\] See 10.2 for an example demonstrating \(\mathcal{T}\) and \(\mathcal{D}\). Thus, when edge \(e = \{x,y\}\) is inserted, the set of vertices \(u\) such that \(e\) contributes to \(\mathsf{Near}(u,s)\) and to \(\mathsf{Far}(u,s)\) is precisely \(\mathcal{T}^{\uparrow}(x) \setminus \mathcal{D}^{\uparrow}(y) \cup \mathcal{T}^{\uparrow}(y) \setminus \mathcal{D}^{\uparrow}(x)\), i.e., each \(u\) having \(x\) as a descendant in \(\mathcal{T}\) (so, \(x\in \mathsf{Near}(u,s)\)) and \(y\) not a descendant in \(\mathcal{D}\) (so, \(y\notin \mathsf{Far}(u,s)\)), or vice versa. Hence, the data structure of [3] simply stores \(\mathcal{T}\) and \(\mathcal{D}\), and answers an insertion query in \(O(n)\) time by \(O(1)\) BFS searches in (the reverses of) \(\mathcal{T}\) and \(\mathcal{D}\).
Given this background, we move on to consider the problem of 1: supporting a failure query of edge \(e = \{x,y\} \in E\). Observe that the failure of \(e\) changes the \(u,s\)-mincut value if and only if \(e\) contributes to some \(u,s\)-mincut. This makes the failure variant a lot more challenging than the insertion one, which just requires examining \(\mathsf{Near}(u,s)\) and \(\mathsf{Far}(u,s)\), only two very special \(u,s\)-mincuts. In light of this, it might seem that the nearest mincut tree \(\mathcal{T}\) and farthest mincut DAG \(\mathcal{D}\) have little to do with our task. While \(\mathcal{T}\) is indeed less relevant, it turns out that \(\mathcal{D}\) is useful also for failure queries, as explained next.
A vertex \(u\) is said to separate two non-empty vertex subsets \(P,Q \subseteq V\) if there exists a \(u,s\)-mincut that keeps \(P\) and \(Q\) on different sides. Hence, the goal in a failure query of an edge \(e = \{x,y\} \in E\) is to report all vertices that separate \(x,y\).9 We now give a few basic observations on where these vertices lie in \(\mathcal{T}\) and in \(\mathcal{D}\), which help in answering our query, and also highlight what makes the latter more useful. For each \(\mathcal{S} \in \{\mathcal{T}, \mathcal{D}\}\), let us classify the nodes into three types based on their ancestry relations to the nodes of \(x\) and \(y\):
an ancestor of both \(\mathcal{S}(x)\) and \(\mathcal{S}(y)\).
an ancestor of exactly one of \(\mathcal{S}(x)\) or \(\mathcal{S}(y)\).
neither an ancestor \(\mathcal{S}(x)\), nor of \(\mathcal{S}(y)\).
Exclusive ancestors are trivial to handle both in \(\mathcal{T}\) and in \(\mathcal{D}\): all their vertices separate \(x,y\). Indeed, if \(\mathcal{T}(u)\) (resp., \(\mathcal{D}(u)\)) is an exclusive ancestor, then the \(u,s\)-mincut \(\mathsf{Near}(u,s)\) (resp., \(\mathsf{Far}(u,s)\)) keeps \(x\) and \(y\) on different sides. The other two types play dual roles in \(\mathcal{T}\) and in \(\mathcal{D}\), as follows:
If \(\mathcal{T}(u)\) is a common ancestor, then \(\mathsf{Near}(u,s)\) contains both \(x\) and \(y\), and hence \(e\) cannot contribute to any \(u,s\)-mincut. Namely, common ancestors in \(\mathcal{T}\) cannot contain vertices that separate \(x,y\).
If \(\mathcal{D}(u)\) is a non-ancestor, then \(\mathsf{Far}(u,s)\) keeps both \(x\) and \(y\) outside, and hence \(e\) cannot contribute to any \(u,s\)-mincut. Namely, non-ancestors in \(\mathcal{D}\) cannot contain vertices that separate \(x,y\).
To conclude, each of \(\mathcal{T}\) and \(\mathcal{D}\) has one non-trivial type: in \(\mathcal{T}\) these are the non-ancestors, while in \(\mathcal{D}\) these are the common ancestors. Intuitively, this is what makes \(\mathcal{D}\) preferable: its non-trivial nodes are well-structured. Indeed, if \(\mathcal{D}\) were a tree, the common ancestors would form a path from the root to the LCA (lowest/least common ancestor), so any two of them would be related by ancestry. It turns out that even though \(\mathcal{D}\) is a DAG, it still admits a very similar property: among any three common ancestors, at least two are related by ancestry. This is by the following lemma:
Lemma 3. If \(\mu_1, \mu_2, \mu_3\) are three nodes of \(\mathcal{D}\) such that10 \(\mathcal{D}_{\downarrow}(\mu_1) \cap \mathcal{D}_{\downarrow}(\mu_2) \cap \mathcal{D}_{\downarrow}(\mu_3) \neq \emptyset\), then at least two of them must be related by ancestry.
Proof. If some \(\mu_i\) is the source node \(\{s\}\) this is immediate, as it is an ancestor of all other nodes. Otherwise, for each \(i = 1,2,3\), take a vertex \(u_i \in \mu_i\), so \(\mathcal{D}_{\downarrow}(\mu_i) = \mathsf{Far}(u_i, s)\). Because the intersection of these three mincuts to \(s\) is non-empty, by 2 there must be some \(i \neq j\) with \(u_i \in \mathsf{Far}(u_j, s) = \mathcal{D}_{\downarrow}(\mu_j)\), and thus \(\mu_i = \mathcal{D}(u_i)\) is a descendant of \(\mu_j\). ◻
In particular, this lemma implies that \(\mathcal{D}(x)\) and \(\mathcal{D}(y)\) can have at most two LCAs in \(\mathcal{D}\).11 These two LCAs can be easily found in \(O(n)\) time, and as discussed, all the non-trivial nodes are ancestors of (at least) one of them. Therefore, our goal becomes to give a data structure for the following query:
We now present the key insight that underlies our approach. The idea is to analyze how arbitrary mincuts to the source vertex \(s\) “interact” with the farthest mincut DAG \(\mathcal{D}\). Consider an arbitrary \((u,s)\)-mincut \(U\). Then of course, \(U \subseteq \mathsf{Far}(u,s) = \mathcal{D}_{\downarrow}(u)\), i.e., \(U\) only contains vertices from descendants of \(\mathcal{D}(u)\). Other than that, \(U\) need not “respect” the structure of \(\mathcal{D}\): for a descendant node \(\mu\) of \(\mathcal{D}(u)\), it could be that \(U\) keeps \(\mu\) entirely inside, entirely outside, or—“worst of all”—it could even splits \(\mu\) between its sides, which indeed turns out most challenging for us. Our key insight to mitigate this challenge is that if \(\mu\) is split by \(U\), then the partition \(\mu \cap U, \mu \cap \overline{U}\) cannot be arbitrary: it must be a valid partition of \(\mu\) (see 2.1). This is because \(U\) “induces” a \(\mu\)-mincut, as formalized in the following simple-yet-crucial lemma:
Lemma 4. Let \(U\) be a \((u,s)\)-mincut for some \(u \in V \setminus \{s\}\), and let \(\mu\) be a node of \(\mathcal{D}\). Suppose that \(U\) splits \(\mu\) (i.e., \(\mu \cap U \neq \emptyset\) and \(\mu \cap \overline{U} \neq \emptyset\)). Then \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut, and its capacity \(\lambda_\mu\) is equal to the capacity of \(\mathcal{D}_{\downarrow}(\mu)\). In particular, \(\mu \cap U, \mu \cap \overline{U}\) is a valid partition of \(\mu\).
Proof. We need to prove that \(\lambda_\mu = c(U \cap \mathcal{D}_{\downarrow}(\mu)) = c(\mathcal{D}_{\downarrow}(\mu))\).
First, we note that \(\lambda_\mu \leq c(U \cap \mathcal{D}_{\downarrow}(\mu))\), as \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-cut and \(\lambda_\mu\) is the capacity of \(\mu\)-mincut.
Next, we argue that \(c(U \cap \mathcal{D}_{\downarrow}(\mu)) = c(\mathcal{D}_{\downarrow}(\mu))\). Take some \(w \in \mu \cap U\). As \(w \in \mu\), \(\mathcal{D}_{\downarrow}(\mu)\) is (the farthest) \(w,s\)-mincut. Now, \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \((w,s)\)-cut and \(U \cup \mathcal{D}_{\downarrow}(\mu)\) is a \((u,s)\)-cut. So, by submodularity (1), \(c(U \cap \mathcal{D}_{\downarrow}(\mu)) = c(\mathcal{D}_{\downarrow}(\mu))\).
Finally, we show that \(c(\mathcal{D}_{\downarrow}(\mu)) \leq \lambda_\mu\). Take any \(\mu\)-mincut \(C\) such that \(s \notin C\). Choose any \(v \in \mu \cap C\), hence \(C\) is a \((v,s)\)-cut. Because \(v \in \mu\), \(\mathcal{D}_{\downarrow}(\mu)\) is (the farthest) \(v,s\)-mincut, so \(c(\mathcal{D}_{\downarrow}(\mu)) \leq c(C) = \lambda_\mu\). ◻
Thus, 4 provides a “bridge” between single-source mincuts and Steiner mincuts: It serves as a key that unlocks the powers of the connectivity carcass, and allows us to harness them for our purposes.
As detailed in 2, the connectivity carcass has several components; the simplest and most well-known is the skeleton, a cactus representation for all valid partitions of the terminals (see 4). It turns out that by only utilizing skeletons, together with our previous insights on \(\mathcal{D}\), we can already provide a non-trivial data structure for Query [query-Q] with \(O(m)\) space and \(O(n)\) query time, through a tool we term the representatives framework.
On a high-level, the representative framework provides a succinct characterization for the set of vertices \(u\) that separate two vertices \(x,y\), which is precisely what we need for Query [query-Q]. The framework even applies more generally, if we replace the two vertices \(x,y\) with two non-empty subsets of vertices \(P,Q\). This generalization would be critical for us to obtain an optimal \(O(n)\) space bound, as will be explained later on in this overview. The framework associates \(O(1)\) representative information \(\mathrm{\small rep}(P,Q)\) with any such pair \(P,Q\). This information, along with the \(O(n)\) global information consisting of the DAG \(\mathcal{D}\) and the skeletons \(\mathcal{H}_\nu\) associated with each node \(\nu\) of \(\mathcal{D}\), essentially encodes all the vertices \(u\) that separate \(P,Q\) (namely, such that some \(u,s\)-mincut keeps \(P\) and \(Q\) on different sides). The following lemma provides the interface of this framework.
Lemma 5. There is an \(O(n)\) space data structure such that, given \(\mathrm{\small rep}(P,Q)\) for a pair of non-empty \(P,Q \subseteq V\), and given a node \(\mu\) of \(\mathcal{D}\) such that \(P \cup Q \subseteq \mathcal{D}_{\downarrow}(\mu)\), reports in \(O(n)\) time the set of vertices from ancestors of \(\mu\) that separate \(P,Q\), namely \(\{u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{exists u,s-mincut with P and Q on different sides}\}\).
Given 5, we immediately get an \(O(m)\) space data structure that answers Query [query-Q] within \(O(n)\) time: we just store \(\mathrm{\small rep}(x,y)\) for every edge \(e = \{x,y\} \in E\) and the \(O(n)\) space global structure from 5. We now outline what is going on behind the hood of 5, and explain the essential role of skeletons in obtaining it.
First, by exploiting 3, we show that there exists \(O(1)\) representative nodes \(\nu_1, \nu_2, \dots\) for \(P,Q\), such that every \(u\) which separates \(P,Q\) must lie in a descendant node of some \(\nu_i\). Conversely, by using sub/posimodularity and the structure of \(\mathcal{D}\), we prove that if vertex \(u\) lies in a strict descendant of some \(\nu_i\) and satisfies \(P \cup Q \subseteq \mathcal{D}_{\downarrow}(u)\), then \(u\) must separate \(P,Q\). We let \(\mathrm{\small rep}(P,Q)\) store the names of \(\nu_1, \nu_2, \dots\). So, using this information and the “global” DAG \(\mathcal{D}\), we can classify every vertex \(u \in \mathcal{D}^{\uparrow}(\mu)\) as separating \(P,Q\) or not, except for those vertices inside the representative nodes.
Let us now zoom-in on one representative node \(\nu_i\). By a structural analysis based on sub/posimodularity, we show that there exists \(O(1)\) mincuts-to-\(s\) \(U_1, U_2, \dots\) such that those vertices of \(\nu_i\) that separate \(P,Q\) are precisely \(\nu_i \cap (U_1 \cup U_2 \cup \cdots)\). By the “bridge” 4, each \(\nu_i \cap U_j\) defines a valid partition of \(\nu_i\), and thus can be determined as the terminals in one side of a corresponding canonical cut \(C_{ij}\) in the skeleton \(\mathcal{H}_{\nu_i}\). Crucially, such a canonical cut \(C_{ij}\) with a “marked” side can be compactly represented by storing the one or two skeleton edges of \(C_{ij}\), with marking on their endpoints from the marked side. So, we let \(\mathrm{\small rep}(P,Q)\) store \(C_{i1},C_{i2},\dots\) (with the markings), and together with the “global” skeleton \(\mathcal{H}_{\nu_i}\), this lets us determine which vertices in \(\nu_i\) that separate \(P,Q\).
To keep the overview focused, from now on we will only care about the space of our data structure for Query [query-Q], and neglect query time; the latter can be made \(O(n)\) by using some technical extensions of the representative framework.
Up until now, we have only used the skeleton component of the carcass, which enabled us to get down to \(O(m)\) space. To get optimal \(O(n)\) space, we need to use the more complicated and crucial component of the carcass: the projection mapping (see 5 and 6).
As a warm-up to demonstrate our use of projections, we first discuss a special case of Query [query-Q]: the query edge \(e = \{x,y\}\) is internal, i.e., \(x\) and \(y\) are from the same node \(\mu\) of \(\mathcal{D}\), which is trivially the unique LCA of \(\mathcal{D}(x),\mathcal{D}(y)\). The main insight for this special case is the following. Consider any vertex \(u \in \mathcal{D}^{\uparrow}(\mu)\) which we should classify as separating \(x,y\) or not. Let \(U\) be some arbitrary \((u,s)\)-mincut. Using our “bridge to the carcass”, we can characterize precisely when \(U\) separates \(x,y\) in terms of the projection \(\pi_\mu (e)\), which is a proper path in the skeleton \(\mathcal{H}_\mu\).
Claim 7. \(U\) separates \(x,y\) if and only if \(\mu \cap U, \mu \cap \overline{U}\) is a valid partition of \(\mu\) whose corresponding canonical cut \(C\) contains an edge \(g\) from \(\pi_\mu (e)\).
Proof. (\(\Rightarrow\)) By 4, \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut with \(e\) contributing, so its valid partition \(\mu \cap U, \mu \cap \overline{U}\) distinguishes \(e\), hence by 6 the latter corresponds to a canonical cut with an edge from \(\pi_\mu (e)\).
(\(\Leftarrow\)) As \(x,y \in \mu\), \(\pi_\mu (x)\) and \(\pi_\mu (y)\) are nodes, and they form \(\pi_\mu (e)\)’s endpoints by 6, so \(C\) keeps them on different sides. Hence, by 5, any \(\mu\)-mincut whose valid partition is \(\mu \cap U, \mu \cap \overline{U}\) separates \(x,y\). But \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is such a \(\mu\)-mincut by 4, and \(x,y \in \mathcal{D}_{\downarrow}(\mu)\), so \(U\) separates \(x,y\). ◻
To utilize this insight through the representative framework, we show a rather simple property of the skeleton: Each skeleton edge \(g\) in \(\mathcal{H}_\mu\) has two sets of associated terminals \(\mu_0 (g), \mu_1 (g) \subseteq \mu\), such that the canonical cuts containing \(g\) correspond exactly to the valid partitions keeping \(\mu_0 (g)\) and \(\mu_1 (g)\) on different parts. We say that \(u\) separates \(g\) if it separates \(\mu_0 (g), \mu_1 (g)\) (i.e., some \(u,s\)-mincut keeps these sets on different sides), and define \(\mathrm{\small rep}(g) = \mathrm{\small rep}(\mu_0 (g), \mu_1 (g))\). Thus, by the previous claim, we obtain that
Claim 8. \(u\) separates \(x,y\) if and only if \(u\) separates some skeleton edge \(g\) from \(\pi_\mu (e)\).
In light of this discussion, our \(O(n)\) space data structure for “internal” Query [query-Q] consists of:
The \(O(n)\) space global structure of the representatives framework from 5.
For each node \(\mu\) in \(\mathcal{D}\), the skeleton \(\mathcal{H}_\mu\) is stored along with \(\mathrm{\small rep}(g)\) for each skeleton edge \(g\) of \(\mathcal{H}_\mu\).
As \(\mathcal{H}_\mu\) has \(O(|\mu|)\) edges, and \(\mathrm{\small rep}(g)\) takes up \(O(1)\) space, this amounts only to \(O(n)\) storage overall. Now, to answer a query of \(e = \{x,y\} \in E\) with \(x,y \in \mu\), we find the unique proper path between the nodes \(\pi_\mu (x)\) and \(\pi_\mu (y)\) in the skeleton \(\mathcal{H}_\mu\), which is \(\pi_\mu (e)\) by 6. Then, for each edge \(g\) of \(\pi_\mu (e)\), we use \(\mathrm{\small rep}(g)\) in 5 to find all vertices \(\mathcal{D}^{\uparrow}(\mu)\) that separate \(g\), and return the union of all found vertices, which is all those \(u \in \mathcal{D}^{\uparrow}(\mu)\) that separate \(x,y\) by 8.
From now on, we discuss the strategy for generalizing the internal case and handling Query [query-Q] with any edge \(e = \{x,y\}\). Unlike the internal case, now we need to consider two types of mincuts to \(s\) which separate \(x,y\): 1) those that split \(\mu\), and 2) those placing all of \(\mu\) entirely on one side (the latter were impossible when \(x,y \in \mu\)). We thus fork query [query-Q] into two queries:
Given \(e = \{x,y\} \in E\) and an LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\),
report all \(u \in \mathcal{D}^{\uparrow}(\mu)\) such that some \(u,s\)-mincut separates \(x,y\) and splits \(\mu\).
report all \(u \in \mathcal{D}^{\uparrow}(\mu)\) such that some \(u,s\)-mincut separates \(x,y\) and keeps \(\mu\) on one side.
Query [query-Q1] turns out to be the more challenging one, so we focus only on it in this overview.
As in the internal case, the projection path \(\pi_\mu(e)\) in the skeleton \(\mathcal{H}_\mu\) will still play a crucial role for us, though its use will be more involved. But, before we can use \(\pi_\mu (e)\), we are first faced with a more basic challenge: how can we even find \(\pi_\mu (e)\)? Recall that \(\pi_\mu (e)\) is the unique proper path that has \(\pi_\mu (x)\) and \(\pi_\mu (y)\) as a prefix and suffix. When \(e\) was internal, \(x,y\) were terminals, so their projections are given directly from the skeleton \(\mathcal{H}_\mu\), which we store. But in general, \(x\) and/or \(y\) are non-terminals, and so we do not have the budget to explicitly store their projections in \(\mathcal{H}_\mu\). Our strategy to tackle this challenge goes through the notion of anchors, introduced in the following definition:
definitionanchors For each node \(\nu\) of \(\mathcal{D}\), choose an arbitrary vertex \(z_\nu \in \nu\) called the pivot of \(\nu\). For a vertex \(x \in \mathcal{D}_{\downarrow}(\mu)\), where \(\mu\) is a node in \(\mathcal{D}\), define the anchor of \(x\) w.r.t.\(\mu\) as follows:
If \(x \in \mu\), the anchor is just \(x\) itself.
If \(x \notin \mu\), the anchor is a pivot \(z_\nu\) where \(\nu\) is an arbitrary child of \(\mu\) such that \(x \in \mathcal{D}_{\downarrow}(\nu)\).
Relying on sub/posimodularity and the properties of the farthest mincut DAG \(\mathcal{D}\), we are able to prove that the anchors \(z_x\) and \(z_y\) are “equivalent” to the endpoints of the query edge \(e = \{x,y\}\), in every meaningful sense for us. So, our strategy is to “translate” the original query endpoints \(x,y\) to their anchors \(z_x, z_y\). In particular, it turns out that \(\pi_\mu (z_x)\) and \(\pi_\mu (z_y)\) form a prefix and suffix of the proper path \(\pi_\mu(e)\), in a similar fashion to \(\pi_\mu (x)\) and \(\pi_\mu (y)\) (although \(\pi_\mu (z_x)\) might not be equal to \(\pi_\mu (x)\), and similarly with \(z_y\) and \(y\)). Thus, we can store the projections \(\pi_\mu (z_\nu)\) for each edge \((\mu, \nu)\) of \(\mathcal{D}\), and still be able to recover the projection path \(\pi_\mu (e)\) at query time as desired; this only requires \(O(n)\) space since \(\mathcal{D}\) has \(O(n)\) edges.
As mentioned before, finding \(\pi_\mu (e)\) is merely one basic challenge that we need to overcome. However, the equivalence of the anchors \(z_x,z_y\) to the endpoints \(x,y\) is key to reducing the space needed to tackle other challenges as well: in essence, whenever we would like to store some \(O(1)\) information for a vertex as a “potential endpoint” of the yet-unknown query edge whose LCA is \(\mu\), we can just store it for the anchor instead, and this will result in \(O(n)\) storage overall. So, exploiting this equivalence, in the remaining discussion we simply assume that \(x = z_x\) and \(y = z_y\).
Finally, we give an overview of the more complicated structural insights to treat the general case of Query [query-Q1], which play an analogous role to 8 for the internal case. One direction of 8 remains true: if \(u\) separates \(x,y\) (by a cut that splits \(\mu\)), then \(u\) must separate some edge \(g\) of \(\pi_\mu (e)\). However, the converse direction is no longer true. This is because now \(x\) or \(y\) might be stretched vertices. We illustrate the issue through a hypothetical example:
Say \(\pi_\mu (x)\) is a prefix of \(\pi_\mu (e)\) with at least one edge \(g\), which is a tree-edge; then \(\mu_0 (g), \mu_1 (g)\) form the valid partition corresponding to \(g\), which distinguishes \(x\) by 5. So, there are \((\mu_0 (g),\mu_1 (g))\)-mincuts \(A\) and \(B\) s.t.\(x \in A\) and \(x \notin B\); say \(A,B\) are the only \((\mu_0 (g) ,\mu_1 (g))\)-mincuts.
Say there is a unique \((u,s)\)-mincut \(U\) splitting \(\mu\), where \(\mu_0 (g) \subseteq U\), \(\mu_1 (g) \subseteq \overline{U}\). Thus, \(u\) separates \(g\).
Finally, say \(y \in \overline{U}\). Thus, \(u\) should be included in the output for Query [query-Q1] iff \(x \in U\). By 4, \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \((\mu_0 (g),\mu_1 (g))\)-mincut. Note that \(x \in U\) iff \(x \in W\). However, we have no way of telling if \(W\) is equal to \(A\) or to \(B\), and accordingly, both \(x \in U\) and \(x \notin U\) are possible.
So, we need new tools to help us characterize precisely those “false positive” cases where \(u\) separates \(\pi_\mu (e)\) but does not separate \(x,y\). These come from storing some additional information with the vertex projections \(\pi_\mu (x)\) and \(\pi_\mu (y)\), as follows.
First, we show that one can associate two terminal sets \(\mu_0 (x)\) and \(\mu_1 (x)\) with the proper path \(\pi_\mu (x)\), in a similar fashion to what we did with single skeleton edges: the canonical cuts having an edge from \(\pi_\mu (x)\) correspond precisely to the valid partitions keeping \(\mu_0 (x)\) and \(\mu_1 (x)\) on different parts. Further, each of the sets \(\mu_0 (x), \mu_1 (x)\) has a “matching endpoint” of \(\pi_\mu (x)\): the endpoint which matches \(\mu_i (x)\) lies in the same side as \(\mu_i (x)\) of any canonical cut that splits \(\mu_0 (x)\) and \(\mu_1 (x)\). We store the representative information \(\mathrm{\small rep}(\mu_0 (x) \cup \{x\}, \mu_1 (x))\) and \(\mathrm{\small rep}(\mu_0(x), \mu_1 (x) \cup \{x\})\). This is done during preprocessing, hence we also store symmetric information also for \(\pi_\mu (y)\).
At query time, using some additional technical tools, we determine which of \(\mu_0 (x)\) or \(\mu_1 (x)\) matches the \(x\)-endpoint of \(\pi_\mu (e)\); say \(\mu_0 (x)\). Then, define \(A_\mu (x)\) as the set of all vertices from \(\mathcal{D}^{\uparrow}(\mu)\) that have some mincut to \(s\) which keeps \(x\) with \(\mu_0 (x)\) on one side, and \(\mu_1 (x)\) on the other. This set can be found by using \(\mathrm{\small rep}(\mu_0 (x) \cup \{x\}, \mu_1 (x))\) in the representative framework (5). We define \(A_\mu (y)\) and find it in a symmetric fashion. Next, similarly as in the internal case, we find \(\pi_\mu (e)\) as the unique proper path in \(\mathcal{H}_\mu\) that starts with \(\pi_\mu (x)\) and ends with \(\pi_\mu(y)\) (by 6), and for each edge \(g\) in \(\pi_\mu (e)\), we use \(\mathrm{\small rep}(g)\) in the representatives framework to find the set of all vertices from \(\mathcal{D}^{\uparrow}(\mu)\) that separate \(g\).
The analog of 8 from the internal case is the following characterization, showing that the information we have obtained can be used to exactly find those vertices \(u \in \mathcal{D}^{\uparrow}(\mu)\) that have some \(u,s\)-mincut which separates \(x,y\) and splits \(\mu\), which should be reported for Query [query-Q1].
If \(u\) separates a “middle” edge from \(\pi_\mu (e) \setminus (\pi_\mu (x) \cup \pi_\mu (y))\): Report \(u\).
Else, if \(u\) separates an “overlap” edge from \(\pi_\mu (x) \cap \pi_\mu (y)\): Report \(u\) iff \(u \in A_\mu (x) \cap A_\mu (y)\).
Else, if \(u\) separates a “wing” edge from \(\pi_\mu (e) \setminus (\pi_\mu (x) \cap \pi_\mu (y))\): Report \(u\) iff \(u \in A_\mu (x) \cup A_\mu (y)\).
Else, when \(u\) does not separate any edge from \(\pi_\mu (e)\): Do not report \(u\).
The correctness proof of the above characterization is based on delicate structural arguments, relying on sub/posimodularity and carcass properties (using the bridge 4).
The rest of the paper is organized as follows.
We start by introducing the tools required for our oracles. 4 gives some new carcass tools needed for our results, which essentially add some capabilities to its basic interface from 2.1 (the proofs for this section appear in 12). The next 5 gives the details of the representatives framework discussed in 3.3. The following 6 gives the formal “query translation” using the anchors discussed in 3.4.0.3.
After all the needed tools are given, we provide the data structures for Query [query-Q1] and Query [query-Q2] in [sec:splitting-mu] and 8 respectively, which together give the proof of our main 1.
9 then introduces our data structure for queries on the farthest mincut DAG, and combines it with the previous tools to the fast-query oracles of 2 and 3. The insertion variant of 2 appears in 14.
Some straightforward lower bounds are given in 13: (1) \(\Omega(n)\) space is needed even for the fixed-pair setting, and (2) the directed single-source setting needs \(\Omega(n^2)\) space.
This section introduces several new tools regarding the connectivity carcass, which was presented in the Preliminaries (2.1). These are used in a black-box manner by our data structures; we therefore provide only their interfaces here, with the proofs deferred to 12. As in 2.1, the terminal set is denoted by \(S\).
As mentioned in [sec:internal-overview,sec:general-case-overview], we use a mechanism of associated terminal sets for skeleton edges and proper paths. These are defined as follows:
Definition 3 (Associated terminals). We first define the associated terminal sets for skeleton edges. Let \(g = \{a,b\}\) be an edge in \(\mathcal{H}_S\). Then, the associated terminal sets are denoted \(S(a,g)\) and \(S(b,g)\), where \(S(a,g)\) is defined as follows, and \(S(b,g)\) is defined symmetrically:
If \(g\) is a tree-edge: Let \(C\) be the canonical cut defined by \(g\). Then, \(S(a,g)\) are the terminals mapped to the side of \(C\) where \(a\) lies.
If \(g\) is a cycle-edge: Let \(a'\) be the other neighboring node to \(a\) (which is not \(b\)) on the cycle. Let \(C\) be the canonical cut consisting of \(g\) and the cycle edge-adjacent to \(a'\) from the opposite side to \(a\). (Note that \(C\) is indeed a canonical cut because the cycle is of length at least 4.) That is, \(C\) is the unique canonical cut that keeps \(a\) and \(a'\) on one side, and all other nodes from the cycle on the opposite side. Then, \(S(a,g)\) are the terminals mapped to the side of \(C\) where \(a\) and \(a'\) lie.
We extend this definition to proper paths in \(\mathcal{H}_S\) as follows. Let \(P\) be a proper path between nodes \(a\) and \(b\) in \(\mathcal{H}_S\), and let \(g_a\) and \(g_b\) be its edges to \(a\) and to \(b\) respectively (it might be that \(g_a = g_b\)). The associated terminal sets of \(P\) are defined by \(S(a,P) := S(a,g_a)\) and \(S(b,P) := S(b,g_b)\).
We have the following property of associated terminal sets on proper paths:
Lemma 6. Let \(P = (a_0, a_1, \dots, a_k)\) be a proper path in \(\mathcal{H}_S\), and denote its edges by \(g_i = \{a_{i-1},a_i\}\). Then, for every \(1 \leq i \leq k\), it holds that \(S(a_0, g_1) \subseteq S(a_{i-1}, g_i)\) and \(S(a_i, g_i) \supseteq S(a_k, g_k)\).
The main point of 3 is to ensure the correctness of the following 7. The somewhat tedious proof is based on the skeleton properties of 4, the main one being the bijection between canonical cuts and valid partitions.
Lemma 7. Let \(P\) be a proper path in \(\mathcal{H}_S\). The valid partitions of \(S\) that keep the associated terminal sets of \(P\) in different parts correspond precisely to the canonical cuts of \(\mathcal{H}_S\) that contain an edge of \(P\).
Our next tool concerns the process of query translation to the anchors, overviewed in 3.4.0.2. Specifically, it is used to prove that the projections of the anchors \(z_x\) and \(z_y\) form a prefix and suffix of the projection of \(e = \{x,y\}\) in 1. (Here, \(x',y'\) play the roles of \(z_x,z_y\).)
Lemma 8 (Translation). Let \(e = \{x,y\} \in E\) and \(x',y' \in V\) such that:
For every valid partition \(S_1,S_2\) of \(S\), there exists some \(S_1,S_2\)-mincut keeping \(x\) with \(S_1\) and \(y\) with \(S_2\) if and only if there exist some \(S_1,S_2\)-mincut keeping \(x'\) with \(S_1\) and \(y'\) with \(S_2\).
\(\phi_S(x') \neq \phi_S (y')\). Note that given (P1), this is equivalent to \(\phi_S (x) \neq \phi_S (y)\).
Then \(\pi_S (e)\) is defined, and has \(\pi_S (x')\) as a prefix and \(\pi_S (y')\) as a suffix, where \(\pi_S (e)\) in the direction from the \(x\)-endpoint to the \(y\)-endpoint.
We now present some tools pertaining to the skeleton \(\mathcal{H}_S\). The first is an algorithm for computing the union of (marked sides) of canonical cuts, which will be useful for a generalization of the representatives framework (13) that allows us to achieve the (worst-case optimal) \(O(n)\) query time in 1.
Lemma 9. Let \(C_1, \dots, C_\ell\) be canonical cuts in \(\mathcal{H}_S\), where each \(C_j\) has a marked side specified markings on the endpoints of its edges that belong to the marked side. Then one can compute the union of all marked sides within \(O(|S| + \ell)\) time.
Next, we present some data structures for the skeleton. These are not required for our main 1, but needed for the data structures of 2 that support faster queries.
Lemma 10. There is an \(O(|S|)\) space data structure for the skeleton \(\mathcal{H}_S\), supporting the following queries:
(Cut side) Given a canonical cut \(C\) and a node \(a\), return which endpoints of the edges of \(C\) are on the side of \(C\) that contains \(a\). The query takes \(O(1)\) time.
(Order on proper path) Given \(k\) nodes \(a_1, \dots, a_k\) which are promised to all lie on a proper path, return the order of appearance of \(a_1, \dots, a_k\) on the unique minimal proper path containing them (in an arbitrary direction). The query takes \(O(k \log k)\) time.
(Terminals in intersection) Given \(k\) canonical cuts \(C_1, \dots, C_k\), where each \(C_i\) has a distinguished marked side specified by marking which endpoints of the edges in \(C_i\) belong to it, return the subset \(S'\) of the terminals \(S\) containing every \(x \in S\) which is mapped to the marked side of every cut from \(C_1, \dots, C_k\). The query takes \(O(|S'| + k^2)\) time.
Lemma 11. Suppose each proper path \(P\) in \(\mathcal{H}_S\) has some \(O(1)\) information \(I(P)\) associated with it. Then, there an \(O(|S| \log |S|)\) space data structure that supports the following queries: Given the two endpoints of a proper path \(P\), return a partition of \(P\) into \(\ell = O(\log |S|)\) subpaths \(P_1, \dots, P_\ell\) (where each subpath is specified by its endpoints), along with the information \(I(P_1), \dots ,I(P_\ell)\). The query takes \(O(\log |S|)\) time.
The following 12 is a technical lemma that assigns numbers to vertices, helping us deal with certain “directionality properties” of projections in certain corner cases. We use it in [sec:splitting-mu]. Specifically, our use-case is (roughly) as follows: if edge \(e = \{x,y\}\) has its projection \(\pi_S (e)\) equal to both \(\pi_S (x)\) and \(\pi_S (y)\), we can use the numbers assigned to \(x\) and \(y\) in order to determine the \(x\)-endpoint and the \(y\)-endpoint of \(\pi_S (e)\). This lemma is not new: it has appeared before in [4], [9], but was stated using carcass terminologies which we bypass in this paper. Thus, we give an explicit statement and provide a proof that assumes only the carcass preliminaries of 2.1.
Lemma 12. There exists a numbering \(\sigma_S : V \to [n]\) such that the following hold. Let \(P\) be a proper path in \(\mathcal{H}_S\) whose endpoints are \(a\) and \(b\), where node \(a\) has smaller identifier than node \(b\) in \(\mathcal{H}_S\). Let \(z_1, z_2 \in V\) such that \(\phi_S (z_1) \neq \phi_S (z_2)\), but they both have \(P\) as their projection, i.e., \(\pi_S (z_1) = \pi_S (z_2) = P\). Then:
It holds that \(\sigma_S (z_1) \neq \sigma_S (z_2)\).
If \(\sigma_S (z_1) < \sigma_S (z_2)\), then there exists some \(S\)-mincut \(W\) with \(z_1 \in W\), \(z_2 \in \overline{W}\) and a canonical cut of \(\mathcal{H}_S\) that keeps node \(a\) with \(S \cap W\) on one side, and node \(b\) with \(S \setminus W\) on the other side.
In this section, we give the details of the representative framework, which was overviewed in 3.3. The framework associates \(O(1)\) representative information with any unordered pair \(P,Q\) of non-empty vertex subsets, in such a manner that guarantees the following (which is generalized version of 5):
Lemma 13. There is an \(O(n)\) space data structure with the following property: Given \(\{\mathrm{\small rep}(P_i,Q_i)\}_{i=1}^\ell\) for \(\ell\) pairs of non-empty vertex subsets \(P_i, Q_i \subseteq V\), and given a node \(\mu\) of \(\mathcal{D}\) such that \(P_i \cup Q_i \subseteq \mathcal{D}_{\downarrow}(\mu)\) for each \(i=1,\dots,\ell\), it reports within \(O(n + \ell)\) time those vertices in \(\mathcal{D}^{\uparrow}(\mu)\) that separate some pair \(P_i, Q_i\), namely \(\{u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{exists 1 \leq i \leq \ell and u,s-mincut U` keeping P_i and Q_i on different sides}\}\).
Recall that vertex \(u\) is said to separate \(P,Q\) if there exists a \(u,s\)-mincut which keeps \(P\) on one side and \(Q\) on the other. We will also need an ordered version of this terminology: we say that \(u\) separates \((P,Q)\) if there exists a \((u,s)\)-minuct \(U\) such that \(P \subseteq U\) and \(Q \subseteq \overline{U}\). Thus, \(u\) separates \(P,Q\) iff \(u\) separates \((P,Q)\) or \(u\) separates \((Q,P)\).
In order to prove 13, we first need to define \(\mathrm{\small rep}(P,Q)\). In fact, each ordered pair \((P,Q)\) or \((Q,P)\) has its own representative information, and \(\mathrm{\small rep}(P,Q)\) consists of the information for both; we arbitrarily focus on \((P,Q)\). The first ingredient is the representative nodes, defined in the following lemma.
Lemma 14. We can find at most two representative nodes for \((P,Q)\) in \(\mathcal{D}\), such that:
Each representative node contains some vertex separating \((P,Q)\).
Every node that contains a vertex separating \((P,Q)\) is a descendant of some representative node.
Proof. It suffices to show that among any three nodes that contain some vertex separating \((P,Q)\), at least two must be related by ancestry: indeed, this immediately means that among them we can find at most two “highest ones” which are ancestors of all the others. By 3, in order to prove this, it is enough if we can find a vertex \(p\) such that \(p \in \mathcal{D}_{\downarrow}(\nu)\) for every \(\nu\) that contains some vertex \(u\) separating \((P,Q)\). To this end, we can take any arbitrary \(p \in P\): indeed, as \(u\) separates \((P,Q)\), in particular there is a \((u,s)\)-mincut \(U\) such that \(P \subseteq U\), and hence \(p \in U \subseteq \mathsf{Far}(u,s) = \mathcal{D}_{\downarrow}(\nu)\). ◻

Figure 1: Let \(W\) be a \(w,s\)-mincut, \(U\) with color green, and \(U\) with color blue be the farthest mincuts for vertices from nodes green and blue, respectively. Edge \(\{x,y\}\) belongs to the graph for which \(\mu\in \mathrm{LCA}(x,y)\) in \(\mathcal{D}\). Each node of the DAG contains a Skeleton..
One may hope for the following “converse to 14”: if \(\mathcal{D}(u)\) has some representative node for \((P,Q)\) as an ancestor, then \(u\) should separate \((P,Q)\). While this fails, we next prove an “almost-converse”; the caveats are in conditions (ii) and (iii), and in the conclusion of separating the unordered \(P,Q\).
Lemma 15. Let \(u \in V \setminus \{s\}\) such that the following hold:
Some representative node \(\nu\) for \((P,Q)\) is an ancestor of \(\mathcal{D}(u)\).
\(\nu \neq \mathcal{D}(u)\). (So by (i), \(\nu\) is a strict ancestor of \(\mathcal{D}(u)\).)
\(P \cup Q \subseteq \mathcal{D}_{\downarrow}(u)\).
Then \(u\) separates the unordered pair \(P,Q\).
Proof. We refer to 1 for an illustration of the proof. By 14, the representative node \(\nu\) contains some vertex \(w\) that separates \((P,Q)\). Let \(W\) be a \((w,s)\)-mincut with \(P \subseteq W\), \(Q \subseteq \overline{W}\). Denote \(U := \mathcal{D}_{\downarrow}(u) = \mathsf{Far}(u,s)\). As \(\nu\) is a strict ancestor of \(\mathcal{D}(u)\) by (i) and (ii), we get that \(w \notin U\). Also, \(P, Q \subseteq U\) by (iii). We split into cases:
If \(u \in W\), then \(U \cap W\) is a \((u,s)\)-cut and \(U \cup W\) is a \((w,s)\)-cut. So by submodularity (1), \(U \cap W\) is a \((u,s)\)-mincut, where \(P \subseteq U \cap W\) and \(Q \subseteq \overline{U \cap W}\).
If \(u \notin W\), then \(U \setminus W\) is a \((u,s)\)-cut and \(W \setminus U\) is a \((w,s)\)-cut. So by posimodularity (1), \(U \setminus W\) is a \((u,s)\)-mincut, where \(Q \subseteq U \setminus W\) and \(P \subseteq \overline{U \setminus W}\).
So in the first case \(u\) separates \((P,Q)\), and in the second it separates \((Q,P)\). ◻
Let us now focus on characterizing which vertices inside the representative nodes separate \((P,Q)\); these are not treated by 15 because of condition (ii). While a representative node \(\nu\) must contain some vertex separating \((P,Q)\), it may also contain vertices that do not separate \((P,Q)\), or even that do not separate \(P,Q\). The second ingredient of the representative information consists of canonical cuts of the skeleton \(\mathcal{H}_\nu\), that precisely characterize which vertices inside \(\nu\) separate \((P,Q)\). These are called the representative cuts, defined in the following lemma:
Lemma 16. Let \(\nu\) be a representative node for \((P,Q)\). There exists at most two representative cuts of the skeleton \(\mathcal{H}_\nu\) with the following properties:
Each representative cut is either a canonical cut in the skeleton \(\mathcal{H}_\nu\), or a degenerate cut with one side containing all of \(\mathcal{H}_\nu\). Further, the representative cut has a marked side.
For every \(u \in \nu\), the following holds: \(u\) separates \((P,Q)\) if and only if \(u\) is mapped to the marked side of some representative cut in \(\mathcal{H}_\nu\).
Proof. For a vertex \(u\) separating \((P,Q)\), let \(\mathsf{Far}(u,s \mid P,Q)\) denote the unique \((u,s)\)-minuct which keeps \(P\) inside (on the side of \(u\)), keeps \(Q\) outside (on the side of \(s\)), and contains every other \(u,s\)-mincut with these properties. \(\mathsf{Far}(u,s \mid P,Q)\) is well defined due to submodularity (it is the union of all \((u,s)\)-mincuts keeping \(P\) inside and \(Q\) outside). The crux of the proof is showing there exists at most two vertices \(u_1, u_2 \in \nu\) such that, for any \(u \in \nu\), it holds that \(u\) separates \((P,Q)\) if and only if \(u \in \mathsf{Far}(u_i, s \mid P,Q)\) for some \(i \in \{1,2\}\).
Before we show this, let us explain how this yields the required representative cuts by using 4. Denote \(U_i := \mathsf{Far}(u_i, s \mid P,Q)\). If \(\nu\) is not contained in \(U_i\), then 4 ensures that \(\nu \cap U_i, \nu \cap \overline{U_i}\) is a valid partition of \(\nu\). Hence, by 4 we can take the representative cut as the canonical cut \(C_i\) of the skeleton \(\mathcal{H}_\nu\) corresponding to this valid partition, with its marked side being the side of \(\nu \cap U_i\). In case \(\nu\) is contained in \(U_i\), we can just take \(C_i\) as the degenerate cut whose marked side is all of \(\nu\). Thus, for any \(u \in \nu\), it holds that \(u \in U_i\) iff \(u\) is mapped to the marked side of \(C_i\).
We now show the existence of \(u_1,u_2\) with the required properties. We choose them by the following procedure. First, we just take \(u_1\) as some arbitrary vertex from \(\nu\) which separates \((P,Q)\). Next, we choose any \(u_2 \in \nu \setminus \mathsf{Far}(u_1, s \mid P,Q)\) which separates \((P,Q)\) (and if there is no such \(u_2\), we take just \(u_1\) and \(u_2\) is undefined). Denote \(U_i = \mathsf{Far}(u_i, s \mid P,Q)\) for \(i \in \{1,2\}\). So, to conclude the proof, we need to show that for any \(u_3 \in \nu\), it holds that \(u_3\) separates \((P,Q)\) iff \(u_3 \in U_1 \cup U_2\).
(\(\Leftarrow\)) Suppose \(u_3 \in U_i\) for some \(i \in \{1,2\}\). Note that \(\mathsf{Far}(u_3, s) = \mathcal{D}_{\downarrow}(\nu) = \mathsf{Far}(u_i, s)\), so the mincut values of \(u_3\) and \(u_i\) to \(s\) are equal. Thus, \(U_i\) itself is a \((u_3,s)\)-mincut which keeps \(P\) inside and \(Q\) outside.
(\(\Rightarrow\)) Seeking contradiction, say \(u_3\) separates \((P,Q)\) but \(u_3 \notin U_1 \cup U_2\). Denote \(U_3 := \mathsf{Far}(u_3, s \mid P,Q)\). By our process for choosing \(u_1\) and \(u_2\), we get that for any two distinct indices \(i,j \in \{1,2,3\}\), either \(u_i \notin U_j\) or \(u_j \notin U_i\). We next derive the contradiction by showing there must be two different indices \(i,j\) such that \(u_i \in U_j\) and \(u_j \in U_i\). Since \(\emptyset \neq P \subseteq U_1 \cap U_2 \cap U_3\), by 2 there must be two different indices \(i,j \in \{1,2,3\}\) such that \(u_i \in U_j\), so it remains to show that \(u_j \in U_i\). Observe that \(U_i \cap U_j\) is a \((u_i,s)\)-cut, and \(U_i \cup U_j\) is a \((u_j,s)\)-cut. So, by submodularity (1), \(U_i \cup U_j\) is a \((u_j,s)\)-cut. But, as \(\mathsf{Far}(u_i,s) = \mathcal{D}_{\downarrow}(\nu) = \mathsf{Far}(u_j,s)\), \(u_i\) and \(u_j\) have the same mincut value to \(s\). Thus, \(U_i \cup U_j\) must also be a \((u_i,s)\)-mincut. Note that \(P \subseteq U_i \cup U_j\) and \(Q \subseteq \overline{U_i \cup U_j}\), so we get \(U_i \cup U_j \subseteq \mathsf{Far}(u_i, s \mid P,Q) = U_i\), meaning that \(U_j \subseteq U_i\), hence \(u_j \in U_i\), and so we have reached the desired contradiction. ◻
Crucially, each (non-degenerate) representative cut is a canonical cut in its skeleton, which is represented just by its one or two skeleton edges with markings on their endpoints from the marked side (for example, the cut defined by two purple cycle-edges in the Skeleton in 1).
We can now finally define \(\mathrm{\small rep}(P,Q)\) and prove 13.
Definition 4. For two non-empty sets \(P,Q \subseteq V\), the representative information \(\mathrm{\small rep}(P,Q)\) consists of the representative nodes and cuts for \((P,Q)\) and for \((Q,P)\), given by 14 and 16. If there are no vertices that separate \(P,Q\), then we just define \(\mathrm{\small rep}(P,Q)\) to be a null value indicating this situation.
Proof (of 13). Let \(\nu_1, \dots, \nu_r\) be all the representative nodes that are stored in some \(\mathrm{\small rep}(P_i, Q_i)\). By 14, every vertex that separates some pair \(P_i, Q_i\) must lie in a descendant of some \(\nu_j\). To identify these, we execute multi-source BFS (breadth first search) from \(\nu_1, \dots, \nu_r\) in \(\mathcal{D}\), which takes \(O(n)\) time. During the BFS, we also determine which nodes are strict descendants of at least one \(\nu_j\): when we scan an edge \((\omega, \nu)\), we mark that \(\nu\) is such a strict descendant. This is because the BFS has already found some path from some \(\nu_j\) to \(\omega\), so \(\nu_j\) is an ancestor of \(\nu\), and \(\nu_j \neq \nu\) because \(\mathcal{D}\) has no cycles. (It could be that \(\nu\) is itself one of the sources, and we still mark it.) Next, we run a reverse-BFS from \(\mu\) to find all its ancestors, and determine which of them are also strict descendants of some \(\nu_j\). By 15, every vertex in one of these nodes separates some \(P_i, Q_i\).
The remaining vertices to consider are those that lie inside the representative nodes \(\nu_1, \dots, \nu_r\), or more precisely, inside nodes \(\nu_j\) such that \(\nu_j\) is an ancestor of \(\mu\) but not a strict descendant of any other \(\nu_{k}\). Suppose all of \(\nu_1, \dots, \nu_r\) fulfill these conditions (otherwise, we remove those that do not). Let us first focus on a specific \(\nu_j\). Note that \(\nu_j\) could be a representative node for many different pairs \(P_i, Q_i\), hence there could be many representative cuts corresponding to \(\nu_j\) originating from different \(\mathrm{\small rep}(P_i,Q_i)\); denote these cuts by \(C_1, \dots, C_{\ell_j}\). By 16, the vertices in \(\nu_j\) which separate some pair \(P_i, Q_i\) are exactly those vertices mapped to a marked side of at least one of \(C_1, \dots, C_{\ell_j}\) in the skeleton \(\mathcal{H}_{\nu_j}\). Thus, to treat \(\nu_j\), we just need to compute the union of the marked sides of \(C_1, \dots, C_{\ell_j}\), which takes \(O(|\nu_j| + \ell_j)\) time by 9. Thus, the overall time spent to treat vertices inside representative nodes is \(\sum_{i=j}^r O(|\nu_j| + \ell_j)\). As the nodes of \(\mathcal{D}\) partition \(V\), we have \(\sum_j |\nu_j| = O(n)\). Also, each of the \(\ell\) pairs \(P_i, Q_i\) gives rise to only \(O(1)\) representative cuts over all the representative nodes, we have that \(\sum_j \ell_j = O(\ell)\). Thus, the total running time is \(O(n + \ell)\). ◻
In this section, we formally prove the useful properties of the anchors used for the query translation process, overviewed in 3.4.0.3. We first restate the definition of pivots and anchors:
The following lemma formalizes the essential equivalence between the endpoints \(x,y\) of the failing edge, and their anchors \(z_x, z_y\) with respect to an LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\).

Figure 2: The figures shows two possible cases – a \(u,s\)-mincut separating \(z_x,z_y\) that contains both \(x,y\) or contains none of \(x\) and \(y\). The proof of Item 2 in 17 shows that using sub/posimodularity with the farthest \(z_x,s\)-mincut and \(z_y,s\)-mincut, one can find another \(u,s\)-mincut separating \(x,y\) having the same intersection with \(\mu\)..
Lemma 17. Let \(e = \{x,y\} \in E\), and let node \(\mu\) be an LCA of \(\mathcal{D}(x),\mathcal{D}(y)\). Let \(z_x\) and \(z_y\) be the anchors of \(x\) and of \(y\) w.r.t.\(\mu\). Then for every \(u \in \mathcal{D}^{\uparrow}(\mu)\), the following hold:
If \(U\) is a \(u,s\)-mincut with \(x \in U\) and \(y \notin U\), then \(z_x \in U\) and \(z_y \notin U\).
If \(U\) is a \(u,s\)-mincut with \(z_x \in U\) and \(z_y \notin U\), then there exists another \(u,s\)-mincut \(U'\), such that the following hold: (i) \(x \in U'\) and \(y \notin U'\), (ii) \(U' \cap \mu = U \cap \mu\), and (iii) \(u \in U'\) iff \(u \in U\).
Proof. The crux is exploring the relationship of the given \(U\) with \(Z_x := \mathcal{D}_{\downarrow}(z_x)\) and \(Z_y := \mathcal{D}_{\downarrow}(z_y)\), which are (the farthest) \((z_x,s)\)-mincut and \((z_y,s)\)-mincut, by using sub/posimodularity. We first highlight some key properties of \(Z_x\) (and symmetrically, of \(Z_y\)). Suppose \(z_x \neq x\). Then by [def:32anchors], \(\mathcal{D}(z_x)\) is a child of \(\mu\) and an ancestor of \(\mathcal{D}(x)\). Because \(\mu\) is an LCA, this means that \(\mathcal{D}(z_x)\) is not an ancestor of \(\mathcal{D}(y)\), and hence it also cannot be an ancestor of \(\mathcal{D}(z_y)\) (as \(\mathcal{D}(z_y)\) is an ancestor of \(\mathcal{D}(y)\) by [def:32anchors]). Also, because it is assumed that \(\mathcal{D}(u)\) is an ancestor of \(\mu\), \(\mathcal{D}(u)\) cannot be a descendant of \(\mathcal{D}(z_x)\). These conclusions can be summarized as follows: \[\begin{align} z_x \neq x & \quad \implies \quad x \in Z_x \quad \text{and} \quad u,y,z_y \notin Z_x \quad \text{and} \quad \mu \cap Z_x = \emptyset, \tag{1} \\ z_y \neq y & \quad \implies \quad y \in Z_y \quad \text{and} \quad u,x,z_x \notin Z_y \quad \text{and} \quad \mu \cap Z_y = \emptyset. \tag{2} \end{align}\] We are now ready to prove the two items of the lemma.
Item 1. Let \(U\) be a \(u,s\)-mincut with \(x \in U\), \(y \notin U\). We show that \(z_x \in U\) and that \(z_y \notin U\) by similar arguments, using posimodularity and submodularity, respectively.
Seeking contradiction, suppose \(z_x \notin U\). Then in particular \(z_x \neq x\), so 1 applies. Note that \(U \setminus Z_x\) is a \(u,s\)-cut because \(|U \cap \{u,s\}| = 1\) and \(u,s \notin Z_x\). Also, \(Z_x \setminus U\) is a \(z_x,s\)-cut. Hence, by posimodularity (1), there cannot be an edge between \(U \cap Z_x\) and \(\overline{U \cup Z_x}\). But \(x \in U \cap Z_x\) and \(y \in \overline{U \cup Z_x}\), so \(e\) is such an edge — contradiction.
Seeking contradiction, suppose \(z_y \in U\). Then in particular \(z_y \neq y\), so 2 applies. Note that \(U \cup Z_y\) is a \(u,s\)-cut because \(|U \cap \{u,s\}| = 1\) and \(u,s \notin Z_y\). Also, \(U \cap Z_y\) is a \(z_y,s\)-cut. Hence, by submodularity (1), there cannot be an edge between \(U \setminus Z_y\) and \(Z_y \setminus U\). But \(x \in U \setminus Z_y\) and \(y \in Z_y \setminus U\), so \(e\) is such an edge — contradiction.
Item 2. Let \(U\) be a \(u,s\)-minuct with \(z_x \in U\), \(z_y \notin \tilde{U}\). We construct the desired \(U'\) in two steps, starting with \(U_0 := U\). In the first step, we find an intermediate cut \(U_1\), ensuring that \(x \in U_1\). In the second, we find the final cut \(U_2 = U'\), which additionally ensures that \(y \notin U_2\). See 2.
First Step: If \(z_x = x\) take \(U_1 = U_0\), otherwise \(U_1 = U_0 \cup Z_x\). We claim that \(U_1\) is a \(u,s\)-mincut:
If \(z_x = x\), this is trivial.
If \(z_x \neq x\) then 1 applies. Note that \(U_0 \cup Z_x\) is a \(u,s\)-cut because \(|U_0 \cap \{u,s\} | = 1\) and \(u,s \notin Z_x\). Also, \(U_0 \cap Z_x\) is a \(z_x,s\)-cut. So the claim follows by submodularity (1).
Observe that (a) \(x \in U_1\), \(z_y \notin U_1\), (b) \(\mu \cap U_1 = \mu \cap U_0\), and (c) \(u \in U_1\) iff \(u \in U_0\). Indeed, this is trivial if \(z_x = x\), and otherwise this is by 1 .
Second Step: If \(z_x = x\) take \(U_2 = U_1\), otherwise \(U_2 = U_1 \setminus Z_y\). We claim that \(U_2\) is a \(u,s\)-mincut:
If \(z_y = y\), this is clear by the previous step.
If \(z_y \neq y\), then 2 applies. Note that \(U_1 \setminus Z_y\) is a \(u,s\)-cut because \(|U_1 \cap \{u,s\}|=1\) and \(u,s \notin Z_y\). Also, \(Z_y \setminus U_1\) is a \(z_y,s\)-cut (as \(z_y \notin U_1\) by the first step). So the claim follows by posimodularity (1).
Finally, we observe that (i), (ii) and (iii) for \(U_2\) hold, because their counterpart properties (a), (b) and (c) hold for \(U_1\). Indeed, this is trivial if \(z_y = y\), and otherwise this follow immediately by 2 .
◻

Figure 3: Vertices \(z_x\) and \(z_y\) are the anchors of \(x\) and \(y\) respectively for \(\mu\in \mathrm{LCA}(x,y)\). The projection of \(\pi_\mu(z_x)\) (resp., \(\pi_\mu(z_y)\)) is represented by the green (resp., purple) polyline on the skeleton inside node \(\mu\). 1 shows that they form a prefix and suffix of the edge projection \(\pi_\mu (e)\), where \(e = \{x,y\}\)..
Finally, as explained in 3.4.0.3, the projections of the anchors in the skeleton of the LCA \(\mu\) play a crucial role, as they enable us to find the projection of the edge \(e\). This is obtained by 1, which is derived from the equivalence of anchors in 17 and our carcass translation lemma (8); see 3.
Corollary 1. Let \(e = \{x,y\} \in E\), and let node \(\mu\) be an LCA of \(\mathcal{D}(x),\mathcal{D}(y)\). Let \(z_x\) and \(z_y\) be the anchors of \(x\) and of \(y\) w.r.t.\(\mu\). Suppose that the following conditions hold:
\(c(\mathcal{D}_{\downarrow}(\mu)) = \lambda_\mu\).
\(\phi_\mu (z_x) \neq \phi_\mu (z_y)\). That is, \(z_x,z_y\) are not \(\mu\)-equivalent.
Then the projection path \(\pi_\mu(e)\) is defined, and it has \(\pi_\mu (z_x)\) as a prefix and \(\pi_\mu (z_y)\) as a suffix, where \(\pi_\mu (e)\) is considered in the direction from its \(x\)-endpoint to its \(y\)-endpoint.
Proof. This follows by 8 with \(S = \mu\), \(x' = z_x\), \(y' = z_y\), once we show that [prop:P1] and [prop:P2] hold. [prop:P2] is just (ii). For [prop:P1], let \(S_1,S_2\) be a valid partition of \(\mu\). We should show: there is an \((S_1,S_2)\)-mincut \(U\) with \(z_x \in U\), \(z_y \notin U\) iff there is an \((S_1,S_2)\)-mincut \(U'\) with \(x \in U'\), \(y \notin U'\).
First, suppose \(U'\) exists. Take any \(u \in \mu\) lying in the opposite side to \(s\) of the cut \(U'\). Then \(U'\) is a \(u,s\)-cut, and because \(\mathcal{D}_{\downarrow}(\mu) = \mathsf{Far}(u,s)\), by (i) it is in fact a \(u,s\)-mincut. Thus, by 17(1), \(z_x \in U'\) and \(z_y \notin U'\), so we just take \(U = U'\). Now, suppose \(U\) exists. Then \(U\) must be a \(u,s\)-mincut for some \(u \in \mu\) by a similar argument as in previous direction. Thus, by 17(2), there is a \(u,s\)-mincut \(U'\) with \(x \in U'\), \(y \notin U'\), and \(U' \cap \mu = U \cap \mu\). The last condition means that the \(u,s\)-mincut \(U'\) is also \((S_1, S_2)\)-cut, but by (i) this means \(U'\) is \((S_1,S_2)\)-mincut, as needed. ◻
This section provides the data structure for Query [query-Q1], restated below; See the overview in 3.4.0.2.
Note that by the equivalence of \(x,y\) to their anchors \(z_x,z_y\) w.r.t.\(\mu\) from 17, the condition in Query [query-Q1] is equivalent to “some \(u,s\)-mincut separates \(z_x,z_y\) and splits \(\mu\)”; this new condition would be the one that we will use. Our goal in this section is to show:
Lemma 18. There is a data structure for Query [query-Q1] with \(O(n)\) space and \(O(n)\) query time.
Our first step is to formally define the \(A_\mu (\cdot)\) sets, which are crucial to our query algorithm, as mentioned in the overview (3.4.0.2).
Definition 5. Let \(\mu\) be a node in \(\mathcal{D}\), and let \(z \in V\) be a stretched vertex w.r.t.\(\mu\). Let \(a_0 (z)\) and \(a_1 (z)\) be the endpoints of the projection path \(\pi_\mu (z)\) in \(\mathcal{H}_\mu\), where \(a_0\) has smaller identifier than \(a_1\). Let \(g_0 (z), g_1 (z)\) be the edges of \(\pi_\mu (z)\) incident to \(a_0, a_1\) respectively. Let \(\mu_0 (z) := \mu(a_0 (z), g_0 (z))\) and \(\mu_1 (z) := \mu(a_1 (z), g_1 (z))\) as defined in 3. We then define: \[\begin{align} A_\mu^{(0)} (z) &:= \{ u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates \mu_0 (z) \cup \{z\}, \mu_1 (z)} \}, \\ A_\mu^{(1)} (z) &:= \{ u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates \mu_0 (z), \mu_1 (z) \cup \{z\}} \}. \end{align}\]
We now formally describe the information stored by our data structure for Query [query-Q1].
First, we store the \(O(n)\) global data structure for the representative framework of 13, which consists of the DAG \(\mathcal{D}\) and the skeletons \(\mathcal{H}_\mu\) for each node \(\mu\) of \(\mathcal{D}\). We augment each skeleton edge \(g = \{a,b\}\) in \(\mathcal{H}_\mu\) with its \(O(1)\) representative information \(\mathrm{\small rep}(g) := \mathrm{\small rep}(\mu(a,g),\mu(b,g))\) (see 3 for the definition of \(\mu(a,g)\), and \(\mu(b,g)\)).
Next, for each node \(\mu\) in \(\mathcal{D}(\mu)\), we store the values \(\lambda_\mu\) and \(c(\mathcal{D}_{\downarrow}(\mu))\), and the following \(O(1)\) information for every \(z \in \{z_\nu \mid \text{\nu child of \mu}\} \cup \mu\), consumes a total of \(O(|\mu| + \operatorname{outdeg}_\mathcal{D}(\mu))\) space for \(\mu\):
The \(\mu\)-equivalence class number \(\phi_\mu (z)\), and the \(\sigma_\mu (z)\) number of 12.
The endpoints \(a_0 (z)\) and \(a_1 (z)\) of the projection \(\pi_\mu (z)\) (see 5). Note that these endpoints are distinct if \(z\) is stretched, and equal otherwise.
The representative information for \(A_\mu^{(0)}(z)\) and to \(A_\mu^{(1)}(z)\), namely \(\mathrm{\small rep}(\mu_0(z) \cup \{z\}, \mu_1 (z))\) and \(\mathrm{\small rep}(\mu_0(z), \mu_1(z) \cup \{z\})\). These are defined only if \(z\) is stretched (see 5).
As the nodes of \(\mathcal{D}\) partition the vertices in \(V\), and because \(\sum_\mu \operatorname{outdeg}_\mathcal{D}(\mu)\) counts each of the \(O(n)\) edges of \(\mathcal{D}\) exactly once, the total space occupied by the data structure is \(O(n)\).

Figure 4: Partitioning the edges of \(\pi_\mu(e)\) into four subpaths for answering queries..
We now give the algorithm to answer Query [query-Q1], given edge \(e = \{x,y\} \in E\) and LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\).
Find the anchors \(z_x,z_y\) of \(x,y\) w.r.t.\(\mu\), which takes \(O(n)\) time by searching \(\mathcal{D}\). Note that by their definition ([def:32anchors]), \(z_x,z_y \in \{z_\nu \mid \text{\nu child of \mu}\} \cup \mu\) .
If \(\lambda_\mu \neq c(\mathcal{D}_{\downarrow}(\mu))\) or \(\phi_\mu (z_x) = \phi_\mu (z_y)\): Halt without reporting any vertex.
Use the stored endpoints of \(\pi_\mu (z_x)\) and \(\pi_\mu (z_y)\) as the unique proper paths between their endpoints (or, if \(z_x\) and/or \(z_y\) are non-stretched, the projections are nodes) in \(\mathcal{H}_\mu\). Next, compute \(\pi_\mu (e)\) as the unique proper path that starts with \(\pi_\mu (z_x)\) and ends with \(\pi_\mu (z_y)\); this path indeed exists and is equal to \(\pi_\mu (e)\) by 1, since we did not halt in Step 1. These computations on \(\mathcal{H}_\mu\) take \(O(|\mu|) \leq O(n)\) time, and let us to determine the edges in each of the following subpaths of \(\pi_\mu (e)\) (see 4):
middle part \(\pi_\mu (e) \setminus (\pi_\mu (z_x) \cup \pi_\mu (z_y))\),
overlap \(\pi_\mu (z_x) \cap \pi_\mu (z_y)\),
prefix \(\pi_\mu (z_x) \setminus \pi_\mu (z_y)\),
suffix \(\pi_\mu (z_y) \setminus \pi_\mu (z_x)\).
For each \(P\) among (i)-(iv), find the set \(\{ u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates some edge g of P}\}\) by applying the representative framework from 13 with \(\{\mathrm{\small rep}(g)\}_{g \in P}\). As \(P\) has at most \(O(|\mu|) \leq O(n)\) edges, this takes \(O(n)\) time by 13.
Determine the \(x\)-endpoint \(a_x\) and the \(y\)-endpoint \(a_y\) of \(\pi_\mu (e)\), and hence also the edges \(g_x\) and \(g_y\) of \(\pi_\mu(e)\) adjacent to \(a_x\) and to \(a_y\) respectively (where possibly \(g_x = g_y\)), as follows.
If \(\pi_\mu (z_x) \neq \pi_\mu (y)\), then either the \(x\)-endpoint lies uniquely on the prefix (iii), or the \(y\)-endpoint lies uniquely on the suffix (iv), so we are done.
If \(\pi_\mu (z_x) = \pi_\mu (y)\), then compare \(\sigma_\mu (z_x)\) and \(\sigma_\mu (z_y)\). If \(\sigma_\mu (z_x) < \sigma_\mu (z_y)\), then the \(x\)-endpoint of \(\pi_\mu (e)\) is the one with smaller identifier; otherwise it is the one with larger identifier. The correctness of this step is proved in 20.
If \(z_x\) is stretched, let \(i \in \{0,1\}\) be such that \(a_x = a_i (z_x)\), and use \(\mathrm{\small rep}(\mu_i (z_x) \cup \{x\}, \mu_{1-i} (z_x))\) with the representative framework of 13 to compute \(A_\mu (z_x) := A_\mu^{(i)} (z_x)\) within \(O(n)\) time. If \(z_x\) is non-stretched, let \(A_\mu (z_x) := \emptyset\). Similarly, if \(z_y\) is stretched, let \(j \in \{0,1\}\) be such that \(a_y = a_j (z_y)\), and compute \(A_\mu (z_y) := A_\mu^{(j)}(z_y)\) is a similar fashion, and if \(z_y\) is non-stretched then \(A_\mu (z_y) := \emptyset\). This takes \(O(n)\) time by 13.
Find all vertices \(u \in \mathcal{D}^{\uparrow}(\mu)\) within \(O(n)\) time by searching \(\mathcal{D}\). Then, for each \(u \in \mathcal{D}^{\uparrow}(\mu)\), decide within \(O(1)\) time whether to report \(u\) as part of the output for Query [query-Q1] as follows:
If \(u\) separates an edge of the middle part (i): Report \(u\).
Else, if \(u\) separates an edge of the overlap (ii): Report \(u\) iff \(u \in A_\mu (z_x) \cap A_\mu (z_y)\).
Else, if \(u\) separates an edge of the prefix (iii) or the suffix (iv): Report \(u\) iff \(u \in A_\mu (z_x) \cup A_\mu (z_y)\).
Else: Do not report \(u\).
Thus, our data structure answers Query [query-Q1] within \(O(n)\) time.
We first need to prove that Step 1 is correct:
Lemma 19. If \(\lambda_\mu \neq c(\mathcal{D}_{\downarrow}(\mu))\) or \(\phi_\mu (z_x) = \phi_\mu (z_y)\), then for every vertex \(u\), there is no \(u,s\)-mincut that splits \(\mu\) and separates \(z_x,z_y\).
Proof. Suppose there is such a \(u,s\)-mincut \(U\). Without loss of generality, say \(u \in U\). Then, by 4, \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut, and we have that \(\lambda_\mu = c(\mathcal{D}_{\downarrow}(\mu))\). We also see that \(\phi_\mu (z_x) \neq \phi_\mu (z_y)\), i.e. that \(z_x, z_y\) are separated by some \(\mu\)-mincut: Indeed, as \(z_x,z_y\) both belong to \(\mathcal{D}_{\downarrow}(\mu)\) and are separated by \(U\), they are also separated by \(W\). ◻
So, for the rest of the correctness proof (i.e., in all of the following lemmas), we will implicitly assume that the query algorithm did not stop in Step 1, i.e., that \(\lambda_\mu = c(\mathcal{D}_{\downarrow}(\mu))\) and \(\phi_\mu (z_x) \neq \phi_\mu (z_y)\). Thus, 1 is assumed to apply: \(\pi_\mu(e)\) is defined, and has \(\pi_\mu (z_x)\) as a prefix and \(\pi_\mu (z_y)\) as a suffix in the direction from the \(x\)-endpoint \(a_x\) to its \(y\)-endpoint \(a_y\). Next, we need to prove that Step 3 correctly identifies the \(x\)-endpoint and the \(y\)-endpoint. This is clear in case \(\pi_\mu (z_x) \neq \pi_\mu (z_y)\). For the other case, this is due to the properties of the \(\sigma_\mu (\cdot)\) numbers from 12:
Lemma 20. Suppose \(\pi_\mu (z_x) = \pi_\mu (z_y)\). Then, the \(x\)-endpoint of \(\pi_\mu (e)\) is the one with smaller identifier if and only if \(\sigma_\mu (z_x) < \sigma_\mu (z_y)\).
Proof. (\(\Leftarrow\)) By 12, there is a \(\mu\)-mincut \(W\) with \(z_x \in W\), \(z_y \notin \overline{W}\) and a canonical cut \(C\) of \(\mathcal{H}_\mu\) which keeps the endpoint of smaller identifier with \(\mu \cap W\) and the one with larger identifier with \(\mu \cap \overline{W}\). Choose any vertex \(w \in \mu\) from the side without \(s\) of the cut \(W\). Then \(c(W) = \lambda_\mu = c(\mathcal{D}_{\downarrow}(\mu)) = c(\mathsf{Far}(w,s))\), so \(W\) is a \(w,s\)-mincut. By 17, there exists some \(w,s\)-mincut \(W'\) such that \(x \in W'\), \(y \in \overline{W'}\) and \(W' \cap \mu = W \cap \mu\). Thus, \(W'\) is a \(\mu\)-mincut inducing the same valid partition as \(W\), and \(e\) contributes to \(W'\) with \(x \in W'\) and \(y \in \overline{W'}\). By the unidirectionality of the edge projection \(\pi_\mu (e)\) (6), this means that the smaller-identifier endpoint, which \(C\) keeps with \(W \cap \mu = W' \cap \mu\), must be the \(x\)-endpoint.
(\(\Rightarrow\)) Suppose that \(\sigma_\mu (z_x) \geq \sigma_\mu (y)\). Note that equality is impossible by 12. So, by the exact same proof as the previous direction with \(x,y\) swapped, the \(y\)-endpoint must have the smaller identifier. ◻
We now arrive at the main part of the correctness analysis: proving that Step 4 is correct. From now on, we fix \(u \in \mathcal{D}^{\uparrow}(\mu)\), and our goal is to show that our query algorithm determines whether to report \(u\), namely, \(u\) is reported precisely when there exists a \(u,s\)-mincut which separates \(z_x,z_y\) and splits \(\mu\).
Before treating each substep separately, we show a “helper lemma”, useful for several of them.
Lemma 21. Suppose there exists a \(u,s\)-mincut which splits \(\mu\) and separates \(z_x,z_y\). Then, there exists a \(u,s\)-mincut \(U\) and an edge \(g = \{a,b\}\) of \(\pi_\mu (e)\) such that the following hold:
Node \(a\) (resp., \(b\)) is the endpoint of \(g\) closer to the \(x\)-endpoint \(a_x\) (resp., the \(y\)-endpoint \(a_y\)) of \(\pi_\mu (e)\).
The cut \(U\) keeps \(\{z_x\} \cup \mu(a,g)\) on one side and \(\{z_y\} \cup \mu(b,g)\) on the other.
Proof. By 17, there must also be a \((u,s)\)-mincut \(U\) which splits \(\mu\) and keeps \(\{x,z_x\}\) and \(\{y,z_y\}\) on different sides. By 4, \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut, and it also separates \(\{x,z_x\}\) from \(\{y,z_y\}\) as \(x,z_x,y,z_y \in \mathcal{D}_{\downarrow}(\mu)\). Let \(C\) be the canonical cut of \(\mathcal{H}_\mu\) corresponding to the valid partition \(\mu \cap W, \mu \cap \overline{W}\). Since the latter distinguishes \(e = \{x,y\}\), \(C\) must have an \(g\) from \(\pi_\mu (e)\) by 6. Let \(a\) and \(b\) be the endpoint of \(g\) closer to \(a_x\) or to \(a_y\) on \(\pi_\mu (e)\), respectively. By the unidirectionality property of \(\pi_\mu (e)\) in 6, \(W\) must keep \(\mu(a,g)\) with \(x\) (and \(z_x\)), and \(\mu(b,g)\) with \(y\) (and \(z_y\)). So, \(W\) separates \(\{z_x\} \cup \mu(a,g)\) from \(\{z_y\} \cup \mu(a,g)\). But these are both subsets of \(\mathcal{D}_{\downarrow}(\mu)\), hence this is also true for \(U\). ◻
Our proofs also repeatedly use the following observations, which follow immediately from 6 and the definitions of \(\mu_i (z_x), \mu_{1-i}(z_x), \mu_j (z_y), \mu_{1-j}(z_y)\).
Observation 9. The following hold (see 5):
If \(\mu_0 (z_x), \mu_1 (z_x)\) are defined (i.e., \(z_x\) is stretched), then \(\mu_i (z_x) = \mu(a_x,g_x)\) and \(\mu_{1-i} (z_x) \supseteq \mu(a_y, g_y)\).
If \(\mu_0 (z_y), \mu_1 (z_y)\) are defined (i.e., \(z_y\) is stretched), then \(\mu_j (z_y) = \mu(a_y, g_y)\) and \(\mu_{1-j} (z_y) \supseteq \mu(a_x, g_x)\).
Let \(g = \{a,b\}\) be an edge in \(\pi_\mu (e)\), where \(a\) is closer to the \(x\)-endpoint \(a_x\) and \(b\) is closer to the \(y\)-endpoint \(a_y\) on \(\pi_\mu (e)\). Then \(\mu(a,g) \supseteq \mu(a_x, g_x) = \mu_i (z_x)\) and \(\mu(b,g) \supseteq \mu(a_y, g_y) = \mu_j (z_y)\) (where the last equalities hold whenever \(\mu_i (z_x)\) and \(\mu_j (z_y)\) are defined). Furthermore:
If \(g\) is in \(\pi_\mu (z_x)\), then \(\mu(g,a) \supseteq \mu_i (z_x)\) and \(\mu(g,b) \supseteq \mu_{1-i}(z_x)\).
If \(g\) is in \(\pi_\mu (z_y)\), then \(\mu(g,b) \supseteq \mu_j (z_y)\) and \(\mu(a,g) \supseteq \mu_{j-1}(z_y)\).

Figure 5: Depicting 9..
Finally, the following four lemmas correspond to the correctness of each of the four substeps 4a-4b.
Lemma 22 (4a). Suppose \(u\) separates an edge of the middle part \(\pi_\mu (e) \setminus (\pi_\mu (z_x) \cup \pi_\mu (z_y))\). Then, there exists a \(u,s\)-mincut which splits \(\mu\) and separates \(z_x,z_y\).
Proof. By the assumption, there is an edge \(g = \{a,b\}\) in the middle part \(\pi_\mu (e) \setminus (\pi_\mu (z_x) \cup \pi_\mu (z_y))\) and a \((u,s)\)-mincut \(U\) keeping \(\mu(a,g)\) on one side and \(\mu(b,g)\) on the other. So \(U\) splits \(\mu\), and we next prove it also separates \(z_x,z_y\). By 4, \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut, so \(\mu \cap W, \mu \cap \overline{W}\) is a valid partition keeping \(\mu(a,g)\) and \(\mu(b,g)\) on different sides. Thus, by 7, the canonical cut \(C\) corresponding to this valid partition contains the edge \(g\), so \(C\) keeps all \(\pi_\mu (z_x)\) on one side and all of \(\pi_\mu (z_y)\) on the other side. Hence, by the properties of vertex projections in 5, every \(\mu \cap W, \mu \cap \overline{W}\)-mincut must separate \(z_x,z_y\). In particular, \(W\) itself must separate \(z_x, z_y\), and because \(z_x, z_y \in \mathcal{D}_{\downarrow}(\mu)\), so does \(U\). ◻
Lemma 23 (4b). Suppose \(u\) separates an edge of the overlap \(\pi_\mu (z_x) \cap \pi_\mu (z_y)\). Then, it holds that \(u \in A_\mu (z_x) \cap A_\mu (z_y)\) if and only if there exists a \(u,s\)-mincut which splits \(\mu\) and separates \(z_x,z_y\).
Proof. We will show the existence of \(W\) which is both a \(\mu\)-mincut and a \(w,s\)-mincut for some \(w \in \mu\), with \[\{z_x\} \cup \mu_i (z_x) \cup \mu_{1-j}(z_y) \subseteq W \quad \text{and} \quad \{z_y\} \cup \mu_{1-i}(z_x) \cup \mu_j (z_y) \subseteq \overline{W}.\] We defer this argument to the end of the proof, and start by showing how \(W\) is used to prove both directions. See 6 for an illustration of the proof.



Figure 6: Illustrating the proof of 23..
(\(\Rightarrow\)) We split into cases:
Case 1: \(W\) separates \(u,s\). Then \(W\) is a \(u,s\)-cut, so \(c(W) \geq c(\mathsf{Far}(u,s))\). But, because \(u \in \mathcal{D}^{\uparrow}(\mu)\), we have that \(w \in \mu\subseteq \mathcal{D}_{\downarrow}(u) = \mathsf{Far}(u,s)\), meaning that \(\mathsf{Far}(u,s)\) is a \(w,s\)-cut, and hence \(c(W) \leq c(\mathsf{Far}(u,s))\). We conclude that \(c(W) = c(\mathsf{Far}(u,s))\), so \(W\) itself is a \(u,s\)-mincut, and it separates \(z_x,z_y\) and splits \(\mu\) as required.
Case 2: \(u,s \in W\). Since \(u \in A_\mu (z_x)\), there exists a \(u,s\)-mincut \(U\) with \(\{z_x\} \cup \mu_i (z_x) \subseteq U\) and \(\mu_{1-i}(z_x) \subseteq \overline{U}\). Note that \(U \cap W\) is a \(u,s\)-cut, since \(|U \cap \{u,s\}| = 1\) and \(u,s \in W\). Also \(U \cup W\) is a \(\mu\)-cut, as it separates \(\mu_i (z_x)\) from \(\mu_{1-i}(z_x)\). Thus, by submodularity (1), \(U \cap W\) is a \(u,s\)-mincut, and we have \(\{z_x\} \cup \mu_i (z_x) \subseteq U \cap W\) and \(\{z_y\} \cup \mu_{1-i}(z_x) \subseteq \overline{U \cap W}\), namely, it separates \(z_x,z_y\) and splits \(\mu\).
Case 3: \(u,s \in \overline{W}\). Symmetric to Case 2, using \(u \in A_\mu (z_y)\) and considering \(\overline{W}\) instead of \(W\).
(\(\Leftarrow\)) We show that \(u \in A_\mu (z_x)\), and the proof for \(u \in A_\mu (z_y)\) is symmetric. We split to cases:
Case 1: \(W\) separates \(u,s\). Then as in Case 1 of the previous direction, \(W\) is a \(u,s\)-mincut, and it separates \(\{z_x\} \cup \mu_i (z_x)\) from \(\mu_{1-i} (z_x)\), hence \(u \in A_\mu (z_x)\).
Case 2: \(u,s \in W\). In this case, consider the \(u,s\)-mincut \(U\) and the edge \(g = \{a,b\}\) guaranteed by 21, so in particular \(\{z_x\} \cup \mu_i (z_x) \subseteq \{z_x\} \cup \mu(a,g) \subseteq U\). We have that \(\{z_x\} \cup \mu_i (z_x) \subseteq U \cap W\) and \(\mu_{1-i} (z_x) \subseteq \overline{W \cap U}\). Thus, in order to prove that \(u \in A_\mu (z_x)\), it suffices to show that \(U \cap W\) is a \(u,s\)-mincut. Note that it is a \(u,s\)-cut because \(|U \cap \{u,s\}| = 1\) and \(u,s \in W\). Also, note that \(U \cup W\) is a \(\mu\)-cut since \(\mu(a_x, g_x) = \mu_i (z_x) \subseteq U \cup W\) and \(\mu(a_y,g_y) \subseteq \mu_{1-i}(z_i) \cap \mu(b,g) \subseteq \overline{U \cup W}\). Hence, by submodularity (1), we get that \(U \cap W\) is indeed a \(u,s\)-mincut.
Case 3: \(u,s \notin W\). In this case, let \(g = \{a,b\}\) be any edge in the overlap that \(u\) separates, which exists by the assumption of the lemma, such that \(a\) is closer to \(a_x\) and \(b\) is closer to \(a_y\) on \(\pi_\mu (e)\). Then there exist a \(u,s\)-mincut \(U\) with \(\mu_i (z_x) \subseteq \mu(a,g) \subseteq U\) and \(\mu_{1-i} (z_x) \subseteq \mu(b,g) \subseteq \overline{U}\). We have that \(\{z_x\} \cup \mu_i (z_x) \subseteq U \cup W\) and \(\mu_{1-i} (z_x) \subseteq \overline{U \cup W}\). Thus, to prove that \(u \in A_\mu (z_x)\), it suffices to show that \(U \cup W\) is a \(u,s\)-mincut. Note that it is a \(u,s\)-cut because \(|U \cap \{u,s\}| = 1\) and \(u,s \notin W\). Also, note that \(U \cap W\) is a \(\mu\)-cut since \(\mu_i (z_x) \subseteq U \cap W\) and \(\mu_{1-i} (z_x) \subseteq \overline{U \cap W}\). Hence, by submodularity (1), we get that \(U \cup W\) is indeed a \(u,s\)-mincut.
(Existence of \(W\)) Take any edge \(g = \{a,b\}\) in the overlap, where \(a\) is closer to the \(x\)-endpoint \(a_x\) and \(b\) is closer to the \(y\)-endpint \(a_y\) on \(\pi_\mu (e)\), so \(\mu_i (z_x) \cup \mu_{1-j} (z_y) \subseteq \mu(a,g)\) and \(\mu_{1-i}(z_x) \cup \mu_j (z_y) \subseteq \mu(b,g)\). Take any canonical cut \(C\) of \(\mathcal{H}_\mu\) that contains \(g\), and let \(\mu_1,\mu_2\) be its corresponding valid partition, where \(\mu_1\) are the terminals mapped to the side of \(a\) (and the \(x\)-endpoint \(a_x\)), and \(\mu_2\) are those mapped to the side of \(b\) (and the \(y\)-endpoint \(a_y\)), so \(\mu(a,g) \subseteq \mu_1\) and \(\mu(b,g) \subseteq \mu_2\). Because \(g\) is an edge of \(\pi_\mu (e)\), 6 ensures that \(\mu_1,\mu_2\) distinguishes \(e\). Therefore, there must exists a \(\mu\)-mincut \(W\) with \(\mu_1 \subseteq W\) and \(\mu_2 \subseteq W\) where \(e\) is contributing; Furthermore, by the unidirectionality property in 6, it must be that \(x \in W\) and \(y \in \overline{W}\). Now, take any \(w \in \mu\) which is from the side without \(s\) of \(W\) (that is, if \(s \in \overline{W}\) take \(w \in \mu_1\), and if \(s \in W\) take \(w \in \mu_2\)). Then, as \(c(W) = \lambda_\mu = c(\mathcal{D}_{\downarrow}(\mu))\) and \(\mathcal{D}_{\downarrow}(\mu) = \mathsf{Far}(w,s)\), we have that \(W\) is a \(w,s\)-mincut. Finally, 17 now yields that \(z_x \in W\) and \(z_y \in \overline{W}\). This concludes the proof. ◻
Lemma 24 (4c). Suppose \(u\) does not separate any edge of the middle/overlap, but \(u\) separates the prefix \(\pi_\mu (z_x) \setminus \pi_\mu (z_y)\) or the suffix \(\pi_\mu (z_y) \setminus \pi_\mu (z_x)\). Then \(u \in A_\mu (z_x) \cup A_\mu (z_y)\) if and only if there exists a \(u,s\)-mincut which splits \(\mu\) and separates \(z_x,z_y\)
Proof. (\(\Rightarrow\)) Say \(u \in A_\mu (z_x)\), as \(u \in A_\mu (z_y)\) is symmetric. Then, there exists a \((u,s)\)-mincut \(U\) keeping \(\mu_i (z_x) \cup \{z_x\}\) and \(\mu_{1-i} (z_x)\) on different sides. By 4, we have that \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut, which also separates \(\mu_i (z_x) \cup \{z_x\}\) from \(\mu_{i-1} (z_x)\). Let \(C\) be the canonical cut of \(\mathcal{H}_\mu\) which corresponds to the valid partition \(\mu \cap W, \mu \cap \overline{W}\). Recall that \(\mu_i (z_x)\) and \(\mu_{i-1} (z_x)\) are the terminal sets associated with the proper path \(\pi_\mu (e)\), so by 7, \(C\) must have an edge \(g = \{a,b\}\) from \(\pi_\mu (z_x)\), where \(a\) is closer to the endpoint \(a_x = a_i (z_x)\) of \(\pi_\mu (z_x)\), and \(b\) is closer its other endpoint \(a_{1-i}(z_x)\). Thus, \(W\) keeps \(\mu(a,g)\) on the side of \(\{z_x\} \cup \mu_i (z_x)\), and \(\mu(b,g)\) on the side of \(\mu_{i-1} (z_x)\). As these are subsets of \(\mathcal{D}_{\downarrow}(\mu)\), this is also true for \(U\), so \(u\) separates \(g\). Now, since \(u\) does not separate edges of the overlap, \(g\) must be in the prefix \(\pi_\mu (z_x) \setminus \pi_\mu (z_y)\). Thus, \(C\) keeps all of \(\pi_\mu (z_y)\) on the side of \(\mu (b,g)\). This means that \(W\) must keep \(z_y\) with \(\mu (b,g)\) by 5. Hence, \(W\) separates \(\{z_x\} \cup \mu(a,g)\) from \(\{z_y\} \cup \mu(b,g)\). Because these are subsets of \(\mathcal{D}_{\downarrow}(\mu)\), this is also true for \(U\), so \(U\) is a \(u,s\)-mincut which splits \(\mu\) and separates \(x,y\).
(\(\Leftarrow\)) Let \(U\) and \(g = \{a,b\}\) be \(u,s\)-mincut and the of \(\pi_\mu (e)\) guaranteed by 21. As \(u\) does not separate any edge in the middle part, \(g\) must be either in \(\pi_\mu (z_x)\) or in \(\pi_\mu (y)\). If \(g\) is in \(\pi_\mu (x)\), then we have \(\mu_i (z_x) \subseteq \mu(a,g)\) and \(\mu_{1-i} (z_x) \subseteq \mu(b,g)\), hence \(U\) separates \(\{z_x\} \cup \mu_i (z_x)\) from \(\mu_{1-i}(z_x)\), and thus \(u \in A_\mu (z_x)\). The case where \(g\) is in \(\pi_\mu (y)\) is symmetric, leading to the conclusion that \(u \in A_\mu (z_y)\). ◻
Lemma 25 (4d). Suppose \(u\) does not separate \(\pi_\mu (e)\). Then no \(u,s\)-mincut splits \(\mu\) and separates \(z_x,z_y\).
Proof. Immediate by 21. ◻
This concludes the proof of 18.
This section provides the data structure for Query [query-Q2], restated below.
Again, as was with Query [query-Q1], by 17 the condition in Query [query-Q2] is equivalent to “some \(u,s\)-mincut separates \(z_x,z_y\) and keeps \(\mu\) on one side”, where \(z_x,z_y\) are the anchors of \(x,y\) w.r.t.\(\mu\). So, our goal in this section is to show:
Lemma 26. There is a data structure for Query [query-Q2] with \(O(n)\) space and \(O(n)\) query time.
We will need the following tool, which is similar to 12.
Lemma 27. Let \(\mu\) be a node in \(\mathcal{D}\). Then we can assign each vertex \(z \in V\) a number \(\tau_\mu (z) \in [n]\), such that the following hold for every \(z_1, z_2 \in V\):
If \(\tau_\mu (z_1) = \tau_\mu (z_2)\), then there is no \(\mu,s\)-mincut separating \(z_1,z_2\).
If \(\tau_\mu (z_1) < \tau_\mu (z_2)\), then there exists a \(\mu,s\)-mincut \(W\) with \(\{z_1\} \cup \mu \in W\), \(z_2 \in \overline{W}\).
Proof. Define a directed graph \(H\) on the vertices \(V\) where edge \((z,z')\) is not in \(E(H)\) iff there is a \(\mu,s\)-mincut \(W\) with \(\mu \cup \{z'\} \subseteq W\), \(z \in \overline{W}\). Contract each SCC (strongly connected component) of \(H\), and find a topological ordering for the resulting DAG: \(\tau_\mu (z)\) is the place of the SCC containing \(z\) in this ordering.
The second item is now easy to prove: if \(\tau_\mu (z_1) < \tau_\mu (z_2)\), then the edge \((z_2,z_1)\) cannot exist in \(H\) as it would violate the topological ordering.
For the first item, say \(\tau_\mu (z_1) = \tau_\mu (z_2)\). Seeking contradiction, suppose there is some \(\mu,s\)-mincut \(W\) separating \(z_1,z_2\). Without loss of generality, say \(\mu \cup \{z_2\} \in W\) and \(z_1 \in \overline{W}\) (the case \(z_1 \in W\) and \(z_2 \in \overline{W}\) is symmetric). Take some path \((z_1 = v_0, v_1, \dots, v_k = z_2)\) from \(z_1\) to \(z_2\) in \(H\), which exists as \(z_1,z_2\) belong to the same SCC. Consider the largest \(0 \leq r \leq k-1\) with \(v_r \in \overline{W}\) (which is well-defined since \(v_0 = z_1 \in \overline{W}\) and \(v_k = z_2 \in W\)). Then \(v_{r+1} \in W\), but this contradicts the existence of edge \((v_r, v_{r+1})\) in \(H\). ◻
We now formally describe the information stored by our data structure for Query [query-Q2]. First, we store the \(O(n)\) space data structure of the representative framework from 13. Next, for each node \(\mu\) of \(\mathcal{D}\), and each \(z \in \{z_\nu \mid \text{\nu child of \mu}\} \cup \mu\), we store \(\mathrm{\small rep}(\mu, z)\), and the number \(\tau_\mu (z)\) from 27, which consumes a total of \(O(|\mu| + \operatorname{outdeg}_\mathcal{D}(\mu))\) space for \(\mu\). Because the nodes of \(\mathcal{D}\) partition the vertices \(V\), and because \(\sum_\mu \operatorname{outdeg}_\mathcal{D}(\mu)\) counts each of the \(O(n)\) edges of \(\mathcal{D}\) exactly once, the total space is \(O(n)\).
We now give the algorithm to answer Query [query-Q2], given \(e = \{x,y\} \in E\) and LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\).
Find the anchors \(z_x,z_y\) of \(x,y\) w.r.t.\(\mu\), which takes \(O(n)\) time by searching \(\mathcal{D}\). Note thta \(z_x,z_y \in \{z_\nu \mid \text{\nu child of \mu}\}\) by [def:32anchors].
Use \(\mathrm{\small rep}(\mu, z_x)\) in 13 to determine the set \(B(z_x) = \{u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates \mu,z_x}\}\). Similarly, use \(\mathrm{\small rep}(\mu,z_y)\) to compute \(B(z_y) = \{u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates \mu,z_y}\}\). This takes \(O(n)\) time by 13.
Answer the query as follows.
If \(\tau_\mu (z_x) = \tau_\mu (z_y)\): Return \(\emptyset\).
If \(\tau_\mu (z_x) < \tau_\mu (z_y)\): Return \(B(z_y)\).
If \(\tau_\mu (z_x) > \tau_\mu (z_y)\): Return \(B(z_x)\).
Thus, our data structure answers Query [query-Q2] within \(O(n)\) time.
First, we prove the following “helper” lemma:
Lemma 28. Suppose that for some vertex \(u \in \mathcal{D}^{\uparrow}(\mu)\), there is a \(u,s\)-mincut \(U\) with \(\{z_x\} \cup \mu \subseteq U\) and \(z_y \in \overline{U}\). Then \(\tau_\mu (z_x) < \tau_\mu (z_y)\). (Symmetrically, if for some vertex \(u \in \mathcal{D}^{\uparrow}(\mu)\) there is a \(u,s\)-mincut \(U\) with \(\{z_y\} \cup \mu \subseteq U\) and \(z_y \in \overline{U}\), then \(\tau_\mu (z_x) > \tau_\mu (z_y)\).)
Proof. By 17, we may also assume that \(x \in U\) and \(y \in \overline{U}\). We observe that \(U \cup \mathcal{D}_{\downarrow}(\mu)\) is a \(u,s\)-cut:
If \(u \in \mu\), then as \(\mu \subseteq U\) we have \(u \in U\), and \(s \notin U\). Thus, \(u \in U \cup \mathcal{D}_{\downarrow}(\mu)\) and \(s \in \overline{U \cup \mathcal{D}_{\downarrow}(\mu)}\).
If \(u \notin \mu\), then as \(u \in \mathcal{D}^{\uparrow}(\mu)\), it must be that \(u \notin \mathcal{D}_{\downarrow}(\mu)\). Thus, \(|U \cap \{u,s\}| = 1\) and \(u,s \notin \mathcal{D}_{\downarrow}(\mu)\).
Also, \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu,s\)-cut as \(\mu \subseteq U\) and \(s \notin \mathcal{D}_{\downarrow}(\mu)\). Thus, by submodularity (1), we obtain that \(W := U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu,s\)-mincut. Note that \(\mu \cup \{x, z_x\} \subseteq W\) and \(\{y, z_y\} \subseteq \overline{W}\). So, by the first item in 27, we have \(\tau_\mu (z_1) \neq \tau_\mu (z_2)\). Now, assume towards contradiction that \(\tau_\mu (z_x) > \tau_\mu (z_y)\). Then by 27, there is a \(\mu,s\)-mincut \(W'\) with \(\{z_y\} \cup \mu \subseteq W'\) and \(z_x \in \overline{W'}\). By 17, we may also assume that \(x \in W'\) and \(y \in \overline{W'}\). Note that both \(W \cap W'\) and \(W \cup W'\) are \(\mu,s\)-cuts, so by submodularity (1) there cannot be any edge between \(W \setminus W'\) and \(W' \setminus W\). But \(x \in W \setminus W'\) and \(y \in W' \setminus W\), so \(e\) is such an edge — contradiction. We therefore conclude that \(\tau_\mu (z_x) < \tau_\mu (z_y)\). ◻
We now prove the correctness of the substeps of Step 2. As 2b and 2c are completely symmetric, we only consider 2b here. For this, we fix any \(u \in \mathcal{D}^{\uparrow}(\mu)\), and show that \(u\) is reported in the output of our algorithm precisely when there is some \(u,s\)-mincut which separates \(z_x,z_y\) and keeps \(\mu\) on one side.
Lemma 29 (2a). If \(\tau_\mu (z_x) = \tau_\mu (z_y)\), there is no \(u,s\)-mincut which separates \(z_x,z_y\) and does not split \(\mu\).
Proof. Immediate by 28, as such a \(u,s\)-mincut implies either that \(\tau_\mu (z_x) < \tau_\mu (z_y)\) or that \(\tau_\mu (z_x) > \tau_\mu (z_y)\), depending on whether it keeps \(\mu\) with \(z_x\) or with \(z_y\). ◻
Lemma 30 (2b). Suppose \(\tau_\mu (z_x) < \tau_\mu (z_y)\). Then it holds that \(u \in B(z_y)\) if and only if there exists a \(u,s\)-mincut which separates \(z_x,z_y\) and does not split \(\mu\).
Proof. (\(\Rightarrow\)) Suppose \(u \in B(z_y)\), so by definition of \(B(z_y)\) there is a \(u,s\)-mincut with \(\mu \subseteq U\) and \(z_y \in \overline{U}\). As \(\tau_\mu (z_x) < \tau_\mu (z_y)\), by 27 there is a \(\mu,s\)-mincut \(W\) with \(\{z_x\} \cup \mu \in W\), \(z_y \in \overline{W}\). Note that \(U \cap W\) is a \(\mu,s\)-cut. Also, we claim that \(U \cup W\) is a \(u,s\)-cut as follows:
If \(u \in U\) and \(s \in \overline{U}\), then as we also have \(s \in \overline{W}\) the claim holds.
Otherwise, \(s \in U\) and \(u \in \overline{U}\), and we should show that \(u \in \overline{W}\). Seeking contradiction, suppose \(u \in W\). As \(W \subseteq \mathsf{Far}(\mu,s) = \mathcal{D}_{\downarrow}(\mu)\), this means that \(\mathcal{D}(u)\) is a descendant of \(\mu\) in \(\mathcal{D}\). But \(\mathcal{D}(u)\) is also an ancestor of \(\mu\), so this means that \(\mathcal{D}(u)=\mu\), i.e., \(u \in \mu \subseteq U\) — contradiction as \(u \in \overline{U}\).
Thus, by submodularity (1), \(U \cup W\) is a \(u,s\)-mincut, with \(\{z_x\} \cup \mu \subseteq U \cup W\) and \(z_y \in \overline{U \cup W}\).
(\(\Leftarrow\)) Let \(U\) be a \(u,s\)-mincut which separates \(z_x,z_y\) and does not split \(\mu\); then \(U\) must keep \(\mu\) on the opposite side from \(z_y\), as otherwise we would get \(\tau_\mu (z_x) > \tau_\mu (z_y)\) by 28, in contradiction to the assumption of the lemma. Thus, the \(u,s\)-mincut \(U\) shows that \(u \in B(z_y)\). ◻
This concludes the proof of 26.
In this section, we show how, by allowing space of \(O(n^{1.5})\), we can support faster edge-failure queries for single-source mincuts as stated in 2: an output-sensitive query algorithm that reports all vertices whose mincut to \(s\) in time which is proportional to their number up to an \(\log^3 n\) factor, and a one-destination query algorithm that, given a single destination vertex of interest as part of the query, determines whether its mincut to \(s\) changes upon the failure in \(O(\log n)\) time.
The most important component of 2 is a data structure for the farthest mincut \(\mathcal{D}\) that occupies \(O(n^{1.5})\) and supports fast ancestry and LCA queries, which is given in 31 below. In fact, this is the only component of our data structure with \(O(n^{1.5})\) space, where all other components only need \(O(n \log n)\) space. Improving the space of this ancestry/LCA structure beyond \(O(n^{1.5})\) while maintaining polylogarithmic query time would directly yield an improved space bound for the entire data structure, and doing so appears to be a challenging and interesting problem.
We mention that the \(O(n^{1.5})\) space bound is by itself non-trivial, and might seem surprising in light of the Reachability Conjecture [15], [16]. This conjecture states that any data structure supporting reachability (i.e., ancestry) queries for DAGs with \(n\) vertices and \(m\) edges must either spend \(\tilde{\Omega}(m)\) query time or consume \(\tilde{O}(n^2)\) space in the worst case. However, the farthest mincut DAG \(\mathcal{D}\) is not worst-case; it is very well-structured due to 3, which is the key to obtaining the data structure.
Lemma 31. There is an \(O(n^{1.5})\) space data structure for the farthest mincut DAG \(\mathcal{D}\) that supports the following queries:
(Ancestry) Given two nodes \(\alpha\) and \(\beta\), determine if \(\alpha\) is ancestor of \(\beta\). The query takes \(O(1)\) time.
(LCA) Given nodes \(\alpha, \beta\), return the (at most two) LCAs of \(\alpha,\beta\). Furthermore, for each such LCA \(\mu\), if \(\alpha \neq \mu\) (resp., if \(\beta \neq \mu\)), also return a child \(\nu\) of \(\mu\) such that \(\nu\) is an ancestor of \(\alpha\) (resp., of \(\beta\)). The query takes \(O(\log n)\) time.
Proof. The key property of \(\mathcal{D}\) that yields this data structure is 3, saying that among any three ancestors of a given node in \(\mathcal{D}\), at least two must be related by ancestry. To utilize it, we will exploit chain-antichain decompositions, and Dilworth’s Theorem:
A chain (resp., antichain) is a set of nodes where every pair is related (resp., unrelated) by ancestry. I.e., chains and antichains are respectively paths and independent sets in the transitive closure \(TC(\mathcal{D})\).
A chain-antichain decomposition is a partition of the nodes in \(\mathcal{D}\) into a collection of sets, where each set is either a chain or an antichain. For every \(1 \leq \ell \leq n\), there always exists such a decomposition with \(O(\ell)\) chains and \(O(n/\ell)\) antichains [34].
The width of a set of nodes is the maximal size of an antichain within it. Dilworth’s Theorem [35] states that if a set has width \(k\) then it has a \(k\)-chain cover, that is, it can be partitioned into \(k\) chains.
We start with the simple intuition underlying our strategy for ancestry queries. Fix a node \(\nu\) of \(\mathcal{D}\), and let us consider how its ancestors behave w.r.t.chains and anti-chains. Obviously, the ancestors of \(\nu\) within any arbitrary chain \(C\) form a prefix of \(C\), which makes chains rather easy to deal with. Our key property (3) renders antichains easy as well: an arbitrary antichain \(A\) can only contain two ancestors of \(\nu\), since \(\nu\) cannot have three ancestors which are pairwise-unrelated.
In light of this, to support ancestry queries, we decompose \(\mathcal{D}\) into \(O(\sqrt{n})\) chains \(C_1, C_2, \dots\) and \(O(\sqrt{n})\) antichains \(A_1, A_2, \dots\). For each node \(\nu\), we store its last ancestor from each chain \(C_i\), and its at most two ancestors from each antichain \(A_i\); denote this set of \(O(\sqrt{n})\) stored ancestors by \(S(\nu)\). Now, to answer a query asking whether \(\alpha\) is an ancestor \(\beta\), we consider two cases. If \(\alpha\) is from an antichain \(A_i\), we just need to check whether \(\beta\) explicitly stored it in \(S(\beta)\) as one of its ancestors from \(A_i\). If \(\alpha\) is from a chain \(C_i\), we just need to check if it appears before the last ancestor of \(\beta\) on \(C_i\), which was explicitly stored by \(\beta\). Thus, we can answer ancestry queries within \(O(1)\) time.
Let us now discuss LCA queries. Our first observation is that the LCAs of \(\alpha,\beta\) must lie in \(S(\alpha) \cup S(\beta)\). Indeed, if an LCA \(\mu\) is from an antichain \(A_i\), this is immediate. If \(\mu\) is from a chain \(C_i\), then it must be the last ancestor of either \(\alpha\) or \(\beta\) on \(C_i\): otherwise, the node \(\mu'\) following \(\mu\) on \(C_i\) would be a common ancestor of \(\alpha,\beta\) which is a strict descendant of \(\mu\), a contradiction.
The next crucial observation is that, due to the key property of \(\mathcal{D}\) (3), each of \(S(\alpha)\) and \(S(\beta)\) has width at most \(2\) (as each of them consists of only ancestors of a given node, and thus cannot contain three pairwise-unrelated nodes). Therefore, we can apply Dilworth’s Theorem (during preprocessing) and decompose each of them into two chains. To answer the LCA query between \(\alpha\) and \(\beta\), we consider each of these four chains, and find the last common ancestor of \(\alpha,\beta\) on each by an \(O(\log n)\) time binary search. Note that the common ancestors form a prefix in each chain, and we can check if a node is a common ancestor by two ancestry queries of \(O(1)\) time, so binary search is indeed applicable. The LCAs of \(\alpha,\beta\) (which are at most two by 3) must be among these four candidate nodes; we detect them by \(O(1)\) ancestry queries between the candidates, to filter out those that are strict ancestors of others.
Finally, let us explain how we find children of the LCAs that are ancestors of \(\alpha\) and of \(\beta\). To this end, we augment our data structure as follows: Whenever node \(\nu\) stores some ancestor \(\mu\) in \(S(\nu)\), it also stores a child of \(\mu\) which is an ancestor of \(\nu\). Additionally, whenever some node \(\mu\) from a chain \(C_i\) is stored (in some \(S(\nu\))), we also store a child of \(\mu\) which is an ancestor of the node \(\mu'\) following \(\mu\) on \(C_i\). Now, consider an LCA \(\mu\) of \(\alpha,\beta\), and say \(\alpha \neq \mu\) and we want to find a child of \(\mu\) that is an ancestor of \(\alpha\). If \(\mu \in S(\alpha)\), then \(\alpha\) has explicitly stored such a child. Otherwise, \(\mu\) must appear before the last ancestor of \(\alpha\) on some chain \(C_i\); in this case, the child we have stored for \(\mu\) w.r.t.\(C_i\), which is an ancestor of the node \(\mu'\) following \(\mu\) on \(C_i\), must also be an ancestor of \(\alpha\). ◻
Remark 1. As the main cause for the \(O(n^{1.5})\) space bound is the decomposition into \(O(\sqrt{n})\) chains and antichains, which works for every DAG, one might hope for a better decomposition utilizing the special properties of \(\mathcal{D}\), namely 3. However, this is not possible. Indeed, take \(\mathcal{D}\) as a tree of \(\sqrt{n}\) paths connected only at the root \(s\), each of length \(\sqrt{n}\). Note that 3 holds for \(\mathcal{D}\): That is, the set of ancestors of any given node has width at most \(2\) (in fact \(1\)). As the longest chain and the largest antichain in \(\mathcal{D}\) are both of size \(\sqrt{n}\), it is impossible to partition its \(n\) nodes into \(o(\sqrt{n})\) chains and antichains.
We now present two extensions of the representative framework using the ancestry data structure for \(\mathcal{D}\) of 31. The first extension is useful for the One-Destinations queries:
Lemma 32. There is an \(O(n^{1.5})\) space data structure such that, given \(\mathrm{\small rep}(P,Q)\) for a pair of non-empty \(P,Q \subseteq V\), and given \(u\) such that \(P \cup Q \subseteq \mathcal{D}_{\downarrow}(u)\), reports if \(u\) separates \(P,Q\) in \(O(1)\) time.
Proof. The data structure stores the DAG \(\mathcal{D}\) and its ancestry/LCA data structure from 31, which takes \(O(n^{1.5})\) space. Additionally, for every node \(\nu\) in \(\mathcal{D}\), it stores the skeleton \(\mathcal{H}_\nu\) and its data structure of 10, which consumes \(O(|\nu|)\) space for each \(\nu\), and hence only \(O(n)\) space overall.
Let \(\nu_1, \dots, \nu_r\) be the \(O(1)\) representative nodes for \(P,Q\) found in \(\mathrm{\small rep}(P,Q)\). For each \(\nu_i\), we check if it is an ancestor of \(\mathcal{D}(u)\), which takes \(O(1)\) time using the ancestry data structure of 31. If no \(\nu_i\) is an ancestor, then \(u\) does not separate \(P,Q\) by 14. If some \(\nu_i\) is a strict ancestor, then \(u\) separate \(P,Q\) by 15. It remains to consider the case where \(u \in \nu_i\) (and \(\nu_i\) has no strict ancestors among \(\nu_1, \dots, \nu_r\)). In this case, let \(C_1, \dots, C_\ell\) be the \(O(1)\) representative cuts for \(P,Q\) of the node \(\nu_i\) (with specified marked sides). Then \(u\) separates \(P,Q\) iff \(\pi_\nu (u)\) is on the marked side of some \(C_i\), which we can check within \(O(1)\) time using the data structure for \(\mathcal{H}_{\nu_i}\) of 10. ◻
The second extension is useful for the output-sensitive query algorithm, and it a bit more involved. Informally, the setting is the following. We have some node of interest \(\nu\) in \(\mathcal{D}\), and we are given \(\mathrm{\small rep}(P_i,Q_i)\) for \(k\) pairs \(P_i,Q_i \subseteq V\). For each pair, we also have a demand: “separate” or “do not separate”. We wish to find the set \(Y\) consisting of every vertex \(v\) inside \(\nu\) that fulfills the demands: i.e., \(v\) separates every pair \(P_i,Q_i\) whose demand is “separate”, and does not separate any pair \(P_i,Q_i\) whose demand is “do not separate”.
Lemma 33. The \(O(n^{1.5})\) space data structure of 32 can also support the following queries: Given
\(\mathrm{\small rep}(P_i, Q_i)\) for non-empty \(P_i, Q_i \subseteq V\), \(i = 1, \dots, k\),
integer \(\ell\), \(0 \leq \ell \leq k\), and
node \(\nu\) of \(\mathcal{D}\) s.t.\(P_i \cup Q_i \subseteq \mathcal{D}_{\downarrow}(\nu)\), for every \(1 \leq i \leq k\),
return the set \(Y\) of all vertices \(v \in \nu\) such that \(v\) separates \(P_i, Q_i\) whenever \(1 \leq i \leq \ell\), but \(v\) does not separate \(P_i,Q_i\) whenever \(\ell + 1 \leq i \leq k\). The time to answer the query is \(O(|Y| + k^2)\).
Proof. See the start of the proof of 32 for the definition of the data structure.
We now explain how to answer the query. First, for every \(i =1, \dots, k\), we check if some representative node of \(P_i,Q_i\) is an ancestor of \(\nu\) in \(\mathcal{D}\) using the data structure of 31. This takes \(O(k)\) time, as there are \(O(1)\) representative nodes for each \(P_i,Q_i\), and each ancestry query takes \(O(1)\) time. We use this information as follows:
If some representative node of \(P_i,Q_i\) is a strict ancestor of \(\nu\), then every vertex in \(\nu\) separates \(P_i,Q_i\) by 15. So, if \(1 \leq i \leq \ell\) we can eliminate \(P_i,Q_i\) from the query without affecting the result, and if \(\ell+1 \leq i \leq k\) we can immediately report that \(Y = \emptyset\).
If no representative node of \(P_i,Q_i\) is an ancestor of \(\nu\), then no vertex in \(\nu\) separates \(P_i,Q_i\) by 14. So, if \(1 \leq i \leq \ell\) we can immediately report that \(Y = \emptyset\), and if \(\ell+1 \leq i \leq \ell\) we can eliminate \(P_i,Q_i\) from the query without affecting the result.
Hence, from now on, we may assume the following: for every \(1 \leq i \leq k\), the vertices separating \(P_i,Q_i\) in \(\nu\) are those mapped to the marked side of some representative cut of \(P_i,Q_i\) in the skeleton \(\mathcal{H}_\nu\). Let \(C_{i,1}, \dots ,C_{i,r_i}\) be the \(O(1)\) representative cuts of \(P_i,Q_i\). We denote by \(A_{i,j}\) the set of skeleton nodes in the marked (resp., unmarked) side of \(C_{i,j}\) when \(1 \leq i \leq \ell\) (resp., when \(\ell+1 \leq i \leq k\)). Thus, \(Y\) are precisely the vertices mapped to some skeleton node in \(\bigcap_{i=1}^k \bigcap_{j=1}^{r_i} A_{i,j}\). These can be reported in \(O(|Y| + (r_1 + \cdots + r_k)^2) = O(|Y| + k^2)\) by the data structure for \(\mathcal{H}_\nu\) of 10. ◻
We now provide the proof for the failure variant of 2; the proof for the simpler insertion variant appears in 14. We first focus on [item:faster-queries-reporting-all] of 2. That is, we show a data structure of \(O(n^{1.5})\) space that, given a query of failed edge \(e = \{x,y\} \in E\), reports \(X = \{u \in V \setminus \{s\} \mid \text{u separates x,y}\}\) within \(O(|X| \log^3 n)\) time.
The data structure construction augments the previous \(O(n)\) data structures for Query [query-Q1] (18) and Query [query-Q2] (26), by adding also the \(O(n^{1.5})\) space structures for ancestry/LCA queries in \(\mathcal{D}\) from 31 and for the extensions of the representative framework from [lem:rep-framework-one-vertex,lem:blackbox-reporting-all]. We will also use additional \(O(|\mu| \log |\mu|)\) space for each node \(\mu\) of \(\mathcal{D}\), and hence only \(O(n \log n)\) additional space in total, as will be explained shortly (in the discussion after 34).
We start by executing a multi-source BFS from \(\mathcal{D}(x),\mathcal{D}(y)\) in the reverse of \(\mathcal{D}\), that keeps exploring the edges of a reached node only if it is not a common ancestor of \(\mathcal{D}(x),\mathcal{D}(y)\), which is checked within \(O(1)\) using 31. The “halting nodes” where this condition doesn’t hold are precisely the LCAs of \(\mathcal{D}(x),\mathcal{D}(y)\), which are at most two by 3. Except for the LCAs, the BFS visits precisely those “exclusive ancestors” from 3.1, i.e., ancestors of exactly one of \(\mathcal{D}(x),\mathcal{D}(y)\)). As explained there, all vertices in these nodes belong to \(X\). Because each node in \(\mathcal{D}\) has at most two parents, the number of edges that this BFS-in-reverse touches is at most twice the number of nodes it reaches. Therefore, this procedure reports all those vertices of \(X\) found in exclusive ancestors within \(O(X)\) time. All other vertices in \(X\) are found in ancestors of the LCAs, as explained in 3.1, and finding these becomes our main goal.
So, from now on we focus on an LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\). We can also ensure that the BFS procedure above finds two children of \(\mu\) which are ancestors of \(\mathcal{D}(x)\) and of \(\mathcal{D}(y)\), and hence allows us to determine the anchors \(z_x,z_y\) of \(x,y\) w.r.t.\(\mu\) by [def:32anchors]. Given the equivalence of the anchors to \(x,y\) from 17, our problem now reduces to the following task: Given \(e = \{x,y\} \in E\), an LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\), and the anchors \(z_x,z_y\) of \(x,y\) w.r.t.\(\mu\), we wish to report the set \(X^\mu : = \{u \in \mathcal{D}^{\uparrow}(\mu) \mid \text{u separates z_x,z_y}\}\) in \(\tilde{O}(|X^{\mu}|)\) time. Since this is our only focus, and in order to avoid clutter, from now on we will slightly abuse notation and write \(X\) instead of \(X^\mu\).
We will need some additional notions regarding proper paths in the skeleton \(\mathcal{H}_\mu\). Let \(P\) be such a proper path with endpoint nodes \(a\) and \(b\). Vertex \(u\) is said to separate \(P\) if \(u\) separates the associated terminal sets \(\mu(a,P),\mu(b,P)\) of \(P\) (which have been defined in 3). That is, there exists a \(u,s\)-mincut which keeps \(\mu(a,P)\) on one side, and \(\mu(b,P)\) on the other side. (Note that a single skeleton edge is trivially also a proper path.) We define the representative information of \(P\) as a shorthand to the representative information of its associated terminal sets, and write this as \(\mathrm{\small rep}(P) := \mathrm{\small rep}(\mu(a,P), \mu(b,P))\). We have the following easy consequence of 7 and 4:
Lemma 34. Let \(P\) be a proper path in \(\mathcal{H}_\mu\). Then, for each vertex \(u \in V \setminus \{s\}\), it holds that \(u\) separates \(P\) iff \(u\) separates some edge \(g\) of \(P\).
Proof. First, consider any \(\mu\)-mincut \(W\). By 7, \(W\) separates the associated terminal sets of \(P\) iff the valid partition \(\mu \cap W, \mu \cap \overline{W}\) corresponds to a canonical cut of \(\mathcal{H}_S\) that has an edge \(g\) from \(P\). But by 7, this happens iff \(W\) separates the associated terminal sets of some edge \(g\) of \(P\). Now, let \(U\) be any \((u,s)\)-mincut. By 4, \(U\) separates the associated terminal sets of \(P\) iff \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut that separates these sets. By the previous discussion, this happens iff \(U \cap \mathcal{D}_{\downarrow}(\mu)\) is a \(\mu\)-mincut that separates the associated terminal sets of some edge \(g\) of \(P\), which, by 4, happens iff \(U\) separates them. ◻
We store the \(O(|\mu| \log |\mu|)\) data structure of 11 for the skeleton \(\mathcal{H}_\mu\), where the information associated with a proper path is \(\mathrm{\small rep}(P)\). So, when queries with the two endpoints of a proper path, this data structure returns a partition of the path into \(O(\log |\mu|)\) subpaths (specified by their endpoints), along with \(\mathrm{\small rep}(\cdot)\) for each of these subpaths. Additionally, we will store the \(O(|\mu|)\) data structure of 10, which lets us determine the order of nodes on a proper path. So, over all nodes, this only adds \(O(n \log n)\) additional storage, which is negligible as we already use \(O(n^{1.5})\) storage.
Let us focus on a specific node \(\nu\) which is an ancestor of \(\mu\), and suppose we just wish to find \(X_\nu := X \cap \nu\), i.e., all those vertices in \(\nu\) that separate \(z_x,z_y\), in \(\tilde{O}(X_\nu)\) time. Thus, \(\nu\) consists of all those vertices \(u \in \nu\) that would have been reported by one the query algorithms for Query [query-Q1] from [sec:splitting-mu], or for Query [query-Q2] from 8. Denote by \(X_\nu^{(1)}\) and \(X_\nu^{(2)}\) the respective sets of vertices in \(X\), so \(X_\nu = X_\nu^{(1)} \cup X_\nu^{(2)}\). Thus, it suffices to report each \(X_\nu^{(i)}\) in time \(\tilde{O}(|X_\nu^{(i)}|)\). From now on, we focus on the more complicated Query [query-Q1], as the procedure for [query-Q2] is very similar (and much simpler). Let us consider the steps of the query algorithm, and the way these are modified to obtain our goal.
First, Step 0 has already been executed, as we have found \(z_x,z_y\) before. Next, if Step 1 fails, i.e. \(\lambda_\mu \neq c(R(\mu))\) or \(\phi_\mu (z_x) = \phi_\mu (z_y)\), we know \(X_\nu^{(1)} = \emptyset\), and we are done.
We “simulate” Step 2 by the following procedure. We have stored the endpoints of the projection paths \(\pi_\mu (z_x)\) and \(\pi_\mu (z_y)\). By a query to the data structure of 10 for \(\mathcal{H}_\mu\), we get their order on \(\pi_\mu (e)\). This allows us to determine the endpoints of the middle/overlap/prefix/suffix subpaths of \(\pi_\mu (e)\). For each such subpath \(P\), we use the data structure from 11 which we have stored for \(\mathcal{H}_\mu\) (with \(I(\cdot) = \mathrm{\small rep}(\cdot)\)) to get a partition of \(P\) to \(O(\log n)\) paths \(P_1,P_2,\dots\), along with \(\mathrm{\small rep}(P_i)\) for each \(i\). We call \(P_1,P_2, \dots\) the parts of \(P\). We do not yet use their \(\mathrm{\small rep}(\cdot)\)-s, but “save” them for later usage. So, this modified Step 2 takes us only \(O(\log n)\) time.
Step 3 can be executed in exactly the same manner as before, except we do not compute the sets \(A_\mu (z_x)\) and \(A_\mu (z_y)\), but rather just “save” their corresponding representative information, i.e., \(\mathrm{\small rep}(A_\mu (z_x)) := \mathrm{\small rep}(\mu_i (z_x) \cup \{x\}, \mu_{1-i} (z_x))\) for \(A_\mu (z_x)\) and \(\mathrm{\small rep}(A_\mu (z_y)) := \mathrm{\small rep}(\mu_j (z_x) \cup \{x\}, \mu_{1-j} (z_x))\) for the next step, which is the most crucial.
We now arrive at the key Step 4. To demonstrate the essence, suppose that we just want to report all those vertices from \(X^{(1)}_\nu\) which would have been reported in Substep 4c; similar arguments apply to each of the other substeps. Thus, our goal is to report all those vertices \(u \in \nu\) such that:
\(u\) belongs to either \(A_\mu (z_x)\) or \(A_\mu (z_y)\),
\(u\) separates some edge in the prefix or in the suffix, and
\(u\) does not separate any edge in the middle/overlap.
To this end, iterate over all possible choices of \(A \in \{A_\mu (z_x), A_\mu (z_y)\}\) and part \(P_i\) of either the prefix or the suffix. In each such iteration, we apply 33 to find all vertices in \(\nu\) that (1) belong to \(A\), (2) separate \(P_i\) (or equivalently, separate some edge in \(P_i\), by 34), and (3) do not separate any of the \(O(\log n)\) parts of the middle/overlap. Namely, the input for 33 is the list that starts with \(\mathrm{\small rep}(A)\), \(\mathrm{\small rep}(P_i)\), followed by \(\mathrm{\small rep}(\cdot)\) of each part of the prefix/suffix (and \(\ell = 2\)).
These are a total of \(O(\log n)\) calls to 33, where each call is applied on \(O(\log n)\) \(\mathrm{\small rep}(\cdot)\)’s, thus taking \(O(\text{\# vertices returned} + \log^2 n)\) time. The union of the vertices returned by each of these calls is precisely the set of vertices from \(\nu\) that would have been reported in Substep 4c. Thus, the time it takes us to report this union is proportional to its size, up to a multiplicative \(\log n\) factor, plus an additive \(\log^3 n\) term.
As previously mentioned, a similar analysis applies to every other substep of Step 4 for Query [query-Q1], and a simpler one applies to Query [query-Q2]. We thus get the following:
Corollary 2. There is an \(O(n^{1.5})\) space data structure for the following queries: Given \(e = \{x,y\} \in E\), an LCA \(\mu\) of \(\mathcal{D}(x),\mathcal{D}(y)\), the anchors \(z_x,z_y\) of \(x,y\) w.r.t.\(\mu\), and given a node \(\nu\) which is an ancestor of \(\mu\), report the set \(X_\nu = \{u \in \nu \mid \text{u separates z_x,z_y}\}\). The query takes \(O(|X_\nu| \log n + \log^3 n)\) time.
We are now ready to explain how we find the set \(X\) consisting of every \(u \in \mathcal{D}^{\uparrow}(\mu)\) which separates \(z_x,z_y\) in time \(\tilde{O}(X)\).
Call a node \(\nu\) which is an ancestor of \(\mu\) relevant if it contains a vertex from \(X\), i.e., if \(X_\nu = X \cap \nu \neq \emptyset\). If we somehow knew all the relevant nodes, we could have just applied the query of 2 on each of them, and return the union of found vertices, which is precisely \(X\), and this would take \(\tilde{O}(X)\) time. So, our goal is to find these relevant nodes without spending much time looking into irrelevant ones.
To this end, we execute the following BFS-like procedure, which works by visiting nodes \(\nu\) of \(\mathcal{D}\), where in such a visit reports the set \(X_\nu\) and marks \(\nu\) as visited. We initialize a queue \(\mathcal{Q}\) to contain \(\mu\), and the following iterations while \(\mathcal{Q} \neq \emptyset\):
Dequeue node \(\nu\) from the front of \(\mathcal{Q}\).
If \(\nu\) is not marked as visit it, visit \(\nu\) as follows:
Find and report \(U_\nu\) using 2.
Mark \(\nu\) as visited.
If \(\nu\) is relevant (i.e., \(U_\nu \neq \emptyset\)), enqueue its (at most two) parents.
To prove correctness, we should show that this procedure indeed visits all the relevant nodes. Let \(\nu\) be a relevant node, and let \((\nu = \nu_0, \nu_1, \dots, \nu_k = \mu)\) be a path from \(\nu\) to \(\mu\) in \(\mathcal{D}\). Using the insights behind the representative framework from 5, we can show that every \(\nu_i\) on this path must be relevant. Indeed, because \(\nu = \nu_0\) is useful, i.e., contains a vertex which separates \(z_x,z_y\), by 14 it must be a descendant of some representative node \(\eta\) for \((z_x,z_y)\) or for \((z_y,z_x)\). Thus, every other \(\nu_i\) is a strict descendant of \(\eta\), and as \(\mu\) is a descendant of \(\nu_i\), we have have \(z_x,z_y \in \mathcal{D}_{\downarrow}(\mu) \subseteq \mathcal{D}_{\downarrow}(\nu_i)\). Therefore, by 14, every vertex in \(\nu_i\) must separate \(z_x,z_y\), and in particular \(\nu_i\) is relevant. Now, as the procedure starts by visiting \(\mu = \nu_k\), it must find that it is relevant and enqueue \(\nu_{k-1}\), and so it must also visit \(\nu_{k-1}\), find that it is relevant and enqueue \(\nu_{k-2}\), and so on until \(\nu_0 = \nu\) is visited. Finally, as each visit to a relevant node causes at most two enqueue operations, and visits to irrelevant nodes do not cause any enqueues, the number of visited node is bounded by at most twice the number of relevant nodes, which is at most \(X\). A visit to node \(\nu\) takes \(O(|X_\nu| \log n + \log^3 n)\) time. Hence, the total running time is \(O(\sum_\nu |X_\nu| \log n + |X| \log^3 n) = O(|X| \log n + |X| \log^3 n) = O(|X| \log^3 n)\).
This concludes the proof of (the failure variant) of 2(1).
We now discuss [item:faster-queries-one-vertex] of 2, where a query consists of failed edge \(e = \{x,y\} \in E\) and destination \(u \in V \setminus \{s\}\), and we should determine whether the \(u,s\)-mincut value decreases after the failure of \(e\), or equivalently, whether \(u\) separates \(x,y\).
The data structure is the same as for [item:faster-queries-reporting-all].
To answer the query, we first determine the ancestry relations between \(\mathcal{D}(u)\) and \(\c(x),\mathcal{D}(y)\), which takes \(O(1)\) time using 31. As discussed in 3.1, the only case where this does not suffice is when \(\mathcal{D}(u)\) is an ancestor of both. Next, using 31, we find the (at most two) LCAs of \(\mathcal{D}(x),\mathcal{D}(y)\) within \(O(\log n)\) time. For each LCA \(\mu\), we also get two children of it which are ancestors of \(\mathcal{D}(x)\) and of \(\mathcal{D}(y)\), and hence we know the anchors of \(x,y\) w.r.t.\(\mu\) (by [def:32anchors]). By two more ancestry queries, we find one LCA \(\mu\) s.t.\(u \in \mathcal{D}^{\uparrow}(\mu)\), and let \(z_x,z_y\) be the anchors of \(x,y\) w.r.t.\(\mu\). At this point, our goal becomes to determine whether \(u\) would have been reported by the query algorithms of Query [query-Q1] or [query-Q2]; we focus on the first one, as the latter is similar but much simpler. We execute the modified steps, from Step 0 up to Step 3, exactly as we did for [item:faster-queries-reporting-all]. So, when we arrive at Step 4, we have the following:
For each subpath \(P\) of \(\pi_\mu (e)\) among the middle/overlap/prefix/suffix, we have a partition of \(P\) into \(O(\log n)\) parts \(P_1,P_2, \cdots\), along with \(\mathrm{\small rep}(P_i)\) for each part.
\(\mathrm{\small rep}(A_\mu (z_x)) := \mathrm{\small rep}(\mu_i (z_x) \cup \{z_x\}, \mu_{1-i} (z_x))\) and \(\mathrm{\small rep}(A_\mu (z_y)) := \mathrm{\small rep}(\mu_j (z_y) \cup \{z_y\}, \mu_{1-j} (z_y))\).
Thus, by \(O(\log n)\) calls to the representatives framework structure of 32 (each taking \(O(1)\) time), we determine for each \(P \in \{\text{middle, overlap, prefix, suffix}\}\) whether \(u\) separates \(P\) (or equivalently, by 34, separates an edge of \(P\)), and also determine whether \(u \in A_\mu (z_x)\) and whether \(u \in A_\mu (z_y)\). So we can now decide in \(O(1)\) time whether to report \(u\), by exactly the same logic of Step 4 from [sec:splitting-mu].
This concludes the proof of [item:faster-queries-one-vertex] of 2.
We now prove 3, and show a data structure with \(O(n^{2.5})\) space that, given a query of failed edge \(e = \{x,y\}\), reports the set \(X\) of all vertex pairs \(u,w\) such that the \(u,w\)-mincut value changes after the failure of \(e\), within \(O(|X| \log^3 n)\) time. We store, for every \(s \in V\) the single-source data structures of 2 corresponding to this source \(s\), so the space is clearly \(O(n^{2.5})\). The key insight is:
Lemma 35. Let \(e = \{x,y\} \in E\), and let \(u,w \in V\). If the failure of \(e\) causes the \(u,w\)-mincut value to decrease, then it also causes either the \(u,x\)-mincut value or the \(u,y\)-mincut value to decrease.
Proof. Let \(A\) be a \((u,w)\)-mincut with \(e\) contributing, which exists by the assumption of the lemma. Without loss of generality, say \(x \in A\) and \(y \in \overline{A}\) (otherwise, swap \(x\) and \(y\) in the following argument). Let \(B\) be some \((u,y)\)-mincut (\(u \neq y\) since \(u \in A\) and \(y \notin A\)). Observe that \(A \cap B\) is a \((u,w)\)-cut, and \(A \cup B\) is a \((u,y)\)-cut. Hence, by submodularity (1), \(A \cup B\) is a \((u,y)\)-mincut. Also, \(x \in A \cup B\) and \(y \in \overline{A \cup B}\), so \(e\) contributes to \(A \cup B\). Therefore, the failure of \(e\) causes the \(u,y\)-mincut value to decrease. ◻
This leads to the following query algorithm: First, using the data structures for \(x\) and for \(y\) as the sources, find all vertices \(u\) such that either the \(u,x\)-mincut value or the \(u,y\)-mincut value decreases after the failure of \(e\). Let \(U\) be the set of all such vertices \(u\) that were found. Then, for every \(u \in U\), use the data structure for \(u\) as the source to find all vertices \(w\) such that the \(u,w\)-mincut value decreases after the failure of \(e\). Let \(W_u\) be the set of all such vertices \(w\) that were found. Report \(X\) as the set of pairs \(u,w\) such that \(w \in W_u\).
The correctness follows immediately from 35. As for the running time: The first step takes us \(O(|U| \log^3 n)\) time, and the second \(O(\sum_{u \in U} |W_u|\log^3 n)\) time. Note that, by definition of \(U\), for each \(u \in U\), \(W_u\) contains at least one of \(x\) or \(y\), hence \(|U| \leq \sum_{u \in U} |W_u|\). Also, this last sum counts every pair from \(X\) at most twice. Thus, the running time of the query algorithm is \(O(|X| \log^3 n)\).

Figure 7: The Connectivity Carcass.
7 gives an example of the connectivity carcass, formally introduced in 2.1.
Numbers next to edges in \(G\) represent their multiplicities (no number means multiplicity \(1\)). The terminals in \(S\) and non-terminals in \(V \setminus S\) are denoted by capital and lowercase letters, respectively. The capacity of \(S\)-mincuts is \(\lambda_S = 6\).
Each terminal vertex is mapped to a node in \(\mathcal{H}_S\), but the mapping is neither injective (two terminals can go in the same node, as terminals \(H,I\) in this example) nor surjective (there are empty nodes).
The dashed colored lines show several canonical cuts of \(\mathcal{H}_S\). Canonical cuts bijectively correspond to valid partitions of \(S\), but such a valid partition can be induced by many different \(S\)-mincuts. The two red \(S\)-mincut in \(G\) both give rise to the same valid partition \(\{R,T\}, S \setminus \{R,T\}\), and hence to the same canonical cut in \(\mathcal{H}_S\) (the tree-edge between the nodes with \(Q\) and with \(R\)). These two cuts keep the non-terminal \(u\) on different sides, so this valid partition (and its canonical cut) distinguishes \(u\).
Projections of several non-terminal vertices are depicted on the right. Vertex \(z\) is non-stretched (i.e., not distinguished by any canonical cut), so \(\pi_S (z)\) is a tree node with \(G\) of \(\mathcal{H}_S\). Vertices \(u,v,w,x,y\) are stretched, so their projections are proper paths. The canonical cuts that distinguish a stretched vertex are precisely those that keep the endpoints of the projection path on different sides.
The projection of an edge (that contributes to some \(S\)-mincut) is the unique proper path whose prefix and suffix are the projections of its endpoints, so we easily see \(\pi_S (\{u,v\})\) and \(\pi_S (\{x,y\})\).
For \(\{u,v\}\), the prefix and suffix \(\pi_S (u), \pi_S (v)\) are not the same, so we can easily determine the \(u\)-endpoint and the \(v\)-endpoint of \(\pi_S (\{u,v\})\) as the nodes containing \(R\) and \(M\) respectively.
For \(\{x,y\}\), the \(x\)-endpoint and \(y\)-endpoints are the node with \(A\) and \(F\), respectively. This can be verified through the unidirectionality property: indeed, \(\{x,y\}\) contributes to the purple \(S\)-mincut, and this cut keeps \(x\) on the same side of \(A\), and \(y\) on the same side as \(F\).
Finally, consider again the valid partition \(\{R,T\}, S\setminus \{R,T\}\). Since its corresponding canonical cut is an edge from \(\pi_S (\{u,v\})\), it distinguishes \(e\), which means that some \(\{R,T\}, S\setminus \{R,T\}\)-mincut has \(\{u,v\}\) as a contributing edge. However, there could be \(\{R,T\}, S\setminus \{R,T\}\)-mincuts where \(\{u,v\}\) is not contributing. This is demonstrated by the two red cuts: \(\{u,v\}\) contributes to one but not the other.

Figure 8: The Nearest Mincut Tree and Farthest Mincut DAG..
8 gives an example of nearest mincut tree \(\mathcal{T}\) and the farthest mincut DAG \(\mathcal{D}\), which are presented in 3.1.
Numbers next to edges in \(G\) represent their multiplicities (no number means multiplicity \(1\)). The source \(s\) is marked in orange.
The minimal region defined by a dashed-red curve (resp., solid blue curve) which contains vertex \(u\) is \(\mathsf{Near}(u,s)\) (resp., \(\mathsf{Far}(u,s)\)). The red-bounded regions corresponding to nearest mincuts are laminar: every two are either disjoint, or one contains the other. The blue-bounded regions corresponding to farthest mincuts are not laminar.
The nodes of the nearest mincut tree \(\mathcal{T}\) (resp., farthest mincut DAG \(\mathcal{D}\)) partition \(V\), where the root node contains only \(s\). For every vertex \(u\), its nearest mincut \(\mathsf{Near}(u,s)\) (resp., farthest mincut \(\mathsf{Far}(u,s)\)) consists of all the vertices found in descendants of the node \(\mathcal{T}(u)\) (resp., \(\mathcal{D}(u)\)) that contains \(u\).
Proof of 1. We prove the statement with \(S\) and \(T\), and the “furthermore” part is proved in exactly the same way.
(Submodularity) Let \(C\) denote the \(S\)-cut among \(A \cap B\) or \(A \cup B\), and \(D\) denote the other one of them, which is a \(T\)-cut. As \(A\) is an \(S\)-mincut and \(B\) is a \(T\)-mincut, we get the inequalities \(c(A) \leq c(C)\) and \(c(B) \leq c(D)\). But by submodularity \(c(A) + c(B) \geq c(C) + c(D)\), so these inequalities must in fact hold with equality. Now, suppose towards contradiction that \(e\) is an edge between \(A \setminus B\) and \(B \setminus A\). Consider the graph \(G'\) obtained by removing \(e\) from \(G\), and let \(c'(\cdot)\) denote capacities in \(G'\). As \(e\) contributed to \(A\), it remains an \(S\)-mincut in \(G'\). Similarly, \(B\) remains a \(T\)-mincut in \(G'\). Thus, by the first part of the proof, \(C\) is an \(S\)-mincut also in \(G'\). However, \(e\) does not contribute to \(C\), so we get \(0 = c(C) - c'(C) = c(A) - c'(A) = 1,\) a contradiction.
(Posimodularity) Without loss of generality, say \(A \setminus B\) is the \(S\)-cut and \(B \setminus A\) is the \(T\)-cut. Note that \(A \setminus B = A \cap \overline{B}\) and \(B \setminus A =\overline{A \cup \overline{B}}\). So, by submodularity on \(A\) and \(\overline{B}\), we get that \(A \setminus B\) and \(\overline{B \setminus A}\) are \(S\)-mincut and \(T\)-mincut respectively, and there are no edges between \(A \setminus \overline{B} = A \cap B\) and \(\overline{B} \setminus A = \overline{A \cup B}\). ◻
Proof of 2.. The assumption implies that \(A \setminus (B \cup C)\), \(B \setminus (A \cup C)\) and \(C \setminus (A \cup B)\) are \((a,s)\)-cut, \((b,s)\)-cut and \((c,s)\)-cut, respectively. Thus, \[c(A \setminus (B \cup C)) + c(B \setminus (A \cup C)) +c(C \setminus (A \cup B)) \geq c(A) + c(B) + c(C).\] However, in undirected graphs, we have the following “submodularity-like” inequality which can be shown by edge counting arguments, cf. [36]: \[c(A) + c(B) + c(B) \geq c(A \setminus (B \cup C)) + c(B \setminus (A \cup C)) +c(C \setminus (A \cup B)) + c(A \cap B \cap C).\] Combining these two inequalities and rearranging, we get \(c(A \cap B \cap C) \leq 0\), i.e., \(A \cap B \cap C\) has \(0\) capacity. As \(G\) is connected, the only two vertex subsets with \(0\) capacity are \(\emptyset, V\), but the latter option is impossible since \(s \notin A,B,C\). ◻
Proof of 6. We observe that for every \(1 \leq j < k\), \(S(a_{j-1}, g_j) \subseteq S(a_j, g_{j+1})\) and \(S(a_j, g_j) \supseteq S(a_{j+1},g_{j+1})\). This is easy to see from 3, by considering the three possible cases: (i) both \(g_j,g_{j+1}\) are tree-edges, (ii) \(g_j\) is a tree-edge and \(g_{j+1}\) is a cycle-edge, or (iii) \(g_j\) is a cycle-edge and \(g_j\) is a tree-edge. These are the only possible cases because \(P\) is proper. We thus get that \(S(a_0, g_1) \subseteq S(a_1,g_2) \subseteq \cdots \subseteq S(a_{i-1},g_i)\), and \(S(a_i,g_i) \supseteq S(a_{i+1}, g_{i+1}) \supseteq \cdots S(a_k, g_k)\). ◻
Proof of 7. Consider the first direction of the lemma: suppose \(C\) is a canonical cut containing some \(g_i\). Then by 3, we see that \(C\) must keep the associated terminal sets of \(g_i\) on different sides. Hence, by 6, \(C\) keeps \(S(a_0, g_1)\) and \(S(a_k, g_k)\) on different sides, and so its corresponding valid partition keeps them on different parts, as required.
Let us now consider the other direction: suppose \(C\) is a canonical cut corresponding to valid partition \(S_1,S_2\) such that \(S(a_0, g_1) \subseteq S_1\) and \(S(a_k, g_k) \subseteq S_2\), and we should show that \(C\) contains some edge \(g_i\). The proof is by complete induction on the length \(k\) of the proper path \(P\).
The inductive step is when \(P\) has some intermediate tree-edge \(g_i\) with \(1 < i < k\). In this case \(S(a_{i-1}, g_i), S(a_i, g_i)\) is the valid partition corresponding to the canonical cut \(\{g_i\}\) (by 3). If \(C = \{g_i\}\) we are done. Otherwise, because \(g_i\) is a tree-edge \(C\) has all its edges from one side of the cut defined by \(g_i\); let \(A_{i-1}\) be the side of \(a_{i-1}\), and \(A_i\) be the side of \(a_i\).
If \(C\) has both edges in \(A_{i-1}\): Then \(C\) has one side contained in \(A_{i-1}\) and the other containing \(A_i\). Further, the side containing \(A_i\) must be the side \(S_2\); Indeed, otherwise \(S_1 \supseteq S(a_i, g_i) \supseteq S(a_k, g_k)\) (the last containment is by 6) but this means that \(\emptyset \neq S(a_k, g_k) \subseteq S_1 \cap S_2\), a contradiction. Therefore, we have that \(S_2 \supseteq S(a_i, g_i)\). As \(S_1 \supseteq S(a_0, g_0)\) and \(i < k\), we can apply the induction hypothesis on the subpath path \((a_0, a_1, \dots, a_i)\) and obtain that \(C\) has an edge from it.
If \(C\) has both edges in \(A_i\): This is symmetrical to the previous case, now applying the induction hypothesis on \((a_{i-1}, a_i, \dots, a_k)\) which is strictly shorter since \(i > 1\).
It remains to deal with the base cases of the induction, when \(P\) has no intermediate tree-edge. These are somewhat tedious.
First, suppose \(P\) is one tree-edge \(g_1 = \{a_0,a_1\}\), then \(S(a_0,g_1), S(a_1,g_1)\) is the valid partition corresponding to the canonical cut \(\{g_1\}\) (by 3), hence \(S_1,S_2\) must be equal to this partition, so by the bijectivety in 4 we must have \(C = \{g_1\}\).
Next, suppose \(P\) is two adjacent tree-edges. Denote by \(x\) the intermediate node of \(P\), which must be a tree-node by 4. Let \(f_j = \{x, y_j\}\) for \(1\leq i\leq r\) be the incident edges to \(x\). Note that \(S(y_j, f_j), S(x,f_j)\) is the valid partition corresponding to the canonical cut \(\{f_j\}\) (by 3), and that \(\{S(y_j,f_j)\}_{1 \leq j \leq r}\) are mutually disjoint. Suppose that \(P = (y_1, x, y_2)\), so \(S(y_1,f_1) \subseteq S_1\), \(S(y_2, f_2) \subseteq S_2\), and we should show that \(C\) is \(\{f_1\}\) or \(\{f_2\}\). Note that \(f_1\) and \(f_2\) are the only edges \(f_j\) that define cuts placing \(S(y_1,f_1)\) and \(S(y_2,f_2)\) on different sides, hence it suffices to show that \(C\) must be an edge incident to \(x\). Towards contradiction, suppose not: then \(C\) has all its edges from the side of \(y_j\) in the cut defined by \(f_j\), for some \(1 \leq j \leq r\). Therefore, one of \(S_1,S_2\) is contained in \(S(y_j,f_j)\). Further, this containment is strict: otherwise the partitions \(S_1,S_2\) and \(S(y_j,f_j),S(x,f_j)\) are identical, so the bijectivity in 4 gives \(C = \{f_j\}\) in contradiction. Hence, the other part among \(S_1,S_2\) must intersect \(S(y_j, f_j)\), and it also contains \(S(y_\ell, f_\ell)\) for each \(\ell \neq j\), but this is also contradiction as \(S(y_1,f_1) \subseteq S_1\) and \(S(y_2,f_2) \subseteq S_2\).
Finally, it remains to treat the base cases with \(P\) having a cycle-edge; say this edge is \(g= \{x_1,x_2\}\) on a cycle \(\sigma = (x_0, x_1, \dots, x_r = x_0)\). By 4, \(r \geq 4\), and each node \(x_j\) on \(\sigma\) has a unique incident tree-edge \(f_j = \{x_j, y_j\}\). Note that \(S(y_j,f_j),S(x_j,f_j)\) is the valid partition corresponding to the canonical cut \(\{f_j\}\) (by 3), and that \(\{S(y_j,f_j)\}_{1\leq j <r}\) are mutually disjoint. As \(P\) is a proper path without an intermediate tree-edge, exactly one of the following cases holds:
\(P = (x_1,x_2)\), and then \(S(y_1, f_1) \cup S(y_0, f_0) \subseteq S_1\) and \(S(y_2, f_2) \cup S(y_3, f_3) \subseteq S_2\).
\(P = (y_1,x_1,x_2)\), and then \(S(y_1,f_1) \subseteq S_1\) and \(S(y_2,f_2) \cup S(y_3,f_3) \subseteq S_2\).
\(P = (x_1,x_2,y_2)\), and then \(S(y_1,f_1) \cup S(y_0,f_0) \subseteq S_1\) and \(S(y_2,f_2) \subseteq S_2\).
\(P = (y_1,x_1,y_2,x_2)\), and then \(S(y_1,f_1) \subseteq S_1\) and \(S(y_2,f_2) \subseteq S_2\).
The implications in each case are due to 3. Note that in any case, \(S(y_1,f_1) \subseteq S_1\) and \(S(y_2,f_2) \subseteq S_2\). Thus, by repeating the argument from the case where \(P\) was two tree-edges, we can eliminate the possibility that \(C\) has all its edges in the side of \(y_j\) in the cut defined by \(\{f_j\}\) for some \(1 \leq j < r\). Hence, \(C\) can either consist of two edges from \(\sigma\), or \(C = \{f_j\}\) for some \(j\). But as \(C\) keeps \(S(y_1,f_1)\) and \(S(y_2,f_2)\) on different sides, the possible options are (i) \(C = \{f_1\}\), (ii) \(C = \{f_2\}\), or (iii) \(C\) contains \(g\). We can eliminate some options according to the different cases:
Options (i) and (ii) are eliminated as they keep \(S(y_0,f_0)\) and \(S(y_3,f_3)\) on the same side.
Option (ii) is eliminated as it keeps \(S(y_1,f_1)\) and \(S(y_3,f_3)\) on the same side.
Option (i) is eliminated as it keeps \(S(y_0,f_0)\) and \(S(y_2,f_2)\) on the same side.
No option is eliminated.
So, in any case, the remaining options for \(C\) correspond to canonical cuts having an edge from \(P\). ◻
Proof of 8. For the proof, we need the following result; it is usually stated in terms of the flesh (see [14] and [13]), but the formulation here is equivalent.
Lemma 36. Let \(u,v \in V\) such that \(\phi_S (u) \neq \phi_S (v)\). If \(S_1,S_2\) is a valid partition of \(S\) that distinguishes \(u\) or \(v\) (or both), then there exists an \(S_1,S_2\)-minuct where \(u\) and \(v\) lie on different sides.
We now give the proof. Because (P1) and (P2) imply that \(\phi_S (x) \neq \phi_S (y)\), \(\pi_S (e)\) is indeed defined. We prove that \(\pi_S (x')\) is a prefix of \(\pi_S (e)\) from the \(x\)-endpoint); the proof for \(\pi_S (y')\) being a suffix is symmetric.
We start by showing that \(\pi_S (x')\) is contained in \(\pi_S (e)\), in two cases:
If \(x'\) is stretched: Then \(\pi_S (x')\) is a proper path with at least one edge. By the properties of the skeleton in 4 and the projection mapping in [thm:proj-vertex,thm:proj-edge], to show that \(\pi_S (x') \subseteq \pi_S (e)\), it is enough to prove the following statement: If a valid partition \(S_1,S_2\) of \(S\) distinguishes \(x'\), it also distinguishes \(e\). To see this, recall that \(\phi_S (x') \neq \phi_S (x')\) by P2, so 36 guarantees an \(S_1,S_2\)-mincut separating \(x'\) from \(y'\). By (P1), this implies an \(S_1,S_2\)-mincut where \(e\) is contributing.
If \(x'\) is non-stretched: Then \(\pi_S (x')\) is a tree-node, hence incident only to tree-edges; seeking contradiction, suppose none of these edges is from \(\pi_S (e)\). Note that if \(y'\) is stretched then \(\pi_S (y') \subseteq \pi_S (e)\) by case (i), and if \(y'\) is non-stretched then the node \(\pi_S (y')\) is different than \(\pi_S (x')\) by (P2) (as otherwise, \(x',y'\) would be \(S\)-equivalent). In any case, this means we can find a canonical cut \(C\) consisting of a tree-edge \(g\) incident to \(\pi_S (x')\), that keeps \(\pi_S (x')\) and \(\pi_S (y')\) on different sides. Let \(S_1,S_2\) be the valid partition corresponding to \(C\), where \(S_1\) are the terminals mapped to the side of \(\pi_S (x')\). Then by (the last item in) 5, any \(S_1,S_2\)-mincut separates \(x'\) from \(y'\). But by (P1), this means that \(S_1,S_2\) distinguishes \(e\), so the tree-edge \(g\) must in fact be in \(\pi_S (e)\) by 6 — contradiction.
Finally, we prove that \(\pi_S (x')\) is a prefix of \(\pi_S (e)\) from the side of the \(x\)-endpoint. Seeking contradiction, suppose otherwise. Then as \(\pi_S (e)\) contains \(\pi_S (x')\), we can find a canonical cut \(C\) of \(\mathcal{H}_S\) that keeps the \(x\)-endpoint of \(\pi_S (e)\) on one side, but keeps the \(y\)-endpoint along with \(\pi_S (x')\) on the other side. Let \(S_1\) and \(S_2\) be the terminal sets mapped to the sides of the \(x\)-endpoint and of the \(y\)-endpoint, respectively. Then by 6 there exists some \(S_1,S_2\)-mincut keeping \(x\) with \(S_1\) and \(y\) with \(S_2\). By (P1), this means that there is some \(S_1,S_2\)-mincut keeping \(x'\) with \(S_1\) (and \(y'\) with \(S_2\)). But \(\pi_S (x')\) lies on the side of \(C\) containing \(S_2\), so this is a contradiction to the last item in 5. ◻
Proof of 9. We first consider the simpler case where \(\mathcal{H}_S\) is a tree. Then, each \(C_i\) consists of one tree-edge with a marked endpoint. If two cuts \(C_i, C_j\) are the same edge with different marked endpoints, then the union is all of \(\mathcal{H}_\nu\) and we are done, so suppose the cut edges are distinct. Let \(C_1\) be the edge \(\{a_1,b_1\}\) with marked endpoint \(a_1\). We identify the marked side of \(C_1\) by a BFS from \(a_1\) that ignores the edge to \(b_1\). Suppose that during this BFS we scan an edge \(\{a_i, b_i\}\) from some cut \(C_i\), in the direction from the marked endpoint \(a_i\) and into the unmarked endpoint \(b_i\). This means that the marked side of \(C_1\) contains all of the unmarked side of \(C_i\), and vice versa. Thus, the union is all of \(\mathcal{H}_S\) and we are done. If this does not happen, we add the marked side of \(C_1\) to the union, delete it from the tree \(\mathcal{H}_\nu\) and continue the process on the remaining subtree with the surviving cuts among \(C_2, \dots, C_\ell\). The deletions ensure that the total time we spend to compute the union is only \(O(|S|)\). (Note that, when \(\mathcal{H}_S\) is a tree there can be only \(O(|S|)\) canonical cuts, so \(\ell = O(|S|)\).)
Now we consider the general case where \(\mathcal{H}_S\) is a cactus that can have cycles. Let us first focus on some cycle \(\sigma = (a_0, a_1, \dots, a_{k-1}, a_k = a_0)\) of length \(k\). Suppose that among the given cuts \(C_1, \dots, C_\ell\), there are \(r\) cuts having two cycle-edges from \(\sigma\). We identify each such cut with a marked interval on the cycle \(\sigma\): this is the interval between the marked endpoints of the two cycle-edges that define the cut, which leaves their unmarked endpoints out. Within \(O(k+r)\) time, we can create a list \(M_\sigma\) of all nodes of \(\sigma\) that lie in some marked interval; we defer the argument to the end of the proof. Next, we add to \(\mathcal{H}_S\) a dummy node \(a_\sigma\), and replace the cycle \(\sigma\) by a star of edges between \(a_\sigma\) and each node \(a_i \in \sigma\). Finally, we replace the \(r\) cuts in \(\sigma\) by \(|M_\sigma|\) one-edge cuts, consisting of the edges \(\{a_\sigma, a_i\}\) with \(a_i \in M_\sigma\) with marked endpoint \(a_i\). The union of marked sides of these new cuts is the same as for the original \(r\) cuts in the cycle \(\sigma\). Hence, executing this transformation maintains the same overall union of marked sides (ignoring the new dummy node \(a_\sigma\)). Because the cycles are edge-disjoint, and edge of the given \(\ell\) cuts corresponds comes from at most one cycle, the total time to eliminate them in this manner is \(O(|S| + \ell)\). At this point, we are left with a tree with \(O(|S|)\) nodes, and at most \(O(|S|)\) single tree-edge cuts marked sides, so we can compute the union in \(O(|S|)\) time as explained before. Thus, the total running time is \(O(|S| + \ell)\).
Finally, let us address the procedure for computing \(M_\sigma\), namely, uniting \(r\) intervals in a length-\(k\) cycle on \(\{0, 1 \dots, k-1\}\). By splitting each interval that wraps over the \(0\) into two, we get \(\leq 2r\) intervals of the form \([a,b]\), \(0 \leq a \leq b \leq k-1\), that have the same union. Sort these intervals by non-decreasing order of their starting points; this can be done in \(O(k+r)\) with Counting Sort. Now, in one pass over the sorted list, we merge overlapping intervals to obtain a new list of disjoint intervals with the same union. This takes \(O(k)\) time. We can then explicitly list all of the integers in this union within \(O(r)\) time. ◻
Proof of 10. Let \(\mathcal{T}_S\) be the tree obtained from \(\mathcal{H}_S\) by replacing cycles with stars as follows: for each cycle \(\sigma = (a_0, a_1, \dots, a_k = a_0)\) in \(\mathcal{H}_S\), add a new auxiliary node \(a_\sigma\) with edges into every node \(a_i\) in \(\sigma\), and delete the original edges of \(\sigma\). The auxiliary node \(a_\sigma\) also stores the cyclic order of its neighbors according to \(\sigma\), so the skeleton \(\mathcal{H}_S\) can be completely recovered from \(\mathcal{T}_S\). Note that \(\mathcal{T}_S\) also has \(O(|S|)\) nodes and edges. We root \(\mathcal{T}_S\) arbitrarily, and let each node in \(\mathcal{T}_S\) store its depth (i.e., its distance from the root). We store \(\mathcal{H}_S\) and \(\mathcal{T}_S\), along with an data structure for \(\mathcal{T}_S\) that has linear size in the number of nodes in the tree, and answers LCA or level-ancestor queries12 in constant time [37]–[39]. So, the total size of the data structure is \(O(|S|)\). We now describe how the different queries are answered.
(Cut side) There are two cases:
\(C\) consists of one tree-edge of \(\mathcal{H}_S\): Denote this edge by \(g = \{z_0,z_1\}\), where \(z_1\) is deeper than \(z_0\) in \(\mathcal{T}_S\). We make an LCA query between \(a\) and \(z_1\) in \(\mathcal{T}_S\): if the LCA is \(z_1\) than we return \(z_1\) as the endpoint on the side of \(a\), and otherwise we return \(z_0\).
\(C\) consists of two cycle-edges from the same cycle of \(\mathcal{H}_S\): Let \(\sigma = (z_0, z_1, \dots, z_k = z_0)\) be the cycle, denote the edges of \(C\) by \(g_1 = \{z_i, z_{i+1}\}\) and \(g_2 = \{z_j, z_{j+1}\}\), and suppose without loss of generality that \(0 \leq i < j < k\). Now, consider the path in \(\mathcal{T}_S\) from \(a\) to \(a_\sigma\). The penultimate node of this path is some \(z_\ell\) on \(\sigma\). If \(i+1 \leq \ell \leq j\), then we should report \(z_{i+1}\) and \(z_j\) as the endpoints on the side of \(a\). Otherwise, we should report \(z_i\) and \(z_{j+1}\). To find \(z_\ell\), we first make an LCA query between \(a_\sigma\) and \(a\). If the LCA is not \(a_\sigma\), then \(z_\ell\) must be the parent of \(a_\sigma\) in \(\mathcal{T}_S\). Otherwise, \(z_\ell\) must be the ancestor of \(a\) whose depth is smaller by 1 than the depth of \(a_\sigma\), so we find it with a level-ancestor query.
(Order on proper path) Let \(z_1 = a_1\), and \(z_i = \mathrm{LCA}_{\mathcal{T}_S} (z_{i-1}, a_i)\) for \(i = 2, \dots, k\), and denote \(z = z_k\). Thus, \(z\) is found within \(k\) ancestry queries. Note that the unique minimal proper path which contains \(a_1,\dots,a_k\) corresponds to a simple path in \(\mathcal{T}_S\) which preserves the same ordering, goes up the tree until it hits \(z\), and then either stops or continues down the tree. Thus, we just need to classify which \(a_i \neq z\) belongs to the “upward” part, and which to the “downward” part. At this point, we sort the \(a_i\)’s in those two parts according to increasing or decreasing order of depth, respectively. Finally, we concatenate the two sorted lists (possibly adding \(z\) in the middle, in case it is one of the \(a_i\)’s) and return this list as the ordering. For the classification process, we use \(k\) level-ancestor queries. For each \(a_i \neq z\), we find the ancestor of \(a_i\) whose depth is smaller by 1 than the depth of \(z\); there can be at most two children of \(z\) returned by these queries, and we can classify \(a_i\) according to the child found in its query.
(Terminals in intersection) The query algorithm is simple. Let \(F\) be the set of all edges contained in at least one of the cuts \(C_1, \dots, C_k\), so \(|F| \leq 2k\). For each endpoint \(a\) of an edge from \(F\), we check if \(a\) lies on the marked side of every \(C_i\) using cut side queries; let \(I\) be the set of all such \(a\)’s. Finally, we run multi-origin BFS from \(I\) in \(\mathcal{H}_S-F\), and let \(M\) be the set of nodes reached by this BFS. Namely, \(M\) are those nodes which are connected to some node in \(I\) by a path that does not have any edge from \(F\). Observe that \(M\) are precisely those nodes that lie on the marked sides of every cut in \(C_1, \dots, C_k\). Thus, \(S'\) consists of the terminals mapped into \(M\), so we report these.
Analyzing the running time of the BFS is a bit more involved. Note that it takes \(O(|M|+k)\) time (where the \(O(k)\) term is added since edges from \(F\) might still be encountered even though they are “ignored”). So, we show that \(|M| = O(|S'| + k)\), which yields the desired \(O(|S'| + k)\) running time.
Let \(H_1, \dots, H_r\) be the connected components of \(\mathcal{H}_S - F\) scanned by the BFS, so \(M = V(H_1) \cup \dots \cup V(H_r)\). Let \(S_i\) denote the set of terminals mapped into \(H_i\), and let \(f_i = \sum_{a \in V(H_i)} \deg_F (a)\). The crux of the argument is showing that \(|V(H_i)| \leq 3(|S_i| + f_i)\), which we will shortly do. Given that this holds, we sum over \(i\) and get that \[|M| = 3\sum_i |S_i| + 3\sum_i f_i = 3|S'| + 3\sum_i \sum_{a \in V(H_i)} \deg_F (a) \leq 3|S'| + 3\cdot 2|F| \leq 3|S'| + 12k\]
We now prove that \(|V(H_i)| \leq 3(|S_i| + f_i)\). Let us color the nodes of \(H_i\) black or white, where the black nodes are those that have mapped terminals. Let \(H'_i\) be obtained from \(H_i\) by adding \(f_i\) new edges, going into \(f_i\) new black nodes, such that each \(a \in V(H_i)\) gets \(\deg_F (a)\) new edges. Thus, for every node \(a \in V(H_i)\), we have \(\deg_{H'_i} (a) = \deg_{\mathcal{H}_S - F} (a) + \deg_F (a) = \deg_{\mathcal{H}_S} (a)\). Therefore, by the properties of the skeleton \(\mathcal{H}_S\) (see 4):
the white nodes in \(H'_i\) all have degree at least \(3\),
the cycles in \(H'_i\) contain only white nodes of degree exactly 3, and
each such cycle has length at least 4, and does not share nodes with any other cycle.
Let \(X_i\) be the nodes found in cycles of \(H'_i\), let \(Y_i\) be its remaining white nodes outside the cycles, and let \(Z_i\) be its black nodes. Consider the tree \(T_i\) obtained by contracting each cycle \(\sigma\) of \(H'_i\) into a (white) super-node \(a_\sigma\). Observe that \(\deg_{T_i} (a_\sigma)\) is the number of edges that leave the cycle \(\sigma\) in \(H'_i\). This number is equal to the length of the cycle \(\sigma\), because each node in \(\sigma\) cycle has two edges in \(\sigma\) and one additional edge going out of \(\sigma\). Therefore, the sum of degrees of super-nodes in \(T_i\) is precisely \(|X_i|\). Nodes in \(Y_i\) and \(Z_i\) have the same degree in \(T_i\) as in \(H'_i\), so the sum of degrees in \(Y_i\) is at least \(3|Y_i|\), and in \(Z_i\) it is at least \(|Z_i|\). We get that \[|X_i| + 3|Y_i| + |Z_i| \leq 2|E(T_i)| \leq 2|V(T_i)| \leq 2(|X_i|/4 + |Y_i| + |Z_i|) = |X_i|/2 + 2|Y_i| + 2|Z_i|.\] (where the last inequality is because there can be at most \(|X_i|/4\) super-nodes in \(T_i\), since each cycle in \(H'_i\) has at least 4 nodes). Rearranging the above inequality yields that \(|X_i| + 2|Y_i| \leq 2|Z_i|\). Using this, we finally get that \[|V(H_i)| \leq |V(H'_i)| = |X_i| + |Y_i| + |Z_i| \leq 3|Z_i| \leq 3(|S_i| + f_i),\] where the last inequality is because every node in \(Z_i\) except the \(f_i\) new nodes has a mapped terminal. ◻
Proof of 11. First, we store the same \(O(|S|)\) data structure as in 10. In particular, we store the tree \(\mathcal{T}_S\) (where each cycle \(\mathcal{H}_S\) is transformed into stars with an auxiliary center node), and the LCA and level-ancestor data structures for \(\mathcal{T}_S\) which support these queries in \(O(1)\) time.
Next, consider any proper path \(Q\) between the endpoints \(z_0\) and \(z_1\) in \(\mathcal{H}_S\). We explicitly store \(I(Q)\) only if one of the following conditions is met:
\(Q\) consists of a single cycle-edge of \(\mathcal{H}_S\).
\(z_0\) is a descendant of \(z_1\) in \(\mathcal{T}_S\), and their distance in \(\mathcal{T}_S\) is either \(2^j\) or \(2^j+1\) for some integer \(j \geq 0\).
Thus, each \(z_0\) can be an endpoint of at most \(O(\log |S|)\) distinct proper paths \(Q\) for which we store \(I(Q)\): indeed, case (i) can only occur twice because \(z_0\) can only be a part of one cycle, and case (ii) can only occur \(O(\log |S|)\) times because \(\mathcal{T}_S\) is of \(O(|S|)\) height. Therefore, in total, we only store \(O(|S| \log |S|)\) information of \(I(\cdot)\) for different proper paths.
We now show how a query is answered. Let \(a\) and \(b\) be the endpoints of the proper path \(P\) given as input. Let us first handle the case when \(a\) and \(b\) are related by ancestry in \(\mathcal{T}_S\), say \(b\) is an ancestor of \(a\). Afterwards, we will reduce the general case to this case. The algorithm is as follows. Initialize \(i = 1\) and \(a_1 = a\). While \(a_i \neq b\), do the following:
Let \(j\) be the largest integer such that the distance between \(a_i\) and \(b\) is at least \(2^j\).
By a level-ancestor query, find the ancestor \(z_i\) of \(a_i\) within distance exactly \(2^{j_i}\) from \(a_i\).
If \(z_i\) is an original node from \(\mathcal{H}_S\), then define \(a_{i+1} := z_i\).
Otherwise, \(z_i\) is an auxiliary node of \(\mathcal{T}_S\) corresponding to a cycle in \(\mathcal{H}_S\), and its parent \(z'_i\) in \(\mathcal{T}_S\) is an original node from that cycle. In this case, defined \(a_{i+1} = z'_i\).
Report the subpath \(P_i\) of \(P\) as the proper path between \(a_i\) and \(a_{i+1}\), along with its corresponding information \(I(P_i)\). Note that the latter is explicitly stored by the data structure, as the distance between \(a_i\) and \(a_{i+1}\) in \(\mathcal{T}_S\) is either \(2^j\) or \(2^j+1\).
Increment \(i \gets i+1\).
Thus, the \(i\)-th iteration of the while loop ensures that the distance between \(a_{i+1}\) and \(b\) in \(\mathcal{T}_S\) is at most half of the distance between \(a_i\) and \(b\). As the starting distance between \(a = a_1\) and \(b\) is at most \(O(|S|)\), there can be only \(O(\log |S|)\) iterations. As each iteration takes \(O(1)\) time, we also get the desired query time.
Finally, consider the case where \(a\) and \(b\) are not related by ancestry in \(\mathcal{T}_S\). Let \(c\) be the LCA of \(a,b\), which we find by one LCA query. If \(c\) is an original node from \(\mathcal{H}_S\), then \(c\) appears on the proper path \(P\) between \(a\) and \(b\). Thus, we just apply the query algorithm from before \(a,c\) and for \(b,c\), and concatenate the results. The remaining case is when \(c\) is an auxiliary node corresponding to a cycle \(\sigma\) in \(\mathcal{H}_S\). This means that the proper path \(P\) goes through exactly one edge of \(\sigma\). Furthermore, this edge must connect \(c_a\) and \(c_b\), which are, respectively, the children of \(c\) that are ancestors of \(a\) and of \(b\) in \(\mathcal{T}_S\). So, we find \(c_a\) and \(c_b\) by two level-ancestor queries, apply the algorithm for before on \(a,c_a\) and on \(b,c_b\), and concatenate the results along with \(I(\{c_a,c_b\})\) which we’ve explicitly stored. ◻
Proof of 12. Define a directed graph \(H\) on the vertices \(V\) whose edges are defined as follows: edge \((z,z')\) is not in \(E(H)\) iff (at least) one of the following conditions holds:
\(\pi_S (z) \neq \pi_S (z')\).
There exists an \(S\)-mincut \(W\) and a canonical cut \(C\) of \(\mathcal{H}_\mu\) such that \(z' \in W, z \in \overline{W}\) and \(C\) keeps the smaller-identifier endpoint of \(\pi_S (z)\) with \(S \cap W\) on one side, and the larger-identifier endpoint of \(\pi_S (z)\) with \(S \setminus W\) on the other.
Contract each SCC (strongly connected component) of \(H\), find a topological ordering of the resulting DAG, and define \(\sigma_S (z)\) as the place of the SCC containing \(z\) in the ordering.
Given this definition of the numbering \(\sigma_S\), let us prove its properties as stated in the lemma. We first prove the second item, which is more straightforward. Suppose \(\sigma_S (z_1) < \sigma_S (z_2)\). Then, the edge \((z_2,z_1)\) cannot exist in \(H\), as it would violate the topological ordering. So, by the definition of \(H\), one of the conditions (i) and (ii) must hold, but it cannot be (i) because \(\pi_S (z_1) = \pi_S (z_2)\). Thus, condition (ii) holds (where \(z = z_2\) and \(z' = z_1\)), but this condition is precisely what we need to prove.
We now prove the more involved first item. Because \(\phi_S (z_1) \neq \phi_S (z_2)\), there exists an \(S\)-mincut \(W\) which separates \(z_1\) from \(z_2\). Let \(C\) be the canonical cut of \(\mathcal{H}_S\) corresponding to the valid partition \(S \cap W, S \setminus W\). As \(P = \pi_S (z_1) = \pi_S (z_2)\), it is impossible that \(P\) lies completely on one side of \(C\); Indeed, if that were to happen, then \(z_1,z_2\) would be in the same side of every \(S \cap W, S \setminus W\)-mincut by 5, but \(W\) is such a cut keeping them on different sides. Hence, \(C\) keeps the endpoints \(a\) and \(b\) of \(P\) on different sides. We may assume that \(a\) is with \(S \cap W\) and \(b\) is with \(S \setminus W\) (otherwise, replace \(W\) by \(\overline{W}\)). Without loss of generality, say \(z_2 \in W\) and \(z_1 \in \overline{W}\) (the case \(z_1 \in W\) and \(z_2 \in \overline{W}\) is symmetric).
Now, suppose towards contradiction that \(\sigma_S (z_1) = \sigma_S (z_2)\), meaning \(z_1, z_2\) are in the same SCC. Take some path \((z_1 = v_0, v_1, \dots, v_k = z_2)\) from \(z_1\) to \(z_2\) in \(H\). Note that for each edge \((v_{i-1},v_i)\) on this path, condition (i) does not hold, meaning \(\pi_S (v_{i-1}) = \pi_S (v_i)\). Thus, we obtain that that \(\pi_S (v_i) = P\) for every \(v_i\) on the path. Now, consider the largest \(0 \leq r \leq k-1\) with \(v_r \in \overline{W}\) (which is well-defined since \(v_0 = z_1 \in \overline{W}\) and \(v_k = z_2 \in W\)). Then \(v_{r+1} \in W\). But now, \(W\) and \(C\) imply that condition (ii) holds for \((v_i, v_{i+1})\), contradicting the fact that this edge belongs to \(H\). ◻
In this section, we present two information-theoretic lower bounds on space for our data structure in 1. Our first lower bound is in undirected graphs for fixed \(s,t\)-mincut, and the second lower bound is in directed graphs for single-source mincuts.
Theorem 10. Let \(D\) be any data structure for undirected, unweighted, and simple graphs with a designated source and sink vertices \(s,t\), respectively. Given a query with an edge \(e\), \(D\) can determine whether the value of \(s,t\)-mincut is reduced after the failure of edge \(e\). Then, \(D\) must occupy \(\Omega(n)\) bits of space in the worst-case, irrespective of the query time.
Proof. Let \(B\in \{0,1\}^n\). Consider the following undirected, unweighted, and simple graph \(H=(V_H,E_H)\) on \(|V_H|=2n+2\) vertices. The vertices in \(V_H\) are \(x_1,x_2,\cdots,x_n, y_1,y_2,\cdots,y_n\), a designated source vertex \(s\), and a designated sink vertex \(t\). The edge set \(E_H=E_M \cup \{\{s,x_i\},\{y_i,t\}~|~i\in [n]\}\), where \(E_M=\{\{x_i,y_i\}~|~B[i]=1\}\). It is easy to observe that \(|E_M|\) is the maximum number of edge-disjoint paths between \(s\) and \(t\). Each such path is of the form \(\langle s, x_i, y_i, t \rangle\) if \(\{x_i,y_i\}\in E_m\). So, the value of \(s,t\)-mincut is \(|E_M|\). Therefore, in any maximum \(s,t\)-flow, every edge in \(E_M\) is fully saturated. By strong duality of maximum flow and mincut, every edge in \(E_M\) contributes to the \(s,t\)-mincut \(C=\{s\}\cup \{x_1,x_2,\cdots, x_n\}\). Furthermore, observe that each \(x_i\) has degree \(2\) with exactly one edge contributing to \(C\) iff \(\{x_i,y_i\}\in E_M\). If we take \(x_i\) out of \(C\), then \(C\setminus \{x_i\}\) is of the same capacity as the \(s,t\)-mincut iff \(\{x_i,y_i\}\in E_M\). So, edge \(\{x_i,y_i\}\) exists iff edge \(\{s,x_i\}\) contributes to an \(s,t\)-mincut. Therefore, the following fact is immediate from the construction of \(H\).
For any \(i\in[n]\), \(B[i]=1\) if and only if \(s,t\)-mincut value reduces after the failure of edge \(\{s,x_i\}\).
It follows from the above fact that any data structure \(D\) that can determine whether the value of \(s,t\)-mincut reduces after failure of any edge given as a query, we can determine using \(D\) the value of \(B[i]\) for every \(i\in [n]\). Therefore, data structure \(D\) must occupy at least \(\Omega(n)\) bits of space in the worst case. ◻
Theorem 11. Let \(D\) be any data structure for directed, unweighted, and simple graphs with a designated source vertex \(s\) that, given any edge \(e\) and a vertex \(u\), can determine whether the capacity of \((s,u)\)-mincut is reduced after failure of edge \(e\). Then, \(D\) must occupy \(\Omega(n^2)\) bits of space in the worst-case, irrespective of the query time.
Proof. Let \(B\) be an \(n\times n\) binary matrix. Consider the following directed, unweighted, and simple graph \(H=(V_H,E_H)\) on \(|V_H|=2n+1\) vertices. The vertices in \(V_H\) are \(x_1,x_2,\cdots,x_n, y_1,y_2,\cdots,y_n\), and a designated source vertex \(s\). The edge set \(E_H=E_M \cup \{(s,x_i)~|~i\in [n]\}\), where \(E_M=\{(x_i,y_j)~|~B[i,j]=1,~ i,j\in [n]\}\). Observe that for each \(j\in [n]\), the number of edge-disjoint paths from \(s\) to \(y_j\) is the same as the indegree of \(y_j\). Each such path is of the form \(\langle s, x_i, y_j \rangle\), for some \(i\in [n]\), if \((x_i,y_j)\in E_M\). So, the \((s,y_j)\)-mincut value is the indegree of \(y_j\). It follows that, in any maximum \((s,y_j)\)-flow, every edge incident on \(y_j\) is fully saturated. By the strong duality of maximum flow and mincut, \(V_H\setminus \{y_j\}\) is a \((s,y_j)\)-mincut, where each incoming edge of \(y_j\) contributes. Therefore, the following fact is immediate from the construction of \(H\).
For any \(i,j\in[n]\), \(B[i,j]=1\) if and only if \((s,y_j)\)-mincut value reduces after the failure of edge \(\{s,x_i\}\).
Let \(D\) be any data structure that, given any vertex \(u\) and an edge \(e\) as a query, can determine whether the value of \((s,u)\)-mincut is reduced after the failure of edge \(e\). By using the above equivalence, we can use \(D\) for graph \(H\) to determine the value of \(B[i,j]\) for every \(i,j\in [n]\). Therefore, data structure \(D\) must occupy \(\Omega(n^2)\) bits of space in the worst case. ◻
The following is an immediate corollary of 11.
Corollary 3. Let \(D\) be any data structure for directed, unweighted, and simple graphs with a designated source vertex \(s\) that, given any edge \(e\), can report each vertex \(u\) such that the \((s,u)\)-mincut value is reduced after failure of edge \(e\). Then, \(D\) must occupy \(\Omega(n^2)\) bits of space in the worst-case, irrespective of the query time.
In this section, we prove the insertion variant of 2. The data structure (for both items of 2) stores the nearest mincut tree \(\mathcal{T}\) and the farthest mincut DAG \(\mathcal{D}\) along with data structures that support constant-time ancestry queries for both. For \(\mathcal{T}\), we can use any of-the-shelf \(O(n)\) space ancestry data structure (e.g. [40]). For \(\mathcal{D}\), we use the \(O(n^{1.5})\) space data structure from 31. Thus, the total space is \(O(n^{1.5})\).
We start with the simple query algorithm for [item:faster-queries-one-vertex]: given an inserted edge \(e = \{x,y\}\) and vertex \(u \in V \setminus \{s\}\), we wish to determine whether the \(u,s\)-mincut value increases after \(e\) is inserted, within \(O(1)\) time. As discussed in 3.1, this happens iff \(u \in \mathcal{T}^{\uparrow}(x) \setminus \mathcal{D}^{\uparrow}(y) \cup \mathcal{T}^{\uparrow}(y) \setminus \mathcal{D}^{\uparrow}(x)\). To detect this situation, we just need to determine the ancestry relations between \(\mathcal{T}(u)\) and \(\mathcal{T}(x),\mathcal{T}(y)\), and between \(\mathcal{D}(u)\) and \(\mathcal{D}(x),\mathcal{D}(y)\), which we can do within \(O(1)\) time using the ancestry data structures.
We now focus on the query algorithm for [item:faster-queries-reporting-all]: given an inserted edge \(e = \{x,y\}\), we wish to report the set \(X\) of all vertices \(u \in V \setminus \{s\}\) such that the value of \(u,s\)-mincut increases after \(e\) is inserted, within \(O(|X|)\) time. For this, we use ideas introduced by [3]. We first observe the following:
Observation 12. 1. The partition of \(V\) by the nodes of \(\mathcal{T}\) refines its partition by the nodes of \(\mathcal{D}\).
2. If \(\nu,\mu\) are two nodes of \(\mathcal{T}\) such that \(\nu\) is an ancestor of \(\mu\) in \(\mathcal{T}\), then the node containing \(\nu\) in \(\mathcal{D}\) is an ancestor of the node containing \(\mu\) in \(\mathcal{D}\).
Proof. 1. Suppose \(u,w\) are two vertices from the same node of \(\mathcal{T}\). This means that \(u \in \mathsf{Near}(w,s) \subseteq \mathsf{Far}(w,s)\) and \(w \in \mathsf{Near}(u,s) \subseteq \mathsf{Far}(u,s)\), and hence \(u \in \mathcal{D}^{\uparrow}(w) \cap \mathcal{D}_{\downarrow}(w) = \mathcal{D}(w)\).
2. Take any \(w \in \mu\) and \(u \in \nu\), then \(w \in \mathcal{T}_{\downarrow}(u) = \mathsf{Near}(u,s) \subseteq \mathsf{Far}(u,s) = \mathcal{D}_{\downarrow}(u)\), and thus \(\mathcal{D}(w)\) is a descendant of \(\mathcal{D}(u)\). ◻
Recall that, by the previous discussion, \(X = \mathcal{T}^{\uparrow}(x) \setminus \mathcal{D}^{\uparrow}(y) \cup \mathcal{T}^{\uparrow}(y) \setminus \mathcal{D}^{\uparrow}(x)\). So, by 12, we conclude that for any node \(\nu\) of \(\mathcal{T}\), either \(\nu \cap X\) is all of \(\nu\), or it is \(\emptyset\); we call \(\nu\) relevant if the former holds. Also, 12 implies that \(X_1 = \mathcal{T}^{\uparrow}(x) \setminus \mathcal{D}^{\uparrow}(y)\) and \(X_2 = \mathcal{T}^{\uparrow}(y) \setminus \mathcal{D}^{\uparrow}(x)\) are disjoint: indeed, if \(v \in X_1\) then \(\mathcal{T}(v)\) is an ancestor of \(\mathcal{T}(x)\), so \(\mathcal{D}(v)\) is an ancestor of \(\mathcal{D}(x)\), and thus \(v \notin X_2\). We now arrive at the key insight of [3]:
Lemma 37 ([3]). The relevant nodes of \(\mathcal{T}\) form at most two contiguous upwards paths in \(\mathcal{T}\), and each such path starts either at \(\mathcal{T}(x)\) or at \(\mathcal{T}(y)\).
Proof. Fix a relevant node \(\nu\), and say without loss of generality that \(\nu \subseteq X_1\). Then \(\nu\) is an ancestor of \(\mathcal{T}(x)\), and we should show that every node \(\mu\) on the path between them is also contained in \(X_1\). Because \(\mu\) is an ancestor of \(\mathcal{T}(x)\), we just need to show that no \(w \in \mu\) belongs to \(\mathcal{D}^{\uparrow}(y)\). Seeking contradiction, suppose there is such \(w\). Take any \(u \in \nu\), then because \(\nu = \mathcal{T}(u)\) is an ancestor of \(\mu = \mathcal{T}(w)\), 12 yields that \(\mathcal{D}(u)\) is an ancestor of \(\mathcal{D}(w)\), and hence also of \(\mathcal{D}(y)\), but then \(u \in \nu \cap \mathcal{D}^{\uparrow}(y) \subseteq X_1 \cap \mathcal{D}^{\uparrow}(y) = \emptyset\), a contradiction. ◻
We thus get the following query algorithm: Find all relevant nodes in \(\mathcal{T}\) by walking upwards, once from \(\mathcal{T}(x)\) and once from \(\mathcal{T}(y)\); whenever a node is encountered in the walk, check if it is relevant within \(O(1)\) time by using \(O(1)\) ancestry queries in \(\mathcal{T}\) and \(\mathcal{D}\), and halt if an irrelevant node is reached. This procedure visits at most two irrelevant nodes and all the useful nodes, which are at most \(O(|X|)\); then, we report the set \(X\) of all vertices inside the relevant nodes, which again takes \(O(|X|)\) time.
Weizmann Institute of Science, Israel. Email: koustav.bhanja@weizmann.ac.il. Supported by the Koshland Prize fellowship, and Merav Parter’s European Research Council (ERC) grant under the European Union’s Horizon 2020 research
and innovation programme, grant agreement No. 949083.↩︎
Weizmann Institute of Science, Israel. Email: merav.parter@weizmann.ac.il. Supported partially by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme, grant agreement
No. 949083.↩︎
Weizmann Institute of Science, Israel. Email: asaf.petruschka@weizmann.ac.il. Supported by an Azrieli Foundation fellowship, and by Merav Parter’s European Research Council (ERC) grant under the European Union’s Horizon 2020
research and innovation programme, grant agreement No. 949083.↩︎
More accurately, the improvement would be to [item:faster-queries-reporting-all] of 2; for [item:faster-queries-one-vertex] we also need fast LCA queries on the DAG, which are more general than just reachability.↩︎
A trivial extension of 2(2) incurs an additional \(O(n)\) time to report all affected pairs from \(V\times V\).↩︎
Usually, a cactus only means that no edge is shared by two cycles, but we only deal with cacti having node-disjoint cycles.↩︎
The mapping \(\pi_S (\cdot)\) need not be surjective, i.e., there could be nodes of \(\mathcal{H}_S\) without mapped terminals.↩︎
If \(x\) is non-stretched, this means that the node \(\pi_S (x)\) is the \(x\)-endpoint of \(\pi_S (e)\), and similarly with \(y\).↩︎
Here and througout, “to separate \(x,y\)” is shorthand for “to separate \(\{x\},\{y\}\)”.↩︎
For a node \(\mu\), we naturally denote \(\mathcal{D}^{\uparrow}(\mu)\) and \(\mathcal{D}_{\downarrow}(\mu)\) for the sets of vertices in ancestors and in descendants of \(\mu\), respectively.↩︎
Similarly to trees, an LCA of two nodes in a DAG is a common ancestor of them, which does not have any child that is also a common ancestor. Unlike trees, there could be several LCAs, but they must be unrelated by ancestry.↩︎
A level-ancestor query gets node \(a\) and non-negative integer \(d\), and returns the ancestor of \(a\) that has depth \(d\) (or a null value if \(a\) has depth smaller than \(d\).)↩︎