---
title: 'All-Pairs Mincuts: Theory and Techniques'
url: https://www.emergentmind.com/topics/all-pairs-mincuts-problem
type: topic
---

# All-Pairs Mincuts: Theory and Techniques

The all-pairs mincuts problem asks for the minimum \(s\)-\(t\) cut, or at least its value, for every pair of vertices \(s,t\) in a graph. In undirected graphs, the problem is classically identified with constructing a Gomory–Hu tree, which preserves all pairwise mincut values and corresponding cut partitions in a compact tree representation [2507.20354]. Modern work has separated the topic into several distinct regimes: static exact computation in undirected graphs, sensitivity under single-edge updates, bounded-threshold formulations in directed graphs, and restricted-access models such as cut queries, streaming, and fully dynamic maintenance [2106.02233][2011.03291][2305.02132][2511.10036].

## 1. Formal definitions and problem variants

For an undirected weighted graph \(G=(V,E,w)\), the edge connectivity between two vertices \(s,t\in V\) is
\[
\lambda_G(s,t)=\min_{S\subseteq V:\ s\in S,\ t\notin S} w(\partial_G S),
\]
where \(\partial_G(S)\) is the set of edges with exactly one endpoint in \(S\) [2507.20354]. In the unweighted setting, the same quantity is the size of a minimum \(s\)-\(t\) edge cut; one notation used for this value is \(c_{s,t}\), with
\[
c_{s,t}=\min\{|\delta(X)|: s\in X,\ t\notin X\},
\]
where \(\delta(X)\) denotes the set of edges with exactly one endpoint in \(X\) [2011.03291].

The classical all-pairs mincuts problem asks to determine \(\lambda_G(s,t)\) or \(c_{s,t}\) for every unordered pair \(\{s,t\}\subseteq V\). In directed graphs, the same task is often phrased as all-pairs connectivity or all-pairs max-flow, since by Menger’s theorem the maximum number of edge-disjoint \(s\)-to-\(t\) paths equals the size of a minimum \((s,t)\)-cut in the unweighted case [2305.02132]. For vertex connectivity, one analogously studies the maximum number of internally vertex-disjoint \(s\)-to-\(t\) paths, denoted \(\nu(s,t)\) in the directed bounded literature [2305.02132].

A major distinction is between the unrestricted and bounded forms. In the \(k\)-bounded formulation, the task is to compute \(\min(k,\lambda(s,t))\) or \(\min(k,\nu(s,t))\) for all pairs, so values below \(k\) must be exact, जबकि pairs of connectivity at least \(k\) may simply be reported as “large” [1807.05803][2305.02132]. Another orthogonal distinction is sensitivity: instead of answering only in the original graph, one preprocesses \(G\) so that for any pair \(s,t\) and any single-edge deletion or insertion, the updated \((s,t)\)-mincut can be reported efficiently [2011.03291].

## 2. Gomory–Hu trees as the canonical undirected representation

In undirected graphs, a Gomory–Hu tree is the canonical compact representation of all-pairs mincuts. It is a weighted tree \(T\) on the same vertex set such that for every pair \(s,t\in V\),
\[
\lambda_G(s,t)=\min_{e\in P_T(s,t)} w_T(e),
\]
where \(P_T(s,t)\) is the unique \(s\)-to-\(t\) path in \(T\) [2507.20354]. Deleting a minimum-weight edge on that path yields a partition whose preimage in \(G\) is an actual \((s,t)\)-minimum cut [2507.20354].

This representation is already enough to solve the static all-pairs mincuts problem outright: once the tree is built, every pairwise mincut value is a path-minimum query, and a corresponding cut partition is obtained from the bottleneck tree edge [2106.02233]. In this sense, static all-pairs mincut values admit an \(O(n)\)-size representation, even though there are \(\Theta(n^2)\) terminal pairs [2011.03291].

Several later algorithms work with partial forms of this representation. A partial Gomory–Hu tree maintains a partition of the vertex set together with a tree on supervertices, and the algorithm proceeds by refinement until the full tree is obtained [2106.02233]. A more general terminal-set formulation is the Gomory–Hu \(U\)-Steiner tree, which preserves all mincuts among a specified terminal set \(U\subseteq V\) and is central to the recursive structure of recent weighted algorithms [2507.20354].

