Euler & Hamilton Graph

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

EULER & HAMILTON

GRAPH
Presented by Muhammad Awais
Roll # 18681556-036
INTRODUCTION

• How can we travel along the edges of a graph starting at a vertex and returning to it
by traversing each edge of the graph exactly once?
• How can we travel along the edges of a graph starting at a vertex and returning to it
while visiting each vertex of the Can graph exactly once?
EULER PATH
• An Euler path is a path that uses every edge in a graph with no repeats. Being a path,
it does not have to return to the starting vertex.
• Example : In the graph shown below, there are several Euler paths. One such path is
CABDCB. The path is shown in arrows to the right, with the order of edges numbered.
EULER CIRCUIT

• An Euler circuit is a circuit that uses every edge in a graph with no repeats. Being a
circuit, it must start and end at the same vertex.
• Example: The graph below has several possible Euler circuits. Here’s a couple,
starting and ending at vertex A: ADEACEFCBA and AECABCFEDA. The second is
shown in arrows.
THEOREMS

• A graph will contain an Euler path if it contains at most two vertices of odd degree.
• A graph will contain an Euler circuit if all vertices have even degree
EXAMPLE
• In the graph below, vertices A and C have degree 4, since there are 4 edges leading
into each vertex. B is degree 2, D is degree 3, and E is degree 1. This graph contains
two vertices with odd degree (D and E) and three vertices with even degree (A, B,
and C), so Euler’s theorems tell us this graph has an Euler path, but not an Euler
circuit.
EXAMPLE
• No two vertices have odd degree. So, it is not a Eular Path
• Since all vertices have even degree, so it is a Eular Circuit.
APPLICATIONS OF EULER PATHS AND
CIRCUITS

• Finding an Euler Path or circuit in the appropriate graph model can solve such
problems. For example, if a postman can find an Euler path in the graph that
represents the streets the postman needs to cover, this path produces a route that
traverses each street of the route exactly once. If no Euler path exists, some streets
will have to be traversed more than once. The problem of finding a circuit in a graph
with the fewest edges that traverses every edge at least once is known as the
Chinese postman problem.
HAMILTON PATH

• A Hamiltonian Path visits every vertex once with no repeats, but does not have to
start and end at the same vertex.
HAMILTON CIRCUIT
• A Hamiltonian Circuit is a circuit that visits every vertex once with no repeats.
Being a circuit, it must start and end at the same vertex
EXAMPLE

• Which of the simple graphs in figure below have a Hamilton circuit or, if not, a Hamilton path?
• Solution: G1 has a Hamilton circuit: a,b,c,d,e,a. There is no Hamilton circuit in G2 (this can be
seen by noting that any circuit containing every vertex must contain the edge{a,b}twice), but
G2 does have a Hamilton path, namely, a,b,c,d. G3 has neither a Hamilton circuit nor a Hamilton
path.
CONDITIONS FOR THE EXISTENCE OF
HAMILTON CIRCUIT

• A graph with a vertex of degree one cannot have a Hamilton circuit, because in a
Hamilton circuit, each vertex is incident with two edges in the circuit.
CONT.
• EXAMPLE Show that graph displayed in Figure has a Hamilton circuit
• Solution: There is no Hamilton circuit in G because G has a vertex of degree one,
namely, e.
DIRAC’S THEOREM

• If G is a simple graph with n vertices with n ≥ 3 such that the degree of every vertex
in G is at least n/2, then G has a Hamilton circuit.
CONT.

• As C and D have only 2 degree but n/2 is 3, so it isn’t a Hamilton circuit.


ORE’S THEOREM

• If G is a simple graph with n vertices with n ≥ 3 such that deg(u)+deg(v) ≥ n for


every pair of nonadjacent vertices u and v in G, then G has a Hamilton circuit.
CONT.
• It does not satisfy the condition of ORE’S Theorem but still Hamilton circuit.
APPLICATIONS OF HAMILTON CIRCUITS:

• Hamilton paths and circuits can be used to solve practical problems. For example,
many applications ask for a path or circuit that visits each road intersection in a city,
each place pipelines intersect in a utility grid, or each node in a communications
network exactly once. Finding a Hamilton path or circuit in the appropriate graph
model can solve such problems. The famous traveling salesperson problem or TSP
(also known in older literature as the traveling salesman problem) asks for the
shortest route a traveling salesperson should take to visit a set of cities. This problem
reduces to finding a Hamilton circuit in a complete graph such that the total weight of
its edges is as small as possible.
ANY QUESTION
END

You might also like