This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Breaking the Cubic Barrier for All-Pairs Max-Flow:
Gomory-Hu Tree in Nearly Quadratic Time

Amir Abboud Weizmann Institute of Science. Supported by an Alon scholarship and a research grant from the Center for New Scientists at the Weizmann Institute of Science. Email: amir.abboud@weizmann.ac.il    Robert Krauthgamer Weizmann Institute of Science. Work partially supported by ONR Award N00014-18-1-2364, the Israel Science Foundation grant #1086/18, the Weizmann Data Science Research Center, and a Minerva Foundation grant. Email: robert.krauthgamer@weizmann.ac.il    Jason Li Simons Institute for the Theory of Computing, University of California, Berkeley. Email: jmli@cs.cmu.edu    Debmalya Panigrahi Duke University. Supported in part by NSF Awards CCF-1750140 (CAREER) and CCF-1955703, and ARO Award W911NF2110230. Email: debmalya@cs.duke.edu    Thatchaphol Saranurak University of Michigan, Ann Arbor. Email: thsa@umich.edu    Ohad Trabelsi University of Michigan, Ann Arbor. Work partially supported by the NSF Grant CCF-1815316, and by the NWO VICI grant 639.023.812. Email: ohadt@umich.edu
Abstract

In 1961, Gomory and Hu showed that the All-Pairs Max-Flow problem of computing the max-flow between all (n2){n\choose 2} pairs of vertices in an undirected graph can be solved using only n1n-1 calls to any (single-pair) max-flow algorithm. Even assuming a linear-time max-flow algorithm, this yields a running time of O(mn)O(mn), which is O(n3)O(n^{3}) when m=Θ(n2)m=\Theta(n^{2}). While subsequent work has improved this bound for various special graph classes, no subcubic-time algorithm has been obtained in the last 60 years for general graphs. We break this longstanding barrier by giving an O~(n2)\tilde{O}(n^{2})-time algorithm on general, weighted graphs. Combined with a popular complexity assumption, we establish a counter-intuitive separation: all-pairs max-flows are strictly easier to compute than all-pairs shortest-paths.

Our algorithm produces a cut-equivalent tree, known as the Gomory-Hu tree, from which the max-flow value for any pair can be retrieved in near-constant time. For unweighted graphs, we refine our techniques further to produce a Gomory-Hu tree in the time of a poly-logarithmic number of calls to any max-flow algorithm. This shows an equivalence between the all-pairs and single-pair max-flow problems, and is optimal up to poly-logarithmic factors. Using the recently announced m1+o(1)m^{1+o(1)}-time max-flow algorithm (Chen et al., March 2022), our Gomory-Hu tree algorithm for unweighted graphs also runs in m1+o(1)m^{1+o(1)}-time.

Historical note:

The first version of this paper (arXiv:2111.04958) titled “Gomory-Hu Tree in Subcubic Time” (Nov. 9, 2021) broke the cubic barrier but only claimed a time bound of O~(n2.875)\tilde{O}(n^{2.875}). The second version (Nov. 30, 2021) optimized one of the ingredients (Section 2) and gave the O~(n2)\tilde{O}(n^{2}) time bound. The latter optimization was discovered independently by Zhang [Zha21].

1 Introduction

The edge connectivity of a pair of vertices s,ts,t in an undirected graph is defined as the minimum weight of edges whose removal disconnects ss and tt in the graph. Such a set of edges is called an (s,t)(s,t) mincut, and by duality, its value is equal to that of an (s,t)(s,t) max-flow. Consequently, the edge connectivity of a vertex pair is obtained by running a max-flow algorithm, and by extension, the edge connectivity for all vertex pairs can be obtained by (n2)=Θ(n2){n\choose 2}=\Theta(n^{2}) calls to a max-flow algorithm. (Throughout, nn and mm denote the number of vertices and edges in the input graph G=(V,E,w)G=(V,E,w), where w:E+0w:E\rightarrow\mathbb{Z}^{0}_{+} maps edges to non-negative integer weights. We denote the maximum edge weight by WW.)

Definition 1.1 (The All-Pairs Max-Flow (APMF) Problem).

Given an undirected edge-weighted graph, return the edge connectivity of all pairs of vertices.

Remarkably, Gomory and Hu [GH61] showed in a seminal work in 1961 that one can do a lot better than this naïve algorithm. In particular, they introduced the notion of a cut tree (later called Gomory-Hu tree, which we abbreviate as GHtree) to show that n1n-1 max-flow calls suffice for finding the edge connectivity of all vertex pairs.

Theorem 1.2 (Gomory-Hu (1961)).

For any undirected edge-weighted graph G=(V,E)G=(V,E), there is a cut tree (or GHtree), which is defined as a tree 𝒯\mathcal{T} on the same set of vertices VV such that for all pairs of vertices s,tVs,t\in V, the (s,t)(s,t) mincut in 𝒯\mathcal{T} is also an (s,t)(s,t) mincut in GG and has the same cut value. Moreover, such a tree can be computed using n1n-1 max-flow calls.111These max-flow calls are on graphs that are contractions of GG, and thus no larger than GG.

Since their work, substantial effort has gone into obtaining better GHtree algorithms, and faster algorithms are now known for many restricted graph classes, including unweighted graphs [BHKP07, KL15, AKT21b], simple graphs [AKT21c, AKT21a, LPS21, Zha22, AKT22], planar graphs [BSW15], surface-embedded graphs [BENW16], bounded treewidth graphs [ACZ98, AKT20], and so on (see Table 1 and the survey [Pan16]). Indeed, GHtree algorithms are part of standard textbooks in combinatorial optimization (e.g., [AMO93, CCPS97, Sch03]) and have numerous applications in diverse areas such as networks [Hu74], image processing [WL93], and optimization [PR82]. They have also inspired entire research directions as the first example of a sparse representation of graph cuts, the first non-trivial global min-cut algorithm, the first use of submodular minimization in graphs, and so forth.

In spite of this attention, Gomory and Hu’s 60-year-old algorithm has remained the state of the art for constructing a GHtree in general, weighted graphs (or equivalently for APMF, due to known reductions [AKT20, LPS21] showing that any APMF algorithm must essentially construct a GHtree). Even if we assume an optimal O(m)O(m)-time max-flow algorithm, the Gomory-Hu algorithm takes O(mn)O(mn) time, which is O(n3)O(n^{3}) when m=Θ(n2)m=\Theta(n^{2}). Breaking this cubic barrier for the GHtree problem has been one of the outstanding open questions in the graph algorithms literature.

In this paper, we break this longstanding barrier by giving a GHtree algorithm that runs in O~(n2)\tilde{O}(n^{2})-time for general, weighted graphs.

Theorem 1.3.

There is a randomized Monte Carlo algorithm for the GHtree (and APMF) problems that runs in O~(n2)\tilde{O}(n^{2}) time in general, weighted graphs.

Remarks:

1. As noted earlier (and similar to state-of-the-art max-flow algorithms), we assume throughout the paper that edge weights are integers in the range {1,2,,W}\{1,2,\ldots,W\}. Throughout, the notation O~()\tilde{O}(\cdot) hides poly-logarithmic factors in nn and WW.
2. Our result is unconditional, i.e., it does not need to assume a (near/almost) linear-time max-flow algorithm. We note that concurrent to our work, an almost-linear time max-flow algorithm has been announced [CKL+22]. Our improvement of the running time of GHtree/APMF is independent of this result: even with this result, the best GHtree/APMF bound was m1+o(1)nm^{1+o(1)}n which is between n2+o(1)n^{2+o(1)} and n3+o(1)n^{3+o(1)} depending on the value of mm, and we improve it to O~(n2)\tilde{O}(n^{2}). Moreover, we stress that we do not need any recent advancement in max-flow algorithms for breaking the cubic barrier: even using the classic Goldberg-Rao max-flow algorithm [GR98] in our (combinatorial) algorithm solves GHtree/APMF in subcubic time.

Our techniques also improve the bounds known for the GHtree problem in unweighted graphs, and even for simple graphs. For unweighted graphs, the best previous results were O~(mn)\tilde{O}(mn) obtained by Bhalgat et al. [BHKP07] and by Karger and Levine [KL15], and an incomparable result that reduces the GHtree problem to O(m)O(\sqrt{m}) max-flow calls [AKT21b]. There has recently been much interest and progress on GHtree in simple graphs as well [AKT21c, AKT21a, LPS21, Zha22, AKT22], with the current best running time being (m+n1.9)1+o(1)(m+n^{1.9})^{1+o(1)}.

We give a reduction of the GHtree problem in unweighted graphs to polylog(n)\mathrm{polylog}(n) calls of any max-flow algorithm. Note that this reduction is nearly optimal (i.e., up to the poly-log factor) since the all-pairs max-flow problem is at least as hard as finding a single-pair max-flow. Using the recent m1+o(1)m^{1+o(1)}-time max-flow algorithm [CKL+22], this yields a running time of m1+o(1)m^{1+o(1)} for the GHtree problem in unweighted graphs.

Theorem 1.4.

There is a randomized Monte Carlo algorithm for the GHtree problem that runs in m1+o(1)m^{1+o(1)} time in unweighted graphs.

APMF vs APSP.

Our results deliver a surprising message to a primordial question in graph algorithms: What is easier to compute, shortest paths or max-flows? Ignoring no(1)n^{o(1)} factors, the single-pair versions are both solvable in linear-time and therefore equally easy; albeit, the shortest path algorithm [Dij59] is classical, elementary, and fits on a single page, whereas the max-flow algorithm [CKL+22] is very recent, highly non-elementary, and requires more than a hundred pages to describe and analyze. This and nearly all other evidence had supported the consensus that max-flows are at least as hard as (if not strictly harder than) shortest paths, and perhaps this can be established by looking at the more general all-pairs versions: APMF and APSP (All-Pairs Shortest-Paths). Much effort had gone into proving this belief (APMF \geq APSP) using the tools of fine-grained complexity [AVY15, KT18, AGI+19, AKT21b, AKT20], with limited success: it was shown that (under popular assumptions) APMF is strictly harder than APSP in directed graphs, but the more natural undirected setting remained open. The first doubts against the consensus were raised in the aforementioned n2+o(1)n^{2+o(1)} algorithms for APMF in simple (unweighted) graphs that go below the nωn^{\omega} bound of APSP [Sei95] (where 2ω<2.372862\leq\omega<2.37286 [AW21] denotes the fast matrix multiplication exponent). But if, as many experts believe, ω=2+o(1)\omega=2+o(1) then the only conclusion is that APMF and APSP are equally easy in simple graphs. In general (weighted) graphs, however, one of the central conjectures of fine-grained complexity states that the cubic bound for APSP cannot be broken (even if ω=2\omega=2). Under this “APSP Conjecture”, Theorem 1.3 proves that APMF is strictly easier than APSP! Alternatively, if one still believes that APMF \geq APSP, then our paper provides strong evidence against the APSP Conjecture and against the validity of the dozens of lower bounds that are based upon it (e.g., [RZ04, WW18, AW14, AGW15, Sah15, AD16, BGMW20]) or upon stronger forms of it (e.g., [BT17, BDT16, CMWW19, ACK20, GMW21]).

1.1 Related Work

Algorithms.

Before this work, the time complexity of constructing a Gomory-Hu tree in general graphs has improved over the years only due to improvements in max-flow algorithms. An alternative algorithm for the problem was discovered by Gusfield [Gus90], where the n1n-1 max-flow queries are made on the original graph (instead of on contracted graphs). This algorithm has the same worst-case time complexity as Gomory-Hu’s, but may perform better in practice [GT01]. Many faster algorithms are known for special graph classes or when allowing a (1+ϵ)(1+\epsilon)-approximation, see Table 1 for a summary. Moreover, a few heuristic ideas for getting a subcubic complexity in social networks and web graphs have been investigated [AIS+16].

Restriction Running time Reference
General (n1)T(n,m)(n-1)\cdot T(n,m) Gomory and Hu [GH61]
Bounded Treewidth* O~(n)\tilde{O}(n) Arikati, Chaudhuri, and Zaroliagis [ACZ98]
Unweighted O~(mn)\tilde{O}(mn) Karger and Levine [KL15]
Unweighted O~(mn)\tilde{O}(mn) Bhalgat, Hariharan, Kavitha, and Panigrahi [BHKP07]
Planar O~(n)\tilde{O}(n) Borradaile, Sankowski, and Wulff-Nilsen [BSW15]
Bounded Genus O~(n)\tilde{O}(n) Borradaile, Eppstein, Nayyeri, and Wulff-Nilsen [BENW16]
Unweighted O~(m)T(n,m)\tilde{O}(\sqrt{m})\cdot T(n,m) Abboud, Krauthgamer, and Trabelsi [AKT21b]
(1+ϵ)(1+\epsilon)-Approx* O~(n2)\tilde{O}(n^{2}) Abboud, Krauthgamer, and Trabelsi [AKT20]
Bounded Treewidth O~(n)\tilde{O}(n) Abboud, Krauthgamer, and Trabelsi [AKT20]
Simple O~(n2.5)\tilde{O}(n^{2.5}) Abboud, Krauthgamer, and Trabelsi [AKT21c]
(1+ϵ)(1+\epsilon)-Approx polylog(n)T(n,m)\mathrm{polylog}(n)\cdot T(n,m) Li and Panigrahi [LP21]
Simple O~(n2)\tilde{O}(n^{2}) \dagger Abboud, Krauthgamer, and Trabelsi [AKT21a]
Simple O~(n2)\tilde{O}(n^{2}) \dagger Li, Panigrahi, and Saranurak [LPS21]
Simple O~(n218)\tilde{O}(n^{2\frac{1}{8}}) \dagger Zhang [Zha22]
Simple O~(m+n1.9)\tilde{O}(m+n^{1.9}) Abboud, Krauthgamer, and Trabelsi [AKT22]
General O~(n2)\tilde{O}(n^{2}) Theorem 1.3
Unweighted m1+o(1)+polylog(n)T(n,m)m^{1+o(1)}+\mathrm{polylog}(n)\cdot T(n,m) Theorem 1.4
Table 1: Algorithms for constructing a data-structure that answers s,ts,t-min-cut queries in O~(1)\tilde{O}(1) time (listed chronologically). Except for those marked with *, they all also produce a Gomory-Hu tree. T(n,m)T(n,m) denotes the time to compute s,ts,t-max-flow in an undirected graph, which using Chen et al. [CKL+22] is m1+o(1)m^{1+o(1)}. The three results marked with \dagger were obtained concurrently and independently of each other.
Hardness Results.

The attempts at proving conditional lower bounds for All-Pairs Max-Flow have only succeeded in the harder settings of directed graphs [KT18, AGI+19] or undirected graphs with vertex weights [AKT21b], where Gomory–Hu trees cannot even exist [May62, Jel63, HL07]. In particular, SETH gives an n3o(1)n^{3-o(1)} lower bound for weighted sparse directed graphs [KT18] and the 44-Clique conjecture gives an nω+1o(1)n^{\omega+1-o(1)} lower bound for unweighted dense directed graphs [AGI+19].

Applications.

Gomory-Hu trees have appeared in many application domains. We mention a few examples: in mathematical optimization for the bb-matching problem [PR82] (and that have been used in a breakthrough NC algorithm for perfect matching in planar graphs [AV20]); in computer vision [WL93], leading to the graph cuts paradigm; in telecommunications [Hu74] where there is interest in characterizing which graphs have a Gomory-Hu tree that is a subgraph [KV12, NS18]. The question of how the Gomory-Hu tree changes with the graph has arisen in applications such as energy and finance and has also been investigated, e.g. [Elm64, PQ80, BBDF06, HW13, BGK20].

1.2 Overview of Techniques

We now introduce the main technical ingredients used in our algorithm, and explain how to put them together to prove Theorem 1.3 and Theorem 1.4.

Notation.

In this paper, a graph GG is an undirected graph G=(V,E,w)G=(V,E,w) with edge weights w(e){1,2,,W}w(e)\in\{1,2,\ldots,W\} for all eEe\in E. If w(e)=1w(e)=1 for all eEe\in E, we say that GG is unweighted. The total weight of an edge set EEE^{\prime}\subseteq E is defined as w(E)=eEw(e)w(E^{\prime})=\sum_{e\in E^{\prime}}w(e). For a cut (S,VS)(S,V\setminus S), we also refer to a side SS of this cut as a cut. The value of cut SS is denoted δ(S)=w(E(S,VS))\delta(S)=w(E(S,V\setminus S)). For any two vertices a,ba,b, we say that SS is an (a,b)(a,b)-cut if |S{a,b}|=1|S\cap\{a,b\}|=1. An (a,b)(a,b)-mincut is an (a,b)(a,b)-cut of minimum value, and we denote its value by λ(a,b)\lambda(a,b).

Reduction to Single-Source Minimum Cuts.

The classic Gomory-Hu approach to solving APMF is to recursively solve (s,t)(s,t) mincut problems on graphs obtained by contracting portions of the input graph. This leads to n1n-1 max-flow calls on graphs that cumulatively have O(mn)O(mn) edges. Recent work [AKT20] has shown that replacing (s,t)(s,t) mincuts by a more powerful gadget of single-source mincuts reduces the cumulative size of the contracted graphs to only O~(m)\tilde{O}(m). But, how do we solve the single-source mincuts problem? Prior to our work, a subcubic algorithm was only known for simple graphs [AKT21c, AKT21a, LPS21, Zha22, AKT22]. Unfortunately, if applied to non-simple graphs, these algorithms become incorrect, and not just inefficient.

Conceptually, our main contribution is to give an O~(n2)\tilde{O}(n^{2})-time algorithm for the single source mincuts problem in general weighted graphs. For technical reasons, however, we will further restrict this problem in two ways: (1) the algorithm (for the single-source problem) only needs to return the values λ(s,t)\lambda(s,t) for some terminals tU{s}t\in U\setminus\{s\}, and (2) the mincut values λ(s,t)\lambda(s,t) for the terminals tU{s}t\in U\setminus\{s\} are guaranteed to be within a 1.11.1-factor of each other.222The value 1.11.1 is arbitrary and can be replaced by any suitably small constant greater than 11.

We now state a reduction from GHtree to this restricted single-source problem. Let UVU\subseteq V be a set of terminal vertices. The UU-Steiner connectivity/mincut is λ(U)=mina,bUλ(a,b)\lambda(U)=\min_{a,b\in U}\lambda(a,b). The restricted single-source problem is defined below.

Problem 1.5 (Single-Source Terminal Mincuts).

The input is a graph G=(V,E,w)G=(V,E,w), a terminal set UVU\subseteq V and a source terminal sUs\in U with the promise that for all tU{s}t\in U\setminus\{s\}, we have λ(U)λ(s,t)1.1λ(U)\lambda(U)\leq\lambda(s,t)\leq 1.1\lambda(U). The goal is to determine the value of λ(s,t)\lambda(s,t) for each terminal tU{s}t\in U\setminus\{s\}.

The reduction has two high-level steps. First, we reduce the single-source terminal mincuts problem without the promise that λ(s,t)[λ(U),1.1λ(U)]\lambda(s,t)\in[\lambda(U),1.1\lambda(U)] (we define this as A.1 in Appendix A) to the corresponding problem with the promise (i.e., 1.5) by calling an approximate single-source mincuts algorithm of Li and Panigrahi [LP21]. Then, we use a reduction from Gomory-Hu tree to the single-source terminal mincuts without the promise (i.e., A.1) that was presented by Li [Li21].333The actual reduction is slightly stronger in the sense that it only requires a “verification” version of single-source terminal mincuts, but we omit that detail for simplicity. We present both steps of the reduction in Appendix A.

Lemma 1.6 (Reduction to Single-Source Terminal Mincuts).

There is a randomized algorithm that computes a GHtree of an input graph by making calls to max-flow and single-source terminal mincuts (with the promise, i.e., 1.5) on graphs with a total of O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges, and runs for O~(m)\tilde{O}(m) time outside of these calls.

Guide Trees.

The main challenge, thus, is to solve single-source terminal mincuts (1.5) faster than n1n-1 max-flow calls. Let us step back and think of a simpler problem: the global mincut problem. In a beautiful paper, Karger [Kar00] gave a two-step recipe for solving this problem by using the duality between cuts and tree packings. First, by packing a maximum set of edge-disjoint spanning trees in a graph and sampling one of them uniformly at random, the algorithm obtains a spanning tree that, with high probability, 22-respects the global mincut, meaning that only two edges from the tree cross the cut. Second, a simple linear-time dynamic program computes the minimum value cut that 22-respects the tree. Can we use this approach?

Clearly, we cannot hope to pack λ(U)\lambda(U) disjoint spanning trees since the global mincut value could be much less than λ(U)\lambda(U). But what about Steiner trees? A tree TT is called a UU-Steiner tree if it spans UU, i.e., UV(T)U\subseteq V(T). When UU is clear from the context, we write Steiner instead of UU-Steiner.

First, we define the kk-respecting property for Steiner trees.

Definition 1.7 (kk-respecting).

Let AVA\subseteq V be a cut in G=(V,E,w)G=(V,E,w). Let TT be a tree on (some subset of) vertices in VV. We say that the tree TT kk-respects the cut AA (and vice versa) if TT contains at most kk edges with exactly one endpoint in AA.

Using this notion of kk-respecting Steiner trees, we can now define a collection of guide trees that is analogous to a packing of spanning trees.

Definition 1.8 (Guide Trees).

For a graph GG and set of terminals UVU\subseteq V with a source sUs\in U, a collection of UU-Steiner trees T1,,ThT_{1},\dots,T_{h} is called a kk-respecting set of guide trees, or in short guide trees, if for every tU{s}t\in U\setminus\{s\}, at least one tree TiT_{i} kk-respects some (s,t)(s,t)-mincut in GG.

Two questions immediately arise:

  1. 1.

    Can we actually obtain such kk-respecting guide trees, for a small kk (and hh)?

  2. 2.

    Can guide trees be used to speed up the single-source mincuts algorithm?

The first question can be solved in a way that is conceptually (but not technically) similar to Karger’s algorithm for global mincut. We first prove, using classical tools in graph theory (namely, Mader’s splitting-off theorem [Mad78], and Nash-Williams [NW61] and Tutte’s [Tut61] tree packing) that there exists a packing with λ(U)/2\lambda(U)/2 edge-disjoint Steiner trees. Then, we use the width-independent Multiplicative Weights Update (MWU) framework [GK07, Fle00, AHK12] to pack a near-optimal number of Steiner trees using O~(m)\tilde{O}(m) calls to an (approximation) algorithm for the minimum Steiner tree problem. For the latter, we use Mehlhorn’s 22-approximation algorithm [Meh88] that runs in O~(m)\tilde{O}(m) time, giving a packing of λ(U)/4\lambda(U)/4 Steiner trees in O~(m2)\tilde{O}(m^{2}) time. To speed this up, we compute the packing in a (1+ϵ)(1+\epsilon)-cut-sparsifier of GG (e.g., [BK15]), which effectively reduces mm to O~(n)\tilde{O}(n) for this step. Overall, this gives an O~(n2)\tilde{O}(n^{2})-time algorithm for constructing 44-respecting guide trees.

We note that our improved running time for unweighted graphs comes from replacing this algorithm for constructing guide trees by a more complicated algorithm. Specifically, we show that all of the O~(m)\tilde{O}(m) calls to (approximate) minimum Steiner tree during the MWU algorithm can be handled in a total of m1+o(1)m^{1+o(1)} time using a novel dynamic data structure that relies on (1) a non-trivial adaptation of Mehlhorn’s reduction from minimum Steiner tree to Single-Source Shortest Paths and (2) a recent dynamic algorithm for the latter problem [BGS22]. This achieves running time m1+o(1)m^{1+o(1)} compared with O~(n2)\tilde{O}(n^{2}) for unweighted graphs.

We summarize the construction of guide trees in the next theorem, which we prove in Section 3. (The new dynamic data structure that is used in the improvement for unweighted graphs is given in Section 4.)

Theorem 1.9 (Constructing Guide Trees).

There is a randomized algorithm that, given a graph G=(V,E,w)G=(V,E,w), a terminal set UVU\subseteq V and a source terminal sUs\in U, with the guarantee that for all tU{s}t\in U\setminus\{s\}, λ(U)λ(s,t)1.1λ(U)\lambda(U)\leq\lambda(s,t)\leq 1.1\lambda(U), computes a 44-respecting set of O(logn)O(\log{n}) guide trees. The algorithm takes O~(n2)\tilde{O}(n^{2}) time on weighted graphs (i.e., when w(e){1,2,,W}w(e)\in\{1,2,\ldots,W\} for all eEe\in E) and m1+o(1)m^{1+o(1)} time on unweighted graphs (i.e., when w(e)=1w(e)=1 for all eEe\in E).

But, how do guide trees help? In the case of global mincuts, the tree is spanning, hence every kk tree edges define a partition of VV, and also a cut in GG. Therefore, once the kk-respecting property has been achieved, finding the best kk-respecting cut is a search over at most nkn^{k} cuts for any given tree, and can be done using dynamic programming for small kk [Kar00]. In contrast, specifying the kk tree-edges that are cut leaves an exponential number of possibilities when TT is a Steiner tree based on which side of the cut the vertices not in TT appear on. In fact, in the extreme case where the Steiner tree is a single edge between two terminals ss and tt, computing the 11-respecting mincut is as hard as computing (s,t)(s,t)-mincut.

We devise a recursive strategy to solve the problem of obtaining kk-respecting (s,t)(s,t)-mincuts. First, we root the tree TT at a centroid, and recurse in each subtree (containing at most half as many vertices). We show that this preserves the kk-respecting property for (s,t)(s,t)-mincuts. However, in general, this is too expensive since the entire graph GG is being used in each recursive call, and there can be many subtrees (and a correspondingly large number of recursive calls). Nevertheless, we show that this strategy can be made efficient when all the cut edges are in the same subtree by an application of the Isolating Cuts Lemma from [LP20, AKT21c].

This leaves us with the case that the cut edges are spread across multiple subtrees. Here, we use a different recursive strategy. We use random sampling of the subtrees to reduce the number of cut edges, and then make recursive calls with smaller values of kk. Note that this effectively turns our challenge in working with Steiner trees vis-à-vis spanning trees into an advantage; if we were working on spanning trees, sampling and removing subtrees would have violated the spanning property. This strategy works directly when there exists at least one cut edge in a subtree other than those containing ss and tt; then, with constant probability, we remove this subtree but not the ones containing s,ts,t to reduce kk by at least 11. The more tricky situation is if the cut edges are only in the subtrees of ss and tt; this requires a more intricate procedure involving a careful relabeling of the source vertex ss using a Cut Threshold Lemma from [LP21].

The algorithm is presented in detail in Section 2, and we state here its guarantees.

Theorem 1.10 (Single-Source Mincuts given a Guide Tree).

