LINGO程序哪里出错了model:sets:city/1..6/:u;link(city,city):d,x;endsetsdata:d=0 70 50 40 50 3070 0 30 40 60 5050 30 0 50 70 80 40 40 50 0 60 60 50 60 70 50 0 4030 50 80 60 40 0;enddataN=@size(city);min=@sum(link:d*x);@for(city(j):@sum(city(i)|i

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/03 00:31:13

LINGO程序哪里出错了model:sets:city/1..6/:u;link(city,city):d,x;endsetsdata:d=0 70 50 40 50 3070 0 30 40 60 5050 30 0 50 70 80 40 40 50 0 60 60 50 60 70 50 0 4030 50 80 60 40 0;enddataN=@size(city);min=@sum(link:d*x);@for(city(j):@sum(city(i)|i
LINGO程序哪里出错了
model:
sets:
city/1..6/:u;
link(city,city):d,x;
endsets
data:
d=0 70 50 40 50 30
70 0 30 40 60 50
50 30 0 50 70 80
40 40 50 0 60 60
50 60 70 50 0 40
30 50 80 60 40 0;
enddata
N=@size(city);
min=@sum(link:d*x);
@for(city(j):@sum(city(i)|i #ne# j:x(i,j))=1;
@sum(city(j)|j #ne# i:x(i,j))=1;);
@for(city(i):@for(city(j)|j #gt# 1 #and# i #ne# j:u(i)-u(j):N*x(i,j)=N-1):);
@for(city(i):u(i)=N-1);
@for(link:@bin(x):);
end
这个程序中哪里出错了,
这里主要是讲TSP问题的

LINGO程序哪里出错了model:sets:city/1..6/:u;link(city,city):d,x;endsetsdata:d=0 70 50 40 50 3070 0 30 40 60 5050 30 0 50 70 80 40 40 50 0 60 60 50 60 70 50 0 4030 50 80 60 40 0;enddataN=@size(city);min=@sum(link:d*x);@for(city(j):@sum(city(i)|i

在lingo的程序中,最后的限定城市的约束

“@for(city(j):@sum(city(i)|i #ne# j:x(i,j))=1;

             @sum(city(j)|j #ne# i:x(i,j))=1;);

@for(city(i):@for(city(j)|j #gt# 1 #and# i #ne# j:u(i)-u(j):N*x(i,j)=N-1):);”

有误.正确的方式如图.

将你的程序修改了下,正确的程序:

MODEL:

    sets:

   city/1..6/:u;

      link(city, city):

        d, x;      

    endsets

    data: 

     d = 0 70 50 40 50 30

  70 0 30 40 60 50

  50 30 0 50 70 80 

  40 40 50 0 60 60 

  50 60 70 50 0 40

  30 50 80 60 40 0;

   enddata

   n=@size(city); 

  min=@sum(link(i,j)|i #ne# j: d(i,j)*x(i,j));

   @for(city(i) :

      @sum(city(j)| j #ne# i: x(j,i))=1;

      @sum(city(j)| j #ne# i: x(i,j))=1;

     @for(city(j)| j #gt# 1 #and# j #ne# i :

         u(j) >= u(i) + x(i,j)

                 - (n-2)*(1-x(i,j)) + (n-3)*x(j,i);

      );

   );

   @for(link : @bin(x));

   @for(city(i) | i #gt# 1 :

      u(i)<=n-1-(n-2)*x(1,i);

      u(i)>=1+(n-2)*x(i,1);

   );

 END

结果:   Global optimal solution found.

   Objective value:                              240.0000

   Extended solver steps:                               0

   Total solver iterations:                            34

                       X( 1, 1)        0.000000            0.000000

                       X( 1, 2)        0.000000            70.00000

                       X( 1, 3)        0.000000            50.00000

                       X( 1, 4)        0.000000            40.00000

                       X( 1, 5)        0.000000            50.00000

                       X( 1, 6)        1.000000            30.00000

                       X( 2, 1)        0.000000            70.00000

                       X( 2, 2)        0.000000            0.000000

                       X( 2, 3)        1.000000            30.00000

                       X( 2, 4)        0.000000            40.00000

                       X( 2, 5)        0.000000            60.00000

                       X( 2, 6)        0.000000            50.00000

                       X( 3, 1)        1.000000            50.00000

                       X( 3, 2)        0.000000            30.00000

                       X( 3, 3)        0.000000            0.000000

                       X( 3, 4)        0.000000            50.00000

                       X( 3, 5)        0.000000            70.00000

                       X( 3, 6)        0.000000            80.00000

                       X( 4, 1)        0.000000            40.00000

                       X( 4, 2)        1.000000            40.00000

                       X( 4, 3)        0.000000            50.00000

                       X( 4, 4)        0.000000            0.000000

                       X( 4, 5)        0.000000            60.00000

                       X( 4, 6)        0.000000            60.00000

                       X( 5, 1)        0.000000            50.00000

                       X( 5, 2)        0.000000            60.00000

                       X( 5, 3)        0.000000            70.00000

                       X( 5, 4)        1.000000            50.00000

                       X( 5, 5)        0.000000            0.000000

                       X( 5, 6)        0.000000            40.00000

                       X( 6, 1)        0.000000            30.00000

                       X( 6, 2)        0.000000            50.00000

                       X( 6, 3)        0.000000            80.00000

                       X( 6, 4)        0.000000            60.00000

                       X( 6, 5)        1.000000            40.00000

                       X( 6, 6)        0.000000            0.000000

帮忙看下这个lingo程序哪里出错了MODEL:SETS:CUTFA/1..6/:x;CUTFAA/1..11/:y;切割的方法有17种,x表示对应1-6种切割方法的原料钢管的需求量,y表示对应7-17种切割方法的原料钢管的需求量;BUJ/1..3/:n,b;3种钢 请各位大大看看这个lingo程序哪里出错了?model:sets:I/1..45/:x,y,c,b,t;endsetsdata:c=64,88,193,193,128,120,120,120,110,120,64,247,190,210,70,85,192,195,128,120,120,120,110,160,70,256,190,210,190,205,110,160,70,256,190,210,190,190,210,200 请高手帮我看看lingo软件以下提示是什么意思?可能是哪里出错?由于程序语句太长,太多,就不就不在这里写下了, 这个lingo程序错在哪?我编了个lingo程序,测试的时候出错,感激不尽~以下是程序“MODEL:title 码流提取问题;SETS:job/1..5/;worker/1..16/;assign(job,worker):x,a,b;ENDSETSDATA:a=30.8667,32.7657,35.4304,37.781,40.3113,28.6755, 我在使用lingo时出现THE MODEL DIMENSIONS EXCEED THE CAPACITY OF THIS VERSION.哪位大虾可以告诉我是什么地方出了问题.如何解决,程序应该不用出错.谢谢.程序如下:model:title CUMCM-2003B-01;sets:cai / 1..10 /:crate, 看看这个lingo程序哪里出错了?model:sets:de/1..8/:x,y;fe/1..5/:f;link(fe,de):W;endsetsdata:x=5 7 5 4 6 5 5 3;y=25 36 32 15 31 28 22 12;L=20;enddatamin=@sum(de:x*w(1,j))+@sum(de:x*w(2,j))+@sum(de:x*w(3,j))+@sum(de:x*w(4,j))+@sum(de:x*w(5,j))+ LINGO程序哪里出错了model:sets:city/1..6/:u;link(city,city):d,x;endsetsdata:d=0 70 50 40 50 3070 0 30 40 60 5050 30 0 50 70 80 40 40 50 0 60 60 50 60 70 50 0 4030 50 80 60 40 0;enddataN=@size(city);min=@sum(link:d*x);@for(city(j):@sum(city(i)|i 有没有LINGO高手呀,帮我看看这个程序哪里出错了,MODEL:SETS:WH/W1..W18/:AI,BI,X; ENDSETSDATA:AI=0,0,0.4,1.8,1.3,1.5,2.2,0,-1.2,0.9,1.2,0,0,0.8,1.8,-3,1.4,0;BI=0,3,1,2,2,1,1,0,2,1,1,0,0,2,2,1,3,0; ENDDATAMAX=@SUM(WH:X(I)*AI(I));@FOR(WH: Lingo 那里出错了啊?model:title 物流仓库选址问题lingo求解程序;sets:store/1..12/:w,s,m;sale/1..12/:d;links(store,sale):C,p,x;endsetsdata:从仓库i向销售中心j运送货物的运送总成本;C=100,80,50,50,60,100,120,90,60,100,120, LINGO问题 我找了一个程序 自己改了改,运行出错了,求大侠帮忙.model:sets:v/1..20/:a,b,d,n,m; endsetsmin=w;w=@sum(v(i):a*b*d)*t;@sum(v(i):n*d)>=k1;@sum(v(i):n*d)=0.8*m);@for(v(i):n proteus isis中NO model specified for RP1 什么错误估计画图出错了,烧入程序报错.. lingo程序出错,MODEL:MAX=x1*y4+x2*y1+x3*y2+x4*y3;data:l,d=?;enddatal,d为所放箱子的长宽;x1*l+y1*d 求助!这是我第一次接触LINGO,因为写论文要建模,我输入了一下这段,可是跳错,求大侠帮忙看看 哪里出错MODEL:SETS:S/S1..S4/: SI;D/D1..D4/: DJ, R, Y;LINKS (S,D): C,A,U,X;ENDSETSDATA:SI=10, 50, 200, 100;DJ=10, 100, 200, 5 帮忙看哈下面这个lingo程序哪里有问题,显示第十行出错,求指导~model:sets:season/1..4/:x;fire/2,3,4/:y;endsetsmin=120+x(1)+x(2)+x(3)+x(4);120*65+x(1)*60>=6000;((120+x(1))*0.85-y(2))*65+60*x(2)>=7500;(((120+x(1))*0.85-y(2)+x(2))*0. 目标函数的lingo语句(0-1变量)是不是写错了啊求大神指点!运行出的结果是没有计算运费的最优方案,但是不知道错在哪里…本程序是模型Ⅰ中张三的程序;model:最优网购问题;sets:定义变量部 错别字哪里出错了? 大家看看这个lingo程序哪里错了啊····谢谢各位model:title first stepsets:demand/1,2/:dem;supply/1..5/:sup;link(supply,demand):,d,c;endsetsmin=@sum(link(i,j):d(i,j)*c(i,j));@for(suply(i):@sum(demand(j):c(i,j))dem(j));data:sup=640,390 lingo程序,这里哪里错了,提示是错误11.data那里有错吗.model:3发点4收点运输问题;集合部分;sets:warehouses/wh1..wh3/:capacity;vendors/v1..v4/:demand;links(warehouses,vendors):cost,volume;endsets目标函数;min=@sum(links:cost