Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #shortest part
  2. param numNodes;
  3. set Nodes := 1..numNodes;
  4.  
  5. param cost{i in Nodes,j in Nodes};
  6. param demand{i in Nodes};
  7.  
  8. var flow{i in Nodes,j in Nodes} >= 0;
  9. minimize tripcost: sum{i in Nodes,j in Nodes} flow[i,j] * cost[i,j];
  10.  
  11. s.t. conservation{i in Nodes}:sum{h in Nodes} flow[h,i]-sum{j in Nodes} flow[i,j] >= demand[i];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement