Manuscript Offprint
arXiv:2611.08466Canonical Cut Hierarchy in Almost-Linear Time via Reduction to Max-Flow
Abstract
The canonical cut hierarchy recursively partitions a graph along Tutte-Nash-Williams partitions, choosing the partition with the most number of parts at each step. We give a randomized almost linear-time algorithm for computing this hierarchy in undirected graphs with polynomially bounded capacities via reduction to max-flow. This yields randomized almost linear-time algorithms for computing partition connectivity, strength, both arboricity and fractional arboricity, both integral and fractional spanning tree packing numbers, and implicit representations of the principal partition sequence and a maximum fractional spanning tree packing.
Contents
| 1 Introduction | 1 |
|---|---|
| 1.1 Previous Work | 3 |
| 1.2 Our Results | 3 |
| 1.3 Technical Overview and AI Disclosure | 4 |
| 1.4 Preliminaries | 7 |
| 2 A tree-based network and its properties | 8 |
| 2.1 Compressing the network | 9 |
| 3 Optimal partition from a respecting tree | 11 |
| 4 Finding a respecting tree | 15 |
| 4.1 Algorithm and Correctness | 18 |
| 4.2 Run-time | 22 |
| 5 Algorithm for the Lagrangian Problem | 25 |
| 6 Fast canonical cut hierarchy | 29 |
| 6.1 Properties of the Lagrangian optima | 29 |
| 6.2 Algorithm | 31 |
| 6.3 Correctness | 33 |
| 6.4 Runtime | 34 |
*University of Illinois, Urbana-Champaign, USA, Email: {karthe, harshul4}@illinois.edu. Supported in part by NSF grant CCF-2402667.
In this work, we design a fast flow-based algorithm for another fundamental graph structure, the canonical cut hierarchy. This hierarchy is obtained by recursively decomposing the graph along Tutte-Nash-Williams partitions—we will define it formally shortly. An equivalent decomposition was studied by Trubin under the name HS-decomposition [43], and the underlying decomposition also appears in Thorup's work on ideal tree packing [41,42]. The hierarchy is closely connected to the classical principal partition sequence [11,23]. We follow the canonical formulation studied by Cen, Fleischmann, Li, Li, and Panigrahi [7], by choosing the finest Tutte-Nash-Williams partition in each recursive step. The hierarchy captures strength, partition connectivity, both arboricity and fractional arboricity, both integral and fractional spanning tree packing numbers, and implicitly represents the principal partition sequence as well as a maximum fractional packing of spanning trees. Computing it efficiently, therefore, provides a common structural tool for several graph optimization problems.
We now set up the background needed to define the canonical cut hierarchy of a graph. Let be an undirected graph with vertices, edges and positive integer capacities. For a partition of the vertex set into non-empty parts, let denote the crossing edges and . The strength of is
A minimizing partition for is a Tutte-Nash-Williams partition. The partition connectivity of is . The tree packing number of is the maximum number of spanning trees, counted with multiplicity, such that each edge occurs in at most trees. The fractional tree packing number of is the maximum sum of weight of all spanning trees in an assignment of non-negative weights to spanning trees such that the total weight of the spanning trees using each edge is at most . Tutte [44] and Nash-Williams [34] showed that the tree packing number is equal to the partition connectivity, and it implies that the fractional tree packing number is equal to the strength.
The canonical cut hierarchy is a rooted tree whose root represents and whose leaves represent the vertices of . Each internal node represents the set of its descendant leaves and is labeled by the strength of , i.e., . The children of an internal node representing represent the parts of the unique finest Tutte-Nash-Williams partition of . Here, finest means that the partition has the largest number of parts among all Tutte-Nash-Williams partitions. This choice makes the hierarchy canonical [7]. Every internal node has at least two children, so there are at most nodes in the tree. Thus, the canonical cut hierarchy can be stored in -space: each node stores its children, and for an internal node , its strength . In this representation, the vertices represented by a node are its descendant leaves. See Figure 1 for an example.
In addition to strength and partition connectivity, the hierarchy encodes arboricity and fractional arboricity. Its largest internal-node label is the fractional arboricity, namely , where contains the edges within . The ceiling of fractional arboricity is known as arboricity. Nash-Williams [35] showed that arboricity is equal to the minimum number of forests whose union contains each edge exactly times.
An equivalent description connects the canonical cut hierarchy to the classical principal partition sequence.

Figure 1: A graph and its canonical cut hierarchy. (a) Edge labels are capacities. The dotted outlines mark , , and . The dashed outlines mark and . (b) Each internal node names its represented set and displays its strength . Its children form the finest Tutte–Nash–Williams partition of . The root splits into and . The set splits into and , whereas splits into and the singleton . The sets , and then split into singletons, giving four, two, and three children, respectively. Each represented set is specified implicitly by its descendant leaves, so only child pointers and strength labels need to be stored.
For a parameter , we consider the Lagrangian problem associated with strength, namely
(2)
We denote as the Lagrangian problem on for . We note that unlike strength, the Lagrangian for allows the partition to have only one part. For a fixed parameter , we say that a partition is a finest optimum for if it is a minimizer for and has the largest number of parts among all such minimizers. For each , there is a unique finest optimum partition for . The sequence , of unique finest optimum partitions for obtained as we vary from to is the principal partition sequence. It is known that the sequence has at most partitions and has a nested structure, namely parts of are obtained by splitting some of the parts of . The values where the optimum value changes are known as breakpoints. The canonical cut hierarchy is a rooted tree representation of the principal partition sequence with nodes representing parts of the partition and node labels being breakpoints. The principal partition sequence has a long history in graph, matroid, and submodular optimization [17,31,32]. Their applications include network reinforcement [14], rigidity [36], minimum -cut approximation for all positive integers [11,33,37,38], and submodular -partition [6,9]. Together with the capacities, the hierarchy determines Thorup's ideal edge loads [41,42]. After scaling by the strength of the graph, these give the edge loads of a maximum fractional spanning tree packing—see [11] for details. Thus, the hierarchy implicitly represents a maximum fractional spanning tree packing without listing its trees. For these reasons, fast computation of the sequence is a well-investigated problem in the literature [5,7,13,14,18,22,27,31,32,36,37].
The fast algorithms for global minimum cut and Gomory-Hu trees lead to a natural question: can strength be computed in almost linear-time and can the entire canonical cut hierarchy be computed just as fast? The recursive definition uses computations of strength and can repeatedly process large subgraphs. Yet, we answer both questions affirmatively: for polynomially bounded positive integer capacities, we show that strength and the canonical cut hierarchy can be computed in randomized almost linear-time. As a consequence, we can compute partition connectivity, both arboricity and fractional arboricity, both integral and fractional tree packing numbers, and implicit representations of the principal partition sequence and a maximum fractional tree packing in randomized almost linear time.
1.1 Previous Work
Approximate strength can be computed in near-linear time through approximate fractional tree packing. Approximate fractional tree packing is a key ingredient in Karger's global minimum cut algorithm [26]. Chekuri and Quanrud [10] give a deterministic -time algorithm for a -approximate maximum fractional spanning-tree packing, and hence for approximating strength. Our focus is exact computation of strength and the entire canonical cut hierarchy. Throughout, suppresses polylogarithmic factors and almost-linear time means .
Strongly polynomial-time algorithms. The equivalence with the principal partition sequence connects the canonical cut hierarchy problem to classical results. Narayanan [31] showed that principal partition sequence of a graph can be computed using maximum-flow computations. Patkar and Narayanan [36] compute a structure that is richer than the principal partition sequence structure in time. Kolmogorov [27] computes the principal partition sequence using parametric maximum-flow computations, yielding an time. For computing exact strength, Cunningham [14] initiated an algorithmic approach based on polymatroids and network flows. Gusfield [22] and Cheng and Cunningham [13] used parametric-flow techniques to compute strength in and time, respectively. Gabow [18] gave an time algorithm for computing strength using parametric-cut methods.
Weakly polynomial-time algorithms. For a fixed , Barahona [5] solved the Lagrangian problem (2) using at most maximum-flow computations. We observe that if and only if . Combining this with binary search and modern maximum-flow algorithms gives an -time algorithm to compute strength when capacities are polynomially bounded integers. Cen, Fleischmann, Li, Li, and Panigrahi [7] showed that the canonical cut hierarchy can be computed in time for polynomially bounded capacities. For comparison, our algorithm computes the canonical cut hierarchy in time for polynomially bounded capacities.
1.2 Our Results
We recall the -sized representation for the canonical cut hierarchy: Each node stores its children, and for an internal node , its strength ; the vertices represented by a node are its descendant leaves. By canonical cut hierarchy, we mean such a representation. Our main result is a randomized almost linear-time algorithm to compute the canonical cut hierarchy of a given graph with polynomially bounded capacities.
Theorem 1.1. Let be an undirected graph with vertices and edges. Let and . For every , there is a randomized algorithm that returns the canonical cut hierarchy of with probability at least . It uses maximum-flow computations, each on a network with vertices and arcs with positive integer capacities bounded by , and
additional expected arithmetic operations. If the capacities of are polynomially bounded in , then for with any fixed , the expected run-time is .
We emphasize that our theorem is a reduction to max-flow. If max-flow can be done in near-linear time then the run-time of our algorithm also improves to near-linear.
Several consequences follow directly. The root label gives the strength and its floor gives partition connectivity while the largest internal-node label gives fractional arboricity and its ceiling gives arboricity. These values can be extracted in time. We therefore obtain almost linear-time algorithms for the integral and fractional tree packing numbers and for arboricity and fractional arboricity. Almost linear-time computation of arboricity was obtained only recently [16], while the previous fastest run-time for strength, partition connectivity, and the cut hierarchy was [5, 7]. As mentioned earlier, the hierarchy is a compact representation of the principal partition sequence and specifies the edge loads of a maximum fractional spanning tree packing. Thus, we get almost linear-time algorithms for an implicit representation of the principal partition sequence and a maximum fractional spanning tree packing.
The main algorithmic ingredient of Theorem 1.1 is an almost linear-time algorithm to solve the Lagrangian problem (2) for graphs with polynomially bounded capacities as summarized in the following theorem. It is known that there exists a unique finest optimum partition to the Lagrangian problem (2) [31, 32].
Theorem 1.2. Let be an undirected graph with vertices and edges, and let , where and are integers. For every , there is a randomized algorithm that returns the unique finest partition minimizing , together with its objective value, with probability at least . The algorithm has the following run-time guarantees, where :
- The algorithm uses maximum-flow computations, each on a network with vertices and arcs, together with
additional expected arithmetic operations. The maximum-flow networks can be chosen to have positive integer capacities bounded by .
- Moreover, let and let be fixed. If , then, provided each maximum-flow computation returns an integral maximum flow, the additional expected running time is
where the exponent depends only on .
- In particular, if the capacities and the integers are polynomially bounded in , then, for with any fixed , the expected running time is .
We remark that if max-flow can be done in near-linear time, then both of our algorithms also improve to near-linear time.
1.3 Technical Overview and AI Disclosure
We first discuss our techniques to prove Theorem 1.2. Cut-respecting trees have been central to algorithms for global minimum cut. In Karger's algorithm, tree packing gives a small collection of trees such that a minimum cut crosses at most two edges of one of the trees in the collection; an efficient search over cuts with this property then recovers a minimum cut [26]. This high-level principle generalizes for several other cut minimization problems and involves designing fast algorithms for the following two steps: (1) find a tree that crosses the relevant optimum cut a small number of times and (2) recover the relevant optimum/approximate-optimum cut from such a tree. This high-level principle has found applications in several other problems—e.g., fast computation of Gomory-Hu trees [1, 3, 4, 46], -cut [8, 11, 29, 42], and directed global min-cut [16]. Our algorithm adopts the same high-level principle to solve the Lagrangian partition problem.
For ease of discussion in this technical section, we will assume that edge capacities and the numerator and denominator of are polynomially bounded, and that there exists a unique optimum partition for the Lagrangian problem (2). Throughout, a tree will refer to a spanning tree over the vertex set , and the tree need not be a subgraph of the input graph . Every tree has at least edges crossing . We say that a tree is -respecting if it has exactly such edges. Following the above-mentioned high-level principle, we show the following two results (stated informally):
(1) There exists a randomized almost-linear time algorithm that returns a -respecting tree with high probability.
(2) Given a -respecting tree , there exists a deterministic almost-linear time algorithm to find an optimum partition for the Lagrangian problem.
The above two statements immediately lead to an almost-linear time algorithm to compute an optimum partition for the Lagrangian problem. We now outline our approach to prove the above two statements. We fix a root vertex arbitrarily and retain this choice for the proofs of both statements. Both proofs rely on a network constructed relative to a fixed tree . The proof of the second statement is easier to describe and motivates the network, so we begin with this.
Recovering an optimum from a -respecting tree. We outline how to recover an optimum partition from a -respecting tree in almost-linear time. Fix and normalize the input capacities by setting . It is convenient to maximize the partition deficit
This is exactly the Lagrangian partition problem (2) after multiplying the objective by . The trivial partition containing only one part has deficit zero, so .
We construct a network that depends on the tree . The network has one unit of supply associated with each nonroot vertex and one unit of receiving capacity associated with each tree edge. There are of each. To send a unit from a vertex to a tree edge , the flow must choose a graph edge incident to such that the unique path in contains . Thus, a flow path records both a selected graph edge and a tree edge lying on its tree path. All flow paths using the same graph edge pass through a shared arc of capacity , including paths starting from either endpoint. This prevents the two end-vertices of from using the capacity of independently. See Section 2 for the full network and its compact implementation, which has near-linear size and permits an almost-linear-time maximum-flow computation [45].
The maximum flow in the network can be at most by construction. We write for the maximum-flow value in this network and for its shortfall. The network has two complementary cut properties. First, from any minimum cut we can extract a partition whose deficit is at least . The extraction uses the source-side vertex nodes and tree-edge nodes: certain components of the corresponding tree-edge forest become parts, and the remaining vertices form the part containing . The shared input-edge arcs pay for the edges crossing this partition. Consequently for every tree irrespective of whether the tree respects an optimum partition.
Second, if respects a partition , its parts are subtrees and can be encoded by a network cut of capacity . The part containing the arbitrarily chosen root plays a distinguished role in this encoding. If is optimal, this gives . The two inequalities then force , and the partition extracted from a minimum cut is optimal. Crucially, constructing the network and extracting this partition use only , and . The unknown respecting partition is needed solely to prove that the recovered partition is optimal. We formalize these details in Section 3.
Finding a -respecting tree. Next, we outline how to find a -respecting tree without knowledge of . Define the excess of a tree T by
The excess is a nonnegative integer, and it is zero exactly when respects . Given an arbitrary tree , we will design a randomized algorithm to construct an updated tree satisfying
Starting from any tree on , after such updates, the expected excess is at most . Its integrality implies that the final tree respects with probability at least .
We now explain how to construct a tree satisfying (3). We will use the max flow in the network . For ease of exposition, we focus on the case where we have a flow of value in the network here (if its value is less than , we first complete the flow through an auxiliary node; this may introduce selected edges outside , which is a mild technical complication—Section 4.1 for details). Randomized flow rounding [25] gives an integral flow while preserving the expected flow on every arc. Such an integral flow corresponds to unit paths. These unit paths would select one graph edge for each nonroot vertex and assign the selected edges bijectively to the tree edges, with each assigned tree edge lying on the unique tree-path between the end-vertices of the selected graph edge being assigned to . The shared capacity arc in the network would ensure that the expected number of selected copies of a graph edge is at most . Let be the resulting multiset of selected graph edges. The bijective assignment and path condition imply that the multigraph decomposes into two spanning trees and such a decomposition can be found in time [40]; see Lemma 4.4. Choose one of these two trees uniformly to obtain .
We now outline why (3) holds for such a randomized choice of . First, we bound how many selected copies in cross the fixed optimal partition . Let be the number of copies of graph edge selected into . Each such copy uses the shared capacity arc for . Unbiased rounding preserves its expected flow, so . Only copies of graph edges in contribute original crossings. Linearity of expectation therefore gives
For each realized , the two new trees together contain exactly the crossing copies in . The current tree has crossings, whereas contributes at most in expectation. Consequently, uniform choice of a new tree gives
Subtracting proves that the expected excess halves. We emphasize that the argument controls the crossings above the unavoidable , rather than seeking to halve the number of crossings. We formalize these details in Section 4.
Comparison to known techniques. Our work and techniques build on the recent work on showing an almost linear-time algorithm for directed global min-cut [16]. Their algorithm is also based on the high-level principle of finding a cut-respecting tree and working with such a tree to find an optimum cut. They use a network for both steps and that network informs the construction of our network, although our network is different from theirs. A distinction of our work from all previous appearances of the high-level principle is the number of relevant crossing tree edges. All previous algorithms were interested in cuts, which is a partition of the vertex set into two parts, and used trees with only a small number of edges crossing the optimum cut of interest. For the Lagrangian problem that is of interest to our work, all optimum partitions could have a large number of parts. Consequently, we cannot afford to use trees that have only a small number of edges crossing an optimum partition . In our setting, a -respecting tree has exactly edges crossing the optimum partition, and this number can grow with . Thus, our work shows the generalizability of the approach beyond a constant number of crossings.
Canonical cut hierarchy from the Lagrangian. We now explain how Theorem 1.2 implies Theorem 1.1. The principal partition sequence provides the link: at each , the optimum partition divides the hierarchy into splits that have already occurred and splits that remain to be discovered. We recover these two portions by contraction and restriction. For simplicity assume that is connected. Let . Start with interval . The finest optima to the Lagrangian problem at the end-points of this interval are the one-part and singleton partitions, respectively. A recursive call on a graph and an interval maintains these end-point optima. Find the finest optimum partition to the Lagrangian problem at the mid-point . Next, observe that the finest optimum partitions for the Lagrangian problem for values below can only merge parts of . To find these, we contract each part of to a vertex and recurse on the resulting graph over the interval . Next, observe that the finest optimum partitions for the Lagrangian problem for values above can only split parts of . To find the later splits, recurse separately on each induced graph for each over the interval . The recursion on returns a hierarchy whose leaves represent the parts of . Replace the leaf representing by the hierarchy returned for . This way, we assemble the full hierarchy without explicitly listing every partition in the sequence. We consider two base cases for the recursion: (1) If is a one-vertex graph, we return a single leaf. (2) If the interval width is less than ; integer capacities ensure that the interval contains at most one breakpoint. Since the end-point partitions for this interval differ, it contains exactly one breakpoint at which the one-part and singleton objectives agree. The resulting hierarchy is a split of into singletons with label . See Section 6 for details.
The running time follows from conservation of total graph size at each recursion depth. Every edge of appears in exactly one child problem: edges crossing go to the recursion problem on and edges within a part go to that part's induced graph. Consequently, the instances at each depth of the recursion tree have total size. Consequently, the total expected run-time at each depth is . We will reach the base case of the recursion in at most levels. Hence, the total expected run-time is almost-linear. The use of nesting and restriction-contraction principles to construct the principal partition sequence is classical [31]. We use the same principles to obtain an almost linear time algorithm via the combination of almost linear-time finest Lagrangian optimum partition computation, conservation of total instance size at each level, and a logarithmic bound on the number of levels.
AI Disclosure. This paper originated as follows: the authors had a faster algorithm for arboricity in simple unweighted graphs via new structural observations. While writing up those results, the work on directed global min-cut [16] was posted to arXiv. One of the consequences of that work is an almost linear-time algorithm to compute arboricity. The authors asked AI to use the ideas in that paper to design an almost linear-time algorithm for computing strength, which it promptly did. The authors noticed that the ideas to compute strength would generalize to compute the canonical cut hierarchy in almost linear time. The authors asked AI to complete this step as well and verified the details. We used AI to assist with writing this manuscript. We assume responsibility for all content.
1.4 Preliminaries
Let be a graph with positive rational capacities. Throughout this work, a tree refers to a spanning tree over vertex set , a partition refers to a partition of the vertex set into non-empty parts, and the Lagrangian problem on refers to the Lagrangian problem (2) on with parameter . Let be a tree over . For vertices , let be the edge set of the unique path in . Let be a partition. We denote to be the set of edges in whose end-vertices are in distinct parts of and to be the set of edges in whose end-vertices are in distinct parts of . We say that is -respecting if the tree has exactly edges crossing . We define the deficit of and the maximum deficit to be
We note that the Lagrangian problem (2) on is equivalent to finding a partition that maximizes deficit and hence, is a deficit-maximizing partition. We denote .
2 A tree-based network and its properties
Let be an undirected graph with positive rational capacities, where and . Fix an arbitrary root vertex . We construct a network that will be used both to recover an optimum Lagrangian partition from a respecting tree and to find such a tree.
Let be a tree on vertex set . The tree need not be a subgraph of , and its edges do not carry capacities. For , let denote the edge set of the unique path in . We write for the set of graph edges incident with .
Definition 2.1. The directed capacitated network has source , sink , and the following additional nodes:
-
a node for every ;
-
two nodes and for every graph edge ;
-
a node for every tree edge .
Its arcs and their capacities are as follows:
-
an arc of capacity 1, for every ;
-
an arc of capacity 1, for every ;
-
an arc of capacity , for every ;
-
an arc of capacity , for every and every ;
-
an arc of capacity , for every and every .
We call the arcs in the last item the path-incidence arcs. Let be the maximum -flow value in , and define its shortfall by
We identify an -cut with its source side , where and . Its capacity, denoted , is the sum of the capacities of the arcs leaving .

