哈密顿圈~Lingo程序
sets:
c/1..15/:u;
link(c,c):w,x;
endsets
data:
w=@ole('第二题第一组.xls','d');
enddata
n=@size(c);
min=@sum(link:w*x);
@for(c(k):
@sum(c(i)|i#ne#k:x(i,k))=1;
@sum(c(j)|j#ne#k:x(k,j))=1;
);
@for(link(i,j)|i#gt#1 #and# j#gt#1 #and# i#ne#j:u(i)-u(j)+n*x(i,j)<=n-1);
@for(link:@bin(x));
end