帮我运行个lingo的程序,我这边运行不了程序如下:model:sets:cities/1..6/:u; link(cities,cities):dist,x;endsetsn=@size(cities);data:dist=0 5600 3500 2100 5100 60005600 0 2100 5700 7800 70003500 2100 0 3600 6800 68002100 5700 3600 0 51

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 17:04:48
帮我运行个lingo的程序,我这边运行不了程序如下:model:sets:cities/1..6/:u;link(cities,cities):dist,x;endsetsn=@size(cities

帮我运行个lingo的程序,我这边运行不了程序如下:model:sets:cities/1..6/:u; link(cities,cities):dist,x;endsetsn=@size(cities);data:dist=0 5600 3500 2100 5100 60005600 0 2100 5700 7800 70003500 2100 0 3600 6800 68002100 5700 3600 0 51
帮我运行个lingo的程序,我这边运行不了
程序如下:
model:
sets:
cities/1..6/:u;
link(cities,cities):
dist,
x;
endsets
n=@size(cities);
data:
dist=0 5600 3500 2100 5100 6000
5600 0 2100 5700 7800 7000
3500 2100 0 3600 6800 6800
2100 5700 3600 0 5100 6100
5100 7800 6800 5100 0 1300
6000 7000 6800 6100 1300 0
;
enddata
min=@sum(link:dist*x);
@for(cities(k):
@sum(cities(i)|i #ne# k:x(i,k))=1;
@sum(cities(j)|j #ne# k:x(k,j))=1;
);
@for(cities(i)|i #gt# 1:
@for(cities(j)|j #gt#1 #and# i #ne# j:
u(i)-u(j)+n*x(i,j)

帮我运行个lingo的程序,我这边运行不了程序如下:model:sets:cities/1..6/:u; link(cities,cities):dist,x;endsetsn=@size(cities);data:dist=0 5600 3500 2100 5100 60005600 0 2100 5700 7800 70003500 2100 0 3600 6800 68002100 5700 3600 0 51
没有发现问题.
Global optimal solution found.
Objective value: 21100.00
Objective bound: 21100.00
Infeasibilities: 0.000000
Extended solver steps: 0
Total solver iterations: 363
Model Class: MILP
Total variables: 42
Nonlinear variables: 0
Integer variables: 36
Total constraints: 38
Nonlinear constraints: 0
Total nonzeros: 155
Nonlinear nonzeros: 0
Variable Value Reduced Cost
N 6.000000 0.000000
U( 1) 0.000000 0.000000
U( 2) 3.000000 0.000000
U( 3) 4.000000 0.000000
U( 4) 0.000000 0.000000
U( 5) 1.000000 0.000000
U( 6) 2.000000 0.000000
DIST( 1, 1) 0.000000 0.000000
DIST( 1, 2) 5600.000 0.000000
DIST( 1, 3) 3500.000 0.000000
DIST( 1, 4) 2100.000 0.000000
DIST( 1, 5) 5100.000 0.000000
DIST( 1, 6) 6000.000 0.000000
DIST( 2, 1) 5600.000 0.000000
DIST( 2, 2) 0.000000 0.000000
DIST( 2, 3) 2100.000 0.000000
DIST( 2, 4) 5700.000 0.000000
DIST( 2, 5) 7800.000 0.000000
DIST( 2, 6) 7000.000 0.000000
DIST( 3, 1) 3500.000 0.000000
DIST( 3, 2) 2100.000 0.000000
DIST( 3, 3) 0.000000 0.000000
DIST( 3, 4) 3600.000 0.000000
DIST( 3, 5) 6800.000 0.000000
DIST( 3, 6) 6800.000 0.000000
DIST( 4, 1) 2100.000 0.000000
DIST( 4, 2) 5700.000 0.000000
DIST( 4, 3) 3600.000 0.000000
DIST( 4, 4) 0.000000 0.000000
DIST( 4, 5) 5100.000 0.000000
DIST( 4, 6) 6100.000 0.000000
DIST( 5, 1) 5100.000 0.000000
DIST( 5, 2) 7800.000 0.000000
DIST( 5, 3) 6800.000 0.000000
DIST( 5, 4) 5100.000 0.000000
DIST( 5, 5) 0.000000 0.000000
DIST( 5, 6) 1300.000 0.000000
DIST( 6, 1) 6000.000 0.000000
DIST( 6, 2) 7000.000 0.000000
DIST( 6, 3) 6800.000 0.000000
DIST( 6, 4) 6100.000 0.000000
DIST( 6, 5) 1300.000 0.000000
DIST( 6, 6) 0.000000 0.000000
X( 1, 1) 0.000000 0.000000
X( 1, 2) 0.000000 5600.000
X( 1, 3) 0.000000 3500.000
X( 1, 4) 1.000000 2100.000
X( 1, 5) 0.000000 5100.000
X( 1, 6) 0.000000 6000.000
X( 2, 1) 0.000000 5600.000
X( 2, 2) 0.000000 0.000000
X( 2, 3) 1.000000 2100.000
X( 2, 4) 0.000000 5700.000
X( 2, 5) 0.000000 7800.000
X( 2, 6) 0.000000 7000.000
X( 3, 1) 1.000000 3500.000
X( 3, 2) 0.000000 2100.000
X( 3, 3) 0.000000 0.000000
X( 3, 4) 0.000000 3600.000
X( 3, 5) 0.000000 6800.000
X( 3, 6) 0.000000 6800.000
X( 4, 1) 0.000000 2100.000
X( 4, 2) 0.000000 5700.000
X( 4, 3) 0.000000 3600.000
X( 4, 4) 0.000000 0.000000
X( 4, 5) 1.000000 5100.000
X( 4, 6) 0.000000 6100.000
X( 5, 1) 0.000000 5100.000
X( 5, 2) 0.000000 7800.000
X( 5, 3) 0.000000 6800.000
X( 5, 4) 0.000000 5100.000
X( 5, 5) 0.000000 0.000000
X( 5, 6) 1.000000 1300.000
X( 6, 1) 0.000000 6000.000
X( 6, 2) 1.000000 7000.000
X( 6, 3) 0.000000 6800.000
X( 6, 4) 0.000000 6100.000
X( 6, 5) 0.000000 1300.000
X( 6, 6) 0.000000 0.000000
Row Slack or Surplus Dual Price
1 0.000000 0.000000
2 21100.00 -1.000000
3 0.000000 0.000000
4 0.000000 0.000000
5 0.000000 0.000000
6 0.000000 0.000000
7 0.000000 0.000000
8 0.000000 0.000000
9 0.000000 0.000000
10 0.000000 0.000000
11 0.000000 0.000000
12 0.000000 0.000000
13 0.000000 0.000000
14 0.000000 0.000000
15 0.000000 0.000000
16 2.000000 0.000000
17 3.000000 0.000000
18 4.000000 0.000000
19 4.000000 0.000000
20 1.000000 0.000000
21 2.000000 0.000000
22 3.000000 0.000000
23 8.000000 0.000000
24 9.000000 0.000000
25 0.000000 0.000000
26 7.000000 0.000000
27 7.000000 0.000000
28 8.000000 0.000000
29 4.000000 0.000000
30 0.000000 0.000000
31 0.000000 0.000000
32 7.000000 0.000000
33 3.000000 0.000000
34 4.000000 0.000000
35 1.000000 0.000000
36 0.000000 0.000000
37 4.000000 0.000000
38 3.000000 0.000000
39 2.000000 0.000000