Let G=(V,E,w)G=(V,E,w) be a weighted graph, let TT be a tree defined on (some subset of) vertices in VV, and let ss be a vertex in TT. For any fixed integer k2k\geq 2, there is a Monte-Carlo algorithm that finds, for each vertex tst\not=s in TT, a value λ~(t)λ(s,t)\tilde{\lambda}(t)\geq\lambda(s,t) such that λ~(t)=λ(s,t)\tilde{\lambda}(t)=\lambda(s,t) if TT is kk-respecting an (s,t)(s,t)-mincut. The algorithm takes m1+o(1)m^{1+o(1)} time.

Remarks:

The algorithm in Theorem 1.10 calls max-flow on instances of maximum number of mm edges and nn vertices and total number of O~(m)\tilde{O}(m) edges and O~(n)\tilde{O}(n) vertices, and spends O~(m)\tilde{O}(m) time outside these calls. The number of logarithmic factors hidden in the O~()\tilde{O}(\cdot) depends on kk. Note that the running time of the algorithm is m1+o(1)m^{1+o(1)} even when GG is a weighted graph.

Putting it all together: Proof of Theorem 1.3 and Theorem 1.4

The three ingredients above suffice to prove our main theorems. By Lemma 1.6, it suffices to solve the single-source mincut problem (1.5). Given an instance of 1.5 on a graph GG with terminal set UU, we use Theorem 1.9 to obtain a 44-respecting set of O(logn)O(\log{n}) guide trees. We call the algorithm in Theorem 1.10 for each of the O(logn)O(\log{n}) trees separately and keep, for each tU{s}t\in U\setminus\{s\}, the minimum λ~(s,t)\tilde{\lambda}(s,t) found over all the O(logn)O(\log n) trees.

The running time of the final algorithm equals that of max-flow calls on graphs with at most O(m)O(m) edges and O(n)O(n) vertices each, and total number of O~(m)\tilde{O}(m) edges and O~(n)\tilde{O}(n) vertices. In addition, the algorithm takes O~(n2)\tilde{O}(n^{2}) time outside of these calls (in Theorem 1.9); in unweighted graphs, the additional time is only m1+o(1)m^{1+o(1)}.

2 Single-Source Mincuts Given a Guide Tree

In this section, we present our single-source mincut algorithm (SSMC) given a guide tree, which proves Theorem 1.10.

Before describing the algorithm, we state two tools we will need. The first is the Isolating-Cuts procedure introduced by Li and Panigrahi [LP20] and independently by Abboud, Krauthgamer, and Trabelsi [AKT21c]. (Within a short time span, this has found several interesting applications [LP21, CQ21, MN21, LNP+21, AKT21a, LPS21, Zha22, AKT22, CLP22].)

Recall that for a vertex set SVS\subseteq V, δ(S)\delta(S) denotes the total weight of edges with exactly one endpoint in SS (i.e., the value of the cut (S,VS)(S,V\setminus S)). For any two disjoint vertex sets A,BVA,B\subseteq V, we say that SS is an (A,B)(A,B)-cut if ASA\subseteq S and BS=B\cap S=\emptyset or BSB\subseteq S and AS=A\cap S=\emptyset. In other words, the cut SS “separates” the vertex sets AA and BB. We say that SS is an (A,B)(A,B)-mincut if it is an (A,B)(A,B)-cut of minimum value, and let λ(A,B)\lambda(A,B) denote the value of an (A,B)(A,B)-mincut. As described earlier, if AA and BB are singleton sets, say A={a}A=\{a\} and B={b}B=\{b\}, then we use the shortcut (a,b)(a,b)-mincut to denote an (A,B)(A,B)-mincut, and use λ(a,b)\lambda(a,b) to denote the value of an (a,b)(a,b)-mincut.

We now state the isolating cuts lemma from [LP20, AKT21c]:

Lemma 2.1 (Isolating Cuts Lemma: Theorem 2.2 in [LP20], also follows from Lemma 3.4 in [AKT21c]).

There is an algorithm that, given a graph G=(V,E,w)G=(V,E,w) and a collection 𝒰\cal{U} of disjoint terminal sets U1,,UhVU_{1},\dots,U_{h}\subseteq V, computes a (Ui,jiUj)(U_{i},\cup_{j\neq i}U_{j})-mincut for every Ui𝒰U_{i}\in\cal{U}. The algorithm calls max-flow on graphs that cumulatively contain O(mlogh)O(m\log h) edges and O(nlogh)O(n\log h) vertices, and spends O~(m)\tilde{O}(m) time outside these calls.

Remark:

The isolating cuts lemma stated above slightly generalizes the corresponding statement from [LP20, AKT21c]. In the previous versions, each of the sets U1,U2,,UhU_{1},U_{2},\ldots,U_{h} is a distinct singleton vertex in VV. The generalization to disjoint sets of vertices is trivial because we can contract each set UiU_{i} for i[h]i\in[h] and then apply the original isolating cuts lemma to this contracted graph to obtain 2.1.

We call each (Ui,jiUj)(U_{i},\cup_{j\neq i}U_{j})-mincut SiS_{i} a minimum isolating cut because it “isolates” UiU_{i} from the rest of the terminal sets, using a cut of minimum size. The advantage of this lemma is that it essentially only costs O(logh)O(\log{h}) max-flow calls, which is an exponential improvement over the naïve strategy of running hh max-flow calls, one for each UiU_{i}.

The next tool is the Cut-Threshold procedure of Li and Panigrahi, which has been used earlier in the approximate Gomory-Hu tree problem [LP21] and in edge connectivity augmentation and splitting off algorithms [CLP22].

Lemma 2.2 (Cut-Threshold Lemma: Theorem 1.6 in [LP21]).

There is a randomized, Monte-Carlo algorithm that, given a graph G=(V,E,w)G=(V,E,w), a vertex sVs\in V, and a threshold λ¯\overline{\lambda}, computes all vertices vVv\in V with λ(s,v)λ¯\lambda(s,v)\leq\overline{\lambda} (recall that λ(s,v)\lambda(s,v) is the size of an (s,v)(s,v)-mincut). The algorithm calls max-flow on graphs that cumulatively contain O~(m)\tilde{O}(m) edges and O~(n)\tilde{O}(n) vertices, and spends O~(m)\tilde{O}(m) time outside these calls.

We use the Cut-Threshold lemma to obtain the following lemma, which is an important component of our final algorithm.

Lemma 2.3.

For any subset UVU\subseteq V of vertices and a vertex sUs\notin U, there is a randomized, Monte-Carlo algorithm that computes λmax=max{λ(s,t):tU}\lambda_{\max}=\max\{\lambda(s,t):t\in U\} as well as all vertices tUt\in U attaining this maximum, i.e., the vertex set argmaxtU{λ(s,t)}\arg\max_{t\in U}\{\lambda(s,t)\}. The algorithm calls max-flow on graphs that cumulatively contain O~(m)\tilde{O}(m) edges and O~(n)\tilde{O}(n) vertices, and spends O~(m)\tilde{O}(m) time outside these calls.

Proof.

We binary search for the value of λmax\lambda_{\max}. For a given estimate λ¯\overline{\lambda}, we call the Cut-Threshold Lemma (Lemma 2.2) with this value of λ¯\overline{\lambda}; if the procedure returns a set containing all vertices in UU, then we know λmaxλ¯\lambda_{\max}\leq\overline{\lambda}; otherwise, we have λmax>λ¯\lambda_{\max}>\overline{\lambda}. A simple binary search recovers the exact value of λmax\lambda_{\max} in O(lognW)O(\log nW) iterations since edge weights are integers in {1,2,,W}\{1,2,\ldots,W\}. Finally, we call the Cut-Threshold Lemma with λ¯=λmax1\overline{\lambda}=\lambda_{\max}-1; we remove the vertices returned by this procedure from UU to obtain all vertices tUt\in U satisfying λ(s,t)=λmax\lambda(s,t)=\lambda_{\max}. For the running time bound, note that by Lemma 2.2, each iteration of the binary search calls max-flow on graphs that cumulatively contain O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges, and uses O~(m)\tilde{O}(m) time outside these calls. ∎

The SSMC Algorithm.

Having introduced the main tools, we are now ready to present our SSMC algorithm (see Figure 1). The input to the algorithm is a graph G=(V,E,w)G=(V,E,w) containing a specified vertex ss, a (guide) tree TT containing ss, and a positive integer kk. The algorithm is a recursive algorithm, and although the guide tree initially only contains vertices in VV, there will be additional vertices (not in VV) that are introduced into the guide tree in subsequent recursive calls. To distinguish between these two types of vertices, we define R(T)R(T) as the subset of vertices of TT that are in VV, and call these real vertices. We call the vertices of TT that are not in VV fake vertices.

We extend the definition of kk-respecting (i.e., Definition 1.7) to fake vertices as follows:

Definition 2.4 (Generalized kk-respecting).

Let AVA\subseteq V be a cut in G=(V,E,w)G=(V,E,w). Let TT be a tree on (some subset of) vertices in VV as well as additional vertices not in VV. We say that TT kk-respects cut AA (and vice versa) if there exists a set FAF_{A} of fake vertices such that TT contains at most kk edges with exactly one endpoint in AFAA\cup F_{A}; we say that such edges are cut by AFAA\cup F_{A}.

We also note that even if all the vertices in TT are real vertices, TT may not be a subgraph of GG.


Recall that our goal is to obtain a value λ~(t)λ(s,t)\tilde{\lambda}(t)\geq\lambda(s,t) for every terminal tU{s}t\in U\setminus\{s\} such that if an (s,t)(s,t)-mincut kk-respects TT, then λ~(t)=λ(s,t)\tilde{\lambda}(t)=\lambda(s,t). We will actually compute λ~(t)\tilde{\lambda}(t) for every real vertex tR(T){s}t\in R(T)\setminus\{s\}; clearly, this suffices since the input Steiner tree (i.e., at the top level of the recursion) spans all the vertices in UU.

The algorithm maintains estimates λ~(t)\tilde{\lambda}(t) of the mincut values λ(s,t)\lambda(s,t) for all tR(T){s}t\in R(T)\setminus\{s\}. The values λ~(t)\tilde{\lambda}(t) are initialized to \infty, and whenever we compute an (s,t)(s,t)-cut in the graph, we “update” λ~(t)\tilde{\lambda}(t) by replacing λ~(t)\tilde{\lambda}(t) with the value of the (s,t)(s,t)-cut if it is lower. Formally, we define Update(t,x):λ~(t)min(λ~(t),x)\textsc{Update}(t,x):\tilde{\lambda}(t)\leftarrow\min(\tilde{\lambda}(t),x).

