哈密顿圈~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

 

 

posted @ 2013-08-20 23:51  Xbingbing  阅读(550)  评论(0编辑  收藏  举报