Figure 2: A portion of for a graph edge , with and .
Figure 2 illustrates the construction. The shared arc limits the total flow routed through a graph edge ; after using this arc, flow can proceed to any node with . The source cut has capacity , so
In particular, . The network is acyclic, and every feasible flow decomposes into -paths of total weight at most . Thus every arc carries at most units, and replacing all infinite capacities by preserves every feasible flow. This replacement also preserves, in both directions, every -cut of capacity at most : no such cut can cross an arc of capacity or . All algorithmic constructions below use this finite implementation.
2.1 Compressing the network
The network has nodes, but its path-incidence arcs can number . We replace these arcs by a small directed network that preserves which tree-edge nodes are reachable from each . The size bounds below are stated for ; the case has no tree edges and is immediate.
Lemma 2.1. Given an undirected graph with vertices and edges, a tree on , and a root vertex , one can construct a directed acyclic network with the following properties. It contains every node of and retains every arc other than the path-incidence arcs, with infinite capacities implemented by .
- The network has nodes and arcs and can be constructed in time. Every arc capacity belongs to
-
The maximum -flow value in is .
-
Every -cut with source side in and capacity at most restricts to an -cut with source side
of the same capacity in . Conversely, every -cut in of capacity at most extends to an -cut of the same capacity in .
- For every graph edge and every tree edge ,
Each such directed path consists of one arc from to a node of an auxiliary rooted forest, followed by zero or more arcs from forest parents to their children. Its length is .
The construction uses the following representation of tree paths. It combines a heavy-light decomposition [39] with balanced binary trees on the heavy paths. We give the full construction and query algorithm.
Lemma 2.2. Given a tree with vertices, one can construct in time a rooted binary forest and auxiliary data of total size with the following properties.
- The forest has nodes and height . Its leaves are in bijection with : for each there is exactly one leaf , and every leaf is of this form. For each node of , define
In particular, .
- For every , one can compute in time a set of nodes of such that the sets , for , are pairwise disjoint and
When u = v, the returned set is empty.
Proof. Root at an arbitrary vertex, and compute the size of the subtree rooted at each vertex . For every vertex with children, choose a child of maximum subtree size, breaking ties arbitrarily, and call its incident edge heavy; call every other parent-child edge light. If is light and is the parent of , a different child of has subtree size at least , so
Consequently, a path from the root to any vertex contains light edges. The heavy edges form vertex-disjoint paths, including single-vertex paths. The head of such a path is its vertex nearest the root. Store the parent, depth, path head, and position on its heavy path for every vertex. All these data can be computed in time.
For each heavy path with at least one edge, order its edges from its head downwards and build a balanced binary tree whose leaves, in that order, correspond to these edges. Construct this binary tree by recursively dividing the edge list into two consecutive sublists whose lengths differ by at most one, and store the first and last leaf positions at every binary-tree node. For each light edge , create a separate one-node tree consisting of the leaf . Let be the disjoint union of these binary trees. Every edge of labels exactly one leaf. A binary tree on leaves has nodes and height in this construction. Since the leaf sets partition , the forest has nodes, height , and can be built in time. We store its nodes and leaf labels; the sets are represented implicitly by the subtrees.
We next describe how to answer a query , i.e. given two vertices , we show to compute the set required by Property 2. Maintain two current vertices, initially and . While their heavy-path heads differ, select the current vertex whose head is deeper, breaking ties arbitrarily. Report the heavy-edge interval from that head to the selected vertex, if nonempty, and the light edge entering the head. Replace the selected vertex by the parent of its head. When the two current vertices lie on the same heavy path, report the interval between them, if nonempty, and stop. The chosen head is below the lowest common ancestor of the two current vertices, so every reported interval or edge lies on their connecting path. Each step removes precisely that portion of the path. Thus the reported intervals and light edges are pairwise edge-disjoint and together equal . Each iteration crosses one light edge on one of the two original paths towards their lowest common ancestor. Hence there are iterations, and the stored data allow each interval and light edge to be identified in constant time per iteration.
It remains to represent a heavy-edge interval using nodes of its binary tree in . Starting at that tree's root, discard a node if its leaf interval is disjoint from the queried interval, select it if its leaf interval is contained in the queried interval, and otherwise recurse on its children. The selected subtrees have disjoint leaf sets whose union is exactly the queried interval. At each depth, at most two nodes have leaf intervals that intersect the query without being contained in it. The search therefore visits and selects nodes and takes time. Apply this procedure to every reported heavy-edge interval, and select the singleton leaf for every reported light edge. The union of all selected nodes is . There are heavy-edge intervals and light edges, so the query takes time and returns nodes. The disjointness and covering properties follow from those of the reported path portions and the selected binary-tree subtrees.
We now prove Lemma 2.1.
Proof of Lemma 2.1. We first describe the construction, using the finite implementation of described above. Construct using Lemma 2.2. Identify each leaf with the existing node . Add the internal nodes of to the network, and direct every forest edge from parent to child. For each graph edge , compute and add the arcs
Give every forest arc and every added arc capacity . Retain all other nodes and arcs of , omitting the original path-incidence arcs. Call the resulting network .
We next verify the preservation properties. The network is acyclic: its arcs proceed from to the nodes, then to the nodes, then to the nodes, and finally down the forest to the nodes and . For every graph edge , the forest leaves reachable from are exactly the leaves below the nodes in . By Lemma 2.2, their labels are precisely the edges of . This proves the reachability equivalence in part 4. Every such directed path uses one added arc followed by a downward forest path, so its length is .
Let be the source side of an -cut in with capacity at most , and set . No added arc or forest arc leaves , since each has capacity . Thus, if , every forest leaf reachable from also belongs to . The reachability equivalence implies that no omitted path-incidence arc leaves . All remaining arcs are retained and cross the two cuts identically, with the same finite capacities. Therefore is the source side of an -cut in of the same capacity.
Conversely, let be the source side of an -cut in with capacity at most . Extend by adding every internal forest node reachable from some , and call the resulting set . Every forest leaf reached in this way already belongs to : otherwise a corresponding path-incidence arc would leave and contribute capacity . It follows that no added arc or forest arc leaves . No omitted path-incidence arc leaves , and all retained arcs cross the two cuts identically. This proves the reverse cut correspondence and hence part 3. Both networks have a source cut of capacity . Applying part 3 to a minimum cut in each network shows that their minimum-cut values agree. The max-flow/min-cut theorem now gives part 2.
Finally, we bound the construction time and network size. The retained portion of has nodes and arcs. The forest adds nodes and arcs. For each graph edge, its query and the addition of its arcs take time. Hence the compact network has nodes and arcs, and it is constructed in time. Every retained arc has capacity , for some , or , and every new arc has capacity . This proves all the claims in part 1.
3 Optimal partition from a respecting tree
Let be an undirected graph with positive rational capacities and a fixed root vertex , where and . Let be an optimum partition for the Lagrangian problem. In this section, we show that a -respecting tree can be used to find an optimum partition for the Lagrangian problem using a single max-flow computation in a network of near-linear size. The following lemma is the main result of this section.
Lemma 3.1. Given an undirected graph with vertices and edges, and a -respecting tree for some optimum partition to the Lagrangian problem on , there exists a deterministic algorithm that returns an optimal partition to the Lagrangian problem on . The algorithm has the following running-time guarantees:
-
The algorithm uses one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to , together with additional arithmetic operations.
-
Let and let be fixed. Suppose that for every , where and all are positive integers satisfying and for every . If the maximum-flow computation returns a flow whose arc values are integer multiples of , then the additional running time is
where the exponent depends only on .
We first show two intermediate lemmas that help us establish Lemma 3.1. We recall that our goal is to find and a deficit-maximizing partition. Our first lemma shows that if is a -respecting tree, then shortfall is at least the maximum deficit.
Lemma 3.2. Let be a -respecting tree for some optimum partition to the Lagrangian problem, then has an -cut of capacity . Consequently, .
Proof. Let with vertex . Since exactly tree edges cross , the induced forests together contain edges. Each contains at most edges, and

(a)

(b)
Figure 3: An example of the construction in Lemma 3.2. (a) The input graph is the path , and the chosen tree is this same path. Dotted outlines show the parts of and dashed edges are the edges crossing the partition. Edge capacities appear below the edges. Grey vertices denote and thick edges denote . (b) The corresponding cut in . Grey network vertices are precisely those belonging to , enclosed by the dashed outline. Arc labels indicate capacities, and all unlabelled network arcs have capacity . The five bold arcs are exactly those leaving . Here , and their total capacity is .
Thus, every is connected. Define
Then, . Construct the set that contains the source vertex and the following vertices:
-
all with , and all with ,
-
for every edge with an end-vertex in , and
-
for every edge with for some .
See Figure 3 for an example. We note that is an -cut in the network . We bound the capacity of next. We examine the contribution of each kind of arc to the capacity of . We have a capacity of from arcs leaving the source vertex and a capacity of from arcs entering the sink vertex. None of the infinite capacity arcs leave . Among arcs of the form , we have a capacity