We describe the algorithm below. The reader should use the illustration in Figure 1 as a visual description of each step of the algorithm.

  1. 1.

    First, we describe a base case. If |R(T)||R(T)| is less than some fixed constant, then we simply compute the (s,t)(s,t)-mincut in GG separately for each tR(T){s}t\in R(T)\setminus\{s\} using |R(T)|1=O(1)|R(T)|-1=O(1) max-flow calls, and run Update(t,λ(s,t))\textsc{Update}(t,\lambda(s,t)).

  2. From now on, assume that |R(T)||R(T)| is larger than some (large enough) constant.444For example, the constant 1010 is more than enough.

  3. 2.

    Let cc be a centroid of the tree TT, defined in the following manner: cc is a (possibly fake) vertex in TT such that if we root TT at cc, then each subtree rooted at a child of cc has at most |R(T)|/2|R(T)|/2 real vertices.555A centroid always exists by the following simple argument: take the (real or fake) vertex of TT of maximum depth whose subtree rooted at TT has at least |R(T)|/2|R(T)|/2 real vertices. By construction, this vertex is a centroid of TT, and it can be found in time linear in the number of vertices in the tree using a simple dynamic program.

  4. If cR(T)c\in R(T) and scs\not=c, then compute an (s,c(s,c)-mincut in GG (whose value is denoted λ\lambda) using a max-flow call and run Update(c,λ(s,c))\textsc{Update}(c,\lambda(s,c)).

  5. 3.

    Root TT at cc and let u1,,uu_{1},\ldots,u_{\ell} be the children of cc. For each i[]i\in[\ell], let TiT_{i} be the subtree rooted at uiu_{i}. Recall that R(Ti)R(T_{i}) denotes the set of real vertices in the respective subtrees TiT_{i} for i[]i\in[\ell]. (For technical reasons, we ignore subtrees TiT_{i} that do not contain any real vertex.) Use 2.1 to compute minimum isolating cuts in GG with the following terminal sets: (1) Ui=R(Ti)U_{i}=R(T_{i}) for i[]i\in[\ell]. (2) If cR(T)c\in R(T), then we add an additional set U+1={c}U_{\ell+1}=\{c\}. Note that iUi=R(T)\cup_{i}U_{i}=R(T) irrespective of whether cR(T)c\in R(T) or not.

  6. Let SiVS_{i}\subseteq V be the (Ui,R(T)Ui)(U_{i},R(T)\setminus U_{i})-mincut in GG obtained from 2.1. We ignore S+1S_{\ell+1} (if it exists) and proceed with the remaining sets SiS_{i} for i[]i\in[\ell] in the next step.

  7. 4.

    For each i[]i\in[\ell], define GiG_{i} as the graph GG with VSiV\setminus S_{i} contracted to a single vertex. Now, there are two cases. In the first case, we have sVSis\in V\setminus S_{i}. Then, the contracted vertex for VSiV\setminus S_{i} is labeled the new ss in graph GiG_{i}. Correspondingly, define TiT^{\prime}_{i} as the tree TiT_{i} with an added edge (s,ui)(s,u_{i}) (recall that uiu_{i} is the root of TiT_{i}). In the second case, we have sSis\in S_{i}. Then, assign a new label cic_{i} to the contracted vertex for VSiV\setminus S_{i} in GiG_{i}. In this case, define TiT^{\prime}_{i} as the tree TiT_{i} with an added edge (ci,ui)(c_{i},u_{i}), and keep the identity of vertex ss unchanged since it is in TiT_{i}. (Note that if s=cs=c, the only difference is that the second case does not happen for any i[]i\in[\ell].)

  8. In both cases above, make recursive calls (Gi,Ti,k)(G_{i},T^{\prime}_{i},k) for all i[]i\in[\ell]. Call Update(t,λ(s,t))\textsc{Update}(t,\lambda^{\prime}(s,t)) for all tR(Ti){s}t\in R(T_{i})\setminus\{s\} where the recursive call returns the value λ(s,t)\lambda^{\prime}(s,t) for the variable λ~(t)\tilde{\lambda}(t). Furthermore, if sSis\in S_{i}, call Update(t,λ(s,ci))\textsc{Update}(t,\lambda^{\prime}(s,c_{i})) for all tR(T)R(Ti)t\in R(T)\setminus R(T_{i}) where the recursive call returns the value λ(s,ci)\lambda^{\prime}(s,c_{i}) for the variable λ~(ci)\tilde{\lambda}(c_{i}).

  9. If k=1k=1, then we terminate the algorithm at this point, so from now on, assume that k>1k>1.

  10. 5.

    Sample each subtree TiT_{i} independently with probability 1/21/2 except the subtree containing ss (if it exists), which is sampled with probability 11. (If c=sc=s, then there is no subtree containing ss, and all subtrees are sampled with probability 1/21/2.) Let T(5)T^{(\ref{step:5})} be the tree TT with all (vertices of) non-sampled subtrees deleted. Recursively call (G,T(5),k1)(G,T^{(\ref{step:5})},k-1) and update λ~(t)\tilde{\lambda}(t) for all tR(T(5))t\in R(T^{(\ref{step:5})}). (Note that R(T(5))R(T^{(\ref{step:5})}) denotes the set of real vertices in tree T(5)T^{(\ref{step:5})}. Moreover, by the sampling procedure, ss is always in R(T(5))R(T^{(\ref{step:5})}) and hence, the recursion is valid.) Repeat this step for O(logn)O(\log n) independent sampling trials.

  11. 6.

    Execute this step only if scs\neq c, and let TsT_{s} be the subtree from step (2) containing ss. Using Lemma 2.3, compute the value λmax=max{λ(s,t):tR(T)R(Ts)}\lambda_{\max}=\max\{\lambda(s,t):t\in R(T)\setminus R(T_{s})\}, as well as all vertices tR(T)R(Ts)t\in R(T)\setminus R(T_{s}) attaining this maximum. Update λ~(t)=λmax\tilde{\lambda}(t)=\lambda_{\max} for all such tt, and arbitrarily select one such tt to be labeled ss^{\prime}. Let T(6)T^{(\ref{step:6})} be the tree TT with (the vertices of) subtree TsT_{s} removed. Recursively call (G,T(6),k1)(G,T^{(\ref{step:6})},k-1) where ss^{\prime} is treated as the new ss, and update λ~(t)\tilde{\lambda}(t) for all tR(T(6))t\in R(T^{(\ref{step:6})}).

Refer to caption
Figure 1: An illustration of the steps inside a recursive iteration of the SSMC algorithm. We assume that the centroid cc has four children in TT and that all tree vertices are real; in particular cR(T)c\in R(T), which simplifies some of the steps. Graph vertices that are not spanned by TT are represented by gray dots. The gray areas in Step 4 refer to contracted subsets, and the scissors symbol in Steps 5 and 6 means we remove the subtree.

2.1 Correctness

First, we show a standard (uncrossing) property of mincuts.

Lemma 2.5.

Let G=(V,E,w)G=(V,E,w) be a weighted, undirected graph with vertex subset UVU\subseteq V. For any subsets XXU\emptyset\subsetneq X\subseteq X^{\prime}\subsetneq U and an (X,UX)(X^{\prime},U\setminus X^{\prime})-mincut AVA^{\prime}\subseteq V of GG, there is an (X,UX)(X,U\setminus X)-mincut AVA\subseteq V of GG satisfying AAA\subseteq A^{\prime}.

Proof.

Consider any (X,UX)(X,U\setminus X)-mincut AAA\subsetneq A^{\prime}. We claim that AAA\cap A^{\prime} is also an (X,UX)(X,U\setminus X)-mincut of GG. First, note that (AA)U=X(A\cup A^{\prime})\cap U=X^{\prime}, so AAA\cup A^{\prime} is an (X,UX)(X^{\prime},U\setminus X^{\prime})-cut. Since AA^{\prime} is an (X,UX)(X^{\prime},U\setminus X^{\prime})-mincut, we have

δ(AA)δ(A).\delta(A\cup A^{\prime})\geq\delta(A^{\prime}).
δ(A)+δ(A)δ(AA)+δ(AA).\delta(A)+\delta(A^{\prime})\geq\delta(A\cup A^{\prime})+\delta(A\cap A^{\prime}).

Combining the two inequalities gives δ(AA)δ(A)\delta(A\cap A^{\prime})\leq\delta(A). Now, since XXAX\subseteq X^{\prime}\subseteq A^{\prime}, we have X(AA)=X\cap(A\setminus A^{\prime})=\emptyset. Since XAX\subseteq A, it must be that XAAX\subseteq A\cap A^{\prime}. So, AAA\cap A^{\prime} is an (X,UX)(X,U\setminus X)-cut. Since δ(AA)δ(A)\delta(A\cap A^{\prime})\leq\delta(A), it follows that AAA\cap A^{\prime} is an (X,UX)(X,U\setminus X)-mincut, which completes the proof. ∎

Now, we proceed to establish correctness of the SSMC algorithm. Note that λ~(t)\tilde{\lambda}(t) starts with the value \infty, and every time we run Update(t,x)\textsc{Update}(t,x), we have that xx is the value of some (s,t)(s,t)-cut in GG. Naturally, this would suggest that our estimate λ~(t)\tilde{\lambda}(t) is always an upper bound on the true value λ(s,t)\lambda(s,t). However, this is not immediately clear because the vertex ss may be relabeled in a recursive call from step (6). The lemma below shows that this relabeling is not an issue.

Lemma 2.6 (Upper bound).

For any instance (G=(V,E,w),T,k)(G=(V,E,w),T,k) and a vertex tR(T)t\in R(T), the output value λ~(t)\tilde{\lambda}(t) is at least λ(s,t)\lambda(s,t).

Proof.

If λ~(t)\tilde{\lambda}(t) is updated on Step (1) or Step (5), then we have λ~(t)λ(s,t)\tilde{\lambda}(t)\geq\lambda(s,t) because the updated value corresponds to a valid (s,t)(s,t)-cut. Suppose now that λ~(t)\tilde{\lambda}(t) is updated on Step (2), and let TiT_{i} be the subtree containing tt. By construction of GiG_{i}, we either contract a set containing ss (namely, VSiV\setminus S_{i}) into a vertex labeled the new ss, or we contract a set not containing ss (namely, VSiV\setminus S_{i} again) into a vertex (not labeled the new ss). In both cases, any (s,t)(s,t)-cut of graph GiG_{i}, with the contraction “reversed”, is a valid (s,t)(s,t)-cut in the original graph GG. It follows that the (s,t)(s,t)-mincut value λGi(s,t)\lambda_{G_{i}}(s,t)666λGi(s,t)\lambda_{G_{i}}(s,t) is the value of an (s,t)(s,t)-mincut in graph GiG_{i}. in GiG_{i} is at least the value λG(s,t)\lambda_{G}(s,t) in GG. By induction, the output of the recursive call (Gi,Ti,k)(G_{i},T_{i}^{\prime},k) is at least λGi(s,t)λG(s,t)\lambda_{G_{i}}(s,t)\geq\lambda_{G}(s,t), as promised.

If λ~(s,t)\tilde{\lambda}(s,t) is updated on Step (5), then since the graph GG remains unchanged, the value λ(s,t)\lambda(s,t) is also unchanged, and we have λ~(t)λ(s,t)\tilde{\lambda}(t)\geq\lambda(s,t) by induction. The most interesting case is when λ~(s,t)\tilde{\lambda}(s,t) is updated on Step (6). Here, by the choice of ss^{\prime}, we have λ(s,s)λ(s,t)\lambda(s,s^{\prime})\geq\lambda(s,t). Next, observe that λ(s,t)min{λ(s,s),λ(s,t)}\lambda(s^{\prime},t)\geq\min\{\lambda(s,s^{\prime}),\lambda(s,t)\} holds because the (s,t)(s^{\prime},t)-mincut is either an (s,t)(s,t)-cut or an (s,s)(s^{\prime},s)-cut depending on whether ss is on the side of ss^{\prime} or the side of tt. Combining the two previous inequalities gives λ(s,t)λ(s,t)\lambda(s^{\prime},t)\geq\lambda(s,t), and by induction, the output of the recursive call (G,T(6),k1)(G,T^{(\ref{step:6})},k-1) is at least λ(s,t)λ(s,t)\lambda(s^{\prime},t)\geq\lambda(s,t), as promised. ∎

The lemma above establishes the condition λ~(t)λ(s,t)\tilde{\lambda}(t)\geq\lambda(s,t) of Theorem 1.10. It remains to show equality when TT is kk-respecting an (s,t)(s,t)-mincut, which we prove below.

Lemma 2.7 (Equality).

Consider an instance (G=(V,E,w),T,k)(G=(V,E,w),T,k) and a vertex tR(T)t\in R(T) such that there is an (s,t)(s,t)-mincut in GG that kk-respects TT. Then, the value λ~(t)\tilde{\lambda}(t) computed by the algorithm equals λ(s,t)\lambda(s,t) w.h.p.

Proof.

Consider an (s,t)(s,t)-mincut CC in GG that kk-respects TT. First, if the centroid cc is the vertex tt, then the mincut computation in Step (5) correctly recovers λ(s,t)\lambda(s,t). Otherwise, let TtT_{t} be the subtree containing tt. We have a few cases based on the locations of the edges in TT that cross the cut CC, which we call the cut edges. Note that there is at least one cut edge along the (s,t)(s,t) path in TT, and it is incident to (the vertices of) either TtT_{t} or the subtree TsT_{s} containing ss. (If c=sc=s and there is no subtree TsT_{s} containing ss, then at least one cut edge must be incident on some vertex in TtT_{t}.)

Refer to caption
Figure 2: An illustration of the different cases, which part of our algorithm deals with them, and the corresponding running time. Here, vertices in the side of ss are depicted by blue dots, vertices in the side of tt by red dots, and cut edges by dashed lines. The gray area refers to a contracted subset, and the scissors symbol means we remove the subtree. Observe that whenever the latter happens, we get rid of at least one cut edge.

The first case (Case 1 in Figure 2) is that all the cut edges are incident to the vertices of a single subtree TjT_{j}, which must be either TtT_{t} or TsT_{s} (if the latter exists). Then, there is a side A{C,VC}A\in\{C,V\setminus C\} of the (s,t)(s,t)-mincut CC whose vertices in R(T)R(T) are all in R(Tj)R(T_{j}); in other words, AR(T)=AR(Tj)A\cap R(T)=A\cap R(T_{j}). Note that AA is an (AR(Tj),R(T)(AR(Tj)))(A\cap R(T_{j}),R(T)\setminus(A\cap R(T_{j})))-mincut since if there were a smaller such cut, then that would also be a smaller (s,t)(s,t)-cut, which contradicts that AA is an (s,t)(s,t)-mincut. Also, by construction, SjS_{j} is a (R(Tj),R(T)R(Tj))(R(T_{j}),R(T)\setminus R(T_{j}))-mincut. We now apply Lemma 2.5 on parameters U=R(T)U=R(T), A=AA=A, X=AR(Tj)X=A\cap R(T_{j}), A=SjA^{\prime}=S_{j}, and X=R(Tj)X^{\prime}=R(T_{j}). The lemma implies that there is an (AR(Tj),R(T)(AR(Tj)))(A\cap R(T_{j}),R(T)\setminus(A\cap R(T_{j})))-mincut A~Sj\tilde{A}\subseteq S_{j}, and this cut survives in the contracted graph GjG_{j}. Since A~\tilde{A} is an (s,t)(s,t)-cut of the same value as AA, we conclude that A~\tilde{A} is also an (s,t)(s,t)-mincut. Finally, we argue that A~\tilde{A} also kk-respects the tree TjT^{\prime}_{j} in the recursive instance. By definition, since AA kk-respects TT, there exists a set FAF_{A} of fake vertices such that TT contains at most kk edges cut by AFAA\cup F_{A}. Since AA and A~\tilde{A} agree on vertices in R(Tj)R(T_{j}), tree TT also contains at most kk edges cut by A~FA\tilde{A}\cup F_{A} (it is the exact same set of edges). Define FA~=FAV(Tj)F_{\tilde{A}}=F_{A}\cap V(T_{j}), and from A~R(T)R(Tj)\tilde{A}\cap R(T)\subseteq R(T_{j}), we observe that tree TjT_{j} contains at most kk edges cut by A~FA~\tilde{A}\cap F_{\tilde{A}} (it is all edges from before, restricted to tree TjT_{j}). Furthermore, the new edge (s,uj)(s,u_{j}) or (cj,uj)(c_{j},u_{j}) added to TjT^{\prime}_{j} is cut by A~FA~\tilde{A}\cup F_{\tilde{A}} if and only if the edge (c,uj)(c,u_{j}) of TT is cut by A~FA\tilde{A}\cup F_{A}. It follows that at most kk edges of TjT^{\prime}_{j} are cut by A~FA~\tilde{A}\cup F_{\tilde{A}}. Thus, the lemma statement is satisfied on recursive call (Gj,Tj,k)(G_{j},T^{\prime}_{j},k) of Step (2), and the algorithm recovers λ(s,t)\lambda(s,t) w.h.p.

In the rest of the proof, we assume that the edges of TT cut by AFAA\cup F_{A} are incident to (the vertices of) at least two subtrees. Suppose first (Case 2 in Figure 2) that a cut edge is incident to some subtree TjT_{j} that is not TtT_{t} or TsT_{s} (or only TtT_{t}, if s=cs=c and TsT_{s} does not exist). In each independent trial of Step (5), we sample TtT_{t} but not TjT_{j} with constant probability. In this case, since TjT_{j} is discarded in the construction of T(5)T^{(\ref{step:5})}, the (s,t)(s,t)-mincut CC (k1)(k-1)-respects the resulting tree T(5)T^{(\ref{step:5})}. Over O(logn)O(\log n) independent trials, this happens w.h.p., and the algorithm correctly recovers λ(s,t)\lambda(s,t) w.h.p.

We are left with the case (Case 3 in Figure 2) that all edges of TT cut by AFAA\cup F_{A} are incident to subtrees TtT_{t} and TsT_{s}. Note that TsT_{s} must exist since if s=cs=c and Case 2 does not happen, we would be in Case 1. Furthermore, TsTtT_{s}\neq T_{t}, because otherwise, we would either be in Case 1 (if all cut edges are incident on Tt=TsT_{t}=T_{s}) or in Case 2 (if there is at least one cut edge incident on some TjTt=TsT_{j}\not=T_{t}=T_{s}).

Since TsTtT_{s}\neq T_{t}, we have tR(Ts)t\notin R(T_{s}), i.e., tR(T)R(Ts)t\in R(T)\setminus R(T_{s}). If λ(s,t)=λmax\lambda(s,t)=\lambda_{\max} (where λmax\lambda_{\max} is as defined in Step (6)), then Step (6) sets λ(s,t)=λmax\lambda(s,t)=\lambda_{\max} correctly. Otherwise, we must have λ(s,t)<λmax\lambda(s,t)<\lambda_{\max}. In this case, we claim that the vertex ss^{\prime} (that has the property λ(s,s)=λmax\lambda(s,s^{\prime})=\lambda_{\max} in Step (6) of the algorithm) satisfies λ(s,t)=λ(s,t)\lambda(s^{\prime},t)=\lambda(s,t). To prove this claim, we first observe that ss^{\prime} must appear on the ss-side of the (s,t)(s,t)-mincut CC. Otherwise, if ss^{\prime} is on the tt-side, then CC is an (s,s)(s,s^{\prime})-cut of value λ(s,t)<λmax\lambda(s,t)<\lambda_{\max}, contradicting the guarantee λ(s,s)=λmax\lambda(s,s^{\prime})=\lambda_{\max}. It follows that λ(s,t)λ(s,t)\lambda(s^{\prime},t)\leq\lambda(s,t). Next, observe that ss must appear on the ss^{\prime}-side of the (s,t)(s^{\prime},t)-mincut CC^{\prime}. Otherwise, if ss is on the tt-side, then CC^{\prime} is an (s,s)(s,s^{\prime})-cut of value λ(s,t)λ(s,t)<λmax\lambda(s^{\prime},t)\leq\lambda(s,t)<\lambda_{\max}, contradicting the guarantee λ(s,s)=λmax\lambda(s,s^{\prime})=\lambda_{\max}. It follows that λ(s,t)λ(s,t)\lambda(s,t)\leq\lambda(s^{\prime},t), which proves the claim λ(s,t)=λ(s,t)\lambda(s,t)=\lambda(s^{\prime},t).

Consider again the (s,t)(s,t)-mincut CC. Since ss^{\prime} is on the ss-side of the (s,t)(s,t)-mincut CC, if we swap the locations of ss and ss^{\prime} in TT, then CC still kk-respects the modified tree, and the edges of the tree that cross the cut are the same (except that ss and ss^{\prime} swap places on the edges). In particular, the subtree TsT_{s} with ss replaced by ss^{\prime} has at least one cut edge. By removing this modified subtree TsT_{s}, we arrive at the tree T(6)T^{(\ref{step:6})} in Step (6), and the (s,t)(s,t)-mincut CC must (k1(k-1)-respect T(6)T^{(\ref{step:6})}. So, the recursive call (G,T(6),k1)(G,T^{(\ref{step:6})},k-1) recovers λ(s,t)\lambda(s^{\prime},t) w.h.p., which equals λ(s,t)\lambda(s,t) by the claim above.

This concludes all cases, and hence the proof of Lemma 2.7. ∎

2.2 Running Time

Lemma 2.8 (Running time).

For any fixed integer k1k\geq 1, the algorithm calls max-flow on instances of at most nn vertices and mm edges each, and a total of O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges. Moreover, these max-flow calls dominate the running time.

We first bound the total number of vertices across all recursive instances, then use the same technique to also bound the total number of edges.

We use the following notation for any recursive call: r=|R(T)|r=|R(T)| and nn represents the number of vertices in GG including contracted vertices, i.e., vertices resulting from the contraction on Step (2) of any previous instance. (Since the original instance has no contracted vertex, the initial value of nn is just the number of vertices in the input graph.) The function f(n,r,k)f(n,r,k) represents an upper bound on the total number of vertices among all max-flow calls that occur, starting from a single input instance with parameters n,r,kn,r,k (and including max-flows called inside recursive instances).

Fix an instance with parameters n,r,kn,r,k. For each ii, let nin_{i} represent the number of vertices in GiG_{i}, and let ri=|R(Ti)|r_{i}=|R(T_{i})|. Now observe that

  1. 1.

    i=1(ni1)=n1\sum_{i=1}^{\ell}(n_{i}-1)=n-1 since the sets SiS_{i} are disjoint by the guarantee of 2.1, and

  2. 2.

    rir/2r_{i}\leq r/2 for each i[]i\in[\ell] by the fact that cc is a centroid.

We now consider the individual steps of the recursive SSMC algorithm.

  1. 1.

    The algorithm calls a single max-flow in step (5), and then in step (2), it calls 2.1, which in turn calls max-flows on a total of O(nlog)O(n\log\ell) vertices. In total, this is O(nlog)O(n\log\ell) vertices among the max-flow calls.

  2. 2.

    In step (2), the algorithm makes recursive calls on trees TiT^{\prime}_{i} containing ri+1r_{i}+1 real vertices each, and graphs GiG_{i} containing nin_{i} vertices each, so the total number of vertices in the max-flow calls in the recursion is at most i[]f(ni,ri+1,k)\sum_{i\in[\ell]}f(n_{i},r_{i}+1,k).

  3. 3.

    In step (5), the algorithm makes O(logn)O(\log n) independent calls to an instance where kk decreases by 11. So, this step contributes at most O(logn)f(n,r,k1)O(\log n)\cdot f(n,r,k-1).

  4. 4.

    In step (6), the algorithm calls Lemma 2.3, which in turn calls max-flows on a total of O~(n)\tilde{O}(n) vertices, followed by a recursive call on an instance where kk decreases by 11. In total, this step contributes at most O~(n)+f(n,r,k1)\tilde{O}(n)+f(n,r,k-1).

We may assume that f(n,r,k)f(n,r,k) is monotone non-decreasing in all three parameters, which gives us the recursive formula

f(n,r,k)O(nlog)steps (5),(2)\displaystyle f(n,r,k)\leq\underbrace{O(n\log\ell)}_{\text{steps~{}(\ref{step:2}),(\ref{step:3})}} +i[]f(ni,ri+1,k)step (2)+O(logn)f(n,r,k1)step (5), only for k>1+O~(n)+f(n,r,k1)step (6), only for k>1.\displaystyle+\underbrace{\sum_{i\in[\ell]}f(n_{i},r_{i}+1,k)}_{\text{step (\ref{step:4})}}+\underbrace{O(\log n)\cdot f(n,r,k-1)}_{\text{step (\ref{step:5}), only for }k>1}+\underbrace{\tilde{O}(n)+f(n,r,k-1)}_{\text{step (\ref{step:6}), only for }k>1}.

We now claim that f(n,r,k)f(n,r,k) solves to O~(n)\tilde{O}(n) for any constant kk, where the number of polylog terms depends on kk. For k=1k=1, the recursive formula f(n,t,1)f(n,t,1) solves to O(nlog2t)O(n\log^{2}t). This is because ri+1r/2+123rr_{i}+1\leq r/2+1\leq\frac{2}{3}r for all i[]i\in[\ell] limits the recursive depth to O(logt)O(\log t).777Here, we have used the assumption that rr is larger than some constant, e.g. 10. And, since i=1(ni1)=n1\sum_{i=1}^{\ell}(n_{i}-1)=n-1, the sum of f()f(\cdot) in any recursive level is O(nlogt)O(n\log t). For larger kk, note that if we assume that f(n,r,k1)O~(n)f(n,r,k-1)\leq\tilde{O}(n), then we also obtain f(n,r,k)O~(n)f(n,r,k)\leq\tilde{O}(n), where the O~()\tilde{O}(\cdot) hides more logarithmic factors. The claim then follows by induction on kk. (Note that the polylogarithmic dependency on kk is f(n,r,k)=n(logn)O(k)f(n,r,k)=n(\log n)^{O(k)}.)

We now bound the total number of edges. We use the following notation in any recursive call: as earlier, r=|R(T)|r=|R(T)| and nn represents the number of vertices in GG including contracted vertices. In addition, mm^{\prime} represents nn plus the number of edges in GG not incident to a contracted vertex. (Since the original instance has no contracted vertex, the initial value of mm^{\prime} is just the number of vertices plus the number of edges in the input graph.) The function g(m,n,r,k)g(m^{\prime},n,r,k) represents an upper bound on f(n,r,k)f(n,r,k) plus the total number of edges not incident to contracted vertices among all max-flow calls that occur, starting from a single input instance with parameters m,n,r,km^{\prime},n,r,k (and including max-flows called inside recursive instances). This then implies a bound on the total number of edges over all max-flow calls, including those incident to contracted vertices, by the following argument. Each recursive instance has at most O(log|R(T)|)O(\log|R(T)|) contracted vertices, since each contraction in Step (2) decreases |R(T)||R(T)| by a constant factor. So the total number of edges incident to contracted vertices is at most the total number of vertices times O(log|R(T)|)O(\log|R(T)|), which is at most f(n,r,k)O(logn)g(m,n,r,k)O(logn)f(n,r,k)\cdot O(\log n)\leq g(m^{\prime},n,r,k)\cdot O(\log n). So from now on, we only focus on edges not incident to contracted vertices.

Fix an instance with parameters m,n,r,km^{\prime},n,r,k. For each ii, let nin_{i} represent the number of vertices in GiG_{i}, let mim^{\prime}_{i} represent the number of edges in GiG_{i} not incident to a contracted vertex, and let ri=|R(Ti)|r_{i}=|R(T_{i})|. Once again, observe that i=1(ni1)=n1\sum_{i=1}^{\ell}(n_{i}-1)=n-1 and rir/2r_{i}\leq r/2 for each i[]i\in[\ell]. This time, we also have i=1mim\sum_{i=1}^{\ell}m^{\prime}_{i}\leq m^{\prime} by the following explanation: 2.1 guarantees that the vertex sets SiS_{i} are disjoint, and the edges of each GiG_{i} not incident to a contracted vertex have both endpoints in SiS_{i}, and are therefore disjoint over all ii. We may assume that g(m,n,r,k)g(m,n,r,k) is monotone non-decreasing in all four parameters, which gives us the recursive formula

g(m,n,r,k)O((m+n)log)steps (5),(2)+i[]g(mi,ni,ri,k)step (2)\displaystyle g(m^{\prime},n,r,k)\leq\underbrace{O((m+n)\log\ell)}_{\text{steps~{}(\ref{step:2}),(\ref{step:3})}}+\underbrace{\sum_{i\in[\ell]}g(m_{i},n_{i},r_{i},k)}_{\text{step (\ref{step:4})}} +O(logn)g(m,n,r,k1)step (5), only for k>1\displaystyle+\underbrace{O(\log n)\cdot g(m,n,r,k-1)}_{\text{step (\ref{step:5}), only for }k>1}
+O~(m)+g(m,n,r,k1)step (6), only for k>1.\displaystyle+\underbrace{\tilde{O}(m)+g(m,n,r,k-1)}_{\text{step (\ref{step:6}), only for }k>1}.

Similar to the solution for f(n,r,k)f(n,r,k), we now have that g(m,n,r,k)g(m,n,r,k) solves to O~(m+n)\tilde{O}(m+n) for any constant kk by the same inductive argument. (Once again, the polylogarithmic dependency on kk is f(n,r,k)=(m+n)(logn)O(k)f(n,r,k)=(m+n)(\log n)^{O(k)}.)

Since the graph never increases in size throughout the recursion, each max-flow call is on a graph with at most as many vertices and edges as the original input graph. Finally, we claim that the max-flow calls dominate the running time of the algorithm. In particular, finding the centroid of TT on step (5) can be done in time in the size of the tree (see the footnote at step (5)), which is dominated by the single max-flow call on the same step. This finishes the proof of Lemma 2.8.

3 Constructing Guide Trees

In this section, we show how to obtain guide trees that prove Theorem 1.9. Our algorithm is based on the notion of a Steiner subgraph packing, as described next.

Definition 3.1.

Let G=(V,E,w)G=(V,E,w) be an undirected edge-weighted graph with a set of terminals UVU\subseteq V. A subgraph HH of GG is said to be a UU-Steiner subgraph (or simply a Steiner subgraph if the terminal set UU is unambiguous from the context) if all the terminals are connected in HH. In this case, we also call HH a terminal-spanning subgraph of GG.

Definition 3.2.

A UU-Steiner-subgraph packing 𝒫{\cal P} is a collection of UU-Steiner subgraphs H1,,HkH_{1},\ldots,H_{k}, where each subgraph HiH_{i} is assigned a value val(Hi)>0\mathrm{val}(H_{i})>0. If all val(Hi)\mathrm{val}(H_{i}) are integral, we say that 𝒫{\cal P} is an integral packing. Throughout, a packing is assumed to be fractional (which means that it does not have to be integral), unless specified otherwise. The value of the packing 𝒫{\cal P} is the total value of all its Steiner subgraphs, denoted val(𝒫)=H𝒫val(H)\mathrm{val}({\cal P})=\sum_{H\in{\cal P}}\mathrm{val}(H). We say that 𝒫{\cal P} is feasible if

eE,H𝒫:eHval(H)w(e).\forall e\in E,\quad\sum_{H\in{\cal P}:e\in H}\mathrm{val}(H)\leq w(e).

To understand this definition, think of w(e)w(e) as the “capacity” of ee; then, this condition means that the total value of all Steiner subgraphs H𝒫H\in{{\cal P}} that “use” edge ee does not exceed its capacity w(e)w(e). A Steiner-tree packing is a packing 𝒫{\cal P} where each subgraph H𝒫H\in{\cal P} is a tree.

Denote by pack(U)\mathrm{pack}(U) the maximum value of a feasible UU-Steiner-subgraph packing in GG. The next two lemmas show a close connection between Steiner-subgraph packing pack(U)\mathrm{pack}(U) and UU-Steiner mincut λ(U)\lambda(U), and that the former problem admits a (2+ϵ)(2+\epsilon)-approximation algorithm.

Lemma 3.3.

For every graph GG with terminal set UU, we have λ(U)/2pack(U)λ(U)\lambda(U)/2\leq\mathrm{pack}(U)\leq\lambda(U).

Lemma 3.4.

There is a deterministic algorithm that, given ϵ(0,1/2)\epsilon\in(0,1/2), a graph G=(V,E,w)G=(V,E,w), and a terminal set UVU\subseteq V, returns a UU-Steiner-subgraph packing 𝒫{\cal P} of value val(𝒫)pack(U)/(2+ϵ)\mathrm{val}({\cal P})\geq\mathrm{pack}(U)/(2+\epsilon) in O~(m2/ϵ2)\tilde{O}(m^{2}/\epsilon^{2}) time, and in the case of unweighted GG in m1+o(1)/ϵ2m^{1+o(1)}/\epsilon^{2} time.

We prove Lemmas 3.3 and 3.4 in Sections 3.1 and 3.2, respectively. Assuming these lemmas, we immediately obtain the following.

Corollary 3.5.

There is a deterministic algorithm that, given ϵ(0,1/2)\epsilon\in(0,1/2) and a graph G=(V,E,w)G=(V,E,w) with mm edges and terminal set UVU\subseteq V, returns a UU-Steiner subgraph packing 𝒫{\cal P} of value val(𝒫)λ(U)/(4+ϵ)\mathrm{val}({\cal P})\geq\lambda(U)/(4+\epsilon) in O~(m2/ϵ2)\tilde{O}(m^{2}/\epsilon^{2}) time, and in the case of unweighted GG in m1+o(1)/ϵ2m^{1+o(1)}/\epsilon^{2} time.

Algorithm for constructing guide trees.

Given Corollary 3.5, we can now prove Theorem 1.9.

Proof of Theorem 1.9.

Fix ϵ0=1/60\epsilon_{0}=1/60 (or another sufficiently small ϵ0>0\epsilon_{0}>0). The construction of guide trees is described in Algorithm 1. To analyze this algorithm, let 𝒫{\cal P} be the packing computed in line 1. Consider tU{s}t\in U\setminus\{s\}, and let (St,VSt)(S_{t},V\setminus S_{t}) be a minimum s,ts,t-cut in GG. Denote by w(St,VSt)w(S_{t},V\setminus S_{t}) the total edge-weight of this cut in GG, and by w(St,VSt)w^{\prime}(S_{t},V\setminus S_{t}) the total edge-weight of the cut in GG^{\prime} between these same vertices.

input : Undirected graph G=(V,E,w)G=(V,E,w) (weighted or unweighted) and terminal set UVU\subseteq V
output : A collection of guide trees for UU
1 if GG is weighted then then
2       compute for it a (1±ϵ0)(1\pm\epsilon_{0})-cut-sparsifier GG^{\prime} using [BK15] and ϵ0=1/60\epsilon_{0}=1/60, thus GG^{\prime} has m=O~(n/ϵ02)m=\tilde{O}(n/\epsilon_{0}^{2}) edges
3else
4       let GGG^{\prime}\leftarrow G
5compute a packing 𝒫{\cal P} for GG^{\prime} by applying Corollary 3.5
6 sample 300lnn300\ln n subgraphs from 𝒫{\cal P}, each drawn independently from the distribution {val(H)/val(𝒫)}H𝒫\{\mathrm{val}(H)/\mathrm{val}({\cal P})\}_{H\in{\cal P}}
7 compute any Steiner tree of each sampled subgraph, and report these trees
Algorithm 1 An algorithm for constructing guide trees

Consider first an unweighted input GG. Then, the computation in line 1 is applied to G=GG^{\prime}=G. By combining Corollary 3.5 and the promise in the single source terminal mincuts problem (1.5) that λG(s,t)1.1λ(U)\lambda_{G}(s,t)\leq 1.1\lambda(U), 888For a graph GG^{\prime}, λG(s,t)\lambda_{G^{\prime}}(s,t) denotes the value of an (s,t)(s,t)-mincut in GG^{\prime}, and recall that λ(U)\lambda(U) is the value of a UU-Steiner mincut in GG. we get that

val(𝒫)λ(U)4+ϵ0λG(s,t)1.1(4+ϵ0)=w(St,VSt)1.1(4+ϵ0).\displaystyle\mathrm{val}({\cal P})\geq\frac{\lambda(U)}{4+\epsilon_{0}}\geq\frac{\lambda_{G}(s,t)}{1.1(4+\epsilon_{0})}=\frac{w^{\prime}(S_{t},V\setminus S_{t})}{1.1(4+\epsilon_{0})}\ . (1)

If the input graph GG is weighted, then the bound in (1) applies to the cut-sparsifier GG^{\prime} of GG, and we get that

val(𝒫)λG(s,t)1.1(4+ϵ0)(1ϵ0)w(St,VSt)1.1(4+ϵ0)(1ϵ0)w(St,VSt)1.1(4+ϵ0)(1+ϵ0)w(St,VSt)1.1(4+30ϵ0).\displaystyle\mathrm{val}({\cal P})\geq\frac{\lambda_{G^{\prime}}(s,t)}{1.1(4+\epsilon_{0})}\geq\frac{(1-\epsilon_{0})\cdot w(S_{t},V\setminus S_{t})}{1.1(4+\epsilon_{0})}\geq\frac{(1-\epsilon_{0})\cdot w^{\prime}(S_{t},V\setminus S_{t})}{1.1(4+\epsilon_{0})(1+\epsilon_{0})}\geq\frac{w^{\prime}(S_{t},V\setminus S_{t})}{1.1(4+30\epsilon_{0})}\ . (2)

We remark that now the packing 𝒫{\cal P} contains subgraphs of the sparsifier GG^{\prime} and not of GG, but it will not pose any issue.

In both cases we have the weaker inequality

val(𝒫)w(St,VSt)1.1(4+30ϵ0).\displaystyle\mathrm{val}({\cal P})\geq\frac{w^{\prime}(S_{t},V\setminus S_{t})}{1.1(4+30\epsilon_{0})}\ . (3)

Let EtE^{\prime}_{t} be the set of edges in the cut (St,VSt)(S_{t},V\setminus S_{t}) in GG^{\prime} (depending on the case, GG^{\prime} is either GG or the sparsifier). Let 𝒫4𝒫{\cal P}_{\leq 4}\subseteq{\cal P} be the subset of all Steiner subgraphs H𝒫H\in{\cal P} whose intersection with EtE^{\prime}_{t} is at most 44 edges, and let FtF_{t} be the event that no subgraph from 𝒫4{\cal P}_{\leq 4} is sampled in line 1. Then

Pr[Ft]\displaystyle\Pr[F_{t}] =(1val(𝒫4)/val(𝒫))300lnn\displaystyle=\left(1-\mathrm{val}({\cal P}_{\leq 4})/\mathrm{val}({\cal P})\right)^{300\ln n}
n300val(𝒫4)/val(𝒫).\displaystyle\leq n^{-300\cdot\mathrm{val}({\cal P}_{\leq 4})/\mathrm{val}({\cal P})}. (4)

Similarly to Karger’s paper [Kar00], define xHx_{H} to be one less than the number of edges of HH that crosses the cut EtE^{\prime}_{t}, and observe that xHx_{H} is always a non-negative integer (because UU is connected in HH). Since 𝒫{\cal P} is a packing, every edge of EtE^{\prime}_{t} appears in at most one subgraph of 𝒫{\cal P}, and consequently,

H𝒫val(H)(xH+1)\displaystyle\sum_{H\in{\cal P}}\mathrm{val}(H)(x_{H}+1) eEtw(e)=w(St,VSt)\displaystyle\leq\sum_{e\in E^{\prime}_{t}}w(e)=w^{\prime}(S_{t},V\setminus S_{t})
H𝒫val(H)xH\displaystyle\Longrightarrow\sum_{H\in{\cal P}}\mathrm{val}(H)x_{H} w(St,VSt)H𝒫val(H)=w(St,VSt)val(𝒫).\displaystyle\leq w^{\prime}(S_{t},V\setminus S_{t})-\sum_{H\in{\cal P}}\mathrm{val}(H)=w^{\prime}(S_{t},V\setminus S_{t})-\mathrm{val}({\cal P}).

Observe that for a random H¯𝒫\bar{H}\in{\cal P} drawn as in line 1,

𝔼H¯[xH¯]=H𝒫xHval(H)val(𝒫)w(St,VSt)val(𝒫)11.1(4+30ϵ0)1,\operatorname{\mathbb{E}}_{\bar{H}}[x_{\bar{H}}]=\sum_{H\in{\cal P}}x_{H}\cdot\frac{\mathrm{val}(H)}{\mathrm{val}({\cal P})}\leq\frac{w^{\prime}(S_{t},V\setminus S_{t})}{\mathrm{val}({\cal P})}-1\leq 1.1(4+30\epsilon_{0})-1,

where the last inequality is by (3). By Markov’s inequality,

PrH¯[xH¯4]1.1(4+30ϵ0)140.99.\Pr_{\bar{H}}[x_{\bar{H}}\geq 4]\leq\frac{1.1(4+30\epsilon_{0})-1}{4}\leq 0.99.

Observe that val(𝒫4)/val(𝒫)=PrH¯[xH¯<4]0.01\mathrm{val}({\cal P}_{\leq 4})/\mathrm{val}({\cal P})=\Pr_{\bar{H}}[x_{\bar{H}}<4]\geq 0.01, and so by plugging into (4)(\ref{eq:weighted}) we get that Pr[Ft]1/n3\Pr[F_{t}]\leq 1/n^{3}. Finally, by a union bound we have that with high probability, for every tU{s}t\in U\setminus\{s\}, at least one of the subgraphs that are sampled in line 1 of the algorithm 44-respects the cut EtE^{\prime}_{t},999Strictly speaking, Definition 1.7 defines 44-respecting only relative to a tree TT, but the same wording extends immediately to any graph TT (not necessarily a tree). and thus at least one of the trees reported by the algorithm 44-respects EtE^{\prime}_{t}. Furthermore, since the cut EtE^{\prime}_{t} in GG^{\prime} has the exact same bipartition of VV as the (s,t)(s,t)-mincut in GG, the reported tree mentioned above 44-respects also the (s,t)(s,t)-mincut in GG (recall that Definition 1.7 refers to a cut as a bipartition of VV).

Finally, computing a Steiner tree of a Steiner subgraph in Line 1 only takes linear time, and so the running time is dominated by line 1 and thus it is bounded by O~(n2/ϵ2)\tilde{O}(n^{2}/\epsilon^{2}) for weighted graphs and by m1+o(1)/ϵ2m^{1+o(1)}/\epsilon^{2} for unweighted graphs, and by fixing a small ϵ>0\epsilon>0, we can write these as O~(n2)\tilde{O}(n^{2}) and m1+o(1)m^{1+o(1)}, respectively. This concludes the proof of Theorem 1.9. ∎

3.1 Steiner-Subgraph Packing vs Steiner Mincut

In this section, we prove 3.3, i.e., that λ(U)/2pack(U)λ(U)\lambda(U)/2\leq\mathrm{pack}(U)\leq\lambda(U).

We start with the second inequality pack(U)λ(U)\mathrm{pack}(U)\leq\lambda(U), which is easier. Let 𝒫{\cal P} be a UU-Steiner-subgraph packing, and let SVS\subset V be a Steiner min-cut of UU. Then for every Steiner subgraph H𝒫H\in{\cal P}, by definition |EH(S,VS)|1|E_{H}(S,V\setminus S)|\geq 1.101010For any graph GG^{\prime}, the set of edges in the cut (S,VS)(S,V\setminus S) is denoted EG(S,VS)E_{G^{\prime}}(S,V\setminus S). By the feasibility of 𝒫{\cal P}, for every eEe\in E we have H𝒫:eHval(H)w(e)\sum_{H\in{{\cal P}}:e\in H}\mathrm{val}(H)\leq w(e). Putting these together, we conclude that

val(𝒫)=H𝒫val(H)\displaystyle\mathrm{val}({\cal P})=\sum_{H\in{\cal P}}\mathrm{val}(H) H𝒫val(H)|EH(S,VS)|\displaystyle\leq\sum_{H\in{\cal P}}\mathrm{val}(H)\cdot|E_{H}(S,V\setminus S)|
=eEG(S,VS)H𝒫:eHval(H)\displaystyle=\sum_{e\in E_{G}(S,V\setminus S)}\sum_{H\in{\cal P}:e\in H}\mathrm{val}(H)
eEG(S,VS)w(e)=λ(U).\displaystyle\leq\sum_{e\in E_{G}(S,V\setminus S)}w(e)=\lambda(U).

To establish the first inequality λ(U)/2pack(U)\lambda(U)/2\leq\mathrm{pack}(U), we need to show that one can always pack into GG Steiner subgraphs of total value (at least) λ(U)/2\lambda(U)/2. This packing bound actually follows from more general theorems of Bang-Jensen et al. [BFJ95] and Bhalgat et al. [BHKP07, BCH+08], but we give a simple self-contained proof here.

First note that we can assume, only for sake of analysis, that the graph is an unweighted multi-graph (by replacing each edge by parallel edges of unit weight) and that every vertex has an even degree (by appropriate scaling). (In what follows, we will obtain an integral packing but undoing the scaling step possibly converts it into a fractional packing.)

We use the following classic result due to Mader [Mad78].

Theorem 3.6.

Let G=(V{s},E)G=(V\cup\{s\},E) be an undirected unweighted multi-graph where every vertex has an even degree.111111In the original theorem of Mader, the only restriction is that the degree of ss cannot be equal to 3. But, for our purposes, it suffices to assume that every vertex has even degree. Then, there exists a pair of edges (u,s)(u,s) and (v,s)(v,s) incident on ss that can be split off, i.e., replaced by their shortcut edge (u,v)(u,v), while preserving the xyx-y edge connectivity for all pairs of vertices x,yVx,y\in V.

By applying Theorem 3.6 repeatedly on edges incident on ss, we can isolate the vertex ss. Iterating further, we can isolate any subset of vertices while preserving the pairwise edge connectivities of all the remaining vertices. We thus isolate all the non-terminal vertices, and then delete these isolated vertices to obtain a graph G(U)G(U) only on the terminal vertices UU. Observe that edges in G(U)G(U) represent edge-disjoint paths in GG. We also claim that the global edge connectivity of G(U)G(U) is at least λ(U)\lambda(U). Indeed, the global edge connectivity of G(U)G(U) equals the minimum of all its pairwise edge connectivities, which are all preserved from GG, and it is clear that in GG all pairwise edge connectivities are at least λ(U)\lambda(U).

Next, we shall use the following classic theorem of Nash-Williams [NW61] and Tutte [Tut61] to pack edge-disjoint spanning trees in G(U)G(U).

Theorem 3.7.

Let G=(V,E)G=(V,E) be an undirected unweighted multi-graph with global edge connectivity λ0\lambda_{0}. Then, GG contains at least λ0/2\lambda_{0}/2 edge-disjoint spanning trees.

Now we apply this theorem to our graph G(U)G(U), to pack in it (at least) λ(U)/2\lambda(U)/2 edge-disjoint spanning trees, and then replace each edge in these spanning trees of G(U)G(U) by its corresponding path in GG. These paths are edge-disjoint as well, hence the corresponding subgraphs are edge-disjoint in GG. This yields a set of (at least) λ(U)/2\lambda(U)/2 edge-disjoint UU-spanning subgraphs in GG, which completes the proof of 3.3.

3.2 (2+ϵ)(2+\epsilon)-approximate Steiner-Subgraph Packing

In this section, we provide a (2+ϵ)(2+\epsilon)-approximation algorithm for fractionally packing Steiner subgraphs, proving 3.4. The technique is a standard application of the width-independent multiplicative weight update (MWU) framework [GK07, Fle00, AHK12]. We provide the proofs for completeness, following closely the presentation from [CS21].

We start by describing, in Section 3.2.1, an algorithm based on the multiplicative weight update framework, and we bound its number of iterations, also called “augmentations”. Then, in Section 3.2.2, we show how to implement these augmentations efficiently by using either a static (2+ϵ)(2+\epsilon)-approximation algorithm by Mehlhorn [Meh88], or in unweighted graphs, by using a decremental (2+ϵ)(2+\epsilon)-approximation algorithm from Theorem 4.1.

3.2.1 Algorithm Based on Multiplicative Weight Update

Let the input be an edge-weighted graph G=(V,E,w)G=(V,E,w) with nn vertices, mm edges, and terminal set UVU\subseteq V. Denote by {\cal H} the set of all UU-Steiner subgraphs. The algorithm maintains >0E\ell\in\mathbb{R}_{>0}^{E}, which we refer to as edge lengths.121212Multiplicative weight update algorithms usually maintain “weights” on edges of the input graph. We use here instead the terminology of edge lengths, because GG already has edge weights (that can be viewed as capacities). The total length of a subgraph HH is defined as (H)=eE(H)(e)\ell(H)=\sum_{e\in E(H)}\ell(e). A UU-Steiner subgraph HH is said to have γ\gamma-approximate minimum \ell-length if its length satisfies (H)γminH(H)\ell(H)\leq\gamma\cdot\min_{H^{\prime}\in{\cal H}}\ell(H^{\prime}). Our algorithm below for packing Steiner subgraphs assumes access to a procedure that computes a γ\gamma-approximate minimum \ell-length Steiner subgraph.

input : Undirected edge-weighted graph G=(V,E,w)G=(V,E,w), terminal set UVU\subseteq V, and accuracy parameter 0<ϵ<10<\epsilon<1
output : Feasible UU-Steiner subgraph packing 𝒫{\cal P}
1 let 𝒫{\cal P}\leftarrow\emptyset and δ(2m)1/ϵ\delta\leftarrow(2m)^{-1/\epsilon}
2 let (e)δ/w(e)\ell(e)\leftarrow\delta/w(e) for all eEe\in E
3 while eEw(e)(e)<1\sum_{e\in E}w(e)\ell(e)<1 do
4       let HH\leftarrow a γ\gamma-approximate minimum \ell-length UU-Steiner subgraph
5       let vmin{w(e):eE(H)}v\leftarrow\min\{w(e):\ e\in E(H)\}
6       add HH with val(H)v\mathrm{val}(H)\leftarrow v into the packing 𝒫{\cal P}
7       let (e)(e)(1+ϵvw(e))\ell(e)\leftarrow\ell(e)(1+\frac{\epsilon v}{w(e)}) for all eE(H)e\in E(H)
return a scaled-down packing 𝒫{\cal P}, where val(H)val(H)/log1+ϵ(1+ϵδ)\mathrm{val}(H)\leftarrow\mathrm{val}(H)/\log_{1+\epsilon}(\frac{1+\epsilon}{\delta}) for all H𝒫H\in{\cal P}
Algorithm 2 A (γ+O(ϵ))(\gamma+O(\epsilon))-approximation algorithm for Steiner subgraph packing
Lemma 3.8.

The scaled-down packing 𝒫{\cal P} computed by Algorithm 2 is feasible.

Proof.

Given a packing 𝒫{\cal P}, if we define the “flow” (or load) on an edge ee as f(e)=H𝒫,eHval(H)f(e)=\sum_{H\in{\cal P},e\in H}\mathrm{val}(H), then we need to show that f(e)w(e)f(e)\leq w(e) for all eEe\in E. (This terminology highlights the analogy with packing flow paths and thinking of w(e)w(e) as the capacity of ee.) Consider the computation of 𝒫{\cal P} before scaling it down in line 2. Whenever an iteration adds some HH into the packing 𝒫{\cal P} (in line 2), it effectively increases the flow f(e)f(e) additively by v=aw(e)v=a\cdot w(e) for some 0a10\leq a\leq 1, and the corresponding length (e)\ell(e) is increased multiplicatively by 1+aϵ(1+ϵ)a1+a\epsilon\geq(1+\epsilon)^{a} (in line 2). Observe that initially (e)=δ/w(e)\ell(e)=\delta/w(e) and at the end (e)<(1+ϵ)/w(e)\ell(e)<(1+\epsilon)/w(e) (because prior to the last iteration w(e)(e)<1w(e)\ell(e)<1), thus over the course of the execution, (e)\ell(e) grows multiplicatively by at most (1+ϵ)/δ=(1+ϵ)log1+ϵ((1+ϵ)/δ)(1+\epsilon)/\delta=(1+\epsilon)^{\log_{1+\epsilon}((1+\epsilon)/\delta)}, implying that at the end of the execution, f(e)w(e)log1+ϵ(1+ϵδ)f(e)\leq w(e)\cdot\log_{1+\epsilon}(\frac{1+\epsilon}{\delta}). Hence, scaling down 𝒫{\cal P} by factor log1+ϵ(1+ϵδ)\log_{1+\epsilon}(\frac{1+\epsilon}{\delta}) in line 2 makes this packing feasible. ∎

We call each iteration in the while loop of Algorithm 2 an augmentation and say that an edge eEe\in E participates in the augmentation if ee is contained in the Steiner subgraph HH of that iteration (in line 2). The next lemma is used to bound the total running time.

Lemma 3.9.
  1. (a).

    If GG is unweighted, then each edge eEe\in E participates in at most O~(1/ϵ2)\tilde{O}(1/\epsilon^{2}) augmentations.

  2. (b).

    There are at most O~(m/ϵ2)\tilde{O}(m/\epsilon^{2}) augmentations.

Proof.

(a) Fix eEe\in E. In every augmentation, v1v\geq 1 because GG is unweighted. So whenever ee participates in an augmentation, (e)\ell(e) is increased by factor 1+ϵ1+\epsilon. Since (e)=δ/w(e)\ell(e)=\delta/w(e) initially and (e)<(1+ϵ)/w(e)\ell(e)<(1+\epsilon)/w(e) at the end, ee can participate in at most log1+ϵ(1+ϵδ)=O(1ϵlog1δ)=O~(1ϵ2)\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})=O(\frac{1}{\epsilon}\log\frac{1}{\delta})=\tilde{O}(\frac{1}{\epsilon^{2}}) augmentations.

