The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by Ram Krishna Marahatta, 2021-05-22 06:51:33

GRAPH THEORY- I & II NOTES (1)

GRAPH THEORY- I & II NOTES (1)

Example-1: For the diagram of a planar graph shown below, find the
degrees of regions and verify that the sum of these degrees is equal
to twice the number of edges.

Fig: Graph G r1 r4
r2 r3

Sol: The above graph has 9 edges and 4 regions.

The region r1 is bounded by 3 edges, hence deg(r1)=3

The region r2 is bounded by 5 edges, hence deg(r2)=5

The region r3 is bounded by 3 edges, hence deg(r3)=3

The infinite region r4 is bounded by 5 edges and a pendant
edge. hence deg(r4)=7(while determining the degree of a region, a
pendant edge is counted twice)

We know that, sum of the degrees of all the vertices of a
graph is equal to the twice the number of edges in a given
graph.

Accordingly,

d(r1)+d(r2)+d(r3)+d(r4)=2*| E |
3+5+7+3=2*9

18=18
Hence, it is proved.

Euler’s Formula: | V | - | E | +| R| = 2
= 7-9+4=2
2=2

Hence, the above graph satisfies the Euler’s theorem.

Kuratowski’s Theorem:

A necessary and sufficient condition for a graph G to be
planar is that G does not contain K5, K3,3 as a subgraph.

NOTE-1: The complete graph K5 (Kuratowski’s first graph ) is a
non-planar graph.

NOTE-2: The complete graph K3,3 (Kuratowski’s second graph)

is a non-planar graph.

NOTE-3: Petersen’s graph is non-planar

NOTE-4: The complete graphs K2,K3,K4 are planar graphs.

NOTE-5: Bipartite graphs K2,2 and K2,3 are planar graphs.

NOTE-6: A connected planar graph G with n vertices and m
edges has exactly m-n+2 regions in all of its diagrams.

NOTE-7: if G is a connected simple planar graph with n(≥3)
vertices, m(≥2) edges and r regions, then

a. m ≥(3/2)*r b. m≤3n-6

Graph Coloring:

Given a planar or non-planar graph G, if we assign colors to
its vertices in such a way that no two adjacent vertices have
the same color, then we say that the graph G is properly
colored.

(or)

Properly coloring of a graph means assigning colors to its
vertices such that adjacent vertices have different colors.

Example-1: red blue

green green
blue red

red blue

Fig: Properly
colored Graphs

blue red

green

blue red
green
blue

Note: 1. A graph can have more than one proper coloring.
2. Two non-adjacent vertices in a properly colored graph

can have the same color.

Chromatic Number:
The chromatic number of a graph is the minimum number of

colors required with which the graph can be properly colored.
The chromatic number of a graph G is usually denoted by χ(G)

Example: Find the chromatic number of the following graphs.

red
red
blue

blue
blue pink

red blue

red green

blue Fig: Graph G1

Fig: Graph G

The chromatic number of a graph G is χ(G)=2

The chromatic number of a graph G1 is χ(G1)=4

Chromatic Number of a Complete Graph:

A simple graph, in which there is exactly one edge between
each pair of distinct vertices is called a complete graph. We have
to color all the vertices of a complete graph by using minimum
number of colors is called chromatic number of a complete graph.

A complete graph with n vertices is denoted by Kn. The
following figures show the complete graphs from K1 through K6.

red

red red blue V1

green blue

V1 V1 V2

V2 V3

KC1hromatic CK2hromatic CKh3romatic
number of a number of a

Complete numCobmerpoKlef2taeisco2Gmrpalpehte graph K1 number of a Complete

GraphThKe1cihsro1matic is Gχ(rKap1h)=K13 is 3

The chromatic number of a complete graph K2 is χ(K2 )=2

The chromatic number of a complete graph K3 is χ(K3 )=3

The chromatic number of a complete graph K4 is χ(K4 )=4

The chromatic number of a complete graph K5 is χ(K5 )=5

The chromatic number of a complete graph K6 is χ(K6 )=6

The chromatic number of a complete graph Kn is χ(Kn )=n

V1 red red blue

red blue grey blue V2 V3

V1 V2 V5 V2 grey pink
V4
V1

V4 K4 V3 V4 V3 V6 V5
green pink green pink green K6 brown

K5

Chromatic Chromatic Chromatic
number of a number of a number of a
Complete Graph Complete Graph Complete Graph

K4 K5 K6
is 4 is 5 is 6

Chromatic Number of a Bipartite Graph:

