Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Graph Theory Lecture-1 by Amit

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

University Institute of Engineering

Academic Unit - 4
Computational Mathematics
20SMT – 125
Introduction to Graph Theory

Topic : Introduction of Graph Theory DISCOVER . LEARN . EMPOWER


1
INTRODUCTION

In the domain of mathematics and computer


Science, graph theory is the study of graphs that concerns
with the relationship among edges and vertices.

It is a popular subject having its applications in


computer science, information technology, biosciences,
mathematics.

2
Graph

A graph is a pair of sets (V, E), where V is the set


of vertices and E is the set of edges, connecting the
pairs of vertices. Take a look at the following graph:

In the above graph,


V = {a, b, c, d, e}
E = {ab, ac, bd, cd, de}

3
Types of Edges
1. Parallel Edge: 2. Self Loop

4
Types of Graphs
1. Null Graph
2. Simple Graph
3. Multi Graph
4. Pseudo Graph
5. Directed Graph
6. Undirected Graph
7. Connected and Disconnected Graph
8. Complementary Graph
9. Labeled Graphs
10. Weighted Graph
5
Null Graph:
A null graph is defined as a graph which consists
only the isolated vertices.

Example: The graph shown in fig is a null graph, and


the vertices are isolated vertices.

6
Simple Graph:
A graph with no loops and no parallel edges is
called a simple graph.

Example:

7
Multi Graph:
Multi-graph is a graph which is permitted to
have multiple edges (also called parallel edges) but no self
Loop , that is, edges that have the same end nodes

Example:
The graph is a multi-graph
because of the double edge
between B and C
and
the triple edge between E and F

8
Pseudo Graph:
Pseudo graph is a graph which is permitted to
have multiple edges (also called parallel edges) and
self Loop

9
Directed Graph

A directed graph is a graph in which the edges are directed by arrows.

Directed graph is also known as digraphs.


Example:

10
Undirected Graph

An undirected graph is a graph whose edges are not


directed.

Example:

11
Connected and Disconnected Graph:
Connected Graph:
A graph is called connected
if there is a path from
any vertex u to v or vice-versa.

Disconnected Graph:
A graph is called disconnected
if there is no path between
any two of its vertices.

12
Complementary Graph:
The complement of a graph G is defined to be a
graph which has the same number of vertices as in graph
G and has two vertices connected if and only they are not
related in the graph.
Example: Consider the graph G shown in fig. Find the
complement of this graph.

.
13
Labeled Graphs:
A graph G=(V, E) is called a labeled graph if its edges are
labeled with some name or data. So, we can write these labels in
place of an ordered pair in its edges set.

14
Weighted Graph
A weighted graph is a graph whose edges have
been labeled with some weights or numbers.

The length of a path in a weighted graph is the sum


of the weights of all the edges in the path.
Example:

15
Degree of a Vertex

The degree of a vertex is the number of edges


incident on a vertex v.

Note: The self-loop is counted twice. The degree of


a vertex is denoted by d (v)

16
Example
Consider the graph G shown in fig. Determine the
degree of each vertex.

17
Example
Consider the graph G shown in fig. Determine the
degree of each vertex.

Solution:
The degree of each vertex is as follows:
d(a)=3; d(b)=5; d(c) = 2; d(d)=2.
18
Types of Vertex
1. Odd Vertex
2. Even Vertex
3. Isolated Vertex
4. Pendant Vertex
5. Adjacency Vertex

19
Odd Vertex:
A vertex having degree odd is called an odd vertex.

Even Vertex:
A vertex having a degree even is called an even vertex.
Example: Find degree of each vertex of following
graph.

20
Odd Vertex:
A vertex having degree odd is called an odd vertex.
Even Vertex:
A vertex having a degree even is called an even vertex.
Example: Find degree of each vertex of following
graph.
The degree of each vertex are
d(a)=3; d(b)=5;
d(c) = 2; d(d)=2.

21
Pendant Vertex:
A vertex with degree one
is called a Pendant Vertex.
Isolated Vertex:
A vertex with degree Zero
is called a Isolated Vertex.
Pendant Edge:
An edge of a graph is said to be pendant
if one of its vertices is a pendant vertex.
In Fig. edge AB is said to be Pendant edge.
22
Adjacent Vertices
In a graph, two vertices are said to be adjacent, if
there is an edge between the two vertices. Here, the
adjacency of vertices is maintained by the single edge
that is connecting those two vertices.
In a graph, two edges are said to be adjacent, if
there is a common vertex between the two edges.
Here, the adjacency of edges is maintained by the
single vertex that is connecting two edges.