(b) By the choice of vv in each augmentation, at least one edge ee has its length (e)\ell(e) increased by factor 1+ϵ1+\epsilon. For every edge eEe\in E, initially (e)=δ/w(e)\ell(e)=\delta/w(e) and at the end (e)<(1+ϵ)/w(e)\ell(e)<(1+\epsilon)/w(e), and thus the total number of augmentations is bounded by mlog1+ϵ(1+ϵδ)=O~(m/ϵ2)m\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})=\tilde{O}(m/\epsilon^{2}). ∎

Lemma 3.10.

The scaled-down packing 𝒫{\cal P} is a (γ+O(ϵ))(\gamma+O(\epsilon))-approximate UU-Steiner subgraph packing.

Proof.

We first write an LP for the UU-Steiner subgraph packing problem and its dual LP, using our notation (H)=eE(H)(e)\ell(H)=\sum_{e\in E(H)}\ell(e).

(𝑷LP)maxHval(H)s.t.H:eHval(H)w(e)eEval(H)0H\begin{array}[]{crccc}(\boldsymbol{P}_{LP})\\ \max&\sum_{H\in{\cal H}}\mathrm{val}(H)\\ \text{s.t.}&\sum_{H\in{\cal H}:e\in H}\mathrm{val}(H)&\leq&w(e)&\forall e\in E\\ &\mathrm{val}(H)&\geq&0&\forall H\in{\cal H}\end{array} (𝑫LP)mineEw(e)(e)s.t.(H)1H(e)0eE\begin{array}[]{crccc}(\boldsymbol{D}_{LP})\\ \min&\sum_{e\in E}w(e)\ell(e)\\ \text{s.t.}&\ell(H)&\geq&1&\forall H\in{\cal H}\\ &\ell(e)&\geq&0&\forall e\in E\end{array}

Denote D()=eEw(e)(e)D(\ell)=\sum_{e\in E}w(e)\ell(e), and let α()=minH(H)\alpha(\ell)=\min_{H\in{\cal H}}\ell(H) be the length of the minimum \ell-length UU-Steiner subgraph. Let i\ell_{i} be the edge-length function \ell after ii executions of the while loop (and by convention i=0i=0 refers to just before entering the loop). For brevity, denote D(i)=D(i)D(i)=D(\ell_{i}) and α(i)=α(i)\alpha(i)=\alpha(\ell_{i}). We also denote by HiH_{i} the Steiner subgraph found in the ii-th iteration and by viv_{i} the value of Hi𝒫H_{i}\in{\cal P} (before scaling down). Observe that

D(i)\displaystyle D(i) =eEw(e)i1(e)+eE(Hi)w(e)(ϵviw(e)i1(e))\displaystyle=\sum_{e\in E}w(e)\ell_{i-1}(e)+\sum_{e\in E(H_{i})}w(e)\Big{(}\frac{\epsilon v_{i}}{w(e)}\cdot\ell_{i-1}(e)\Big{)}
=D(i1)+ϵvii1(Hi).\displaystyle=D(i-1)+\epsilon v_{i}\cdot\ell_{i-1}(H_{i}).

Since HiH_{i} is a γ\gamma-approximate minimum i1\ell_{i-1}-length UU-Steiner subgraph,

D(i)\displaystyle D(i) D(i1)+ϵviγα(i1).\displaystyle\leq D(i-1)+\epsilon v_{i}\gamma\cdot\alpha(i-1).

Observe that the optimal value of the dual LP 𝑫LP\boldsymbol{D}_{LP} can be written as OPT=minD()/α()\mathrm{OPT}=\min_{\ell}D(\ell)/\alpha(\ell), and thus

D(i)\displaystyle D(i) D(i1)+ϵγviD(i1)/OPT\displaystyle\leq D(i-1)+\epsilon\gamma v_{i}D(i-1)/\mathrm{OPT}
D(i1)eϵγvi/OPT.\displaystyle\leq D(i-1)\cdot e^{\epsilon\gamma v_{i}/\mathrm{OPT}}.

Let tt be the index of the last iteration, then D(t)1D(t)\geq 1. Since D(0)2δmD(0)\leq 2\delta m, we get

1D(t)2δmeϵγi=1tvi/OPT.1\leq D(t)\leq 2\delta m\cdot e^{\epsilon\gamma\sum_{i=1}^{t}v_{i}/\mathrm{OPT}}.

Taking a logarithm from both sides, and denoting val=i=1tvi\mathrm{val}=\sum_{i=1}^{t}v_{i}, we get

valϵγOPTln(1/(2δm)).\frac{\mathrm{val}\cdot\epsilon\gamma}{\mathrm{OPT}}\geq\ln(1/(2\delta m)). (5)

Notice that val\mathrm{val} is exactly the value of 𝒫{\cal P} before scaling down in line 2. By 3.8, the scaled-down packing is a feasible solution for the primal 𝑷LP\boldsymbol{P}_{LP}, and thus by weak duality val/log1+ϵ(1+ϵδ)OPT\mathrm{val}/\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})\leq\mathrm{OPT}. Thus, to prove that it achieves (γ+O(ϵ))(\gamma+O(\epsilon))-approximation, it suffices to show that val/log1+ϵ(1+ϵδ)1O(ϵ)γOPT\mathrm{val}/\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})\geq\frac{1-O(\epsilon)}{\gamma}\cdot\mathrm{OPT}. And indeed, using (5) and the fact that δ=(2m)1/ϵ\delta=(2m)^{-1/\epsilon}, i.e., 2m=(1/δ)ϵ2m=(1/\delta)^{\epsilon}, we have

val/log1+ϵ(1+ϵδ)OPT\displaystyle\frac{\mathrm{val}/\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})}{\mathrm{OPT}} ln(1/(2δm))ϵγ1log1+ϵ(1+ϵδ)\displaystyle\geq\frac{\ln(1/(2\delta m))}{\epsilon\gamma}\cdot\frac{1}{\log_{1+\epsilon}(\frac{1+\epsilon}{\delta})}
=ln(1/δ)ln(2m)ϵγln(1+ϵ)ln(1+ϵδ)\displaystyle=\frac{\ln(1/\delta)-\ln(2m)}{\epsilon\gamma}\cdot\frac{\ln(1+\epsilon)}{\ln(\frac{1+\epsilon}{\delta})}
(1ϵ)ln(1/δ)ϵγln(1+ϵ)ln(1+ϵδ)\displaystyle\geq\frac{(1-\epsilon)\ln(1/\delta)}{\epsilon\gamma}\cdot\frac{\ln(1+\epsilon)}{\ln(\frac{1+\epsilon}{\delta})}
1O(ϵ)γ,\displaystyle\geq\frac{1-O(\epsilon)}{\gamma},

where the last inequality holds because ln(1+ϵ)ϵϵ2/2\ln(1+\epsilon)\geq\epsilon-\epsilon^{2}/2 and ln(1+ϵδ)(1+ϵ)ln(1/δ)\ln(\frac{1+\epsilon}{\delta})\leq(1+\epsilon)\ln(1/\delta). ∎

3.2.2 Efficient Implementation

In this section, we complete the proofs of 3.4 by providing an efficient implementation of Algorithm 2 from Section 3.2.1.

O~(m2/ϵ2)\tilde{O}(m^{2}/\epsilon^{2})-time Algorithms for General Graphs.

In line 2 of Algorithm 2, we invoke the algorithm of Mehlhorn [Meh88] for 22-approximation of the minimum-length Steiner tree (it clearly approximates also the minimum-length Steiner subgraph, because an optimal Steiner subgraph is always a tree). Each invocation runs in time O(m+nlogn)O(m+n\log n), which subsumes the time complexity of other steps in a single iteration of the while loop. There are O~(m/ϵ2)\tilde{O}(m/\epsilon^{2}) iterations by 3.9(a), hence the total running time is O~(m2/ϵ2)\tilde{O}(m^{2}/\epsilon^{2}). The packing 𝒫{\cal P} produced as output is a (2+O(ϵ))(2+O(\epsilon))-approximate solution by 3.10.

m1+o(1)/ϵ2m^{1+o(1)}/\epsilon^{2}-time Algorithms for Unweighted Graphs.

In unweighted graphs, we obtain an almost-linear time by invoking the data structure 𝒟{\cal D} from Theorem 4.1, which is a dynamic algorithm that maintains a graph GG under edge-weight increases and can report a (2+ϵ)(2+\epsilon)-approximate minimum-length Steiner subgraph. Then in line 2 of Algorithm 2, we query 𝒟{\cal D} to obtain a graph HH, and in line 2 we instruct 𝒟{\cal D} to update the edge lengths. The packing 𝒫{\cal P} produced as output is again an (2+O(ϵ))(2+O(\epsilon))-approximate solution by 3.10, and it only remains to analyze the total running time.

A small technical issue is that 𝒟{\cal D} maintains a graph whose edge lengths are integers in the range {1,,W}\{1,\ldots,W\}. Our edge lengths (e)\ell(e) lie in the range [(2m)1/ϵ,(1+ϵ)][(2m)^{-1/\epsilon},(1+\epsilon)], which can be scaled to the range [1ϵ,1ϵ(1+ϵ)(2m)1/ϵ][\frac{1}{\epsilon},\frac{1}{\epsilon}(1+\epsilon)(2m)^{1/\epsilon}]. Each update to 𝒟{\cal D} is further rounded upwards to the next integer, and thus we can use W=1ϵ(1+ϵ)(2m)1/ϵW=\lceil\frac{1}{\epsilon}(1+\epsilon)(2m)^{1/\epsilon}\rceil. The rounding increases edge lengths multiplicatively by at most 1+ϵ1+\epsilon, and thus each reported subgraph achieves (2+O(ϵ))(2+O(\epsilon))-approximation with respect to the unrounded lengths. We can prevent the rounding error from accumulating, by maintaining a table of the exact lengths of each edge (separately from 𝒟\cal D), and using this non-rounded value when computing the edge’s new length in line 2.

The overall running time is dominated by the time spent by updates and queries to the data structure 𝒟{\cal D}. By 3.9(a), each edge participates in at most O~(1/ϵ2)\tilde{O}(1/\epsilon^{2}) augmentations and thus appears in at most O~(1/ϵ2)\tilde{O}(1/\epsilon^{2}) different Steiner subgraphs HH. As each iteration updates only the lengths of edges in its subgraph HH, the total number of edge-length updates, over the entire execution, is at most H𝒫|E(H)|=O~(m/ϵ2)\sum_{H\in{\cal P}}|E(H)|=\tilde{O}(m/\epsilon^{2}). By Theorem 4.1, the total update time of 𝒟{\cal D} is mno(1)logO(1)W+O(H𝒫|E(H)|)=mno(1)/ϵ2mn^{o(1)}\log^{O(1)}W+O(\sum_{H\in{\cal P}}|E(H)|)=mn^{o(1)}/\epsilon^{2}. Lastly, 𝒟{\cal D} returns each Steiner subgraph HH in time |E(H)|no(1)logO(1)W|E(H)|\cdot n^{o(1)}\log^{O(1)}W, and therefore the total time of all queries is H𝒫|E(H)|no(1)logO(1)W=mno(1)/ϵ2\sum_{H\in{\cal P}}|E(H)|\cdot n^{o(1)}\log^{O(1)}W=mn^{o(1)}/\epsilon^{2}. Thus, the overall running time is mno(1)/ϵ2mn^{o(1)}/\epsilon^{2}.

4 Decremental (2+ϵ)(2+\epsilon)-approximate Minimum Steiner Subgraphs

The goal of this section is to establish an algorithm for maintaining a (2+ϵ)(2+\epsilon)-approximate minimum Steiner subgraph with no(1)n^{o(1)} amortized time per weight-increase update, and no(1)n^{o(1)} output-sensitive query time. In this paper, the main application of this algorithm is in proving Theorem 1.9: fractionally packing λ(U)/(4+ϵ)\geq\lambda(U)/(4+\epsilon) UU-Steiner-subgraphs in an unweighted graph with UU-Steiner mincut λ(U)\lambda(U) in almost-linear time. More specifically, this result gets used inside the MWU framework (Lemma 3.4). However, it can also be viewed as a result of independent interest: obtaining an almost-optimal algorithm for a classic problem in the decremental (weight-increase) setting. To be consistent with Section 3.2.1 we refer to the edge-weights as lengths. A key feature of this new algorithm is that it is deterministic, and therefore works in an adaptive-adversary setting (such as MWU).

Theorem 4.1 (Decremental Approximate Minimum Steiner Subgraph).

For any constant ϵ>0\epsilon>0, there is a deterministic data-structure that maintains a graph G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) with terminals UVU\subseteq V under a sequence of updates (edge-length-increase only) in total mno(1)logO(1)L+O(y)m\cdot n^{o(1)}\cdot\log^{O(1)}{L}+O(y) time, and can, at any time, produce a (2+ϵ)(2+\epsilon)-approximate minimum \ell-length UU-Steiner subgraph HH of GG in time mno(1)logO(1)Lm^{\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} where mm^{\prime} is the number of edges in the subgraph it outputs.

At a high-level, there are two distinct steps for establishing this result:

  1. 1.

    A reduction to decremental Single-Source Shortest Paths (SSSP). It is well-known that a 22-approximation for Steiner Tree can be obtained by computing the Minimum Spanning Tree (MST) of a helper graph HH. This helper graph is simply the complete distance graph of the terminals, and (naively) requires Ω(mn)\Omega(mn) time to compute. The MST of HH then gets expanded into a Steiner subgraph of GG. Mehlhorn’s algorithm achieves a 22-approximation in O~(m)\tilde{O}(m) time by further reducing the problem to an SSSP computation, by seeking the MST of a slightly different helper graph HH. At a high-level, our plan is to design a dynamic version of Mehlhorn’s algorithm.

  2. 2.

    An almost-optimal decremental algorithm for (1+ϵ)(1+\epsilon)-SSSP. The challenge with the above reduction is in the difficult task of maintaining the SSSP information that is required to construct the helper graph HH while the input graph GG is changing. Roughly speaking, we succeed in doing that, while paying an additional (1+ϵ)(1+\epsilon) factor, due to a recent decremental (1+ϵ)(1+\epsilon)-SSSP deterministic algorithm by Bernstein, Gutenberg, and Saranurak [BGS22] with no(1)logO(1)Ln^{o(1)}\cdot\log^{O(1)}{L} time per update.

Thus, the plan is as follows. Let G(i)G^{(i)} be the graph GG after the ithi^{th} update. Using a decremental (1+ϵ)(1+\epsilon)-SSSP algorithm we maintain a helper graph H(i)H^{(i)}. Then, using a fully-dynamic MST algorithm we maintain the MST of H(i)H^{(i)}. Whenever there is a query, we output a Steiner subgraph S(i)S^{(i)} of G(i)G^{(i)} by querying for the MST of H(i)H^{(i)} and expanding it into S(i)S^{(i)}. Notably, whereas G(i)G^{(i)} is obtained from G(i1)G^{(i-1)} in a decremental fashion, i.e. only via increasing edge-lengths, the updates to the helper graph can be both decremental and incremental. As a result, we need to maintain the MST in a fully-dynamic setting, which can be done in polylog(n)\mathrm{polylog}(n) update time with a deterministic algorithm [HdLT01]. This is schematically described in Figure 3.

Refer to caption
Figure 3: A diagram representing how an approximate minimum Steiner subrgaph is produced by our algorithm (inside an iteration of the MWU framework for packing Steiner subgraphs).

Realizing this plan, however, involves several lower-level challenges. First of all, the construction of the helper graph from Mehlhorn’s algorithm needs to be modified in order to prevent the number of changes to HH from being much larger than the number of changes to GG. (Otherwise, each edge update in GG could result in Ω(n)\Omega(n) edge changes in HH.) This is presented in Section 4.2. Second, the new construction of a helper graph has slightly different properties than Mehlhorn’s which we state and analyze next in Section 4.1. And finally, the reduction requires additional features from the (1+ϵ)(1+\epsilon)-SSSP data-structure that were not explicitly stated in previous work. We explain how they can be achieved (with minor modifications) in the discussion below Lemma 4.10.

4.1 The Helper Graph

We begin by describing what properties the helper graph HH should have, and by proving that they suffice for the MST of HH to yield a (2+ϵ)(2+\epsilon)-approximate UU-Steiner tree for GG. The algorithm for dynamically maintaining a helper graph with these properties is discussed later on. Note that we will have a helper graph H(i)H^{(i)} of G(i)G^{(i)} in each step ii, but the properties we describe in this section are indifferent to the step and to the fact that we are in a dynamic environment; therefore we will drop the (i)(i) superscript in this subsection.

