0% found this document useful (0 votes)
101 views24 pages

Basic Graph Terminologies: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook

This document defines basic graph theory terminology. It defines graphs, multigraphs, directed graphs, weighted graphs, adjacency, incidence, degree, and the degree-sum formula. The degree-sum formula states that the sum of the degrees of all vertices in a graph equals twice the number of edges. This implies that the number of edges in a graph can be calculated from the vertex degrees alone. The document also defines maximum and minimum degree of a graph.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
101 views24 pages

Basic Graph Terminologies: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook

This document defines basic graph theory terminology. It defines graphs, multigraphs, directed graphs, weighted graphs, adjacency, incidence, degree, and the degree-sum formula. The degree-sum formula states that the sum of the degrees of all vertices in a graph equals twice the number of edges. This implies that the number of edges in a graph can be calculated from the vertex degrees alone. The document also defines maximum and minimum degree of a graph.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Chapter 2

Basic Graph Terminologies

In this chapter, we give some definitions of basic graph theoretic terminolo-


gies.

2.1 Graphs and Multigraphs

A graph G is a tuple consisting of a finite set V of vertices and a finite set E


of edges where each edge is an unordered pair of vertices. The two vertices
associated with an edge e is called the end-vertices of e. We often denote
by (u, v), an edge between two vertices u and v. We also denote the set of
vertices of a graph G by V (G) and the set of edges of G by E(G).
We generally draw a graph G by representing each vertex of G by a
point or a small circle and each edge of G by a line segment or a curve
between its two end-vertices. For example, Fig. 2.1 represents a graph G
where V (G) = {v1 , v2 , . . . , v11 } and E(G) = {e1 , e2 , . . . , e17 }. We often
denote the number of vertices of a graph G by n and the number of edges
of G by m; that is, n = |V (G)| and m = |E(G)|. We will use these two
notations n and m to denote the number of vertices and the number of
edges of a graph unless any confusion arises. Thus n = 11 and m = 17 for
the graph in Fig. 2.1.
A loop is an edge whose end-vertices are the same. Multiple edges are
edges with the same pair of end-vertices. If a graph G does not have any

13
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

14 Basic Graph Theory

v8 v7 e11

v5 e13
e16 e12 v4
v9 e8
e15 v6 e10
e14 e9
v10
e17 e6 v11 e7
e4 e5 v3
e3
v1 e2 v2
e1

Fig. 2.1 A simple graph with eleven vertices and seventeen edges.

loops or multiple edges, then G is called a simple graph; otherwise it is


called a multigraph. The graph in Fig. 2.1 is a simple graph since it has no
loops or multiple edges. On the other hand, the graph in Fig. 2.2 contains
a loop e5 and two sets of multiple edges {e2 , e3 , e4 } and {e6 , e7 }. Hence the
graph is a multigraph. In the remainder of the book, when we say a graph,
we shall mean a simple graph unless there is any possibility of confusion.

e5
e10
e1 v5 v4
v1 e2 e8
e3 e9
e6
e4
v2 v3
e7

Fig. 2.2 A multigraph.

We call a graph a directed graph or a digraph if edge is associated with a


direction, as illustrated in Figure 2.3(a). One can consider a directed edge
as a one-way street. We thus can think an undirected graph as a graph
where each edge is directed in both direction. We deal with digraphs in
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 15

Chapter 8. We call a graph an weighted graph if an weight is assigned to


each vertex or each edge. Figure 2.3(b) illustrates an edge-weighted graph.

a 4 b
a

4 3 2
6
f f
b
e
e 5
5
6
c
5
d c
d

(a) (b)

Fig. 2.3 A multigraph.

2.2 Adjacency, Incidence and Degree

Let e = (u, v) be an edge of a graph G. Then the two vertices u and v are
said to be adjacent in G and the edge e is said to be incident to the vertices
u and v. The vertex u is also called a neighbor of v in G and vice versa.
In the graph in Fig. 2.1, the vertices v1 and v3 are adjacent; the edge e1 is
incident to the vertices v1 and v3 . The neighbors of the vertex v1 in G are
v2 , v3 v6 , v9 and v11 .
The degree of a vertex v in a graph G, denoted by deg(v) or d(v), is the
number of edges incident to v in G, with each loop at v counted twice. The
degree of the vertex v1 in the graph of Fig. 2.1 is 5. Similarly, the degree
of the vertex v5 in the graph of Fig. 2.2 is also 5.
Since the degree of a vertex counts its incident edges, it is obvious that
the summation of the degrees of all the vertices in a graph is related to the
total number of edges in the graph. In fact the following lemma, popularly
known as the “Degree-sum Formula” indicates that summing up the degrees
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

16 Basic Graph Theory

of each vertex of a graph counts each edge of the graph exactly twice.

Lemma 2.2.1 (Degree-sum Formula) Let G = (V, E) be a graph with



m edges. Then deg(v) = 2m.
v∈V

Proof. Every non-loop edge is incident to exactly two distinct vertices


of G. On the other hand, every loop edge is counted twice in the degree
of its incident vertex in G. Thus, every edge, whether it is loop or not,
contributes a two to the summation of the degrees of the vertices of G. �

The above lemma, due to Euler (1736), is an essential tool of graph


theory and is sometimes refer to as the “First Theorem of Graph Theory”
or the “Handshaking Lemma”. It implies that if some people shake hands,
then the total number of hands shaken must be even since each handshake
involves exactly two hands. The following corollary is immediate from the
degree-sum formula

Lemma 2.2.2 The number of odd degree vertices in a graph is an even


number.

Proof. Let G be a graph with m edges. Let x be the sum of the degrees of
even degree vertices and y be the sum of the degrees of odd degree vertices.
By Lemma 2.2.1 x + y = 2m. Since x is the sum of even integers, x is
even, and hence y = 2m − x is also an even integer. Since y is the sum of
odd integers, the number of addends in the sum must be even. Thus the
number of odd degree vertices must be even. �

2.2.1 Maximum and Minimum Degree

The maximum degree of a graph G, denoted by Δ(G), is the maximum


value among the degrees of all the vertices of G, i.e. Δ(G) = max deg(v).
v∈V (G)
Similarly, we define the minimum degree of a graph G and denote it by
δ(G), i.e. δ(G) = min deg(v). The maximum and minimum degree of
v∈V (G)
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 17

the graph in Fig. 2.1 are 5 and 1, respectively.


Let G be a graph with n vertices and m edges. Then by the degree-sum
2m 2m
formula, the average degree of a vertex in G is n and hence δ(G) ≤ n ≤
Δ(G).

2.2.2 Regular Graphs

If all the vertices of a graph G has equal degree, then we call G a regular
graph. We call it a k-regular graph if the common degree is k. Fig. 2.4
represents some regular graph.

(a) (b) (c) (d)

Fig. 2.4 (a) A 2-regular Graph, a simple cyle, (b) A 3-regular Graph, Petersen graph,
(c) A 4-regular Graph, 4-dimensional hypercube, and (d) A 5-regular Graph, a doughnut
graph.

Only the graphs with empty edge sets are 0-regular. These are called
null graphs. Similarly, a 1-regular graph consists of a set of edges such that
no two edges are incident to a common vertex. There is also only one type
of 2-regular graphs. A graph of this type consists of a list of vertices such
that each consecutive vertices are adjacent with each other and the first
vertex is also adjacent with the last vertex, as illustrated in Fig. 2.4(a).
Such a graph is called a cycle or a simple cycle.
A 3-regular graph is also called a cubic graph. The graph in Fig. 2.4(b)
is a cubic graph. This particular graph is also known as the ”Petersen
graph”. This graph has 10 vertices and 15 edges. Petersen graph shows
some interesting properties and also serves as a minimum-sized example
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

18 Basic Graph Theory

and counter-example for many problems in graph theory. We shall study


some properties of Petersen graph in Chapter 8.6. In Chapter 8.6, we shall
also study a subclass of 5-regular graphs, called the “p-doughnut graphs”
or simply “doughnut graphs”. A p-doughnut graph has exactly 4p vertices.
Figure 2.4(d) illustrates a p-doughnut graph for p = 4. Another important
example of a regular graph is a “d-dimensional hypercube” or simply “
hypercube”. A d-dimensional hypercube has 2d vertices and each of its
vertices has degree d. Figure 2.4(c) illustrates a d-dimensional hypercube
for d = 4.
The degree-sum formula implies the following two corollaries for regular
graphs.

Corollary 2.2.3 Every regular graph with an odd degree has an even
number of vertices.

Corollary 2.2.4 A k-regular graph with n vertices has nk/2 edges.

2.3 Subgraphs

A subgraph of a graph G = (V, E) is a graph G′ = (V ′ , E ′ ) such that V ′ ⊆ V


