1 / 41

ENGM 792 Network Flow Programming

ENGM 792 Network Flow Programming. Minimum Cost Flow Solutions. Minimum Cost Flow Solutions. Primal Algorithm Find an initial network flow that satisfies primal feasibility Determine is network is optimal. If so, stop. If not, go to 3. Modify network flow, return to step 2.

roch
Download Presentation

ENGM 792 Network Flow Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ENGM 792Network Flow Programming Minimum Cost Flow Solutions

  2. Minimum Cost Flow Solutions • Primal Algorithm • Find an initial network flow that satisfies primal feasibility • Determine is network is optimal. If so, stop. If not, go to 3. • Modify network flow, return to step 2.

  3. Minimum Cost Flow Solutions • Initial feasible solution • Maximal flow • Use of artificial arcs

  4. Initial Feasible (Max Flow) (2,1) (2,-3) 7 (1,4) 1 4 [-2] [4] 1 (2,2) (2,5) 2 3 (4,3) (4,3) 4 (2,1) 2 5 [3] [-3] 5 6 (3,3) (2,6) 7 8 [3] (1,5) 3 6 [-6] 9

  5. Initial Feasible (Max Flow) [0] 7 [bfi] (flow, capacity) [3] [1] Start at top and assign Max flow to each arc Assign 1 unit flow arc 1 Need to satisfy 3 more Units of supply Need one more unit at Node 4 (1,1) 1 4 [-2] [4] 1 2 5 [3] [-3] [3] 3 6 [-6]

  6. Initial Feasible (Max Flow) [0] 7 [bfi] (flow, capacity) [1] [-1] Start at top and assign Max flow to each arc Assign 1 unit to arc 1, 2 units to arc 2 Need to satisfy 1 more Unit of supply (1,1) 1 4 [3] 1 (2,2) 2 [-1] 2 5 [3] [-3] [3] 3 6 [-6]

  7. Initial Feasible (Max Flow) [0] 7 [bfi] (flow, capacity) [0] [-1] Start at top and assign Max flow to each arc Assign 1 unit to arc 1, 2 units to arc 2 1 unit to arc 3 Arc 3 could take 3 more Units of flow, but supply Is exhausted (1,1) 1 4 [1] 1 (2,2) 2 3 (1,4) 2 5 [-1] [3] [-5] [3] 3 6 [-6]

  8. Initial Feasible (Max Flow) [0] 7 [bfi] (fk,ck) [0] [0] (1,1) 1 4 [-2] [4] (2,2) (1,2) (1,4) [0] [0] (1,2) 2 5 [3] [-3] (1,3) [-4] [3] [3] 3 6 [-6]

  9. Initial Feasible (Max Flow) [0] 7 [bfi] (fk,ck) [0] [0] (1,1) 1 4 [-2] Arc 3 to 6 now at capacity, But we still need to meet 2 units of supply at node 3 Max flow says look at arc 3 to 4 and arc 3 to 5 [4] (2,2) (1,2) (1,4) [0] [0] (1,2) 2 5 [3] [-3] (1,3) [-3] [2] [3] (1,1) 3 6 [-6]

  10. Initial Feasible (Max Flow) [0] 7 [bfi] (fk,ck) [0] [0] Arc 3 to 6 now at capacity, But we still need to meet 2 units of supply at node 3 Max flow says look at arc 3 to 4 and arc 3 to 5 Arc 3 to 4 allows us to meet Supply at node 3. We remove Arc 1 to 4 since it forces us to Exceed demand at 4 1 4 [-2] [4] (2,2) (2,4) [0] [0] (1,2) 2 5 [3] [-3] (2,4) (2,3) [-1] [0] [3] (1,1) 3 6 [-6]

  11. Initial Feasible (Max Flow) [-1] (1,2) (0,2) 7 [bfi] (flow, capacity) Final max flow Solution Initial feasible solution Is it basic ? 1 4 [0] [0] (1,2) (2,4) (3,4) (1,2) 2 5 [0] [0] (1,2) (2,3) [0] (1,1) 3 6 [0]

  12. Initial Feasible (Max Flow) (2,1) (2,-3) 7 (1,4) 1 4 [-2] [4] 1 (2,2) (2,5) 2 3 (4,3) (4,3) 4 (2,1) 2 5 [3] [-3] 5 6 (3,3) (2,6) 7 8 [3] (1,5) 3 6 [-6] 9

  13. Initial Feasible (Max Flow) [-1] (1,2) (0,2) 7 [bfi] (flow, capacity) Final max flow Solution Initial feasible solution Is it basic ? We essentially have 3 supply nodes, 1 dummy supply, and 3 demand nodes or n+m-1=6 . A basic feasible will have 6 arcs with flow. We have 8 1 4 [0] [0] (1,2) (2,4) (3,4) (1,2) 2 5 [0] [0] (1,2) (2,3) [0] (1,1) 3 6 [0]

  14. Initial Feasible (Artificial Arc) (6,6,R) (3,3,R) 7 (3,3,R) (3,3,R) (Flow, capacity, cost) (2,2,R) (4,4,R) We must add the possibility Of a slack flow since demand Exceeds supply 1 4 [4] [-2] 2 5 [3] [-3] 3 6 [-6] [3]

  15. Initial Feasible (Artificial Arc) (0,2,1) (6,6,R) (3,3,R) 7 (3,3,R) (3,3,R) Flow, capacity, cost) (2,2,R) (4,4,R) (0,2,-3) Note that we have 7 Nodes; n+m-1 = 6 We have 6 arcs with flow Initial basic feasible soln. We now add in remaining Arcs with zero flow. 1 4 [4] [-2] 2 5 [3] [-3] 3 6 [-6] [3]

  16. Initial Feasible (Artificial Arc) (0,2,1) (6,6,R) (3,3,R) 7 (3,3,R) (3,3,R) Flow, capacity, cost) (2,2,R) (4,4,R) (0,2,-3) (0,4) 1 4 1 (0,2) (0,5) [4] [-2] 2 3 (0,3) (0,3) 4 (0,1) 2 5 5 6 [3] [-3] (0,3) (0,6) 7 8 (0,5) 3 6 9 [-6] [3]

  17. Moving to a Solution • For each basic arc • For each non-basic arc

  18. Moving to a Solution • For each basic arc • For each non-basic arc

  19. Initial Feasible (Max Flow) (flow, capacity, cost) (1,2,1) (0,2,-3) 7 (0,1,4) (0,2,2) 1 4 (2,4,3) (2,2,5) 2 5 (0,2,1) (1,2,6) (2,4,3) 3 (3,3,3) 6 (1,1,5)

  20. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 Six basic arcs For each basic arc, We start with 7 = 0 (0,1,4) (0,2,2) 1 4 1 (2,4,3) 4 7 (2,2,5) 2 2 5 (0,2,1) 5 (1,2,6) 8 (2,4,3) 3 3 (3,3,3) 6 6 (1,1,5) 9

  21. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 Six basic arcs For each basic arc, We start with 7 = 0 3= 0 + 1 = 1 (0,1,4) (0,2,2) 1 4 1 (2,4,3) 4 7 (2,2,5) 2 2 5 (0,2,1) 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 6 (1,1,5) 9

  22. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 Six basic arcs For each basic arc, We start with 7 = 0 3= 0 + 1 = 1 4= 1 + 3 = 4 (0,1,4) (0,2,2) 1 4 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 6 (1,1,5) 9

  23. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} Six basic arcs For each basic arc, We start with 7 = 0 3= 0 + 1 = 1 4= 1 + 3 = 4 (0,1,4) (0,2,2) 1 4 [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  24. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, We start with d10 = 4+-3-0 = 1 (0,1,4) (0,2,2) 1 4 [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  25. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, We start with d10 = 4+-3-0 = 1 d1= 2+4-4 = 2 {2} (0,1,4) (0,2,2) 1 4 [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  26. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, We start with d10 = 4+-3-0 = 1 d1= 2+4-4 = 2 d4= 2+2-4 = 0 {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  27. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, We start with d10 = 4+-3-0 = 1 d1= 2+4-4 = 2 d4= 2+2-4 = 0 d5= 2+1-7 = -4 {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) {-4} [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  28. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} For each non basic arc, We start with d10 = 4+-3-0 = 1 d1= 2+4-4 = 2 d4= 2+2-4 = 0 d5= 2+1-7 = -4 d9 = 1+5-5 = -1 {dk} {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) {-4} [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) {-1} 9

  29. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, We start with d10 = 4+-3-0 = 1 d1= 2+4-4 = 2 d4= 2+2-4 = 0 d5= 2+1-7 = -4 {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) {-4} [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  30. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, d5= 2+1-7 = -4 This loop allows me to save 4 for each unit of flow which agrees with d5 = -4 {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (2,2,5) 2 2 5 (0,2,1) {-4} [2] [7] 5 (1,2,6) 8 (2,4,3) [1] 3 3 (3,3,3) 6 [5] 6 (1,1,5) 9

  31. Initial Feasible (Max Flow) [j] [0] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 11 10 {1} {dk} For each non basic arc, d5= 2+1-7 = -4 Move the maximum around this loop. Since capacity of d2 is 2, we move 2. {2} (0,1,4) (0,2,2) 1 4 {0} [2] 1 (2,4,3) [4] 4 7 (0,2,5) 2 2 5 (2,2,1) {-4} [2] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [5] 6 (1,1,5) 9

  32. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 1 (2,4,3) 4 7 3 = 0 + 1 = 1 (0,2,5) 2 2 5 (2,2,1) 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 6 (1,1,5) 9

  33. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 [6] 1 (2,4,3) [4] 4 7 3 = 0 + 1 = 1 (0,2,5) 6 = 1 + 5 = 6 2 2 5 (2,2,1) [6] [7] 5 5 = 1 + 6 = 7 (1,2,6) 8 4 = 1 + 3 = 4 2= 7 – 1 = 6 6= 6 + 3 = 9 1= 9 - 3 = 6 (4,4,3) [1] 3 3 (1,3,3) 6 [9] 6 (1,1,5) 9

  34. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 [6] 1 (2,4,3) [4] 4 7 d1= 6+4-4 = 6 d4= 6+2-4 = 4 d2= 6+5-7 = 4 d9= 1+5-9 = -3 (0,2,5) 2 2 5 (2,2,1) [6] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [9] 6 (1,1,5) {-3} 9

  35. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 [6] 1 (2,4,3) [4] 4 7 Note I can move no units of flow since d9 is at capacity (0,2,5) 2 2 5 (2,2,1) [6] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [9] 6 (1,1,5) {-3} 9

  36. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 1 (2,4,3) 4 7 Note I can move no units of flow since d9 is at Capacity Arc d9 enters basis, arc d2 leaves basis (0,2,5) 2 2 5 (2,2,1) 5 (1,2,6) 8 (4,4,3) 3 3 (1,3,3) 6 6 (1,1,5) 9

  37. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find (0,2,2) 1 4 1 [3] (2,4,3) [4] 4 7 3 = 0 + 1 = 1 5= 1 + 6 = 7 6= 1 + 5 = 6 2= 6 - 3 = 3 4= 1 + 3 = 4 1 = 6 - 3 = 3 (0,2,5) 2 2 5 (2,2,1) [3] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [6] 6 (1,1,5) 9

  38. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find Find (0,2,2) 1 4 1 [3] (2,4,3) [4] 4 7 d1= 3+4-4 = 3 d4= 3+2-4 = 1 d5= 3+1-7 = -3 d10 = 4+-3-1 = 1 (0,2,5) 2 2 5 (2,2,1) [3] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [6] 6 (1,1,5) 9

  39. Recall • For each basic arc • For each non-basic arc

  40. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find Find (0,2,2) 1 4 1 [3] (2,4,3) [4] 4 7 d1= 3+4-4 = 3 d4= 3+2-4 = 1 d5= 7-1-3 = 3 d10 = 4+-3-1 = 1 (0,2,5) 2 2 5 (2,2,1) [3] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [6] 6 (1,1,5) 9

  41. Initial Feasible (Max Flow) [0] [j] (flow, capacity, cost) (1,2,1) (0,2,-3) 7 {dk} 11 10 (0,1,4) Find Find (0,2,2) 1 4 1 [3] (2,4,3) [4] 4 7 d1= 3+4-4 = 3 d4= 3+2-4 = 1 d5= 7-1-3 = 3 d10 = 4+-3-1 = 1 All dk positive, optimal solution (0,2,5) 2 2 5 (2,2,1) [3] [7] 5 (1,2,6) 8 (4,4,3) [1] 3 3 (1,3,3) 6 [6] 6 (1,1,5) 9

More Related