euler path and cycle
euler path and cycle
A path that travels through every edge of a connected graph once and only once and starts and ends at different
vertices
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.
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).
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.
Note that a graph with no edges is considered Eulerian because there are no edges to traverse.