Hi, here is my new input...
I searched for a ways this could be done in less time, but I found that this is only possible if searching is reduced to point clouds that don't go over 9 points... I coded for all cases - if you want exact solution, you must specify complete point cloud - selection of all points and if it's over 9 points, then you'll have to wait for a long time (if it's even possible to complete the task) - it is strongly recommended that you do not specify in input more than 9 points and if there are many points, then 9 points specification is preferable... Still my already posted code is IMHO the best, but it may prove that the task could be completed in less time, but with less reliability of resulting solution... Until someone convert posted lisp to something else - arx, dll; here is my protected vlx that is alternative to shortpath.vlx... The command to invoke is TSP-2D-PTCLOUDS - the same as the name of vlx... But in almost all cases shortpath.vlx beat my version both in speed and solutions... Still I've found one example where my version found better solution and with my posted lisp (look previous postings) with more exhaustive inputs there was found even better solution... I am still not sure if this is exact solution as there were many points above 10 (18) - convex hull simplified somewhat things and so the green solution was found... When it comes to my vlx - convex hull is used only in finding starting solution - after that all points are considered in finding better - if there is better, so not much help from convex hull... Already posted lisp is still the best if you don't hurry, only someone has to make it even faster by coding other than LISP...
So now no code as it would spoil latest lisp version which is the best IMO, just protected vlx and dwg where shortpath.vlx was beaten - both with white after specified point cloud 9 with my vlx and green solution after long time processing with latest lisp here posted...
BTW. LISP version may prove even faster than my vlx if convex hull is complex and there left small number of free inside points from reasons I explained, so it is the good way for correct solving TSP, just it would be better if programmed other than LISP...
I wish you good luck if you try to improve LISP and (or) you found a ways for solution different than proposed in this topic...
M.R.