Figure 4: The tree and the partition associated with a -cut as in Definition 3.1. Solid lines indicate edges of , and dashed lines indicate edges of . Grey vertices belong to , whereas white vertices lie outside . Dotted outlines enclose the connected components of . The components are wholly contained in and are retained as separate parts. Each of contains a vertex outside , so these components are merged into . Thus . We note that is disconnected.
of : if both end-vertices of belong to the same part, then both and are in and hence they do not contribute and the only contribution is from edges which have exactly one end-vertex in . Consequently,
Since is the minimum -cut capacity, and hence, .
Next, we show that a tree respecting an optimum partition allows us to recover an optimum partition using one minimum -cut computation. For a given minimum -cut in the network , we associate a partition with it as follows.
Definition 3.1. Let be the source side of an -cut in . Define
Consider the forest and let be the connected components of this forest whose vertex sets are wholly contained in , and let . The partition associated with is
See Figure 4 for an example. Let be an -cut in and let be the partition associated with as defined in Definition 3.1. The root vertex is not in . Therefore, contains and is non-empty, and . Our second lemma shows that the shortfall is at most the deficit of the partition recovered from a minimum -cut of . While Lemma 3.2 holds only if is respecting, the next lemma holds even if is not -respecting.
Lemma 3.3. Let be an arbitrary tree on , be the source side of a minimum -cut in , and be the partition associated with as in Definition 3.1. Then,
Proof. Let be as in Definition 3.1, and let be the connected components of the forest . Since each component of contains edges of , we have that
The last inequality is because, each component wholly contained in contributes one to the sum, whereas every other component contributes at most zero to the sum and in particular, the component containing the root vertex contributes zero to the sum.
Next, we lower bound the cut capacity of as a function of the partition . We recall that has a trivial -cut of capacity , hence the capacity of the minimum -cut is . Thus, no infinite-capacity arc leaves . Consider an edge . At least one end-vertex, say , belongs to a component for some , and hence . Thus, , and the infinite capacity arc forces . The end-vertices of lie in distinct components of the forest , so their tree path contains an edge . Consequently, , and the infinite capacity arc forces . Therefore, the arc , of capacity , leaves . The outgoing arcs from the source leaving contribute , and the incoming arcs to the sink leaving contribute to the capacity of . another and from these source and sink arcs. Consequently, the capacity of the -cut satisfies
where the last inequality is using . Thus, we obtain
The last inequality follows from the definition of .
We now prove Lemma 3.1. In particular, we show that if is a respecting tree for some optimal partition to the Lagrangian problem on and is a minimum -cut in , then is also an optimal partition and can be recovered in time. The run-time claimed in Lemma 3.1 is obtained by working with instead of .
Proof of Lemma 3.1. We first describe the algorithm. Construct using Lemma 2.1, implementing every infinite-capacity arc with capacity n, and compute a maximum -flow in this network. Obtain the source side of a minimum -cut by a reachability search from s in the residual network. Set
construct as in Definition 3.1, and return .
Next, we prove correctness. The arcs leaving have total capacity , so . Replacing infinite capacities by preserves the minimum cuts and their capacities: the source cut has capacity , whereas any cut crossing a replaced arc has capacity at least . By the flow-preservation property of Lemma 2.1, the computed maximum flow has value . Consequently, has capacity , and the cut-preservation property of the same lemma implies that is the source side of a minimum -cut in with capacity . By Lemmas 3.2 and 3.3,
Thus all inequalities are equalities, and is a deficit-maximizing partition and hence an optimal partition for the Lagrangian problem on G.
Finally, we prove the running-time guarantees. By Lemma 2.1, the compact network has vertices and arcs, and its construction takes arithmetic operations. The retained arcs have capacities 1, , or n, and every auxiliary arc introduced by the compact construction has capacity n. Thus every arc capacity belongs to
Constructing the residual network and performing the reachability search take a number of arithmetic operations linear in the compact network size. Restricting to the original network nodes takes time and does not require explicitly constructing . To construct , read and from , and traverse the forest to identify its components. Retain each component wholly contained in as a separate part, and merge the remaining components into , as in Definition 3.1. These steps take time. This proves the bound of one maximum-flow computation together with additional arithmetic operations.
For the second guarantee, fix and a constant . Suppose that for every , where and all are positive integers at most , and that the returned flow values are integer multiples of . Represent capacities and flow values using their integer numerators over the common denominator . The capacity numerators belong to
Since , every such numerator is at most . Feasibility bounds each flow numerator by the corresponding capacity numerator. Hence the capacity numerators, flow numerators, and numerators of residual capacities all have bits, with the implied constant depending only on . Residual capacities and their positivity can therefore be computed using arithmetic on integers of this bit length. All remaining operations manipulate graph indices and counters whose bit lengths are also . Consequently, each additional arithmetic operation can be implemented in time. Since , the total running time excluding the maximum-flow computation is
where the exponent depends only on C.
4 Finding a respecting tree
Let be an undirected graph with positive rational capacities and a fixed root vertex , where and . In this section, we show that a -respecting tree can be found using logarithmic max-flows in networks of near-linear size, where is an optimum partition for the Lagrangian problem on .
Lemma 4.1. Given an undirected graph with vertices and edges, and , there is a randomized algorithm that returns a -respecting tree with probability at least , for every fixed optimum partition to the Lagrangian problem on . For , the algorithm takes constant time and requires no maximum-flow computation. For , it has the following running-time guarantees:
- The algorithm performs iterations, each using one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to , together with
additional expected arithmetic operations per iteration.
- Let and let be fixed. Suppose that for every , where and all are positive integers at most , and suppose that . If every maximum-flow computation returns a flow whose arc values are integer multiples of , then the total expected running time excluding the maximum-flow computations is
where the exponent depends only on C.
Throughout this section, we fix an optimum partition for the Lagrangian problem on . This partition is fixed only for the purpose of the analysis and is not known to the algorithm. Let be an arbitrary tree on . We define the -excess of by
Every tree has at least edges crossing . Thus, is a nonnegative integer, and it is zero exactly when respects .
Our key ingredient to prove Lemma 4.1 is a randomized algorithm that takes an arbitrary tree and produces a tree whose -excess is at most half that of in expectation.
Lemma 4.2. Given an undirected graph with vertices and edges, and a tree on , there is a randomized algorithm that returns a tree on such that, for every fixed optimum partition to the Lagrangian problem on ,
For , the algorithm takes constant time and requires no maximum-flow computation. For , it has the following running-time guarantees:
- The algorithm uses one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to , together with
additional expected arithmetic operations.
- Let and let be fixed. Suppose that for every , where and all are positive integers satisfying and for every . If the maximum-flow computation returns a flow whose arc values are integer multiples of , then the additional expected running time is
where the exponent depends only on .
We defer the proof of Lemma 4.2 and first use it to prove Lemma 4.1.
Proof of Lemma 4.1. We first describe the algorithm. If , return the tree with no edges. Henceforth, assume that . Choose an arbitrary tree on and set
For every , apply the algorithm of Lemma 4.2 to and , using fresh randomness, to obtain a tree . Return .
Next, we prove correctness. The case is immediate, so suppose that . Fix an optimum partition to the Lagrangian problem on , independently of the algorithm's random choices. By Lemma 4.2 and the use of fresh randomness, for every ,
Taking expectations and iterating this inequality gives
Since the excess is a nonnegative integer and is zero exactly when the tree respects , Markov's inequality yields
Thus the returned tree respects with probability at least . Since was an arbitrary fixed optimum partition, this proves the claimed guarantee.
Finally, we prove the running-time guarantees. The case takes constant time and requires no maximum-flow computation. Suppose that . There are iterations. By the first guarantee of Lemma 4.2, each iteration uses one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to
together with
additional expected arithmetic operations. Summing over the iterations gives
additional expected arithmetic operations. The time to construct is absorbed by this bound.
For the second guarantee, fix and a constant . Suppose that for every , where and all are positive integers at most , that , and that every maximum-flow computation returns a flow whose arc values are integer multiples of . The graph and its capacities remain unchanged throughout the algorithm; only the tree changes. Consequently, for every realized input tree , the second guarantee of Lemma 4.2 applies with the same and . It bounds the conditional expected running time outside the maximum-flow computation in that iteration by
uniformly over the choice of . Moreover, and imply
By the law of total expectation and linearity of expectation, the total expected running time excluding the maximum-flow computations is therefore
where the exponent depends only on C.
The remainder of this section proves Lemma 4.2. We give the algorithm and prove correctness in Section 4.1, and show an efficient implementation in Section 4.2. Let be the input graph and be the input tree for both these sections. We will use the following standard randomized flow-rounding result—e.g., see Sections 3.3 and 4 of [25].
Lemma 4.3. [25] Let g be a nonnegative rational -flow of integer value on a directed network. There is a randomized algorithm that returns an integral -flow of value on the same arcs such that, for every arc ,
4.1 Algorithm and Correctness
In this section, we describe an algorithm to prove Lemma 4.2 and prove its correctness. We describe the algorithm using the network for simplicity. Efficient implementation to achieve the desired run-time will be done using the compact representation from Section 2—these implementation details will be discussed in the next subsection.
We give an outline of the algorithm now. We begin with a rational maximum flow in the network . We recall that . The flow might saturate some of the arcs leaving the source and some of the arcs entering the sink . We augment the network to by adding one dummy node , unit-capacity arcs from all vertices to the node (exactly such arcs), and unit-capacity arcs from to all vertices (exactly such arcs). We augment the flow along these newly added arcs to obtain flow in such that the value of is exactly with the amount of the flow being routed through being exactly the shortfall . Next, we use Lemma 4.3 to randomly round to obtain an integral flow in . We use the integral flow to obtain a multi-set of edges such that the multi-graph has 2 edge-disjoint spanning trees. We find two edge-disjoint spanning trees in , say and , sample uniformly at random and return it. In the rest of the section, we formalize the above-described approach and prove correctness.
Augmenting the network and the max flow. We begin with the description of the augmented network and the augmented flow.
Definition 4.1. Let be a maximum flow in with value . Let be obtained from by adding a dummy vertex , unit-capacity arcs for all , and unit-capacity arcs for all . For all , define
For all , define
For every other arc , let .
See Figure 5 for an example. We summarize the key properties of the augmented flow below.
Proposition 4.1. Let be a maximum flow in with value . Let and be as in Definition 4.1. Then, the following hold:
(i) The flow is feasible in and has value n - 1.
(ii) For all , we have that .
(iii) The total flow through h is , that is, .
Proof. For every , the additional incoming flow at is , which is exactly the flow sent on . For every , the additional outgoing flow from is , which is supplied by . At , we have

(a) Maximum flow in , of value 3/2.

