% Options for packages loaded elsewhere \PassOptionsToPackage{unicode}{hyperref} \PassOptionsToPackage{hyphens}{url} \documentclass[ ]{article} \usepackage{xcolor} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb} \setcounter{secnumdepth}{-\maxdimen} % remove section numbering \usepackage{iftex} \ifPDFTeX \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{textcomp} % provide euro and other symbols \else % if luatex or xetex \usepackage{unicode-math} % this also loads fontspec \defaultfontfeatures{Scale=MatchLowercase} \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} \fi \usepackage{lmodern} \ifPDFTeX\else % xetex/luatex font selection \fi % Use upquote if available, for straight quotes in verbatim environments \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class \IfFileExists{parskip.sty}{% \usepackage{parskip} }{% else \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt}} }{% if KOMA class \KOMAoptions{parskip=half}} \makeatother \usepackage{longtable,booktabs,array} \newcounter{none} % for unnumbered tables \usepackage{calc} % for calculating minipage widths % Correct order of tables after \paragraph or \subparagraph \usepackage{etoolbox} \makeatletter \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} \makeatother % Allow footnotes in longtable head/foot \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}} \makesavenoteenv{longtable} \usepackage{graphicx} \makeatletter \newsavebox\pandoc@box \newcommand*\pandocbounded[1]{% scales image to fit in text height/width \sbox\pandoc@box{#1}% \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}% \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}% \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}% \else\usebox{\pandoc@box}% \fi% } % Set default figure placement to htbp \def\fps@figure{htbp} \makeatother \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \usepackage{bookmark} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available \urlstyle{same} \hypersetup{ hidelinks, pdfcreator={LaTeX via pandoc}} \author{} \date{} \begin{document} \section{Near-Linear Preprocessing for Reachability After Two Vertex Failures in DAGs and Reducible Flowgraphs}\label{near-linear-preprocessing-for-reachability-after-two-vertex-failures-in-dags-and-reducible-flowgraphs} Idris Ali Shaik\\ Independent researcher (unaffiliated)\\ shaikidris@apache.org \textbf{Version 1.4.1, 29 November 2026.} \subsection{Abstract}\label{abstract} We construct a single-source reachability oracle for directed acyclic graphs and reducible flowgraphs. After preprocessing, a query specifies a target and up to two failed vertices and asks whether a path to the target survives. For \(n\) vertices and \(m\) arcs, the deterministic construction takes \(O((n+m)\log(n+2))\) time and \(O(n+m)\) working words. The oracle retains \(O(n)\) words and answers in \(O(1)\) worst-case time. The construction groups vertices by their immediate dominator. Within each group, the pairs whose deletion disconnects another vertex form a forest. An identity for exits from dominator subtrees reduces a query to a constant number of tree-path extrema. The same preprocessing bound gives a subgraph with at most four incoming arcs per vertex preserving all two-failure answers. When the target is fixed before preprocessing, we obtain the same space and query bounds for three arbitrary vertex failures. A Lean 4 formalization of Theorem 1.1, including its resource bounds, is registered with \href{https://palomar-registry.org/entry?id=PALOMAR-2026-11-29-000076&version=1}{Palomar}. \subsection{1. The oracle}\label{the-oracle} A single vertex \(a\) disconnects a reachable target \(t\) from a source \(r\) exactly when every \(r\)-to-\(t\) path visits \(a\). The dominator tree stores that relation for every target. Two vertices can disconnect \(t\) even if neither lies on every path. For this problem Choudhary gives a linear-space, constant-query-time oracle for general directed graphs with \(O(mn)\) preprocessing {[}Cho16, Cho17{]}. We ask whether one can retain these query and space bounds while building the oracle in near-linear time when the graph is acyclic. \hyperref[statement-1-1]{Theorem 1.1} does so and also applies to reducible flowgraphs. The graph is given by adjacency lists with \(n\ge1\) vertices, \(m\) arc occurrences and a specified source \(r\). Parallel arcs are allowed. Write \(L=\lceil\log_2(n+2)\rceil\). For a set \(F\) of failed vertices let \(R(F)\) be the vertices reachable from \(r\) in \(G-F\). A path may have length zero, and \(R(F)=\varnothing\) if \(r\in F\). Each query starts from the original graph. A vertex dominates another if it lies on every path from the source to that vertex. A flowgraph is \emph{reducible} exactly when removing the arcs whose heads dominate their tails leaves a DAG {[}HU74{]}. The cyclic case below assumes reducibility on the vertices reachable from \(r\). Costs count deterministic operations on words of \(\Theta(\log(n+m+2))\) bits, or \(\Theta(\log(S+2))\) bits for an explicit batch of size \(S\). \hypertarget{statement-1-1}{} \textbf{Theorem 1.1 (two-failure reachability oracle).} For a DAG or a reducible flowgraph with fixed source \(r\), one can construct an index in \(O((n+m)L)\) time and \(O(n+m)\) working words. The index occupies \(O(n)\) words. Given any original target \(t\) and any set \(F\) of at most two original vertices after construction, it decides whether \(t\in R(F)\) in \(O(1)\) worst-case time. The index retains the original tail of each arc leaving a dominator subtree. A failure inside the subtree may disable some exits and leave others reachable. All the tails disabled by that failure lie in one interval of dominator-tree preorder. It therefore suffices to know the smallest and largest ranks of the tails whose exits lead to the target. Sections 2 and 3 identify the separating pairs. \hyperref[statement-4-1]{Theorem 4.1} expresses the exits at one pair in terms of the exits at its child. Section 5 uses this identity to recover the two extrema in constant time. \hypertarget{statement-1-2}{} \textbf{Corollary 1.2 (listed target sets).} Suppose \(q\) queries specify failure sets \(F_i\) of size at most two and explicit target lists \(T_i\). Put \(M=\sum_i|T_i|\) and \(S=n+m+q+M\). Computing one Boolean \([T_i\cap R(F_i)\ne\varnothing]\) per list takes \(O((n+m)L+q+M)\) total time and \(O(S)\) working words, including construction. A single list given later takes \(O(1+|T_i|)\) time. \emph{Proof.} Build the oracle once. Scan each list until a target survives or the list is exhausted. This makes at most \(M\) constant-time probes. Reading the failure sets and writing the \(q\) answers costs \(O(q)\), including empty lists. \ensuremath{\square} \hypertarget{statement-1-3}{} \textbf{Corollary 1.3 (three failures with a fixed target).} Fix \(t\) as well as \(r\) before construction on a DAG or a reducible flowgraph. An index built in \(O((n+m)L)\) time and \(O(n+m)\) working words retains \(O(n)\) words and decides whether \(t\in R(F)\) in \(O(1)\) worst-case time for any later set \(F\) of at most three vertices. Two targets fixed in advance can both be answered within the same bounds. The proof in Section 6 orders three internal failures along the DAG. A path survives if it can bypass the last failure from a tail reachable after the first two. With a fixed target, we can prepare the candidate tails for every position of the last failure. \hyperref[statement-6-2]{Corollary 6.2} selects a subgraph that preserves all two-failure answers using at most \(4(n-1)\) original arcs. {\def\LTcaptype{none} % do not increment counter \begin{longtable}[]{@{} >{\raggedright\arraybackslash}p{(\linewidth - 8\tabcolsep) * \real{0.1667}} >{\raggedright\arraybackslash}p{(\linewidth - 8\tabcolsep) * \real{0.1667}} >{\raggedleft\arraybackslash}p{(\linewidth - 8\tabcolsep) * \real{0.2222}} >{\raggedleft\arraybackslash}p{(\linewidth - 8\tabcolsep) * \real{0.2222}} >{\raggedleft\arraybackslash}p{(\linewidth - 8\tabcolsep) * \real{0.2222}}@{}} \toprule\noalign{} \begin{minipage}[b]{\linewidth}\raggedright Single-source oracle \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright Failures and target \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft Build time \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft Retained words \end{minipage} & \begin{minipage}[b]{\linewidth}\raggedleft Query time \end{minipage} \\ \midrule\noalign{} \endhead \bottomrule\noalign{} \endlastfoot Choudhary, general digraphs {[}Cho17, Theorem 3.2{]} & Up to two vertices, any later target & \(O(mn)\) & \(O(n)\) & \(O(1)\) \\ \hyperref[statement-1-1]{Theorem 1.1}, DAGs and reducible flowgraphs & Up to two vertices, any later target & \(O((n+m)L)\) & \(O(n)\) & \(O(1)\) \\ \hyperref[statement-1-3]{Corollary 1.3}, same graph classes & Up to three vertices, fixed target & \(O((n+m)L)\) & \(O(n)\) & \(O(1)\) \\ \hyperref[statement-5-3]{Proposition 5.3}, Lean-verified implementation on DAGs & Up to two vertices, any later target & \(O((n+m)L^2)\) & \(O(n)\) & \(O(L)\) \\ \end{longtable} } \textbf{Related work.} Choudhary tests for detours around failed vertices on two independent spanning trees {[}Cho16, Theorem 13{]}. Our preprocessing uses topological order, first to find the separating pairs and then to compute the exits between them. Teslenko and Dubrova construct a linear-size representation of all double dominators of a given vertex in linear time {[}TD15{]}. In our path orientation this fixes the target. Teslenko describes the quadratic cost of building separate chain representations for all vertices {[}Tes08, §3.9{]}. Teslenko, Dubrova and Tenhunen combine the prepared dominator chains of \(k\) supplied circuit vertices in \(O(k\log n)\) time {[}TDT06, §§5--6{]}. Theorem 1.1 constructs one index from the input graph and accepts the target at query time. The graph on siblings in the dominator tree is Tarjan's derived graph {[}GT15, §3{]}. For binary decision diagrams, Karplus represents two-cuts by child pairs linked to the next cut and gives a quadratic-time construction {[}Kar88, §§2.3--2.4{]}. Here the sibling graph retains original arc tails, the cut forest permits arbitrary indegrees, and exit information passes between adjacent cuts. Proposition 5.3 states the bounds of the DAG implementation verified in Lean 4 {[}ShaL26{]}. \subsection{2. Where a surviving path can leave a block}\label{where-a-surviving-path-can-leave-a-block} Discard vertices unreachable from \(r\), retaining a translation for original identifiers. They can never become reachable through deletions. Also discard them from failure sets. On the retained graph, \(a\) \emph{dominates} \(v\) if every \(r\)-to-\(v\) path contains \(a\). The dominators of \(v\) are its ancestors in a tree \(\mathcal D\) rooted at \(r\). Write \(D(a)\) for the subtree rooted at \(a\), including \(a\). Thus deleting \(a\) loses exactly \(D(a)\). We can find \(\mathcal D\) within \(O((n+m)L)\) time and linear working space by the simple Lengauer--Tarjan algorithm {[}LT79{]}. \textbf{Removing cycles in a reducible flowgraph.} After finding \(\mathcal D\) on the reachable graph, remove every arc \(x\to w\) for which \(w\) dominates \(x\), including self-loops. A simple surviving path could use such an arc only by visiting \(w\) twice, since its prefix to \(x\) already contains \(w\). Every reachable target admits a simple path. Deleting all these arcs together therefore preserves \(R(F)\) for \emph{every} vertex-failure set \(F\). The Hecht--Ullman characterization {[}HU74{]} says the remaining graph is acyclic exactly when the reachable flowgraph is reducible. Dominator preorder intervals test every arc in one scan. Ordinary dominators are preserved as well, since the reachable sets after single deletions agree. In the sequel \(G\) denotes this reachable DAG. For a vertex \(d\) of \(\mathcal D\) with children, call each child subtree \(D(u)\) a \emph{block} of \(d\). Define \(H_d\) to have root \(d\) and one vertex for each child. An original arc \(x\to y\) is assigned to \(d=\operatorname{idom}(y)\), the parent of \(y\) in \(\mathcal D\). If \(x=d\), insert \(d\to y\). Otherwise insert \(u\to y\), where \(u\) is the child above \(x\). In both cases label the inserted arc with its original tail \(x\). Two arcs with the same quotient endpoints may have different labels. \hypertarget{statement-2-1}{} \textbf{Lemma 2.1 (sibling quotients).} Each \(H_d\) is a rooted DAG in which deleting any nonroot vertex loses only that vertex. Paths through the blocks project to paths in \(H_d\), and a quotient path lifts through any chosen sequence of its labelled arcs. Across all \(d\) there are at most \(2n\) vertex copies and one quotient arc per retained original arc. \emph{Proof.} Any arc into a strict descendant of \(u\) from outside \(D(u)\) would allow a source path to that descendant avoiding \(u\). Thus entry from outside a block is at its root. Every vertex of the block has an internal path from its root. Indeed, a source path to it passes through the root and could only reenter at that root, which acyclicity prevents. The same reasoning applies to \(D(d)\). Every strict dominator of \(y\) dominates the tail \(x\) of an entering arc, since any source path to \(x\) extends to \(y\). The tail lies outside \(D(y)\), since otherwise \(y\) would precede \(x\), contradicting the arc \(x\to y\). The quotient arc is therefore well defined, and its tail precedes its head in original topological order. Project an original path segment starting at \(d\) and ending at a child of \(d\) by replacing each visit to a block by its root. Conversely, upon entering a block, follow an internal path to the original tail of the next specified arc. This lifts the quotient path, including the choice among parallel exits. For distinct children \(u,y\), the vertex \(u\) does not dominate \(y\). A path to \(y\) avoiding \(u\) avoids its whole block. The suffix from \(d\) projects to a path avoiding \(u\) in \(H_d\). Hence every nonroot vertex there has immediate dominator \(d\). Each child occurs once as a child and at most once as a quotient root. Arc assignment uses the unique parent of its head. \ensuremath{\square} If the source fails, or if an original target was discarded, the answer is immediate. A single retained failure is handled by a dominator ancestry test. For two comparable failures the higher one suffices, since every source path visiting the lower one also visits the higher one. Suppose henceforth \(a,b\) are incomparable in \(\mathcal D\). Let \(d\) be their lowest common ancestor and \(u,v\) the distinct children of \(d\) above them. Write \(B=\{u,v\}\). For a pair \(B\) in \(H_d\), let \(Z(B)\) be all vertices lost on deleting \(B\), including \(B\), and let \(J(B)=Z(B)\smallsetminus B\) be its \emph{proper losses}. For \(y\in J(B)\) and \(s\in B\), let \(X^B_s(y)\) be the set of original tails on quotient arcs \(s\to w\) such that \(w\) reaches \(y\) in \(H_d-B\). A direct arc to \(y\) qualifies. Both endpoint sets are nonempty. Deleting the other endpoint alone preserves \(y\), and the surviving path must visit \(s\). Its last exit from \(s\) supplies a tail. Number the vertices of the original dominator tree in preorder. The ranks in \(D(a)\) form the half-open interval \(I(a)=[\operatorname{tin}(a),\operatorname{tout}(a))\), where \(\operatorname{tout}(a)\) is the first rank after the subtree. For a nonempty set \(X\) of original vertices write \[ \sigma(X)=\bigl[\min_{x\in X}\operatorname{tin}(x),\,\max_{x\in X}\operatorname{tin}(x)\bigr], \qquad \sigma^B_s(y)=\sigma(X^B_s(y)). \] Set \(\sigma(\varnothing)=\varnothing\). \hypertarget{statement-2-2}{} \textbf{Lemma 2.2 (last-exit test).} Every target outside \(D(d)\), and \(d\) itself, survives. A target in \(D(u)\) survives precisely when \(a\) does not dominate it, with the symmetric rule for \(D(v)\). For a target in a third block \(D(y)\), it survives if \(y\notin J(B)\). If \(y\in J(B)\), it survives precisely when \[ \sigma^B_u(y)\nsubseteq I(a)\quad\text{or}\quad \sigma^B_v(y)\nsubseteq I(b). \] \emph{Proof.} Outside \(D(d)\) there is a path avoiding \(d\), so it avoids both failures. The two failures follow \(d\) in topological order. To reach a target in \(D(u)\) that \(a\) does not dominate, first reach \(u\) avoiding \(b\). This prefix avoids \(a\), a strict descendant of \(u\) in this case. Take the internal suffix of a path to the target avoiding \(a\). It avoids \(b\) because it stays in \(D(u)\). If \(a=u\), every target of this block is lost. The same argument applies in \(D(v)\). A third block has no internal failure, so reaching \(y\) suffices. A quotient path avoiding \(B\) lifts by Lemma 2.1. Otherwise, consider a surviving physical path and its last exit from either of the two failure blocks. Its tail is reachable, and the remaining quotient path avoids \(B\). Conversely, any such reachable tail extends to \(y\) along the labelled arc and its continuation through failure-free blocks. The preceding within-block test determines which tails are reachable. For nonempty \(X\), all its tails lie in \(D(a)\) precisely when its smallest rank is at least \(\operatorname{tin}(a)\) and its largest rank is strictly below \(\operatorname{tout}(a)\). Applying these two comparisons at each endpoint gives the displayed test. \ensuremath{\square} \subsection{3. A forest of separating pairs}\label{a-forest-of-separating-pairs} Fix one sibling quotient \(H\) with root \(\rho\). Its dominator tree is flat, which means every nonroot vertex is a child of \(\rho\). We use \(B\) only for pairs of distinct nonroot vertices. Many pairs have no proper loss. Those with a proper loss can all be found in one topological sweep. \hypertarget{statement-3-1}{} \textbf{Lemma 3.1 (forest of proper losses).} There is a rooted forest with one node for each pair \(B\) with \(J(B)\ne\varnothing\), and a label \(c(y)\) for each vertex of \(H\). Adjoin an artificial root \(0\) above all forest roots, allowing \(c(y)=0\). For every real pair \(B\), \(y\in J(B)\) precisely when \(B\) is an ancestor of \(c(y)\), with ancestry inclusive. A real child \(P\) of a real parent \(B\) satisfies \(P\subseteq Z(B)\) and \(J(P)\subseteq J(B)\). Every vertex in \(P\smallsetminus B\) follows both endpoints of \(B\) in topological order. There are at most \(|V(H)|\) real forest nodes. \emph{Proof.} A proper loss of a pair follows both endpoints. Before its later endpoint, that deletion has no effect and the earlier endpoint alone loses only itself. Consider the first proper loss. Every predecessor is already lost, so each belongs to the pair. There must be two distinct predecessors, since a unique nonroot predecessor would by itself disconnect the vertex. Thus the two predecessors are precisely the failed pair. Each pair with a proper loss has such a first vertex, and the vertex determines the pair. Now process \(H\) in topological order. At \(\rho\) and at vertices with an arc directly from \(\rho\), use label \(0\). Assume the statement about ancestor labels holds for earlier vertices. Every earlier real forest edge from \(B\) to \(P\) was installed with \(P\subseteq Z(B)\). This implies \(Z(P)\subseteq Z(B)\) even for future vertices. Indeed, a path surviving \(B\) cannot visit an unreachable vertex, so avoids \(P\). At another vertex \(y\), let \(m_y\) be the latest distinct predecessor. A pair that properly loses \(y\) must lose all its predecessors. If that pair omits \(m_y\), it properly loses \(m_y\) and occurs on the ancestor path of \(c(m_y)\). On that path the real pairs losing every predecessor form a prefix starting nearest the artificial root, by the nesting of the \(Z\) sets. Let \(B_*\) be the deepest such pair, or \(0\) for an empty prefix. Conversely every real pair in this prefix properly loses \(y\), since its endpoints already precede \(m_y\). If a pair contains \(m_y\), each other predecessor can be lost only by being its other endpoint. It precedes \(m_y\) and a singleton deletion disconnects only itself. Since \(y\) has no direct source arc, it has at least two distinct predecessors. The only additional pair is therefore \(P=\{p,m_y\}\) when these are exactly its predecessors. Install \(P\) immediately below \(B_*\), and set \(c(y)=P\). If this key already occurs, reuse the node. Its parent is determined by the labels and raw memberships at \(p,m_y\), fixed when those vertices were processed. If there is no additional pair, use \(c(y)=B_*\). Whenever \(B_*\) is real, both endpoints of the new pair belong to \(Z(B_*)\), as required for the induction. A pair first encountered at this step cannot acquire an earlier proper loss by the first-vertex argument. The proper-loss sets are now inverse images under \(c\) of forest subtrees. This gives \(J(P)\subseteq J(B)\). A fresh endpoint in \(P\smallsetminus B\) lies in \(Z(B)\smallsetminus B\), so the initial topological observation places it after both old endpoints. \ensuremath{\square} \hypertarget{statement-3-2}{} \textbf{Lemma 3.2 (constructing the forest).} On a flat quotient with \(n_H\) vertices and \(m_H\) labelled arcs, the labels \(c(y)\) and the pair forest can be built in \(O((n_H+m_H)L)\) time and \(O(n_H+m_H)\) working words. The labels, parents, depths, one ancestor pointer per node and endpoint pairs occupy \(O(n_H)\) words. \emph{Proof.} In each incoming row gather the distinct predecessors with a timestamp array and record the latest one, \(m_y\). Keep the labelled arcs for Section 5. For a row with exactly two distinct nonroot predecessors and no root arc, form the key consisting of their ordered ranks. Sort the at most \(n_H\) candidate keys in \(O(n_H L)\) time and link equal keys to a common array cell. The first row processed with a given key fills the cell with its new pair node. Later rows reuse it. We need ancestor queries while the forest is growing. Use Myers's skew-binary stack {[}Mye83, §§3--4{]}. Each node has a depth, a parent and a jump pointer \(j\), with \(j(0)=0\). To insert a child \(v\) of \(p\), put \(a=j(p)\) and \(b=j(a)\). If the jumps from \(p\) to \(a\) and from \(a\) to \(b\) have equal positive lengths, set \(j(v)=b\). Otherwise set \(j(v)=p\). The list of ancestors starting at \(v\), up to but excluding 0, consists of blocks of sizes \(2^k-1\), \(k\ge1\). Sizes increase from the front, with equality allowed only between the first two. A jump skips the leading block. Insertion either adds a singleton or joins the new head and the two equal leading blocks. This proves the invariant and shows that jump length depends only on depth. To find an ancestor at a given depth, jump whenever the jump stays at or below that depth and otherwise take a parent step. There are \(O(L)\) whole blocks before the answer. In the block containing the answer a parent step splits the block into two equal smaller blocks, of which at most one is skipped. Thus there are \(O(L)\) moves. The same argument applies to finding a boundary defined by a monotone predicate on the ancestor path, since each proposed landing can be tested. The lowest common ancestor (LCA) of two online nodes also takes \(O(L)\) moves. Equalize their depths. While the nodes differ, jump both when their jump endpoints differ and otherwise take both parents. At equal depths the jumps have equal lengths, and their endpoints differ exactly when the landing is strictly below the LCA. Thus the traversal searches for a single depth boundary, with the same block bound. For a head with no root arc and latest predecessor \(m_y\), consider the path from \(0\) to \(C=c(m_y)\). For a quotient vertex \(z\), let \(r_C(z)\) be the depth of the last real node on this path whose lost set contains \(z\), or zero if none does. By Lemma 3.1 the qualifying nodes form a prefix. Every real node through \(U=\operatorname{LCA}(C,c(z))\) properly loses \(z\). Below \(U\), a node covers \(z\) exactly when \(z\) is an endpoint of its pair, a constant-time test. If \(C=U\) or \(z\in C\) for real \(C\), return \(\operatorname{depth}(C)\). Otherwise climb from \(C\), skipping a block whenever its landing is strictly below \(U\) and still omits \(z\). At the first parent equal to \(U\) or containing \(z\), return that parent's depth. This computes the cutoff in \(O(L)\) time for each remaining predecessor. The real ancestors of \(C\) all properly lose \(m_y\). Consequently the depth of \(B_*\) in Lemma 3.1 is the minimum of \(\operatorname{depth}(C)\) and all the other predecessors' cutoffs. One ancestor lookup retrieves \(B_*\). Each distinct predecessor is processed once at its head, so the total work is \(O((n_H+m_H)L)\). The temporary rows and permanent node arrays give the stated space bounds. \ensuremath{\square} \subsection{4. Transferring exits between nested cuts}\label{transferring-exits-between-nested-cuts} The forest tells us whether deleting two \emph{whole} blocks loses a target. A physical failure can lie strictly inside either block, in which case some of its exits remain usable. The following identity computes exactly which original tails have to be tested. We use the notation \(X^B_s(y)\) of Section 2 in a fixed quotient \(H_d\). \hypertarget{statement-4-1}{} \textbf{Theorem 4.1 (exit transfer).} Let \(P\) be a real child of a real pair \(B\) in the forest of \(H_d\). For each \(s\in B\) and \(y\in J(P)\), \[ X^B_s(y) = \bigcup_{p\in P\smallsetminus B} X^B_s(p) \ \cup\ \begin{cases} X^P_s(y), & s\in P,\\ \varnothing, & s\notin P . \end{cases} \] The union over fresh endpoints is independent of \(y\). \emph{Proof.} Lemma 3.1 puts \(y\) and every fresh endpoint \(p\in P\smallsetminus B\) in \(J(B)\), so all the sets on the left and in the union are defined. For each fresh \(p\), deletion of the other endpoint of \(P\) preserves \(y\). A surviving path must visit \(p\), since deleting both endpoints loses \(y\). Its suffix from \(p\) to \(y\) avoids the two earlier endpoints of \(B\). Appending the suffix to any exit witnessing \(X^B_s(p)\) proves that this tail belongs to \(X^B_s(y)\). For the inherited term, write \(B=\{s,v\}\) and \(P=\{s,p\}\). Take an arc out of \(s\) whose continuation to \(y\) avoids \(P\). If that continuation visits \(v\), choose a source path to \(v\) avoiding \(s\), possible by flatness. The path also avoids \(p\), which follows \(v\). Concatenating this prefix with the continuation from \(v\) would reach \(y\) after deleting \(P\). Thus the continuation also avoids \(v\), and the original tail belongs to \(X^B_s(y)\). Conversely, take an arc witnessing \(X^B_s(y)\). If its continuation visits a fresh endpoint \(p\), the prefix of that continuation to \(p\) places the tail in \(X^B_s(p)\). Otherwise the continuation avoids \(P\), since it already avoids all of \(B\). For \(s\in P\) this gives the inherited term. For \(s\notin P\), there exists a source path to \(s\) avoiding \(P\). Every fresh endpoint follows \(s\), and the at most one shared endpoint cannot by itself dominate \(s\). Concatenation with the chosen arc and continuation would survive \(P\), a contradiction. This also covers disjoint parent and child pairs. \ensuremath{\square} \textbf{A graph that needs both terms.} Take the seven vertices \(r,U,V,\ell,h,p,y\) and exactly the arcs in these three paths: \[ r\longrightarrow U\longrightarrow\ell\longrightarrow p\longrightarrow y, \qquad r\longrightarrow V\longrightarrow p, \qquad U\longrightarrow h\longrightarrow y . \] Figure 1 pairs the original DAG with its quotient \(H_r\). The arcs from \(U\) in the quotient carry their original tail labels. \begin{figure} \centering \includegraphics[width=0.94\linewidth,height=\textheight,keepaspectratio,alt={Figure 1. The original DAG and its quotient at r. The exit labelled \textbackslash ell reaches the fresh endpoint p. The exit labelled h reaches y directly and contributes through the shared endpoint U.}]{figures/exit-transfer-example.pdf} \caption{\textbf{Figure 1.} The original DAG and its quotient at \(r\). The exit labelled \(\ell\) reaches the fresh endpoint \(p\). The exit labelled \(h\) reaches \(y\) directly and contributes through the shared endpoint \(U\).}\label{fig-exit-transfer} \end{figure} The block \(D(U)\) contains \(\ell\) and \(h\). In \(H_r\), the pair \(B=\{U,V\}\) properly loses \(p\) and \(y\). Its child \(P=\{U,p\}\) properly loses \(y\). For the shared endpoint \(U\), the first term of the identity contributes the physical tail \(\ell\) on the exit to \(p\). The inherited term contributes \(h\) on the direct exit to \(y\). Deleting \(h,V\) leaves the route through \(\ell\), whereas deleting \(\ell,V\) leaves the route through \(h\). Deleting \(U,V\) removes both. This is why storing only the separating pair, or keeping only one of the two terms, loses information about the original target. \subsection{5. Building and querying the index}\label{building-and-querying-the-index} Lemma 2.2 needs only the smallest and largest preorder ranks of the exit tails. For two nonempty intervals define \[ [l,h]\sqcup[l',h']=[\min(l,l'),\max(h,h')]. \] The empty interval is the identity. Then \(\sigma(X\cup Y)=\sigma(X)\sqcup\sigma(Y)\), including when either set is empty. This associative operation takes constant time on rank pairs. We can therefore apply Theorem 4.1 directly to the summaries. \hypertarget{statement-5-1}{} \textbf{Lemma 5.1 (compressed exit summaries).} Given the completed forest and its jump pointers in \(H_d\), the original-tree preorder ranks, and the labelled quotient arcs, one can build a base vector of two intervals for each vertex with a real label and two constant-size maps for each real pair node. For any \(y\in J(B)\) these records recover both intervals \(\sigma_s^B(y)\), \(s\in B\), in \(O(L)\) time. Building the records takes \(O((n_H+m_H)L)\) time and \(O(n_H+m_H)\) working words. They occupy \(O(n_H)\) words after construction. \emph{Proof.} Order the endpoints in each pair by topological number. For a real forest edge from child \(P\) to parent \(B\), form a map with two output coordinates. In coordinate \(s\in B\), its constant is the join of \(\sigma_s^B(p)\) over the fresh endpoints \(p\). If \(s\in P\), join that constant with the input coordinate for \(s\). Otherwise return the constant. Theorem 4.1 proves the map's effect for every target below \(P\). In particular its constants can be shared. Composing two maps of this form again gives two such coordinates. For a coordinate that copies an intermediate input, join the outer constant with the corresponding inner constant and retain the inner input slot if present. A coordinate with no input slot keeps its outer constant. Composition requires only a constant number of interval joins. Process the vertices of \(H_d\) in topological order. Store at \(y\) the two summaries for its deepest pair \(c(y)\) when that pair is real. When a pair \(P\) first appears at such a vertex \(y\), install its map to its parent \(B\) \emph{before} computing the base at \(y\). If \(B\) is real, each fresh endpoint \(p\) precedes \(y\) and lies in \(J(B)\). Its base at \(c(p)\) is already present. Every real pair on the path from \(c(p)\) up to \(B\) properly loses \(p\), so that pair first appeared no later than \(p\). Evaluating the maps along this path gives the constants needed for the new edge. A map to the artificial root may return two empty coordinates since no exit query asks for that root. Now let \(B=c(y)\) be real. Inspect every entering arc \(z\to y\). If \(z=s\in B\), join the singleton interval of its original tail's preorder rank into coordinate \(s\). Otherwise \(z\in J(B)\), since an unfailed route to \(z\) would extend to \(y\) after deletion of \(B\). Evaluate the stored maps from \(c(z)\) to \(B\) on the base at \(z\), and join both coordinates into the base at \(y\). Every admissible exit is included by considering the last arc of its witnessing path. Every contribution extends to a witnessing path. The predecessor \(z\) is earlier than \(y\), so all these reads are available. For each real node \(v\) store the map to its parent \(p\) and the map to its jump ancestor. If \(j(v)=p\), the maps coincide. In the merge case of Lemma 3.2, compose, in order of traversal, the edge map from \(v\) to \(p\), the jump map from \(p\) to \(a=j(p)\) and the jump map from \(a\) to \(j(a)\). The jumps start at proper ancestors of \(v\). Those pairs were already present when the sweep of Lemma 3.1 first encountered \(v\), so their maps are available in the same topological order. Thus installing the jump map takes constant time once the edge map is known. To evaluate a base at a specified ancestor, follow the jumps and parent steps of Lemma 3.2, applying one map at each move. This takes \(O(L)\) time. Each entering arc requires at most one such evaluation, and each new pair needs at most two to obtain its fresh-endpoint constants. Initializing the bases and storing the maps takes constant time per record. Lemma 3.1 bounds the number of pair nodes by \(n_H\), giving the construction and space bounds. \ensuremath{\square} \hypertarget{statement-5-2}{} \textbf{Lemma 5.2 (constant-time lookup on the completed forest).} For each flat quotient, \(O(n_H)\) additional words built in \(O(n_H L)\) time suffice for the following queries in \(O(1)\) worst-case time. Given distinct nonroot \(u,v,y\), test whether \(y\in J(\{u,v\})\) and, if so, return its pair node and both exit intervals. Given a real ancestor pair \(A\) of a real pair \(C\), also return the first edge below \(A\) on which each endpoint of \(A\) disappears, if it disappears by \(C\). \emph{Proof.} Equip the completed forest, with dummy root 0, with static lowest-common-ancestor and level-ancestor indexes {[}BFC00, BFC04{]}. Each uses linear construction time and space and returns its answer in constant time. Write \(\operatorname{LA}(v,h)\) for the ancestor of \(v\) at depth \(h\). \textbf{Finding the pair.} Order \(u,v\) by topological rank with \(u