---
title: All-Pairs Minimum Cut Problem
url: https://www.emergentmind.com/topics/all-pairs-minimum-cut-problem
type: topic
---

# All-Pairs Minimum Cut Problem

The all-pairs minimum cut problem concerns, given a (typically undirected) graph $G = (V, E, w)$, computing for every $\binom{n}{2}$ pair of distinct vertices $(s,t)$ the minimum total weight of edges whose removal separates $s$ from $t$. In contrast to the single source–sink minimum cut, the all-pairs variant requires either explicit computation of every pair’s cut value or an efficient data structure supporting mincut queries for any $(s,t)$. This problem is fundamental in combinatorial optimization, network reliability, and graph theory, directly connected to classical constructs like Gomory–Hu trees, cactus representations, and various algorithmic paradigms ranging from flow-based techniques to enumeration and algebraic methods.

## 1. Formal Problem Definition and Classical Structures

Let $G = (V, E, w)$ be an undirected edge-weighted graph with $n = |V|$ vertices. The minimum $s$–$t$ cut, $\lambda(s,t)$, is defined as the minimal total weight of a set $S \subseteq V$ containing $s$ but not $t$, such that the total weight of edges crossing $S$ and $V\setminus S$ is minimized. The all-pairs minimum cut problem asks to compute $\lambda(s,t)$ for all unordered pairs $(s, t)$.

A central data structure is the **Gomory–Hu tree**: a weighted tree $T$ on $V$, satisfying that for every pair $(s, t)$, the minimal weight on the unique $s$–$t$ path in $T$ equals $\lambda(s,t)$. Removing the corresponding tree edge partitions $V$ into the two sides of an $(s,t)$-mincut. The compactness of the Gomory–Hu tree (only $n-1$ edges) enables storage and fast query of all pairwise mincut values.

Key mathematical properties:
- If $T$ is the Gomory–Hu tree for $G$, then $\lambda(s,t) = \min_{e\in P_T(s,t)} w(e)$, where $P_T(s,t)$ is the unique $s$–$t$ path in $T$.
- Global minimum cuts correspond to the minimum value of $\lambda(s,t)$ over all $(s,t)$.

## 2. Algorithmic Paradigms for All-Pairs Minimum Cut

### Gomory–Hu Algorithm and Subcubic-Time Advances

The classical approach by Gomory and Hu (1961) computes the tree via $n-1$ mincut (equivalently, maxflow) computations, requiring $O(mn)$ time with the fastest known single-pair flow algorithms. This cubic barrier persisted for decades. Recent breakthroughs have produced **nearly quadratic time** algorithms for general, weighted graphs:

- "Breaking the Cubic Barrier for All-Pairs Max-Flow: Gomory-Hu Tree in Nearly Quadratic Time" [2111.04958] introduced an algorithm that constructs the Gomory–Hu tree in $\tilde{O}(n^2)$ time, using reductions to single-source terminal mincuts and the concept of "guide trees" that capture local cut structure within a small covering set.
- For unweighted graphs, the runtime can be improved to $m^{1+o(1)}$ given a nearly-linear time maxflow [2111.04958].

Further, "A Nearly Optimal All-Pairs Min-Cuts Algorithm in Simple Graphs" [2106.02233] achieves $n^{2+o(1)}$ time for simple undirected graphs via iterative refinement of sparse partial trees, well-linked set decompositions, and batched maxflow computations, nearly matching the trivial $\Omega(n^2)$ lower bound dictated by the output size.

#### Table: Algorithmic Runtimes for All-Pairs Minimum Cut

| Paper/Setting                        | Time Complexity               | Graph Type                |
|:-------------------------------------:|:-----------------------------:|:--------------------------|
| Gomory–Hu Classical                  | $O(mn)$                       | General Undirected        |
| [2111.04958] (weighted)               | $\tilde{O}(n^2)$              | General Undirected        |
| [2111.04958] (unweighted)             | $m^{1+o(1)}$                  | General Undirected        |
| [2106.02233] (simple graphs)          | $n^{2+o(1)}$                  | Simple Undirected         |
| Planar/bounded-genus [1411.7055]      | $2^{O(g^2)}n\log^3 n$         | Genus $g$ (planar: $g=0$) |

For surface-embedded graphs (planar or bounded-genus), near-linear or subquadratic time is achievable via reductions to planar instances and recursive cut decompositions [1411.7055]. For special classes, algorithms exploit topological or combinatorial structure for additional gains.

### Cut-Query Model

The cut-query model—where the algorithm queries the weight of cuts of explicit subsets, rather than being given edge lists directly—presents unique challenges. The first nontrivial algorithm in this model is given in "All-Pairs Minimum Cut using $\tilde{O}(n^{7/4})$ Cut Queries" [2510.16741]. The algorithm constructs the Gomory–Hu tree using only $\tilde{O}(n^{7/4})$ cut queries, leveraging randomized contraction, weak isolating cuts, and recursive partitioning. This complexity substantially improves over the $O(n^2)$ queries required by naive graph recovery.

### Bounded-Capacity, Directed, and Special Connectivity Variants