The starting point of both our helper graph and Mehlhorn’s original construction is the well-known fact that an MST of the complete distance graph of the terminals is a 22-approximation to the Steiner tree.

Lemma 4.2 ([HR92, TM80, KMB81, Ple81]).

Let G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) be a graph with terminals UVU\subseteq V, and let H=(U,EH,H:EH[2nL])H^{*}=(U,E_{H},{\ell}_{H}:E_{H}\to[2nL]) be the distance graph of the terminals, i.e. t1,t2U:H(t1,t2)=dG(t1,t2)\forall t_{1},t_{2}\in U:\ {\ell}_{H^{*}}(t_{1},t_{2})=d_{G}(t_{1},t_{2}). Then, the MST of HH has length at most 22 times the minimum UU-Steiner tree of GG.

The issue with this helper graph HH^{*} is in the complexity of computing (and maintaining) it. Mehlhorn’s fast algorithm is based on the observation that a different helper graph, that can be viewed as a proxy towards HH^{*}, suffices to get a 22-approximation. The exact property of a helper graph that Mehlhorn’s algorithm is based on is stated in the next lemma. (The analysis of our helper graph will not use this Lemma; we only include it for context.)

Lemma 4.3 ([Meh88]).

Let G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) be a graph with terminals UVU\subseteq V, and let H=(U,EH,H:EH[2nL])H=(U,E_{H},{\ell}_{H}:E_{H}\to[2nL]) be a weighted graph such that for each edge (x,y)E(x,y)\in E there exists an edge (tx,ty)EH(t_{x},t_{y})\in E_{H}, where txt_{x} and tyt_{y} are the closest terminals to xx and yy (respectively), of length dG(tx,x)+G(x,y)+dG(y,ty)d_{G}(t_{x},x)+{\ell}_{G}(x,y)+d_{G}(y,t_{y}). Then, the MST of HH has length at most 22 times the minimum UU-Steiner tree of GG.

Notice that a pair of vertices in HH may have many parallel edges between them with different lengths. (See Figure 4 for an illustration.)

Refer to caption
Figure 4: An illustration of the different kinds of helper graphs discussed in this paper. Dashed lines represent edges in GG, and curves represent paths in GG.

As an intermediate step towards defining the properties of our actual helper graph, we consider the following approximate version of Mehlhorn’s definition. We say that txt_{x} is a (1+ϵ)(1+\epsilon)-closest terminal to xx iff dG(x,tx)(1+ϵ)dG(x,t)d_{G}(x,t_{x})\leq(1+\epsilon)\cdot d_{G}(x,t) for all tUt\in U.

Lemma 4.4.

Let G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) be a graph with terminals UVU\subseteq V, and let H=(U,EH,H:EH[2nL])H=(U,E_{H},{\ell}_{H}:E_{H}\to[2nL]) be a graph such that: (1) for each vertex xVx\in V there is a unique terminal txUt_{x}\in U assigned to xx, where txt_{x} is a (1+ϵ)(1+\epsilon)-closest terminal to xx, and (2) for each edge (x,y)E(x,y)\in E there exists an edge (tx,ty)EH(t_{x},t_{y})\in E_{H} of length (1+ϵ)(dG(tx,x)+G(x,y)+dG(y,ty))\leq(1+\epsilon)\cdot(d_{G}(t_{x},x)+{\ell}_{G}(x,y)+d_{G}(y,t_{y})). Then, the MST of HH has length at most 2(1+ϵ)22(1+\epsilon)^{2} times the minimum UU-Steiner tree of GG.

Proof.

Let TT^{*} be an MST of the ideal helper graph HH^{*} (the complete distance graph of the terminals). We will prove that there exists an MST TT of our helper graph HH with length H(T)(1+ϵ)2H(T){\ell}_{H}(T)\leq(1+\epsilon)^{2}\cdot{\ell}_{H^{*}}(T^{*}). Then by Lemma 4.2 we get that the MST of HH has length at most 2(1+ϵ)22(1+\epsilon)^{2} times the minimum UU-Steiner tree of GG.

We describe a process that modifies TT^{*} by replacing its edges with edges from HH while keeping it a terminal spanning tree and while only increasing its length by (1+ϵ)2(1+\epsilon)^{2} (see Figure 5).

Refer to caption
Figure 5: An illustration representing the process of replacing edges from TT^{*} by edges from HH. Here, eTe\in T^{*} is replaced with eHe^{\prime}\in H. Gray curves represent paths, the red curve represents the shortest t1t2t_{1}t_{2}-path in GG, and blue arrows represent the length charging.

Specifically, each edge eTe\in T^{*} gets replaced by an edge eHe^{\prime}\in H of length H(e)(1+ϵ)2H(e){\ell}_{H}(e^{\prime})\leq(1+\epsilon)^{2}\cdot{\ell}_{H^{*}}(e). We will do this replacement as long as there is an edge in TT^{*} that is not in HH, or is in HH but has a different length than it does in HH^{*}.

Let e=(t1,t2)Te=(t_{1},t_{2})\in T^{*} be such an edge, and let v1,,vpv_{1},\ldots,v_{p} be a shortest path from t1t_{1} to t2t_{2} in GG with total length dG(t1,t2)=H(t1,t2)d_{G}(t_{1},t_{2})={\ell}_{H^{*}}(t_{1},t_{2}). The removal of ee from TT^{*} disconnects the tree into two components, call them t1T1t_{1}\in T_{1} and t2T2t_{2}\in T_{2}. Let i[p]i\in[p] be such that tviT1t_{v_{i}}\in T_{1} but tvi+1T2t_{v_{i+1}}\in T_{2}. Such an ii must exist because tv1=t1T1t_{v_{1}}=t_{1}\in T_{1} and tvp=t2T2t_{v_{p}}=t_{2}\in T_{2}.

Consider the edge e=(tvi,tvi+1)He^{\prime}=(t_{v_{i}},t_{v_{i+1}})\in H that follows from the edge (vi,vi+1)(v_{i},v_{i+1}) by the assumptions on the helper graph HH. Replacing ee with ee^{\prime} keeps TT^{*} a terminal spanning tree. It only remains to bound the difference in lengths:

H(e)(1+ϵ)(dG(tvi,vi)+G(vi,vi+1)+dG(vi+1,tvi+1)).{\ell}_{H}(e^{\prime})\leq(1+\epsilon)\cdot(d_{G}(t_{v_{i}},v_{i})+{\ell}_{G}(v_{i},v_{i+1})+d_{G}(v_{i+1},t_{v_{i+1}})).

Since tvit_{v_{i}} is a (1+ϵ)(1+\epsilon)-closest terminal to viv_{i} we know that dG(tvi,vi)(1+ϵ)dG(t1,vi)d_{G}(t_{v_{i}},v_{i})\leq(1+\epsilon)\cdot d_{G}(t_{1},v_{i}) and similarly dG(vi+1,tvi+1)(1+ϵ)dG(vi+1,t2)d_{G}(v_{i+1},t_{v_{i+1}})\leq(1+\epsilon)\cdot d_{G}(v_{i+1},t_{2}). Therefore,

H(e)(1+ϵ)2(dG(t1,vi)+G(vi,vi+1)+dG(vi+1,t2)){\ell}_{H}(e^{\prime})\leq(1+\epsilon)^{2}\cdot(d_{G}(t_{1},v_{i})+{\ell}_{G}(v_{i},v_{i+1})+d_{G}(v_{i+1},t_{2}))
=(1+ϵ)2dG(t1,t2)=(1+ϵ)2H(e).=(1+\epsilon)^{2}\cdot d_{G}(t_{1},t_{2})=(1+\epsilon)^{2}\cdot{\ell}_{H^{*}}(e).

Our actual helper graph, described next, differs from Mehlhorn’s not only in the fact that it is approximate, but more importantly, it is a graph on the entire vertex set VV rather than just the terminals. This is done for efficiency; the (admittedly vague) intuition is as follows. Updating each edge of HH after each update to GG is too costly because the closest (or even the (1+ϵ)(1+\epsilon)-closest) terminal to a vertex might change very frequently. But one can observe that most of these frequent changes are not important for the MST; there is usually a parallel edge that was not affected and whose length is within (1+ϵ)(1+\epsilon) of the new edges that we would want to add. Figuring out which changes in HH are important and which are not does not seem tractable. Instead, our new idea is to make the update only in a helper graph that is, on the one hand, much closer to GG than to Mehlhorn’s helper graph (and therefore doesn’t change too frequently), and on the other hand, has the same MST up to (1+ϵ)(1+\epsilon) as Mehlhorn’s. In other words, the idea is to let the MST algorithm do the work of figuring out which edges are relevant.

The properties that our actual helper graph will satisfy are described in the following lemma. In words, each terminal tt has a disjoint component CtC_{t} in HH of vertices that can be reached from tt with distance 0 (due to edges of length zero in HH). The components morally represent the approximate Voronoi cells of the terminals. And instead of demanding that each edge (x,y)(x,y) of the original graph be represented by an edge (tx,ty)(t_{x},t_{y}) between the two corresponding terminals in the helper graph, we only demand that there be some edge (x,y)(x^{\prime},y^{\prime}) between the two corresponding components (where x,yx^{\prime},y^{\prime} need not be terminals).

Lemma 4.5.

Let G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) be a graph with terminals UVU\subseteq V, and let H=(VH,EH,H:EH[2nL]{0})H=(V_{H},E_{H},\ell_{H}:E_{H}\to[2nL]\cup\{0\}) be a weighted graph satisfying the following properties:

  • for each vertex xVHx\in V_{H} there is a unique terminal txUt_{x}\in U such that dH(x,tx)=0d_{H}(x,t_{x})=0,

  • for each edge (x,y)E(x,y)\in E there exists an edge (x,y)EH(x^{\prime},y^{\prime})\in E_{H} with dH(x,tx)=0d_{H}(x^{\prime},t_{x})=0 and dH(y,ty)=0d_{H}(y^{\prime},t_{y})=0, where txt_{x} and tyt_{y} are (1+ϵ)(1+\epsilon)-closest terminals to xx and yy in GG (respectively), of length H(x,y)(1+ϵ)(dG(tx,x)+G(x,y)+dG(y,ty))\ell_{H}(x^{\prime},y^{\prime})\leq(1+\epsilon)\cdot(d_{G}(t_{x},x)+\ell_{G}(x,y)+d_{G}(y,t_{y})).

Then, the MST of HH has length at most 2(1+ϵ)22(1+\epsilon)^{2} times the minimum UU-Steiner tree of GG.

Proof.

For each terminal tUt\in U let Ct={xVH:dH(t,x)=0}C_{t}=\{x\in V_{H}:d_{H}(t,x)=0\} be the component of vertices at distance zero to tt. By the assumption on HH, the sets {Ct}tU\{C_{t}\}_{t\in U} form a partition of VHV_{H}. Let H¯\bar{H} be the graph obtained from HH by contracting each CtC_{t} into a single vertex. It immediately follows that H¯\bar{H} is a helper graph that satisfies requirements of Lemma 4.4 above, and therefore the MST of H¯\bar{H} has length at most 2(1+ϵ)22(1+\epsilon)^{2} times the minimum UU-Steiner tree of GG. But any MST of H¯\bar{H} can be expanded into an MST of HH with the same length, by taking a zero-length spanning tree for each component CtC_{t}; the shortest path tree rooted at tt is such a tree. ∎

4.2 Maintaining the Helper Graph Dynamically: A Reduction to SSSP

The main technical result towards proving Theorem 4.1 is an algorithm for maintaining a helper graph with the properties required by Lemma 4.5.

Lemma 4.6.

Given a graph G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) with terminal set UVU\subseteq V and a sequence of length-increase updates, it is possible to maintain a helper graph H=(VH,EH,H:EH[2nL]{0})H=(V_{H},E_{H},\ell_{H}:E_{H}\to[2nL]\cup\{0\}) satisfying the properties in Lemma 4.5 with a deterministic algorithm such that:

  • The total time is mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}, and

  • The recourse, i.e. number of edge-length changes to HH throughout the sequence, is mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}.

  • Given an MST of HH of total length mst(H)mst(H) it is possible to produce a UU-Steiner subgraph of GG of total length (1+ϵ)mst(H)\leq(1+\epsilon)\cdot mst(H), in time mno(1)logO(1)Lm^{\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} where mm^{\prime} is the number of edges in the subgraph.

This lemma is proved in the next sections. But first, let us explain how Theorem 4.1 follows from it.

Proof of Theorem 4.1.

Let GG be the input graph that is undergoing a sequence of length-increase updates; let G(i)G^{(i)} be the graph after the ithi^{th} update. We use the algorithm in Lemma 4.6 to maintain a helper graph HH as GG changes; let H(i)H^{(i)} be the helper graph after the ithi^{th} update. We use the fully-dynamic MST algorithm by Holm et al. [HdLT01], with HH as the input, to (explicitly) maintain an MST of HH as GG changes. If after the ithi^{th} update, there is a query asking for a UU-Steiner subgraph for G(i)G^{(i)}, we first inspect the MST data-structure to obtain an MST T(i)T^{(i)} of H(i)H^{(i)}. We use the algorithm in Lemma 4.6 again to expand the MST T(i)T^{(i)} into a UU-Steiner subgraph S(i)S^{(i)} of G(i)G^{(i)}. If the total length of the MST is xx then the total length of the Steiner subgraph is (1+ϵ)x\leq(1+\epsilon)\cdot x, and therefore, since the helper graph satisfies the properties of Lemma 4.5, we get that S(i)S^{(i)} is a 2(1+ϵ)32(1+\epsilon)^{3}-minimum UU-Steiner subgraph for G(i)G^{(i)}.

The running time for maintaining the helper graph HH is mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}. To bound the running time of the MST algorithm we first need to bound the number of updates we make to HH (not GG) because HH is the input graph to the MST algorithm. This number of updates is exactly the recourse and it is bounded by mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}. The MST algorithm [HdLT01] has polylog(n)\mathrm{polylog}(n) amortized update time (and is deterministic) and therefore it can support this number of updates in a total of mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L} time as well. Finally, the time to produce the UU-Steiner subgraph is mno(1)logO(1)Lm^{\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} where mm^{\prime} is the number of edges in the subgraph, as required by Theorem 4.1. ∎

4.2.1 The Basic Construction

In order to understand our final construction of the helper graph HH, it is helpful to first see a simplified version that works assuming an SSSP data-structure with (slightly) stronger properties than currently achievable.

Let us first briefly overview how a decremental SSSP data-structure works, to clarify the context of some of the notation below. Naturally, the idea is to maintain a shortest-path tree rooted at the source ss. For efficiency, it is desirable that the tree’s depth be small. For this reason, the data-structures (e.g. [HKN14, BGS22]) typically use a hopset: by adding a set EhopsetE_{hopset} of mno(1)m\cdot n^{o(1)} edges to the graph, it is guaranteed that there exist a path from ss to any vv that is (1+ϵ)(1+\epsilon)-shortest-path and that only uses no(1)n^{o(1)} edges; namely, it has only no(1)n^{o(1)} hops. A hopset-edge eEhopsete\in E_{hopset} typically has a length that corresponds to the shortest path distance between its endpoints, and therefore the distance in the new graph is never shorter than the original distance. The data-structure then maintains an approximate shortest-path tree ThopsetT_{hopset} on the graph with the hopset, of depth no(1)n^{o(1)}, which can be done efficiently. The distances that it reports are exactly the distances in this tree.

Proposition 4.7.

Suppose that there is a deterministic data-structure that given a graph G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) and a single-source sVs\in V, that undergoes a sequence of edge-length-increase updates, and supports the following operations in mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L} total time:

  • Explicitly maintains an estimate d~(s,v)\tilde{d}(s,v) for each vVv\in V, such that d(s,v)d~(s,v)(1+ϵ)d(s,v)d(s,v)\leq\tilde{d}(s,v)\leq(1+\epsilon)\cdot d(s,v). In particular, can report after each update, all vertices vVv\in V such that d~(s,v)\tilde{d}(s,v) increased by a (1+ϵ)\geq(1+\epsilon) factor (since the last time vv was reported).

  • Explicitly maintains a tree ThopsetT_{hopset} rooted at ss, such that d~(s,v)=dThopset(s,v)\tilde{d}(s,v)=d_{T_{hopset}}(s,v) for all vVv\in V. An edge of the tree is either from EE or from a set of hopset-edges EhopsetV×VE_{hopset}\subseteq V\times V. In particular, can report after each update, all edges that are added or removed from ThopsetT_{hopset}.

Moreover, it holds that each hopset-edge e=(u,v)Ehopsete=(u,v)\in E_{hopset} of length ww is associated with a u,vu,v-path πe\pi_{e} in GG of length ww. And that the number of times an edge eEe\in E may appear on a single root-to-leaf path in ThopsetT_{hopset}, either as an edge eEe\in E or as an edge eπee\in\pi_{e^{\prime}} on the path of a hopset-edge eEhopsete^{\prime}\in E_{hopset}, is no(1)n^{o(1)}. Additionally, the data-structure supports the following query:

  • Given a hopset-edge ee and an integer k1k\geq 1, can return the first (or last) kk edges of πe\pi_{e} in time kno(1)logO(1)Lk\cdot n^{o(1)}\cdot\log^{O(1)}{L}.

Then Lemma 4.6 holds.

The main difference between the requirements of Proposition 4.7 and the features of the existing (1+ϵ)(1+\epsilon)-SSSP algorithm is simply that the data-structure explicitly maintains O(logn)O(\log{n}) trees instead of one, and the ithi^{th} tree is only guaranteed to approximate to within (1+ϵ)(1+\epsilon) the distances d(s,v)d(s,v) when they are in the range [γi1,γi][\gamma^{i-1},\gamma^{i}] (for some γ2\gamma\geq 2). Another minor gap is that the hopsets use auxiliary vertices, in addition to the shortcut edges. These gaps will be handled in the next subsection. For now, let us see how to obtain Proposition 4.7.

Proof of Proposition 4.7.

We start off with a trick similar to the way Mehlhorn’s algorithm reduces the problem of computing the closest terminal to each vertex (i.e. the Voronoi cell of each terminal) to an SSSP problem. Let GG^{\prime} be the graph obtained from G=(V,EG,G:EG[L])G=(V,E_{G},\ell_{G}:E_{G}\to[L]) by adding a super-source ss^{*} that is connected with edges of length 0 to all terminals UVU\subseteq V (see Figure 6).

Refer to caption
Figure 6: An illustration representing HH in the basic construction. Here, dG(s,v)=mintUdG(t,v)=dG(t2,v)d_{G^{\prime}}(s^{*},v)=\min_{t\in U}d_{G}(t,v)=d_{G}(t_{2},v). Furthermore, the green edge (x,y)H(x,y)\in H has length that is the sum of the gray curves.

Consequently, for any vertex vVv\in V, dG(s,v)=mintUdG(t,v)d_{G^{\prime}}(s^{*},v)=\min_{t\in U}d_{G}(t,v), and moreover vv belongs to the subtree rooted at argmintUdG(t,v)\arg\min_{t\in U}d_{G}(t,v) in the SSSP-tree rooted at ss^{*}. Note that this can be achieved without really using edges of length 0 by simply contracting all terminals into one vertex and calling it ss^{*}.131313The description below assumes we do add the zero-length edges. In the full construction in the next subsection we do in fact need to use the contractions, and so the arguments differ in minor ways. We will run the (1+ϵ)(1+\epsilon)-SSSP data-structure in the statement on GG^{\prime} with ss^{*} as the source. Note that it is trivial to transform the length-increase sequence of updates to GG into a sequence of length-increase updates on GG^{\prime}. Let ThopsetT_{hopset} and d~(s,v)\tilde{d}(s^{*},v) be the tree and estimates maintained by the data-structure.

Maintaining a helper graph

The helper graph H=(V,EH,H:EH[2nL]{0})H=(V,E_{H},\ell_{H}:E_{H}\to[2nL]\cup\{0\}) is defined based on GG, ThopsetT_{hopset} and d~(s,v)\tilde{d}(s^{*},v) as follows. Note that the vertex set of HH is the same as GG’s; in our full construction (in the next subsection) there will be additional vertices. There are two kinds of edges in HH:

  • Green edges: for each edge (x,y)EG(x,y)\in E_{G} we add an edge (x,y)(x,y) to EHE_{H} with length

    H(x,y):=d~(s,x)+G(x,y)+d~(s,y).\ell_{H}(x,y):=\tilde{d}(s^{*},x)+\ell_{G}(x,y)+\tilde{d}(s^{*},y).

    A green edge gets updated whenever: (1) the length G(x,y)\ell_{G}(x,y) gets updated and is more than (1+ϵ)(1+\epsilon) times the value used in the current H(x,y)\ell_{H}(x,y), or (2) the data-structure reports that d~(s,x)\tilde{d}(s^{*},x) or d~(s,y)\tilde{d}(s^{*},y) is increased by a (1+ϵ)\geq(1+\epsilon) factor.

  • Red edges: for each edge (x,y)E(Thopset)(x,y)\in E(T_{hopset}) we add an edge (x,y)(x,y) of length 0 to EHE_{H}.141414The zero-length edges between ss^{*} and each terminal in TT are exempted, since ss^{*} does not exist in HH. A red edge gets updated whenever the tree ThopsetT_{hopset} changes. If an edge is removed from the tree, the red edge is removed (i.e. the length is increased from 0 to infinity),151515Notably, these are the only incremental updates that we do. and if a new edge is added to the tree we add an edge of length zero to HH.

The recourse of the helper graph

The data-structure will not only maintain the helper graph HH described above, but it will also feed it into a dynamic MST algorithm and explicitly maintain an MST of HH. For this to be efficient, we must argue that the total number of updates we make to HH is small. The running time of the data-structure is upper bounded by mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}, and since it stores the tree ThopsetT_{hopset} explicitly, this is also an upper bound on the total number of changes to ThopsetT_{hopset}. Whenever a red edge is updated it is because the corresponding edge was updated in ThopsetT_{hopset}; this can happen mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L} times. A green edge (x,y)(x,y) is updated either when the corresponding edge in GG has its length increase by at least a (1+ϵ)(1+\epsilon) factor, or when d~(s,x)\tilde{d}(s^{*},x) or d~(s,y)\tilde{d}(s^{*},y) increase by (1+ϵ)\geq(1+\epsilon). Since the lengths and estimates are upper bounded by nLnL, they can only increase by a (1+ϵ)(1+\epsilon) factor O(lognL)O(\log{nL}) times. Each time an estimate d~(s,x)\tilde{d}(s^{*},x) increases we would update degG(x)\deg_{G}(x) edges in HH. Thus, the total number of updates to the green edges is O(mlogn)+xVdegG(x)O(lognL)=O(mlognL)O(m\log{n})+\sum_{x\in V}\deg_{G}(x)\cdot O(\log{nL})=O(m\log{nL}). It follows that the running time and total number of updates to HH is mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L}.

The properties of the helper graph

Next, let us prove that HH satisfies the two properties in Lemma 4.5. For that, it is helpful to establish the following claims.

Claim 4.8.

In the tree ThopsetT_{hopset} the root ss^{*} has all of the terminals in UU as children.

Proof.

Suppose for contradiction that t1Ut_{1}\in U is in the subtree of terminal t2Ut_{2}\in U. Then it must follow that d~(s,t1)=dThopset(s,t1)=0+dThopset(t2,t1)>0\tilde{d}(s^{*},t_{1})=d_{T_{hopset}}(s^{*},t_{1})=0+d_{T_{hopset}}(t_{2},t_{1})>0 because all edges that are not adjacent to ss^{*} in GG^{\prime} have non-zero length. On the other hand, dG(s,t1)=0d_{G^{\prime}}(s^{*},t_{1})=0, contradicting the fact that d~(s,t1)(1+ϵ)dG(s,t1)\tilde{d}(s^{*},t_{1})\leq(1+\epsilon)\cdot d_{G^{\prime}}(s^{*},t_{1}). ∎

The first of the two properties in Lemma 4.5 now follows. In the tree ThopsetT_{hopset}, each vertex xVUx\in V\setminus U appears in the subtree of exactly one terminal txUt_{x}\in U and, due to the red edges, has distance dH(x,tx)=0d_{H}(x,t_{x})=0. For all other terminals ttxUt^{\prime}\neq t_{x}\in U the path from tt^{\prime} to xx must use a green edge of length >0>0.

Claim 4.9.

For all xVx\in V, d~(s,x)(1+ϵ)mintUdG(t,x)\tilde{d}(s^{*},x)\leq(1+\epsilon)\cdot\min_{t\in U}d_{G}(t,x). Moreover, if xx is in the subtree of terminal txUt_{x}\in U then txt_{x} is a (1+ϵ)(1+\epsilon)-closest terminal to xx.

Proof.

The first part follows from the fact that dG(s,x)=mintUdG(t,x)d_{G^{\prime}}(s^{*},x)=\min_{t\in U}d_{G}(t,x), and the guarantee on the estimates. For the second part note that dG(tx,x)dThopset(tx,x)=d~(s,x)(1+ϵ)mintUdG(t,x)d_{G}(t_{x},x)\leq d_{T_{hopset}}(t_{x},x)=\tilde{d}(s^{*},x)\leq(1+\epsilon)\cdot\min_{t\in U}d_{G}(t,x); thus, txt_{x} is a (1+ϵ)(1+\epsilon)-closest terminal to xx. ∎

To prove the second property, let (x,y)E(x,y)\in E be an edge in GG; we will show that the green edge (x,y)EH(x,y)\in E_{H} satisfies the requirement.161616That is, we prove the property with x=xx=x^{\prime} and y=yy=y^{\prime}. This will not be the case in the full construction in the next subsection. Let txt_{x} and tyt_{y} be such that dH(x,tx)=0d_{H}(x,t_{x})=0 and dH(y,ty)=0d_{H}(y,t_{y})=0. By the above claim, we know that txt_{x} and tyt_{y} are (1+ϵ)(1+\epsilon)-closest terminals to xx and yy (respectively) in GG. Finally, we can upper bound the length of the green edge (x,y)(x,y) in HH by

H(x,y)=d~(s,x)+G(x,y)+d~(s,y)=d~(tx,x)+G(x,y)+d~(ty,y)\ell_{H}(x,y)=\tilde{d}(s^{*},x)+\ell_{G}(x,y)+\tilde{d}(s^{*},y)=\tilde{d}(t_{x},x)+\ell_{G}(x,y)+\tilde{d}(t_{y},y)
(1+ϵ)(dG(tx,x)+G(x,y)+dG(y,ty)).\leq(1+\epsilon)\cdot(d_{G}(t_{x},x)+\ell_{G}(x,y)+d_{G}(y,t_{y})).
Expanding an MST of HH into a UU-Steiner subgraph of GG

By the above we know that the length of an MST of HH is a (2+ϵ)(2+\epsilon)-approximation to the minimum length of a Steiner subgraph of GG. So if our goal was only to maintain an approximation to the length of a Steiner-Tree, we would just use the length of a given MST of HH and be done. Alas, for our applications the data-structure must return the subgraph itself, which is more complicated. The process of (efficiently) expanding an MST into a Steiner subgraph is as follows.