and E ′ ⊆ E. For instance, the graphs in Fig. 2.5(b)–(e) are subgraphs of
the graph in Fig. 2.5(a).
We can obtain subgraphs of a graph G by deleting some vertices and
edges of G. Let e be an edge of G. We denote by G − e the graph obtained
by deleting the edge e from G. More generally, if F is a set of edges of G,
we denote by G − F the graph obtained by deleting all the edges in F from
G. Figure 2.5(a) illustrates a graph G and Fig. 2.5(b) illustrates the graph
G − e6 obtained by deleting the edge e6 from G.
Similarly, we can define the deletion of a vertex from a graph. However,
deleting a vertex v from a graph G also requires that we also delete the
edges incident to v in G. Let v be a vertex of a graph G. We denote by
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 19

v5 v5
v6 e10 v6 e10
e11 e9 e11 e9
e7 e7
e8 v7 e8 v7
e6 e5 e5
v3 e3 e4 v3 e3 e4
e2 v4 e2 v4

v1 e1 v1 e1
v2 v2

(a) (b)
v5 v6
v6 e10 e9
e11 v5
e7 v7
e8 v6
e8 e5 e11 e9
e6 e7
e4 v7
v3 e3 v4 e6
v4 e2 e5
e2 v3
v1 e1 v4
v1 e1 v2
v2

(c) (d) (e)

Fig. 2.5 (a) A Graph G, (b)–(e) subgraphs of G.

G − v the graph obtained by deleting the vertex v and all its incident edges
from G. More generally, if W is a set of vertices of G, we denote by G − W
the graph obtained by deleting the vertices in W ( and all the incident edges
) from G. Figure 2.5(a) illustrates a graph G and Fig. 2.5(c) illustrates the
graph G − v7 obtained by deleting the vertex v7 from G.
Let G = (V, E) be a graph and let W be a set of vertices of G. A
subgraph G′ = (V ′ , E ′ ) of G is called a subgraph of G induced by W if
V ′ = W and E ′ consists of all those edges e of G such that both the end-
vertices of e are in W . The graph in Fig. 2.5(d) is a subgraph of the graph
of Fig 2.5(a) induced by the set of vertices {v1 , v2 , v4 , v6 , v7 }.
Let G = (V, E) be a graph and let F be a set of edges of G. A subgraph
G′ = (V ′ , E ′ ) of G is called a subgraph of G induced by F if E ′ = F and
V ′ consists of all those vertices v of G such that v is an end-vertex of some
edge in F . The graph in Fig. 2.5(e) is a subgraph of the graph of Fig 2.5(a)
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

20 Basic Graph Theory

induced by the set of edges {e5 , e6 , e7 , e9 , e11 }.

2.4 Some Important Classes of Graphs

In this section we see some special classes of graphs, which will often appear
in our discussion in subsequent chapters.

2.4.1 Null Graphs

A graph with an empty edge set is called a null graph. A null graph with n
vertices is denoted by Nn . Figure 2.6(a) illustrates the null graph N6 with
six vertices. A null graph is a subgraph of any graph with the same number
of vertices.

(a) (b)

Fig. 2.6 (a) A null graph N6 with six vertices, (b) a complete graph K6 with six vertices.

2.4.2 Complete Graphs

A graph in which each pair of distinct vertices are adjacent is called a


complete graph. A complete graph with n vertices is denoted by Kn . It is
trivial to see that Kn contains n(n − 1)/2 edges. Figure 2.6(b) illustrates
a complete graph K6 with six vertices. Any graph is a subgraph of the
complete graph with the same number of vertices and thus the number of
edges in a graph with n vertices is at most n(n − 1)/2.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 21

2.4.3 Independent Set and Bipartite Graphs

Let G = (V, E) be a graph. A subset of vertices V ′ ⊆ V is called an


independent set in G if for every pair of vertices u, v ∈ V ′ , there is no edge
in G joining the two vertices u and v.
A graph G is called a bipartite graph if the vertex set V of G can be
partitioned into two disjoint non-empty sets V1 and V2 , both of which are
independent. The two sets V1 and V2 are often called the partite sets of
G. Each edge of a bipartite graph G thus joins exactly one vertex of V1
to exactly one vertex of V2 . Figure 2.7 shows two bipartite graphs where
the independent partitions are highlighted in both the graphs. Given a
graph G, one can test whether G is a bipartite graph in a naive approach
by considering each possible bipartition of the vertices of G and checking
whether the two partitions are independent or not. However since there are
2n − 2 possible bipartition of a graph with n vertices, this approach takes
exponential time. In Chapter 2.7.3, we show a linear-time algorithm to test
whether a graph is bipartite or not.

