MATH1081 Topic 5 Slides
MATH1081 Topic 5 Slides
Graph Theory
d e g
a
b c f
V = {a, b, c, d, e, f }
and edge set
A multigraph G consists of
Example.
Consider the multigraph G with vertices and edges:
V = {v1, v2, v3, v4, v5} and E = {e1, e2, e3, e4, e5, e6, e7} :
Edge Endpoints
v3 e1
e2 e4 e2
e5 e3
e6 e4
e1 v2 e3 v4 e7 e5
v1 v5
e6
e7
If e = vw is an edge of a graph or multigraph G, then we
say that
v deg(v)
a
a b
d e c
b
d
c e
f
f g g
Exercise.
How many loops, isolated vertices and pendant vertices are
there in this multigraph?
Example.
Path P4 Cube Q3
How many vertices and edges do Pn, Cn, and Kn each have?
|V |:
|E|:
Example.
Proof.
Example.
a
d e
b
c
f g
Exercise.
The vertices of Qn can be labelled as bit strings:
n o
V (Qn) = {0, 1}n = a1 · · · an : ai ∈ {0, 1}
010 110
111
How many vertices does Qn have? 011
000 100
Cube Q3
Challenge: Draw Q4.
?
Q1 Q2 Q3 Q4
Exercise:
Prove that no graph can have the following vertex degrees:
• 5,4,3,2,1
• 4,3,3,1,1
b c
a d
f e
b e
c d
Example. The complete bipartite graph Km,n
• E(G) ⊆ E(H).
Example. G ⊆ H
b b
G a e a d e H
c c
Definition. Let G be a graph with vertex set V and edge
set E. The complement G of G is the graph with vertex set
V , such that
Example.
G G
Exercise:
Example.
v2 v3 v3 v2
v1 v1
A= A=
v0v1v2 . . . vn−1vn.
A walk is closed if it starts and ends in the same vertex:
v0 = v n .
Example.
b y e2 u
e1 e4 e5
a d x w
c e3 z e6
Definition.
A cycle is a walk which does not use the same edge twice,
begins and ends at the same vertex, but which otherwise
has no repeated vertices.
Notes:
c e d b c is a cycle of length 4.
Exercise.
a c
Proof.
2 1 1 1 2 3 4 1
1 2 1 1 3 2 4 1
A2 = A3 =
1 1 3 0 4 4 2 3
1 1 0 1 1 1 3 0
Proof of Theorem.
Definition. A graph G is connected if for any two vertices
a, b there is a walk from a to b.
a b
a
X Y
e b
a b c
d c
K3,2 K5
Euler trail? X aY bX cY No
Euler tour? No abcdeacebda
Hamilton path? aX bY c abcde
Hamilton cycle? No abcdea
Theorem. Let G be a connected multigraph. Then
Proof.
A circuit is a closed walk which uses each edge at most
once.
A D A D
B
B
Can you cross each bridge exactly once and return to where
you started? To solve this problem, Leonhard Euler invented
graph theory.
G H
But these edges form a cycle which does not contain the
inner vertices. So H has no Hamilton cycle.
Cn Kn
Definition.
Graphs G and H are isomorphic, written G ≃ H, if there is
a bijection f : V (G) → V (H) such that
d c w z u f (u)
a
b
a x y c
b
d
G H
G H
G H
Exercise. Are these two graphs isomorphic?
G H
Planar graphs
Example.
K4 a planar map of K4
Exercise. Prove that K2,3 is planar.
K2,3
Example.
R e
S T
Example.
Here are two planar maps of the same planar multigraph.
R R
S T S T
Lemma.
Let G be a connected multigraph with n ≥ 2 vertices.
If G has no cycles then G is a (simple) graph and G has a
pendant vertex (that is, a vertex of degree 1).
Proof.
Proof of Euler’s Formula.
R A B C D
A B D
C deg(R)
Example.
A B D
C
Definition. A dual of a planar map G is a planar map G∗
given as follows:
Example.
G G∗
• e ≤ 3v − 6,
This theorem is useful for proving that some graphs are not
planar.
Proof.
Example. Prove that K5 is not planar.
a b a b
Example.
• K5, or
• K3,3, or
(Informally, this says that K5 and K3,3 are basically the only
barriers to planarity.)
w
a x
y b
c z
G
w w
a x a x a x
y b y b y b
c z c z c z
G G′ H
Example.
Proof.
Theorem. Every tree on n vertices has n − 1 edges.
Proof.
Example
Proof.
Theorem. Every connected graph contains a spanning tree.
Proof.
Theorem.
A connected graph on n vertices is a tree if and only if it
has n − 1 edges.
Proof.
Definition.
A weighted graph is a graph with numbers (weights)
assigned to its edges.
Example.
a a a
G: T1 : T2 :
5 4 4 4
1 1 1
2 5
b b b 2
2 2 2
1 4 1
1. Set T = ∅.
4. Add e to T .
Example.
Find a minimal spanning tree for this weighted graph.
Definition.
The union of these paths forms a minimal a-path spanning
tree for G.
a a a
G: T1 : T2 :
5 4 4 4
1 1 1
2 5
b b b 2
2 2 2
1 4 1
Let G be a connected weighted graph with positive edge
weights, and let a ∈ V (G).
1. Set T = {a}.
2. Let A be the set of edges with one vertex v not in T and
the other in T .
3. Choose an edge e from A that gives a shortest path from
a to any v.
4. Add e to T .
5. Continue until T contains all vertices of G.
6. Then T is a minimal a-path spanning tree for G.
b c d e f g h i
2 6 5 1 4 3 4 5