23
Example:

In the above graph −


 'a' and 'b' are the adjacent vertices, as there is a common edge
'ab' between them.
 'a' and 'd' are the adjacent vertices, as there is a common edge
'ad' between them.
 'ab' and 'be' are the adjacent edges, as there is a common
vertex 'b' between them.
 ‘be' and 'de' are the adjacent edges, as there is a common
vertex 'e' between them.
24
Example:

In the above graph −


 'a' and 'd' are the adjacent vertices, as there is a common edge 'ad'
between them.
 'c' and 'b' are the adjacent vertices, as there is a common edge 'cb'
between them.
 'ad' and 'cd' are the adjacent edges, as there is a common vertex 'd'
between them.
 ‘ac' and 'cd' are the adjacent edges, as there is a common vertex 'c'
between them.

25
Handshaking Theorem-
Handshaking Theorem is also known as Handshaking
Lemma or Sum of Degree Theorem.

Handshaking Theorem states in any given graph,


Sum of degree of all the vertices is twice the number
of edges contained in it.

26
Example:
A simple graph G has 24 edges and degree of each
vertex is 4. Find the number of vertices.
Solution:

27
Example:
A simple graph G has 24 edges and degree of each
vertex is 4. Find the number of vertices.
Solution: Given Number of edges = 24
Degree of each vertex = 4
Let number of vertices in the graph = n.
Using Handshaking Theorem
Sum of degree of all vertices = 2 x Number of edges
Substituting the values, we get
n x 4 = 2 x 24 ⇒ n=2x6 ⇒ ∴ n = 12
Thus, Number of vertices in the graph = 12
28
Example:
A graph contains 21 edges, 3 vertices of degree 4 and all other vertices
of degree 2. Find total number of vertices.

29
Example:
A graph contains 21 edges, 3 vertices of degree 4 and all other vertices
of degree 2. Find total number of vertices.
Solution : Given Number of edges = 21
Number of degree 4 vertices = 3
All other vertices are of degree 2
Let number of vertices in the graph = n.
Using Handshaking Theorem
Sum of degree of all vertices = 2 x Number of edges
Substituting the values, we get
3 x 4 + (n-3) x 2 = 2 x 21 ⇒ 12 + 2n – 6 = 42
2n = 42 – 6 ⇒ 2n = 36 ⇒ ∴ n = 18
Thus, Total number of vertices in the graph = 18. 30
Example:
A simple graph contains 35 edges, four vertices of degree 5, five
vertices of degree 4 and four vertices of degree 3. Find the number of
vertices with degree 2.

31
Example:
A simple graph contains 35 edges, four vertices of degree 5, five
vertices of degree 4 and four vertices of degree 3. Find the number of
vertices with degree 2.
Solution: Given Number of edges = 35
Number of degree 5 vertices = 4 , Number of degree 4 vertices = 5
Number of degree 3 vertices = 4
Let number of degree 2 vertices in the graph = n.
Using Handshaking Theorem
Sum of degree of all vertices = 2 x Number of edges
Substituting the values, we get
4 x 5 + 5 x 4 + 4 x 3 + n x 2 = 2 x 35 ⇒ n=9
Thus, Number of degree 2 vertices in the graph = 9. 32
 The maximum number of edges possible in a simple graph
with ‘n’ vertices is nC2 where nC2 = n(n – 1)/2.

 The number of simple graphs possible with ‘n’ vertices =

33
Example: In the following graph, there are 3 vertices with 3 edges
which is maximum excluding the parallel edges and loops.
Solution: This can be proved by using the above formulae.
The maximum number of edges with n=3 vertices −
nC = n(n–1)/2
2 ⇒ 3(3–1)/2 ⇒ 6/2
⇒ = 3 edges
The maximum number of simple graphs with n=3 vertices −
2nC2 = 2n(n-1)/2
⇒ 23(3-1)/2 ⇒ 8
These 8 graphs are as
shown in graph

34
FAQ

Q.1 What is the purpose of graph theory?


Ans: In mathematics, graph theory is the study of graphs,
which are mathematical structures used to model pairwise
relations between objects. A graph in this context is made up
of vertices (also called nodes or points) which are connected
by edges (also called links or lines).
Q.2 Who is the father of graph theory?
Ans: Eulerian refers to the Swiss mathematician Leonhard
Euler, who invented graph theory in the 18th century.

35
THANK YOU

36

You might also like