Unit 2 Graphs
Unit 2 Graphs
LECTURE 4–GRAPHS
1. Definitions
Definition 1.1. A (finite, undirected) graph G = (V, E, φ) consists of
For conciseness, we will usually write uv for {u, v}. If e is an edge with φ(e) = uv, we say
that e is incident to u and v. If there is atleast one edge e such that φ(e) = uv, we say that
u and v are adjacent. Such an edge does not have to be unique – multiple edges are allowed.
If φ(e) = vv, we call e a loop.
1 c
2
f g
b a d
5
3
4
e
φ(a) = φ(b) = 14, φ(c) = 12, φ(d) = 23, φ(e) = 33, φ(f ) = 13, φ(g) = 24.
The edge e is a loop. Note that the pictorial representation of a graph is not unique. The
same graph can be drawn as
1
2 MATH 180 - GRAPH THEORY LECTURE 4–GRAPHS
1 c
2
a g
b
d
4 5
f
3
C2 (not simple) C3 C4
A complete graph Kn is a graph on n vertices any two of which are connected by an edge.
K2 K3 K4
K3,3
3. More definitions
Definition 3.1. We say that G′ = (V ′ , E ′ ) is a subgraph of G = (V, E) if V ′ ⊆ V and
′
E ′ ⊆ E. We say that G′ is an induced subgraph if E ′ = E ∩ V2 , i.e., if every edge of G
between vertices in V ′ is in E ′ .
Definition 3.2. A path in G is a subgraph that is a path graph. A cycle in G is a subgraph
that is a cycle graph.
4. Graph isomorphism
Two graphs G = (V, E, φ) and G′ = (V ′ , E ′ , φ′ ) are said to be isomorphic if there are
bijections θ : V → V ′ and η : E → E ′ such that φ(e) = uv if and only if φ′ (η(e)) = θ(u)θ(v).
Such a pair (θ, η) is called an isomorphism between G and G′ . Intuitively the graphs G and
G′ are the same but differ only in the labeling of vertices and edges.
Example 4.1. For example, the following two graphs are isomorphic
v3 f3 v0 u1
f6 f2
e1
f5 f1 e4 e6
u0
e2 e3
u2 u3
v2 f2 v1 e5
with θ(vi ) = ui and η(fi ) = ei .
Remark 4.2. Isomorphism is an equivalence relation on graphs. Each of the examples from
Section 2 is unique up to isomorphism. For example, there is only one complete graph on
n vertices up to isomorphism and Kn denotes the isomorphism class, so both the graphs in
Example 4.1 are representatives of K4 .
To show that two graphs are isomorphic, we need to explicitly construct an isomorphism.
To show that two graphs are not isomorphic, it suffices to find a graph-theoretic property
that is different for the two graphs. Examples of such properties are:
(1) Number of vertices.
(2) Number of edges.
(3) Set of degrees of vertices.
(4) Existence of subgraphs, e.g., paths or cycles of some length.
Problem 4.3. Which of the following graphs are isomorphic?
4 MATH 180 - GRAPH THEORY LECTURE 4–GRAPHS
Solution. All three graphs are regular of degree 3 with 10 vertices and 15 edges. The first
two graphs are not isomorphic because the first graph has cycles of length 4 and the second
graph does not. The second and third graphs are isomorphic. An isomorphism is shown
below.
6
6 7
1 2 1
10 7
4
5 2 10 8
4 3 9
9 8 5 3
□
MATH 180 - GRAPH THEORY
LECTURE 5 – GRAPHS: BASIC NOTIONS - 2
1. Graph isomorphisms
Recall that:
An isomorphism between two graphs G = (V, E, φ) and G′ = (V ′ , E ′ , φ′ ) is a pair (θ, η)
where
(1) θ : V → V ′ is a bijection,
(2) η : E → E ′ is a bijection,
such that φ(e) = {u, v} if and only if φ′ (η(e)) = {θ(u), θ(v)}.
Remark 1.1. Isomorphism is an equivalence relation on graphs.
Definition 1.2. An isomorphism of a graph with itself is called an automorphism. Intu-
itively, automorphisms are the symmetries of the graph.
Problem 1.3. How many automorphisms does the path graph Pn have?
Solution. Consider the path graph
v0 v1 v2 vn−1 vn
···
e1 e2 e3 en−1 en
elements of V2 , we have to choose whether to include the edge in G or not. Since the
number of non-isomorphic graphs is at most this number, we obtain the upper bound
n
#non-isomorphic graphs ≤ 2( 2 ) .
Next, we find a lower bound. Since ∼ = is an equivalence relation, it partitions the set of
graphs on V into equivalence classes
G
{graphs on V } = E,
E
1
2 MATH 180 - GRAPH THEORY LECTURE 5 – GRAPHS: BASIC NOTIONS - 2
where the different equivalence classes correspond to the different non-isomorphic graphs.
Each equivalence class contains at most n! graphs since this is the number of bijections
n
[n] → [n], i.e., for every E, |E| ≤ n!. Since there are 2( 2 ) graphs, we get
n
2( 2 ) =
X X
|E| ≤ n! = #non-isomorphic graphs · n!.
E E
Therefore,
n
2( 2 )
#non-isomorphic graphs ≥ .
n!
□
2. Connectedness
Definition 2.1. We say that a subgraph G′ is an induced subgraph of G if for every x, y ∈ V ′ ,
if e ∈ E is an edge with φ(e) = {x, y}, then e ∈ E ′ . In other words, all edges in G between
vertices in G′ must be in G′ .
Definition 2.2. A walk of length t in a graph G = (V, E) is a sequence
(v0 , e1 , v1 , e2 , v2 , . . . , vt−1 , et , vt ),
where ei is an edge in E with ϕ(ei ) = {vi−1 , vi }. We also allow t = 0, in which case the walk
(v0 ) is a walk of length 0.
Remark 2.3. We allow repetition of vertices and edges in a walk (unlike in a path).
We define a relation ∼ on V by x ∼ y if there is a walk from x to y in G.
Lemma 2.4. ∼ is an equivalence relation on V .
Proof. We check the three properties:
(1) reflexive: x ∼ x since we have the walk (x) of length 0.
(2) symmetric: if x ∼ y, then y ∼ x since we have the walk going backwards.
(3) transitive: if x ∼ y and y ∼ z, then x ∼ z since we can concatenate the two walks.
□
Definition 2.5. Let V = V1 ⊔ V2 ⊔ · · · ⊔ Vk denote the partition of V into equivalence classes
and let G1 , . . . , Gk denote the induced subgraphs on V1 , . . . , Vk respectively. The Vi are called
the (connected) components of G. We say that G is connected if there is only one connected
component, i.e., if any two vertices of G are connected by a walk.
3. Degree
Definition 3.1. The degree deg(v) of a vertex v is the number of edges incident to v.
P
Lemma 3.2 (Handshake lemma). 2|E| = v∈V deg(v).
Proof. Count the number of edges by counting the number of edges incident to each vertex.
Then each edge is counted twice, so the number of edges is half the total degree of all
vertices. □
MATH 180 - GRAPH THEORY LECTURE 5 – GRAPHS: BASIC NOTIONS - 2 3
4. Distance
Let G = (V, E) be a connected graph.
Definition 4.1. The distance between x and y is the function dG : V × V → Z defined as
dG (x, y) := min{k : there is a path of length k between x and y}.
Remark 4.2. Since a walk of shortest length must be a path, we could also use walk instead
of path in the definition of distance.
MATH 180 - GRAPH THEORY
LECTURE 6 – GRAPHS: BASIC NOTIONS - 3
1. Distance
Let G = (V, E) be a connected graph.
Definition 1.1. The distance between x and y is the function dG : V × V → Z defined as
dG (x, y) := min{k : there is a path of length k between x and y}.
Remark 1.2. Since a walk of shortest length must be a path, we could also use walk instead
of path in the definition of distance.
2. Graph representations
How can we store the data of a simple graph on a computer? The following matrix gives
one way to do this.
Definition 2.1. Let G = (V, E, φ) be a simple graph with n vertices 1, . . . , n. The adjacency
matrix of G is the n × n matrix A = (Aij ) defined by
(
1 if {i, j} ∈ E,
Aij :=
0 otherwise.
Proposition 2.3. The (i, j)-entry of the kth power A(x)k is Zijk (x).
Proof. Induction on k.
(1) Base case: When k = 1, Zij1 = xij if {i, j} ∈ E and 0 otherwise, so Zji1 = A(x)ij
1
2 MATH 180 - GRAPH THEORY LECTURE 6 – GRAPHS: BASIC NOTIONS - 3
(2) Induction step: Let k > 1 and let i, j be two vertices. Any walk from i to j of length
k consists of an edge {i, l} for some vertex l incident to i followed by a walk of length
k − 1 from l to j. Therefore
X
Zijk (x) = xil Zljk−1 (x).
l:{i,l}∈E
k k−1
Using A(x) = A(x) · A(x) and using the definition of matrix multiplication, we
get
n
X X
k
(A(x) )ij = A(x)il (A(x)k−1 )lj = xil Zljk−1 (x) = Zijk (x).
l=1 l:{i,l}∈E
□
3. Degree
Definition 3.1. The degree deg(v) of a vertex v is the number of edges incident to v.
Definition 3.2. Let v1 , . . . , vn denote the set of vertices of G. The sequence
(degG (v1 ), . . . , degG (vn ))
is called the degree sequence or score of G.
Since the ordering of vertices is arbitrary, we do not distinguish two degree sequences that
are permutations of each other, so we will usually write the degree sequence in nondecreasing
order.
Remark 3.3. Isomorphic graphs have the same degree sequence, so it can be used to tell
if two graphs are not isomorphic. However, there are non-isomorphic graphs with the same
degree sequence (e.g., the pentagonal prism and Petersen’s graph from Lecture 4), so it
cannot be used to tell if two graphs are isomorphic.
Which sequences can arise as degree sequences of graphs? The following gives a necessary
condition.
P
Lemma 3.4 (Handshake lemma). 2|E| = v∈V deg(v).
Proof. Count the number of edges by counting the number of edges incident to each vertex.
Then each edge is counted twice, so the number of edges is half the total degree of all
vertices. □
4. Score theorem
In this section, assume the graph is simple.
Theorem 4.1 (Score theorem). Let D = (d1 , . . . , dn ) be a sequence of natural numbers,
n > 1. Suppose 0 ≤ d1 ≤ d2 ≤ · · · ≤ dn ≤ n − 1, and let D′ := (d′1 , . . . , d′n−1 ), where
(
di for i < n − dn ,
d′i :=
di − 1 for i ≥ n − dn .
Then D is a graph score if and only if D′ is a graph score.