A bipartite graph is an undirected graph whose set of vertices
can be partitioned into two sets M and N in such a way that
each edge joins a vertex in M to a vertex N and no edge joins
either two vertices in M or two vertices in N. We have to color

all the vertices of a bipartite graph by using minimum number
of colors is called chromatic number of bipartite graph.

Example:

red red red

M V1 V3 V5

N V2 V4 V6
blue blue blue

Chromatic number of a Bipartite Graph K3,3 is 2

Chromatic Number of a Complete Bipartite Graph:

A complete bipartite graph is a bipartite graph in which every
vertex of M is connected to every other vertex of N. We have to
color all the vertices of a complete bipartite graph by using
minimum number of colors is called chromatic number of
complete bipartite graph

if M contains m vertices and N contains n vertices, then the

complete bipartite graph is denoted by Km,n red red

red
Example:
V2 red A1 A2 A3
red V1

V3 V4 V5 B1 B2 B3
blue blue blue
blue blue blue
Chromatic number of a
Complete Bipartite Graph Chromatic number of a
K2,3 is 2 Complete Bipartite
Graph K3,3 is 2

Chromatic Number of a Petersen Graph: The chromatic number
of a Petersen graph is the minimum number of colors required
with which the graph can be properly colored.

Example: The chromatic number of a Petersen graph: χ(Petersen
Graph )=3 because 3 colors are required to color all the vertices

of Peterson Graph . red
V1

green blue green blue
V2 V9 V10 V5

red
V6

red V7
V8 green

blue V4 red
V3

Chromatic Number of a Herschel Graph: The chromatic number
of a Herschel graph is the minimum number of colors required
with which the graph can be properly colored.

Example: The chromatic number of a Herschel graph: χ(Herschel
Graph )= 2 because 2 colors are required to color all the vertices

of Herschel Graph . red
V1

green green V8 green
V2 V7
red

V6 red green
V4
V11 red V5

green V9 green
V10

V3
red

MAP COLORING

• A planar graph divides a plane into a number of parts called
regions(faces) of which only one region is exterior region. These
regions are properly colored if no two adjacent regions have the
same color. A proper coloring of all the regions of a map is called
“Map coloring”.

• Two regions are called adjacent regions, if they have a common
edge between them.

• Example: The following figure illustrates a proper coloring of
regions of a planar graph.

red blue Fig: Map coloring
red blue red of a Graph G

blue green
red

NOTE-1: Every simple, connected planar graph is 4-colorable is
called Four Color Theorem.

NOTE-2: The vertices of every simple, connected planar graph can
be properly colored with 5 colors is called Five Color Theorem.

NOTE-3: A graph of order n(≥2) consisting of a single cycle is 2-
chromatic if n is even and 3-chromatic if n is odd.

NOTE-4: if a graph G contains Kn as a subgraph, then χ(G) ≥n
NOTE-5: χ(Kn) = 1 for all n ≥1

NOTE-6: if G is a graph of n vertices, then χ(G) ≤ n
NOTE-7: if a graph G contains a graph G1 as a subgraph, then

χ(G) ≥ χ(G1)
NOTE-8: A graph with one or more edges is atleast 2-chromatic.

NOTE-9: A graph consisting of only isolated vertices(Null Graph)
is 1-chromatic.

SPANNING TREE

A Spanning tree of a connected graph G is a sub graph
which is a tree and which includes every vertex of G.

OR

Let G be a connected graph. A subgraph T of G is called a
spanning tree of G if

i. T is a tree

ii. T contains all the vertices of G.

NOTE: if a graph G has n vertices , a spanning tree of G must have
n vertices and n-1 edges.

NOTE: To obtain a spanning tree of a connected graph G with n
vertices and m edges, the number of edges to be removed from the
graph G is m-n+1, this number is called the circuit rank of G.

NOTE: if T is a spanning tree of a graph G ,then the edges of G that
are not in T are called the chords of G with respect to T.

NOTE: A graph is connected if and only if it has a spanning tree.
NOTE: With respect to any of its spanning trees, a connected graph

of n vertices and m edges has n-1 edges and m-n+1 chords.
Example-1: Construct the possible number of spanning trees for the

following graph G.

A Fig: Graph G

BC

Number of edges that are to be removed from the graph G to get the
spanning tree =m-n+1=3-3+1=1

The possible spanning trees are: A

A
A

BB BC

BC

Example-2: Construct the possible number of spanning trees for the
following graph G.

A B
C
Fig: Graph G

D

Number of edges that are to be removed from the graph G to get the
spanning tree =m-n+1=6-4+1=3

