Is there a much easier way to find the vertices of a Eulerian Path?

376 Views Asked by At

If I have a $K_8$ graph like the one here and I want to label the Eulerian path for the vertices? what would be the best way to do this, there has to be a better way then just going through the lines one at a time. I keep getting lost every time... how do mathmaticians approach this?

1

There are 1 best solutions below

0
On

Euler path finding algorithm:

STEP $1$: Locate the two vertices of odd degree. Pick one of them at random.

STEP $2$: Start walking from the chosen vertex. Make sure you don’t use the same edge twice. Continue until you get stuck - this can only happen when you visit the other odd-degree vertex and have used up every edge through it.

STEP $3$: Remove from $G$ all the edges you’ve walked along and let $G′$ be the remaining subgraph. For each connected component of $G′$ , perform the Euler cycle finding algorithm.

STEP $4$: Glue together the hierarchy of walks so as to obtain an Euler path between the two odd-degree vertices in the original graph $G$.


Euler cycle finding algorithm:

STEP $1$: Choose a starting vertex $v$ at random.

STEP $2$: Start walking from $v$. Make sure you don’t use the same edge twice. Continue until you return to $v$ and have used up every edge through it.

STEP $3$: Remove from $G$ all the edges you’ve walked along and let $G′$ be the remaining subgraph. For each connected component of $G′$ , go to Step $1$.

STEP $4$: Finally, when there are no edges left, glue together the hierarchy of walks so as to obtain an Euler cycle in the original graph $G$.