Join curve recursively

Hi guy’s and girls…

want to create for of particular curve into a group of curve the longuest curve I can by joining them recursively
join-recursevely.gh (128.2 KB)

thanks for help !

Do you have any rule in mind what to do at crossroads which path to choose: 1 or 2?

Should it be by longest possible path in network or by smothness of joining kinks or…?

Yes !
it should go from end of the curve to start of the other curve !
all the curves normals are oriented the same way, and the blue curve should always be linked to the red one or stop if their is no more red line !

thanks for your help !!

I hope you are aware that your curves are in 3d space.
Is this what you wanted? Shortest Walk and Sandbox components used…

Join-recursevely_RE.gh (59.3 KB)

thanks ! I try it very soon !