reset; model tsp0.mod; data germany.dat; #ger_part.dat; #tsp.dat; option solver cplex; solve; #display x; param l default 1; # actual node in the cycle set next default {} ordered; # the two neighbours of the actual node set T ordered default V; # temporary set for the remaining nodes printf "%d -> ", l ; # node, also print it. repeat until (card(T)=1) { # until all nodes are checked let T:= T diff {l}; # remove the node already found let next:={j in T: (l0) then # it is zero only when both neighbours are visited let l := first(next); # take any of them else { printf "end\n"; # we finish with the first cycle let l := first(T); # take the next cycle } printf "%d -> ", l ; }; printf "end\n"; # we finish with the last cycle display _total_solve_time;