0% found this document useful (0 votes)
16 views

Module 5 Basic Concepts of Graph Theory

Uploaded by

mpvrajamin001067
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)
16 views

Module 5 Basic Concepts of Graph Theory

Uploaded by

mpvrajamin001067
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/ 82

Discrete Mathematics and Graph Theory

Module 5 - Fundamentals of Graphs

Aarthy B

Division of Mathematics,
School of Advanced Sciences,
Vellore Institute of Technology,
Chennai campus.

November 5, 2023

Aarthy B (VIT Chennai) GT November 5, 2023 1 / 82


Outline

1 Origin of Graph Theory

2 Basic Concepts of Graph Theory

3 Special Types of Graphs

4 Graph Isomorphism

5 Degree Sequence

6 Shortest Path Algorithm

Aarthy B (VIT Chennai) GT November 5, 2023 2 / 82


Origin of Graph Theory

Aarthy B (VIT Chennai) GT November 5, 2023 3 / 82


Origin

Aarthy B (VIT Chennai) GT November 5, 2023 4 / 82


Graph Representation

Aarthy B (VIT Chennai) GT November 5, 2023 5 / 82


History

The First Research Paper on Graph Theory written by Leonhard Euler


on the Seven Bridges of Königsberg and published in 1736 is regarded
as the first paper in the history of graph theory.
“Theorie der endlichen und unendlichen Graphen” was the first
textbook on graph theory written by Déenes Konig in the year 1936.
It is in German Language.
The term “graph” was introduced by Sylvester in a paper published in
1878 in Nature, where he draws an analogy between “quantic
invariants” and ”co-variants” of algebra and molecular diagrams.

Aarthy B (VIT Chennai) GT November 5, 2023 6 / 82


What/Why Graph Theory?

Graph theory is a branch of mathematics that deals with the study of


graphs, which are mathematical structures used to represent
relationships and connections between objects.

A graph or network is a way to specify relationships among the


collection of items.

A graph consists of nodes/vertices and links/edges.

Two neighbours are connected or related if they are connected by an


edge.

Network models are simple graphs whose Vertices represent the


components of the network and Edges represent the physical
communication links between the vertices.

Aarthy B (VIT Chennai) GT November 5, 2023 7 / 82


Applications I

Graph theory has numerous practical applications in various fields,


including computer science, social sciences, transportation, and more. Key
applications of graph theory are:

1 Social Networks: Social media platforms like Facebook, Twitter,


and LinkedIn use graph theory to model connections between users.
This enables features like friend recommendations, newsfeed
algorithms, and the analysis of social network structures.
2 Transportation Networks: Road networks, airline routes, and
public transportation systems can be modeled as graphs. Graph
theory helps optimize route planning, transportation logistics, and
traffic flow analysis.
3 Computer Networks: The internet and local area networks are
represented as graphs to analyze data transmission, routing
algorithms, and network design.

Aarthy B (VIT Chennai) GT November 5, 2023 8 / 82


Applications II
4 Electrical Circuits: Electrical circuits can be represented as graphs,
with nodes representing components and edges representing
connections. Graph theory is used in circuit analysis and design.
5 Image Processing: In image analysis, graphs can represent pixel
connections and are used in tasks like image segmentation, object
recognition, and scene analysis.
6 Supply Chain Management: Supply chain networks can be
represented using graphs, which help optimize logistics, inventory
management, and supply chain efficiency.
7 Social Sciences: Graph theory is used to model and analyze social
structures, such as collaboration networks, academic citation
networks, and communication networks.
8 Fraud Detection: Graph theory is used to detect fraudulent
activities by modeling relationships between entities and identifying
unusual patterns and anomalies
Aarthy B (VIT Chennai) GT November 5, 2023 9 / 82
Basic Concepts of Graph Theory

Aarthy B (VIT Chennai) GT November 5, 2023 10 / 82


Basics

Graph
A graph is an ordered tuple (V (G ); E (G )) where
V (G ) = {v1 , v2 , v3 , . . . , vn } is a nonempty set and elements of this set are
called vertices, E (G ) is an 2-element subset of V (G ) and the elements of
E (G ) = {e1 , e2 , e3 , . . . , em } are called edges of G .

Types of Graphs
Basically There are thee types of graphs:
1 Directed graph: Graph with directions.
2 Undirected graph: Graph without directions.

