I have two question about similar curves

1:

I have many curves.

and need using C++ codes to divide them into groups along the curves‘s Similarity。

how can I do?

2:I have two group curves named gruop A and B (these curves are not sorted )

which can be merged to two closed curves.

one closed curve is inner the other.

one curve in gruop A has a similartity curve in gruop B.

How can I find the corresponding curve in gruop B?

similarCurves.rar(6.0 KB) is a just simpely test sample curves.

in this example: I need find the same color curve along the outside curves.