Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

K. Maheswaran MCA, M.Phil., M.Sc, (Maths), SET, Ph.

D
Assistant Professor in Computer Science
School of Computing Sciences
St.Joseph’s College(Autonomous)
Tiruchirappalli- 620 002
Compiled by Prof.K.Maheswaran
theory

MCA, MPhil,MSc(Maths),SET
2
Graph theory
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
3
.v 6 v
GRAPH THEORY
DEFINITIONS

 Self loop
 Parallel edges

 Incident

 Adjacent

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
 Degree of the vertex

 Regular graph

 Simple graph

 Null graph

 Isolated graph

 Pendent vertex

 Serial edges
4
DEFINITIONS

 Self loop
 Adjacent

 Serial edges

 Parallel edges

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
 Degree of the vertex

 Regular graph

 Simple graph

 Null graph

 Isolated graph

 Pendent vertex

 Incident
5
Basic Definitions of Graph Theory

Self Loop:
An edge having both of its end vertices are same, such
a edge is called “Self Loop”.

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
Adjacent:
 Two Non-Parallel are said to be adjacent if they are
incident on a common vertex.
 Two vertices are said to be adjacent if their end vertices
are same edge.

Serial Edges:
Two adjacent edges are said to be serial if there is a common
vertex of degree 2. 6
Parallel Edges:
Two edges are said to be parallel if their end vertices are
same

Degree of the vertex:

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
The number of edges incident on a vertex v is called the
degree of the vertex.(Here self loop is counted twice). It is
usually denoted by d(v).

Regular Graph:
A Graph in which all vertices are equal degree is known as
Regular Graph.
Simple Graph:
A graph that has been neither self loop nor parallel edges are 7

called Simple Graph:


Null Graph:
Every vertex in a null graph is Isolated vertex.
Isolated vertex:
The vertex with degree zero is called “Isolated

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
vertex”.
Pendant vertex:
The vertex with degree one is called “Pendant
vertex”.
Incident:
When a vertex Vi is an end vertex of some edge (ej)
then Vi and ej are said to be incident . 8
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
9
RESULT:

Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
10
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
11
ISOMORPHIC
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
12
ISOMORPHIC
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
13
IS IT ISOMORPHIC?
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
14
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
15
SUB GRAPHS
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
16
OBSERVATIONS
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
17
WALK
TERMINAL VERTICES
In a walk beginning and end vertices are called “Terminal
Vertices”.

 Closed walk:
A walk is an Closed walk in which Starting and end vertices

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran

are same.

 Open Walk
 A walk is an Openwalk in which Starting and end vertices are
different.

18
Path:

- Self loop is allowed in a walk but not path.

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
Circuit
- A circuit is a closed walk in which no vertex appears
more than once. (except initial and end vertex)
- Circuit is also referred as ‘cycle’ .
Length of the Path:
The number of edges in a path is called Length of the
Path

19
CONNECTED GRAPH:

DISCONNECTED GRAPH:

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
A Graph G is said to be disconnected graph if there is no
path b/w at least two vertices

COMPONENT:

20
EULER GRAPHS

 Euler line:
A closed walk running through every edge of G

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran

exactly once. Such a walk is called “Euler line”.

 Euler graph:
 A graph that consist of an Euler line is called “Euler
graph”.

Note :
 Euler graph do not have any isolated vertices.
21
 Euler graph is always connected.
KONIGBERG BRIDGE
(BEST EXAMPLE OF GRAPH THEORY)

 It’ s
a long standing problem solved by
Leonhard Euler in 1736

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
22
MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
Euler represents this situation by using graph as shown in the
figure.
23
MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
The vertices represents the land areas and edges represents
the bridges. Here we find that nor all it’s vertices of even
degree and hence it’s not an Euler graph. Thus, it is not
possible to walk over each bridge exactly once and return to
the starting point.
This problem is an same as the problem of drawing
figure without lifting the pen from the paper and 24
without retracing the line.
UNICURSAL LINE
 An open walk covering all the edges without
retracing any edge(exactly once) is known as
“Unicursal line”.(open Euler line)

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
 A graph that has a unicursal line will be called
“Unicursal graph”.
Unicursal line 

25
Note :
 By adding an edge b/w the initial

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
and final vertices of a unicursal line we
will get a EULER LINE.
 Thus a connected graph is