(a) (b)

Fig. 2.7 Two bipartite graphs: the two independent partite sets are highlighted for each
of them, one containing black colored vertices and the other containing white colored
vertices.

Let G be a bipartite graph with the two independent sets V1 and V2 . We


call G a complete bipartite graph if for each vertex u ∈ V1 and each vertex
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

22 Basic Graph Theory

v ∈ V2 , there is an edge (u, v) in G. Figure 2.7(b) illustrates a complete


bipartite graphs where the two partite sets contains 3 and 4 vertices, re-
spectively. This graph is denoted by K3,4 . In general, a complete bipartite
graph is denoted by Km,n if its two partite sets contains m and n vertices,
respectively. One can easily see that Km,n contains m × n edges.

2.4.4 Path Graphs

A path graph is a graph G that contains a list of vertices v1 , v2 , . . ., vp of


G such that for 1 ≤ i ≤ p − 1, there is an edge (vi , vi+1 ) in G and these are
the only edges in G. The two vertices v1 and vp are called the end-vertices
of G. Figure 2.8(a) illustrates a path graph with six vertices. A path graph
with n vertices is denoted by Pn . Note that the degree of each vertex of
a path graph is two except for the two end-vertices, both of which have
degree one.

P6 C6 W7

(a) (b) (c)

Fig. 2.8 (a) P6 , (b) C6 , and (c) W7 .

2.4.5 Cycle Graphs

A Cycle graph is one that is obtained by joining the two end-vertices of a


path graph. Thus the degree of each vertex of a cycle graph is two. Figure
2.8(b) illustrates a cycle graph with six vertices. A cycle graph with n
vertices is often denoted by Cn .
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 23

2.4.6 Wheel Graphs

A wheel graph with n vertices, denoted by Wn , is obtained from a cycle


graph Cn−1 with n − 1 vertices by adding a new vertex w and joining an
edge from w to each vertex of Cn−1 . Figure 2.8(c) illustrates a wheel graph
with seven vertices.

2.5 Operations on Graphs

We are already familiar with two operations on graphs, namely deletion of


vertices and deletion of edges. In this section, we see some other operations
on graphs. Since a graph G = (V, E) is defined as a tuple of two sets;
the vertex set and the edge set, some operations on sets can naturally be
extended to graphs. We first show some examples of such set operations
on graphs. Later in this section, we also define some other operations on
graphs.

2.5.1 Union and Intersection of Graphs

Let G1 = (V1 , E1 ) and G2 = (V2 , E2 ) be two graphs. The union of G1 and


G2 , denoted by G1 ∪ G2 is another graph G3 = (V3 , E3 ), whose vertex set
V3 = V1 ∪ V2 and edge set E3 = E1 ∪ E2 .
Similarly the intersection of G1 and G2 , denoted by G1 ∩ G2 is another
graph G4 = (V4 , E4 ), whose vertex set V4 = V1 ∩ V2 and edge set E4 =
E1 ∩ E2 .
Figure 2.9(a) and (b) shows two graphs G1 and G2 , and Fig. 2.9(c) and
(d) illustrate their union and intersection, respectively.
Clearly, we can define the union and intersection of more than two
graphs in a similar way. These operations on graphs can be used to solve
many problems very easily. We now present such an application of these
operations on two graphs.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

24 Basic Graph Theory

d d d g d
g b b

c c e c e c e
e

h h f
a f a f
f

(a) (b) (c) (d)

Fig. 2.9 (a) G1 (b) G2 , (c) G1 ∪ G2 , and (d) G1 ∩ G2 .

Suppose there are h + g people in a party; h of them are hosts and g


of them are guests. Each person shakes hands with each other except that
no host shakes hands with any other host. The problem is to find the total
number of hand-shakes. As usual, we transform the scenerio into a graph
problemas follows. We form a graph with h + g vertices; h of them are
black vertices, representing the hosts and the other g vertices are white,
representing the guests. The edges of the graph represent the hand-shakes.
Thus there is an edge between every pair of vertices except for that there
is no edge between any pair of black vertices. Thus the problem now is
to count the number of edges in the graph thus formed. The graph is
illustrated for h = 3 and g = 4 in Fig. 2.10(a).

K4

K3,4

(a) (b)

