Module 4 Graph Theory 2
Module 4 Graph Theory 2
History
file < >
History
file < >
Application
file < >
Definition
file < >
What is a graph?
Definition
file < >
Example
file < >
< > section name
Example
file < >
< > section name
Example
file < >
< > section name
Definition
file < >
a
< > section name
Definition
file < >
a b
< > section name
Definition
file < >
a
< > section name
Definition
file < >
a b
< > section name
Definition
file < >
a b
< > section name
Definition
file < >
a b
< > section name
Definition
file < >
v
< > section name
Types of Graph
file < >
Example
file < >
Indegree of a graph.
the indegree of vertex is the number of edges coming toward the vertex
Outdegree of a graph
the outdegree of vertex is the number of edges coming away from the vertex
Example
file < >
Indegree of a graph.
the indegree of vertex is the number of edges coming toward the vertex
Outdegree of a graph
the outdegree of vertex is the number of edges coming away from the vertex
Types of Graph
file < >
WEIGHTED GRAPH.
UNWEIGHTED GRAPH
Has value on its edges
has no value on its
edges
< > section name
Adjacency Matrix
file < >
Example
file < >
e
d
b
c
< > section name
Clear points
file < >
1. The two vertices u and v are end vertices of the edge (u, v).
2. Edges that have the same end vertices are parallel.
3. An edge of the form (v, v) is a loop.
4. A graph is simple if it has no parallel edges or loops.
5. A graph with no edges (i.e. E is empty) is empty.
6. A graph with no vertices (i.e. V and E are empty) is a null graph.
7. A graph with only one vertex is trivial.
8. Edges are adjacent if they share a common end vertex.
9. Two vertices u and v are adjacent if they are connected by an edge, in other words, (u, v)
is an edge.
10. The degree of the vertex v, written as d(v), is the number of edges with v as an end vertex.
By convention, we count a loop twice and parallel edges contribute separately.
11. A pendant vertex is a vertex whose degree is 1.
12. An edge that has a pendant vertex as an end vertex is a pendant edge.
13. An isolated vertex is a vertex whose degree is 0.
< > section name
Euler Path
file < >
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
b d b
c a c
a
d
< > section name
Euler Circuit
file < >
Is a circuit that uses every edge in a graph with no repeats. Being a circuit, it must start at
the same vertex
c b
d e
< > section name
1. A graph will contain an Euler path if it contains at most two vertices of odd degree.
2. A graph will contain an Euler circuit if all vertices have even degree.
Note: These theorems do not tell us how to find the Euler path or Euler circuit
Degree of a Vertex
The degree or valence of a vertex is the number of edges meeting at that vertex. It is
possible for a vertex to have a degree of zero or larger
a b c d e
< > section name
Example
file < >
Determine if each graph has a Euler path. If it has one, find an Euler path.
< > section name
Example
file < >
Determine if each graph has a Euler circuit. If it has one, find an Euler circuit.
< > section name
Example
file < >
Determine if each graph has a Euler circuit. If it has one, find an Euler circuit.
< > section name
Euler Circuits
file < >
Hamiltonian Circuits
file < >
Instead of looking for a circuit that covers every edge once, sometimes we are interested in
a circuit that visits every vertex once.
< > section name
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
A Hamiltonian path also visits every vertex once with no repeats, but does not have to
start and end at the same vertex.
Example
file < >
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
A Hamiltonian path also visits every vertex once with no repeats, but does not have to
start and end at the same vertex.
< > section name
Exercise
file < >
With Hamiltonian circuits, our focus will not be on existence, but on the question of
optimization. Given a graph where the edges have weights, we find the optimal
Hamiltonian circuit which would be the one with the lowest total weight.
< > section name
Exercise
file < >