Gomory–Hu Tree
A Gomory–Hu tree is an edge-weighted tree on the vertex set of an undirected capacitated graph that compactly encodes the minimum s–t cut values and partitions for all vertex pairs using N − 1 maximum-flow computations.
Gomory–Hu tree (also known as a cut tree or all-pairs minimum-cut tree) is a combinatorial data structure in computation and algorithms that represents the minimum s–t cut capacities and vertex partitions for all V(V − 1)/2 unordered pairs of vertices in an undirected, edge-capacitated graph G = (V, E, c) within a single weighted tree T on the same vertex set V. Introduced in 1961 by Ralph E. Gomory and Te Chiang Hu, the structure demonstrates that although an undirected network on V vertices possesses V(V − 1)/2 distinct pairwise minimum-cut problems, their optimal cut capacities can take on at most V − 1 distinct numerical values and can be computed using V − 1 invocations of a maximum-flow subroutine such as the Ford–Fulkerson algorithm, Dinic's algorithm, or the push–relabel algorithm.
Within computational complexity theory and combinatorial optimization, the Gomory–Hu tree forms a foundational bridge between network flow theory, submodular function minimization, and hierarchical clustering. Removing the minimum-weight edge along the unique path between any two vertices u and v in T bipartitions V into two connected components (Su, Sv) that form a true minimum u–v cut in the original graph G, while the weight of that tree edge equals the minimum cut capacity λG(u, v).
Mathematical Formulation and Invariants
Pairwise Minimum Cuts and Flow Equivalence
Let G = (V, E, c) be an undirected graph with vertex count n = |V| and non-negative edge capacities c : E → ℝ≥0. For any nonempty proper subset S ⊂ V, the cut capacity c(δ(S)) is the sum of capacities of all edges in E having one endpoint in S and the other in V \ S:
For any distinct vertices s, t ∈ V, a minimum s–t cut is a subset S ⊂ V with s ∈ S and t ∉ S that minimizes c(δ(S)). Denote this optimal capacity by λG(s, t). By the max-flow min-cut theorem, λG(s, t) equals the maximum value of a feasible s–t flow in G.
A weighted tree T = (V, ET, w) on the identical vertex set V (where ET need not be a subset of E) is called flow-equivalent to G if, for every pair u, v ∈ V, the minimum edge weight along the unique path PT(u, v) in T equals λG(u, v):
A Gomory–Hu tree satisfies both this flow-equivalence property and the cut-equivalence property: for every tree edge e = {x, y} ∈ ET, deleting e from T splits V into two connected vertex subsets (Ae, V \ Ae) such that c(δG(Ae)) = w(e) = λG(x, y). Consequently, the bottleneck edge e* on PT(u, v) directly yields the explicit vertex partition of a minimum u–v cut in G.
Submodularity and the Non-Crossing Cut Property
The existence of a Gomory–Hu tree rests on the symmetry and submodularity of the undirected cut function f(S) = c(δ(S)). For any two vertex subsets A, B ⊆ V, the cut capacity function satisfies the submodular inequality:
Furthermore, because G is undirected, c(δ(A)) = c(δ(V \ A)), implying the posi-modular (symmetric submodular) inequality:
Two cuts A and B are said to cross if all four regions A ∩ B, A \ B, B \ A, and V \ (A ∪ B) are nonempty. Using the submodular and posi-modular inequalities, Gomory and Hu proved the uncrossing lemma: if A is a minimum s–t cut in G and x, y ∈ A are two vertices on the same side of A, then there exists a minimum x–y cut B that does not cross A (meaning either B ⊂ A or A ⊂ B). Because no two cuts in a laminar (non-crossing) family of bipartitions of V intersect transversely, any maximal laminar family of non-trivial bipartitions on n vertices contains at most n − 1 cuts and corresponds bijectively to the edges of a tree on V.
Ultrametric Triangle Inequality
Pairwise minimum-cut capacities in an undirected graph obey the ultrametric inequality (dual to the triangle inequality): for any three distinct vertices u, v, w ∈ V,
In the resulting triple of values {λG(u, v), λG(v, w), λG(u, w)}, the two smallest values must be equal. This algebraic condition is necessary and sufficient for a symmetric matrix of pairwise capacities to be realizable by a flow-equivalent tree, and a maximum-weight spanning tree computed via a minimum spanning tree solver on the complete graph of pairwise min-cut values always yields a flow-equivalent tree (though not necessarily a cut-equivalent Gomory–Hu tree without laminar cut selection).
Algorithmic Construction and Complexity
Classical Gomory–Hu Contraction Algorithm
The original 1961 algorithm by Gomory and Hu constructs T iteratively over n − 1 refinement steps while maintaining a partition tree Tk whose nodes are disjoint supernodes V1, V2, …, Vk partitioning V:
- Initialization: Start with a single supernode V1 = V and an edgeless tree T1.
- Supernode Selection: While any supernode Vi contains at least two original vertices (s, t ∈ Vi), select s and t.
- Contracted Graph Construction: Form a contracted graph G′ from G by contracting every connected component of Tk \ {Vi} into a single representative vertex, while keeping all vertices inside Vi uncontracted.
- Minimum Cut and Uncrossing Split: Compute a minimum s–t cut (A, B) of capacity λ in G′ using a maximum-flow algorithm. Split the supernode Vi into Vi,s = Vi ∩ A and Vi,t = Vi ∩ B, join them in Tk+1 by an edge of weight λ, and reconnect each previously incident tree edge of Vi to Vi,s if its component lay in A or to Vi,t if its component lay in B.
After n − 1 iterations, every supernode is a singleton vertex in V, and Tn is a valid Gomory–Hu tree.
Gusfield's Contraction-Free Algorithm
Implementing explicit graph contractions and dynamic adjacency updates at each of the n − 1 phases introduces substantial bookkeeping overhead. In 1990, Dan Gusfield published a simplified algorithm that constructs a Gomory–Hu tree using n − 1 minimum s–t cut calls directly on the unmodified original graph G:
- Initialize a star tree T in which vertex 1 is connected to every vertex i ∈ {2, …, n} by a tentative edge of weight 0; maintain an array p[i] = 1 recording each vertex's current tree neighbor.
- For s = 2 to n:
- Let t = p[s]. Compute a minimum s–t cut (S, V \ S) of capacity λ in the original graph G, with s ∈ S and t ∈ V \ S.
- Set the weight of the tree edge {s, t} to λ.
- For every vertex v ∈ {s + 1, …, n} such that v ∈ S and p[v] = t, update p[v] ← s.
- If the previous neighbor p[t] belongs to S, swap the tree attachment of the edge (t, p[t]) so that s connects to p[t] and p[s] ← p[t], p[t] ← s.
Gusfield's method requires only two arrays of length n alongside an off-the-shelf max-flow solver, achieving identical O(n · Tmax-flow(n, m)) time complexity without dynamic graph restructuring.
Comparative Complexity Across All-Pairs Minimum-Cut Methods
| Algorithmic Approach | Graph Restriction | Number of Max-Flow Calls | Worst-Case Time Complexity | Auxiliary Space |
|---|---|---|---|---|
| Naive All-Pairs Max-Flow | Directed or Undirected | V(V − 1)/2 | O(V2 · Tflow(V, E)) | O(V2) |
| Gomory–Hu Contraction (1961) | Undirected, Weighted | V − 1 | O(V · Tflow(V, E)) | O(V + E) |
| Gusfield Contraction-Free (1990) | Undirected, Weighted | V − 1 | O(V · Tflow(V, E)) | O(V + E) |
| Hao–Orlin Global Min-Cut (1994) | Global cut only (1 value) | V − 1 dependent push–relabel | O(V E log(V2/E)) | O(V + E) |
| Abboud et al. Almost-Quadratic (2022) | Undirected, Weighted | Polylogarithmic isolating cuts | O(V2 · no(1)) | O(V + E) |
In a 2022 breakthrough, Amir Abboud, Robert Krauthgamer, Jason Li, Debmalya Panigrahi, Thatchaphol Saranurak, and Ohad Trabelsi broke the sixty-year n − 1 max-flow barrier by combining isolating-cut lemmas with almost-linear L1 interior-point flow solvers, constructing a Gomory–Hu tree in weighted undirected graphs in O(n2+o(1)) time.
Scientific and Engineering Applications
- Image Segmentation and Computer Vision: In graph-based Markov Random Field (MRF) and conditional random field segmentation, pixels or superpixels form vertices connected by similarity-weighted edges. Computing a Gomory–Hu tree enables interactive multi-scale foreground/background partitioning and hierarchical clustering without recomputing max-flow for each seed pair.
- Telecommunications and Power Grid Survivability: Network architects evaluate vulnerability to multi-link failures by querying the Gomory–Hu tree (often augmented with a heavy–light decomposition or Tarjan's off-line lowest common ancestors algorithm for O(1) bottleneck queries) to identify pairs of substations or routers separated by low-capacity cuts.
- Bioinformatics and Protein Interaction Networks: In systems biology, interactome graphs weight protein–protein edges by experimental confidence scores. Gomory–Hu cut trees partition dense protein complexes from sparse inter-module linkers and solve the minimum k-cut heuristic in metabolic pathway decomposition.
Frequently Asked Questions
Does every directed graph possess a Gomory–Hu tree?
No. In a directed capacitated graph, the minimum s–t cut capacity λ(s, t) need not equal λ(t, s), and a V-vertex directed graph can exhibit up to Ω(V2) distinct pairwise minimum-cut values. However, symmetric submodular functions and Eulerian directed graphs retain specialized cut-tree representations.
What is the difference between a flow-equivalent tree and a Gomory–Hu tree?
A flow-equivalent tree guarantees only that the minimum edge weight on the tree path between u and v equals the numerical value λG(u, v). A Gomory–Hu tree additionally guarantees that removing that bottleneck tree edge partitions V into two connected components (S, V \ S) whose cut capacity in G actually equals λG(u, v).
References
- Gomory, R. E., & Hu, T. C. (1961). "Multi-terminal network flows." Journal of the Society for Industrial and Applied Mathematics, 9(4), 551–570. https://doi.org/10.1137/0109047
- Gusfield, D. (1990). "Very simple methods for all pairs network flow analysis." SIAM Journal on Computing, 19(1), 143–155. https://doi.org/10.1137/0219009
- Goldberg, A. V., & Tsioutsiouliklis, K. (2001). "Cut tree algorithms: An experimental study." Journal of Algorithms, 38(1), 51–83. https://doi.org/10.1006/jagm.2000.1136
- Abboud, A., Krauthgamer, R., Li, J., Panigrahi, D., Saranurak, T., & Trabelsi, O. (2022). "Breaking the cubic barrier for all-pairs max-flow: Gomory–Hu tree in nearly quadratic time." Proceedings of the 63rd IEEE Annual Symposium on Foundations of Computer Science (FOCS), 884–895. https://doi.org/10.1109/FOCS54457.2022.00088