Fig. 2.10 (a) The graph representing hand-shakes, (b) K 4 and K3,4 .

To solve the problem, we note that the graph can be thought of as a


union of two graphs: a complete graph Kg and a complete bipartite graph
Kh,g as illustrated in Fig. 2.10(b). Since there is no common edge between
the two graphs, their intersection contains no edges. Thus the total number
of edges in the graph (i.e. the total number of hand-shakes in the party) is
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 25

n(n − 1)/2 + m × n.

2.5.2 Complement of a Graph

The complement of a graph G = (V, E) is another graph G = (V, E) with


the same vertex set such that for any pair of distinct vertices u, v ∈ V ,
(u, v) ∈ E if and only if (u, v) ∈
/ E. We often denote the complement of a
graph G by G. Figure 2.11(b) illustrates the complement of the graph in
Fig. 2.11(a). A null graph is the complement of the complete graph with
the same number of vertices and vice versa.

d d

e c e c

a b a b
(a) (b)

Fig. 2.11 (a) A graph G1 , and (b) The complement G of G.

Lemma 2.5.1 For any graph of six vertices, G or G contains a triangle.

Proof. Let G be a graph of six vertices, and let v be a vertex of G. Since


the total number of neighbors of v in G and G is five, v has at least three
neighbors either in G or in G by pigeonhole principle. Without loss of
generality we can assume that v has three neighbors x, y and z in G. If any
two of x, y, and z are adjacent to each other, then G contains a triange. If
no two of x, y, and z are adjacent,then x, y, and z will form a triangle in
G. �

May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

26 Basic Graph Theory

2.5.3 Subdivisions

Subdividing an edge (u, v) of a graph G is the operation of deleting the


edge (u, v) and adding the path u, w, v through a new vertex w of degree
two. A graph G′ is said to a subdivision of a graph G if G′ can be obtained
from G by successively subdividing some of the edges of G. Figure 2.12(b)
illustrates a subdivision of the graph in Fig. 2.12(a).

(a) (b)

Fig. 2.12 (a) A graph G, and (b) a subdivision G′ of G.

2.5.4 Contraction of an Edge

The contraction of an edge (u, v) of a graph G is the operation of deleting


the edge (u, v) and identifying the two vertices u and v. Thus to contract
the edge (u, v), we delete the two vertices u, v and add a new vertex w
where all the edges incident to u and v in G other than the edge (u, v) are
made incident to w. Figure 2.13(a) illustrates a graph G and Fig. 2.13(b)
shows the new graph obtained by contracting the edge e in G. We denote
by G\e the graph obtained from G by contracting an edge e.
After contracting an edge (u, v) of a graph, the new graph may contain
multi-edges. For example, the graph in Fig. 2.13(b) contains some multi-
edges. When we require only a simple graph for our consideration, then we
often take a simple graph by replacing each set of multi-edges by a single
edge from the multigraph. For example Fig. 2.13(c) illustrates a simple
graph obtained by contracting the edge e of the graph in Fig. 2.13(a).
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 27

(a) (b) (c)

Fig. 2.13 (a) A graph G, (b) the graph obtained by contrating the edge e in G, and (c)
the simple graph obtained by contracting the edge e in G.

2.5.5 Graph Isomorphism

An isomorphism between two graphs G1 = (v1 , E1 ) and G2 = (V2 , E2 ) is


a one-to-one correspondence between the vertices in V1 and V2 such that
the number of edges between any two vertices in V1 is equal to the number
of edges between the corresponding vertices in V2 . Thus an isomorphism
between two simple graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) is defined to
be a bijection f : V1 −→ V2 such that for any two vertices u and v of G1 ,
(u, v) ∈ E1 if and only if (f (u), f (v)) ∈ E2 . If there is an isomorphism
between two graphs G1 and G2 , then we say that G1 is isomorphic to G2
and write G1 ∼
= G2 .
Figure 2.14(a) shows two graphs G1 and G2 that are isomorphic to
each other. This isomorphism can be noticed by mapping the vertices a,
b, c, d and e of G1 to the vertices u, w, y, v and x of G2 , respectively.
Similarly, the two graphs illustrated in Fig. 2.14(b) are also isomorphic.
This isomorphic class of graphs is known as Petersen Graph. We will study
some properties of this graph in Chapter 8.6. Observe the two graphs in
Fig. 2.14(a). If we map the vertices a, b, c, d and e of G1 to the vertices u,
w, y, v and x of G2 , repectively, then the two graphs become complement
to each other. A graph which is isomorphic to its complement is called
a self-complimentary. The graphs in Fig. 2.14 (C5 ) are complimentary.
Similarly, P4 is also complimentary.
In order to decide whether two graphs G1 and G2 are isomorphic or
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