The possible spanning trees are:

A BA B AB

C DC D CD

AB

CD

Weighted Graph:

Let G be a graph and suppose there is a positive real number
associated with each edge of G, then G is called a weighted graph.

The positive real number associated with an edge of e is called the

weight of the edge e.

A 20 B
12 10 18

13
CD

15

Fig: Weighted Graph G

Number of edges that are to be removed from the graph G to get the
spanning tree =m-n+1=6-4+1=3

The possible weighted spanning trees are:

A B Total cost=18+15+12=45
12 18

C D

15

20 20 20
AB B
A B A
12 12 18
D
C D C 18 C
15 15 D

Total cost=20+12+15=47 Total cost=20+18+15=53 Total cost=20+12+18=50

Minimum cost Spanning Tree:

A spanning tree whose cost is minimum among all the
possible spanning trees for a given graph is called a Minimum
cost spanning tree.

Example: for the above graph, we consider all the spanning trees
of a weighted, connected graph, and find the total cost of every
one of the spanning trees. A spanning tree whose total cost is
minimum, that spanning tree is called Minimum cost spanning
tree, it is shown in below fig.

A B
12
18
C
Total cost=18+15+12=45

D

15

Minimum Cost Spanning Tree for the Graph G

Algorithms for constructing Minimum cost Spanning Tree(MST):

There are several methods of constructing minimum cost
spanning trees, among them two algorithms are important to
construct minimal spanning tree. They are

1. Kruskal’s Algorithm
2. Prim’s Algorithm

Prim’s and Kruskal’s Algorithms

Prim’s Algorithm

Prim’s Algorithm is a famous algorithm. It is used for
finding the Minimum Spanning Tree (MST) of a given graph.
To apply Prim’s algorithm, the given graph must be weighted,
connected and undirected.

Algorithm:

1. Randomly choose any vertex. The vertex connecting to the
edge having least weight is usually selected.

2. Find all the edges that connect the tree to new vertices. Find
the least weight edge among those edges and include it in the
existing tree. If including that edge creates a cycle, then reject
that edge and look for the next least weight edge.

3.Keep repeating step-02 until all the vertices are included with
n-1 edges .

4. Finally we got a Minimum Spanning Tree (MST)

Algorithm:
1. Randomly choose any vertex. The vertex connecting to the

edge having least weight is usually selected.

2. Find all the edges that connect the tree to new vertices. Find
the least weight edge among those edges and include it in
the existing tree. If including that edge creates a cycle, then
reject that edge and look for the next least weight edge.

3.Keep repeating step-02 until all the vertices are included with
n-1 edges .

4. Finally we got a Minimum Spanning Tree (MST)

Example-1: Construct the minimum cost spanning tree for the
following graph.

Step-1: Initially spanning tree is empty.

12

67 3

5 4 Minimum cost=0

Step-2: Randomly choose any vertex. Let us consider vertex 1. The

vertex connecting to the edge having least weight is usually

selected. 1 2 Adjacent vertices of vertex 1
are vertex 2 and 6
10 1-2 edge cost=28

673 1-6 edge cost=10
Min(28,10)=10
Select vertex 6 by

considering the edge 1-6

54 with cost=10

Minimum cost=10

Step-3: Adjacent vertices of vertices 1 and 6 are vertex 2 and 5. Hence 1-2 edge
cost=28 and 6-5 edge cost=25. Now Min(28,25)=25. Select vertex 5 by considering
the edge 6-5 with cost=25

1 2
10

67 3

25

5 4 Minimum cost=10+25=35

SSanttedepp5-4--47: :AedNdgjaeecxceton,stts=vee2lr4eticacntedsth5oe-f4vmeedritgniceiemcsous1tm=a2n2wd.Ne5iogawrhetMe2di,n4e(2ad2ng,d2e47,22v-8e7)r=tiw2c2ei.st.Sh1e-c2leocestdtvgee1rt4ceoxsta4=n2bd8y
conasdidderiitngtothteheedsgpea5n-4niwnigthtcroeset=w22ith out forming a cycle

1 2 3
10 7

6

25 5 4 Minimum cost=10+25+22=57

22

Step-5: Adjacent vertices of vertices 1 and 4 are 2,7 and 3 vertices.1-2 edge cost=28,
4-7 edge cost=18 and 4-3 edge cost=12. Now Min(28,18,12)=12. Select vertex 3 by
considering the edge 4-3 with cost=12

1 2
10

67 3

25 22 12

5 4 Minimum cost=10+25+22+12=69

