Gomory–Hu tree
{{Short description|Weighted tree representing s-t cuts of a graph}}
In combinatorial optimization, the Gomory–Hu tree{{cite journal | last1 = Gomory | first1 = R. E. | author-link = Ralph E. Gomory | last2 = Hu | first2 = T. C. | author2-link = T. C. Hu | title = Multi-terminal network flows | journal = Journal of the Society for Industrial and Applied Mathematics | volume = 9 | issue = 4| pages = 551–570 | year = 1961 | doi = 10.1137/0109047 }} of an undirected graph with capacities is a weighted tree that represents the minimum s-t cuts for all s-t pairs in the graph. The Gomory–Hu tree can be constructed in {{math|{{abs|V}} − 1}} maximum flow computations. It is named for Ralph E. Gomory and T. C. Hu.
Definition
Let be an undirected graph with being the capacity of the edge respectively.
: Denote the minimum capacity of an {{mvar|s}}-{{mvar|t}} cut by for each .
: Let be a tree, and denote the set of edges in an {{mvar|s}}-{{mvar|t}} path by for each .
Then {{mvar|T}} is said to be a Gomory–Hu tree of {{mvar|G}}, if for each
:
where
- are the two connected components of , and thus forms an {{mvar|s}}-{{mvar|t}} cut in {{mvar|G}}.
- is the capacity of the cut in {{mvar|G}}.
Algorithm
Gomory–Hu Algorithm
:Input: A weighted undirected graph
: Output: A Gomory–Hu Tree
- Set
- Choose some with {{math|{{abs|X}} ≥ 2}} if such {{mvar|X}} exists. Otherwise, go to step 6.
- For each connected component let
- :Let
S = \{ S_C \mid C \text{ is a connected component in } T \setminus X \}.
- : Contract the components to form where:
\begin{align}
V_{G'} &= X \cup S \\[2pt]
E_{G'} &= E_G|_{X \times X} \cup \{(u, S_C) \in X \times S \mid (u,v) \in E_G \text{ for some } v \in S_C \} \\[2pt]
& \qquad \qquad \quad\! \cup \{(S_{C1}, S_{C2}) \in S \times S \mid (u,v) \in E_G \text{ for some } u \in S_{C1} \text{ and } v \in S_{C2} \}
\end{align}
- :: is the capacity function, defined as:
\begin{align}
&\text{if }\ (u,S_C) \in E_G|_{X \times S}: &&c'(u,S_C) = \!\!\! \sum_{\begin{smallmatrix} v \in S_C : \\ (u,v) \in E_G \end{smallmatrix}} \!\!\! c(u,v) \\[4pt]
&\text{if }\ (S_{C1},S_{C2}) \in E_G|_{S \times S}: &&c'(S_{C1},S_{C2}) = \!\!\!\!\!\!\! \sum_{\begin{smallmatrix} (u,v) \in E_G : \\ u \in S_{C1} \, \land \, v \in S_{C2} \end{smallmatrix}} \!\!\!\!\! c(u,v) \\[4pt]
&\text{otherwise}: &&c'(u,v) = c(u,v)
\end{align}
- Choose two vertices {{math|s, t ∈ X}} and find a minimum {{math|s-t}} cut {{math|(A′, B′)}} in {{mvar|G'}}.
- :Set
- Set
- :For each do:
- :#Set if otherwise set
- :#Set
- :#Set
- :Set
- :Set
- :Go to step 2.
- Replace each by {{mvar|v}} and each by {{math|(u, v)}}. Output {{mvar|T}}.
Analysis
Using the submodular property of the capacity function {{mvar|c}}, one has
Then it can be shown that the minimum {{math|s-t}} cut in {{mvar|G'}} is also a minimum {{math|s-t}} cut in {{mvar|G}} for any {{math|s, t ∈ X}}.
To show that for all for some {{math|p ∈ P}}, {{math|q ∈ Q}} throughout the algorithm, one makes use of the following lemma,
: For any {{mvar|i, j, k}} in {{mvar|VG}},
The lemma can be used again repeatedly to show that the output {{mvar|T}} satisfies the properties of a Gomory–Hu Tree.
Example
The following is a simulation of the Gomory–Hu's algorithm, where
- green circles are vertices of T.
- red and blue circles are the vertices in G
' . - grey vertices are the chosen s and t.
- red and blue coloring represents the s-t cut.
- dashed edges are the s-t cut-set.
- A is the set of vertices circled in red and B is the set of vertices circled in blue.
class="wikitable" style="text-align:center; width:800px;" border="1" |
width="15px" |
! G ! T |
---|
| 300px
| 300px |
| align="left" colspan="2" |
:1. Set VT = {VG} = { {0, 1, 2, 3, 4, 5} } and ET = ∅. :2. Since VT has only one vertex, choose X = VG = {0, 1, 2, 3, 4, 5}. Note that | X | = 6 ≥ 2. |
1.
| 300px | 300px |
| align="left" colspan="2" |
: 3. Since T\X = ∅, there is no contraction and therefore G : 4. Choose s = 1 and t = 5. The minimum s-t cut (A : Set A = {0, 1, 2, 4} and B = {3, 5}. : 5. Set VT = (VT\X) ∪ {A ∩ X, B ∩ X} = { {0, 1, 2, 4}, {3, 5} }. : Set ET = { ({0, 1, 2, 4}, {3, 5}) }. : Set w( ({0, 1, 2, 4}, {3, 5}) ) = c : Go to step 2. : 2. Choose X = {3, 5}. Note that | X | = 2 ≥ 2. |
2.
| 300px | 300px |
| align="left" colspan="2" |
: 3. {0, 1, 2, 4} is the connected component in T\X and thus S = { {0, 1, 2, 4} }. : Contract {0, 1, 2, 4} to form G :: c :: c :: c : 4. Choose s = 3, t = 5. The minimum s-t cut (A : Set A = {0, 1, 2, 3, 4} and B = {5}. : 5. Set VT = (VT\X) ∪ {A ∩ X, B ∩ X} = : Since (X, {0, 1, 2, 4}) ∈ ET and {0, 1, 2, 4} ⊂ A, replace it with (A ∩ X, Y) = ({3}, {0, 1, 2 ,4}). : Set ET = { ({3}, {0, 1, 2 ,4}), ({3}, {5}) } with :: w(({3}, {0, 1, 2 ,4})) = w((X, {0, 1, 2, 4})) = 6. :: w(({3}, {5})) = c : Go to step 2. : 2. Choose X = {0, 1, 2, 4}. Note that | X | = 4 ≥ 2. |
3.
| 300px | 300px |
| align="left" colspan="2" |
: 3. { {3}, {5} } is the connected component in T\X and thus S = { {3, 5} }. : Contract {3, 5} to form G :: c :: c :: c : 4. Choose s = 1, t = 2. The minimum s-t cut (A : Set A = {1, 3, 4, 5} and B = {0, 2}. : 5. Set VT = (VT\X) ∪ {A ∩ X, B ∩ X} = { {3}, {5}, {1, 4}, {0, 2} }. : Since (X, {3}) ∈ ET and {3} ⊂ A, replace it with (A ∩ X, Y) = ({1, 4}, {3}). : Set ET = { ({1, 4}, {3}), ({3}, {5}), ({0, 2}, {1, 4}) } with :: w(({1, 4}, {3})) = w((X, {3})) = 6. :: w(({0, 2}, {1, 4})) = c : Go to step 2. : 2. Choose X = {1, 4}. Note that | X | = 2 ≥ 2. |
4.
| 300px | 300px |
| align="left" colspan="2" |
: 3. { {3}, {5} }, { {0, 2} } are the connected components in T\X and thus S = { {0, 2}, {3, 5} } : Contract {0, 2} and {3, 5} to form G :: c :: c :: c :: c :: c : 4. Choose s = 1, t = 4. The minimum s-t cut (A : Set A = {1, 3, 5} and B = {0, 2, 4}. : 5. Set VT = (VT\X) ∪ {A ∩ X, B ∩ X} = { {3}, {5}, {0, 2}, {1}, {4} }. : Since (X, {3}) ∈ ET and {3} ⊂ A, replace it with (A ∩ X, Y) = ({1}, {3}). : Since (X, {0, 2}) ∈ ET and {0, 2} ⊂ B, replace it with (B ∩ X, Y) = ({4}, {0, 2}). : Set ET = { ({1}, {3}), ({3}, {5}), ({4}, {0, 2}), ({1}, {4}) } with :: w(({1}, {3})) = w((X, {3})) = 6. :: w(({4}, {0, 2})) = w((X, {0, 2})) = 6. :: w(({1}, {4})) = c : Go to step 2. : 2. Choose X = {0, 2}. Note that | X | = 2 ≥ 2. |
5.
| 300px | 300px |
| align="left" colspan="2" |
: 3. { {1}, {3}, {4}, {5} } is the connected component in T\X and thus S = { {1, 3, 4, 5} }. : Contract {1, 3, 4, 5} to form G :: c :: c :: c : 4. Choose s = 0, t = 2. The minimum s-t cut (A : Set A = {0} and B = {1, 2, 3 ,4 ,5}. : 5. Set VT = (VT\X) ∪ {A ∩ X, B ∩ X} = { {3}, {5}, {1}, {4}, {0}, {2} }. : Since (X, {4}) ∈ ET and {4} ⊂ B, replace it with (B ∩ X, Y) = ({2}, {4}). : Set ET = { ({1}, {3}), ({3}, {5}), ({2}, {4}), ({1}, {4}), ({0}, {2}) } with :: w(({2}, {4})) = w((X, {4})) = 6. :: w(({0}, {2})) = c : Go to step 2. : 2. There does not exist X∈VT with | X | ≥ 2. Hence, go to step 6. |
6.
| align="center" colspan="2" | |
| align="left" colspan="2" |
: 6. Replace VT = { {3}, {5}, {1}, {4}, {0}, {2} } by {3, 5, 1, 4, 0, 2}. : Replace ET = { ({1}, {3}), ({3}, {5}), ({2}, {4}), ({1}, {4}), ({0}, {2}) } by { (1, 3), (3, 5), (2, 4), (1, 4), (0, 2) }. : Output T. Note that exactly | V | − 1 = 6 − 1 = 5 times min-cut computation is performed. |
Implementations: Sequential and Parallel
Gusfield's algorithm can be used to find a Gomory–Hu tree without any vertex contraction in the same running time-complexity, which simplifies the implementation of constructing a Gomory–Hu Tree.{{cite journal
| doi = 10.1137/0219009
| last = Gusfield | first = Dan
| title = Very Simple Methods for All Pairs Network Flow Analysis
| journal = SIAM J. Comput.
| volume = 19
| issue = 1
| pages = 143–155
| year = 1990
}}
Andrew V. Goldberg and K. Tsioutsiouliklis implemented the Gomory-Hu algorithm and Gusfield algorithm, and performed an experimental evaluation and comparison.{{cite journal|last=Goldberg|first=A. V.|author2=Tsioutsiouliklis, K.|title=Cut Tree Algorithms: An Experimental Study|journal=Journal of Algorithms|year=2001|volume=38|issue=1|pages=51–83|doi=10.1006/jagm.2000.1136 }}
Cohen et al. report results on two parallel implementations of Gusfield's algorithm using OpenMP and MPI, respectively.{{cite conference
| last1 = Cohen | first1 = Jaime
| last2 = Rodrigues | first2 = Luiz A.
| last3 = Silva | first3 = Fabiano
| last4 = Carmo | first4 = Renato
| last5 = Guedes | first5 = André Luiz Pires
| last6 = Duarte | first6 = Jr., Elias P.
| editor1-last = Xiang | editor1-first = Yang
| editor2-last = Cuzzocrea | editor2-first = Alfredo
| editor3-last = Hobbs | editor3-first = Michael
| editor4-last = Zhou | editor4-first = Wanlei
| contribution = Parallel implementations of Gusfield's cut tree algorithm
| doi = 10.1007/978-3-642-24650-0_22
| pages = 258–269
| publisher = Springer
| series = Lecture Notes in Computer Science
| title = Algorithms and Architectures for Parallel Processing – 11th International Conference, ICA3PP, Melbourne, Australia, October 24–26, 2011, Proceedings, Part I
| volume = 7016
| year = 2011| isbn = 978-3-642-24649-4
}}
Related concepts
In planar graphs, the Gomory–Hu tree is dual to the minimum weight cycle basis, in the sense that the cuts of the Gomory–Hu tree are dual to a collection of cycles in the dual graph that form a minimum-weight cycle basis.{{cite journal
| last1 = Hartvigsen | first1 = D.
| last2 = Mardon | first2 = R.
| doi = 10.1137/S0895480190177042
| issue = 3
| journal = SIAM J. Discrete Math.
| pages = 403–418
| title = The all-pairs min cut problem and the minimum cycle basis problem on planar graphs
| volume = 7
| year = 1994}}.
See also
References
{{reflist}}
- {{cite book | author = B. H. Korte, Jens Vygen | title = Combinatorial Optimization: Theory and Algorithms (Algorithms and Combinatorics, 21) | url = https://archive.org/details/combinatorialopt00kort_232 | url-access = limited | chapter = 8.6 Gomory–Hu Trees | year = 2008 | publisher = Springer Berlin Heidelberg | isbn = 978-3-540-71844-4 | pages = [https://archive.org/details/combinatorialopt00kort_232/page/n189 180]–186}}
{{DEFAULTSORT:Gomory-Hu tree}}