Though I have not a 99% definite answer on how to roll with this, I can think of this strategy.
-
You always have to start from the active curve, active curve will act as an initiator that will make things much easier in some ways. Such as for example if you select all but mark the curve [#1] manually as active (explicit selection) then you immediately will know the order of starting.
As for example Blender uses this pattern quite a lot, most notable is Grid Fill, where you will have to explicitly mark the corner as active to get a perfect result at once, otherwise if you go by chance you will end up tuning the steps randomly until you get a good match. -
Once you have the curve #1 selected, you can start a flood fill to check for connections.
-
Once you have figured out the chain of connections, you will have to flip curves that are reversed, have only one flow from start to the end.
-
You will be able now to fix the positions of the curves now.
P.S. I had to solve such a similar problem (except setting the positions - they were snapped manually from the user). See if is helpful.