Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param Vsize := 3;
- set V "Vertices" := (0..Vsize-1);
- set E "Edges" within V cross V := {(0, 1), (1, 2), (2, 0)};
- var v{i in V} >= 0;
- minimize rank_total: sum{i in V} v[i];
- edge{(i, j) in E}: v[j] - v[i] >= 1;
- solve;
- printf "#OUTPUT:n";
- printf (if ((exists{i in V} v[i] >= 1) or card(E) = 0) then "" else "Infeasible, has cycles or loops.n");
- printf{i in V} (if ((exists{j in V} v[j] >= 1) or card(E) = 0) then "v_%d: %dn" else ""), i, v[i];
- printf "#OUTPUT ENDn";
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement