极其希望CSDN能加入lingo,MATLAB等建模语言的代码染色方式
model:
sets:
node/1..6/;
road(node,node):w,a,f;
endsets
data:
a=
0,1,1,0,0,0,
0,0,0,1,1,0,
0,0,0,1,1,0,
0,0,0,0,0,1,
0,0,0,0,0,1,
0,0,0,0,0,0;
w=
0,3,4,0,0,0,
0,0,0,6,4,0,
0,0,0,5,3,0,
0,0,0,0,0,7,
0,0,0,0,0,3,
0,0,0,0,0,0;
enddata
n=@size(node);
max=vf;
@sum(road(i,j)|i#eq#1:f(i,j))=vf;
@for(node(i)|i#gt#1 #and# i#ne#n: @sum(node(j):f(i,j)*a(i,j))=@sum(node(j):f(j,i)*a(j,i) ));
@for(road(i,j):f(i,j)<w(i,j));