Advertisement
Guest User

Untitled

a guest
May 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. # list of nodes
  2. nodes = [1,2,3,4]
  3.  
  4. # supply or demand of nodes
  5. #NodeID : [Supply,Demand]
  6. nodeData = {1:[5,0],
  7. 2:[0,0],
  8. 3:[0,0],
  9. 4:[0,5]}
  10.  
  11.  
  12.  
  13. # arcs list
  14. arcs = [ (1,2),
  15. (1,3),
  16. (2,3),
  17. (2,4),
  18. (3,4)]
  19.  
  20. # arcs cost, lower bound and capacity
  21. #Arc : [Cost,MinFlow,MaxFlow]
  22. arcData = { (1,2):[2,0,4],
  23. (1,3):[2,0,2],
  24. (2,3):[1,0,2],
  25. (2,4):[3,0,3],
  26. (3,4):[1,0,5] }
  27.  
  28.  
  29.  
  30. WYNIK :
  31. ('Route_(1,_2)', '=', 3.0)
  32. ('Route_(1,_3)', '=', 2.0)
  33. ('Route_(2,_3)', '=', 2.0)
  34. ('Route_(2,_4)', '=', 1.0)
  35. ('Route_(3,_4)', '=', 4.0)
  36. ('Total Cost of Transportation = ', 19.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement