- 整数规划(@gin的应用)
model:
sets:
row/1..4/:b;
col/1..5/:c1,c2,x;
link(row,col):a;
endsets
data:
c1=1,1,3,4,2;
c2=-8,-2,-3,-1,-2;
a=1 1 1 1 1
1 2 2 1 6
2 1 6 0 0
0 0 1 1 5;
b=400,800,200,200;
enddata
max=@sum(col:c1*x^2+c2*x);
@for(row(i):@sum(col(j):a(i,j)*x(j))<b(i));
@for(col:@gin(x)); !限制x为整数
@for(col:@bnd(0,x,99));
end
标签:..,sum,解决,c2,c1,规划,col,lingo,row
From: https://www.cnblogs.com/SkyRainWind/p/16842456.html