lingo目标规划:想要加多个条件使得I不等于J时,volume(I,J)=-volume(J,I)成立 求大神指教!
model:sets:from/f1..f3/:capacity;to/t1..t3/:demand;links(from,to):cost,volume;endsets...
model:
sets:
from/f1..f3/:capacity;
to/t1..t3/:demand;
links(from,to):cost,volume;
endsets
min=@sum(links:cost*@abs(volume));
@for(to(J):
@sum(from(I):volume(I,J))>=demand(J));
@for(from(I):
@sum(to(J):volume(I,J))<=capacity(I));
!@for(from(I):
@for(to(J)|I#ne#J:volume(I,J)=-volume(J,I)));
@for(from(I):volume(I,I)>=0);
data:
capacity=1200,500,800;
demand=600,600,400;
cost=0,4,5
4,0,3
5,3,0;
enddata
end 展开
sets:
from/f1..f3/:capacity;
to/t1..t3/:demand;
links(from,to):cost,volume;
endsets
min=@sum(links:cost*@abs(volume));
@for(to(J):
@sum(from(I):volume(I,J))>=demand(J));
@for(from(I):
@sum(to(J):volume(I,J))<=capacity(I));
!@for(from(I):
@for(to(J)|I#ne#J:volume(I,J)=-volume(J,I)));
@for(from(I):volume(I,I)>=0);
data:
capacity=1200,500,800;
demand=600,600,400;
cost=0,4,5
4,0,3
5,3,0;
enddata
end 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询