I've got an array of unique edges (n,2) from my mesh, each edge contains the index of the vertexes it belongs to. I already checked whether the edges form one or more closed loops or not (with networkx) but now I need them sorted for further investigation on the boundary loop.
For example this array has a closed loop from four unsorted edges:
edges = ([[3, 2], [7, 3],[2, 6],[6, 7]])
Now I want to create a new array with the edges sorted like this:
[3, 2] <-> [2, 6] <-> [6, 7] <-> [7,3])
Additionally, the edges which form the first closed loop shell be deleted from the initial array so I can do another sorting for the next closed loop (if there is one).