28 Basic Graph Theory

d x

e c y w

a b u v
(a) (b)

Fig. 2.14 Two pairs of isomorphic graphs.

not, a tirivial approach would take all the possible permutations of the
vertices of G2 to check whether any of these permutations induces an iso-
morphism. Clearly, this approach takes exponential time on the number of
vertices. Unfortunately there is no known polynomial-time algorithm to ex-
amin whther two graphs are isomorphic or not; neither is there any proof of
the fact that there cannot be any such polynomial-time algorithm. Thus it
is an interesting open problem to prove wither the existence or inexistence
of a polynomial-time algorithm to test two graphs to be isomorphic.
We end this section with the following lemma, which shows that iso-
morphism between graphs gives equivalence classes under the isomorphism
relation.

Lemma 2.5.2 The isomorphism relation is an equivalence relation on


the set of graphs.

Proof. The reflexivity property of the isomorphism is trivial since for any
graph G = (V, E), the bijection f : V −→ V that maps every vertex v ∈ V
to itself gives an isomorphism. Again if f : V1 −→ V2 is an isomorphism
from a graph G1 = (V1 , E1 ) to another graph G2 = (V2 , E2 ), then f −1
defines an isomorphism from G2 to G1 , because (u, v) ∈ E1 if and only if
(f (u), f (v)) ∈ E2 implies that (x, y) ∈ E2 if an only if (f −1 (x), f −1 (y)) ∈
E1 . Thus isomorphism relation is also symmetric on the set of graphs. We
now prove the transivity property of isomorphism. Suppose f : V1 −→ V2
and g : V2 −→ V3 defines isomorphisms from G1 to G2 and from G2 to
G3 , where G1 = (V1 , E1 ), G2 = (V2 , E2 ) and G3 = (V3 , E3 ) are three
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 29

graphs. Hence, (u, v) ∈ E1 if and only if (f (u), f (v)) ∈ E2 and (x, y) ∈ E2


if and only if (g(x), g(y)) ∈ E3 . Therefore, (u, v) ∈ E1 if and only if
(g(f (u)), g(f (v))) ∈ E3 . Thus g ◦ f defins an isomorphism from G1 to G3 .

For many problems, we often require only structural properties of a


graph. For such cases, the ‘labels’ of the vertices of the graph are often un-
necessary and and we informally use the term “unlabeled graph” to denote
an isomorphic class of graphs.

2.6 Degree Sequence

The degree sequence of a graph is the list of vertex degrees. The degree
sequence of a graph is usually written in nonincreasing order as d1 ≥ · · · ≥
dn . The set of distinct non-negative integers occuring in a degree sequence
of a graph is called its degree set. For the graph in Figure 2.15(a) the degree
sequence is 5, 4, 3, 3, 3, 2 and the degree set is {2, 3, 4, 5}. Two graphs with
the same degree sequence are said to be degree equivalent. The two graphs
in Figures 2.15(a) and (b) are degree equivalent.

3
3 2
3 3

5 3 4

4
5
2 3
(a) (b)

Fig. 2.15 Illustration for degree sequence.


May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

30 Basic Graph Theory

Every graph has a degree sequence. But is there exists a graph for a
given sequence of nonincreasing nonnegative integers? To answer this ques-
tion, a trivial necessary condition comes from degree sum formula. That is,
the sum of the integers in the sequence must be even. It is interesting that
this trivial necessary condition is also sufficient, as can be seen from the
following construction. Assume that the sum of the integers in the sequence
is even. Since the sum is even, the number of odd values in the sequence is
even. First form an arbitrary pairing of the vertices with odd degrees, and
add an edge between the two vertices of each pair. Then the remaining de-
gree needed to each vertex is even and nonnegative. Construct loops in each
vertex to fulfil these degree requirements of each vertex. The construction
of a graph for the sequence 5, 4, 3, 2, 1, 1 is illustrated in Figure 2.16.

3 1

5
1
Fig. 2.16 Illustration of a construction for the sequence 5, 4, 3, 2, 1, 1.

Allowing loops makes the realization of a degree sequence easy. If we


do not allow loops and muliple edges, some sequences are not realizable
even if their sum is even. For example, it is not possible to realize the
sequence 2, 2, 0 if we do not allow loops and multiple edges. We call a
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 31

