Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. param Vsize := 3;
  2. set V "Vertices" := (0..Vsize-1);
  3. set E "Edges" within V cross V := {(0, 1), (1, 2), (2, 0)};
  4.  
  5. var v{i in V} >= 0;
  6. minimize rank_total: sum{i in V} v[i];
  7. edge{(i, j) in E}: v[j] - v[i] >= 1;
  8.  
  9. solve;
  10.  
  11. printf "#OUTPUT:n";
  12. printf (if ((exists{i in V} v[i] >= 1) or card(E) = 0) then "" else "Infeasible, has cycles or loops.n");
  13. printf{i in V} (if ((exists{j in V} v[j] >= 1) or card(E) = 0) then "v_%d: %dn" else ""), i, v[i];
  14. printf "#OUTPUT ENDn";
  15.  
  16. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement