Lecture Note 4 (CSM 166)
Lecture Note 4 (CSM 166)
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1,
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4,
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3,
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2,
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3,
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=2
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=2
deg(g)=
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=2
deg(g)=1.
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=2
deg(g)=1.
Degree sequence is:
1/25
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Degree Sequence
deg(a)=1, deg(b)=4, deg(c)=3, deg(d)=2, deg(e)=3, deg(f)=2
deg(g)=1.
Degree sequence is: 1, 1, 2, 2, 3, 3, 4.
1/25
Graph Theory - Bipartite Graph
Bipartite Graph
A bipartite graph Km,n (for m, n ≥ 1) is a simple graph with m + n
vertices. The vertex set partitions into sets X and Y of cardinalities m and
n. And edges are only of the form xy , where x ∈ X , y ∈ Y :
3/25
Bipartite Graph, 2-Coloring and No Odd-length Cycle
Theorem
The following are equivalent:
1 G is bipartite.
2 G admits a proper 2-vertex-colouring; that is, the vertices of G can
be coloured with 2 colours (say, red and blue) so that the endpoints
of each edge receive distinct colours.
3 G has no subgraph that is a cycle of odd length.
5 6
1 2
3 4
8 7
G
Bipartite Graph, 2-Coloring and No Odd-length Cycle
Theorem
The following are equivalent:
1 G is bipartite.
2 G admits a proper 2-vertex-colouring; that is, the vertices of G can
be coloured with 2 colours (say, red and blue) so that the endpoints
of each edge receive distinct colours.
3 G has no subgraph that is a cycle of odd length.
5 6
1 2
3 4
8 7
G
3/25
Bipartite Coloring
4/25
Bipartite Coloring
4/25
Bipartite Coloring
4/25
Bipartite Coloring
4/25
Matrix Representation of Graphs
Graph Theory - Incident Matrix Representation
7/25
Graph Isomorphism
a g 5 6
b h 1 2
c i 3 4
d j 8 7
G H
a g 5 6
b h 1 2
c i 3 4
d j 8 7
G H
An Isomorphism
between G and H
a g 5 6 f (a) = 5 f (b) = 2
b h 1 2 f (c) = 3 f (d) = 7
c i 3 4 f (g ) = 1 f (h) = 6
d j 8 7 f (i) = 8 f (j) = 4
G H
8/25
Graph Isomorphism
An Isomorphism
between G and H
a g 5 6 f (a) = 5 f (b) = 2
b h 1 2 f (c) = 3 f (d) = 7
c i 3 4 f (g ) = 1 f (h) = 6
d j 8 7 f (i) = 8 f (j) = 4
G H
8/25
Graph Isomorphism
Are these two graph isomorphic?
u ∼G v ⇔ ϕ(u) ∼H ϕ(v )
for all u, v ∈ V (G ). Graphs G and H are called isomorphic (denoted
G∼ = H) if there exists an isomorphism from G to H.
9/25
Graph Isomorphism
10/25
Graph Isomorphism
Observation
To prove that graphs G and H are isomorphic, we must find an
isomorphism from G to H.
To prove that graphs G and H are not isomorphic, it suffices to find
an invariant in which G and H differ.
11/25
Graph Isomorphism -Example 1
Solution:
12/25
Graph Isomorphism -Example 1
Solution:
No. They have the same degree sequence. But these two graphs are not
isomorphic. H has a subgraph isomorphic to C3 , while G does not (it is, in
fact, bipartite and isomorphic to K3,3 ).
12/25
Graph Isomorphism -Example 2
Are these two graph isomorphic?
Solution:
13/25
Graph Isomorphism -Example 2
Are these two graph isomorphic?
Solution:
Yes, these two graphs are isomorphic. An isomorphism ϕ : (G ) → V (H) is
given by
ϕ(1) = a ϕ(2) = d
ϕ(3) = b ϕ(4) = e
ϕ(5) = c ϕ(6) = f
13/25
Graph Isomorphism -Example 3
Solution:
14/25
Graph Isomorphism -Example 3
Solution:
No, these two graphs are not isomorphic. They have the same degree
sequence, however, graph H contains no pair of adjacent vertices of degree
3, while G does.
14/25
Walks, Trails, Paths, Cycle
Walks, Trails, Paths, Cycles
Definition
Walk Let G = (V , E ) be a graph with the incidence function fG . Let
x, y ∈ V and k ∈ N. An (x, y )-walk of length k in G is an alternating
sequence of vertices and edges.
15/25
Walks, Trails, Paths, Cycles
Definition
Walk Let G = (V , E ) be a graph with the incidence function fG . Let
x, y ∈ V and k ∈ N. An (x, y )-walk of length k in G is an alternating
sequence of vertices and edges.
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
is a (1,3)-walk of length 6 that is not a trail.
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
is a (1,3)-walk of length 6 that is not a trail.
W = 1e4d4c3
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
is a (1,3)-walk of length 6 that is not a trail.
W = 1e4d4c3
is a (1,3)-trail of length 3 that is not a path.
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
is a (1,3)-walk of length 6 that is not a trail.
W = 1e4d4c3
is a (1,3)-trail of length 3 that is not a path.
W = 1f 5m8k3
16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 1a2h6n5f 1a2b3
is a (1,3)-walk of length 6 that is not a trail.
W = 1e4d4c3
is a (1,3)-trail of length 3 that is not a path.
W = 1f 5m8k3
is a (1,3)-path of length 3. 16/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 2b3j7i2h6o7i2
17/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
17/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 4d4l8k3c4
17/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
17/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
W = 2b3j7o6h2
17/25
Walks, Trails, Paths, Cycles
Definition
A walk W = v0 e1 v1 e2 v2 · · · vk1 ek vk is called
closed if v0 = vk , and open otherwise;
a trail if its edges are pairwise distinct;
a path if its vertices are pairwise distinct; and
a cycle if v0 = vk while its internal vertices v1 , · · · , vk are pairwise
distinct.
Connected Graph
A graph G = (V , E ) is called connected if for any x, y ∈ V there exists an
(x, y )-path (or equivalently, (x, y )-walk) in G . A graph that is not
connected is called disconnected.
18/25
Trees
19/25
Trees
Theorem 1
Let G be a graph. Then G is a tree if and only if for any two vertices
u, v ∈ V (G ), there exists a unique (u, v )-path in G .
Theorem 2 and 3
Every tree with at least 2 vertices has at least 2 vertices of degree 1
(called leaves).
Any tree with n vertices has exactly n − 1 edges.
20/25
Rooted Trees
Rooted Tree
A tree with a vertex designated as the root is called a rooted tree.
21/25
Rooted Trees
Similar terminologies for rooted trees?
22/25
Rooted Trees
Terminology for rooted trees:
Let T = (V , E ) be a rooted tree with root r and u, v ∈ V .
If u lies on the unique (v , r )-path, then u is called anancestor of v ,
and v is called a descendant to u.
If u lies on the unique (v , r )-path and uv has an edge, then u is called
the parent of v , and v is called a child of u.
If u and v have the same parent, then they are called siblings.
If vertex u has a child, then it is called an internal vertex; if it has
no children, thenit is called a leaf.
23/25
Rooted m-ary Trees
24/25
Thank you for your attention!!
25/25