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 t 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 Maximum Flow Formulation • Wij = Vij - C = Vij = value of g old 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 block (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 100 100 t 100 100 100 1,2 1,3 1,4 1,1 100 1,5 100 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 400 400 s Optimal Solution: v = 700 t 1,1 2,1 1,2 2,2 1,3 1,4 1,5 2,4 (100, 100) (100,) (100,) (300, ) (300,400) 3,1 (400,400) s Minimum Cut t 1,1 1,2 100 100 1,3 2,1 100 1,4 1,5 2,2 2,4 3,1 400 s 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 Minimum Cut Example Arcs with capacity c from each block needed to mine (i,j) will be in the minimum cut t s (i,j) capacity arcs can’t 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 gold G* is a constant Max –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