Connect closest points into one polyline

Hello, forum,

at first for me it looked like an easy walk, however I was wrong.

I have a huge list of points, having no particular sequence.
My goal is to connect closest points to make a single polyline.
Since point list has no logical sequence, interpolate component is making sketchy, chaotic curve.

Attached image is an output of interpolation…

My afterthought right now is to:

  1. List item (to identify a single point)
  2. Find closest point (to find neighbouring point)
  3. Line (connect both points)
  4. End points (find end point)
  5. Repeat

Since that point list is huge, repeating a process appears to be an issue. Would looping it somehow solve it? Are there any other ideas that you’d share?

Thank you in advance.

polyline-by-closest-point.gh (18.7 MB)

Try this method.

or

polyline-by-closest-point a.gh (18.7 MB)