急求lingo代码解决极值问题

问题描述:

急求lingo代码解决极值问题
试用lingo软件解决下述运输问题:
某公司有3个仓库,库存货物总数分别为3,5,7.现有4个客户各要一批货,数量分别为2,3,4,6.各仓库到4个客户处的单位货物运输价见表1(Vi表示第i个客户,Wi表示第i个供货栈):试确定各货栈到各客户处的货物调运数量,使总的运费最小,并求出最小运费.
v1v2 v3 v4
w1 211 34
w2 10 359

model:
sets:
warehouses/wh1..wh3/: capacity;
vendors/v1..v4/: demand;
links(warehouses,vendors): cost, volume;
endsets
!目标函数;
min=@sum(links: cost*volume);
!需求约束;
@for(vendors(J):
@sum(warehouses(I): volume(I,J))=demand(J));
!产量约束;
@for(warehouses(I):
@sum(vendors(J): volume(I,J))