Step-6: Adjacent vertices of vertices 1 and 3 are 2. 1-2 edge cost=28 and 3-2 edge
cost=16. Now Min(28,16)=16. Select vertex 2 by considering the edge 3-2 with
cost=16

1 2 16
10

6 3
7

25 12

22 Minimum cost=10+25+22+12+16=85

54

Step-7: Adjacent vertices of vertices 1 and 2 are vertices 1,2,3 and 7.1-2 edge cost=28,
and 2-7 edge cost=14. Now Min(28,14)=14. Select the vertex 7 by considering the
edge 2-7 with cost=14

1 2 16
10 14 3

6 7

25 12

Minimum cost

54 =10+12+22+12+16+14=99
22

Step-8: Adjacent vertices of vertices 1 and 7 that are not visited till now are nil. Hence

The minimal cost spanning tree with 7 vertices and n=1=7-1=6 edges. cost=99 is shown

in below

1 14 2 16

10

67 3

25 12 Minimum cost
5 4 =10+12+14+16+22+25=99

22

Example-2: Construct the minimum cost spanning tree for the
following graph.

Fig: Graph G

Fig: Minimal cost spanning Tree for Graph G with cost=
1+2+3+4+6+10=26

Kruskal’s Algorithm-

• Kruskal’s Algorithm is a famous algorithm. It is used for
constructing the Minimal Spanning Tree (MST) of a given
graph.

• To apply Kruskal’s algorithm, the given graph must be
weighted, connected and undirected.

Algorithm: The steps of the algorithm are

• The edges of the given graph G are arranged in the order of
increasing weights.

• An edge G with minimum weight is selected as an edge of the
required spanning tree.

• If adding an edge creates a cycle, then reject that edge and go
for the next least weighted edge.

• This procedure is stopped after n-1 edges have been selected

• Finally we got a Minimum Spanning Tree (MST)

Example: Construct the minimum cost spanning tree for the
following graph.

Sol: The edges of the given graph G are arranged in the order of
increasing weights.
10 12 14 16 18 22 24 25 28

S.NO EDGE WEIGHT OR COST ACCEPTED OR REJECTED
1 1-6 10 ACCEPTED
2 3-4 12 ACCEPTED
3 2-7 14 ACCEPTED
4 2-3 16 ACCEPTED
5 4-7 18 REJECTED
6 4-5 22 ACCEPTED
7 5-7 24 REJECTED
8 5-6 25 ACCEPTED
9 1-2 28 REJECTED

Step-1: Initially spanning tree is empty.

12

67 3

5 4 Minimum cost=0

Step-2: select the minimum weighted edge 1-6 with cost 10 and add
it to the spanning tree with out forming a cycle.

1 2
10

673

54 Minimum cost=10

Step-3: Next, select the minimum weighted edge 3-4 with cost 12
and add it to the spanning tree with out forming a cycle

1 2
10

67 3

12

Minimum cost=10+12=22

54

Step-4: Next, select the minimum weighted edge 2-7 with cost 14
and add it to the spanning tree with out forming a cycle

12

10 14

6 73

12

54 Minimum cost=10+12+14=36

Step-5: Next, select the minimum weighted edge 2-3 with cost 16
and add it to the spanning tree with out forming a cycle

1 2 16
10 14 3

6 7

12

5 4 Minimum cost=10+12+14+16=52

Step-6: Next, select the minimum weighted edge 4-7 with cost 18

and add it to the spanning tree, it forms a cycle, hence we reject

it. 12
16

10 14

6 73

12
54

Minimum cost=10+12+14+16=52

Step-7: Next, select the minimum weighted edge 4-5 with cost 22
and add it to the spanning tree with out forming a cycle

1 2 16
10 14 3

6 7

12

5 4 Minimum cost
22 =10+12+14+16+22=74

Step-8: Next, select the minimum weighted edge 5-7 with cost 24

and add it to the spanning tree it forms a cycle, hence we reject

it. 1 14 2 16

10

67 3

54 12 Minimum cost
22 =10+12+14+16+22=74

Step-9: Next, select the minimum weighted edge 5-6 with cost 25
and add it to the spanning tree with out forming a cycle

1 2 16
10 14 3

6 7

25 12

Minimum cost

54 =10+12+14+16+22+25=99
22

Step-10: We have to stop the procedure after n-1=7-1=6 edges are

selected. The final Minimum cost spanning tree is

1 14 2 16

10

67 3

25 12 Minimum cost
5 4 =10+12+14+16+22+25=99

22

