# Example showing how to solve LP associated with
# network flow problem from LP chapter in the algorithms
# textbook. See the other linearExample.mod for more
# details and links.
set V;
param E {i in V, j in V};
var vc{i in V};
minimize z: sum{i in V} vc[i];
s.t. edges{i in V, j in V}: vc[i]+vc[j] >= E[i,j];
s.t. verticesLT{i in V}: vc[i] <= 1;
s.t. verticesGT{i in V}: vc[i] >= 0;
data;
set V := a b c d e;
param E: a b c d e :=
a 0 1 0 0 0
b 1 0 1 1 0
c 0 1 0 1 0
d 0 1 1 0 1
e 0 0 0 1 0;
end;