For a terminal tUt\in U we define tt’s component (or subtree or Voronoi cell) to be the set of vertices {xV:dH(t,x)=0}\{x\in V:d_{H}(t,x)=0\} that are connected by red edges to tt. Pick an arbitrary terminal t1Ut_{1}\in U as a starting point. We will construct a Steiner Subgraph SS^{\prime} by starting from S={t1}S^{\prime}=\{t_{1}\} and iteratively adding paths (in GG) to it. Let UUU^{\prime}\subseteq U be the set of terminals that are spanned by SS^{\prime}; initially U={t1}U^{\prime}=\{t_{1}\}. In each step, we pick an arbitrary green edge of the MST that has an endpoint in one of the components of the terminals in UU^{\prime}. Let e=(x,y)e=(x,y) be such an edge, and let tx,tyt_{x},t_{y} be the two terminals such that x,yx,y are in their components (respectively). First, note that such an edge must exist as long as UUU^{\prime}\neq U (or else the MST does not span the entire graph). Second, note that txUt_{x}\in U^{\prime} but tyUt_{y}\notin U^{\prime} (otherwise there would be a cycle in the MST). We would like to add to SS^{\prime}: (1) a path from txt_{x} to xx, (2) the edge (x,y)(x,y), and (3) a path from yy to tyt_{y}. This would connect tyt_{y} to txt_{x} and therefore add tyt_{y} to UU^{\prime}. And we would like to have that the total length of (1) + (2) + (3) is at most H(x,y)\ell_{H}(x,y). Ignoring certain subtle details, this can be done by observing that H(x,y)=dThopset(tx,x)+G(x,y)+dThopset(ty,y)\ell_{H}(x,y)=d_{T_{hopset}}(t_{x},x)+\ell_{G}(x,y)+d_{T_{hopset}}(t_{y},y) and the distances in ThopsetT_{hopset} come from paths in GG. Namely, we can scan the path from txt_{x} to xx in ThopsetT_{hopset} and, whenever we encounter an edge from EE we simply add it to SS^{\prime}, while if we encounter an edge eEhopsete\in E_{hopset} we ask the data-structure to expand it into the path πe\pi_{e} and add πe\pi_{e} to SS^{\prime}. If we do this, the total length of the final Steiner Subgraph SS^{\prime} will be exactly mst(H)mst(H).

The subtle issue with the above is that the total running time for outputting a Steiner Subgraph with mm^{\prime} edges may not be mno(1)logO(1)Lm^{\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} even though every time the data-structure reports an edge it only costs no(1)logO(1)Ln^{o(1)}\cdot\log^{O(1)}{L} time. Indeed, if m′′m^{\prime\prime} edges are reported throughout the above process, we only spend m′′no(1)logO(1)Lm^{\prime\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} time, but due to edges being repeated many times, the number of edges that we finally output mm^{\prime} could be much smaller than m′′m^{\prime\prime}.171717While the total length from the repetitions is still within our budget of mst(H)mst(H), the MWU framework does not allow us to spend more than no(1)logO(1)Ln^{o(1)}\cdot\log^{O(1)}{L} time on an edge we output, even if it is being repeated many times in the output. To resolve this issue we use a more careful process that uses the ability of the data-structure to list only the first or last kk edges on a path πe\pi_{e} at cost only kno(1)logO(1)Lk\cdot n^{o(1)}\cdot\log^{O(1)}{L}; it turns out that if we see an edge that we have already seen, we can stop expanding πe\pi_{e}.

In more details, the step for expanding a green edge (x,y)(x,y) is as follows. We start from tyt_{y} (rather than txt_{x}) and scan the tree down to yy. When we see an edge eEe\in E we check if it is already in SS^{\prime}:

  • If it is not in SS^{\prime} we add it to a set S(x,y)S_{(x,y)} of edges that will be added to SS^{\prime} at the end of the step.

  • If ee happens to already be in SS^{\prime}, then we stop, add all edges in S(x,y)S_{(x,y)} to SS^{\prime}, and finish the step of edge (x,y)(x,y). This makes sense because the edges in S(x,y)S_{(x,y)} form a path from tyt_{y} to eSe\in S^{\prime} and all of SS^{\prime} is connected to txUt_{x}\in U^{\prime}, so we have accomplished the goal of connecting tyt_{y} to txt_{x} (at a potentially cheaper length than H(x,y)\ell_{H}(x,y)).

And when we see an edge eEhopsete\in E_{hopset} we do the following for each k=2i,i=1,,log|πe|k=2^{i},i=1,\ldots,\log{|\pi_{e}|}: ask the data-structure to report the first (closest to tyt_{y}) kk edges of πe\pi_{e}, call them e1,,ekEe_{1},\ldots,e_{k}\in E, and check if they are already in SS^{\prime}:

  • If none of them are in SS^{\prime} we add them to the set S(x,y)S_{(x,y)} of edges that will be added to SS^{\prime} at the end of the step.

  • Otherwise, let eie_{i} be the first (closest to tyt_{y}) reported edge that is already in SS^{\prime}. We stop the step, add all edges in S(x,y){e1,,ei1}S_{(x,y)}\cup\{e_{1},\ldots,e_{i-1}\} to SS^{\prime}, and finish the step of edge (x,y)(x,y). The edges in S(x,y){e1,,ei1}S_{(x,y)}\cup\{e_{1},\ldots,e_{i-1}\} form a path from tyt_{y} to eiSe_{i}\in S^{\prime} and therefore to txt_{x}, so we are done.

If we reach yy without stopping, we continue on to the edge (x,y)(x,y). Again, we check if it is already in SS^{\prime}; if not we add it to S(x,y)S_{(x,y)}, if it is, we stop and add all of S(x,y)S_{(x,y)} into SS^{\prime}. Similarly, after reaching xx we continue by scanning the tree up to txt_{x}. When encountering an edge from EE or EhopsetE_{hopset} we do the exact steps above to decide if we should add it to S(x,y)S_{(x,y)} or stop. If we reach the txt_{x} without stopping, we add all of S(x,y)S_{(x,y)} into SS^{\prime} and finish the step.

We claim that the total time for the above process is mno(1)logO(1)Lm^{\prime}\cdot n^{o(1)}\cdot\log^{O(1)}{L} where mm^{\prime} is the number of distinct edges that end up in SS^{\prime}. Consider the step corresponding to an edge (x,y)(x,y), and let ee^{*} be the first edge on the corresponding path from tyt_{y} to txt_{x} (the one closest to tyt_{y}) that is already in SS^{\prime} before the step. Let e1,,eie_{1},\ldots,e_{i} be the ii edges that come before ee^{*} on the path, and let mim^{*}\leq i be the number of distinct edges among them; note that the step ends up adding mm^{*} new edges to SS^{\prime} and our goal is to bound its running time by mno(1)logO(1)Lm^{*}\cdot n^{o(1)}\cdot\log^{O(1)}{L}. By the assumption on the data-structure, each edge can appear only no(1)n^{o(1)} times on a root-to-leaf path in ThopsetT_{hopset}, and therefore mi/no(1)m^{*}\geq i/n^{o(1)}. Due to the repeated doubling of kk in the above process, each edge might get reported an additional O(logn)O(\log{n}) times, and more importantly, the number of edges ee^{\prime} that come after ee^{*} on the path and that the data-structure reports (but do not end up in SS^{\prime}) is 2i\leq 2i. Therefore, the total time can be upper bounded by O(ilogn)no(1)logO(1)L=mno(1)logO(1)LO(i\log n)\cdot n^{o(1)}\cdot\log^{O(1)}{L}=m^{*}\cdot n^{o(1)}\cdot\log^{O(1)}{L}.

4.2.2 The Full Construction

We are now ready to present our actual construction. The proof is heavily based on the proof of the simpler construction above.

Refer to caption
Figure 7: An illustration representing how the O(logn)O(\log{n}) approximate SSSP trees maintained by the dynamic algorithm are combined in our helper graph.
Lemma 4.10.

Suppose that for any constant ϵ>0\epsilon>0, there is a deterministic data-structure that given a graph G=(V,E,:E[L])G=(V,E,\ell:E\to[L]) and a source sVs\in V, that undergoes a sequence of edge-length-increase updates of length UU, and supports the following operations in mno(1)logO(1)L+O(U)m\cdot n^{o(1)}\cdot\log^{O(1)}L+O(U) total time. There is a parameter 2γno(1)2\leq\gamma\leq n^{o(1)} such that, for each i[logγnL]i\in[\log_{\gamma}nL]:

  • Explicitly maintains an estimate d~i(s,v)\tilde{d}^{i}(s,v) for each vVv\in V, such that d(s,v)d~i(s,v)d(s,v)\leq\tilde{d}^{i}(s,v) and if d(s,v)[γi1,γi]d(s,v)\in[\gamma^{i-1},\gamma^{i}] then d~i(s,v)(1+ϵ)d(s,v)\tilde{d}^{i}(s,v)\leq(1+\epsilon)\cdot d(s,v). In particular, can report after each update, all vertices vVv\in V such that d~i(s,v)\tilde{d}^{i}(s,v) increased.

  • Explicitly maintains a graph H~i\tilde{H}^{i} where H~i\tilde{H}^{i} is not a subgraph of GG and V(H~i)V(\tilde{H}^{i}) contains all vertices of GG but also a set CiC^{i} of auxiliary vertices, which forms an independent set in H~i\tilde{H}^{i}. For any pair of regular vertices u,vVu,v\in V, if (u,v)E(H~i)(u,v)\in E(\tilde{H}^{i}) has length ww or there is an auxiliary vertex cCic\in C^{i} such that (u,c),(c,v)E(H~i)(u,c),(c,v)\in E(\tilde{H}^{i}) is a 22-path of length ww, then there is an associated u,vu,v-path πu,v\pi_{u,v} in GG of length between ww and (1+ϵ)w(1+\epsilon)\cdot w. Although πu,v\pi_{u,v} is not a simple path, each edge ee in GG may appear at most β=no(1)\beta=n^{o(1)} times in πu,v\pi_{u,v}.

  • Explicitly maintains a tree ThopsetiT_{hopset}^{i} rooted at ss in H~i\tilde{H}^{i} of depth no(1)n^{o(1)}, such that d~i(s,v)=dThopseti(s,v)\tilde{d}^{i}(s,v)=d_{T_{hopset}^{i}}(s,v) for all vVv\in V. In particular, can report after each update, all edges that are added or removed from ThopsetT_{hopset}.

Additionally, the data-structure supports the following query:

  • For each path πu,v\pi_{u,v} in H~i\tilde{H}^{i}, given an integer k1k\geq 1, can return the first (or last) kk edges of πu,v\pi_{u,v} in time kno(1)logO(1)Lk\cdot n^{o(1)}\cdot\log^{O(1)}L.

Then Lemma 4.6 holds.

A data-structure with the above requirements indeed exists by the recent work of Bernstein et al. [BGS22]. Since this exact formulation was not explicitly stated in [BGS22], let us point out how to obtain it. In Section III.5 of [BGS22], there are logγnL\log_{\gamma}nL distance scales of the data structures where γ(2,no(1))\gamma\in(2,n^{o(1)}). For each scale ii, the objects in Lemma 4.6, such as the estimates d~i(v)\tilde{d}^{i}(v) for all vv, are maintained by the ApxBallπ\textsc{ApxBall}^{\pi} data structure described in Sections II.5 and III.3 of [BGS22]. H~i\tilde{H}^{i} is called an emulator in Definition II.5.2 in [BGS22]. A vertex cCic\in C^{i} corresponds to a core (see Definition II.2.8 of [BGS22]). The tree ThopsetiT^{i}_{hopset} is the Monotone Even-Shiloach tree maintained by ApxBallπ\textsc{ApxBall}^{\pi} as described in Section II.5.2.

The only guarantee which was implicit in [BGS22] is the last bullet point about returning the first/last kk edges in the path πu,v\pi_{u,v} in kno(1)logO(1)Lk\cdot n^{o(1)}\cdot\log^{O(1)}L time. This guarantee follows by inspecting Algorithm 7 of [BGS22]. When the algorithm needs to report the whole path πu,v\pi_{u,v}, it does so by recursively querying the data structure starting from the largest distance scale to the smallest distance scale. More precisely, the path πu,v\pi_{u,v} is represented by a hierarchical tree of depth logγnL\log_{\gamma}nL whose leaves correspond to edges of πu,v\pi_{u,v} and internal vertices correspond to subpaths of πu,v\pi_{u,v}. Each internal vertex has no(1)n^{o(1)} children ordered according to the ordering of the edges in the path. Now, when we query only for the first kk edges in the path, the algorithm would resemble the situation when we have a balanced binary search tree and we want to list the first kk leaves of this tree. For our setting, the tree has logγnL\log_{\gamma}nL depth and each vertex has no(1)n^{o(1)} children. By recursively querying the multi-level data structures in this way, we will obtain the first kk edges of the path in kno(1)logO(1)Lk\cdot n^{o(1)}\cdot\log^{O(1)}L time.

Proof.

The proof follows along the lines of the proof of Proposition 4.7 but with a few modifications. As before, we apply the data-structure on the graph GG^{\prime} that is obtained from GG by adding a super-source ss^{*} that represents all terminals in TT. Rather than adding zero-length edges between each tUt\in U and ss^{*} we contract all terminals into a single vertex and call it ss^{*}. Note that each edge (s,x)(s^{*},x) in GG^{\prime} can be traced back to an edge (t,x)(t,x) for some tUt\in U. Let Thopset1,,ThopsetaT^{1}_{hopset},\ldots,T^{a}_{hopset} and d~1(s,v),,d~a(s,v)\tilde{d}^{1}(s^{*},v),\ldots,\tilde{d}^{a}(s^{*},v) be the trees and estimates maintained by the data-structure, where a=logγnL=no(1)logO(1)La=\log_{\gamma}nL=n^{o(1)}\log^{O(1)}L.

Maintaining a helper graph

The helper graph H=(VH,EH,wH:EH[2nL]{0})H=(V_{H},E_{H},w_{H}:E_{H}\to[2nL]\cup\{0\}) is defined based on GG, the trees ThopsetiT^{i}_{hopset} and estimates d~i(s,v)\tilde{d}^{i}(s^{*},v) as follows. For each vertex xVUx\in V\setminus U in GG we create aa copies {x1,,xa}\{x^{1},\ldots,x^{a}\} in VHV_{H}. A terminal vertex tUVt\in U\subseteq V however only has one copy tVHt\in V_{H}. Moreover, we add all auxiliary vertices in CiC^{i} for all ii to VHV_{H}. There are two kinds of edges in HH:

  • Green edges: for each edge (x,y)EG(x,y)\in E_{G} we add a2a^{2} edges (xi,yj)(x^{i},y^{j}) to EHE_{H}, for all i,j[a]i,j\in[a], and set their length to

    H(xi,yj):=d~i(s,x)+G(x,y)+d~j(s,y).\ell_{H}(x^{i},y^{j}):=\tilde{d}^{i}(s^{*},x)+\ell_{G}(x,y)+\tilde{d}^{j}(s^{*},y).

    A green edge gets updated whenever: (1) the length G(x,y)\ell_{G}(x,y) gets updated and is more than (1+ϵ)(1+\epsilon) times the value used in the current H(xi,yj)\ell_{H}(x^{i},y^{j}), or (2) the data-structure reports that d~i(s,x)\tilde{d}^{i}(s^{*},x) or d~j(s,y)\tilde{d}^{j}(s^{*},y) increased by a (1+ϵ)\geq(1+\epsilon) factor.

  • Red edges: for each edge (x,y)E(Thopseti)(x,y)\in E(T^{i}_{hopset}) for some i[a]i\in[a] we add an edge (xi,yi)(x^{i},y^{i}) of length 0 to EHE_{H}. If one of xx or yy is ss^{*}, suppose w.l.o.g. that it is xx, then we trace the edge (s,y)(s^{*},y) back to an edge (t,x)E(t,x)\in E and we add an edge (t,yi)(t,y^{i}) of length 0 to EHE_{H}. A red edge gets updated whenever the tree ThopsetiT^{i}_{hopset} changes. If an edge is removed from the tree, the red edge is removed (i.e. the length is increased from 0 to infinity),181818As before, these are the only incremental update that we do. and if a new edge is added to the tree we add an edge of length zero to HH.

(See Figure 7 for an illustration.)

The recourse of the helper graph

The mno(1)logO(1)Lm\cdot n^{o(1)}\cdot\log^{O(1)}{L} upper bound on the total running time and recourse of maintaining HH follows exactly as in the simpler construction above, with the exception that there is an additional a2=no(1)logO(1)La^{2}=n^{o(1)}\log^{O(1)}L factor due to the number of times an edge is copied.

The properties of the helper graph

Next, let us prove that HH satisfies the two properties in Lemma 4.5.

For the first property, consider any vertex xiVHx^{i}\in V_{H}, for some xVUx\in V\setminus U, and our goal is to prove that there is exactly one terminal txUt_{x}\in U such that dH(xi,tx)=0d_{H}(x^{i},t_{x})=0. First, observe that the only red edges that are adjacent to a vertex xix^{i} come from edges in the tree ThopsetiT^{i}_{hopset}. Let e=(s,u)e=(s^{*},u) be the first edge on the path from ss^{*} to xix^{i} in ThopsetiT^{i}_{hopset}. This edge can be traced back to an edge (tx,u)E(t_{x},u)\in E where txUt_{x}\in U. Due to the red edges, we will have dH(xi,tx)=0d_{H}(x^{i},t_{x})=0. On the other hand, since ThopsetiT^{i}_{hopset} is a tree, there cannot be any other path from xix^{i} to ss^{*} and consequently there will not be any other terminal tUt^{\prime}\in U with a red path to xix^{i} (via edges from Thopseti)T^{i}_{hopset}). The only other way that tt^{\prime} could potentially reach xix^{i} with a red path is if tt^{\prime} could reach txt_{x} via edges from some other ThopsetjT^{j}_{hopset} and then use the red path from txt_{x} to xix^{i}. However, by construction, any red path between two terminals implies a loop in one of the trees ThopsetjT^{j}_{hopset} – a contradiction.

To prove the second property, let (x,y)E(x,y)\in E be an edge in GG, and let i,j[a]i,j\in[a] be such that dG(s,x)[γi1,γi]d_{G^{\prime}}(s^{*},x)\in[\gamma^{i-1},\gamma^{i}] and dG(s,y)[γj1,γj]d_{G^{\prime}}(s^{*},y)\in[\gamma^{j-1},\gamma^{j}]. Consequently, d~i(s,x)(1+ϵ)dG(s,x)\tilde{d}^{i}(s^{*},x)\leq(1+\epsilon)\cdot d_{G^{\prime}}(s^{*},x) and d~j(s,y)(1+ϵ)dG(s,y)\tilde{d}^{j}(s^{*},y)\leq(1+\epsilon)\cdot d_{G^{\prime}}(s^{*},y). We will show that the green edge (xi,yj)EH(x^{i},y^{j})\in E_{H} satisfies the requirement. Let txt_{x} and tyt_{y} be such that dH(xi,tx)=0d_{H}(x^{i},t_{x})=0 and dH(yj,ty)=0d_{H}(y^{j},t_{y})=0. By an argument similar to Claim 4.9 from before, we know that txt_{x} and tyt_{y} are (1+ϵ)(1+\epsilon)-closest terminals to xx and yy (respectively) in GG. This is because dG(tx,x)dThopseti(tx,x)=d~i(s,x)(1+ϵ)dG(s,x)=(1+ϵ)mintUdG(t,x)d_{G}(t_{x},x)\leq d_{T^{i}_{hopset}}(t_{x},x)=\tilde{d}^{i}(s^{*},x)\leq(1+\epsilon)\cdot d_{G^{\prime}}(s^{*},x)=(1+\epsilon)\cdot\min_{t\in U}d_{G}(t,x), and similarly dG(ty,y)d~j(s,y)(1+ϵ)mintUdG(t,y)d_{G}(t_{y},y)\leq\tilde{d}^{j}(s^{*},y)\leq(1+\epsilon)\cdot\min_{t\in U}d_{G}(t,y). Finally, we can upper bound the length of the green edge (xi,yj)(x^{i},y^{j}) in HH by

H(xi,yj)=d~i(s,x)+G(x,y)+d~j(s,y)(1+ϵ)(dG(s,x)+G(x,y)+dG(s,y))\ell_{H}(x^{i},y^{j})=\tilde{d}^{i}(s^{*},x)+\ell_{G}(x,y)+\tilde{d}^{j}(s^{*},y)\leq(1+\epsilon)\cdot(d_{G^{\prime}}(s^{*},x)+\ell_{G}(x,y)+d_{G^{\prime}}(s^{*},y))
(1+ϵ)(dG(tx,x)+G(x,y)+dG(y,ty)).\leq(1+\epsilon)\cdot(d_{G}(t_{x},x)+\ell_{G}(x,y)+d_{G}(y,t_{y})).
Expanding an MST of HH into a UU-Steiner subgraph of GG

To conclude the proof we point out that the process of expanding an MST of HH into a Steiner Subgraph of GG can be carried out in exactly the same way as in the previous subsection, with the minor detail that we have to get rid of the auxiliary vertices CiC^{i} if they are in the MST. By assumption, there are no edges between them, so we can simply make the expansion on two-paths in the MST (that skip over auxiliary vertices) rather than edges. This expansion of an edge or two-path of length ww into a path πu,x\pi_{u,x} in GG of length up to (1+ϵ)w(1+\epsilon)\cdot w introduces a (1+ϵ)(1+\epsilon) factor to the total length of the Steiner subgraph (that we did not have in the simple construction). ∎

5 Conclusion

In this paper, we broke the longstanding cubic barrier for the GHtree and APMF problems in general, weighted graphs. All previous improvements since 1961, were either corollaries of speed-ups in (single-pair) max-flow algorithms, or were limited to special graph classes. Assuming the APSP Conjecture, a cornerstone of fine-grained complexity, our result disproves the belief that computing max-flows is at least as hard as computing shortest-paths.

Our algorithm has a running time of O~(n2)\tilde{O}(n^{2}) which is nearly-optimal for APMF if all (n2){n\choose 2} max-flow values must be returned. For GHtree in unweighted graphs, our techniques yield an improved running time of m1+o(1)m^{1+o(1)}. In fact, a succinct representation of all-pairs max-flows can be produced in the time of O~(1)\tilde{O}(1) calls to a (single-pair) max-flow algorithm.

It is an interesting open question as to whether our techniques can be extended to obtain an m1+o(1)m^{1+o(1)}-time GHtree algorithm for weighted graphs as well. In particular, the most significant challenge is to design a new dynamic Steiner tree subroutine (analogous to the one in Section 4) that can be used for packing Steiner trees in weighted graphs in almost-linear time.

