MATH 441 Section 201
A sample input for LINGO for Network Flows
Online Course Material 

We have entered the arcs in an uninteresting way as 1,2,..,11 and then each arc has a specified tail and head.

MODEL:
!xij=flow on arc (i,j) i->j;

Sets:
node / 1..6/: b;
arc: tail,head,x,upper,cost;
endsets

[objective] Min=@sum( arc(a) :cost(a)*x(a) );

@for(node(i): [balance] @sum(arc(a) | head(a)#EQ#i: x(a))
-@sum(arc(a) | tail(a)#EQ#i: x(a))=b(i) );

@for(arc(a): [upperbd] x(a) < upper(a) );

!no need to ask for integrality;

Data:
b = 0 0 0 0 0 0;
!This is a new case where we are defining the sets;
!during the initializing phase;
!arc tail head cost upper;
arc, tail, head, cost, upper =
a5to1 5 1 2 10
a5to2 5 2 1 10
a5to3 5 3 1 10
a1to2 1 2 0 3
a1to4 1 4 4 5
a2to3 2 3 -3 2
a2to4 2 4 1 2
a3to1 3 1 1 5
a3to6 3 6 0 5
a4to6 4 6 0 8
a6to5 6 5 -100 100;

enddata

end