degree sequence a graphic sequence if it realizes a simple graph. Thus the


degree sequence 2, 2, 0 is not a graphic sequence. Figure 2.17(a) shows a
simple graph G with the graphic sequence 3, 3, 3, 2, 1 with Δ = 3. We can
construct a simple graph G′ from G by adding a new vertex x and adding
edges x to each of the Δ + 1 vertices of largest degrees in G, as illustrated
in Figure 2.17(b), where the degree sequence of G′ is 4, 4, 4, 4, 3, 1. Now
consider the following scenario. Assume that we have a degree sequence
d = d1 , d2 , · · · dn . We obtain a degree sequence d′ from d by deleting d1
and subtracting 1 from each of d2 , · · · , dd1 +1 . Then clearly d′ is graphic if d
is graphic, since we can construct a simple graph realizing d′ from a simple
graph realizing d by adding a new vertex and d1 edges. The reverse of the
implication above is also hold as Havel and Hakimi showed that d is graphic
if and only if d′ is graphic. Therefore, based on the construction above, we
can easily develop a recursive algorithm to check whether a degree sequence
is graphic or not. Note that d1 = 0 is the only 1-element graphic sequence.
Steps of an recursive algorithm for testing a graphic sequence are illustrated
in figure Figure 2.18.

(a) (b)

Fig. 2.17 (a) A graph G with the degree sequence 3, 3, 3, 2, 1 and (b) a graph G ′ with
the degree sequence 4, 4, 4, 4, 3, 1.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

32 Basic Graph Theory

4,4,4,3,1 3,3,3,2,1 2,2,1,1 1,0,1 1,1,0 0, 0 0

Fig. 2.18 Illustration for testing realizing a graphic sequence.

2.7 Data Structures and Graph Representation

We are already accustomed with one way of representing a graph, i.e. by a


diagram where each vertex is represented by a point or a small circle and
each edge is represented by a straight-line between the end-vertices. This
graphical representation is convenient for the visualization of a graph, yet it
is unsuitable if we want to store a graph in a computer. However, there are
other ways of representing a graph. In this section, we first give a very brief
account of some basic data structures and then we show three methods for
representing a graph in a computer.
A vector or a set of variables is usually stored as a (one-dimensional)
array and a matrix is stored as a two-dimensional array. The main feature
of an array is that the location of an entry can be uniquely determined
by its index in the array and the entry can be accessed in constant time.
A list is a data structure which consists of homogeneous records, linked
together in a linear fashion. Each record contains one or more items of
data and one or more pointers. In a singly linked lists, each record has a
single forwarding pointer indicating the address of the memory cell of the
next record. In a doubly linked list, each record has forward and backward
pointers indicating the address of the memory cell of the next and the
previous records, respectively.
We now present three different representations of graphs.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 33

2.7.1 Adjacency Matrix

Let G be a graph with the vertex set V = {v1 , v2 , . . . , vn } and the edge
set E = {e1 , e2 , . . . , em }. The adjacency matrix A(G) of G is an n × n
matrix A(G) = [aij ] in which aij is the number of edges between the two
vertices vi and vj . Figure 2.19(a) shows a graph and Fig. 2.19(b) illustrates
its adjacency matrix. Note that an adjacency matrix of a graph is always
symmetric.

e10 v1 v2 v3 v4 v5 e1 e2 e3 e4 e5 e6 e7 e8 e9 e10
e9 v1 0 3 0 0 1 v1 1 1 1 1 0 0 0 0 0 0
e1 v5 v4
v2 3 0 2 0 0 v2 0 1 1 1 1 1 0 0 0 0
v1 e2 e8
e3 e7 v3 0 2 0 1 1 v3 0 0 0 0 1 1 1 1 0 0
e6
e4 v4 0 0 1 0 1 v4 0 0 0 0 0 0 1 0 1 0
v2 v3
G e5 v5 1 0 1 1 1 v5 1 0 0 0 0 0 0 1 1 1

A(G) I(G)
(a) (b) (c)

Fig. 2.19 (a) A graph G, (b) adjacency matrix representation of G, and (c) incedence
matrix representation of G.

If G is a simple graph, then each entry of A(G) is either a zero or one