(b) Completed flow in , of value 2.
Figure 5: Completing a maximum flow. Here is given by the path , and the spanning tree is the entire graph itself. Let , , , and . Arc labels give flow values, not capacities. In (a), the flow saturates both shared arcs and is therefore maximum. In (b), dashed arcs are the new unit-capacity arcs incident with . The thick path carries the additional half-unit along . Every source and sink arc then carries one unit, while all other old arc flows remain unchanged. The completed flow has value , and the flow through is .
These equalities prove conservation at and part (iii). Every new arc carries a value in , and all other capacity constraints and conservation equations remain satisfied. Every arc leaving carries one unit, so the value of the flow is , proving part (i). For every , the arc retains its original flow, proving part (ii).
Rounding the Augmented Flow. Applying Lemma 4.3 to the augmented flow gives the following guarantees.
Proposition 4.2. Let be a rational maximum flow in with value . Let and be as in Definition 4.1, and let be obtained by applying Lemma 4.3 to . Then the following hold:
-
The flow is integral and has value . Moreover, for all , we have and for all , we have .
-
For every graph edge , we have .
-
The expected total flow through satisfies .
Proof. By Proposition 4.1(i), the augmented flow has value . Lemma 4.3 preserves this value and returns an integral flow. The bounds (5a) preserve the unit values on every source and sink arc, proving part (1). The expectation guarantee (5b), together with Proposition 4.1(ii), gives part (2). Finally, linearity of expectation and (5b) give
Proposition 4.1(iii) implies that the last sum is , proving part (3).
Selecting edges from the rounded flow. We define the multiset together with a vertex and tree-edge assignments that will be used to show that contains two edge-disjoint spanning trees.
Definition 4.2. Let be a maximum flow in with value . Let and be as in Definition 4.1, and let be an integral flow obtained by applying Lemma 4.3. Decompose into unit -paths. For each , let be the unique path starting with , and let be the tree edge whose node is the last internal node of . For each , we select a tuple , where is a copy of an edge of and is an edge of , as follows:
- If avoids , it has the following form for some and some tree edge :
Let be the other end-vertex of the edge incident with , and let be a copy of . Let .
- If passes through , it has the following form for some tree edge :
Let be the end-vertex of in the component of not containing , and let be a copy of . Let . Call this copy of a dummy edge (since it need not belong to ).
Let be the multiset of the selected copies. Copies remain distinct even when their end-vertices coincide with those of another copy or an edge of .
We have the following properties about the mapping constructed in Definition 4.2.
Proposition 4.3. The construction in Definition 4.2 is well-defined and has the following properties.
(i) The assignment is a bijection from to .
(ii) For all ,
Proof. By Proposition 4.2(1), the rounded flow is integral, has value , and carries one unit on every outgoing arc from the source and incoming arc into the sink. Since is acyclic, this flow decomposes into unit -paths. Every source arc and every sink arc belongs to exactly one of these paths. Thus and are well-defined for all , and the assignment is a bijection, proving part (i).
Let . If avoids , the construction of ensures that its graph edge is incident with and that . Choosing as the other end-vertex of therefore gives . If passes through , exactly one end-vertex of lies in the component of not containing . This defines and again gives . Hence every selected copy is well-defined, and part (ii) holds.
Two-disjoint spanning trees. Next, we show that the multiset contains two disjoint spanning trees. We emphasize that the proof of this does not require to be a max flow in .
Lemma 4.4. Let be a tree on rooted at . For each , let be an edge copy, and let be the multiset of these copies. Suppose that there is a bijection from to such that for all . Then, the graph can be partitioned into two edge-disjoint spanning trees.
Proof. Orient every edge of away from . For all , orient the copy from to . Let be the resulting directed multigraph. We show that every nonempty set has at least two arcs entering it in . In the orientation of , each component of has exactly one entering arc. If has at least two components, the claim follows already from the tree arcs. Otherwise, is connected and exactly one tree arc enters . Suppose no arc from enters . Since the copy is directed into , this would imply for every . Connectivity of then gives, for all ,
The bijection would assign distinct tree edges to a set of only edges, a contradiction. Thus a second arc enters . Edmonds' arborescence packing theorem [15] now guarantees two arc-disjoint spanning arborescences rooted at and directed away from . Together they contain arcs, which is all of . Forgetting directions therefore partitions the edge copies of into two spanning trees, as required.
We now state the algorithm and prove its correctness. See Algorithm 1 for the pseudocode.
Algorithm 1 HALVEEXCESS()
Input: A graph , a tree on with , and a root .
Output: A tree satisfying (4) for every fixed optimum partition .
-
Compute a rational maximum -flow in .
-
Construct and as in Definition 4.1.
-
Apply Lemma 4.3 to to obtain a randomized integral flow in .
-
Decompose into unit paths and construct as in Definition 4.2.
-
Partition the multiset into two spanning trees , (which exists via Proposition 4.3 and Lemma 4.4).
-
Choose uniformly at random and return .
Correctness. We now prove the excess-halving guarantee of Algorithm 1. This argument will use the fact that is a maximum flow in . We recall that for every vertex partition , and .
Lemma 4.5. Algorithm 1 returns a tree on . Moreover, for every fixed optimum partition of the Lagrangian problem on , we have that .
Proof. Proposition 4.3 ensures that the multiset as constructed in Definition 4.2 is well-defined. Part (i) gives the bijection , and part (ii) gives the path condition (6). Lemma 4.4 therefore guarantees that the algorithm returns a tree. We next bound its expected excess.
Fix a maximum flow chosen by the algorithm. Let be obtained from as in Definition 4.1 and let be obtained from by applying Lemma 4.3. For every , let be the number of copies of e selected in by paths avoiding . Each such path traverses exactly once. Thus, for all , Proposition 4.2(2) gives
Let be the number of dummy edges selected. Each path through uses exactly one arc . Hence Proposition 4.2(3) gives
By Definition 4.2, an edge-copy selected by a path avoiding crosses only if its graph edge belongs to . Hence,
The last inequality above is by Lemma 3.3.
For every realized , the two trees partition . Consequently, their total number of crossings of equals . Uniformly choosing a tree and using (7) gives
□
4.2 Run-time
We implement Algorithm 1 using the compact network from Section 2. The following lemma gives the required implementation and its run-time.
Lemma 4.6. Suppose . Algorithm 1 can be implemented with the following running-time guarantees:
- The algorithm uses one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to , together with
additional expected arithmetic operations.
- Let and let be fixed. Suppose that for every , where and all are positive integers satisfying and for every . If the maximum-flow computation returns a flow whose arc values are integer multiples of , then the additional expected running time is
where the exponent depends only on .
Proof. We first describe the implementation. Construct using Lemma 2.1, implementing every infinite-capacity arc with capacity , and compute a rational maximum -flow in this network. We define the augmented compact network and its flow explicitly. Let be obtained from by adding a dummy node , unit-capacity arcs for all , and unit-capacity arcs for all . For every , define
For every , define
On every other arc, retain the value of . Apply Lemma 4.3 to to obtain an integer-valued flow on the same arcs satisfying the lemma's rounding guarantees, and decompose it into unit -paths.
Select edge copies as in Definition 4.2, with the following interpretation of paths in the compact network. For every , let be the path starting with , and let be its last internal node. If avoids , read its arc , let be the other end-vertex of the graph edge incident with , and select a copy of . If passes through , let be the end-vertex of in the component of not containing , and select a dummy copy . Let be the multiset of the selected copies, retaining the assignment . Find two edge-disjoint spanning trees in , choose one uniformly at random, and return it.
We next prove correctness. The source cut has capacity , whereas any cut crossing an arc whose infinite capacity was replaced by has capacity at least . Thus this replacement preserves the minimum cuts and their capacities. By the flow-preservation property of Lemma 2.1, the value of is . The same conservation calculation as in the proof of Proposition 4.1 shows that is feasible in and has value . Moreover,
and
Consequently, the proof of Proposition 4.2 applies to this augmented compact flow as well: the rounded flow has value , every source and sink arc carries one unit, each graph edge arc has expected flow at most , and the expected total flow through is . The augmented compact network is acyclic, so the rounded flow decomposes into unit -paths, and is a bijection. For a path avoiding , the segment from to runs through the auxiliary forest. By the reachability property of Lemma 2.1,
For a path through , the same condition follows from the choice of . These are the two properties in Proposition 4.3, so Lemma 4.4 guarantees the required two edge-disjoint spanning trees.
For every , let be the number of copies of selected by paths avoiding , and let be the number of dummy copies. Each selected graph edge copy corresponds to one unit of flow through its graph edge arc, and each dummy copy corresponds to one unit of flow through . The rounding guarantees therefore give
These are precisely the estimates used in (7). Since has maximum-flow value , Lemma 3.3 gives . The averaging argument in the proof of Lemma 4.5 therefore proves the same excess-halving guarantee for the compact implementation.
Finally, we analyze the running time. By Lemma 2.1, constructing takes arithmetic operations. Its retained arcs have capacities 1, , or , and every auxiliary arc has capacity . Thus the single maximum-flow computation uses a network whose arc capacities belong to
Adding the dummy node and arcs and completing the flow takes additional arithmetic operations. Let and be the numbers of vertices and arcs in the augmented compact network. Then and . To implement Lemma 4.3, add a return arc carrying units and apply the unbiased circulation-rounding algorithm of Kang and Payor [25, Sections 3.3 and 4], using the initial floor and ceiling of each arc flow as its rounding bounds. It takes expected arithmetic operations. The return arc retains its integer value by (5a); removing it gives .
Every -path avoiding has arcs by Lemma 2.1, and every path through has constant length. For every , start with , follow arcs with positive remaining integral flow until reaching , and subtract one unit along the resulting path. Conservation and acyclicity ensure that this procedure reaches . Maintain adjacency-list pointers that skip arcs once their remaining flow becomes zero. Each arc is skipped at most once, and the extracted paths have total length , so the decomposition takes arithmetic operations. For a path avoiding , read and directly from the path. For a dummy path, find in constant time after preprocessing of : root at and record the depth-first entry and exit times of each vertex. If joins a parent to a child , choose when belongs to the subtree rooted at , and choose otherwise. Hence constructing and its assignments requires no additional asymptotic work.
Construct the orientation from the proof of Lemma 4.4 in time. It has vertices and arcs. Tarjan's algorithm [40] finds two arc-disjoint spanning arborescences rooted at and directed away from in time, where is an inverse-Ackermann function. Forgetting their orientations gives the two required spanning trees. Selecting and returning one takes time. Consequently, the total work beyond the one maximum-flow computation is
expected arithmetic operations, proving the first guarantee.
For the second guarantee, fix and a constant . Suppose that for every , where and all are positive integers at most , and that the returned maximum flow has arc values in . Represent capacities and flow values using their integer numerators over the common denominator . The capacity numerators belong to
so they are at most . The completion formulas preserve membership in , as does adding the return arc. Since the augmented compact network is acyclic and its flow has value , every arc flow before adding the return arc lies between 0 and . The return arc also carries units. Thus every initial flow numerator is at most .
During cycle-cancelling rounding, each update amount is a minimum of distances from current arc flows to their fixed integer rounding bounds. Inductively, all update amounts and all updated flow values remain in . The flows remain between their initial floors and ceilings, and therefore remain between 0 and . Their numerators over consequently have bits, with the implied constant depending only on . The availabilities have numerators at most . The dynamic-tree implementation maintains these quantities using comparisons, minima, and additions or subtractions of update amounts. Its stored numerical quantities can be represented with numerators of magnitude polynomial in , and . Since and are polynomially bounded in , these quantities also have bits.
It remains to account for the random choices in rounding. If the available update amounts in the two directions of a fractional cycle are and , then the forward direction is chosen with probability
Here and are positive integers at most . Sample an integer uniformly from and choose the forward direction exactly when the sampled integer is at most . Rejection sampling with independent unbiased bits implements this choice exactly. Each trial uses bits and succeeds with probability at least , so each choice takes expected time. The final uniform choice between the two spanning trees requires one unbiased bit.
All remaining steps manipulate flow numerators of bits, graph indices, and counters whose magnitudes are polynomial in S. Thus each arithmetic operation and each random choice has expected cost. Combining this with the first guarantee, the total expected running time excluding the maximum-flow computation is
where the exponent depends only on C.
We now complete the proof of Lemma 4.2.
Proof of Lemma 4.2. We first describe the algorithm. For , return the tree with no edges. For , run Algorithm 1 using the compact-network implementation of Lemma 4.6.
Next, we prove correctness. For , the excess is zero. For , Lemma 4.6 provides an implementation of Algorithm 1, so Lemma 4.5 implies that the returned tree satisfies (4) for every fixed optimum partition .
Finally, we prove the running-time guarantees. The case takes constant time and requires no maximum-flow computation. Suppose that . By the first guarantee of Lemma 4.6, the implementation uses one maximum-flow computation on a network with vertices and arcs, where every arc capacity belongs to
together with
additional expected arithmetic operations. For the second guarantee, fix and a constant . Suppose that for every , where and all are positive integers at most , and that the maximum-flow computation returns a flow whose arc values are integer multiples of . The second guarantee of Lemma 4.6 then applies with the same and , giving
expected time excluding the maximum-flow computation, where the exponent depends only on C.
5 Algorithm for the Lagrangian Problem
In this section, we prove that the Lagrangian problem (2) can be solved in almost linear-time and use it to prove Theorem 1.2. Combining Lemma 4.1 with Lemma 3.1 gives the following result.
Lemma 5.1. Given an undirected graph with vertices, edges, and positive integer capacities, a rational , and , there exists a randomized algorithm that returns a partition minimizing , together with its objective value, with probability at least . The algorithm has the following running-time guarantees:
-
If or , the algorithm returns with objective value zero deterministically in time and requires no maximum-flow computation.
-
If and , the algorithm uses maximum-flow computations, each on a network with vertices and arcs, where every arc capacity belongs to , together with
additional expected arithmetic operations.
- Suppose that and , where are positive integers. Let and let be fixed. Suppose that for every , and that , and are at most . If every maximum-flow computation returns a flow whose arc values are integer multiples of , then the additional expected running time is
where the exponent depends only on .
Proof. We first describe the algorithm. If or , return the partition with objective value zero. Otherwise, construct by setting for every . Apply Lemma 4.1 to with failure parameter to obtain a tree . Run the recovery algorithm of Lemma 3.1 on and to obtain a partition . Compute by scanning the graph edges, and return and this objective value.
Next, we prove correctness. If , there is only one partition, and its objective value is zero. If , every partition has nonnegative objective value, and has value zero. Now suppose that and . For every partition ,
Since , the optimum partitions for and coincide. Fix an optimum partition for independently of the algorithm's random choices; this partition is used only for the analysis. By Lemma 4.1, the tree respects with probability at least . On this event, Lemma 3.1 guarantees that the recovered partition is optimal for and hence for . The final scan computes its objective value exactly, establishing the claimed success probability.
Finally, we prove the running-time guarantees. If or , explicitly outputting the partition takes time, and no maximum-flow computation is needed. Suppose that and . Normalizing the capacities takes arithmetic operations. By Lemma 4.1, finding uses maximum-flow computations. The recovery algorithm of Lemma 3.1 uses one additional maximum-flow computation. Its construction and running-time analysis apply to every tree ; the respecting property is needed only to guarantee optimality of the recovered partition. Each maximum-flow network has vertices and arcs, with every arc capacity belonging to
Assigning a part label to each vertex and scanning the graph edges to evaluate takes additional arithmetic operations. Combining these costs with the additional-operation bounds in the two lemmas gives
additional expected arithmetic operations, proving the second guarantee.
For the third guarantee, fix and a constant . Suppose that , where all capacities and the positive integers are at most , that , and that every maximum-flow computation returns arc values in . For every ,
Thus the normalized capacities have common denominator , with and for every . Consequently, the second guarantees of Lemmas 4.1 and 3.1 apply with the same size parameter and exponent . They bound the total expected running time of tree finding and partition recovery, excluding maximum-flow computations, by
where the exponent depends only on .
Normalizing the capacities also obeys this bound: the integers , , and have bits. For objective evaluation, use
Since , every integer involved in this computation has bits, with the implied constant depending only on . Thus normalization and objective evaluation together take time. The total expected running time excluding maximum-flow computations is therefore
as claimed.
In order to prove Theorem 1.2, it remains to show that the unique finest optimum to the Lagrangian can be obtained in almost-linear time. Let be the input graph with positive integer capacities. We recall that at every , there exists a unique finest optimal partition to the Lagrangian problem [31,32]. We show that a small perturbation of makes the optimum to the Lagrangian unique and recovers the finest partition.
Lemma 5.2. Let , where and are integers, and define
The Lagrangian problem at has a unique optimum partition and it is the finest optimum partition for the Lagrangian problem at .
Proof. Let and be two partitions of such that . Since the capacities are integral and , every objective value at is an integer multiple of . Consequently,
By the definition of , for every partition ,
Since the numbers of parts of two partitions differ by at most n - 1, we obtain
Thus every partition that is not optimal at remains strictly worse at than every partition that is optimal at . In particular, every optimum partition at is also an optimum partition at .
Now let and be optimum partitions at . Their objective values at are equal, so
Hence, among optimum partitions at , the objective at is minimized exactly by those with the greatest number of parts. It is known that there is a unique optimum partition with the greatest number of parts [31, 32]. Together with the preceding paragraph, this shows that it is the unique optimum partition at .
Lemmas 5.1 and 5.2 now complete the proof of Theorem 1.2.
Proof of Theorem 1.2. We first describe the algorithm. If , return the partition with objective value zero. Henceforth, assume that . Write , where and are integers, and set
Apply the algorithm of Lemma 5.1 to with parameter and error probability , obtaining a partition . Compute by scanning the graph edges, and return together with this value.
Next, we prove correctness. By Lemma 5.1, with probability at least , the returned partition is optimal at . By Lemma 5.2, the optimum at is unique and is the finest optimum at . Thus, with probability at least , the algorithm returns the required partition and its objective value at the original parameter .
Finally, we analyze the run-time. Since , Lemma 5.1 gives maximum-flow computations, each on a network with vertices and arcs, together with
additional expected arithmetic operations. Forming requires a constant number of arithmetic operations, and evaluating requires additional operations. These costs are absorbed by the stated bound.
Now suppose that the capacities and the integers are polynomially bounded in , and that for a fixed . Let . By the capacity guarantee in Lemma 5.1, every maximum-flow network used at parameter has arc capacities in
Multiplying all arc capacities by produces integer capacities in
all polynomially bounded in . We compute an integral maximum flow in the scaled network using [45] and divide its arc values by . This yields a maximum flow in the original network whose arc values are integer multiples of . Scaling, solving, and rescaling each instance takes time. Using the representation , the additional-running-time guarantee in Lemma 5.1 applies: both and are polynomially bounded, and every returned maximum flow has arc values that are integer multiples of . Consequently, all work outside the maximum-flow computations takes expected time. Evaluating the returned partition at the original parameter also takes time. Since there are maximum-flow computations, the total expected running time is .
6 Fast canonical cut hierarchy
In this section, we prove Theorem 1.1 using Theorem 1.2. We recall the definition of the canonical cut hierarchy. For a connected graph , its root represents . An internal node representing is labelled by , and its children represent the parts of the finest Tutte–Nash–Williams partition of . Singletons are leaves. For a disconnected graph, the hierarchies of its connected components are attached to a root labelled zero. We store child pointers and labels so the set represented by a node is specified implicitly by its descendant leaves.
Throughout this section, capacities are positive integers. For a graph and , let denote the unique finest partition minimizing , and let denote its singleton partition. Theorem 1.2 provides the algorithm for computing .
In Section 6.1, we recall the classical properties of Lagrangian optima that will be central to our algorithm. In Section 6.2, we describe the algorithm. We prove correctness in Section 6.3 and bound runtime in Section 6.4.
6.1 Properties of the Lagrangian optima
Let be an undirected graph. For a partition of , let be obtained by contracting each part to a vertex and deleting loops. We retain parallel edges with their original capacities and identify each contracted vertex with the part it represents. For a partition of , we define its lift to by
It is known that as the parameter increases, the finest optimum only splits its parts. We summarise this in the lemma below. This lemma is standard—e.g., see [32,38]. We include a proof for completeness.
Lemma 6.1. Let be an undirected graph. The following properties hold.
-
For every , the partition refines .
-
For every and every , the induced graph is connected.
-
For a fixed , let . Then,
In particular,
Proof. For classical submodular formulations of nesting and restriction–contraction, see Narayanan [32, Theorem 12.3.1, pp. 636–637, and Section 12.6, pp. 665–668]. We give a direct proof for the graph objective, including the boundary values of the parameter.
For part (1), let and . Write for their common refinement into nonempty part intersections, and for their finest common coarsening. The crossing edges of the common refinement are the union of the two crossing-edge sets, whereas those of the common coarsening are contained in their intersection. Hence,
Also,
To see this, form a bipartite graph with one vertex for each part of and of , and one edge for each nonempty intersection. Its edges correspond to the parts of , and its connected components correspond to the parts of . A connected component with vertices has at least edges, which gives the inequality. Since and , these inequalities imply
Optimality of and gives the reverse inequality, so equality holds and is optimal at . Because is the finest optimum, this refinement must equal . Thus refines .
For part (2), suppose that a part induces connected components. Replacing by those components leaves the crossing capacity unchanged and increases the number of parts by . For , this strictly decreases the objective, contradicting optimality. For , it produces a strictly finer optimum, contradicting fineness. Thus every part induces a connected graph. In particular, is the connected-component partition: it has objective zero, and positive capacities imply that every zero-cost partition is a coarsening of that partition.
For the contraction identity in part (3), fix . By part (1), coarsens . Lifting gives a bijection between partitions of and coarsenings of , and for every such partition ,
Consequently, the two minimum values coincide. The partition is available among the lifted partitions and refines every optimum there. Since lifting preserves refinement, it is the lift of the finest optimum of .
For the restriction identity, fix . Part (1) implies that refines . Every refinement has the form , where is a partition of , and its objective satisfies
The first term is fixed, so minimizing over refinements amounts to minimizing each summand independently. Since a global finest optimum is among these refinements, it is the union of the finest optima of the induced graphs. At , the contraction identity lifts to , so the contracted finest optimum is the singleton partition. The restriction identity at yields itself, so the finest optimum within each part is . This proves all the assertions.
The next lemma shows that an optimum partition separates the canonical cut hierarchy into the hierarchy between its parts and the hierarchies within them.
Lemma 6.2. Let be a connected undirected graph. Let and . The canonical cut hierarchy of is obtained from that of by replacing each leaf representing with the canonical cut hierarchy of .
Proof. We first relate the hierarchy of a connected graph to its finest optimum partitions. If , the definition of strength implies that is the unique optimum for . At , the nontrivial optimum partitions are exactly the Tutte–Nash–Williams partitions. Thus is the finest such partition and gives the children of the root. For every nonsingleton child , Lemma 6.1(3) gives
This forces , because at and above its strength the finest optimum of a connected graph with at least two vertices is nontrivial. Therefore labels strictly increase along every path of internal nodes from the root towards a leaf.
For any , the hierarchy recovers by expanding every internal node whose label is at most and retaining the resulting unexpanded nodes as parts. Indeed, below the root label the optimum is the one-part partition, and at or above it Lemma 6.1(3) reduces the optimum to the induced graphs on the children. Induction proves the rule. Conversely, these partitions for all determine the hierarchy: the first nontrivial partition determines the root label and its children, and the same argument applies recursively within each child.
Now is connected, and every is connected by Lemma 6.1(2). By part (3) of that lemma, the finest optimum of at is its singleton partition. Thus every internal-node label in its hierarchy is at most . For every nonsingleton , the same lemma gives , so the root label of its hierarchy, and hence all its internal-node labels, exceed . After the stated replacements, the partitions obtained by the expansion rule are therefore
and
Lemma 6.1(3) identifies both with . The hierarchy is consequently the canonical cut hierarchy of , with all labels preserved. The assertion also covers a one-vertex contracted graph: replacing its sole leaf simply returns the hierarchy inserted there.
The next lemma provides a stopping criterion for our recursive construction. It shows that if the transition from the one-part partition to the singleton partition occurs within a sufficiently narrow parameter interval, then the canonical cut hierarchy consists of a single split.
Lemma 6.3. Let be a connected undirected graph with , where . Suppose that satisfy , and . If , then the canonical cut hierarchy of is a root with one leaf child per vertex, and its root label is
Proof. Every internal node representing a set is labelled by . If its finest Tutte–Nash–Williams partition has parts, then this label has the form for an integer , with . Two distinct such labels and therefore satisfy
The assumption implies . Labels strictly increase along paths of internal nodes, as shown in the proof of Lemma 6.2. Also, the expansion rule proved there and the equality imply that every internal-node label is at most . Thus all internal-node labels lie in . The width assumption and the preceding separation bound imply that all these labels are equal. Strict increase along paths now rules out any internal node other than the root. The root's children are therefore the singleton vertices. Since this singleton partition is a Tutte–Nash–Williams partition of , the root label is , as claimed.
6.2 Algorithm
Let be the input graph with vertices and let be the desired failure probability. If , return its single leaf. We henceforth assume that . Initially, find the connected components of and call the algorithm to be described below on with interval for each component. If is connected, return the hierarchy from its only call. Otherwise, attach the returned hierarchies to a new root labelled zero and return it. If any recursive call reports failure, the entire algorithm reports failure. Let
We will construct the canonical cut hierarchy recursively and the above parameters do not change across recursive calls. All calls to the algorithm of Theorem 1.2 use failure probability and fresh randomness. Each recursive call takes as input a connected graph and a parameter interval for some rational values satisfying
For such an input, we describe the recursive construction. We first describe the two base cases of the recursion: (1) if has only one vertex, then we return its only vertex as the leaf. (2) if , then we return a root labeled by with one leaf child for each vertex of . Next, we describe the recursive cases. Let be the mid-point of the interval. We compute the unique finest optimal partition to the Lagrangian problem on for . Next, we recurse on the graph with the interval to obtain the canonical cut hierarchy of . Next, for each part , we recurse on the graph with the interval to obtain the canonical cut hierarchy of the graph and we replace the leaf representing in the hierarchy by the hierarchy . We return the constructed canonical cut hierarchy . See Algorithm 2 for a pseudocode.
Algorithm 2 BUILDHIERARCHY()
Input: A connected graph and an interval satisfying (8).
Output: The canonical cut hierarchy of , or failure.
-
If , return a leaf representing the only vertex of .
-
If , then return a root labelled with one leaf child for each vertex of .
-
.
-
Call the algorithm of Theorem 1.2, with fresh randomness and failure probability , to compute . If the returned object is not a partition of , report failure.
-
Construct and for every . If some is disconnected, report failure.
-
-
For each ,
(a) .
(b) Replace the leaf representing in by the hierarchy .
- Return .
Each vertex of a recursive graph is stored as an atomic identifier; the set of original vertices it represents is not expanded. The returned hierarchy stores a pointer to the leaf corresponding to each vertex of that recursive graph. Replacing a leaf therefore takes constant time, apart from computing the hierarchy that replaces it. If the leaf is the whole hierarchy, replace its root pointer; no extra node is introduced.
6.3 Correctness
In this section, we prove the correctness of the algorithm.
Lemma 6.4. Suppose the graph on input interval satisfies (8). If each call to the algorithm of Theorem 1.2 returns a finest optimum partition to the Lagrangian problem on for parameter , then Algorithm 2 terminates, every recursive call satisfies (8), and the algorithm returns the canonical cut hierarchy of .
Proof. Consider an input to Algorithm 2 satisfying (8), and suppose that all calls to the algorithm of Theorem 1.2 return the finest optimum partition for their respective input graph and parameter. We first show that the invariant is preserved. In a nonterminal call, the partition returned at is . The contraction identity in Lemma 6.1(3), applied at and , gives
The restriction identity in the same lemma gives, for every ,
For the last equality, the union of the finest optima of the induced graphs equals , so each of those optima must be its singleton partition. Thus every child call satisfies the invariant. The contracted graph is connected because is connected, and every is connected by Lemma 6.1(2). The returned partition is valid, so neither check in the algorithm reports failure. Induction proves that every recursive input is valid and satisfies the invariant.
Next, we prove termination. Write for the width of the interval in the initial call under consideration. If , this call is a base case. Otherwise, an interval at depth below this call has width . Since , this width becomes less than after finitely many halvings. Every branch therefore has bounded depth. Each call has finitely many children, so the entire recursion terminates.
Finally, we prove correctness by induction on the height of the recursion below a call. If , the returned leaf is the canonical cut hierarchy of . If and , the invariant and Lemma 6.3 show that the returned star, including its root label, is correct. In the remaining case, the induction hypothesis implies that the recursive calls return the canonical cut hierarchies of and of for every . By Lemma 6.2, replacing each leaf representing in the former hierarchy by the latter hierarchy gives the canonical cut hierarchy of . This is exactly the hierarchy returned by Algorithm 2.
Corollary 6.1. Suppose that every call to the algorithm of Theorem 1.2 returns the finest optimum partition for its input graph and parameter. Then the algorithm described in Section 6.2 returns the canonical cut hierarchy of .
Proof. If , the algorithm returns the only vertex as a leaf, which is the required hierarchy. Assume henceforth that . Let be a connected component of , and put . We verify that the initial call BUILDHIERARCHY satisfies (8). Since is connected and its capacities are positive, . If , its only partition also equals , so the other equality is immediate. Otherwise, let and consider any partition of . Since and
, we have
Consequently, is the unique optimum at , proving the invariant for this initial call.
By the hypothesis and Lemma 6.4, the call on each component terminates and returns its canonical cut hierarchy. If is connected, the algorithm returns this hierarchy. If is disconnected, it attaches the roots of the component hierarchies to a new root labelled zero. By the definition of the canonical cut hierarchy of a disconnected graph, the resulting hierarchy is exactly the canonical cut hierarchy of .
6.4 Runtime
In this section, we bound the runtime of the algorithm and prove Theorem 1.1. Let , where is the number of edges and is the number of vertices in the input graph . For a recursive input graph , let and . The following lemma bounds the total graph size and the number of calls to the algorithm of Theorem 1.2 at a fixed recursion depth.
Lemma 6.5. At any fixed recursion depth, let be the collection of recursive calls whose graphs have at least two vertices. Then
In particular, there are at most such calls per depth and at most calls in total to the algorithm of Theorem 1.2. These bounds hold even if some of the returned partitions are not optimal.
Proof. Consider a nonterminal call on that returns a partition with parts. Each graph edge belongs to exactly one child graph: a crossing edge belongs to , and an edge within a part belongs to . Because parallel edges are retained, we have
The corresponding identity for vertices is
For the initial connected-component calls, the edge counts sum to , and the quantities sum to at most . Discarding singleton graphs, terminal calls, or calls after a reported failure can only decrease these sums. Induction on the depth proves the first two inequalities. Every graph in contributes at least one to the second sum, so , and
Independently of which partitions are returned, every recursive interval is obtained by halving its parent's interval. Only depths can contain calls to the algorithm of Theorem 1.2. There are at most such calls at each depth, proving the total bound. None of these arguments requires optimality of the returned partitions.
We now prove Theorem 1.1.
Proof of Theorem 1.1. Run the algorithm of Section 6.2. For , it returns the only leaf in constant time; assume henceforth that . Conditional on the history preceding any call to the algorithm of Theorem 1.2, fresh randomness gives failure probability at most . Lemma 6.5 bounds the number of such calls, on every execution, by . A union bound on the first incorrect returned partition gives
On the complementary event, Lemma 6.4 proves that the returned hierarchy is correct.
We next bound the additional arithmetic operations. Set . For a call on with , Theorem 1.2(1) uses maximum-flow computations and
additional expected arithmetic operations, since . Lemma 6.5 bounds by at each depth. Summing over the depths that can contain these calls gives
Constructing the contracted and induced graphs requires one scan of the vertices and edges of each parent graph. The partition and connectivity checks, evaluation of the base-case labels, and leaf replacements also take operations per nontrivial call. Creating and returning singleton calls is charged to their parent's vertex count; initial singleton components take time in total. All this work is , including the terminal depth, and is absorbed by the claimed bound. The output has leaves and at least two children at every internal node, so it has at most nodes.
To obtain the claimed number of maximum-flow computations, process the recursion one depth at a time. At a fixed depth, advance each call to the algorithm of Theorem 1.2 until its next required maximum-flow computation. Form the disjoint union of the resulting networks, identifying their sources with a common source and their sinks with a common sink. The maximum-flow value in this combined network is the sum of the individual maximum-flow values: feasible flows combine, and a flow in the combined network restricts to a feasible flow in each constituent network. Consequently, an integral maximum flow in the combined network restricts to an integral maximum flow in every constituent network. Return these restrictions to the corresponding computations and continue in this way. Each call requires at most maximum-flow computations, so there are at most combined computations per depth, and in total. Theorem 1.2(1) and Lemma 6.5 imply that every combined network has vertices and arcs. Constructing these networks and distributing the resulting flows take linear work in their sizes, already covered by the additional-operation bound. A completed call simply does not participate in subsequent computations. Processing calls by depth changes only their order; the recursive outputs are combined as in Algorithm 2.
We now bound the capacities using only Theorem 1.2(1). Every midpoint queried at a depth less than has a representation with positive integers satisfying , and . Moreover, . Every edge of a recursive graph retains an original capacity, so its maximum capacity is at most . Each call with at least two vertices has a connected graph, and hence has an edge; thus is well-defined. Theorem 1.2(1) supplies integer-capacity networks with capacities bounded by
Identifying sources and sinks does not change any capacity; we retain parallel arcs separately. This proves the integer-capacity guarantee for the combined networks.
Finally, suppose the original capacities are polynomially bounded in and for a fixed . Then is polynomially bounded in , , and . The preceding parameter bounds show that are polynomially bounded in for every recursive call. Also,
is polynomially bounded in . Apply Theorem 1.2(2) with the common size parameter and a fixed exponent large enough for all these bounds. Since we supply integral maximum flows, the additional expected time for a call on is
The size accounting over depths therefore gives additional expected time. The construction and combination steps also take time, since their capacities, parameters, and node labels have -bit encodings.
Every combined maximum-flow network has size and integer capacities bounded by a fixed polynomial in . If needed, add isolated unit-capacity arcs, unconnected to the source and sink. This preserves the maximum-flow problem and makes its size at least . The deterministic maximum-flow algorithm of [45] then computes an integral maximum flow in time. There are such computations, so their total time is . Combining this with the additional expected time proves the claimed bound .
Acknowledgements. We thank Chandra Chekuri for insightful discussions and providing feedback that helped improve the manuscript. For AI disclosure, see Section 1.3.
References
[1] A. Abboud, R. Krauthgamer, J. Li, D. Panigrahi, T. Saranurak, and O. Trabelsi. Breaking the cubic barrier for all-pairs max-flow: Gomory–Hu tree in nearly quadratic time. In Proceedings of the 63rd IEEE Symposium on Foundations of Computer Science (FOCS), pages 884–895, 2022.
[2] 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 (STOC), pages 1725–1737, 2021.
[3] A. Abboud, R. Kyng, J. Li, D. Panigrahi, M. Probst Gutenberg, T. Saranurak, W. Yuan, and W. Yuan. Deterministic almost-linear-time Gomory–Hu trees. In Proceedings of the 66th IEEE Symposium on Foundations of Computer Science (FOCS), pages 659–666, 2025.
[4] A. Abboud, J. Li, D. Panigrahi, and T. Saranurak. All-pairs max-flow is no harder than single-pair max-flow: Gomory–Hu trees in almost-linear time. In Proceedings of the 64th IEEE Symposium on Foundations of Computer Science (FOCS), pages 2204–2212, 2023.
[5] F. Barahona. Separating from the dominant of the spanning tree polytope. Operations Research Letters, 12(4):201–203, 1992.
[6] K. Bérczi, K. Chandrasekaran, T. Király, and D. Szabo. -Separating Principal Partition Sequence of Submodular Functions. In Integer Programming and Combinatorial Optimization (IPCO), pages 315–330, 2026.
[7] R. Cen, H. Fleischmann, G. Z. Li, J. Li, and D. Panigrahi. Fast algorithms for graph arboricity and related problems. In Proceedings of the 66th IEEE Symposium on Foundations of Computer Science (FOCS), pages 964–982, 2025.
[8] K. Chandrasekaran and W. Wang. Fixed Parameter Approximation Scheme for Min-max k-cut. Mathematical Programming, 197:1093–1144, 2023.
[9] K. Chandrasekaran and W. Wang. Approximating submodular k-partition via principal partition sequence. SIAM Journal on Discrete Mathematics, 38(4):3198–3219, 2024.
[10] C. Chekuri and K. Quanrud. Near-linear time approximation schemes for some implicit fractional packing problems. In Proceedings of the 28th ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 801–820, 2017.
[11] C. Chekuri, K. Quanrud, and C. Xu. LP relaxation and tree packing for minimum k-cut. SIAM Journal on Discrete Mathematics, 34(2):1334–1353, 2020.
[12] L. Chen, R. Kyng, Y. P. Liu, R. Peng, M. Probst Gutenberg, and S. Sachdeva. Maximum flow and minimum-cost flow in almost-linear time. Journal of the ACM, 72(3):19:1–19:103, 2025.
[13] E. Cheng and W. H. Cunningham. A faster algorithm for computing the strength of a network. Information Processing Letters, 49(4):209–212, 1994.
[14] W. H. Cunningham. Optimal attack and reinforcement of a network. Journal of the ACM, 32(3):549–561, 1985.
[15] J. Edmonds. Edge-disjoint branchings. In R. Rustin, editor, Combinatorial Algorithms, pages 91–96. Algorithms Press, 1973.
[16] H. Fleischmann, J. Li, T. Saranurak, and B. Wang. Directed global minimum cut in almost-linear time. arXiv:2610.10898, 2026.
[17] S. Fujishige. Theory of principal partitions revisited. In Research Trends in Combinatorial Optimization, pages 127–162. 2009.
[18] H. N. Gabow. Algorithms for graphic polymatroids and parametric s-sets. Journal of Algorithms, 26(1):48–86, 1998.
[19] P. Gawrychowski, S. Mozes, and O. Weimann. A note on a recent algorithm for minimum cut. In Symposium on Simplicity in Algorithms (SOSA), pages 74–79, 2021.
[20] P. Gawrychowski, S. Mozes, and O. Weimann. Minimum cut in time. Theory of Computing Systems, 68(4):814–834, 2024.
[21] R. E. Gomory and T. C. Hu. Multi-terminal network flows. Journal of the Society for Industrial and Applied Mathematics, 9(4):551–570, 1961.
[22] D. Gusfield. Computing the strength of a graph. SIAM Journal on Computing, 20(4):639–654, 1991.
[23] E. Harb, K. Quanrud, and C. Chekuri. Convergence to lexicographically optimal base in a (contra)polymatroid and applications to densest subgraph and tree packing. In 31st Annual European Symposium on Algorithms (ESA 2023), pages 56:1–56:17, 2023.
[24] M. Henzinger, J. Li, S. Rao, and D. Wang. Deterministic near-linear time minimum cut in weighted graphs. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3089–3139, 2024.
[25] D. Kang and J. Payor. Flow rounding. arXiv:1507.08139, 2015.
[26] D. R. Karger. Minimum cuts in near-linear time. Journal of the ACM, 47(1):46–76, 2000.
[27] V. Kolmogorov. A faster algorithm for computing the principal sequence of partitions of a graph. Algorithmica, 56(4):394–412, 2010.
[28] J. Li and D. Panigrahi. Deterministic minimum cut in poly-logarithmic maximum flows. Journal of the ACM, 72(4):29:1–29:18, 2025.
[29] D. Lokshtanov, S. Saurabh, and V. Surianarayanan. A parameterized approximation scheme for min -cut. SIAM Journal on Computing, 53(6):FOCS20–205–FOCS20–238, 2024.
[30] S. Mukhopadhyay and D. Nanongkai. Weighted min-cut: Sequential, cut-query, and streaming algorithms. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 496–509, 2020.
[31] H. Narayanan. The principal lattice of partitions of a submodular function. Linear Algebra and its Applications, 144:179–216, 1991.
[32] H. Narayanan. Submodular Functions and Electrical Networks, volume 54 of Annals of Discrete Mathematics. North-Holland, 1997.
[33] H. Narayanan, S. K. Roy, and S. B. Patkar. Approximation algorithms for min-k-overlap problems using the principal lattice of partitions approach. Journal of Algorithms, 21(2):306–330, 1996.
[34] C. St. J. A. Nash-Williams. Edge-disjoint spanning trees of finite graphs. Journal of the London Mathematical Society, s1-36(1):445–450, 1961.
[35] C. St. J. A. Nash-Williams. Decomposition of finite graphs into forests. Journal of the London Mathematical Society, s1-39(1):12, 1964.
[36] S. B. Patkar and H. Narayanan. Principal lattice of partitions of submodular functions on graphs: Fast algorithms for principal partition and generic rigidity. In Algorithms and Computation (ISAAC), volume 650 of Lecture Notes in Computer Science, pages 41–50. Springer, 1992.
[37] K. Quanrud. Fast and deterministic approximations for k-cut. Theory of Computing, 18(7):1–24, 2022.
[38] R. Ravi and A. Sinha. Approximating k-cuts using network strength as a lagrangean relaxation. European Journal of Operational Research, 186(1):77–90, 2008.
[39] D. D. Sleator and R. E. Tarjan. A data structure for dynamic trees. Journal of Computer and System Sciences, 26(3):362–391, 1983.
[40] R. E. Tarjan. Edge-disjoint spanning trees and depth-first search. Acta Informatica, 6(2):171–185, 1976.
[41] M. Thorup. Fully-dynamic min-cut. Combinatorica, 27(1):91–127, 2007.
[42] M. Thorup. Minimum k-way cuts via deterministic greedy tree packing. In Proceedings of the 40th Annual ACM Symposium on Theory of Computing (STOC), pages 159–166, 2008.
[43] V. A. Trubin. Strength of a graph and packing of trees and branchings. Cybernetics and Systems Analysis, 29(3):379–384, 1993.
[44] 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, 1961.
[45] J. van den Brand, L. Chen, R. Kyng, Y. P. Liu, R. Peng, M. Probst Gutenberg, S. Sachdeva, and A. Sidford. A deterministic almost-linear time algorithm for minimum-cost flow. In Proceedings of the 64th IEEE Symposium on Foundations of Computer Science (FOCS), pages 503–514. IEEE, 2023.
[46] T. Zhang. Gomory–Hu trees in quadratic time, 2021. arXiv:2112.01042.