Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H},...
-
Upload
abner-hicks -
Category
Documents
-
view
213 -
download
1
Transcript of Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H},...
![Page 1: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/1.jpg)
Applications of the Max-Flow Min-Cut
Theorem
![Page 2: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/2.jpg)
S-T Cuts
SF
D
H
C
A
NY
5
6
2
4
5
4
7
S = {SF, D, H}, T={C,A,NY}[S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] = 2+4+5 = 11
S = {SF, D, A,C}, T = {H, NY}[S,T] = {(SF,H),(C,NY)}, Cap[S,T] =6 + 4 = 10
Partition the Nodes into SetsS and T.
[S,T] = Arcs from Nodes in Sto Nodes in T.
![Page 3: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/3.jpg)
Maximum-Flow Minimum-Cut Theorem
Removing arcs (D,C) and (A,NY) cuts off SF from NY.
The set of arcs{(D,C), (A,NY)} is an s-t cut with capacity 2+7=9.
The value of a maximum s-t flow = the capacity of a minimum s-t cut.
SF
D
H
C
A
NY
5
6
2
4
5
4
7
SF
D
H
C
A
NY
5
64
5
4
![Page 4: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/4.jpg)
Network Connectivity
An s,t vertex separator of a graph G=(V,E) is a set of vertices whose removal disconnects vertices s and t.
The s,t-connectivity of a graph G is the minimum size of an s,t vertex separator.
The vertex-connectivity of G is the min{s,t-connectivity of G: (s,t) in V}.
![Page 5: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/5.jpg)
Example
1 8
2
3
4
5
6
7
Some Vertex Separators For s=2, t=7: {3, 4, 6}, {1, 4, 8}2,7-connectivity = 3
Some Vertex Separators For s=1, t=8: {4, 5, 6}, {2,3}1,8-connectivity = 2
Vertex-Connectivity = 2
![Page 6: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/6.jpg)
Menger’s Theorem
Given and undirected graph G and two nonadjacent vertices s and t, the maximum number of vertex-disjoint (aside from sharing s and t) paths from s to t is equal to the s,t-connectivity of G.
![Page 7: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/7.jpg)
Maximum Flow Formulation
For G=(V,E), construct the network G’=(N,A) as follows– For each vertex v in V/{s,t}, add nodes v and v’– Add arc (v,v’) with capacity 1– For each edge (u,v) in E, add arcs (u’,v) and (v’,u) with
infinite capacity– For each edge (s,v) in E, add arc (s,v) with infinite
capacity– For each edge (v,t) in E, add arc (v’,t) with infinite
capacity
![Page 8: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/8.jpg)
Proof Lemma 1
– Each set of k vertex-disjoint s,t paths in G, corresponds to exactly one integral flow of value k in G’.
Lemma 2– Each s,t cut of finite capacity c corresponds to an s,t
vertex-separator of size c in G Result follows from Max-Flow Min-Cut
Theorem
![Page 9: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/9.jpg)
Finding the Vertex-Connectivity of G=(N,A)
Let Node 1 be the Source Node s Let c = |N| For i = 2 … |N|
– Let t = i– If s-t Connectivity < c Then
Let c = s-t Connectivity
Return c
Find Vertex-Connectivity of G with |N|-1 Maximum Flow Computations
![Page 10: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/10.jpg)
Mining for Gold Divide a cross-section of earth into a grid of equally-sized
blocks. Given the cost of excavating a full block and the market
value of a full block of gold, determine an optimal shape for the mine.
Constraints on the shape of your mine require that a block of earth cannot be excavated unless the three blocks above it (directly, and diagonally left and right) have also been excavated.
![Page 11: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/11.jpg)
![Page 12: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/12.jpg)
Solution To get the gold in block (2,4), we need to
excavate blocks (1,3), (1,4), (1,5) and (2,4). Revenue = $500, Cost = $400, Profit = $100. Take block (2,4).
To get the gold in block (3,1), we need to excavate blocks (3,1), (2,1), (2,2), (1,1), (1,2) and (1,3). Revenue = $500, Cost = $500*, Profit = $0. Don’t take block (3,1).
* Assuming (1,3) Already Excavated
![Page 13: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/13.jpg)
Maximum Flow Formulation Each Block is a Node Add Infinite Capacity Arc from Node (i,j) to Node (i-1,j-1),
(i-1,j),(i-1,j+1) Add Source Node s and Sink Node t Wij = Vij - C Where
Vij = Value of Gold in Block (i,j)
C = Cost of Excavating a Block If Wij < 0, Add an Arc from Node (i,j) to t with Capacity -
Wij If Wij > 0 Add an Arc from s to Node (i,j) with Capacity Wij
![Page 14: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/14.jpg)
Maximum Flow Network
1,1 1,2 1,3 1,4 1,5
2,1 2,2 2,3 2,4 2,5
3,1 3,2 3,3 3,4 3,5
4,1 4,2 4,3 4,4 4,5
s
t
400
400
100 100100 100
100
![Page 15: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/15.jpg)
Minimum Cut
1,1 1,2 1,3 1,4 1,5
2,1 2,2 2,3 2,4 2,5
3,1 3,2 3,3 3,4 3,5
4,1 4,2 4,3 4,4 4,5
s
t
400
400
100 100100 100
100
Cut:S={s,(2,4)(1,3), (1,4), (1,5)}
T: All Other Nodes
![Page 16: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/16.jpg)
Meaning of the Minimum Cut Excavate all Blocks in S
– Only Finite-Capacity Arcs in Minimum Cut– Blocks in S Can be Excavated Without Excavating Blocks in T
Arcs in [S,T]– Arcs from s to Nodes in T
• Capacity = Value of Gold in T
– Arcs from Nodes in S to t • Capacity = Cost of Excavating S
Cap[S,T] =Value of Gold in T + Cost of Excavating S
![Page 17: Applications of the Max-Flow Min-Cut Theorem. S-T Cuts SF D H C A NY 5 6 2 4 5 4 7 S = {SF, D, H}, T={C,A,NY} [S,T] = {(D,A),(D,C),(H,A)}, Cap [S,T] =](https://reader035.fdocuments.us/reader035/viewer/2022080917/56649ec65503460f94bd15c6/html5/thumbnails/17.jpg)
Maximizing Profit Finding a Maximum Flow Minimizes:
Value of Gold in T + Cost of Excavating S Equivalent to Maximizing:
F = - (Value of Gold in T + Cost of Excavating S ) Equivalent to Maximizing:
Value of All Gold + F =
Value of Gold in S - Cost of Excavating S =
Profit for Excavating S