7、 end iter_num=iter_num+1; end T=T*0.99;endorder1totaldis1figure(2)plot(address(order1,1),address(order1,2),'*r-') functiony=distance(address,order)nmb=size(address,1);y=0;fori=1:nmb-1 y=y+sqrt((address(order(i+1),1)-address(order(i),1))^2+(address(order(i+1),2)-address(order(i
8、),2))^2);endy=y+sqrt((address(order(i+1),1)-address(order(1),1))^2+(address(order(i+1),2)-address(order(1),2))^2); functiony=exhgpath(order) while1 b=size(order,1); r=unidrnd(b,1,2); ifr(1)-r(2)~=0 break end end b=order(r(2)); order(r(2))=order(r(1)); order
10、stepsontthefittemp');T=T_max;loadd:address.txt;order1=randperm(size(address,1))';%生成初始解。plot(address(order1,1),address(order1,2),'*r-')totaldis1=distance(address,order1);whileT>=T_min iter_num=1; s_num=1; plot(T,totaldis1) ho