and the main diagonal of the matrix contains only zeros. Fig. 2.20(b)
illustrates the adjacency matrix of the simple graph in Fig. 2.20(a).
An adjacency matrix uses O(n2 ) space to represent a graph of n vertices.
It is not economical when the number of edges in the graph is much less than
the maximum possible n(n − 1)/2. If A(G) is stored as a two-dimensional
array, then checking whether (vi , vj ) ∈ E for a pair of vertices vi and vj
or deleting an edge (vi , vj ) from G requires only constant time. However,
scanning all the neighbors of a vertex v requires n steps even if deg(v) is
much less than n.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

34 Basic Graph Theory

2.7.2 Incidence Matrix

Let G be a graph with the vertex set V = {v1 , v2 , . . . , vn } and the edge
set E = {e1 , e2 , . . . , em }. The incidence matrix I(G) of G is an n × m
matrix M (G) = [mij ] in which mij is 1 if the vertex vi is adjacent to the
edge ej , and 0 otherwise. Figure 2.19(c) illustrates the incidence matrix of
the graph in Fig. 2.19(a). Similarly, Fig. 2.20(c) illustrates the incidence
matrix of the graph in Fig. 2.20(a).

v1 v2 v3 v4 v5 v6
v1 0 1 1 1 1 0
v3 v2 1 0 1 0 1 1
e9 v4 e8
v5 v6 v3 1 1 0 1 0 0
e6 e7
e2 e5 e4 v4 1 0 1 0 1 0
e3
v1 v2 v5 1 1 0 1 0 0
e1
G v6 0 1 0 0 0 0
A(G)
(a) (b)

v1 v2 v3 v4 v5
e1 e2 e3 e4 e5 e6 e7 e8 e9
v1 1 1 0 0 0 1 0 0 1 v2 v1 v3 v5 v6
v2 1 0 1 1 1 0 0 0 0
v3 v1 v2 v4
v3 0 0 0 1 0 0 0 1 1
v4 0 0 0 0 0 1 1 1 0 v4 v1 v3 v5
v5 0 1 1 0 0 0 1 0 0
v5 v1 v2 v4
v6 0 0 0 0 1 0 0 0 0
I(G) v6 v2
(c) (d)

Fig. 2.20 (a) A simple graph G, (b) adjacency matrix representation of G, (c) incedence
matrix representation of G, and (d) adjacency list representation G.

The space requirement for the incidence matrix is n × m. For a graph


which contains much more number of edges compared to n, this requirement
is much higher than the adjacency matrix. Scanning all the neighbors of the
graph also takes n steps even if deg(v) is much less than n. However, this
representation is helpful for the query to know whether a vertex is incident
to an edge or not and this query can be responsed in constant time from
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

Graph Terminologies 35

this representation.
If a graph G is a simple graph, then there is another representation of
G, called the adjacency lists.

2.7.3 Adjacency List

Let G be a graph with the vertex set V = {v1 , v2 , . . . , vn } and the edge
set E = {e1 , e2 , . . . , em }. The adjacency lists Adj(G) of G is an array of
n lists, where for each vertex v of G, there is a list corresponding to v,
which contains a record for each neighbor of v. Fig. 2.20(d) illustrates the
adjacency lists of the graph in Fig. 2.20(a).

The space requirement for the adjacency lists is (1+deg(v)) = O(n+
v∈V
m). Thus this representation is much more economical than the adjacency
matrix and the incidence matrix, particularly if the number of edge in the
graph is much less than n(n−1)/2. Scanning the neighbors of a vertex takes
O(deg(v)) steps only but checking whether (vi , vj ) ∈ E requires O(deg(v))
steps for a pair of vertices vi and vj of G.

Exercise

1. Show that every regular graph with an odd degree has an even number
of vertices.
2. Construct the complement of K3,3 , W5 and C5 .
3. Can you constract a disconnected graph G of two or more vertices such
that G is also disconnected. Give a proof supporting your answer.
4. Give two examples of self-complementary graphs.
5. What is the necessary and sufficient condition for Km.n to be a regular
graph?
6. Is there a simple graph of n vertices such that the vertices all have
distinct degrees.
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook

36 Basic Graph Theory

7. Draw the graph G = (V, E) with vertex set V = {a, b, c, d, e, f, g, h}


and edge
set {(a, b), (a, e), (b, c), (b, d), (c, d), (c, g), (d, e)(e, f ), (f, g), (f, h), (g, h)}.
Draw G − (d, e). Draw the subgraph of G induced by {c, d, e, f }. Con-
tract the edge (d, e) from G.
8. Show that two graphs are isomorphic if and only if their complements
are isomprphic.

You might also like