Basic Graph Terminologies: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook
Basic Graph Terminologies: May 30, 2014 21:27 WSPC/Book Trim Size For 9in X 6in Bgtbook
Chapter 2
13
May 30, 2014 21:27 WSPC/Book Trim Size for 9in x 6in bgtbook
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.
e5
e10
e1 v5 v4
v1 e2 e8
e3 e9
e6
e4
v2 v3
e7
Graph Terminologies 15
a 4 b
a
4 3 2
6
f f
b
e
e 5
5
6
c
5
d c
d
(a) (b)
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
of each vertex of a graph counts each edge of the graph exactly twice.
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. �
Graph Terminologies 17
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.
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
Corollary 2.2.3 Every regular graph with an odd degree has an even
number of vertices.
2.3 Subgraphs
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
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
In this section we see some special classes of graphs, which will often appear
in our discussion in subsequent chapters.
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.
Graph Terminologies 21
(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.
P6 C6 W7
Graph Terminologies 23
d d d g d
g b b
c c e c e c e
e
h h f
a f a f
f
K4
K3,4
(a) (b)
Fig. 2.10 (a) The graph representing hand-shakes, (b) K 4 and K3,4 .
Graph Terminologies 25
n(n − 1)/2 + m × n.
d d
e c e c
a b a b
(a) (b)
2.5.3 Subdivisions
(a) (b)
Graph Terminologies 27
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.
d x
e c y w
a b u v
(a) (b)
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.
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
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)
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.
Graph Terminologies 31
(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
Graph Terminologies 33
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.
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.
Graph Terminologies 35
this representation.
If a graph G is a simple graph, then there is another representation of
G, called the adjacency lists.
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