基本上就是这样 data自己加上 另外里面恐怕会有问题自己查一下吧
model:
sets:
s1/1..6/:c;
s2/1..7/:;
link(s1,s2):x,y,a;
endsets
data:
enddata
min=@sum(link(i,j):c(i)*x(i,j));
@for(link:x>=2*y;x<=a*y);
@for(s1(i)|i#le#4:@sum(s2(j):x(i,j))>=10);
@for(s1(i)|i#gt#4:@sum(s2(j):x(i,j))>=8);
@for(s2(j):@sum(s1(i):x(i,j))=14);
@for(s1(i):@sum(s2(j):y(i,j))<=5);
@for(s2(j):@sum(s1(i):y(i,j))<=3);
@for(s2(j):y(5,j)+y(6,j)=1);
@for(link:@bin(y));
end
你这个,说实话, 编程的习惯不太。。。‘
推荐你一个鼎好的网站:学问社区,在“小组”里面有很多你中意的内容