Example-2: Construct the minimum cost spanning tree for the
following graph.

Fig: Graph G

Fig: Minimal cost spanning Tree for Graph G with cost=
1+2+3+4+6+10=26

Example-3: Construct the minimum cost spanning tree for the
following graph using Prim’s algorithm and Kruskal’s algorithm.

6B 8C 3

A5 75 R
6
P 10 3
Q

Fig: Graph G

Minimal cost spanning Tree using Prim’s Algorithm:

B C 3
6 7
A5 R
Q 3
P

Fig: Minimal cost Spanning Tree with cost 6+5+7+3+3=24

Minimal cost spanning Tree using Kruskal’s Algorithm:

B C 3
6 7
A5 R
Q 3
P

Fig: Minimal cost Spanning Tree with cost 6+5+7+3+3=24

Example-4: Construct the minimum cost spanning tree for the
following graph using Prim’s algorithm and Kruskal’s algorithm.

1 13 5
3 2
3
2 2 7

2

26 5
4 3
4

1

Fig: Graph G

Minimal cost spanning Tree using Kruskal’s Algorithm:

1 3

13 5
2 2

26 7

24
1

Fig: Minimal cost Spanning Tree with cost 1+1+2+2+2+3=11

Minimal cost spanning Tree using Prim’s Algorithm:

1 3

13 5
2 2

26 7

24
1

Fig: Minimal cost Spanning Tree with cost 1+1+2+2+2+3=11

Hamiltonian Cycle:

Let G be a connected graph. A circuit or cycle of a graph G is
called a Hamiltonian Cycle or circuit, If it includes every vertex
of G exactly once, except the starting and end vertices which
appear twice.

Hamiltonian Graph:

A graph that contains a Hamiltonian Cycle or circuit is called
a Hamiltonian Graph or Hamilton graph.

Example: A B

PQ

SR C
D

Fig: Graph G

By observe the above graph G, the cycle A-B-C-D-S-R-Q-P-A
is a Hamiltonian cycle. Therefore, the above graph is a Hamiltonian

Graph.
Hamiltonian Path:

A path of a connected graph G is called a Hamiltonian path or
Hamilton path, if it includes every vertex(but not necessarily
every edge) of the graph G exactly once.

AB

Fig: Graph G

DC

From the above graph A-B-D-C is a Hamiltonian path

ISOMORPHISM

• Isomorphism:
Consider two graphs G=(V,E) and G1=(V1,E1). Suppose there

exists a function f : V V1 such that i. f is one-to –one ii. For all
vertices A,B of G, the edge {A,B} ∈ E if and only if {f(A),f(B) }∈
E1, then f is called an Isomorphism between G and G1 and we say
that G and G1 are Isomorphic Graphs.

• Check whether two graphs are Isomorphic or not:
Two Graphs G1(V1,E1) and G2(V2,E2) are said to be

Isomorphic if and only if it satisfies the following conditions.

i. Both graphs contains the same number of vertices.

ii. Both graphs contains the same number of edges.

iii. Degree sequence of both graphs should be the same.

iv. Both graphs containing same Cycle length .

v. One-to-One correspondence between the vertices of two
graphs.

vi. Edge preserving should be satisfied.
vii. Adjacency matrices of both graphs should be the same.

AB PQ R
CD S

ExamplEe-1: check whether the above two graphs are iTsomorpGhiracphorGn2ot.

Graph G1

i. Number of vertices=5 i. Number of vertices=5
ii. Number of edges=4 ii. Number of edges=4
iii. Degree sequence(A,B,C,D,E)= iii. Degree sequence
(P,Q,R,S,T)=(1,3,1,2,1)
(2,1,3,1,1)

iv. A2 S2
D1
C E1 Q P1
3 3

R1

B1 T1
A S

2 C3 2 Q3

one-to-one correspondence: each vertex in graph G1 is

equivalent one vertex in Graph G2.

C  Q, A  S, D  P, E  R, B  T

v. Edge Preserving: each edge in graph G1 is equivalent one edge
in Graph G2.
A-B  S-T, A-C  S-Q, C-D  Q-P, C-E  Q-R

vi. Adjacency matrices of both the graphs are
equal

A B CDE S T QPR

A01 100 S 0 1 1 00

B10 000 T 1 0 0 00

C10 011 Q 1 0 0 11

D00 100 P 0 0 1 00

E00 100 R 0 0 1 00

By satisfying all the above six properties mentioned above by
two graphs G1 and G2, Hence we can say that G1 and G2 are

Isomorphic graphs.


Click to View FlipBook Version