Disordered Curves with Inconsistent Curve Directions

I am trying to match up the end points of two lists of curves in order to merge the correct one curve to its coincident partner.

List 1 (left) shows the coordinates of the endpoints of the green curves. List 2 (right) shows the end points of the red polyline curves. I am certain that the end points match up. List 2 is serious disorganized because the red curves were derived from a Brep intersection of a 3D voronoi component leaving me with disordered curves that also have seemingly random curve directions.

Is there any way to search every branch in list 2 for the inclusion of the coordinates in branch {0;0} of list 1; even if the indexed items in each branch are out of order? I am trying to get an pattern of indexes so that I can order my disordered curves (list 2) to have the same order as list 1.

Just use the Z curve to start unifying, off-the-shelf batteries.You know that