新手,lingo怎么输入一个列表啊MODEL:SETS:city/1..11/:u;link(city,city):d,x;ENDSETSDATA:d = @file(juli.txt) ;ENDDATAn=@SIZE(city);MIN=@SUM(link:d*x);@FOR(city(k):@sum(city(i)|i#ne#k:x(i,k))=1;@sum(city(j)|j#ne#k:x(k,j))=1;@for(city(j)|j#gt#1#
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 00:41:58
新手,lingo怎么输入一个列表啊MODEL:SETS:city/1..11/:u;link(city,city):d,x;ENDSETSDATA:d = @file(juli.txt) ;ENDDATAn=@SIZE(city);MIN=@SUM(link:d*x);@FOR(city(k):@sum(city(i)|i#ne#k:x(i,k))=1;@sum(city(j)|j#ne#k:x(k,j))=1;@for(city(j)|j#gt#1#
新手,lingo怎么输入一个列表啊
MODEL:
SETS:
city/1..11/:u;
link(city,city):d,x;
ENDSETS
DATA:
d = @file(juli.txt) ;
ENDDATA
n=@SIZE(city);
MIN=@SUM(link:d*x);
@FOR(city(k):@sum(city(i)|i#ne#k:x(i,k))=1;
@sum(city(j)|j#ne#k:x(k,j))=1;
@for(city(j)|j#gt#1#and#j#ne#k:
u(j)>=u(k)+x(k,j)-(n-2)*(1-x(k,j))+(n-3)*x(j,k));
);
@FOR(link:@BIN(x));
@for(city(k)|k#gt#1:
u(k)=1+(n-2)*x(k,1));
END这个程序对嘛.
新手,lingo怎么输入一个列表啊MODEL:SETS:city/1..11/:u;link(city,city):d,x;ENDSETSDATA:d = @file(juli.txt) ;ENDDATAn=@SIZE(city);MIN=@SUM(link:d*x);@FOR(city(k):@sum(city(i)|i#ne#k:x(i,k))=1;@sum(city(j)|j#ne#k:x(k,j))=1;@for(city(j)|j#gt#1#
这个程序没错.
还需注意juli.txt里面的数据格式是否正确