I have a series of graph coordinates and I need to find the shortest one-way path through them all. I have no predetermined start/end but each point must only be touched once and returning to the optimal origin is NOT required.
I've tried a couple TSP approaches, but they all seem to be based on returning to the origin at the end which gives terribly inefficient results in this case.
Example
1, 13
3, 0
3, 7
2, 21
2, 11
3, 12
1, 19
3, 6
would resolve to
3, 0
3, 6
3, 7
3, 12
2, 11
1, 13
1, 19
2, 21
Notes:
Yes I tried the search function, there is a basically identical question Algorithm: shortest path between all points however the only real answer is a TSP, which once again, closed circuit is inefficient for this.
It does not need to be 100% accurate, I already have a permutations method but its far too slow, I need to handle at least ~25-30 points, settling with a good approximation works for me
Thanks in advance.
Edit to clarify, TSP tends to solve as in img #1, my desired result is img #2
img 3 is the above sample solved via a TSP and img #4 is the desired (x coords shifted back -.5 for visibility)
Couple more for good measure #1 = TSP, #2 = desired
Basically i want the shortest chain connecting n points, using whichever start and end point is most efficient