You are on page 1of 41

1 Timothy 4:12 NIV

“Don’t let anyone look down on you


because you are young, but set an
example for the believers in speech, in
conduct, in love, in faith and in purity”
Graph Theory
In mathematics, graphs are a way
to formally represent a network,
which is basically just a collection
of objects that are all
interconnected.

Vaidehi Joshi
March 2017
• A graph is made up of a set of
vertices (or nodes) and a set of
edges (or lines or curves) that
connect the vertices.
G = { V, E }

Graphs
Examples
Graph Vocabulary
► Two vertices are
adjacent
if there is an edge
between them.
► A path exists
between two
vertices if they are connected by
one or more edges.
► A simple path may
not pass
through the same
vertex
more than one time.
► A loop is an edge
(directed or
undirected) which
starts and ends on the
same vertex
► Multiple edges are
edges that connect two
vertices.
► A path that begins
and ends at
the same vertex is
known as a
cycle/circuit.

► A graph is
connected if
there is a path
between every pair
of vertices,
disconnected, if
not.
The degree of a vertex is the
number of edges attached to it.
► Simple graph is
a graph with
no loops and
no multiple
edges.
► In a complete
graph, each
pair of vertices
has an edge
between them.
Complete Graph
► In a directed graph, or digraph,
a direction is indicated, and
movement can only be in the direction
indicated.
► There may be two edges between a
pair of vertices, one in each direction.
► A weighted graph has edges
labeled with numeric values.
Euler Paths and Circuits
The original problem
A resident of Konigsberg wrote to Leonard
Euler saying that a popular pastime for
couples was to try to cross each of the
seven beautiful bridges in the city exactly
once -- without crossing any bridge more
than once.
It was believed that it was impossible
to do – but why? Could Euler explain
the reason?
The Seven Bridges of Konigsberg
In Konigsberg, Germany, a river ran
through the city such that in its center was
an island, and after passing the island, the
river broke into two parts. Seven bridges
were built so that the people of the city
could get from one part to another.
Konigsberg- in days past.
Euler Invents Graph Theory
Euler realized that all
problems of this form
could be represented
by replacing areas of
land by points (what
we call nodes), and
the bridges to and
from them by arcs.
► Usually the graph is
drawn like this
► The problem now
becomes one of
drawing this picture
without retracing
any line and without
picking your pencil
up off the paper.
► Euler saw that there
were 5 vertices that
each had an odd
number of lines
connected to it.
He stated they would
either be the
beginning or end of
his pencil-path.
Paths and Circuits
► Euler path- a continuous path that
passes through every edge once and
only once.

► Euler circuit- when a Euler path begins


and ends at the same vertex
st
Euler’s 1 Theorem

► If a graph is connected and every


vertex has an even degree.
Euler Circuit?

A C

B
D
E
F
nd
Euler’s 2 Theorem
► If a graph is connected and has
exactly two vertices of odd degree,
then is has at least one Euler path.
Any such path must start at one of
the odd degree vertices and must
end at the other odd degree vertex.
Find the Euler Path

B D

A C

H F
G
Path, circuit, or neither…?

1 2 3

4 5 6
Hamiltonian
Circuits
and
Paths
Sir William Rowan Hamilton
► Irish Mathematician
► Knighted at the age of
30
► Hamiltonian Mechanics
are used to determine
orbital trajectories of
satellites.
► Came up with a game…
► In street network, inspect each street exactly
once.
► Can we start at the garage and stop at each
intersection exactly once and return to the
garage? a d

j f
The street
i h
network G
Hamiltonian Paths and Circuits
► Hamiltonian path: You cross each vertex
exactly once and start and end at different
places.
► Hamiltonian circuit: You cross each vertex
exactly once and start and end at the same
place.
Find the Hamiltonian Circuit
A B

C
E

D
Find the Hamiltonian Circuit

A B

E C

D
Find the Hamiltonian Circuit
A B

E C

D
So is there an easy rule????
► There is not an easy rule, but there is a
vague one.
▪ If a connected graph has n vertices, where n >
2 and each vertex has a degree of at least n/2,
then the graph has a Hamiltonian circuit.
Does it work?
A B

E C

D
Find the Hamiltonian Circuit
A B

E C

D
State which graphs are guaranteed
to have a Hamiltonian circuit
1 2

4
3
Thank You.
God bless.

You might also like