Aarthy B (VIT Chennai) GT November 5, 2023 11 / 82


Other types of graphs

1 Simple Graph: A graph with no loops or multiple edges.


2 Multiple(Multi) graph: Graph with multiple edges (parallel edges)
connecting the same pair of vertices.
3 Psudeo graph: Graph with multiple edges and loops.

Aarthy B (VIT Chennai) GT November 5, 2023 12 / 82


Example

(a) Simple graph (b) Graph with loops (c) Pseudo graph

Aarthy B (VIT Chennai) GT November 5, 2023 13 / 82


Basics

Trivial graph
A graph with only one vertex.

Null graph
A graph with no edges. (also called as Empty graph or Totally
disconnected graph)

Remark
Every trivial graph is a null graph but the converse is not true.

Aarthy B (VIT Chennai) GT November 5, 2023 14 / 82


Basics

Adjacent vertices
Two vertices are said to be adjacent if they share an edge.

Adjacent edges
Two edges are adjacent if they share a common vertex.

Incidence
A vertex is said to be incident with an edge if it is an end point of the
edge.

Aarthy B (VIT Chennai) GT November 5, 2023 15 / 82


Basics

Degree
The degree of a vertex is the number of edges incident with the
vertex. The minimum of all degrees in a graph is Minimum degree (δ)
and the maximum of all degrees in a graph is Maximum degree (∆).

Isolated vertex
A vertex with degree 0.

Pendant vertex
A vertex with degree 1.

Aarthy B (VIT Chennai) GT November 5, 2023 16 / 82


Example

deg (v1 ) = 2, deg (v2 ) = deg (v3 ) = deg (v5 ) = 4, deg (v4 ) = 1,
deg (v6 ) = 3, deg (v7 ) = 0. We note that v4 is a pendant vertex and
v7 is an isolated vertex.

Aarthy B (VIT Chennai) GT November 5, 2023 17 / 82


Handshaking Theorem

Theorem
n
P
For a graph G = (V , E ), deg (vi ) = 2m, where m represents the
i=1
number of edges in the graph G .

Corollary
Every graph has an even number of odd degree vertices.

Aarthy B (VIT Chennai) GT November 5, 2023 18 / 82


Subgraph

Subgraph
A graph H is said to be a subgraph of G if V (H) ⊆ V (G ) and
E (H) ⊆ E (G ). It is denoted as h ⊆ G .

Remark
Empty graph of G is always a subgraph of G .
Every graph is a subgraph of itself.

Aarthy B (VIT Chennai) GT November 5, 2023 19 / 82


Subgraph - Types

Spanning subgraph
If V (H) = V (G ), then H is called a spanning subgraph of G . A
spanning subgraph of G need not contain all its edges.

Induced subgraph
A subgraph H = (V (H), E (H)) of G = (V , E ), where V (H) ⊆ V (G )
and E (H) consists of only those edges that are incident on the
elements of V (H), is called an induced subgraph of G .

Aarthy B (VIT Chennai) GT November 5, 2023 20 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 21 / 82


Walk, Trail and Path

Walk
A walk in a graph G is a finite sequence of the form
v1 e1 v2 e2 v3 e3 v3 · · · which consists of alternating vertices and edges of
G.

Trail
A walk is a said to be a trail if no edges are traversed more than once.

Path
A trail is a said to be a path if no vertices are visited more than once.

Aarthy B (VIT Chennai) GT November 5, 2023 22 / 82


Closed trail
A trail is said to be a closed trail if it begins and ends at the same
vertex.

Cycle
A closed trail whose origin and internal vertices are distinct is a called
as a cycle (circuit).

Aarthy B (VIT Chennai) GT November 5, 2023 23 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 24 / 82


Connectedness

Connected graph
A graph G is said to be connected if there is a path from any vertex
to any other vertex in the graph G .

Component
A subgraph of a graph is a component of G if the subgraph is
connected.

Disconnected graph
A graph which is not connected.

Aarthy B (VIT Chennai) GT November 5, 2023 25 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 26 / 82


Complement of a graph

Complement
The complement G c of the simple graph G is a simple graph where
the edges in the complement are the non edges in the given graph.

Self-complementary
If the graph and its complement are same, then the graph is said to
self complementary.

Example
C5 (a cycle on 5 vertices) is Self-complementary.

Aarthy B (VIT Chennai) GT November 5, 2023 27 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 28 / 82


Special Types of Graphs

Aarthy B (VIT Chennai) GT November 5, 2023 29 / 82


Complete graph

A complete graph of order n is denoted by Kn and is a graph in which


there exists an edge between every pair of vertices.

Aarthy B (VIT Chennai) GT November 5, 2023 30 / 82


Regular graph
A graph G is said to be regular, if all its vertices have the same
degree. In a graph, if the degree of each vertex is ‘k’ , then the graph
is called a ‘k-regular graph’.
Note
Every complete graph Kn is (n − 1) - regular.
Every empty graph G is 0 - regular.

Aarthy B (VIT Chennai) GT November 5, 2023 31 / 82


Bipartite graph

A graph is bipartite if its vertex set can be partitioned into two


subsets V1 and V2 so that every edge has one end in V1 and one end
in V2 . Such a partition (V1 , V2 ) is called a bipartition of the graph.
We denote a bipartite graph G with bipartition (V1 , V2 ) by G [V1 , V2 ].

Aarthy B (VIT Chennai) GT November 5, 2023 32 / 82


Complete Bipartite graph

A bipartite graph G [V1 , V2 ] is said to be a complete bipartite graph if


every vertex in V1 is joined to every vertex in V2 . It is denoted by
Km,n where |V1 | = m and |V2 | = n.

Aarthy B (VIT Chennai) GT November 5, 2023 33 / 82


Planar graph
A graph is a planar graph if it can be drawn in the plane such that no
edges cross each other. The plane embedding is called the plane
graph.

Figure: Complete graph K4

Aarthy B (VIT Chennai) GT November 5, 2023 34 / 82


Characterization theorem for Planar graphs

Theorem
A finite graph is planar if and only if it does not contain a subgraph
K5 or K3,3 .

Aarthy B (VIT Chennai) GT November 5, 2023 35 / 82


Matrix representation of graphs

Adjacency matrix
If G is an undirected graph with n vertices v1 , v2 , v3 , · · · then the
n × n matrix A = [aij ] where
(
1, if (vi , vj ) ∈ E (G )
aij =
0, if (vi , vj ) ∈
/ E (G )

Incidence matrix
If G is an undirected graph with n vertices v1 , v2 , v3 , · · · and m edges
e1 , e2 , e3 , · · · then the n × m matrix B = [bij ] where
(
1, if ej is incident on vi
bij =
0, if ej is not incident on vi

Aarthy B (VIT Chennai) GT November 5, 2023 36 / 82


Example

The adjacency matrix is given by

Aarthy B (VIT Chennai) GT November 5, 2023 37 / 82


Example

The adjacency matrix is given by

Aarthy B (VIT Chennai) GT November 5, 2023 38 / 82


Example

The incidence matrix is given by

Aarthy B (VIT Chennai) GT November 5, 2023 39 / 82


Example

The incidence matrix is given by

Aarthy B (VIT Chennai) GT November 5, 2023 40 / 82


Number of walks of length r between any two vertices

The number of walks between any two vertices of a graph G can be


found only analytically using the adjacency matrix of G , by applying
the following theorem.
Theorem
If A is the adjacency matrix of a graph G (simple graph), then the
number of different walks of length r from vi to vj is equal to the
(i, j)th entry of Ar .

Aarthy B (VIT Chennai) GT November 5, 2023 41 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 42 / 82


Example - Contd.

Aarthy B (VIT Chennai) GT November 5, 2023 43 / 82


Example - Contd.

Aarthy B (VIT Chennai) GT November 5, 2023 44 / 82


Graph Isomorphism

Aarthy B (VIT Chennai) GT November 5, 2023 45 / 82


Graph Isomorphism

Definition
Two graphs G (V1 , E1 ) and H(V2 , E2 ) are isomorphic if there is a
bijection f : V1 → V2 such that u and v are adjacent in G if and only
if f (u) and f (v ) are adjacent in H.

Theorem
Two graphs are isomorphic if and only if their vertices can be labeled
in such a way that the corresponding adjacency matrices are equal.

Aarthy B (VIT Chennai) GT November 5, 2023 46 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 47 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 48 / 82


Try!!

Figure: Problem 1

Figure: Problem 2

Aarthy B (VIT Chennai) GT November 5, 2023 49 / 82


Try!!

Figure: Problem 3

Figure: Problem 4
Aarthy B (VIT Chennai) GT November 5, 2023 50 / 82
Degree Sequence

Aarthy B (VIT Chennai) GT November 5, 2023 51 / 82


Degree Sequence of a graph

If G is a graph on n vertices v1 , v2 , v3 , · · · , vn with degrees


d1 , d2 , d3 , · · · , dn respectively, then (d1 , d2 , d3 , · · · , dn ) is called the
degree sequence of G .

Aarthy B (VIT Chennai) GT November 5, 2023 52 / 82


Problem 1

Check whether the degree sequence (5, 5, 4, 3, 2, 1) is graphical.


Solution:
Sum of given degrees = 20 (even) =⇒ may be graphical.
By Havel Hakimi Theorem,

Let S = (5, 5, 4, 3, 2, 1)
= (4, 3, 2, 1, 0)
= (2, 1, 0, -1) (After rearranging )

The given degree sequence is not graphical.

Aarthy B (VIT Chennai) GT November 5, 2023 53 / 82


Problem 2

Check whether the degree sequence (3, 3, 3, 3, 2) is graphical.


Solution:
Sum of given degrees = 14 (even) =⇒ may be graphical.
By Havel Hakimi Theorem,

Let S = (3, 3, 3, 3, 2)
= (2, 2, 2, 2)
= (1, 1, 2)
After rearranging ,
= (2, 1, 1)
= (0, 0)

The given degree sequence is graphical.

Aarthy B (VIT Chennai) GT November 5, 2023 54 / 82


Problem 2 - Contd.

Aarthy B (VIT Chennai) GT November 5, 2023 55 / 82


Try!!

1 Check whether there exists a graph whose degree sequence is


(5, 5, 4, 3, 2, 1).
2 Check whether there exists a graph whose degree sequence is
(5, 5, 5, 5, 2, 2, 1).
3 Check whether there exists a graph whose degree sequence is
(4, 3, 3, 2, 2, 2, 1).
4 Check whether the degree sequence (3, 3, 2, 1, 1) is graphical.
5 Check whether the degree sequence (3, 3, 3, 3, 3, 3) is graphical.

Aarthy B (VIT Chennai) GT November 5, 2023 56 / 82


Connectivity

Vertex connectivity
Minimum number of vertices whose removal from G leaves the graph
disconnected. (denoted by κ(G ))

Edge connectivity
Minimum number of edges whose removal from G leaves the graph
disconnected. (denoted by λ(G ))

Whitney’s inequality
κ(G ) ≤ λ(G ) ≤ δ(G ).

Aarthy B (VIT Chennai) GT November 5, 2023 57 / 82


Example - Vertex connectivity

Vertex connectivity κ(G ) = 1.

Aarthy B (VIT Chennai) GT November 5, 2023 58 / 82


Example - Edge connectivity

Edge connectivity λ(G ) = 2.


Whitney’s inequality: κ(G ) ≤ λ(G ) ≤ δ(G ) =⇒ 1 ≤ 2 ≤ 2.

Aarthy B (VIT Chennai) GT November 5, 2023 59 / 82


Cut-Sets

Component
A subgraph which is connected is called a component.

Cut vertex
A cut point or cut vertex of a graph G is a vertex whose removal
increases the number of components.

Cut edge
A cut edge or bridge of a graph G is an edge whose removal increases
the number of components.

Block
A connected non-trivial graph having no cut point is a block.

Aarthy B (VIT Chennai) GT November 5, 2023 60 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 61 / 82


Remark

1 The vertex connectivity and edge connectivity of a disconnected


graph is 0.
2 The connectivity of a connected graph with a cut point is 1.
3 The line connectivity of a connected graph with a bridge is 1.
4 The complete graph Kn cannot be disconnected by removing any
number of vertices but the removal of n − 1 vertices results in a
trivial graph. Hence, κ(Kn ) = n − 1.

Aarthy B (VIT Chennai) GT November 5, 2023 62 / 82


Eulerian graph

Eulerian trail
A trail of graph G is called an Eulerian trail (namely, open trail), if it
includes each edge of G exactly once.

Eulerian cycle
A cycle of a graph G is called an Eulerian cycle, if it includes each
edge of G exactly once.

Eulerian graph
A graph containing an Eulerian cycle is called an Eulerian graph.

Aarthy B (VIT Chennai) GT November 5, 2023 63 / 82


Note

The necessary and sufficient conditions for existence of Euler cycle


and Euler trail are given in the following theorems:
Theorem
A connected graph G contains an Eulerian cycle if and only if each of
its vertices is of even degree.

Theorem
A connected graph G contains an Eulerian trail (namely, open trail) if
and only if it has exactly two vertices of odd degree.

Aarthy B (VIT Chennai) GT November 5, 2023 64 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 65 / 82


Problem 1

It contains an Eulerian trail A − B − E − D − A − C − D − B, since it


contains exactly two vertices of odd degree.

Aarthy B (VIT Chennai) GT November 5, 2023 66 / 82


Problem 2

It does not contain an Eulerian trail or Eulerian cycle since it contains


more than two vertices of odd degree.

Aarthy B (VIT Chennai) GT November 5, 2023 67 / 82


Problem 3

It contains an Eulerian cycle A − B − C − D − E − A − C − E − B − D − A


since every vertex has even degree.

Aarthy B (VIT Chennai) GT November 5, 2023 68 / 82


Hamiltonian graph

Hamiltonian path
A path of a graph G is called a Hamiltonian path, if it includes each
vertex of G exactly once.

Hamiltonian cycle
A cycle of a graph G is called a Hamiltonian cycle, if it includes each
vertex of G exactly once, except the starting and end vertices (which
are one and the same) which appear twice.

Hamiltonian graph
A graph containing a Hamiltonian cycle is called a Hamiltonian graph.

Aarthy B (VIT Chennai) GT November 5, 2023 69 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 70 / 82


Problem 1

It contains a Hamiltonian path namely C − B − D − A − E but not a


Hamiltonian cycle.

Aarthy B (VIT Chennai) GT November 5, 2023 71 / 82


Problem 2

It contains a Hamiltonian cycle namely A − B − C − D − E − F − A.

Aarthy B (VIT Chennai) GT November 5, 2023 72 / 82


Problem 3

It does not contain a Hamiltonian path or Hamiltonian cycle.

Aarthy B (VIT Chennai) GT November 5, 2023 73 / 82


Properties

1 A path obtained by deleting any one edge from a Hamiltonian


cycle is a Hamiltonian path.
2 Hamiltonian cycle contains a Hamiltonian path, but a graph
containing a Hamiltonian path need not have a Hamiltonian
cycle.
3 A complete graph Kn , n ≥ 3 will always have a Hamiltonian cycle.
4 A given graph may contain more than one Hamiltonian cycle.

Aarthy B (VIT Chennai) GT November 5, 2023 74 / 82


Aarthy B (VIT Chennai) GT November 5, 2023 75 / 82
Example

Aarthy B (VIT Chennai) GT November 5, 2023 76 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 77 / 82


Example

Aarthy B (VIT Chennai) GT November 5, 2023 78 / 82


Shortest Path Algorithm - Dijkstra’s Algorithm

Aarthy B (VIT Chennai) GT November 5, 2023 79 / 82


Shortest Path in a Weighted Graphs

Weighted graph
A graph in which each edge ′ e ′ is assigned a non-negative real
number w (e) is called a weighted graph, w (e) is called weight of the
edge ′ e ′ may represent distance, time, cost etc., in some units.

Note
A shortest path between two vertices in a weighted graph is a path of
least weight. In an unweighted graph, a shortest path means one with
the least number of edges.

Aarthy B (VIT Chennai) GT November 5, 2023 80 / 82


For Problems, kindly refer class notes for the same and Tutorial
Sheets 9 and 10. Also, the following books will be useful for
understanding the concepts well.
West, D.B., 2001. Introduction to graph theory (Vol. 2). Upper
Saddle River: Prentice hall.
Bondy, J.A. and Murty, U.S.R., 2008. Graph theory. Springer
Publishing Company, Incorporated.
Deo, N., 2017. Graph theory with applications to engineering and
computer science. Courier Dover Publications.
Balakrishnan, R. and Ranganathan, K., 2012. A textbook of graph
theory. Springer Science & Business Media.

Aarthy B (VIT Chennai) GT November 5, 2023 81 / 82


Thank You!!

Aarthy B (VIT Chennai) GT November 5, 2023 82 / 82

You might also like