In directed graphs or for unit/vertex capacities, the all-pairs mincut/maxflow problem is more challenging and closely tied to the matrix multiplication exponent $\omega$:

- [1807.05803] provides randomized and deterministic algorithms for the $k$-bounded version (compute all $s$-$t$ mincuts of value $<k$), achieving runtimes such as $O((nk)^\omega)$ for vertex capacities and $O(2^{O(k^2)}mn)$ for edge capacities in DAGs.
- [2305.02132] further refines the algebraic approach, giving a $k$-bounded all-pairs connectivity algorithm in $O((kn)^\omega)$ time.

Conditional lower bounds under SETH and $4$-Clique conjecture suggest that subquadratic time for all-pairs mincuts is likely only when $k$ is small or for special classes (e.g., undirected, unweighted).

## 3. Data Structures and Sensitivity Oracles

Compact data structures allow for answering mincut queries efficiently after preprocessing:

- The Gomory–Hu tree (and the region tree/Catesian tree variant in [1411.7055]) answers each mincut query in $O(1)$ time after preprocessing.
- Sensitivity oracles [2011.03291] store $O(n^2)$ space to answer, in $O(1)$ time, the new value of any $(s,t)$-mincut after a single edge insertion/deletion, or use $O(m)$ space to answer in $O(\min(m, n c_{s,t}))$ time.

Approximate streaming or sketching approaches offer alternative trade-offs: space-efficient summarizations with $(1+\varepsilon)$ approximation factors are possible with $\tilde{O}(n/\varepsilon)$ space [2412.01143].

## 4. Enumeration, Structure, and Representation of Minimum Cuts

Enumeration of all minimal multicuts and multiway cuts (not necessarily minimum) is addressed in [2006.16222], with polynomial-delay enumeration algorithms based on supergraph and reverse search paradigms. For the minimum cut-sets themselves, deterministic enumeration for graphs and hypergraphs appears in [2110.14815], where for $k=2$ (the global cut case), all minimum cut-sets can be recovered via a polynomial number of $(S,T)$-terminal-cut computations.

Additionally, the cactus representation offers a compact description of all global minimum cuts, supporting efficient enumeration and secondary queries for balanced cuts or special partitions [2108.04566].

## 5. Parallel, Distributed, and Heuristic Algorithms

Practical computation on massive graphs demands scalable algorithms:

- Distributed and streaming-out-of-core algorithms for the mincut/maxflow problem, such as those in [1109.1146], employ region partitioning, local path augmentation, and push-relabel updates, achieving strong empirical performance with guaranteed $O(n^2)$ or $O(|B|^2)$ sweeps for graphs with small boundary sets. These approaches provide a template for all-pairs mincut computations where repeated single-source–sink cuts are needed, as is the case in computer vision applications.

- Contraction-based heuristic algorithms (e.g., VieCut [1708.06127], [2108.04566]) leverage cluster contraction and label propagation to rapidly reduce graph sizes, finding near-minimum cuts with high accuracy on real-world graphs. Such approaches can accelerate repeated mincut computations needed in all-pairs settings or preprocessing for Gomory–Hu tree construction.

Parallel implementations, both shared-memory and distributed, show practical scalability for large graphs (10⁸ vertices, billions of edges), and the use of region-based partitioning in distributed contexts controls the expensive cost of inter-region communication [1109.1146].

## 6. Applications and Fine-Grained Complexity

All-pairs minimum cut is essential in:

- Network design, reliability, and vulnerability analysis, where per-pair bottleneck identification enables robust system planning and defense against failures.
- Computer vision (segmentation, stereo, multiview reconstruction) and data mining (community detection), where repeated mincut computations underpin the solution of Markov Random Field energy minimization and graph partitioning tasks [1109.1146].
- VLSI and circuit partitioning, where efficient partitioning via cut computation is required on massive engineered graphs [2108.04566].

On the fine-grained complexity side, there is a nuanced picture:
- For undirected, unweighted graphs, all-pairs mincut is now provably easier than all-pairs shortest paths under widely believed assumptions ([2111.04958]).
- In directed graphs, conditional lower bounds derived from $4$-Clique and SETH highlight that, even for constant $k$, all-pairs $k$-bounded mincut is strictly harder than transitive closure in some regimes [1807.05803].

## 7. Open Problems and Future Directions

- Further improvements to the exponent in bounded-cut algebraic methods and their applicability to larger $k$ in directed graphs [1807.05803], [2305.02132].
- Deeper understanding and possible reduction of the dependence on the genus for algorithms in surface-embedded graphs [1411.7055].
- Extending efficient Gomory–Hu tree computation to dynamic and streaming settings, possibly leveraging recent advances in sketching and single-pass algorithms [2412.01143].
- Tightening lower bounds, particularly for deterministic versus randomized algorithms (e.g., streaming space [2412.01143]) and for directed vs. undirected graph settings in all-pairs context.

The landscape of the all-pairs minimum cut problem exhibits significant recent progress, with near-optimal algorithms for major regimes, composable data structures like the Gomory–Hu tree, and robust application in both theory and practice. Continuing advances are expected via further exploitation of algebraic, combinatorial, and topological methods, as well as greater sophistication in large-scale and dynamic computation environments.

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