function TL=CalToursLength(AT,DM) %:计算游历路径长度 [m,nc]=size(AT); TL=zeros(m,1); for k=1:m for i=1:nc-1 TL(k)=TL(k)+DM(AT(k,i),AT(k,i+1)); end end