unicursal iff exactly two vertices of odd
degree.

26
OPERATIONS ON A GRAPH
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET

1. UNION
2. INTERSECTION
3. RING SUM
4. DECOMPOSITION
5. DELETION
6. FUSION

27
UNION OF TWO GRAPHS.

G1= (V1,E1) and G2=(V2, E2)

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
If G3 = (V3, E3) Where V3 = V1 U V2 and E
3 = E1 U E2

Then G3 = G1 U G2

28
INTERSECTION OF TWO GRAPHS

G1= (V1,E1) and G2=(V2, E2)

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
If G3 = (V3, E3) Where V3 = V1 ∩ V2 and E
3 = E 1 ∩ E2

Then G3 = G1 ∩ G2

29
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
30
RING SUM
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
31
DECOMPOSITION
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
32
DELETION
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET
33
FUSION:
NOTE:
 Union , Intersection and Ring sum are Commutative.
i.e G1 U G2 = G2 U G1

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
G1 G2 = G2 G1
 if G1 and G2 are edge disjoint, then
I. G1 ∩ G2 is null graph.
II. G1 G 2 = G 1 U G 2

34
ARBITRARILY TRACEABLE GRAPH FROM VERTEX ‘V’

 In a Euler graph if there is a vertex v such that we can


trace the Euler line, simply by moving along any edge

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
that has not already been traversed, then the graph is
said to be “Arbitrarily traceable graph from v ”.

 Given fig. is an Euler graph. Suppose we start vertex ‘a’


and trace the path a b c now at c we have the choice of
going to a, d ,or e.

35
ARBITRARILY TRACEABLE GRAPH FROM VERTEX ‘V’ (CONTD…..)

 If you took choice ‘a’ we can trace only circuit a


b c a which is not an Euler line. But starting
from c, we can trace the Euler line, simply by

MCA, MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran
moving along any edge that has not already been
traversed.

36
Compiled by Prof.K.Maheswaran
MCA, MPhil,MSc(Maths),SET

Note:
• An Euler graph G arbitrarily traceable from vertex ‘v’ in G Iff
every circuit in G Contains ‘v’
37
• Hamiltonian circuit in a connected graph G is
defined as a closed walk that traverses every vertex
of G exactly once, except the starting vertex at
which the walk terminates.

Definition:( Hamiltonian Circuit)

Compiled by Prof.K.Maheswaran MCA,


38
MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran MCA,
39
MPhil,MSc(Maths),SET
1. Hamiltonian Circuits in a graph of n –vertices
consist of exactly n- edges.
2. Not every connected graph has a Hamiltonian
Circuit.
3. There is no criterion, we can apply to determine
the existence of a hamiltonial circuit in general.

Compiled by Prof.K.Maheswaran MCA,


40
MPhil,MSc(Maths),SET
• A path is Connected graph G is said to be
Hamiltonian if it includes every vertex of G.
• If we remove any one edge from Hamiltonian
circuit, we are left with a path. This path is called
“Hamiltonian Path”.
Note:
1) Every graph that has a Hamiltonian circuit also
has a Hamiltonian path, since Hamiltonian path is
a sub graph of Hamiltonian circuit.
2) Not graph with Hamiltonian path has Hamiltonian
Circuit.
3) The Length of a Hamiltonian path in a connected
graph of a vertices is n-1.
Compiled by Prof.K.Maheswaran MCA,
41
MPhil,MSc(Maths),SET
COMPLETE GRAPH

Compiled by Prof.K.Maheswaran MCA,


42
MPhil,MSc(Maths),SET
Note:

1. If a Complete graph G consists of n vertices, then


degree of every vertex is n-1, since every vertex is
joined with every other vertex through one edge.

2. Total no. of edges in G is

3. Every complete graph having more than 2 vertices


have Hamiltonian Circuit.

Compiled by Prof.K.Maheswaran MCA,


43
MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran MCA,
44
MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran MCA,
45
MPhil,MSc(Maths),SET
This

Compiled by Prof.K.Maheswaran MCA,


46
MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran MCA,
47
MPhil,MSc(Maths),SET
Compiled by Prof.K.Maheswaran MCA,
48
MPhil,MSc(Maths),SET

You might also like