References

  • [ACK20] A. Abboud, V. Cohen-Addad, and P. N. Klein. New hardness results for planar graph problems in p and an algorithm for sparsest cut. In K. Makarychev, Y. Makarychev, M. Tulsiani, G. Kamath, and J. Chuzhoy, editors, Proccedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, Chicago, IL, USA, June 22-26, 2020, pages 996–1009. ACM, 2020. Available from: https://doi.org/10.1145/3357713.3384310, doi:10.1145/3357713.3384310.
  • [ACZ98] S. R. Arikati, S. Chaudhuri, and C. D. Zaroliagis. All-pairs min-cut in sparse networks. J. Algorithms, 29(1):82–110, 1998. doi:10.1006/jagm.1998.0961.
  • [AD16] A. Abboud and S. Dahlgaard. Popular conjectures as a barrier for dynamic planar graph algorithms. In I. Dinur, editor, IEEE 57th Annual Symposium on Foundations of Computer Science, FOCS 2016, 9-11 October 2016, Hyatt Regency, New Brunswick, New Jersey, USA, pages 477–486. IEEE Computer Society, 2016. Available from: https://doi.org/10.1109/FOCS.2016.58, doi:10.1109/FOCS.2016.58.
  • [AGI+19] A. Abboud, L. Georgiadis, G. F. Italiano, R. Krauthgamer, N. Parotsidis, O. Trabelsi, P. Uznanski, and D. Wolleb-Graf. Faster Algorithms for All-Pairs Bounded Min-Cuts. In 46th International Colloquium on Automata, Languages, and Programming (ICALP 2019), volume 132, pages 7:1–7:15, 2019. doi:10.4230/LIPIcs.ICALP.2019.7.
  • [AGW15] A. Abboud, F. Grandoni, and V. V. Williams. Subcubic equivalences between graph centrality problems, APSP and diameter. In P. Indyk, editor, Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2015, San Diego, CA, USA, January 4-6, 2015, pages 1681–1697. SIAM, 2015. Available from: https://doi.org/10.1137/1.9781611973730.112, doi:10.1137/1.9781611973730.112.
  • [AHK12] S. Arora, E. Hazan, and S. Kale. The multiplicative weights update method: a meta-algorithm and applications. Theory of Computing, 8(1):121–164, 2012.
  • [AIS+16] T. Akiba, Y. Iwata, Y. Sameshima, N. Mizuno, and Y. Yano. Cut tree construction from massive graphs. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pages 775–780. IEEE, 2016.
  • [AKT20] A. Abboud, R. Krauthgamer, and O. Trabelsi. Cut-equivalent trees are optimal for min-cut queries. In 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, pages 105–118, 2020. doi:10.1109/FOCS46700.2020.00019.
  • [AKT21a] A. Abboud, R. Krauthgamer, and O. Trabelsi. APMF << APSP? Gomory-Hu tree for unweighted graphs in almost-quadratic time. Accepted to FOCS’21, 2021. arXiv:2106.02981.
  • [AKT21b] A. Abboud, R. Krauthgamer, and O. Trabelsi. New algorithms and lower bounds for all-pairs max-flow in undirected graphs. Theory of Computing, 17(5):1–27, 2021. doi:10.4086/toc.2021.v017a005.
  • [AKT21c] A. Abboud, R. Krauthgamer, and O. Trabelsi. Subcubic algorithms for gomory–hu tree in unweighted graphs. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 1725–1737, 2021. doi:10.1145/3406325.3451073.
  • [AKT22] A. Abboud, R. Krauthgamer, and O. Trabelsi. Friendly cut sparsifiers and faster Gomory-Hu trees. Accepted to SODA’22, 2022. arXiv:2110.15891.
  • [AMO93] R. Ahuja, T. Magnanti, and J. Orlin. Network Flows. Prentice Hall, 1993.
  • [AV20] N. Anari and V. V. Vazirani. Planar graph perfect matching is in NC. Journal of the ACM, 67(4):1–34, 2020.
  • [AVY15] A. Abboud, V. Vassilevska Williams, and H. Yu. Matching triangles and basing hardness on an extremely popular conjecture. In Proc. of 47th STOC, pages 41–50, 2015.
  • [AW14] A. Abboud and V. V. Williams. Popular conjectures imply strong lower bounds for dynamic problems. In 55th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2014, pages 434–443, 2014. doi:10.1109/FOCS.2014.53.
  • [AW21] J. Alman and V. V. Williams. A refined laser method and faster matrix multiplication. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, SODA 2021, pages 522–539, 2021. doi:10.1137/1.9781611976465.32.
  • [BBDF06] D. Barth, P. Berthomé, M. Diallo, and A. Ferreira. Revisiting parametric multi-terminal problems: Maximum flows, minimum cuts and cut-tree computations. Discrete Optimization, 3(3):195–205, 2006.
  • [BCH+08] A. Bhalgat, R. Cole, R. Hariharan, T. Kavitha, and D. Panigrahi. Efficient algorithms for Steiner edge connectivity computationand Gomory-Hu tree construction for unweighted graphs. Unpublished full version of [BHKP07], 2008. Available from: http://hariharan-ramesh.com/papers/gohu.pdf.
  • [BDT16] A. Backurs, N. Dikkala, and C. Tzamos. Tight hardness results for maximum weight rectangles. In I. Chatzigiannakis, M. Mitzenmacher, Y. Rabani, and D. Sangiorgi, editors, 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, July 11-15, 2016, Rome, Italy, volume 55 of LIPIcs, pages 81:1–81:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016. Available from: https://doi.org/10.4230/LIPIcs.ICALP.2016.81, doi:10.4230/LIPIcs.ICALP.2016.81.
  • [BENW16] G. Borradaile, D. Eppstein, A. Nayyeri, and C. Wulff-Nilsen. All-pairs minimum cuts in near-linear time for surface-embedded graphs. In 32nd International Symposium on Computational Geometry, volume 51 of SoCG ’16, pages 22:1–22:16, 2016. doi:10.4230/LIPIcs.SoCG.2016.22.
  • [BFJ95] J. Bang-Jensen, A. Frank, and B. Jackson. Preserving and increasing local edge-connectivity in mixed graphs. SIAM J. Discret. Math., 8(2):155–178, 1995. doi:10.1137/S0036142993226983.
  • [BGK20] S. Baswana, S. Gupta, and T. Knollmann. Mincut sensitivity data structures for the insertion of an edge. In 28th Annual European Symposium on Algorithms (ESA 2020), 2020.
  • [BGMW20] K. Bringmann, P. Gawrychowski, S. Mozes, and O. Weimann. Tree edit distance cannot be computed in strongly subcubic time (unless apsp can). ACM Transactions on Algorithms (TALG), 16(4):1–22, 2020.
  • [BGS22] A. Bernstein, M. P. Gutenberg, and T. Saranurak. Deterministic decremental sssp and approximate min-cost flow in almost-linear time. In 2021 IEEE 62nd Annual Symposium on Foundations of Computer Science (FOCS), pages 1000–1008. IEEE, 2022.
  • [BHKP07] A. Bhalgat, R. Hariharan, T. Kavitha, and D. Panigrahi. An O~(mn)\tilde{O}(mn) Gomory-Hu tree construction algorithm for unweighted graphs. In 39th Annual ACM Symposium on Theory of Computing, STOC’07, pages 605–614, 2007. doi:10.1145/1250790.1250879.
  • [BK15] A. A. Benczúr and D. R. Karger. Randomized approximation schemes for cuts and flows in capacitated graphs. SIAM J. Comput., 44(2):290–319, 2015. doi:10.1137/070705970.
  • [BSW15] G. Borradaile, P. Sankowski, and C. Wulff-Nilsen. Min stst-cut oracle for planar graphs with near-linear preprocessing time. ACM Trans. Algorithms, 11(3), 2015. doi:10.1145/2684068.
  • [BT17] A. Backurs and C. Tzamos. Improving viterbi is hard: Better runtimes imply faster clique algorithms. In International Conference on Machine Learning, pages 311–321. PMLR, 2017.
  • [CCPS97] W. Cook, W. Cunningham, W. Pulleybank, and A. Schrijver. Combinatorial Optimization. Wiley, 1997.
  • [CKL+22] L. Chen, R. Kyng, Y. P. Liu, R. Peng, M. P. Gutenberg, and S. Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. CoRR, abs/2203.00671, 2022. Available from: https://doi.org/10.48550/arXiv.2203.00671, arXiv:2203.00671, doi:10.48550/arXiv.2203.00671.
  • [CLP22] R. Cen, J. Li, and D. Panigrahi. Augmenting edge connectivity via isolating cuts. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, SODA 2022, 2022.
  • [CMWW19] M. Cygan, M. Mucha, K. Wegrzycki, and M. Włodarczyk. On problems equivalent to (min,+)-convolution. ACM Transactions on Algorithms (TALG), 15(1):1–25, 2019.
  • [CQ21] C. Chekuri and K. Quanrud. Isolating cuts,(bi-) submodularity, and faster algorithms for connectivity. In 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2021.
  • [CS21] J. Chuzhoy and T. Saranurak. Deterministic algorithms for decremental shortest paths via layered core decomposition. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2478–2496. SIAM, 2021.
  • [Dij59] E. W. Dijkstra. A note on two problems in connexion with graphs. Numerische mathematik, 1(1):269–271, 1959.
  • [Elm64] S. E. Elmaghraby. Sensitivity analysis of multiterminal flow networks. Operations Research, 12(5):680–688, 1964.
  • [Fle00] L. K. Fleischer. Approximating fractional multicommodity flow independent of the number of commodities. SIAM Journal on Discrete Mathematics, 13(4):505–520, 2000.
  • [GH61] R. E. Gomory and T. C. Hu. Multi-terminal network flows. Journal of the Society for Industrial and Applied Mathematics, 9:551–570, 1961. Available from: http://www.jstor.org/stable/2098881.
  • [GK07] N. Garg and J. Könemann. Faster and simpler algorithms for multicommodity flow and other fractional packing problems. SIAM Journal on Computing, 37(2):630–652, 2007.
  • [GMW21] P. Gawrychowski, S. Mozes, and O. Weimann. Planar negative k-cycle. In D. Marx, editor, Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, SODA 2021, Virtual Conference, January 10 - 13, 2021, pages 2717–2724. SIAM, 2021. Available from: https://doi.org/10.1137/1.9781611976465.161, doi:10.1137/1.9781611976465.161.
  • [GR98] A. V. Goldberg and S. Rao. Beyond the flow decomposition barrier. J. ACM, 45(5):783–797, 1998. doi:10.1145/290179.290181.
  • [GT01] A. V. Goldberg and K. Tsioutsiouliklis. Cut tree algorithms: an experimental study. Journal of Algorithms, 38(1):51–83, 2001.
  • [Gus90] D. Gusfield. Very simple methods for all pairs network flow analysis. SIAM Journal on Computing, 19(1):143–155, 1990.
  • [HdLT01] J. Holm, K. de Lichtenberg, and M. Thorup. Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity. Journal of the ACM (JACM), 48(4):723–760, 2001. doi:10.1145/502090.502095.
  • [HKN14] M. Henzinger, S. Krinninger, and D. Nanongkai. Decremental single-source shortest paths on undirected graphs in near-linear total update time. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pages 146–155. IEEE, 2014.
  • [HL07] R. Hassin and A. Levin. Flow trees for vertex-capacitated networks. Discrete Appl. Math., 155(4):572–578, 2007. doi:10.1016/j.dam.2006.08.012.
  • [HR92] F. K. Hwang and D. S. Richards. Steiner tree problems. Networks, 22(1):55–89, 1992. doi:10.1002/net.3230220105.
  • [Hu74] T. C. Hu. Optimum communication spanning trees. SIAM Journal on Computing, 3(3):188–195, 1974. doi:10.1137/0203015.
  • [HW13] T. Hartmann and D. Wagner. Dynamic Gomory–Hu tree construction–fast and simple. arXiv preprint arXiv:1310.0178, 2013.
  • [Jel63] F. Jelinek. On the maximum number of different entries in the terminal capacity matrix of oriented communication nets. IEEE Transactions on Circuit Theory, 10(2):307–308, 1963. doi:10.1109/TCT.1963.1082149.
  • [Kar00] D. R. Karger. Minimum cuts in near-linear time. Journal of the ACM, 47(1):46–76, 2000.
  • [KL15] D. R. Karger and M. S. Levine. Fast augmenting paths by random sampling from residual graphs. SIAM J. Comput., 44(2):320–339, 2015. doi:10.1137/070705994.
  • [KMB81] L. T. Kou, G. Markowsky, and L. Berman. A fast algorithm for steiner trees. Acta Informatica, 15:141–145, 1981. Available from: https://doi.org/10.1007/BF00288961, doi:10.1007/BF00288961.
  • [KT18] R. Krauthgamer and O. Trabelsi. Conditional lower bounds for all-pairs max-flow. ACM Trans. Algorithms, 14(4):42:1–42:15, 2018. doi:10.1145/3212510.
  • [KV12] B. Korte and J. Vygen. Combinatorial optimization, volume 2. Springer, 2012.
  • [Li21] J. Li. Preconditioning and Locality in Algorithm Design. PhD thesis, Carnegie Mellon University, 2021.
  • [LNP+21] J. Li, D. Nanongkai, D. Panigrahi, T. Saranurak, and S. Yingchareonthawornchai. Vertex connectivity in poly-logarithmic max-flows. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 317–329, 2021.
  • [LP20] J. Li and D. Panigrahi. Deterministic min-cut in poly-logarithmic max-flows. In 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS 2020, pages 85–92, 2020. doi:10.1109/FOCS46700.2020.00017.
  • [LP21] J. Li and D. Panigrahi. Approximate Gomory-Hu tree is faster than n1n-1 max-flows. In STOC ’21: 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 1738–1748. ACM, 2021. doi:10.1145/3406325.3451112.
  • [LPS21] J. Li, D. Panigrahi, and T. Saranurak. A nearly optimal all-pairs min-cuts algorithm in simple graphs. Accepted to FOCS’21, 2021. arXiv:2106.02233.
  • [Mad78] W. Mader. A reduction method for edge-connectivity in graphs. In B. Bollobás, editor, Advances in Graph Theory, volume 3 of Annals of Discrete Mathematics, pages 145–164. Elsevier, 1978. doi:https://doi.org/10.1016/S0167-5060(08)70504-1.
  • [May62] W. Mayeda. On oriented communication nets. IRE Transactions on Circuit Theory, 9(3):261–267, 1962. doi:10.1109/TCT.1962.1086912.
  • [Meh88] K. Mehlhorn. A faster approximation algorithm for the steiner problem in graphs. Information Processing Letters, 27(3):125–128, 1988.
  • [MN21] S. Mukhopadhyay and D. Nanongkai. A note on isolating cut lemma for submodular function minimization. arXiv preprint arXiv:2103.15724, 2021.
  • [NS18] G. Naves and F. B. Shepherd. When do Gomory-Hu subtrees exist? CoRR, 2018. Available from: http://arxiv.org/abs/1807.07331.
  • [NW61] C. S. A. Nash-Williams. Edge-Disjoint Spanning Trees of Finite Graphs. Journal of the London Mathematical Society, s1-36(1):445–450, 01 1961. doi:10.1112/jlms/s1-36.1.445.
  • [Pan16] D. Panigrahi. Gomory-Hu trees. In M.-Y. Kao, editor, Encyclopedia of Algorithms, pages 858–861. Springer New York, 2016. doi:10.1007/978-1-4939-2864-4_168.
  • [Ple81] J. Plesník. The complexity of designing a network with minimum diameter. Networks, 11(1):77–85, 1981. Available from: https://doi.org/10.1002/net.3230110110, doi:10.1002/net.3230110110.
  • [PQ80] J.-C. Picard and M. Queyranne. On the structure of all minimum cuts in a network and applications. In Combinatorial Optimization II, pages 8–16. Springer, 1980.
  • [PR82] M. W. Padberg and M. R. Rao. Odd minimum cut-sets and bb-matchings. Mathematics of Operations Research, 7(1):67–80, 1982.
  • [RZ04] L. Roditty and U. Zwick. On dynamic shortest paths problems. In European Symposium on Algorithms, pages 580–591. Springer, 2004.
  • [Sah15] B. Saha. Language edit distance and maximum likelihood parsing of stochastic grammars: Faster algorithms and connection to fundamental graph problems. In V. Guruswami, editor, IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015, pages 118–135. IEEE Computer Society, 2015. Available from: https://doi.org/10.1109/FOCS.2015.17, doi:10.1109/FOCS.2015.17.
  • [Sch03] A. Schrijver. Combinatorial Optimization. Springer, 2003.
  • [Sei95] R. Seidel. On the all-pairs-shortest-path problem in unweighted undirected graphs. Journal of computer and system sciences, 51(3):400–403, 1995.
  • [TM80] H. Takahashi and A. Matsuyama. An approximate solution for the Steiner problem in graphs. Math. Japon., 24(6):573–577, 1979/80.
  • [Tut61] W. T. Tutte. On the Problem of Decomposing a Graph into n Connected Factors. Journal of the London Mathematical Society, s1-36(1):221–230, 01 1961. doi:10.1112/jlms/s1-36.1.221.
  • [WL93] Z. Wu and R. Leahy. An optimal graph theoretic approach to data clustering: Theory and its application to image segmentation. IEEE transactions on pattern analysis and machine intelligence, 15(11):1101–1113, 1993.
  • [WW18] V. V. Williams and R. R. Williams. Subcubic equivalences between path, matrix, and triangle problems. J. ACM, 65(5):27:1–27:38, 2018. doi:10.1145/3186893.
  • [Zha21] T. Zhang. Gomory-Hu trees in quadratic time. arXiv preprint arXiv:2112.01042, 2021.
  • [Zha22] T. Zhang. Faster Cut-Equivalent Trees in Simple Graphs. In 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), volume 229 of Leibniz International Proceedings in Informatics (LIPIcs), pages 109:1–109:18, Dagstuhl, Germany, 2022. arXiv:2106.03305, doi:10.4230/LIPIcs.ICALP.2022.109.

Appendix A Reduction to Single-Source Terminal Mincuts Given a Promise

In this section, we present the reduction of Lemma 1.6, restated below. See 1.6

Before giving the formal reduction, let us give a high-level description. The original Gomory-Hu algorithm is a reduction to n1n-1 max-flow calls. At a high-level, it starts with all vertices in one super-vertex V=VV^{\prime}=V and recursively bi-partitions VVV^{\prime}\subseteq V, until VV^{\prime} contains only one vertex. In any recursive step, the input to the algorithm is the set VVV^{\prime}\subseteq V (called terminals) and a graph GG^{\prime} that is formed from contracting sets of vertices in the input graph GG in previous recursive steps. In the current step, the algorithm picks an arbitrary pair of vertices s,tVs,t\in V^{\prime} and computes an (s,t)(s,t)-mincut in GG^{\prime}. Then, it creates two recursive subproblems, where in each subproblem, one side of the (s,t)(s,t)-mincut cut is retained uncontracted and the other side is contracted into a single vertex. The new VV^{\prime} in a subproblem comprises the vertices in VV^{\prime} on the uncontracted side.

The contractions serve to enforce consistency between the cuts, so that we end up with a tree structure of cuts. But, recent work has shown that these contractions also help with efficiency. Suppose that instead of an arbitrary s,ts,t pair (which can lead to unbalanced cuts and large recursive depth), we split using single-source mincuts from a random pivot sVs\in V^{\prime} to all other terminals V{s}V^{\prime}\setminus\{s\}. It turns out that with sufficiently high probability, the cuts from the random pivot to many other terminals only contain at most (say) 0.90.9-fraction of the vertices in VV^{\prime}, and splitting according to all these cuts (instead of into two) leads to recursion whose depth is bounded by O(logn)O(\log n).

Effectively, this gives a reduction from GHtree to the single-source mincuts problem, with only a multiplicative polylog(n)\mathrm{polylog}(n) overhead in the running time. The random-pivot idea was first used by Bhalgat et al. [BHKP07] but the first general reduction to single-source mincuts is by Abboud et al. [AKT20]. We use a refined reduction that has two additional features: (1) the algorithm (for the single-source problem) only needs to return the values of the cuts rather than the cuts themselves (and in fact, it is given estimates and only needs to decide if they are correct), and (2) the mincut values between any pair of terminals in the graph are guaranteed to be within a (say) 1.11.1-factor from each other (the so called “promise”). The first restriction only serves to simplify our new algorithm, while the second is more important for our new ideas to work. This is encapsulated in Lemma 1.6 which we prove below.

As discussed in the overview, we first remove the “promise” condition from the single source terminal mincuts problem (1.5). To be precise, we first formally define the single source terminal mincuts problem without the promise.

Problem A.1 (Single-Source Terminal Mincuts (without Promise)).

The input is a graph G=(V,E,w)G=(V,E,w), a terminal set UVU\subseteq V and a source terminal sUs\in U. The goal is to determine the value of λ(s,t)\lambda(s,t) for each terminal tU{s}t\in U\setminus\{s\}.

We also require the approximate single-source mincuts algorithm of [LP21], stated below, which we use as a black box.

Theorem A.2 (Theorem 1.7 of [LP21]).

Let G=(V,E,w)G=(V,E,w) be a graph, let sVs\in V, and let ϵ>0\epsilon>0 be a constant. There is an algorithm that outputs, for each vertex vV{s}v\in V\setminus\{s\}, a (1+ϵ)(1+\epsilon)-approximation of λ(s,v)\lambda(s,v), and runs in O~(mlogΔ)\tilde{O}(m\log\Delta) time plus polylog(n)logΔ\textup{polylog}(n)\cdot\log\Delta calls to max-flow on O(n)O(n)-vertex, O(m)O(m)-edge graphs, where Δ\Delta is the ratio of maximum to minimum edge weights.

We now present the reduction that removes the promise.

Lemma A.3.

There is a randomized algorithm for the unconditional Single-Source Terminal Mincuts problem (A.1) that makes calls to the promise version of the Single-Source Terminal Mincuts problem (1.5) on graphs with a total of O(nlog(nW))O(n\log(nW)) vertices and O(mlog(nW))O(m\log(nW)) edges. Outside of these calls, the algorithm takes O~(mlogW)\tilde{O}(m\log W) time plus polylog(n)logW\textup{polylog}(n)\cdot\log W calls to max-flow on O(n)O(n)-vertex, O(m)O(m)-edge graphs.

Proof.

Call Theorem A.2 with ϵ=0.01\epsilon=0.01; note that ΔW\Delta\leq W since the input graph is integer-weighted with maximum weight WW. Let λ~(s,v)\tilde{\lambda}(s,v) be the computed approximations, which satisfy 11+ϵλ(s,v)λ~(s,v)(1+ϵ)λ(s,v)\frac{1}{1+\epsilon}\lambda(s,v)\leq\tilde{\lambda}(s,v)\leq(1+\epsilon)\lambda(s,v). For each integer ii, let ViV{s}V_{i}\subseteq V\setminus\{s\} be all vertices vV{s}v\in V\setminus\{s\} with (1+ϵ)iλ~(s,v)<(1+ϵ)i+1(1+\epsilon)^{i}\leq\tilde{\lambda}(s,v)<(1+\epsilon)^{i+1}. Note that ViV_{i} is nonempty for only O(log(nW))O(\log(nW)) many integers ii, since λ~(s,v)\tilde{\lambda}(s,v) must be in the range [11+ϵ,(1+ϵ)mW][\frac{1}{1+\epsilon},(1+\epsilon)mW].

We first claim that for each ii, the terminal set Ui={s}ViU_{i}=\{s\}\cup V_{i} satisfies the promise of 1.5, namely that for all tVit\in V_{i}, we have λ(Ui)λ(s,t)1.1λ(Ui)\lambda(U_{i})\leq\lambda(s,t)\leq 1.1\lambda(U_{i}). To prove this claim, note that for each vViv\in V_{i},

(1+ϵ)i1=11+ϵ(1+ϵ)i11+ϵλ~(s,v)λ(s,v)(1+ϵ)λ~(s,v)<(1+ϵ)(1+ϵ)i+1=(1+ϵ)i+2,(1+\epsilon)^{i-1}=\frac{1}{1+\epsilon}(1+\epsilon)^{i}\leq\frac{1}{1+\epsilon}\tilde{\lambda}(s,v)\leq\lambda(s,v)\leq(1+\epsilon)\tilde{\lambda}(s,v)<(1+\epsilon)(1+\epsilon)^{i+1}=(1+\epsilon)^{i+2},

so all λ(s,v)\lambda(s,v) values are in the range [(1+ϵ)i1,(1+ϵ)i+3][(1+\epsilon)^{i-1},(1+\epsilon)^{i+3}]. Moreover, we must have λ(Ui)(1+ϵ)i1\lambda(U_{i})\geq(1+\epsilon)^{i-1} since the Steiner mincut of UiU_{i} is an (s,v)(s,v)-mincut for some vUiv\in U_{i}. It follows that λ(s,v)(1+ϵ)3λ(Ui)1.1λ(Ui)\lambda(s,v)\leq(1+\epsilon)^{3}\lambda(U_{i})\leq 1.1\lambda(U_{i}) by the choice ϵ=0.01\epsilon=0.01, concluding the claim.

Since each terminal set UiU_{i} satisfies the promise condition of 1.5, we can run an algorithm that solves 1.5 to determine the values λ(s,v)\lambda(s,v) for all vViv\in V_{i}. Since the sets ViV_{i} partition V{s}V\setminus\{s\}, we have correctly computed all values of λ(s,v)\lambda(s,v). ∎

For the remainder of this section, we reduce Gomory-Hu tree to the unconditional Single-Source Terminal Mincuts (A.1). The reduction is virtually identical to Section 4.5 of [Li21], and we include it for the sake of completeness.

Theorem A.4.

There is a randomized algorithm that outputs a Gomory-Hu tree of a weighted, undirected graph w.h.p. It makes calls to the unconditional Single-Source Terminal Mincuts problem (A.1) on graphs with a total of O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges. It also calls max-flow on graphs with a total of O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges, and runs for O~(m)\tilde{O}(m) time outside of these calls.

The precise Gomory-Hu tree algorithm that proves Theorem A.4 is described in Algorithm LABEL:ghtree a few pages down.

A.1 Additional Preliminaries

For this section, we need to formally define a generalization of Gomory-Hu trees called Gomory-Hu Steiner trees that are more amenable to our recursive structure.

Definition A.5 (Gomory-Hu Steiner tree).

Given a graph G=(V,E,w)G=(V,E,w) and a set of terminals UVU\subseteq V, the Gomory-Hu Steiner tree is a weighted tree TT on the vertices UU, together with a function f:VUf:V\to U, such that

  • For all s,tUs,t\in U, consider the minimum-weight edge (u,v)(u,v) on the unique sstt path in TT. Let UU^{\prime} be the vertices of the connected component of T(u,v)T-(u,v) containing ss. Then, the set f1(U)Vf^{-1}(U^{\prime})\subseteq V is an (s,t)(s,t)-mincut, and its value is wT(u,v)w_{T}(u,v).

In our analysis, we use the notion of a minimal mincut and a rooted minimal Gomory-Hu tree. We define these next.

Definition A.6 (Minimal (s,t)(s,t)-mincut).

A minimal (s,t)(s,t)-mincut is an (s,t)(s,t)-mincut whose side SVS\subseteq V containing ss is vertex-minimal.

Definition A.7 (Rooted minimal Gomory-Hu Steiner tree).

Given a graph G=(V,E,w)G=(V,E,w) and a set of terminals UVU\subseteq V, a rooted minimal Gomory-Hu Steiner tree is a Gomory-Hu Steiner tree on UU, rooted at some vertex rUr\in U, with the following additional property:

  • ()(*)

    For all tU{r}t\in U\setminus\{r\}, consider the minimum-weight edge (u,v)(u,v) on the unique rtr-t path in TT; if there are multiple minimum weight edges, let (u,v)(u,v) denote the one that is closest to tt. Let UU^{\prime} be the vertices of the connected component of T(u,v)T-(u,v) containing rr. Then, f1(U)Vf^{-1}(U^{\prime})\subseteq V is a minimal (r,t)(r,t)-mincut, and its value is wT(u,v)w_{T}(u,v).

The following theorem establishes the existence of a rooted minimal Gomory-Hu Steiner tree rooted at any given vertex.

Theorem A.8.

For any graph G=(V,E,w)G=(V,E,w), terminals UVU\subseteq V, and root rUr\in U, there exists a rooted minimal Gomory-Hu Steiner tree rooted at rr.

Proof.

Let ϵ>0\epsilon>0 be a small enough weight, and let GG^{\prime} be the graph GG with an additional edge (r,v)(r,v) of weight ϵ\epsilon added for each vV{r}v\in V\setminus\{r\}. (If the edge (r,v)(r,v) already exists in GG, then increase its weight by ϵ\epsilon instead.) If ϵ>0\epsilon>0 is small enough, then for all tV{r}t\in V\setminus\{r\} and SVS\subseteq V, if SS is an (r,t)(r,t)-mincut in GG^{\prime}, then SS is an (r,t)(r,t)-mincut in GG.

Let (T,f)(T^{\prime},f) be a Gomory-Hu Steiner tree for GG^{\prime}. We claim that it is essentially a minimal Gomory-Hu Steiner tree for GG, except that its edge weights need to be recomputed as mincuts in GG and not GG^{\prime}. More formally, let TT be the tree TT^{\prime} with the following edge re-weighting: for each edge (u,v)(u,v) in TT, take a connected component UU^{\prime} of T(u,v)T-(u,v) and reset the edge weight of (u,v)(u,v) to be δG(f1(U))\delta_{G}(f^{-1}(U^{\prime})) and not δG(f1(U))\delta_{G^{\prime}}(f^{-1}(U^{\prime})). We now claim that (T,f)(T,f) is a minimal Steiner Gomory-Hu tree for GG.

We first show that (T,f)(T,f) is a Gomory-Hu Steiner tree for GG. Fix s,tUs,t\in U, let (u,v)(u,v) be the minimum-weight edge on the sstt path in TT^{\prime}, and let UU^{\prime} be the vertices of the connected component of T(u,v)T^{\prime}-(u,v) containing ss. Since (T,f)(T^{\prime},f) is a Gomory-Hu Steiner tree for GG^{\prime}, we have that f1(U)f^{-1}(U^{\prime}) is an (s,t)(s,t)-mincut in GG^{\prime}. If ϵ>0\epsilon>0 is small enough, then by our argument from before, f1(U)f^{-1}(U^{\prime}) is also an (s,t)(s,t)-mincut in GG. By our edge re-weighting of TT, the edge (u,v)(u,v) has the correct weight. Moreover, (u,v)(u,v) is the minimum-weight edge on the sstt path in TT, since a smaller weight edge would contradict the fact that f1(U)f^{-1}(U^{\prime}) is an (s,t)(s,t)-mincut.

