Definition: Euler Path
A path that travels through every edge of a connected graph once and only once and starts and ends at different
vertices
Euler Path
Figure : Euler Path Example
One Euler path for the above graph is F, A, B, C, F, E, C, D, E as shown below.
Figure : Euler Path
This Euler path travels every edge once and only once and starts and ends at different vertices. This graph
cannot have an Euler circuit since no Euler path can start and end at the same vertex without crossing over at
least one edge more than once.
Definition: Euler Circuit
An Euler path that starts and ends at the same vertex
Euler Circuit
Figure : Euler Circuit Example
One Euler circuit for the above graph is E, A, B, F, E, F, D, C, E as shown below.
Figure : Euler Circuit
This Euler path travels every edge once and only once and starts and ends at the same vertex. Therefore, it is
also an Euler circuit.
If a graph has any vertices of odd degree, then it cannot have an Euler circuit.
If a graph is connected and every vertex has an even degree, then it has at least one Euler circuit (usually more).
If a graph has more than two vertices of odd degree, then it cannot have an Euler path.
If a graph is connected and has exactly two vertices of odd degree, then it has at least one Euler path (usually
more). Any such path must start at one of the odd-degree vertices and end at the other one.
The sum of the degrees of all the vertices of a graph equals twice the number of edges (and therefore
must be an even number).
Therefore, the number of vertices of odd degree must be even.
Finding Euler Circuits
1. Be sure that every vertex in the network has even degree.
2. Begin the Euler circuit at any vertex in the network.
3. As you choose edges, never use an edge that is the only connection to a part of the network that you
have not already visited.
4. Label the edges in the order that you travel them and continue this until you have travelled along every
edge exactly once and you end up at the starting vertex.
Finding an Euler Circuit
Figure : Graph for Finding an Euler Circuit
The graph shown above has an Euler circuit since each vertex in the entire graph is even degree. Thus, start at
one even vertex, travel over each vertex once and only once, and end at the starting point. One example of an
Euler circuit for this graph is A, E, A, B, C, B, E, C, D, E, F, D, F, A. This is a circuit that travels over every
edge once and only once and starts and ends in the same place. There are other Euler circuits for this graph.
This is just one example.
Figure : Euler Circuit
The degree of each vertex is labeled in red. The ordering of the edges of the circuit is labeled in blue and the
direction of the circuit is shown with the blue arrows.
Eulerian Path is a path in a graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path that
starts and ends on the same vertex.
How to find whether a given graph is Eulerian or not?
The problem is same as following question. “Is it possible to draw a given graph without lifting pencil from the
paper and without tracing any of the edges more than once”.
A graph is called Eulerian if it has an Eulerian Cycle and called Semi-Eulerian if it has an Eulerian Path. The
problem seems similar to Hamiltonian Path which is NP complete problem for a general graph. Fortunately, we
can find whether a given graph has a Eulerian Path or not in polynomial time. In fact, we can find it in O(V+E)
time.
Following are some interesting properties of undirected graphs with an Eulerian path and cycle. We can use
these properties to find whether a graph is Eulerian or not.
Eulerian Cycle: An undirected graph has Eulerian cycle if following two conditions are true.
1. All vertices with non-zero degree are connected. We don’t care about vertices with zero degree because
they don’t belong to Eulerian Cycle or Path (we only consider all edges).
2. All vertices have even degree.
Eulerian Path: An undirected graph has Eulerian Path if following two conditions are true.
1. Same as condition (a) for Eulerian Cycle.
2. If zero or two vertices have odd degree and all other vertices have even degree. Note that only one
vertex with odd degree is not possible in an undirected graph (sum of all degrees is always even in an
undirected graph)
Note that a graph with no edges is considered Eulerian because there are no edges to traverse.
How does this work?
In Eulerian path, each time we visit a vertex v, we walk through two unvisited edges with one end point as v.
Therefore, all middle vertices in Eulerian Path must have even degree. For Eulerian Cycle, any vertex can be
middle vertex, therefore all vertices must have even degree.