一道运筹学的运输问题,求解答

2024-12-29 02:08:03
推荐回答(3个)
回答1:

model:
sets:
stim/1..5/:cap,dem, left;
link(stim,stim):tran, cost;
endsets
data:
cap=200 300 0 0 0 ;
dem=0 0 100 200 50;
cost=
0 6 7 8 9
6 0 5 4 3
7 2 0 5 1
1 5 1 0 4
8 9 7 6 0;
enddata
min=@sum(link:tran*cost);

@for(link(i,j)|i#eq#j:tran=0);
@for(stim(i)|i#le#2:@sum(link(i,j)|i#ne#j:tran(i,j))<=cap(i));
@for(stim(i)|i#ge#3:@sum(link(j,i)|j#lt#3:tran(j,i))-@sum(link(i,k)|k#gt#2:tran(i,k))=dem(i));

Global optimal solution found.
Objective value: 1550.000
Infeasibilities: 0.000000
Total solver iterations: 4

Variable Value Reduced Cost
CAP( 1) 200.0000 0.000000
CAP( 2) 300.0000 0.000000
CAP( 3) 0.000000 0.000000
CAP( 4) 0.000000 0.000000
CAP( 5) 0.000000 0.000000
DEM( 1) 0.000000 0.000000
DEM( 2) 0.000000 0.000000
DEM( 3) 100.0000 0.000000
DEM( 4) 200.0000 0.000000
DEM( 5) 50.00000 0.000000
LEFT( 1) 0.000000 0.000000
LEFT( 2) 0.000000 0.000000
LEFT( 3) 0.000000 0.000000
LEFT( 4) 0.000000 0.000000
LEFT( 5) 0.000000 0.000000
TRAN( 1, 1) 0.000000 0.000000
TRAN( 1, 2) 0.000000 6.000000
TRAN( 1, 3) 50.00000 0.000000
TRAN( 1, 4) 0.000000 2.000000
TRAN( 1, 5) 0.000000 4.000000
TRAN( 2, 1) 0.000000 8.000000
TRAN( 2, 2) 0.000000 0.000000
TRAN( 2, 3) 50.00000 0.000000
TRAN( 2, 4) 200.0000 0.000000
TRAN( 2, 5) 50.00000 0.000000
TRAN( 3, 1) 0.000000 7.000000
TRAN( 3, 2) 0.000000 2.000000
TRAN( 3, 3) 0.000000 0.000000
TRAN( 3, 4) 0.000000 12.00000
TRAN( 3, 5) 0.000000 8.000000
TRAN( 4, 1) 0.000000 1.000000
TRAN( 4, 2) 0.000000 5.000000
TRAN( 4, 3) 0.000000 7.000000
TRAN( 4, 4) 0.000000 0.000000
TRAN( 4, 5) 0.000000 10.00000
TRAN( 5, 1) 0.000000 8.000000
TRAN( 5, 2) 0.000000 9.000000
TRAN( 5, 3) 0.000000 12.00000
TRAN( 5, 4) 0.000000 11.00000
TRAN( 5, 5) 0.000000 0.000000

COST( 1, 1) 0.000000 0.000000
COST( 1, 2) 6.000000 0.000000
COST( 1, 3) 7.000000 0.000000
COST( 1, 4) 8.000000 0.000000
COST( 1, 5) 9.000000 0.000000
COST( 2, 1) 6.000000 0.000000
COST( 2, 2) 0.000000 0.000000
COST( 2, 3) 5.000000 0.000000
COST( 2, 4) 4.000000 0.000000
COST( 2, 5) 3.000000 0.000000
COST( 3, 1) 7.000000 0.000000
COST( 3, 2) 2.000000 0.000000
COST( 3, 3) 0.000000 0.000000
COST( 3, 4) 5.000000 0.000000
COST( 3, 5) 1.000000 0.000000
COST( 4, 1) 1.000000 0.000000
COST( 4, 2) 5.000000 0.000000
COST( 4, 3) 1.000000 0.000000
COST( 4, 4) 0.000000 0.000000
COST( 4, 5) 4.000000 0.000000
COST( 5, 1) 8.000000 0.000000
COST( 5, 2) 9.000000 0.000000
COST( 5, 3) 7.000000 0.000000
COST( 5, 4) 6.000000 0.000000
COST( 5, 5) 0.000000 0.000000
Row Slack or Surplus Dual Price
1 1550.000 -1.000000
2 0.000000 0.000000
3 0.000000 0.000000
4 0.000000 -7.000000
5 0.000000 -6.000000
6 0.000000 -5.000000
7 150.0000 0.000000
8 0.000000 2.000000
9 0.000000 -7.000000
10 0.000000 -6.000000
11 0.000000 -5.000000

回答2:

先选出运费最小的A2/B3,50件B3产品共花费 50x3=150 再选最小的A2/B2 200件B2产品共花费 200x4=800 再选A2/B1 300-200-50=50件B1共花费 50x5=250 再从A1/B1 100-50=50件共花费50x7=350 150+800+250+350=1550

回答3:

1550