I'm looking for an algorithm to find an Euler path in a graph.
I've seen a good one a couple of weeks ago but I can't find it now, I remember there was tagging edges, something with even/odd connections...
Do you know a similar, simple and straightforward algorithm?
Fleury's Algorithm is used to display the Euler path or Euler circuit from a given graph. In this algorithm, starting from one edge, it tries to move other adjacent vertices by removing the previous vertices. Using this trick, the graph becomes simpler in each step to find the Euler path or circuit.
FLEURY'S ALGORITHM If Euler's Theorem indicates the existence of an Euler path or Euler circuit, one can be found using the following procedure: If the graph has exactly two odd vertices choose one of these odd vertices as the starting point of an Euler path. If the graph has no odd vertices it has an Euler circuit.
An Eulerian cycle, Eulerian circuit or Euler tour in an undirected graph is a cycle that uses each edge exactly once. If such a cycle exists, the graph is called Eulerian or unicursal. The term "Eulerian graph" is also sometimes used in a weaker sense to denote a graph where every vertex has even degree.
From Graph-Magics.com, for an undirected graph, this will give you the tour in reverse order, i.e. from the end vertex to the start vertex:
Repeat step 2 until the current vertex has no more neighbors and the stack is empty.
Otherwise:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With