EMIS 8374 The Maximum Flow Problem Flows and
EMIS 8374 The Maximum Flow Problem: Flows and Cuts Updated 6 March 2008
The Maximum Flow Problem • Defined on a network with – Source node s – Sink node t – All other nodes are transshipment nodes – Arcs have capacities, but no costs • Maximize the total flow from s to t Slide 2
Assumptions 1. The network is directed 2. All capacities are non-negative integers 3. The network does not contain an infinitecapacity path from s to t 4. If (i, j) is in A, then (j, i) is also in A Slide 3
Assumption 4 • If we wish to solve a max flow problem on a network where (i, j) is in A, but (j, i) is not, then we set the capacity of (j, i) to zero. • Arcs with capacity zero will generally not be shown in our examples. Slide 4
LP Formulation of Max Flow Slide 5
Max Flow Example (0, 5) s 2 (0, 2) 4 (0, 4) 1 6 (0, 6) t (0, 7) 3 (0, 5) 5 Slide 6
Max Flow Solution (flow, cap) 2 (4, 5) (2, 2) 4 (2, 4) s 1 6 t (7, 7) (5, 6) 3 (5, 5) 5 v=9 Slide 7
s-t Cuts • An s-t cut is a partition of the nodes into disjoint sets S and T such that s is in S and t is in T. – An arc (i, j) with i in S and j in T is called a forward arc – An arc (i, j) with i in T and j in S is called a backwards arc • The set of forward arcs in an s-t cut is denoted by [S, T] • The capacity of an s-t cut, denoted by u[S, T], is the sum of the capacities of the forward arcs • Removing the forward arcs of an s-t cut from G eliminates all directed paths from the source to the sink. Slide 8
Cut 1: S={1}, T={2, 3, 4, 5, 6} (0, 5) s 2 (0, 2) 4 (0, 4) 1 6 (0, 6) t (0, 7) 3 (0, 5) 5 u[S, T] = 11 Slide 9
Cut 2: S={1, 3, 5}, T={2, 4, 6} (0, 5) s 2 (0, 2) 4 (0, 4) 1 6 (0, 6) t (0, 7) 3 (0, 5) 5 u[S, T] = 12 Slide 10
Cut 3: S={1, 2, 3, 5}, T={4, 6} (0, 5) s 2 (0, 2) 4 (0, 4) 1 6 (0, 6) t (0, 7) 3 (0, 5) 5 u[S, T] = 9 Slide 11
Flow Across Cut 2 • S = {1, 3, 5}, T = {2, 4, 6} – [S, T] = {(1, 2), (5, 6)} – [T, S] = {(2, 5)} • Flow balance constraints for nodes in S – Node 1: x 12 + x 13 = v – Node 3: x 35 – x 13 = 0 – Node 5: x 56 – x 25 – x 35= 0 • Implications § § x 12 + x 56 – x 25 = v v ≤ u[S, T] = 12 Slide 12
Flow Across Cut 2 • S = {1, 3, 5}, T = {2, 4, 6} – [S, T] = {(1, 2), (5, 6)} – [T, S] = {(2, 5)} • Flow balance constraints for nodes in S – Node 1: x 12 + x 13 = v – Node 3: x 35 – x 13 = 0 – Node 5: x 56 – x 25 – x 35= 0 • Implication: x 12 + x 56 – x 25 = v v = x[S, T] - x[T, S] where x[S, T] and x[S, T] denote the total flow on the forward and backward arcs, respectively. Slide 13
Flow Across a Generic s-t Cut Slide 14
Max Flow Example 2 2 5 s 4 2 1 6 3 4 t 5 Slide 15
Max Flow Example 2: LP Slide 16
Max Flow Example 2: Flow Balance Constraints 2 1 4 3 Slide 17
Max Flow Example 2: LP Dual Slide 18
Max Flow Example 2: LP Dual Slide 19
Max Flow Example 2: LP Dual Slide 20
Max Flow Example 2: LP Dual Solutions 1. Let y 1 = 0 and yi = 1 for i in {2, 3, 4} • • • z 12 = z 13 = 1 z 23 = z 24 = z 34 = 0 Objective function value = 5 + 6 = 11 2. Let y 4 = 1 and yi = 0 for i in {1, 2, 3} • • • z 24 = z 34 = 1 z 12 = z 13 = z 23 = 0 Objective function value = 4 + 5 = 9 Slide 21
Max Flow Example 2: LP Dual Solutions 3. Let y 1 = y 2 = 0 and y 3 = y 4 = 1 • • • z 13 = z 24 = 1 z 12 = z 34 = 0 Objective function value = 6 + 2 + 4 = 12 4. Let y 1 = y 3 = 0 and y 2 = y 4 = 1 • • • z 12 = z 34 = 1 z 13 = z 24 = 0 Objective function value = 5 + 5 = 10 Slide 22
Max Flow Example 2: LP Dual Solutions 5. Let y 1 = 0, and y 2 = y 3 = 0. 5, and y 4 = 1 • • • z 12 = z 13 = z 24 = z 34 = 1 z 23 = 0 Objective function value = 10 • For every s-t cut there is a corresponding dual solution, but not every dual solution corresponds to an s-t cut Slide 23
LP Dual of the Max Flow Problem Slide 24
s-t Cut Solutions to Dual of Max Flow LP • Given any s-t Cut in G a feasible solution to the dual with objective function value u[S, T] can be obtained by letting yi = 0 if i is in S and yi = 1 if i is in T § yt – ys = 1 – 0 = 1 § If arc (i, j) is a forward arc in the cut, yj – yi = 1 which forces zij = 1 § zij = 0 for all other arcs § The objective function value is the capacity of the cut Slide 25
Property 6. 1 • For any maximum flow problem – the value of any feasible flow is less than or equal to the capacity of any s-t cut – the value of the maximum flow is less than or equal to the capacity of a minimum-capacity cut (i. e. , a minimum cut) Slide 26
- Slides: 26