Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Network Simplex

Ed4015bc3fe175aff40fb1def164df8f?s=47 jojonki
June 25, 2021

Network Simplex

Solve a simple optimal transform problem by Network Simplex algorithm.

Ed4015bc3fe175aff40fb1def164df8f?s=128

jojonki

June 25, 2021
Tweet

Transcript

  1. Network Simplex Twitter @jojonki

  2. Enjoy! • We will solve an optimal transform problem by

    Network Simplex method. • An example and its solution follows the article below. • Transportation Problem: Transportation Simplex Method by Rodion Chachura. • https://geekrodion.medium.com/transportation-problem-balancing- fc95df5c6677 • I strongly recommend that you read through the article in advance.
  3. Example (given) 30 70 50 Supply Demand 40 30 40

    40 10 8 5 4 7 6 6 8 2 2 2 1 Cost
  4. North West Corner Rule 30 70 50 Supply Demand 40

    30 40 40
  5. North West Corner Rule 0 70 50 Supply Demand 30

    10 30 40 40 Transportation amount
  6. North West Corner Rule 0 60 50 Supply Demand 30

    10 0 30 40 40
  7. North West Corner Rule 0 30 50 Supply Demand 30

    10 30 0 0 40 40
  8. North West Corner Rule 0 0 50 Supply Demand 30

    10 30 30 0 0 10 40
  9. North West Corner Rule 0 0 40 Supply Demand 30

    10 30 30 10 0 0 0 40
  10. North West Corner Rule 0 0 0 Supply Demand 30

    10 30 30 10 40 0 0 0 0 Initial basic feasible solution
  11. 10 8 5 4 7 6 6 8 2 2

    2 1 North West Corner Rule 0 0 0 Supply Demand 30 10 30 30 10 40 0 0 0 0 Total cost = 30*2 + 10*10 + 30*8 + 30*5 + 10*6 + 40*6 = 930
  12. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=? u3=? Supply Demand 30 10 30 30 10 40 v1=? v2=? v3=? v4=? Set u1=0 Basic variables
  13. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=? u3=? Supply Demand 30 10 30 30 10 40 v1=2 v2=? v3=? v4=?
  14. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=? Supply Demand 30 10 30 30 10 40 v1=2 v2=? v3=? v4=?
  15. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=? Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=? v4=?
  16. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=? Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=?
  17. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=9 Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=?
  18. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=9 Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=-1
  19. 10 8 5 4 7 6 6 8 2 2

    2 1 Check feasibility u1=0 u2=8 u3=9 Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=-1 -2 -5 -2 3 4 3 Calculate w for all non-basic variables Illegal edges which does not meet the constraint Maximum value → Entering variable
  20. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot u1=0 u2=8 u3=9 Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=-1 Specify the loop
  21. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot u1=0 u2=8 u3=9 Supply Demand 30 10 30 30 10 40 v1=2 v2=0 v3=-3 v4=-1 Find an odd cell (blue) with the smallest value → 10 Yellow: even cell Blue: odd cell
  22. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot u1=0 u2=8 u3=9 Supply Demand 30 10-10 30 30+10 10-10 40 v1=2 v2=0 v3=-3 v4=-1 Yellow: even cell Blue: odd cell 0+10 Update values in the loop
  23. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot u1=0 u2=8 u3=9 Supply Demand 30 0 30 40 40 v1=2 v2=0 v3=-3 v4=-1 10 Successfully update the solution! Total cost = 30*2 + 30*8 + 40*5 + 10*7 + 40*8 = 890 ← 930 0 Drop this cell (smallest odd cell) from the basic variables.
  24. 10 8 5 4 7 6 6 8 2 2

    2 1 Again, check feasibility Supply Demand 30 30 40 40 10 u1=0 u2=? u3=? v1=? v2=? v3=? v4=? Set u1=0 0
  25. 10 8 5 4 7 6 6 8 2 2

    2 1 Again, check feasibility Supply Demand 30 30 40 40 10 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 0
  26. 10 8 5 4 7 6 6 8 2 2

    2 1 Again, check feasibility Supply Demand 30 30 40 40 10 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 -2 -5 2 7 -4 -1 Calculate w for all non-basic variables 0 Illegal edges which does not meet the constraint
  27. 10 8 5 4 7 6 6 8 2 2

    2 1 Again, check feasibility Supply Demand 30 30 40 40 10 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 -2 -5 2 7 -4 -1 0 Maximum value → Entering variable
  28. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot Supply Demand 30 30 40 40 10 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 0 Specify the loop Yellow: even cell Blue: odd cell Find an odd cell (blue) with the smallest value → 0
  29. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot Supply Demand 30 30 40 40-0 10+0 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 0-0 Yellow: even cell Blue: odd cell 0+0 Update values in the loop
  30. 10 8 5 4 7 6 6 8 2 2

    2 1 Looping pivot Supply Demand 30 30 40 40 10 u1=0 u2=8 u3=5 v1=2 v2=0 v3=-3 v4=3 0 Successfully update the solution! Total cost = 30*2 + 30*8 + 40*5 + 10*7 + 40*8 = 890 ← 890 Not getting worse!
  31. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 40 40 10 0 Again, check feasibility u1=0 u2=? u3=? Set u1=0 v1=? v2=? v3=? v4=?
  32. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 40 40 10 0 Again, check feasibility u1=0 u2=1 u3=5 v1=2 v2=7 v3=4 v4=3
  33. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 40 40 10 0 Again, check feasibility u1=0 u2=1 u3=5 v1=2 v2=7 v3=4 v4=3 5 2 2 -7 3 6 Calculate w for all non-basic variables Maximum value → Entering variable
  34. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 40 40 10 0 Looping pivot u1=0 u2=1 u3=5 v1=2 v2=7 v3=4 v4=3 Find an odd cell (blue) with the smallest value → 30
  35. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 40 10 10 30 Looping pivot u1=0 u2=1 u3=5 v1=2 v2=7 v3=4 v4=3 Update values in the loop 30
  36. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 40 10 10 30 Looping pivot u1=0 u2=1 u3=5 v1=2 v2=7 v3=4 v4=3 30 Successfully update the solution! Total cost = 30*2 + 40*5 + 30*4 + 10*7 + 30*6 + 10*8 = 710 ← 890
  37. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 40 10 10 30 u1=0 u2=1 u3=5 v1=2 v2=1 v3=4 v4=3 30 Again, check feasibility -1 2 2 -7 3 -6 Calculate w for all non-basic variables Maximum value → Entering variable
  38. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 40 10 10 30 u1=0 u2=1 u3=5 v1=2 v2=1 v3=4 v4=3 30 Looping pivot Find an odd cell (blue) with the smallest value → 10
  39. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 10 40 u1=0 u2=1 u3=5 v1=2 v2=1 v3=4 v4=3 30 Looping pivot Update values in the loop 10
  40. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 10 40 u1=0 u2=4 u3=5 v1=2 v2=1 v3=1 v4=0 30 Again, check feasibility 10 -1 -1 -1 -3 -3 -4 GREAT! No illegal edges. This is the optimal transportation.
  41. 10 8 5 4 7 6 6 8 2 2

    2 1 Supply Demand 30 30 10 40 u1=0 u2=4 u3=5 v1=2 v2=1 v3=1 v4=0 30 Yay! :D 10 Total cost = 30*2 + 30*5 + 40*4 + 10*7 + 30*6 + 10*6 = 680