An algorithm to find simple cycles

algorithmsgraph

I have a graph with an Eulerian cycle and no Hamiltonian cycles. I would like to divide this graph into simple cycles.
Edges may not be repeated in simple cycles.

How can this be done?

Best Answer

Follow your Eulerian cycle. Whenever you arrive at a vertex you've been at before, the part between the two visits is a simple cycle. Chop that off and store it in the list of simple cycles, mark all vertices used in that, except the one you are at now, as unvisited. Continue until all edges have been used.

To find a Eulerian cycle, Hierholzer's method is efficient.

Related Topic