## 3. Static exact algorithms in undirected graphs

The recent algorithmic picture for static undirected all-pairs mincuts is split between a nearly quadratic result for simple unweighted graphs and an almost-linear deterministic result for weighted graphs.

| Setting | Best result stated in the cited work |
|---|---|
| Simple, undirected, unweighted graphs | Randomized exact Gomory–Hu tree in \(n^{2+o(1)}\) time with high probability [2106.02233] |
| Undirected weighted graphs with polynomially bounded weights | Deterministic exact Gomory–Hu tree in \(m^{1+o(1)}\) time [2507.20354] |

For simple, undirected, unweighted graphs, an \(n^{2+o(1)}\)-time algorithm constructs a Gomory–Hu tree with high probability, improving on the \( \tilde O(n^{2.5}) \) bound of Abboud et al. and described as nearly optimal as a function of \(n\) because both input reading and explicit output can already be quadratic [2106.02233]. The algorithm refines a partial tree in connectivity scales, uses \(3d\)-connectivity certificates, partitions high-degree vertices into \(O(n/d)\) well-linked sets, and refines many terminals in bulk rather than by \(n-1\) sequential max-flow calls [2106.02233].

For undirected weighted graphs, a later result gives the first deterministic \(m^{1+o(1)}\)-time algorithm for constructing a Gomory–Hu tree, assuming polynomially bounded weights [2507.20354]. Its two principal components are a deterministic reduction from all-pairs mincuts to the single-source mincuts problem with only subpolynomial overhead, and a deterministic almost-linear-time algorithm for single-source mincuts [2507.20354]. The reduction depends on a balanced decomposition around a pivot \(r\), extraction of many disjoint minimal \((v,r)\)-mincuts, and the laminarity of minimal \((v,r)\)-mincuts for fixed \(r\) [2507.20354].

The two results illuminate different structural points. The simple-graph \(n^{2+o(1)}\) algorithm uses simplicity in an essential way inside its well-linked partition lemma; extending that result to weighted graphs or even unweighted multigraphs is explicitly identified as open in that work [2106.02233]. By contrast, the deterministic \(m^{1+o(1)}\) algorithm already handles weighted undirected graphs, but its hidden \(o(1)\) factors arise from technically heavy dynamic shortest-path and expander-decomposition machinery [2507.20354].

## 4. Sensitivity under single-edge updates

The sensitivity-oracle version of all-pairs mincuts is strictly stronger than the static problem. Here the input is an undirected unweighted graph \(G=(V,E)\), and after preprocessing the oracle must answer, for any terminals \(s,t\) and any single-edge deletion \(e\in E\) or insertion \(e\notin E\), the updated mincut value in \(G-e\) or \(G+e\) [2011.03291]. The task is qualitatively different from either static all-pairs mincut or recomputing a fresh maxflow after each update, because it asks for every pair under every single-edge perturbation while remaining compact [2011.03291].

A central observation is that a single unweighted edge update changes the \((s,t)\)-mincut value by at most one. Deletion can only leave the value unchanged or increase it by \(1\); insertion can only leave it unchanged or decrease it by \(1\) [2011.03291]. The decisive issue is therefore not the magnitude of change but the combinatorial predicate determining whether a change occurs. For deletion, the value increases iff every minimum \((s,t)\)-cut of the original graph uses the failed edge; for insertion, the value decreases iff there exists a minimum \((s,t)\)-cut of the original graph that separates the endpoints of the inserted edge [2011.03291].

The first compact sensitivity oracle in this setting uses \(O(n^2)\) space and answers the updated \((s,t)\)-mincut value in \(O(1)\) time for any single-edge failure or insertion [2011.03291]. It can also output the set of vertices defining a resulting minimum cut in \(O(n)\) time, which is stated to be worst-case optimal because one side of the cut may itself contain \(\Theta(n)\) vertices [2011.03291]. A second oracle uses only \(O(m)\) space and answers in \(O(\min(m,nc_{s,t}))\) time, where \(c_{s,t}\) is the original \((s,t)\)-mincut value; the paper compares this with deterministic recomputation bounds and states a speedup by a factor of \(\Omega(\min(m^{1/3},\sqrt n))\) [2011.03291].

