Traveling Salesman No Overlapping Lines - Python and Grasshopper

I’ve recently started doing research on the tsp problem and came across tsp art. Like this one->

I’m sure many have come across it. Now my interest is not necessarily in tsp art but the process itself. I recently started incorporating more python into my grasshopper scripts and found a tutorial on a quick python script to generate solutions. However each time i regenerate the solution results in overlapping or crossing lines. Like this->

I did some research and found this method to be heuristic, ie. not really the best or shortest past but an intuitive one. The script works by starting with one point and finding the closest point to it.

So the question i have is how to find a solution that results in no overlapping lines. Any thoughts?

I’ve also done a version with anemone also attached. (7.5 KB) (13.0 KB)


To me that seems very similar to @DanielPiker 's solution here: