0% found this document useful (0 votes)
364 views35 pages

DM Unit-5 Graph Theory

Here are the steps to solve this problem: 1) Let the number of vertices be n 2) Each vertex has a degree of at least 1 (since it is connected to itself by a loop) 3) By the handshaking lemma, the sum of the degrees of all vertices is twice the number of edges 4) Let d_i be the degree of vertex i 5) Then ∑d_i = 2e 6) Since each d_i ≥ 1, ∑d_i ≥ n 7) Therefore, 2e ≥ n 8) Or e ≥ n/2 So the minimum number of edges in a connected graph with n vertices is n/2.

Uploaded by

vyas reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
364 views35 pages

DM Unit-5 Graph Theory

Here are the steps to solve this problem: 1) Let the number of vertices be n 2) Each vertex has a degree of at least 1 (since it is connected to itself by a loop) 3) By the handshaking lemma, the sum of the degrees of all vertices is twice the number of edges 4) Let d_i be the degree of vertex i 5) Then ∑d_i = 2e 6) Since each d_i ≥ 1, ∑d_i ≥ n 7) Therefore, 2e ≥ n 8) Or e ≥ n/2 So the minimum number of edges in a connected graph with n vertices is n/2.

Uploaded by

vyas reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Unit V:

Graph Theory: Graphs and their properties, Degree, Connectivity, Path,


Cycle, Sub Graph, Rooted trees,
Minimum Spanning Trees: Prims Algorithm, Kruskal’s Algorithm, and
Planar Graphs.

Unit VI:
Graph Theory and Applications: Isomorphism, Eulerian and Hamiltonian
Graphs, Graph Colouring, Colouring maps and Colouring Vertices,
Colouring Edges, List Coloring, Perfect Graph: Definition properties and
Example, Bi-connected component and Articulation Points.

2 January 2021 IT Department, BVRIT, 1


Graph Theory and
Applications
• Basic concepts
• Representation of Graphs
• Isomorphism and Sub
graphs
• Multi graphs and Euler
Circuits
• Hamiltonian graphs
• Spanning trees
• Planar graphs
• Chromatic number
2 January 2021 IT Department, BVRIT, 2
Basic concepts and
notations.
• A Graph G is a pair of sets (V, E)
• where V = A set of vertices (nodes) and
• E = A set of edges (lines)
• V(G) = Set of vertices in G.
• E(G) = Set of edges in G.
• V(G) = Number of vertices in graph G = Order
of G.
• E(G) = Number of edges in graph G = Size of G .

ab
* *

c d
* *
2 January 2021 IT Department, BVRIT, 3
Types of
graphs

• Non Directed Graph (Undirected graph): The elements of E are


unordered pairs (sets) of vertices. In this case an edge {u, v} is said
to join u and v or to be between u and v.
• Directed Graph: In a digraph the elements of E are ordered pairs of
vertices. In this case an edge (u, v) is said to be from u to v.
• Loop: An edge drawn from a vertex to itself.
• Multi Graph: If one allows more than one edge to join a pair of
vertices,
the result is then called a multi graph.
• Simple Graph: A graph with no loops and no parallel edges.
• Degree: Degree of a vertex in an undirected graph is the number of
edges incident with it, except that a loop at a vertex contributes
twice to the degree of that vertex. The degree of the vertex ‘v’ is
denoted by deg(v).

2 January 2021 IT Department, BVRIT, 4


Definition
s

• In-degree and Out-degree: In a digraph, the number of edges


incident to a vertex is called the in-degree of the vertex and the
number of vertices incident from a vertex is called its out-degree.
• The in-degree of a vertex ‘v’ in a graph G is denoted by deg+(v) .
• The out-degree of a vertex v is denoted by deg -(G).
• A loop at a vertex in a digraph is counted as one edge for both
in-degree and out-degree of that vertex.
• Neighbors: If there is an edge incident from u to v, or incident on u
and v, then u and v are said to be adjacent ( neighbors).
• (G) = minimum of all the degrees of vertices in a graph G.
• (G) = Maximum of all the degrees of vertices in a graph G.

2 January 2021 IT Department, BVRIT, 5


Regular
graph

• Regular Graph: In a graph G, if (G) = (G) = k


i.e., if each vertex of G has degree k, then G is said to be a regular
graph
of degree k (k-regular).
• Ex: Polygon is a 2-regular graph .
• Ex: A 3-regular graph is a cubic graph.
• Complete Graph: A simple non directed graph with ‘n’ mutually
adjacent vertices is called a complete graph on ‘n’ vertices and may
be represented by Kn.
• Note: A complete graph on ‘n’ vertices has [{n(n – 1)}/ 2]edges,
and each of its vertices has degree ‘n-1’.
• Every complete graph is a regular graph.
• The converse of the above statement need not be true.

2 January 2021 IT Department, BVRIT, 6


More
graphs

• Cycle Graph: A cycle graph of order ‘n’ is a connected graph whose


edges form a cycle of length n.
• Note: A cycle graph ‘Cn’ of order n has n vertices and n edges.
• Null Graph: A null graph of order n is a graph with n vertices and
no edges.
• Wheel Graph: A wheel graph of order ‘n’ is obtained by adding a
single
new vertex (the hub) to each vertex of a cycle graph of order n.
• Note: A wheel graph Wn has ‘n +1’ vertices and 2n edges.
• Bipartite Graph: A Bipartite graph is a non directed graph whose
set of vertices can be partitioned in to two sets M and N in such a
way that each edge joins a vertex in M to a vertex in N.

2 January 2021 IT Department, BVRIT, 7


More
graphs.

• Complete Bipartite Graph: A complete Bipartite graph is a Bipartite


graph in which every vertex of M is adjacent to every vertex of N.
• If M = m and N = n then the complete Bipartite graph is denoted
by
Km , n. It has ‘m n’ edges.
• The number of edges in a bipartite graph is (n2/4).
• Degree Sequence: If v1, v2, ……, vn are the vertices of a graph G, then
the sequence{d1, d2,….., dn} where di = degree of vi is called the
degree sequence of G.
• Usually we order the degree sequence so that the degree sequence
is monotonically decreasing.

2 January 2021 IT Department, BVRIT, 8


First theorem on graph
theory
• Sum of Degrees Theorem: If V = {v1 , v2 , ….., vn } is the vertex set of a
non directed graph G then

• deg (vi) = 2. E
n

• Proof: Wih=e1n the degrees are summed, each edge contributes a


count of one to the degree of each of the two vertices on which
the edge is incident.
• Hence, the theorem follows.

2 January 2021 IT Department, BVRIT, 9


Corrollorie
s

• Cor. If G is a digraph,
1 then
• deg –(vi) =
deg+(vi) E
= n
• Cor.2. An undirected graphi=1 i= 1
n has an even n u mber of vertices of
odd degree. (Refer Text book for proof)
• Cor.3 If G is a k– regular graph , then k. V = 2. E .

• Cor.4 In a non directed graph G, If k = (G) and m = (G) then


• k. V 2. E m . V

2 January 2021 IT Department, BVRIT, 10


Example
s
• Ex. A non directed graph contains 16 edges and all vertices are of
degree
2. Find the number of vertices in G ?
• Solution: By Sum of degrees theorem, if degree of each vertex is k,
then
• k. V = 2. E
• 2. V = 2.(16)
• V = 16

2 January 2021 IT Department, BVRIT, 11


1) Ex. A simple non directed graph G contains 21 edges, 3 vertices of
degree 4 and the other vertices are of degree 2. Find the number of
vertices in the graph G ?

2) What is the number of vertices in an undirected connected graph with


27 edges, 6 vertices of degree 2, 3 vertices of degree 4 and remaining
vertices of degree 3?

3) If a simple non directed graph G contains 24 edges and all vertices


are of
same degree then find the number of vertices in G?
4) What is the largest possible number of vertices in a graph G, with 35
edges and all vertices are of degree at least 3 ?.

2 January 2021 IT Department, BVRIT, 12


Exampl
e

• 1) A simple non directed graph G contains 21 edges, 3 vertices of


degree 4 and the other vertices are of degree 2. Find the number
of vertices in the graph G ?
• Solution: Let V = n . By Sum of degrees theorem,

• deg (vi) = 2. E
n
• 3x4 +m x 2= 2.(21)
m=(42-12)/2=15
• n = 3+15=18.

2 January 2021 IT Department, BVRIT, 13


2) What is the number of vertices in an undirected connected graph
with 27 edges, 6 vertices of degree 2, 3 vertices of degree 4 and
remaining vertices of degree 3?

• Solution: Let V = n . By Sum of degrees theorem,

• deg (vi) = 2. E

• 6.(2) + 3.(4) + (n – 9 ). 3 = 2.(27)


• n = 19.

2 January 2021 IT Department, BVRIT, 14


3) If a simple non directed graph G contains 24 edges and all vertices
are of
same degree then find the number of vertices in G?
• Solution: By Sum of degrees theorem, if degree of each vertex is k,
then
• k. V = 2. E
• k. V = 2.(24)
• V = 48/k ( k = 1,2,3,4,6,8,…)
• V(G) = 48, 24, 16, …

2 January 2021 IT Department, BVRIT, 15


4) What is the largest possible number of vertices in a graph G,
with 35
edges and all vertices are of degree at least 3 ?.
• Solution: By Sum of degrees theorem, if degree of each vertex is
k, then
• k. V 2. E
• 3. VV (70/3
2.(35)= 23.33..)
• V 23

• The largest possible number of vertices = 23

2 January 2021 IT Department, BVRIT, Narsapur 16


Exampl
e

• Ex. Let G be a simple graph with n vertices. Then show that the
number of edges in G is less than or equal to {n.(n – 1)} / 2.

• Solution: In a simple graph, each edge correspond to a distinct


pair of vertices.
• The number of ways to choose a pair of vertices, out of n
vertices = C(n , 2) n. (n – 1 )
• = 2

• The maximum number of edges possible in G = {n.(n – 1)} / 2.
• The number of edges in G is less than or equal to {n.(n – 1)} /
2.

2 January 2021 IT Department, BVRIT, 17


Ex. Which of the following degree sequences represent a simple non
directed
a) {2, 3, 3, 4, 4,graph
5} b) {2, 3, 4, 4, 5}
c) {1, 3, 3, 4, 5, 6, 6} d) {1, 3, 3, 3}
• Solution: a) Consider the degree sequence {2, 3, 3, 4, 4, 5}
• Here, we have 3 vertices with odd degree.
• But, By sum of degrees theorem, An undirected graph should
contain an even number of vertices of odd degree.
• The degree sequence cannot represent a simple non directed
graph.

• b) Consider the degree sequence {2, 3, 4, 4, 5}


• Here, we have a vertex with degree 5.
• But, A simple non directed graph of order 5 cannot have a vertex
with degree 5.
• The degree sequence cannot represent a simple non directed
graph.

2 January 2021 IT Department, BVRIT, 18


Contd.,

• c) Consider the degree sequence {1, 3, 3, 4, 5, 6, 6}


Here, the order of the graph is 7 and we have 2 vertices with
degree 6.
• Since these two vertices are adjacent to all other vertices of the
graph, a vertex with degree 1 does not exist
• The degree sequence cannot represent a simple non directed
graph.

• d) Consider the degree sequence {1, 3, 3, 3 }


Here, the order of the graph is 4 and we have 3 vertices with
degree 3.
• Since these 3 vertices are adjacent to all other vertices of the
graph, a vertex with degree 1 does not exist.
• The degree sequence cannot represent a simple non directed
2 January
graph.2021 IT Department, BVRIT, Narsapur 19
Ex. Show that a degree sequence with all distinct elements cannot
represent
a simple non directed graph.

• Solution: Let G = {v1,v2,v3,…,vn}


• The possible degree sequences are {0,1,2,….,n –1} and {1,2,3,…,n}
• In a simple graph of order n, if there is a vertex with degree n – 1
then a vertex with degree 0 does not exist.
• A simple non directed graph of order ‘n’ cannot have a vertex with
degree n.
• The degree sequence with all distinct elements cannot represent a
simple non directed graph.

2 January 2021 IT Department, BVRIT, 20


Representation of
Graphs

Adjacency list: One way to represent a graph with no multiple edges


is to use adjacency lists, which specify the vertices that are adjacent
to each vertex of the graph.
1) Adjacency matrix: The adjacency matrix of a graph is a
matrix with rows and columns labeled by the vertices and such that
its entry in row i, column j, i 6 = j, is the number of edges incident on I
and j. For instance the following is the adjacency matrix of the graph
of figure

21
2) Incidence matrix: The incidence matrix of a graph G is a
matrix with rows labeled by vertices and columns labeled
by edges, so that entry for row v column e is 1 if e is
incident on v, and 0 otherwise. As an example, the
following is the incidence matrix of graph of figure

22
Minimal Spanning Tree: Let G be a connected graph where each edge
of G is labeled with a non negative cost. A spanning tree T where the
total cost C(T) is minimum is called a minimal spanning tree.

• Kruskal’s Algorithm: (For finding minimal spanning tree of a


connected weighted graph)
• Input: A connected graph G with non negative values assigned to
each
edge.
• Output: A minimal spanning tree for G.
• Method: 1) Select any edge of minimal value that is not a loop.
This is the first edge of T(if there is more than one edge of
minimal value, arbitrary choose one of these edges)
• 2) Select any remaining edge of G of having minimal value that
does not form a circuit with the edges already included in T.
• 3) Continue step 2 until T contain (n – 1) edges when n = |V(G)|

2 January 2021 IT Department, BVRIT, 23


Prim’s
algorithm.
• Prim’s Algorithm: (For finding a minimal spanning tree)
• 1) Let G be a connected graph with non negative values assigned
to each edge. First let T be the tree consisting of any vertex V1 of
G.
• 2) Among all the edges not in T, that are incident on a vertex in T
and do not form a circuit when added to T, Select one of minimal
cost and add it to T.
• 3) The process terminates after we have added (n – 1) edges
• where n = |V(G)|.

2 January 2021 IT Department, BVRIT, 24


Planar
Graphs

• A graph or a multi graph that can be drawn in a plane or on a sphere


so that its edges do not cross is called a planer graph.
• Ex : A complete graph on 4 vertices K4 is a planar graph.
• Ex : Tree is a planar graph.

2 January 2021 IT Department, BVRIT, 25


• Map, Connected map : A particular planar representation of a finite
planer multi graph is called a map. We say that the map is
connected if the underlying multi graph is connected.
• It is also called as Planar representation of Graph.
• Region : A given map (planar graph) divide the plane into connected
areas called regions
• Degree of a region : The boundary of each region of a map consists
of a sequence of edges forming a closed path. The degree of
region ‘r’ denoted by deg (r) is the length of the closed path
bordering r .

2 January 2021 IT Department, BVRIT, 26


Complete Graph K5 is Non-Planar:
Kirtowski Grpah-1 is K5

2 January 2021 IT Department, BVRIT, 27


Complete Bi-Partite Graph K3,3 is Non-
Planar:
Kirtowski Grpah-2 is K3,3

2 January 2021 IT Department, BVRIT, 28


2 January 2021 IT Department, BVRIT, 29
Sum of degrees of regions
theorem

• If G is a planar graph with k regions, then the sum of the degrees of


the regions of G is equal to twice the number of edges in G.
i.e., deg (ri) = 2. E .
K

• Cor.1 In a planar gir=a1ph G, if the degree of each region is k then k.


R =2. E
• Cor.2 In a planar graph G, if the degree of each region is k , then k.
R 2. E
• In particular, If G is a simple connected planar graph ( A planar
graph with no loops and no parallel edges, and degree of each
region is 3), then
3. R ≤ 2 . E

2 January 2021 IT Department, BVRIT, 30


2 January 2021 IT Department, BVRIT, 31
Euler’s
formula
• Euler’s formula for planar graphs.
• Statement: If G is a connected planar graph, then
• V – E + R =2
• In other notation, n–e+f=2

32
2 January 2021 IT Department, BVRIT, Narsapur
2 January 2021 IT Department, BVRIT, 33
Kurtowski
Theorem
• A graph G is not planar iff G contains a sub graph homeomorphic to
K3, 3 or K5 .

• Ex. A planar graph contains 25 vertices and 60 edges then find the
number of regions in the graph .
• Ex. What is the maximum number of edges possible in a planar
graph with eight vertices ?.
• Ex. What is the minimum number of vertices necessary for a graph
with
11 edges to be a simple planar graph?.
• Ex. Suppose that a connected planar graph has 20 vertices, each of
degree 3. In to how many regions does a representation of this
planar graph split the plane ?

2 January 2021 IT Department, BVRIT, 34


Example
s
• Ex. Let G is a connected planar graph with 35 regions and degree of
each region is 6. Find the number of vertices in G ?.
• Theorem: Prove that a complete graph Kn is planar iff n 4.
• Theorem: Prove that a complete Bipartite graph Km, n is planar
• iffm 2 or n 2.

2 January 2021 IT Department, BVRIT, 35

You might also like