Chapter 8. Graphs (Part 1)
Chapter 8. Graphs (Part 1)
Learning Objectives:
5 2
4 3
Types of Graphs
A complete graph is a graph in which every possible
edge is drawn between the vertices.
Types of Graphs
A graph is a directed graph where all the edges are
directed from one vertex to another. It is also called a
digraph.
Equivalent Graphs
Two or more graphs are equivalent if the edges
form the same connections of vertices.
𝑢1 − 𝑢5 − 𝑢2 − 𝑢3 𝑣5 − 𝑣4 − 𝑣3 − 𝑣1 − 𝑣2
CIRCUIT A circuit is a closed path/cycle where a path ends
at the same vertex at which it started.
𝒖𝟏 − 𝑢5 − 𝑢2 − 𝑢3 − 𝒖𝟏 𝒗𝟏 − 𝑣2 − 𝑣3 − 𝑣4 − 𝑣5 − 𝒗𝟏
EULER PATH EULER CIRCUIT
It is a path where each It is a circuit where each
edge in a graph is edge in a graph is traversed
traversed once and starts once and starts and ends at
and ends at a different the same vertex.
vertex.
𝟏−2−3−4−5−1−𝟒 𝟏−2−3−4−5−𝟏
EULERIAN PATH AND CIRCUIT THEOREMS
Eulerian Graph Theorem
A connected graph is Eulerian if and only if every vertex
of the graph is of even degree. Furthermore, the graph is
Eulerian if it has an Euler circuit.
Is it possible to
plan a journey that
traverse the tracks
and returns to the
starting point
without traveling
through any
portion of a track
more than once?
APPLICATION OF EULER PATH THEOREM
𝑩 𝑪 𝑫
𝑬
𝑨 𝑭
HAMILTONIAN CIRCUIT It is a cycle where each vertex is
traversed exactly once and starts
and ends at the same vertex.
Historical background
William Rowan Hamilton (1805-1865) – Irish
mathematician who studied ”Hamiltonian” circuits
Example: Consider 𝒖𝟏 as a starting vertex.
𝒗𝟏 𝒗𝟏
𝒖𝟓 𝒖𝟐 𝒖𝟓 𝒖𝟐
𝒗𝟓 𝒗𝟐 𝒗𝟓 𝒗𝟐
𝒗𝟒 𝒗𝟑 𝒗𝟒 𝒗 𝟑
𝒖𝟒 𝒖𝟑 𝒖𝟒 𝒖𝟑
𝑢1 − 𝑢2 − 𝑢3 − 𝑣3 − 𝑣2 𝑢1 − 𝑢2 − 𝑢3 − 𝑣3 − 𝑣2
− 𝑣1 − 𝑣5 − 𝑣4 − 𝑢4 − 𝑢5 − 𝑣1 − 𝑣5 − 𝑣4 − 𝑢4 − 𝑢5
− 𝑢1
DIRAC’S THEOREM
Dirac’s Theorem
Consider a connected graph with at least three
vertices and no multiple edges. Let 𝒏 be the number of
vertices in the graph. If every vertex has a degree of at
𝒏
least , then the graph must be Hamiltonian.
𝟐
Note:
If the given graph does not meet the requirements of
Dirac’s theorem, it still might be Hamiltonian.
DIRAC’S THEOREM
a. b.
WEIGHTED GRAPHS It is a graph where each edge is
associated with a value called
weight.
713
597 Washington, DC
Chicago
748
544
803
1185
1374
665
Dallas 1299 Philadelphia
585
670
Atlanta
ALGORITHMS IN COMPLETE GRAPHS
A-D-F-B-C-E-A
4+7+5+6+6+5=3
3
ALGORITHMS IN COMPLETE GRAPHS
(Check your progress 3 & 4)
A. Use the Greedy algorithm and the Edge-picking algorithm to
find a Hamiltonian circuit. State the corresponding weight.