Max-Flow Min-Cut Applications:
description
Transcript of Max-Flow Min-Cut Applications:
Max-Flow Min-Cut Applications:
Open-Pit Mining
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.
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.
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.
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
Maximum Flow Formulation
• Wij = Vij - C =Vij = value of g old in block (i,j)C = cost of excavating a block
• If Wij < 0add an arc from node (i,j) to t with capacity –Wijblock (i,j) has value 0 and cost Wij
• If Wij > 0 add an arc from s to node (i,j) with capacity Wij block (i,j) has value Wij and cost 0
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
100100
100
Optimal Solution: v = 700
1,1 1,2 1,3 1,4 1,5
2,1 2,2 2,4
3,1
s
t
(300,400)
(400,400)
(100,)(300, )
(100,)
(100, 100)
Minimum Cut
1,1 1,2
1,3 1,4 1,52,1 2,2
2,4
3,1
s
t
400
100
100 100
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 blocks in T
– Arcs from nodes in S to t » Capacity = cost of excavating S
• u[s,t] = value of T + cost of S
s
Minimum Cut Example
(i,j)
t
capacity arcs can’t be in the minimum cut
Arcs with capacity c from each block needed to mine (i,j) will be in the minimum cut
Meaning of the Minimum Cut
• u[S,T] = 400 + 300 = 700• Value of Gold in T: VG(T) = 400• Cost of Mining S: CM(S) = 300• u[S,T] = VG(T) + CM(S)• Min u[S,T] = Min (VG(T) + CM(S))• Min (VG(T) + CM(S)) =
Max (-VG(T) – CM(S))
Maximizing Profit
Solving the max flow problem gives us the Max –VG(T) – CM(S)
Let G*= total value of available goldG* is a constantMax –VG(T) – CM(S) = Max G*-VG(T)-CM(S) = Max VG(S) +VG(T) - VG(T) – CM(S) = Max VG(S) – CM(S) = profit from mining blocks in S