求高手看看这一段lingo程序有什么错误。
model:maxz=35*x11+12*x12+16*x13+38*x14+5*x15+2*x16+25*x21+8*x22+9*x23+24*x24+6*x25+8*...
model:
max z=35*x11+12*x12+16*x13+38*x14+5*x15+2*x16+25*x21+8*x22+9*x23+24*x24+6*x25+8*x26+12*x31+8*x32+11*x33+27*x34+3*x35+2*x36+38*x41+15*x42+14*x43+39*x44+2*x45+9*x46+0*x51+9*x52+8*x53+25*x54+10*x55+5*x56+0*x61+0*x62+0*x63+14*x64+6*x65+7*x66;
x11+x21+x31+x41+x51+x61=1;
x12+x22+x32+x42+x52+x62=1;
x13+x23+x33+x43+x53+x63=1;
x14+x24+x34+x44+x54+x64=1;
x15+x25+x35+x45+x55+x65=1;
x16+x26+x36+x46+x56+x66=1;
x11+x12+x13+x14+x15+x16=1;
x21+x22+x23+x24+x25+x26=1;
x31+x32+x33+x34+x35+x36=1;
x41+x42+x43+x44+x45+x46=1;
x51+x52+x53+x54+x55+x56=1;
x61+x62+x63+x64+x65+x66=1;
@bin(x11);@bin(x12);@bin(x13);@bin(x14);@bin(x15);@bin(x16);
@bin(x21);@bin(x22);@bin(x23);@bin(x24);@bin(x25);@bin(x26);
@bin(x31);@bin(x32);@bin(x33);@bin(x34);@bin(x35);@bin(x36);
@bin(x41);@bin(x42);@bin(x43);@bin(x44);@bin(x45);@bin(x46);
@bin(x51);@bin(x52);@bin(x53);@bin(x54);@bin(x55);@bin(x56);
@bin(x61);@bin(x62);@bin(x63);@bin(x64);@bin(x65);@bin(x66);
end 展开
max z=35*x11+12*x12+16*x13+38*x14+5*x15+2*x16+25*x21+8*x22+9*x23+24*x24+6*x25+8*x26+12*x31+8*x32+11*x33+27*x34+3*x35+2*x36+38*x41+15*x42+14*x43+39*x44+2*x45+9*x46+0*x51+9*x52+8*x53+25*x54+10*x55+5*x56+0*x61+0*x62+0*x63+14*x64+6*x65+7*x66;
x11+x21+x31+x41+x51+x61=1;
x12+x22+x32+x42+x52+x62=1;
x13+x23+x33+x43+x53+x63=1;
x14+x24+x34+x44+x54+x64=1;
x15+x25+x35+x45+x55+x65=1;
x16+x26+x36+x46+x56+x66=1;
x11+x12+x13+x14+x15+x16=1;
x21+x22+x23+x24+x25+x26=1;
x31+x32+x33+x34+x35+x36=1;
x41+x42+x43+x44+x45+x46=1;
x51+x52+x53+x54+x55+x56=1;
x61+x62+x63+x64+x65+x66=1;
@bin(x11);@bin(x12);@bin(x13);@bin(x14);@bin(x15);@bin(x16);
@bin(x21);@bin(x22);@bin(x23);@bin(x24);@bin(x25);@bin(x26);
@bin(x31);@bin(x32);@bin(x33);@bin(x34);@bin(x35);@bin(x36);
@bin(x41);@bin(x42);@bin(x43);@bin(x44);@bin(x45);@bin(x46);
@bin(x51);@bin(x52);@bin(x53);@bin(x54);@bin(x55);@bin(x56);
@bin(x61);@bin(x62);@bin(x63);@bin(x64);@bin(x65);@bin(x66);
end 展开
2个回答
展开全部
中间有一个集名写错了 最后两句都有问题 倒数第二句不是等式或者不等式关系 最后一句里面的l用在下标里面是什么意思
sets:
jingdian/1..11/:c,t,l;
links(jingdian,jingdian):r,cc,tt;
endsets
data:
t=7 24 18 12 36 30 12 9 15 24 17;
c=120 423 300 135 378 390 175 90 148 303 241;
tt=0 8.54 4.74 2.82 3.44 5.08 8.4 1.32 1.54 6.14 6.6
8.54 0 1.22 11.52 12.14 10.9 13.1 8.84 8.98 14.84 15.54
4.74 1.22 0 11.22 11.82 9.38 11.58 7.66 7.46 13.44 13.9
2.82 11.52 11.22 0 0.88 7.78 8.08 4.02 4.24 5.84 6.3
3.44 12.14 11.82 0.88 0 8.42 8.24 4.66 4.88 6 6.46
5.08 10.9 9.38 7.78 8.42 0 2.18 4.24 4.04 5.98 6.74
8.4 13.1 11.58 8.08 8.24 2.18 0 6.08 6.22 3.86 2.86
1.32 8.84 7.66 4.02 4.66 4.24 6.08 0 0.3 6.28 6.74
1.54 8.98 7.46 4.24 4.88 4.04 6.22 0.3 0 6.08 6.54
6.14 14.84 13.44 5.84 6 5.98 3.86 6.28 6.08 0 2.08
6.6 15.54 13.9 6.3 6.46 6.74 2.86 6.74 6.54 2.08 0;
cc=0 128.1 71.1 42.3 51.6 76.2 126 19.8 23.1 92.1 99
128.1 0 18.3 172.8 182.1 163.5 196.5 132.6 134.7 222.6 233.1
71.1 18.3 0 168.3 177.3 140.7 173.7 114.9 111.9 201.6 208.5
42.3 172.8 168.3 0 13.2 116.7 121.2 60.3 63.6 87.6 94.5
51.6 182.1 177.3 13.2 0 126.3 123.6 69.9 73.2 90 96.9
76.2 163.5 140.7 116.7 126.3 0 32.7 63.6 60.6 89.7 101.1
126 196.5 173.7 121.2 123.6 32.7 0 91.2 93.3 57.9 42.9
19.8 132.6 114.9 60.3 69.9 63.6 91.2 0 4.5 94.2 101.1
23.1 134.7 111.9 63.6 73.2 60.6 93.3 4.5 0 91.2 98.1
92.1 222.6 201.6 87.6 90 89.7 57.9 94.2 91.2 0 31.2
99 233.1 208.5 94.5 96.9 101.1 42.9 101.1 98.1 31.2 0;
n=?;
enddata
min=@sum(jingdian(j):@sum(jingdian(i):r(i,j)*(cc(i,j)+0.5*(c(i)+c(j)))));
@for(jingdian(i):r(i,i)=0);
@for(jingdian(i)|i#ge#2:@for(jingdian(j)|j#ge#2:r(i,j)+r(j,i)<1));
a=@sum(jingdian(j):@sum(jingdian(i):r(i,j)*(tt(i,j)+0.5*(t(i)+t(j)))));
@sum(jingdian(j):@sum(jingdian(i):r(i,j)*(tt(i,j)+0.5*(t(i)+t(j)))))<120;
@for(jingdian(i):@sum(jingdian(j):r(i,j))=@sum(jingdian(j):r(j,i)));
@for(jingdian(i)|i#eq#1:@sum(jingdian(j):r(i,j))=1);
@for(jingdian(i)|i#ne#1:@sum(jingdian(j):r(i,j))<1);
@for(links:@bin(r));
@sum(jingdian(j):@sum(jingdian(i):r(i,j)))=n;
!@for(jingdian(i):@for(jingdian(j)|j#gt#1#and#j#ne#i:l(i)+r(i,j)-(n-2)*(1-r(i,j))+(n-3)*r(j,i)));
!@for(jingdian(i)|i#gt#1:l(i)<n-1-(n-2)*r(l,i);!l(i)>l+(n-2)*r(i,l));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
格式有问题 要写max= 而不是max z=
model:
max=35*x11+12*x12+16*x13+38*x14+5*x15+2*x16+25*x21+8*x22+9*x23+24*x24+6*x25+8*x26+12*x31+8*x32+11*x33+27*x34+3*x35+2*x36+38*x41+15*x42+14*x43+39*x44+2*x45+9*x46+0*x51+9*x52+8*x53+25*x54+10*x55+5*x56+0*x61+0*x62+0*x63+14*x64+6*x65+7*x66;
x11+x21+x31+x41+x51+x61=1;
x12+x22+x32+x42+x52+x62=1;
x13+x23+x33+x43+x53+x63=1;
x14+x24+x34+x44+x54+x64=1;
x15+x25+x35+x45+x55+x65=1;
x16+x26+x36+x46+x56+x66=1;
x11+x12+x13+x14+x15+x16=1;
x21+x22+x23+x24+x25+x26=1;
x31+x32+x33+x34+x35+x36=1;
x41+x42+x43+x44+x45+x46=1;
x51+x52+x53+x54+x55+x56=1;
x61+x62+x63+x64+x65+x66=1;
@bin(x11);@bin(x12);@bin(x13);@bin(x14);@bin(x15);@bin(x16);
@bin(x21);@bin(x22);@bin(x23);@bin(x24);@bin(x25);@bin(x26);
@bin(x31);@bin(x32);@bin(x33);@bin(x34);@bin(x35);@bin(x36);
@bin(x41);@bin(x42);@bin(x43);@bin(x44);@bin(x45);@bin(x46);
@bin(x51);@bin(x52);@bin(x53);@bin(x54);@bin(x55);@bin(x56);
@bin(x61);@bin(x62);@bin(x63);@bin(x64);@bin(x65);@bin(x66);
end
model:
max=35*x11+12*x12+16*x13+38*x14+5*x15+2*x16+25*x21+8*x22+9*x23+24*x24+6*x25+8*x26+12*x31+8*x32+11*x33+27*x34+3*x35+2*x36+38*x41+15*x42+14*x43+39*x44+2*x45+9*x46+0*x51+9*x52+8*x53+25*x54+10*x55+5*x56+0*x61+0*x62+0*x63+14*x64+6*x65+7*x66;
x11+x21+x31+x41+x51+x61=1;
x12+x22+x32+x42+x52+x62=1;
x13+x23+x33+x43+x53+x63=1;
x14+x24+x34+x44+x54+x64=1;
x15+x25+x35+x45+x55+x65=1;
x16+x26+x36+x46+x56+x66=1;
x11+x12+x13+x14+x15+x16=1;
x21+x22+x23+x24+x25+x26=1;
x31+x32+x33+x34+x35+x36=1;
x41+x42+x43+x44+x45+x46=1;
x51+x52+x53+x54+x55+x56=1;
x61+x62+x63+x64+x65+x66=1;
@bin(x11);@bin(x12);@bin(x13);@bin(x14);@bin(x15);@bin(x16);
@bin(x21);@bin(x22);@bin(x23);@bin(x24);@bin(x25);@bin(x26);
@bin(x31);@bin(x32);@bin(x33);@bin(x34);@bin(x35);@bin(x36);
@bin(x41);@bin(x42);@bin(x43);@bin(x44);@bin(x45);@bin(x46);
@bin(x51);@bin(x52);@bin(x53);@bin(x54);@bin(x55);@bin(x56);
@bin(x61);@bin(x62);@bin(x63);@bin(x64);@bin(x65);@bin(x66);
end
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询