Basic Graph Theory PDF
Basic Graph Theory PDF
Note: The purpose of this handout is to help students in their studies in Graph Theory.
Students are advised to consult books for better treatment of the subject.
The Konigsberg Bridge Problem. The city of Konigsberg was located on the Pregel river
in Prussia. The city occupied two islands plus areas on both banks. These regions were linked
by seven bridges. The citizens wondered whether they could leave home, cross every bridge
exactly once, and return home. The problem reduces to traversing the figure below, with heavy
dots representing land masses and curves representing bridges.
Definition. A graph G is a pair (V, E), where V is a non-empty finite set, and E is a set of un-
ordered pairs of elements of V. The elements of V are called the vertices of G, and the elements
of E are the edges of G. We always assume that V ∩ E = φ .
The set of vertices of a graph G may be written V (G); the number |V (G)| of vertices is
the order of G, denoted by n(G) or just n. The set of edges may be written E(G); the number
|E(G)| of edges is the size of G, denoted by m(G) or just m. The edge joining the vertices u
and v is denoted by {u, v} or just uv.
Definition. A vertex v is said to be incident with an edge e if v is one of the vertices of the edge
e.
Definition. Vertices u and v of a graph G are adjacent if uv ∈ E(G). Two distinct edges e and
f are said to be adjacent if there is a vertex incident with both of them. Vertices u and v are
∗ manojksingh88@gmail.com
1
said to be independent if there is no edge between them.
Definition. A graph is said to be finite if its vertex set and edge set are finite otherwise infinite.
Definition. The null graph is the graph whose edge set is empty.
Definition. A loop is an edge whose end vertices are same. Multiple edges (parallel edges)
are edges having the same pair of endpoints. A simple graph is a graph having no loops or
multiple edges.
Figure 2: Loop
Definition. The degree of a vertex v of a graph G is the number of vertices incident with v. It
is denoted by degG v or just deg(v). The minimal degree of the vertices of a graph G is denoted
by δ (G) and the maximal degree by ∆(G).
Definition. A vertex having no incident edge is called an isolated vertex. It can also be defined
as a vertex of degree 0.
Q. (T/F) Max. degree of any vertex in a simple graph with n vertices in (n − 1). (Justify)
Theorem 1. Sum of the degrees of all the vertices in G is twice the number of edges in G.
Proof: Since each edge has two vertices so each edge contribute 2 to the sum of degree of
each vertices. Hence,
Definition. A vertex is called even or odd according as its degree is even or odd.
2
Proof: Let A and B be sets consisting of vertices of even degree and odd degree. By (1),
we have
Definition. A simple graph in which there exists an edge between every pair of vertices is called
a complete graph. The complete graph on n vertices will be denoted by Kn .
Figure 3: K4 and K5
Definition. A graph G is said to be bi-partite if there is a partition of V (G) into two sets V1 and
V2 , called partite sets, such that every edge has one vertex in V1 and another in V2 . In simple
words each edge in G has one end in V1 and another in V2 . A bi-partite graph with partition
(V1 ,V2 ) is called complete bi-partite graph if each vertex in V1 is joint to every vertex in V2
by just one edge. The complete bipartite graph with r vertices in one partite set and s in the
other is denoted by Kr,s .
Q1. Show that the maximum number of edges in a complete bipartite graph of n vertices is
n2
.
4
Q2. Prove that a graph is bipartite if and only if all its cycles are of even length.
3
Definition. Isomorphic Graphs: Let G1 and G2 be graphs. An isomorphism from G1 to G2
is a bijection f : V (G1 ) → V (G2 ) such that uv ∈ E(G1 ) iff f (uv) ∈ E(G2 ). In other words, we
say that two graphs are isomorphic if there is a correspondence between their vertex sets that
preserve adjacency.
Note: If G is a graph then deleting all loops and all the parallel edges except one between
a pair of vertices then we obtain a simple spanning subgraph of G called underlying simple
graph of G.
Union and Intersection of Graphs: Let G = (V1 , E1 ) and G0 = (V2 , E2 ) be two graphs
then their union and intersection are defined as G ∪ G0 = (V1 ∪V2 , E1 ∪ E2 ) and G ∩ G0 =
(V1 ∩V2 , E1 ∩ E2 ).
Definition. Edge-Disjoint Subgraphs: Two (or more) subgraphs G1 and G2 of a graph G are
said to be edge disjoint if G1 and G2 do not have any edges in common.
Definition. Decomposition: A graph G is said to have been decomposed into two subgraphs
G1 and G2 if G1 ∪ G2 = G and G1 ∩ G2 = a null graph.
4
Definition. A subgraph of a graph G is a graph H with V (H) ⊆ V (G) and E(H) ⊆ E(G). We
write H ⊆ G. If U is any proper subset of V (G), G −U is the subgraph obtained by deleting all
vertices of U and all edges with at least one vertex in U.
Definition. A walk is defined as a finite alternating sequence of vertices and edges, beginning
and ending with vertices, such that each edge is incident with the vertices preceding and fol-
lowing it and does not appear more than once. A walk is closed if its first and last vertices are
same, and open if they are different.The length of walk is defined to be number of edges in
walk.
Definition. A walk is said to be a trail if no edge is repeated in the walk. An open walk in
which no vertex appears more than once is called a path.
Definition. A closed walk in which no vertex (except the initial and the final vertex) appears
more than once is called a Cycle (circuit). Length of a path and cycle is defined as the number
of edges it contains.
5
It is sufficient to prove the converse for connected graphs. Let G be a connected
graph that contains no odd cycles. We choose an arbitrary vertex u and define a partition (X,Y )
of V by setting
We shall show that (X,Y ) is a bipartition of V (G). Also we need to show that G is bipartite
graph we have to show that no two vertices of X (similarly of Y ) are not adjacent.
Suppose that v and w are two vertices of X. Let P be the shortest uv path and
Q be the shortest uw path. Denote by u1 the last vertex common to P and Q. Since P and Q are
shortest path, the uu1 sections of P and Q are shortest uu1 paths and, therefore, have the same
length. Now, since the lengths of both P and Q are even, the lengths of the u1 v section (say P1
of P) and u1 w section (say Q1 of Q) are of same parity of length. Hence,the vw path P1−1 Q1
is of even length. If v were joined to w, P1−1 Q1 wv would be a cycle of odd length, contrary to
the hypothesis. Therefore no two vertices in X are adjacent; similarly, no two vertices in Y are
adjacent.
Definition. A graph G is said to be connected if there is at least one path between every pair of
vertices in G. In other words a graph is said to be connected if there exists a uv path whenever
u, v ∈ V (G). A graph is said to be disconnected if it is not connected.
Definition. Component of a graph: We define a relation R in V (G) such that uRv iff there
exists a uv path in G. Clearly, the relation R is an equivalence relation, and equivalence classes
are called components of a graph. Each component is connected, and every connected subgraph
of G is contained in a component. The number of components is denoted by k(G). Thus
k(G) = 1 iff G is connected.
Component of a graph can also be defined as maximal connected subgraph of G.
Theorem 4. A graph G is disconnected iff its vertex set V can be partitioned into two non-
empty, disjoint subsets V1 and V2 such that there exists no edge in G whose one end vertex is in
subset V1 and the other in subset V2 .
Proof: Suppose that such a partitioning exists. Consider two arbitrary vertices a and b of
G, such that a ∈ V1 and b ∈ V2 . No path can exist between vertices a and b; otherwise there
would be at least one edge whose one end vertex would be in V1 and the other in V2 : Hence, if
a partition exists, G is not connected.
6
Theorem 5. If a graph (connected or disconnected) has exactly two vertices of odd degree,
there must be a path joining these two vertices.
Proof: Let G be a graph with all even vertices except vertices v1 and v2 , which are odd. By
theorem 2, no graph can have an odd number of odd vertices. Therefore, in graph G, v1 and v2
must belong to the same component, and hence there must be a path between them.
So, P(u, v) = (u =)u0 e1 u1 e2 ........u j−1 e j u j (= a)e j+1 u j+1 .......ek−1 uk−1 ek uk (= a)ek+1 uk+1 ........un (=
v)
Figure 9: P(u, v)
But then the sequence (u =)u0 e1 u1 e2 ........u j−1 e j u j ek+1 uk+1 ........un (= v) obtained by delet-
ing the subwalk e j+1 u j+1 .......ek−1 uk−1 ek is a walk connecting u and v of length smaller than
P(u, v) but this a contradiction as we have assumed that P(u, v) has minimum length. Hence
P(u, v) is a path.
Notation:
• δ (G) = min. degree of the graph = min. {d(vi ); vi ∈ V (G)}
7
Figure 10: Path P
If not, then there exist uk such that uk ∈ {u1 , u2 , ....., ut }\{v3 , v4 , ....., vn }, then
the path uk v1 e1 v2 .....vn has length greater than the length of the path P, which is a contradiction.
Let j be the greatest integer such that v j = ui for some i, clearly the minimum value of
j is t + 2. Also, v1 e1 v2 ......v j e j v1 is a cycle of length atleast t + 2, which is d(v1 ) + 1 ≥ δ + 1.
So, it has a cycle of length at least δ + 1.
Proof: By induction on p (number of vertices) Clearly the result holds for p = 1, 2, 3 and
q ≥ p.
Now, we assume that every graph on (p − 1) vertices with q ≥ p − 1 contains a cycle.
Proof by induction
Clearly the result holds for p ≤ 3. Let us assume that every connected graph con-
taining a cycle on (p − 1) vertices has atleast (p − 1) edges.
If δ (G) ≥ 2, then
1 1
q(G) = ∑ d(v) ≥ ∑ 2 = p(G) =⇒ q(G) ≥ p(G).
2 v∈V 2 v∈V
8
Now, let δ (G) = 1 and let v be a vertex of degree 1. Now, G − v is a graph on p − 1 vertices.
Clearly, v can’t be a vertex in a cycle C as d(v) = 1. So, G − v contains cycle C and hence by
induction hypothesis, we have q(G − v) ≥ p(G − v). Also, q(G) = q(G − v) + 1. Hence,
q(G − v) + 1 ≥ p(G − v) + 1
=⇒ q(G) ≥ p(G).
Theorem 10. If q ≥ (p − 1) then every (p, q) graph is either connected or contains a cycle.
Proof: Proof by contradiction
Let us assume that the result holds good for a graph having
vertices less than p. Let G be a graph on p vertices. If δ (G) ≥ 2, then
1 1
q(G) = ∑ d(v) ≥ ∑ 2 = p(G)
2 v∈V 2 v∈V
=⇒ q(G) ≥ p(G)
=⇒ q(G) ≥ p(G) − ω(G)
If δ (G) < 2, then we have two possibilities.
1. G has a vertex of degree 0.
2. G has a vertex of degree 1.
Let G has a vertex v of degree 0, then we consider the graph H = G − v, then
p(H) = p(G) − 1, q(H) = q(G) and ω(H) = ω(G) − 1.
So, by induction hypothesis,
q(H) ≥ p(H) − ω(H)
=⇒ q(G) ≥ p(G) − 1 − (ω(G) − 1)
≥ p(G) − ω(G).
9
Next, let G has a vertex v of degree 1. Again, we consider the graph H = G − v, hence
Proof: Let G be a simple graph with n vertices and k components. Let n1 , n2 , n3 , ......, nk be
the number of vertices in each of the k components of G. Then we have
n1 + n2 + ..... + nk = n ; ni ≥ 1 ∀ i
Since the maximum number of edges in a simple graph with n vertices is n(n−1)
2 , therefore
th 1
maximum number of edges in the i component of G is 2 ni (ni − 1), thus the maximum number
of edges in G is
" #
k
ni (ni − 1) 1 k 2 k
∑ 2 = 2 ∑ ni − ∑ ni (2)
i=1 i=1 i=1
Now, using the inequality ∑ki=1 n2i ≤ n2 − (k − 1)(2n − k), above equation can be written as
k
ni (ni − 1) 1 2
∑ ≤ n − (k − 1)(2n − k) − n
i=1 2 2
1
= (n − k) (n − k + 1).
2
10
Definition. TREE: A connected graph without any cycle is called tree.
Theorem 13. A graph G is a tree iff there is one and only one path between any two vertices
of G. (This can be stated as ”A graph G is a tree iff every two vertices of G are connected by a
unique path”)
Proof: Let G be a tree. Let there are two distinct uv paths P1 and P2 in G. Since P1 6= p2 ,
there is an edge e = xy of P1 which is not an edge of P2 . Clearly the graph P1 ∪ P2 − e is con-
nected and so it contains an xy path P but then P + e is a cycle in G, a contradiction to the fact
that G is a tree.
Conversely, let us assume that every two vertices are connected by a unique path.
Clearly, G is connected. Now If G contains a cycle (u =)u0 u1 u2 .......uk (= v)uk+1 uk+2 ......un (=
u0 = u), then the paths u0 u1 u2 .......uk and un un−1 .........uk are two distinct uv paths, contrary to
our assumption. So, G is a connected graph without any cycle and hence a tree.
Clearly the theorem is true for trees with one and two vertices. Assume that the
theorem is true for all trees with fewer than n vertices.
number of edges in G1 = n1 − 1
number of edges in G2 = n2 − 1
11
Theorem 15. Every connected graph with n vertices and n − 1 edges is a tree.
Proof: Let G be a connected graph with n vertices and n − 1 edges. We need to prove that
G does not contain any cycle.
Suppose that G contains at least one cycle. Since removing an edge from a cy-
cle does not disconnect the graph, we may remove edges from cycle but no vertices until the
resulting graph G∗ is cycle free.
Proof: Let G be a graph with n vertices, n − 1 edges and has no cycles. To show that G is a
tree, it is sufficient to prove that G is connected.
Thus G ∪ e does not contain any cycle and is a connected graph and therefore
we obtain a tree having n vertices and n edges, which is not possible. Hence the theorem.
Proof: Suppose that G is a tree, so it connected. If G is not minimally connected then there
exist an edge e in G such that G − e is connected. Therefore e is in some cycle. So, G has a
cycle, hence G is not a tree which is a contradiction. Hence G has to be minimally connected.
If G has a cycle, then by removing an edge of the cycle does not disconnect G, so G
is not a minimally connected which is a contradiction. Hence G is a tree.
12
Definition. Let G be a connected graph and vi and v j be any two vertices in G. The distance
between the vertices vi and v j denoted by d(vi , v j ) is defined as the length of smallest path
between vi and v j .
Theorem 18. Every tree has center consisting of either one vertex or two adjacent vertex.
Proof: Clearly the result holds for a graph having one or two vertices. Let T be a tree
having more than two vertices. Clearly, maximum of distance from a given vertex u of T to any
vertex v of T will occur only when v is an end vertex of T.
Thus T and T’ have same center. Let T” be the tree obtained by removing
all end vertices of T’ then with the same argument above, we note that T’ and T” will have
same center which is also center of T. Continuing this process of removing end vertices, we
arrive at a graph having just one vertex or two vertices, which will have the same center as that
of T, thus center of T consists of a single vertex or two adjacent vertices.
Definition. Radius of a tree: The eccentricity of center in a tree is called the radius of the tree.
Definition. Diameter of a tree: The diameter of a tree T is defined as the length of the longest
path in T.
Definition. Spanning Tree: A subgraph T of a connected graph G is said to be spanning tree
of G if the subgraph T is a tree and contains all the vertices of G.
13
Theorem 19. Every connected graph has atleast one spanning tree.
Proof: Let G be a connected graph. If G has no cycles then it is its own spanning tree. If
G has a cycle then delete an edge from each cycle then the graph G remains connected and we
get a connected graph Ḡ having no cycles. hence Ḡ is a tree and hence spanning tree of G.
Definition. Cut Edge: An edge e is said to be a cut edge of G if ω(G − e) > ω(G).
Proof: Let e be a cut edge of G, then ω(G − e) > ω(G). So there exists two vertices u and
v of G which are connected in G but not in G − e, so there exists some uv path P in G which
necessarily transverses e. Suppose x and y are end vertices of e and x precedes y on P. In G − e,
u is connected to x by a section of P and y is connected to v by a section of P.
Theorem 21. A connected graph is a tree iff its every edge is a cut edge.
Definition. Cut Vertex: A vertex v of a graph G is said to be a cut vertex if ω(G − v) > ω(G).
Definition. Binary Tree: A binary tree is defined as a tree in which there is exactly one vertex
of degree two and each of the remaining vertices is of degree one or three.
Note: The number of vertices in a binary tree is always odd as there is exactly one vertex
of even degree and the remaining (n − 1) vertices are of odd degree. Hence n is odd.
Q 1. What is the maximum number of vertices in a graph with 35 edges and all vertices are
of degree at least 3.
Ans: Let n be the number of vertices. Since the graph has 35 edges and each edge contribute
2 to the sum of degrees of all vertices, therefore sum of degrees of all vertices is 2 × 35 = 70.
Also, each vertex is of degree at least 3, therefore 3n ≤ 70 ⇒ n ≤ 23.3. Hence maximum
number of vertices in a graph with 35 edges such that each vertex is of degree at least 3 is 23.
14
Definition. Incidence Matrix: Let G be a graph with n vertices v1 , v2, ......, vn and m edges
e1 , e2 , ......, em and no self loops. We define an n × m matrix A = ai j whose n rows corre-
sponding to n vertices and m columns corresponding to m edges as follows
Ans:
1 0 0 0 0
0 1 1 0 0
0 0 0 1 0
0 0 1 1 1
1 1 0 0 1
0 0 0 0 0
Properties of Incidence Matrix
1. Each column of incidence matrix A of a graph G without self loops has exactly two 10 s
because each edge is incident on exactly two vertices.
2. Given an incidence matrix, we can draw the corresponding graph.
3. Sum of each row gives the degree of the corresponding vertex.
4. If a graph has multiple edges then the corresponding columns in the incidence matrix are
identical.
5. A row with all zero’s represents an isolated vertex.
6. In changing any two rows or columns in an incidence matrix simply corresponds to rela-
beling the vertices and edges of the same graph. Thus two graphs G1 and G2 are isomor-
phic if the incidence matrix of one graph can be obtained from the incidence matrix of
the other by interchanging some of the rows and the columns.
15
7. Rows of A are linearly dependent if graph does not contain any parallel edges.
Definition. Adjacency Matrix: Adjacency Matrix of a graph with n vertices and no multiple
edges (self loops are allowed) is an n × n matrix X = xi j where
2. If graph has no self loops then the diagonal entries of X(G) are zero and vice- versa.
3. If the graph has no self loops then the sum of the ith row is the degree of vi .
4. Two graphs G1 and G2 are isomorphic iff the adjacency matrix of one can be obtained
from the adjacency matrix of the other by interchanging some of the rows and the corre-
sponding columns.
5. Given any square, symmetric matrix X of order n, we can draw a graph G with n vertices
and no multiple edges.
Cycle Matrix: Let G be a graph with q cycles and n edges, then a cycle matrix
Definition.
B = bi j of G is a q × n matrix with bi j ∈ {0, 1}, 1 ≤ i ≤ q, 1 ≤ j ≤ n such that
16
Figure 14: Graph G
3. The number of 10 s in a row is equal to the number of edges in the corresponding cycle.
Definition. Path Matrix: A path matrix P(u, v) = pi j is defined for a given pair of vertices
in a graph say (u, v) is defined as
1. A column of all zeroes corresponds to an edge that does not lie in any path between u
and v.
2. A column of all one’s corresponds to an edge that lies in every path between u and v.
Definition. Euler Line: A closed walk in a graph contains all the edges of the graph is called
an Euler line . A trail that traverses every edge of G is called an Euler trail of G. Hence,
Euler line is closed Euler trail. A graph which contains an Euler line is called an Euler graph
(Eulerian Graph).
Theorem 22. A connected graph G is an Euler graph if and only if all vertices of G are of even
degree.
Proof: Above theorem can be stated as ”A non empty connected graph is Eulerian if and only
if it has no vertices of odd degree.”
Suppose that G is an Euler graph. It therefore contains an Euler line (which is a closed walk).
In tracing this walk we observe that every time the walk meets a vertex v it goes through two
”new” edges incident on v-with one we ”entered” v and with the other ”exited.” This is true not
only of all intermediate vertices of the walk but also of the terminal vertex, because we ”exited”
17
and ”entered” the same vertex at the beginning and end of the walk, respectively. Thus if G is
an Euler graph, the degree of every vertex is even.
To prove the converse, assume that all vertices of G are of even degree. Now we
construct a walk starting at an arbitrary vertex v and going through the edges of G such that no
edge is traced more than once. We continue tracing as far as possible. Since every vertex is of
even degree, we can exit from every vertex we enter; the tracing cannot stop at any vertex but
v. And since v is also of even degree, we shall eventually reach v when the tracing comes to an
end. If this closed walk H we just traced includes all the edges of G, G is an Euler graph. If not,
we remove from G all the edges in H and obtain a subgraph H’ of G formed by the remaining
edges. Since both G and H have all their vertices of even degree, the degrees of the vertices of
H’ are also even. Moreover, H’ must touch H at least at one vertex a, because G is connected.
Starting from a, we can again construct a new walk in graph H’. Since all the vertices of H’ are
of even degree, this walk in H’ must terminate at vertex a; but this walk in H’ can be combined
with H to form a new walk, which starts and ends at vertex v and has more edges than H. This
process can be repeated until we obtain a closed walk that traverses all the edges of G. Thus G
is an Euler graph.
Corollary 1. A connected graph has as Euler trail if and only if it has at most two vertices of
odd degree.
Proof: If G has an Euler trail then, arguments as is given in previous theorem, each vertex
other than the origin and terminus of this trail has even degree.
Conversely, suppose that G is a nontrivial connected graph with at most two vertices of
odd degree. If G has no such vertices of odd degree then by previous theorem G has a closed
trail. Otherwise, G has exactly two vertices, u and v of odd degree. In this case, G + e denote
the graph obtained from G by addition of a new edge e joining u and v. Clearly, each vertex of
G + e is even and hence G + e is an Eulerian Graph and contains a Euler line. Hence it contains
an Euler trail.
Theorem 23. A connected graph G is an Euler graph if and only if it can be decomposed into
disjoint cycles(circuits).
Proof: Above theorem can be stated as ”A connected graph G is an Euler graph if and only
if G is the union of some edge disjoint cycles.
Suppose graph G can be decomposed into circuits; that is, G is a union of
edge-disjoint circuits. Since the degree of every vertex in a circuit is two, the degree of every
vertex in G is even. Hence G is an Euler graph.
Conversely, let G be an Euler graph. Consider a vertex v1 . There are at least two
edges incident at v1 . Let one of these edges be between v1 and v2 . Since vertex v2 is also of even
degree, it must have at least another edge, say between v2 and v3 . Proceeding in this fashion,
we eventually arrive at a vertex that has previously been traversed, thus forming a circuit Γ.
Let us remove Γ from G. All vertices in the remaining graph (not necessarily connected) must
also be of even degree. From the remaining graph remove another circuit in exactly the same
way as we removed Γ from G. Continue this process until no edges are left. Hence the theorem.
Definition. A Hamiltonian cycle in a connected graph is defined as a closed walk that traverses
every vertex of G exactly once, except the starting vertex, at which the walk also terminates.
18
Definition. A path which contains every vertex of a connected graph G exactly once is called
Hamiltonian path. A Hamiltonian cycle in a graph G is a closed walk that traverses every
vertex of G exactly once except the starting vertex. A connected graph G is said to be Hamil-
tonian graph if it contains a Hamiltonian cycle.
Since Hamiltonian cycle (or path) traverses every vertex exactly once. Hence it
cannot include a self-loop or a set of parallel edges. Hence we need to consider simple graphs
only for study of Hamiltonian graphs. e.g. a complete graph with more than two vertices is
Hamiltonian, every cycle graph is Hamiltonian.
Note: Every graph that has a Hamiltonian circuit also has a Hamiltonian path. There are,
however, many graphs with Hamiltonian paths that have no Hamiltonian circuits. In contrast
with the case of Euler graphs, no nontrivial necessary and sufficient condition for a graph to
be Hamiltonian is known; in fact, the problem of finding such a condition is one of the main
unsolved problems of the graph theory.
Q. Draw a graph that has a Hamiltonian path but does not have a Hamiltonian circuit.
Theorem 24. If G is a simple graph with number of vertices n(≥ 3) and if d(v) + d(w) ≥ n for
every pair of non-adjacent vertices v and w, then G is Hamiltonian.
Proof: On contrary, let us assume that there exists a non Hamiltonian graph with n vertices
satisfying the given condition for every pair of non adjacent vertices v and w. Let G be such
a maximal non Hamiltonian graph. Since G is maximal non Hamiltonian, it follows that there
exist two non adjacent vertices v and w is G such that addition of an edge joining v and w will
result in a Hamiltonian graph. Hence, G contains a Hamiltonian path.
Consider the figure below
Claim: S ∩ T = 0/ and |S ∪ T | ≤ n − 1.
For if, vk ∈ S ∩ T , then the edges (v, vk ) and (vk−1 , w) would be in G and then (v =)v1 v2 ...........
....vk−1 vn (= w)vn−1 .......vk v1 would form a Hamiltonian cycle in G, which is a contradiction.
Further S ∪ T ⊂ {v1 , v2 , ........, vn }. But since vertex v1 = v is neither adjacent to v nor adjacent
to w, v1 ∈/ S ∪ T.
Hence, |S ∪ T | ≤ n − 1
19
Now, we have
Corollary 2. If G is a simple graph with number of vertices n(≥ 3) and if d(v)) ≥ n/2 for each
vertex v, then G us Hamiltonian.
Definition. Dual Graph: Given a plane graph G, dual graph of G denoted as G∗ is defined as
follows: corresponding to each face f of G there is a vertex f ∗ of G∗ and corresponding to each
edge e of G there is an edge e∗ in G∗ ; two vertices f ∗ and g∗ are joined by the edge e∗ in G∗ if
and only if their corresponding faces f and g are separated by the edge e in G. The graph G∗ is
called the dual of graph G.
Note: Dual of a planar graph is also planar. Also, if e is a loop of G, then e∗ is a cut edge
of G∗ and vice-versa. Similarly we can consider the dual of dual i.e. G∗∗ of G∗ and when G is
connected , G∗∗ ∼
= G.
The following are the direct consequences of the definition of G∗
20
• no. of edges in G∗ = no. of edges in G
• dG∗ ( f ∗ ) = dG ( f )
Theorem 25. If G is a plane graph, then ∑ d( f ) = 2e; where F is the set of faces of G.
f ∈F
∑ d( f ) = ∑ d( f ∗ )
f ∈F f ∈V (G∗ )
∗
∗
= 2e(G )
= 2e(G)
Note: 2e ≥ 3 f , as each region is bounded by at least three edges and each edge belongs to
3
exactly two regions, hence e ≥ f .
2
Theorem 26. ( Euler’s Formula) A connected planar graph with n vertices and e edges has
e − n + 2 regions.
Proof: Let G be a connected planar graph. Proof by induction on the number of edges of
G.
If e = 1 then n = 1 or 2, then clearly the result holds.
Let us assume that the result holds for all connected planar graphs with at most e − 1 edges.
Let G be a connected graph with e edges and f regions. If G is a tree then e = n − 1
and f = 1 as only one region (infinite region). Hence the formula f = e − n + 2 holds in this
case.
If G is not a tree then it has some cycles. Let a be an edge in some cycle. Removal
of the edge a from the plane representation of G will merge the two regions into one region.
Thus G − a is a connected graph with n vertices, e − 1 edges and f − 1 regions (where f is the
number of regions in G). By induction hypothesis, we have
f − 1 = (e − 1) − n + 2
=⇒ f = e − n + 2.
Corollary 3. In any simple, connected planar graph with f regions, n vertices, and e edges
such that e > 2, the following inequalities must hold:
• e ≤ 3n − 6.
3
Proof: Now substituting f = e − n + 2 in e ≥ f , we obtain e ≤ 3n − 6.
2
Q. Show that the Peterson graph K5 and K3,3 are non planar.
Solution: In the case of K5 , the complete graph of five vertices n = 5, e = 10 but 3n − 6 = 9
hence e 3n − 6. Hence K5 is non planar.
21
In case of K3,3 we have n = 6, e = 9, hence the result e ≤ (3n − 6) holds. To prove
the nonplanarity of K3,3 , we make use of the additional fact that no region in this graph can be
bounded with fewer than four edges. Hence, if this graph were planar, we would have 2e ≥ 4 f .
Using the Euler’s formula f = e − n + 2 = 5 in 2e ≥ 4 f we have 18 ≥ 20, a contradiction.
Hence K3,3 is non planar.
Definition. A graph G that requires k different colors for its proper coloring, and no less, is
called a k-chromatic graph, and the number k is called the chromatic number of G. Chro-
matic number of G is denoted by χ(G).
• Chromatic number of complete graph Kn of n vertices is n, as all its vertices are adjacent.
Q. Define Chromatic number and find the chromatic number of the following graph.
Figure 16:
22
Note that the converse of the above theorem is not necessarily true, as a cycle with even number
of vertices is 2 chromatic.
Theorem 28. A graph with at least one edge is 2-chromatic if and only if it has no cycles of
odd length.
Proof: Let G be a connected graph with cycles of only even lengths. Select any vertex v,
paint v with color 1 and paint all vertices adjacent to v with color 2. If a vertex is painted with
colour 2 then any vertex adjacent to it will be painted with colour 1. Since every cycle has even
length, no two vertices will have the same colour. Hence, G is 2-chromatic.
Conversely, if G has a cycle of odd length, we would need at least three colors
just for that cycle. Hence the theorem.
Theorem 29. If ∆ is the maximum degree of the degree of the vertices in a graph G, then
χ(G) ≤ 1 + ∆.
Proof: Let G be a graph with n vertices. We shall prove the result by induction on the
number of vertices. If G has 1 or 2 vertices then the result is clearly true. We assume that
the result is true for all graphs having less than n vertices. Remove any vertex v and all edges
incident on v . Then G − v is a graph with n − 1 vertices and maximum degree of any vertex in
G − v is at most ∆. Hence by induction hypothesis, χ(G − v) ≤ 1 + ∆.
Now we add the vertex v and all edges incident on v to G − v. Since degree of v is
∆, atmost ∆ colours are needed to colour all vertices adjacent to v. We can assign a different
colour to v from ∆ + 1 colours. Hence χ(G) ≤ 1 + ∆.
Q. Show that every simple planar graph having n vertices (n ≥ 3) has a vertex of degree at
most 5.
solution: Let G be a planar graph. Assume that all vertices of G have degree greater than or
equal to 6. Also, we know that the sum of the degrees of all verticies of a graph is equal to
twice the number of edges. Let v and e denote the number of vertices and number of edges
respectively. Then, we have
6v ≤ 2e
3v ≤ e (3)
e ≤ 3v − 6 (4)
3v ≤ e ≤ 3v − 6 (5)
which is not possible. Hence our assumption must be wrong. Hence every planar graph has a
vertex of degree at most 5.
23
Theorem 30. Five Colour Theorem: The vertices of every planar graph can be properly col-
ored with five colors.
We assume that the result holds for all planar graphs having less than n ver-
tices. Now consider a planar graph with n vertices. Then it must have a vertex v with degree
5 or less. Let G0 = G −v, the graph obtained from G be deleting vertex v. Then by induction
hypothesis, G0 having n − 1 vertices requires no more than five colours. Paint the vertices of
G0 using five colours and now add to it the vertex v along with all edges incident on v. If the
degree of v is less than 4, we can assign a proper colour to v and obtain a proper colouring of
G.
This leaves only a case when d(v) = 5 and all the five colourd have been
used in colouring the vertices a, b, c, d and e adjacent to v as shown in ”figure 16”.
Figure 17:
Suppose that there is a path in G0 = G − v between vertices a and c colored alternately with
colors 1 and 3, Then a similar path between band d, colored alternately with colors 2 and 4,
cannot exist; otherwise, these two paths will intersect and cause G to be nonplanar.
Had we assumed that there was no path between a and c of vertices painted
alternately with colors 1 and 3, we would have released color 1 or 3 instead of color 2. And
thus the theorem.
Definition. Directed Graph: A directed graph (digraph) G consists of a set of vertices V =
{v1 , v2 , ...}, a set of edges E = {e1 , e2 , ...}, and a mapping ψ that maps every edge onto some
ordered pair of vertices vi , v j . A digraph is also referred to as an oriented graph.
24
Figure 18: Directed Graph
In a digraph an edge is not only incident on a vertex, but is also incident out of a vertex and
incident into a vertex. The vertex vi which edge ek is incident out of, is called the initial vertex
of ek . The vertex v j , which ek is incident into, is called the terminal vertex of ek . An edge for
which the initial and terminal vertices are the same forms a self-loop, such as e5 .
The number of edges incident out of a vertex vi is called the out-degree (or
out-valence or outward demidegree) of vi and is written d + (vi ). The number of edges incident
into vi is called the in-degree of vi and is written as d − (vi ).
Note that
n n
∑ d +(vi) = ∑ d −(vi) (6)
i=1 i=1
Definition. An isolated vertex is a vertex in which the in-degree and the out-degree are both
equal to zero. A vertex v in a digraph is called pendant if it is of degree one, that is, if
d + (v) + d − (v) = 1.
Definition. Two directed edges are said to be parallel if they are mapped onto the same ordered
pair of vertices. Edges e8 , e9 and e10 are parallel, whereas edges e2 and e3 are not.
Definition. Simple Digraphs: A digraph that has no self-loop or parallel edges is called a
simple digraph.
Definition. A complete symmetric digraph is a simple digraph in which there is exactly one
edge directed from every vertex to every other vertex , and a complete asymmetric digraph is
an asymmetric digraph in which there is exactly one edge between every pair of vertices.
Note: A complete asymmetric digraph of n vertices contains n(n − 1)/2 edges, but a com-
plete symmetric digraph of n vertices contains n(n − 1) edges.
Definition. A digraph is said to be balanced if for every vertex vi the in-degree equals the out-
degree; that is, d + (v j ) = d − (v j ). (A balanced digraph is also referred to as a pseudosymmetric
digraph, or an isograph.) A balanced digraph is said to be regular if every vertex has the same
in-degree and out-degree as every other vertex.
25
26
Definition. Weighted Graph: A Weighted Graph is a graph in which a non-negative real num-
ber (called weight) is assigned to each edge.
Problem: A postman starts from his post-office in a town to deliver his letters and returns to
his starting point every day. What route should he take so that he visits each road at least once
and the total distance covered is least?
If the weighted graph G so constructed is Euler then any Euler line of G is a tour of mini-
mum weight since it involves each edge of G once and only once. Thus in practice we may use
Fleury’s algorithm to produce such a tour, i.e., a solution to the CPP. If G is not Euler then any
tour in G has to involve some edges more than once.
27
Dijkstra Algorithm for Shortest Path in Weighted Graphs
The problem of finding the shortest path from a specified vertex s to another specified vertex
t, can be stated as follows: A simple weighted digraph G of n vertices is described by an n × n
matrix D = [di j ]’ where di j = length (or distance or weight) of the directed edge from vertex i
to vertex j, di j ≥ 0, dii = 0 and di j = ∞ if there is no edge from vertex i to vertex j. It should
be noted that in general di j 6= d ji .
Dijkstra’s algorithm labels the vertices of the given digraph. At each stage in the algorithm
some vertices have permanent labels and others temporary labels. The algorithm begins by
assigning a permanent label 0 to the starting vertex s, and a temporary label ∞ to the remaining
n − 1 vertices. From then on, in each iteration another vertex gets a permanent label, according
to the following rules:
1. Every vertex j that is not yet permanently labelled gets a new temporary label whose
value is given by
where i is the latest vertex permanently labelled, in the previous iteration, and di j is the
direct distance between vertices i and j. If i and j are not joined by an edge, then di j = ∞.
2. The smallest value among all the temporary labels is found, and this becomes the perma-
nent label of the corresponding vertex. In case of a tie, select anyone of the candidates
for permanent labeling.
3. Steps 1 and 2 are repeated alternately until the destination vertex t gets a permanent label.
28