You can always get incorrect but close enough version for more points (greedy... - my version)...
@Marko
this last version gives sometimes "strange" and in most case "not optimum" solution
we could use conditional permutation ...
assume lst = x1 x2 x3 x4 x5 x6 with x1 and x6 are the two ends
any list resulted from (permutate lst)
1-must have x1 and x6 as the first and last of it i.e any list such (x4 x1 x2 x3 x5 x6) must be discarded
2-assume the result (x1 x4 x3 x5 x2 x6) each point in this list must be in range of the most nearest 4 points of the next or previous point
i.e
x4 must be in the first 4 items from this
(vl-sort lst (function (lambda (e1 e2)(< (distance x1 e1) (distance x1 e2)))))
x3 must be in the first 4 items from this
(vl-sort lst (function (lambda (e1 e2)(< (distance x4 e1) (distance x4 e2)))))
x5 must be in the first 4 items from this
(vl-sort lst (function (lambda (e1 e2)(< (distance x3 e1) (distance x3 e2)))))
... and so on
i don't know you got what iam trying to say or not ... and excuse me for my bad english