The same work also gives a distributed interpretation of the quadratic-space oracle. If the goal is only to decide whether a single-edge update changes the \((s,t)\)-mincut value, the \(O(n^2)\)-space structure can be partitioned evenly among the \(n\) vertices, and for an updated edge \((x,y)\) only the data stored at \(x\) and \(y\) is required to determine whether the value changes for any pair \(s,t\in V\) [2011.03291]. The endpoint information can also output a compact encoding of all affected terminal pairs, although not every changed cut itself [2011.03291].

## 5. Directed and bounded formulations

In directed graphs, the unrestricted all-pairs min-cut problem remains substantially less understood than the undirected case, and much of the progress has come through bounded-threshold formulations. The \(k\)-bounded problem asks for exact values only when the minimum cut is below \(k\), or equivalently for the truncated quantity \(\min(k,\lambda(s,t))\) for edge connectivity and \(\min(k,\nu(s,t))\) for vertex connectivity [1807.05803][2305.02132].

An earlier line of work on directed bounded min-cuts established three kinds of results. First, for unit vertex capacities in general digraphs, there is a randomized algebraic algorithm running in \(O((nk)^\omega)\) time [1807.05803]. Second, for DAGs with unit edge capacities, there are deterministic witness-reporting algorithms running in \(O(2^{O(k^2)}mn)\) and \(O((k\log n)^{4^k+o(k)}n^\omega)\), both capable of returning explicit minimum cuts for every pair whose mincut value is at most \(k\) [1807.05803]. Third, the same paper proves 4-Clique-based lower bounds of \(n^{\omega-1-o(1)}k^2\) and, for combinatorial algorithms, \(n^{2-o(1)}k^2\), already in DAGs with unit vertex capacities [1807.05803]. The structural machinery behind the DAG algorithms is built from earliest and latest cuts, arc replacement, arc splits, the Witness set-family problem, and tensor-product superimposed codes [1807.05803].

A later result sharpened the algebraic picture for directed unweighted graphs. For edge connectivity, \(k\)-bounded all-pairs connectivity can be solved in \(\tilde O((kn)^\omega)\) time, and for vertex connectivity, \(k\)-bounded all-pairs vertex connectivity can be solved in \(\tilde O(k^2 n^\omega)\) time [2305.02132]. The main technical idea is a low-rank compression of the classical flow-vector framework of Cheung, Lau, and Leung: instead of inverting an \(m\times m\) transfer matrix, the algorithm factors the relevant matrix as \(K=LR\) with rank at most \(kn\), so the expensive inversion is reduced to dimension \(kn\) via
\[
(I-LR)^{-1}=I+L(I-RL)^{-1}R
\]
[2305.02132]. For edge connectivity, the bounded-rank characterization becomes
\[
\rank (I-K)^{-1}[\delta^{out}(s),\delta^{in}(t)] = \min(k,\lambda(s,t)),
\]
with high probability [2305.02132].

These bounded results make clear that thresholding changes the complexity class of the problem. For constant or polylogarithmic \(k\), the runtime approaches transitive-closure complexity, while the lower bounds show that once \(k\) is moderately large one should not expect the problem to remain as easy as transitive closure under standard fine-grained conjectures [1807.05803][2305.02132].

## 6. Cut-query, streaming, and fully dynamic models

Restricted-access models have produced a separate strand of all-pairs mincut research. In the cut-query model, the graph is accessed only through queries returning
\[
cut_G(S)=|E(S,V\setminus S)|
\]
for chosen subsets \(S\subseteq V\) [2510.16741]. In this model, the first nontrivial exact all-pairs algorithm constructs a Gomory–Hu tree of an unweighted undirected graph using \(\tilde O(n^{7/4})\) cut queries [2510.16741].

That \(\tilde O(n^{7/4})\) result relies on two new ideas tailored to the query model. The first is weak isolating cuts: for a terminal set \(R\), the algorithm only needs the true minimum \((v,R\setminus\{v\})\)-cut when it is also a minimum \(v,u\)-cut for some other \(u\in R\), rather than the full isolating-cut object [2510.16741]. The second is a split between friendly and unfriendly minimum cuts. Friendly cuts are preserved by a contraction-based friendly cut sparsifier, while unfriendly cuts are preserved with constant probability by a \((\tau,F)\)-star contraction that excludes a forbidden terminal set \(F\) from contraction [2510.16741]. The resulting single-source subroutine uses \(O(n^{1.75})\) cut queries, and a reduction from all-pairs mincut to batched single-source computations then yields the Gomory–Hu tree [2510.16741].

A subsequent improvement introduced an all-pairs minimum cut sparsifier for unweighted undirected graphs and reduced the cut-query complexity to \(\tilde O(n^{3/2})\) [2511.10036]. The sparsifier guarantee is existential but exact: for every pair \(s,t\in V\), there exists a minimum \(s,t\)-cut in the sparsifier whose restriction to the original vertex set is a minimum \(s,t\)-cut in the original graph, and the cut value is preserved exactly [2511.10036]. The construction begins with a friendly cut sparsifier, then applies a star transform that splits each super-vertex back into its constituent vertices, adds a proxy vertex, and encodes internal adjacency through weighted star edges [2511.10036]. This is combined with the structural fact that every exact mincut is either already friendly or differs from a friendly cut by one endpoint [2511.10036].

The same sparsification framework yields results beyond cut queries. It gives a deterministic fully dynamic algorithm that maintains a Gomory–Hu tree of a dynamic unweighted graph with \(n^{3/2+o(1)}\) worst-case update time, and a randomized two-pass streaming algorithm using \(\tilde O(n^{3/2})\) space [2511.10036]. The central conceptual point is that these algorithms bypass exact max-flow in models where exact max-flow is too expensive or unavailable: the paper constructs the exact-preserving sparsifier using approximate-max-flow-powered expander-decomposition machinery, and performs exact all-pairs mincut computation only on the smaller sparsifier [2511.10036].

## 7. Scope, structural themes, and current boundaries

Across these results, the dominant structural theme is that all-pairs mincuts are tractable only after an appropriate compression of the family of minimum cuts. In static undirected graphs, the compression is exact and global through a Gomory–Hu tree [2507.20354]. In sensitivity, it is a compact encoding of how each edge interacts with the family of minimum \((s,t)\)-cuts under a single update [2011.03291]. In directed bounded problems, it is either algebraic rank compression or a compact extremal-cut description via earliest/latest cuts [2305.02132][1807.05803]. In cut-query and dynamic models, it is an exact-preserving sparsifier that retains at least one optimal cut per pair [2511.10036].

The current boundaries are sharply model-dependent. Static exact all-pairs mincuts in undirected weighted graphs admit a deterministic \(m^{1+o(1)}\)-time solution [2507.20354], whereas the simple-graph nearly quadratic algorithm explicitly does not extend its main theorem to weighted graphs, directed graphs, or general multigraphs [2106.02233]. The sensitivity-oracle results are restricted to undirected unweighted graphs and single-edge failure or insertion [2011.03291]. The strongest directed results are still bounded-threshold rather than unrestricted [2305.02132]. The unweighted sparsifier framework in cut-query, streaming, and fully dynamic models does not seem to extend to weighted graphs and makes no claim for directed graphs [2511.10036].

These contrasts show that “the” all-pairs mincuts problem is no longer a single algorithmic question. In the undirected static setting, the problem is essentially the construction of a cut-equivalent tree. In sensitivity, it becomes an oracle-design problem over a family of perturbed graphs. In directed graphs, bounded variants currently supply the clearest positive results. In restricted-access models, exact sparsification has emerged as the substitute for direct max-flow computation.

Source: https://www.emergentmind.com/topics/all-pairs-mincuts-problem