Discrete Mathematics
Muhammad Arslan 2024-DS-19
Muhammad Ahmed 2024-DS-39
Roshan Ali 2024-DS-48
Hassan Ali 2024-DS-28
Presented to Ms. Fatima
AGENDA
01 02
Isomorphism of graphs Matrix Representation
of Graphs
03 04
Connectivity Adjacency list/Incident
Matrix/path Martrix
Overview of Isomorphism
Isomorphism is a very general concept that appears in several areas of
mathematics. The word derives from the Greek Iso, meaning "equal," and
morphic, meaning "to form" or “to shape.”
Graph isomorphism is a Bijective(one-to one) correspondence between two
graphs vertices and edges that preserves adjacency, effectively making them
identical in structure.
Isomorphic Graphs
●Isomorphism:
– Two graphs are isomorphic, if they are structurally identical, Which means that
they correspond in all structural details.
– Formal vertex-to-vertex and edge –to-edge correspondence is
called isomorphism.
●Two graph are said to be isomorphic if:
They have the same number of vertices.
They
have the same number of edges.
They
have an equal number of vertices with a given degree.
Vertex corresponding & corresponding valid.
Example to understand the concept
Graph A
Graph B
1. Number of Vertices are same.(a,b,c,d,e = p,q,r,s,t)
2. Number of Edges are also same.
3. An equal number of vertices with given degree.
Degree of Vertices of Graph A:a=2,b=3,c=3,d=3,e=1
Degree of Vertices of Graph B: p=3,q=2,r=3,s=3,t=1
4. Vertices(A) : a b c d e
Vertices(B): p q r s t
Question 1: Check whether the given
Graphs are isomorphic or not:
Solution:
Both G and H have five vertices and six edges.
However, H has a vertex of degree one,
namely, e, whereas G has no vertices of degree
one. It follows that G and H are not
isomorphic.
◂
Question 2: Check whether the given Graphs
are isomorphic or not:
Solution:
Both G and H have six vertices and seven edges. Both have
four vertices of degree two and two vertices of degree three.
Hence, G and H consisting of all vertices of degree two and
the edges connecting them are isomorphic.
Paths
A path is a sequence of edges that begins at a vertex of a graph and
travels from vertex to vertex along edges of the graph
2
1 22 1 2
22
3
● The path is a circuit if it begins and ends at the same vertex
● A path or circuit is simple if it does not contain the same edge more than once.
1 22
3
Example
a b c
d e f
● a, d, c, f, e is a simple path of length 4.
● d, e, c, a is not a path because e is not connected to c.
● a, b, e, d, a, b is not a path because a and b vertices repeat .
● b, c, f, e, b is a circuit of length 4.
Summary of Walk, Trial and Path
● Path: Vertex not repeat but edges may.
Close Path: Starting and ending will be same at last also called (Cycle)
● Walk: In the tree Vertex and edge may be repeat.•
Open Walk: Starting and ending will be different.
Close Walk: Starting and ending will be same at last.
Continued
● Trail: Edges Not repeat but vertex may.
Open Trail: Starting and ending will be different.
Close Trial: Starting and ending will be same at last
also called (Circuit)
Connectedness in undirected graphs
Definition: An undirected graph is called connected if there is a path between every
pair of vertices.
G1 G2
Connected components
1 2 2
4 3 5
4
3
5 6 6
2 Components connected graphs 1 Components connected graphs
Connectedness in directed graphs
Strongly Connected components
2
0 6 2
4 3 5
1
4
6
3 strongly connected Components 2 strongly connected Components
Edge connectivity
Definition: Minimum number of edge required to
become a graph disconnected
a b
c
Vertices connectivity
Definition: Minimum number of vertices
required to become a graph disconnected
a b
c d
Counting paths b/w vertices
a b a b c d
0 1 1 0
A= 1 0 0 1
d c 1 0 0 1
0 1 1 0
0 0 0 8
A^4= 0 8 8 0
0 8 8 0
8 0 0 8
Questions
Does each of these lists of vertices form a path in the
following graph? Which paths are simple? Which are
circuits?
Find the strongly connected components of graphs.
Matrix representation of
graphs
Understanding Graph Matrix Representations
Adjacency Matrix: Explanation:
An adjacency matrix is a two- The rows and columns of the matrix
represent the graph's vertices. A 1 in
dimensional array that represents
the matrix indicates an edge between
the connections between nodes in two vertices, while a 0 indicates no
a graph using 0s and 1s edge
Use:
Adjacency matrices are used in computer
science and graph theory to represent finite
graphs. They are an alternative to adjacency
lists for representing relationships.
Properties
In graph theory, adjacency describes the relationship between vertices or edges in
a graph, typically represented using data structures like adjacency matrices or
adjacency lists. Here are the key properties of adjacency in graphs
1. Vertex Adjacency 2. Edge Adjacency
• Two vertices are • Two edges are adjacent
adjacent (or neighbors) if if they share a common
there is an edge directly vertex.
connecting them.
EXAMPLES
Question: Find adjacency matrix of graph
SOLUTION
Question:
Draw graph from matrix
SOLUTION
V1 V2
V4 V3
Incidence Matrix
History
The physicist Kirchhoff was the first to
define the incidence matrix in 1847.
In graph theory
An incidence matrix is a matrix representation of a graph that shows the
number of times each edge is incident with each vertex in the graph. It is a |
V| × |E| matrix, where |V| is the set of vertices and |E| is the set of edges.
Properties
Undirected graphs Directed graphs:
Have no negative entries, and Have some negative entries, and if a
the sum of the elements in directed graph has no self-loops, the
any column is always 2. sum of the elements of its incidence
matrix is always 0.
EXAMPLES
Question
Consider the undirected graph as shown below and Find the Incidence Matrix
Solution
• Rows represent vertices: v1,v2,v3,v4
• Columns represent edges: e1,e2,e3,e4,
Path Matrix
A path matrix is a graph representation scheme that stores paths from source
vertices to all reachable vertices.
Advantages
It has several advantages, including:
• Stores paths: Stores a path from the source vertices to all reachable
vertices
• Implicit order: Paths have an implicit order based on the rows they
appear in
• Space requirement: Requires less space than other representation
schemes
Path Matrix : Suppose G is a simple directed graph with m vertices, then path matrix p and
Bm have same non-zero entries where Bm = A + A2 + ...... Am, where A is adjacency matrix.
HOME TASK
Write incidence and adjacency matrix