1 / 27

The Capacity Scaling Algorithm Implementation

Dive into the details of implementing The Capacity Scaling Algorithm with step-by-step instructions and examples for optimal results.

afarr
Download Presentation

The Capacity Scaling Algorithm Implementation

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. 15.082 and 6.855J The Capacity Scaling Algorithm

  2. The Original Costs and Node Potentials 0 0 4 2 4 7 5 2 1 1 0 6 2 3 5 0 0

  3. The Original Capacities and Supplies/Demands 5 -2 10 2 4 30 25 23 20 1 20 20 25 3 5 -7 -19

  4. Set  = 16. This begins the -scaling phase. 5 -2 10 We send flow from nodes with excess   to nodes with deficit  . 2 4 30 25 23 20 1 20 We ignore arcs with capacity  . 20 25 3 5 -7 -19

  5. Select a supply node and find the shortest paths shortest path distance 7 8 4 2 4 7 0 5 The shortest path tree is marked in bold and blue. 2 1 1 6 2 3 5 8 6

  6. Update the Node Potentials and the Reduced Costs -7 -8 4 3 2 4 7 To update a node potential, subtract the shortest path distance. 5 0 0 2 6 1 1 1 0 0 6 2 3 5 0 -6 -8

  7. Send Flow Along a Shortest Path in G(x, 16) 5 -2 10 Send flow from node 1 to node 5. 2 4 30 25 23 20 1 1 How much flow should be sent? 20 20 3 25 5 -7 -19

  8. Update the Residual Network 5 -2 10 19 units of flow were sent from node 1 to node 5. 2 4 30 23 25 4 20 1 1 20 19 1 19 3 5 6 -19 -7 0

  9. This ends the 16-scaling phase. 5 -2 10 2 4 The -scaling phase continues whene(i)  for some i. e(j)  - for some j. There is a path from i to j. 30 25 4 20 1 1 20 19 1 19 3 5 6 0 -7

  10. This begins and ends the 8-scaling phase. 5 -2 10 2 4 The -scaling phase continues whene(i)  for some i. e(j)  - for some j. There is a path from i to j. 30 25 4 20 1 1 20 19 1 19 3 5 6 0 -7

  11. This begins 4-scaling phase. 5 -2 10 2 4 What would we do if there were arcs with capacity at least 4 and negative reduced cost? 30 25 4 20 1 1 20 19 1 19 3 5 6 0 -7

  12. Select a “large excess” node and find shortest paths. -7 -8 3 2 4 0 The shortest path tree is marked in bold and blue. 0 6 1 1 1 0 0 0 0 3 5 0 -6 -8

  13. Update the Node Potentials and the Reduced Costs -11 -7 -8 0 To update a node potential, subtract the shortest path distance. 2 4 1 0 2 1 1 0 0 Note: low capacity arcs may have a negative reduced cost 4 -4 0 3 5 0 -6 -8 -12 -10

  14. Send Flow Along a Shortest Path in G(x, 4). 5 -2 10 2 4 Send flow from node 1 to node 7 30 25 4 20 1 1 20 How much flow should be sent? 19 1 19 3 5 6 0 -7

  15. Update the Residual Network 5 -2 6 2 4 4 units of flow were sent from node 1 to node 3 4 26 0 25 4 4 20 1 1 16 19 4 1 15 3 5 10 -7 0 -3

  16. This ends the 4-scaling phase. 5 -2 6 2 4 4 26 There is no node j with e(j)  -4. 25 0 4 20 1 1 16 19 4 1 15 3 5 10 -3 0

  17. Begin the 2-scaling phase 5 -2 6 There is no node j with e(j)  -4. 2 4 4 26 25 0 4 What would we do if there were arcs with capacity at least 4 and negative reduced cost? 20 1 1 16 19 4 1 15 3 5 10 -3 0

  18. Send flow along a shortest path 5 -2 6 2 4 Send flow from node 2 to node 4 4 26 25 0 4 20 1 1 16 19 4 How much flow should be sent? 1 15 3 5 10 -3 0

  19. Update the Residual Network 3 0 5 -2 4 2 4 2 units of flow were sent from node 2 to node 4 6 26 25 0 4 20 1 1 16 19 4 1 15 3 5 10 -3 0

  20. Send Flow Along a Shortest Path 3 0 4 2 4 Send flow from node 2 to node 3 6 26 25 0 4 20 1 1 16 19 4 How much flow should be sent? 1 15 3 5 10 -3 0

  21. Update the Residual Network 0 3 0 1 2 4 3 units of flow were sent from node 2 to node 3 9 26 25 0 4 20 1 1 13 19 7 1 12 3 5 13 -3 0 0

  22. This ends the 2-scaling phase. 0 0 1 2 4 Are we optimal? 9 26 25 0 4 20 1 1 13 19 7 1 12 3 5 13 0 0

  23. Begin the 1-scaling phase. 0 0 1 2 4 Saturate any arc whose capacity is at least 1 and with negative reduced cost. 9 26 25 0 4 20 1 1 13 19 7 1 12 3 5 13 reduced cost is negative 0 0

  24. Update the Residual Network 0 0 1 2 4 Send flow from node 3 to node 1. 9 26 25 -1 4 20 1 1 13 20 Note: Node 1 is now a node with deficit 7 12 3 5 13 1 0

  25. Update the Residual Network 0 0 2 2 4 1 unit of flow was sent from node 3 to node 1. 8 27 25 0 3 20 1 1 14 20 6 Is this flow optimal? 13 3 5 12 0 0

  26. The Final Optimal Flow 5 -2 10,8 2 4 30,3 25 23 20 1 20,6 20,20 25,13 3 5 -7 -19

  27. The Final Optimal Node Potentials and the Reduced Costs -7 -11 0 2 4 Flow is at lower bound. 1 0 2 1 0 0 -4 3 5 Flow is at upper bound 0 -10 -12

More Related