We now show the additional property ()(*) that makes (T,f)(T,f) a minimal Gomory-Hu Steiner tree. Fix tU{r}t\in U\setminus\{r\}, and let (u,v)(u,v) and UU^{\prime} be defined as in ()(*), i.e., (u,v)(u,v) is the minimum-weight edge (u,v)(u,v) on the rtr-t path that is closest to tt, and UU^{\prime} is the vertices of the connected component of T(u,v)T-(u,v) containing rr. Since (T,f)(T,f) is a Gomory-Hu Steiner tree for GG, we have that f1(U)f^{-1}(U^{\prime}) is an (r,t)(r,t)-mincut of value wT(u,v)w_{T}(u,v). Suppose for contradiction that f1(U)f^{-1}(U^{\prime}) is not a minimal (r,t)(r,t)-mincut. Then, there exists Sf1(U)S\subsetneq f^{-1}(U^{\prime}) such that SS is also an (r,t)(r,t)-mincut. By construction of GG^{\prime}, δGS=δGS+|S|ϵ\delta_{G^{\prime}}S=\delta_{G}S+|S|\epsilon and δG(f1(U))=δG(f1(U))+|f1(U)|ϵ\delta_{G^{\prime}}(f^{-1}(U^{\prime}))=\delta_{G}(f^{-1}(U^{\prime}))+|f^{-1}(U^{\prime})|\epsilon. We have δGS=δG(f1(U))\delta_{G}S=\delta_{G}(f^{-1}(U^{\prime})) and |S|<|f1(U)||S|<|f^{-1}(U^{\prime})|, so δGS<δG(f1(U))\delta_{G^{\prime}}S<\delta_{G^{\prime}}(f^{-1}(U^{\prime})). In other words, f1(U)f^{-1}(U^{\prime}) is not an (r,t)(r,t)-mincut in GG^{\prime}, contradicting the fact that (T,f)(T^{\prime},f) is a Gomory-Hu Steiner tree for GG^{\prime}. Therefore, property ()(*) is satisfied, concluding the proof. ∎

A.2 A Single Recursive Step

Before we present Algorithm LABEL:ghtree, we first consider the subprocedure LABEL:ghtreestep that it uses on each recursive step.

  1. 1.

    Initialize R0UR^{0}\leftarrow U and DD\leftarrow\emptyset

  2. 2.

    For all ii from 0 to lg|U|\lfloor\lg|U|\rfloor do:

    1. (a)

      Call the Isolating Cuts Lemma (2.1) on the singleton sets {v}\{v\} for vRiv\in R^{i}, obtaining disjoint sets SviS^{i}_{v} (the minimal (v,Riv)(v,R^{i}\setminus v)-mincut) for each vRiv\in R^{i}.

    2. (b)

      Call A.1 on graph GG and source ss.

    3. (c)

      Let DiRiD^{i}\subseteq R^{i} be the union of SviUS^{i}_{v}\cap U over all vRi{s}v\in R^{i}\setminus\{s\} satisfying δSvi=λ(s,v)\delta S^{i}_{v}=\lambda(s,v) and |SviU||U|/2|S^{i}_{v}\cap U|\leq|U|/2

    4. (d)

      Ri+1R^{i+1}\leftarrow subsample of RiR^{i} where each vertex in Ri{s}R^{i}\setminus\{s\} is sampled independently with probability 1/21/2, and ss is sampled with probability 11

  3. 3.

    Return the largest set DiD^{i} and the corresponding sets SviS^{i}_{v} over all vRi{s}v\in R^{i}\setminus\{s\} satisfying the conditions in line 2c

Algorithm 3 LABEL:ghtreestep(G=(V,E,w),s,U)(G=(V,E,w),s,U)

Let D=D0D1Dlg|U|D=D^{0}\cup D^{1}\cup\cdots\cup D^{\lfloor\lg|U|\rfloor} be the union of the sets DiD^{i} as defined in Algorithm LABEL:ghtreestep. Let DD^{*} be all vertices vU{s}v\in U\setminus\{s\} for which there exists an (s,v)(s,v)-mincut whose vv side has at most |U|/2|U|/2 vertices in UU. We now claim that DD covers a large fraction of vertices in DD^{*} in expectation.

Lemma A.9.

𝔼[|DD|]=Ω(|D|/log|U|)\mathbb{E}[|D\cap D^{*}|]=\Omega(|D^{*}|/\log|U|).

Proof.

Consider a rooted minimal Steiner Gomory-Hu tree TT of GG on terminals UU rooted at ss, which exists by Theorem A.8. For each vertex vU{s}v\in U\setminus\{s\}, let r(v)r(v) be defined as the child vertex of the lowest weight edge on the path from vv to ss in TT. If there are multiple lowest weight edges, choose the one with the maximum depth.

For each vertex vDv\in D^{*}, consider the subtree rooted at vv, define UvU_{v} to be the vertices in the subtree, and define nvn_{v} as the number of vertices in the subtree. We say that a vertex vDv\in D^{*} is active if vRiv\in R^{i} for i=lgnr(v)i=\lfloor\lg n_{r(v)}\rfloor. In addition, if Ur(v)Ri={v}U_{r(v)}\cap R^{i}=\{v\}, then we say that vv hits all of the vertices in Ur(v)U_{r(v)} (including itself); see Figure 8. In particular, in order for vv to hit any other vertex, it must be active. For completeness, we say that any vertex in UDU\setminus D^{*} is not active and does not hit any vertex.

Refer to caption
Figure 8: Let i=lgnr(v)=lg7=2i=\lfloor\lg n_{r(v)}\rfloor=\lfloor\lg 7\rfloor=2, and let the red vertices be those sampled in R2R^{2}. Vertex vv is active and hits uu because vv is the only vertex in Ur(v)U_{r(v)} that is red.

To prove that 𝔼[|D|]Ω(|D|/log|U|)\mathbb{E}[|D|]\geq\Omega(|D^{*}|/\log|U|), we will show that

  1. (a)

    each vertex uu that is hit is in DD,

  2. (b)

    the total number of pairs (u,v)(u,v) for which vDv\in D^{*} hits uu is at least c|D|c|D^{*}| in expectation for some small enough constant c>0c>0, and

  3. (c)

    each vertex uu is hit by at most lg|U|+1\lfloor\lg|U|\rfloor+1 vertices.

For (a), consider the vertex vv that hits uu. By definition, for i=lgnr(v)i=\lfloor\lg n_{r(v)}\rfloor, we have Ur(v)Ri={v}U_{r(v)}\cap R^{i}=\{v\}, so f1(Ur(v))f^{-1}(U_{r(v)}) is a (v,Ri{v})(v,R^{i}\setminus\{v\})-cut. By the definition of r(v)r(v), we have that f1(Ur(v))f^{-1}(U_{r(v)}) is a (v,s)(v,s)-mincut. On the other hand, we have that SviS^{i}_{v} is a (v,Ri{v})(v,R^{i}\setminus\{v\})-mincut, so in particular, it is a (v,s)(v,s)-cut. It follows that f1(Ur(v))f^{-1}(U_{r(v)}) and SviS^{i}_{v} are both (v,s)(v,s)-mincuts and (v,Riv)(v,R^{i}\setminus v)-mincuts, and δSvi=λ(s,v)W\delta S^{i}_{v}=\lambda(s,v)\leq W. Since TT is a minimal Gomory-Hu Steiner tree, we must have f1(Ur(v))Svif^{-1}(U_{r(v)})\subseteq S^{i}_{v}. Since SviS^{i}_{v} is the minimal (v,Ri{v})(v,R^{i}\setminus\{v\})-mincut, it is also the minimal (v,s)(v,s)-mincut, so Svif1(Ur(v))S^{i}_{v}\subseteq f^{-1}(U_{r(v)}). It follows that f1(Ur(v))=Svif^{-1}(U_{r(v)})=S^{i}_{v}. Since f1(Ur(v))f^{-1}(U_{r(v)}) is the minimal (v,s)(v,s)-mincut and vDv\in D^{*}, we must have |f1(Ur(v))U|z|f^{-1}(U_{r(v)})\cap U|\leq z, so in particular, |SviU|=|f1(Ur(v))U|z|S^{i}_{v}\cap U|=|f^{-1}(U_{r(v)})\cap U|\leq z. Therefore, the vertex vv satisfies all the conditions of line 2c. Moreover, since uUr(v)f1(Ur(v))=Sviu\in U_{r(v)}\subseteq f^{-1}(U_{r(v)})=S^{i}_{v}, vertex uu is added to DD in the set SviUS^{i}_{v}\cap U.

For (b), for i=lgnr(v)i=\lfloor\lg n_{r(v)}\rfloor, we have vRiv\in R^{i} with probability exactly 1/2i=Θ(1/nr(v))1/2^{i}=\Theta(1/n_{r(v)}), and with probability Ω(1)\Omega(1), no other vertex in Ur(v)U_{r(v)} joins RiR^{i}. Therefore, vv is active with probability Ω(1/nr(v))\Omega(1/n_{r(v)}). Conditioned on vv being active, it hits exactly nr(v)n_{r(v)} many vertices. It follows that vv hits Ω(1)\Omega(1) vertices in expectation.

For (c), since the isolating cuts SviS^{i}_{v} over vRiv\in R^{i} are disjoint for each ii, each vertex is hit at most once on each iteration ii. Since there are lg|U|+1\lfloor\lg|U|\rfloor+1 many iterations, the property follows.

Finally, we show why properties (a) to (c) imply 𝔼[|DD|]Ω(|D|/log|U|)\mathbb{E}[|D\cap D^{*}|]\geq\Omega(|D^{*}|/\log|U|). By property (b), the number of times some vertex hits another vertex is Ω(|D|)\Omega(|D^{*}|) in expectation. Since each vertex is hit at most O(log|U|)O(\log|U|) times by property (c), there are at least Ω(|D|/log|U|)\Omega(|D^{*}|/\log|U|) vertices hit in expectation, all of which are included in DD by property (a). ∎

The corollary below immediately follows. Note that the sets SviS^{i}_{v} output by the algorithm are disjoint, which we require in the recursive GH tree algorithm.

Corollary A.10.

The largest set DiD^{i} returned by LABEL:ghtreestep satisfies 𝔼[|DiD|]=Ω(|D|/log2|U|)\mathbb{E}[|D^{i}\cap D^{*}|]=\Omega(|D^{*}|/\log^{2}|U|).

A.3 The Gomory-Hu Tree Algorithm

The Gomory-Hu tree algorithm is presented in LABEL:ghtree, which uses LABEL:ghtreestep as a subprocedure on each recursive step.

Correctness.

Algorithm LABEL:ghtree has the same recursive structure as Gomory and Hu’s original algorithm, except that it computes multiple mincuts on each step. Therefore, correctness of the algorithm follows similarly to their analysis. For completeness, we include it below.

  1. 1.

    ss\leftarrow uniformly random vertex in UU

  2. 2.

    Call LABEL:ghtreestep(G,s,U)\ref{ghtreestep}(G,s,U) to obtain DiD^{i} and the sets SviS^{i}_{v} (so that Di=SviUD^{i}=\bigcup S^{i}_{v}\cap U)

  3. 3.

    For each set SviS^{i}_{v} do: \triangleright Construct recursive graphs and apply recursion

    1. (a)

      Let GvG_{v} be the graph GG with vertices VSviV\setminus S^{i}_{v} contracted to a single vertex xvx_{v} \triangleright SviS^{i}_{v} are disjoint

    2. (b)

      Let UvSviUU_{v}\leftarrow S^{i}_{v}\cap U

    3. (c)

      If |Uv|>1|U_{v}|>1, then recursively set (Tv,fv)LABEL:ghtree(Gv,Uv)(T_{v},f_{v})\leftarrow\ref{ghtree}(G_{v},U_{v})

  4. 4.

    Let GlargeG_{\textup{large}} be the graph GG with (disjoint) vertex sets SviS^{i}_{v} contracted to single vertices yvy_{v} for all vDiv\in D^{i}

  5. 5.

    Let UlargeUDiU_{\textup{large}}\leftarrow U\setminus D^{i}

  6. 6.

    If |Uv|>1|U_{v}|>1, then recursively set (Tlarge,flarge)LABEL:ghtree(Glarge,Ularge)(T_{\textup{large}},f_{\textup{large}})\leftarrow\ref{ghtree}(G_{\textup{large}},U_{\textup{large}})

  7. 7.

    Combine (Tlarge,flarge)(T_{\textup{large}},f_{\textup{large}}) and {(Tv,fv):vDi}\{(T_{v},f_{v}):v\in D^{i}\} into (T,f)(T,f) according to LABEL:combine

  8. 8.

    Return (T,f)(T,f)

Algorithm 4 LABEL:ghtree(G=(V,E,w),U)(G=(V,E,w),U)
1:Construct TT by starting with the disjoint union TlargevRiTvT_{\textup{large}}\cup\bigcup_{v\in R^{i}}T_{v} and, for each vRiv\in R^{i}, adding an edge between fv(xv)Uvf_{v}(x_{v})\in U_{v} and flarge(yv)Ulargef_{\textup{large}}(y_{v})\in U_{\textup{large}} of weight δGSvi\delta_{G}S^{i}_{v}
2:Construct f:VUf:V\to U by f(v)=flarge(v)f(v^{\prime})=f_{\textup{large}}(v^{\prime}) if vUlargev^{\prime}\in U_{\textup{large}} and f(v)=fv(v)f(v^{\prime})=f_{v}(v^{\prime}) if vUvv^{\prime}\in U_{v} for some vRiv\in R^{i}
3:return (T,f)(T,f)
Algorithm 5 LABEL:combine((Tlarge,flarge),{(Tv,fv):vRi})((T_{\textup{large}},f_{\textup{large}}),\{(T_{v},f_{v}):v\in R^{i}\})
Lemma A.11.

Algorithm LABEL:ghtree(G=(V,E,w),U)(G=(V,E,w),U) outputs a Gomory-Hu Steiner tree.

To prove Lemma A.11, we first introduce a helper lemma.

Lemma A.12.

For any distinct vertices p,qUlargep,q\in U_{\textup{large}}, we have λGlarge(p,q)=λG(p,q)\lambda_{G_{\textup{large}}}(p,q)=\lambda_{G}(p,q). The same holds with UlargeU_{\textup{large}} and GlargeG_{\textup{large}} replaced by UvU_{v} and GvG_{v} for any vDiv\in D^{i}.

Proof.

Since GlargeG_{\textup{large}} is a contraction of GG, we have λGlarge(p,q)λG(p,q)\lambda_{G_{\textup{large}}}(p,q)\geq\lambda_{G}(p,q). To show the reverse inequality, fix any (p,q)(p,q)-mincut in GG, and let SS be one side of the mincut. We show that for each vRiv\in R^{i}, either SviSS^{i}_{v}\subseteq S or SviVSS^{i}_{v}\subseteq V\setminus S. Assuming this, the cut E(S,VS)E(S,V\setminus S) stays intact when the sets SviS^{i}_{v} are contracted to form GlargeG_{\textup{large}}, so λGlarge(p,q)δS=λG(p,q)\lambda_{G_{\textup{large}}}(p,q)\leq\delta S=\lambda_{G}(p,q).

Consider any vRiv\in R^{i}, and suppose first that vSv\in S. Then, SviSS^{i}_{v}\cap S is still a (v,Riv)(v,R^{i}\setminus v)-cut, and SviSS^{i}_{v}\cup S is still a (p,q)(p,q)-cut. By the submodularity of cuts,

δGSvi+δGSδG(SviS)+δG(SviS).\delta_{G}S^{i}_{v}+\delta_{G}S\geq\delta_{G}(S^{i}_{v}\cup S)+\delta_{G}(S^{i}_{v}\cap S).

In particular, SviSS^{i}_{v}\cap S must be a minimum (v,Riv)(v,R^{i}\setminus v)-cut. Since SviS^{i}_{v} is the minimal (v,Riv)(v,R^{i}\setminus v)-mincut, it follows that SviS=SviS^{i}_{v}\cap S=S^{i}_{v}, or equivalently, SviSS^{i}_{v}\subseteq S.

Suppose now that vSv\notin S. In this case, we can swap pp and qq, and swap SS and VSV\setminus S, and repeat the above argument to get SviVSS^{i}_{v}\subseteq V\setminus S.

The argument for UvU_{v} and GvG_{v} is identical, and we skip the details. ∎

Proof (Lemma A.11)..

We apply induction on |U||U|. By induction, the recursive outputs (Tlarge,flarge)(T_{\textup{large}},f_{\textup{large}}) and (Tv,fv)(T_{v},f_{v}) are Gomory-Hu Steiner trees. By definition, this means that for all x,yUlargex,y\in U_{\textup{large}} and the minimum-weight edge (u,u)(u,u^{\prime}) on the xxyy path in TlargeT_{\textup{large}}, letting UlargeUlargeU^{\prime}_{\textup{large}}\subseteq U_{\textup{large}} be the vertices of the connected component of Tlarge(u,u)T_{\textup{large}}-(u,u^{\prime}) containing xx, we have that flarge1(Ularge)f^{-1}_{\textup{large}}(U^{\prime}_{\textup{large}}) is an (s,t)(s,t)-mincut in GlargeG_{\textup{large}} with value is wT(u,u)w_{T}(u,u^{\prime}). Define UUU^{\prime}\subseteq U as the vertices of the connected component of T(u,u)T-(u,u^{\prime}) containing xx. By construction of (T,f)(T,f) (lines 1 and 2), the set f1(U)f^{-1}(U^{\prime}) is simply flarge1(Ularge)f^{-1}_{\textup{large}}(U^{\prime}_{\textup{large}}) with the vertex xlargex_{\textup{large}} replaced by VSlargeiV\setminus S^{i}_{\textup{large}} in the case that xlargef1(U)x_{\textup{large}}\in f^{-1}(U^{\prime}). Since GlargeG_{\textup{large}} is simply GG with all vertices VSlargeiV\setminus S^{i}_{\textup{large}} contracted to xlargex_{\textup{large}}, we conclude that δGlarge(flarge1(Ularge))=δG(f1(U))\delta_{G_{\textup{large}}}(f^{-1}_{\textup{large}}(U^{\prime}_{\textup{large}}))=\delta_{G}(f^{-1}(U^{\prime})). By Lemma A.12, we have λG(x,y)=λGlarge(x,y)\lambda_{G}(x,y)=\lambda_{G_{\textup{large}}}(x,y) are equal, so δG(f1(U))\delta_{G}(f^{-1}(U^{\prime})) is an (x,y)(x,y)-mincut in GG. In other words, the Gomory-Hu Steiner tree condition for (T,f)(T,f) is satisfied for all x,yUlargex,y\in U_{\textup{large}}. A similar argument handles the case x,yUvx,y\in U_{v} for some vRiv\in R^{i}.

There are two remaining cases: xUvx\in U_{v} and yUlargey\in U_{\textup{large}}, and xUvx\in U_{v} and yUvy\in U_{v^{\prime}} for distinct v,vRiv,v^{\prime}\in R^{i}. Suppose first that xUvx\in U_{v} and yUlargey\in U_{\textup{large}}. By considering which sides vv and ss lie on the (x,y)(x,y)-mincut, we have

δGS=λ(x,y)min{λ(x,v),λ(v,s),λ(s,y)}.\delta_{G}S=\lambda(x,y)\geq\min\{\lambda(x,v),\lambda(v,s),\lambda(s,y)\}.

We now case on which of the three mincut values λ(x,y)\lambda(x,y) is greater than or equal to.

  1. 1.

    If λ(x,y)λ(v,s)\lambda(x,y)\geq\lambda(v,s), then since SviS^{i}_{v} is a (v,s)(v,s)-mincut that is also an (x,y)(x,y)-cut, we have λ(x,y)=λ(v,s)\lambda(x,y)=\lambda(v,s). By construction, the edge (fv(xv),flarge(yv))(f_{v}(x_{v}),f_{\textup{large}}(y_{v})) of weight δGSvi=δGS\delta_{G}S^{i}_{v}=\delta_{G}S is on the xyx-y path in TT. There cannot be edges on the xtx-t path in TT of smaller weight, since each edge corresponds to a (s,t)(s,t)-cut in GG of the same weight. Therefore, (fv(xv),flarge(yv))(f_{v}(x_{v}),f_{\textup{large}}(y_{v})) is the minimum-weight edge on the sstt path in TT.

  2. 2.

    Suppose now that λ(x,v)λ(x,y)<λ(v,s)\lambda(x,v)\leq\lambda(x,y)<\lambda(v,s). The minimum-weight edge ee on the xvx-v path in TvT_{v} has weight λ(x,v)\lambda(x,v). This edge ee cannot be on the vfv(xv)v-f_{v}(x_{v}) path in TvT_{v}, since otherwise, we would obtain a (v,xv)(v,x_{v})-cut of value λ(x,v)\lambda(x,v) in GvG_{v}, which becomes a (v,s)(v,s)-cut in GG after expanding the contracted vertex xvx_{v}; this contradicts our assumption that λ(x,v)<λ(v,s)\lambda(x,v)<\lambda(v,s). It follows that ee is on the xfv(xv)x-f_{v}(x_{v}) path in TvT_{v} which, by construction, is also on the xyx-y path in TT. Once again, the xyx-y path cannot contain an edge of smaller weight.

  3. 3.

    The final case λ(s,y)λ(x,y)<λ(v,s)\lambda(s,y)\leq\lambda(x,y)<\lambda(v,s) is symmetric to case 2, except we argue on TlargeT_{\textup{large}} and GlargeG_{\textup{large}} instead of TvT_{v} and GvG_{v}.

Suppose now that xUvx\in U_{v} and yUvy\in U_{v^{\prime}} for distinct v,vRiv,v^{\prime}\in R^{i}. By considering which sides v,v,sv,v^{\prime},s lie on the (x,y)(x,y)-mincut, we have

δGS=λ(x,y)min{λ(x,v),λ(v,s),λ(s,v),λ(v,y)}.\delta_{G}S=\lambda(x,y)\geq\min\{\lambda(x,v),\lambda(v,s),\lambda(s,v^{\prime}),\lambda(v^{\prime},y)\}.

We now case on which of the four mincut values λ(x,y)\lambda(x,y) is greater than or equal to.

  1. 1.

    If λ(x,y)λ(v,s)\lambda(x,y)\geq\lambda(v,s) or λ(x,y)λ(s,v)\lambda(x,y)\geq\lambda(s,v^{\prime}), then the argument is the same as case 1 above.

  2. 2.

    If λ(x,v)λ(x,y)<λ(v,s)\lambda(x,v)\leq\lambda(x,y)<\lambda(v,s) or λ(y,v)λ(x,y)<λ(v,s)\lambda(y,v^{\prime})\leq\lambda(x,y)<\lambda(v^{\prime},s), then the argument is the same as case 2 above.

This concludes all cases, and hence the proof. ∎

Running time.

We now bound the running time of LABEL:ghtree.

Lemma A.13.

W.h.p., the algorithm LABEL:ghtree has maximum recursion depth O(log3n)O(\log^{3}n).

Proof.

By construction, each recursive instance (Gv,Uv)(G_{v},U_{v}) has |Uv||U|/2|U_{v}|\leq|U|/2. We use the following lemma from [AKT20].

Lemma A.14.

Suppose the source vertex sUs\in U is chosen uniformly at random. Then, 𝔼[|D|]=Ω(|U|1)\mathbb{E}[|D^{*}|]=\Omega(|U|-1).

By Corollary A.10 and Lemma A.14, over the randomness of ss and LABEL:ghtreestep, we have

𝔼[Di]Ω(𝔼[|D|]/log2|U|)Ω((|U|1)/log2|U|),\mathbb{E}[D^{i}]\geq\Omega(\mathbb{E}[|D^{*}|]/\log^{2}|U|)\geq\Omega((|U|-1)/\log^{2}|U|),

so the recursive instance (Glarge,Ularge)(G_{\textup{large}},U_{\textup{large}}) satisfies 𝔼[|Ularge|](11/log2|U|)(|U|1)\mathbb{E}[|U_{\textup{large}}|]\leq(1-1/\log^{2}|U|)\cdot(|U|-1). Therefore, each recursive branch either has at most half the vertices in UU, or has at most a (11/log2|U|)(1-1/\log^{2}|U|) fraction in expectation. It follows that w.h.p., all branches terminate by O(log3n)O(\log^{3}n) recursive calls. ∎

Lemma A.15.

For a weighted graph G=(V,E,w)G=(V,E,w) and terminals UVU\subseteq V, LABEL:ghtree(G,V)\ref{ghtree}(G,V) takes time O~(m)\tilde{O}(m) plus calls to max-flow on instances with a total of O~(n)\tilde{O}(n) vertices and O~(m)\tilde{O}(m) edges.

Proof.

For a given recursion level, consider the instances {(Gi,Ui,Wi)}\{(G_{i},U_{i},W_{i})\} across that level. By construction, the terminals UiU_{i} partition UU. Moreover, the total number of vertices over all GiG_{i} is at most n+2(|U|1)=O(n)n+2(|U|-1)=O(n) since each branch creates 22 new vertices and there are at most |U|1|U|-1 branches.

To bound the total number of edges, define a parent vertex in an instance as a vertex resulting from either (1) contracting VSviV\setminus S^{i}_{v} in some previous recursive GvG_{v} call, or (2) contracting a component containing a parent vertex in some previous recursive call. There are at most O(logn)O(\log n) parent vertices: at most O(logn)O(\log n) can be created by (1) since each GvG_{v} call decreases |U||U| by a constant factor, and (2) cannot increase the number of parent vertices. Therefore, the total number of edges adjacent to parent vertices is at most O(logn)O(\log n) times the number of vertices. Since there are O(n)O(n) vertices in a given recursion level, the total number of edges adjacent to parent vertices is O(nlogn)O(n\log n) in this level. Next, we bound the number of edges not adjacent to a parent vertex by mm. To do so, we first show that on each instance, the total number of these edges over all recursive calls produced by this instance is at most the total number of such edges in this instance. Let PVP\subseteq V be the parent vertices; then, each GvG_{v} call has exactly |E(G[SviP])||E(G[S^{i}_{v}\setminus P])| edges not adjacent to parent vertices (in the recursive instance), and the GlargeG_{\textup{large}} call has at most |E(G[VP])vE(G[SviP])||E(G[V\setminus P])\setminus\bigcup_{v}E(G[S^{i}_{v}\setminus P])|, and these sum to |E(G[VP])||E(G[V\setminus P])|, as promised. This implies that the total number of edges not adjacent to a parent vertex at the next level is at most the total number at the previous level. Since the total number at the first level is mm, the bound follows.

Therefore, there are O(n)O(n) vertices and O~(m)\tilde{O}(m) edges in each recursion level. By Lemma A.13, there are O(ϵ1log4n)O(\epsilon^{-1}\log^{4}n) levels, for a total of O~(nϵ1)\tilde{O}(n\epsilon^{-1}) vertices and O~(mϵ1)\tilde{O}(m\epsilon^{-1}) edges. In particular, the instances to the max-flow calls have O~(nϵ1)\tilde{O}(n\epsilon^{-1}) vertices and O~(mϵ1)\tilde{O}(m\epsilon^{-1}) edges in total. ∎

Together, Lemma A.11 (correctness) and Lemma A.15 (running time) prove Theorem A.4.