From charlesreid1

Revision as of 22:57, 27 April 2019 by Admin (talk | contribs) (→‎Overview)

Euler tour/Euler path - a tour around a graph that visits every edge of the graph exactly once.

Euler circuit/Euler cycle - an Euler tour that starts and ends at the same vertex.

Overview

An Euler Circuit is an Euler path or Euler tour (a path through the graph that visits every edge of the graph exactly once) that starts and ends at the same vertex.


Algorithm

Fleury's Algorithm

To print the Euler Circuit of a graph (if it has one), you can use Fleury's Algorithm [1].

Step 1: Check that the graph has 0 or 2 odd vertices (if there are any other number of odd vertices, no Euler circuit exists)

Step 2: If there are 0 odd vertices, start at any node on the graph. If there are 2 odd vertices, start at one o the odd vertices.

Step 3: Follow edges one at a time. If you have a choice between a "bridge" edge and a "non-bridge" edge, always choose the "non-bridge" edge.

Step 4: Stop when you run out of edges.

Related

Graphs:

Traversals on trees:

Breadth-first search and traversal on trees:

  • BFS - breadth first search
  • BFT - breadth first traversal

Depth-first search and traversal on trees:

  • DFS - depth first search
  • DFT - depth first traversal

OOP design patterns:

Category:Traversal

Flags