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

Network Simplex

jojonki
June 25, 2021

Network Simplex

Solve a simple optimal transform problem by Network Simplex algorithm.

jojonki

June 25, 2021
Tweet

More Decks by jojonki

Other Decks in Technology

Transcript

  1. 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.
  2. Example (given) 30 70 50 Supply Demand 40 30 40

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

    10 30 40 40 Transportation amount
  4. North West Corner Rule 0 0 0 Supply Demand 30

    10 30 30 10 40 0 0 0 0 Initial basic feasible solution
  5. 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
  6. 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
  7. 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=?
  8. 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=?
  9. 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=?
  10. 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=?
  11. 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=?
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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.
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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!
  25. 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=?
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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.
  35. 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