Let aij denote the number of edges (Vi, Vj) then A = [aij]m×m is called adjacency matrix of G if
In graph theory, an adjacency matrix is a square matrix that represents a finite graph. The elements of this matrix indicate whether pairs of vertices in the graph are connected by an edge. For a graph with n vertices, the adjacency matrix is an n × n matrix where the element Aij is:
This matrix representation provides a powerful tool for analyzing and manipulating graph structures, making it essential for studying various types of graphs, including undirected and directed graphs.
In an undirected graph, the edges are not directional, meaning the edge between two vertices is bidirectional. Consequently, the adjacency matrix for an undirected graph is symmetric. If there is an edge between vertices i and j, then both Aij and Aji will be 1.
Example:
Consider an undirected graph with 4 vertices V = {A, B, C, D} and the following edges:
The adjacency matrix for this graph is:
Here, the matrix is symmetric about the diagonal, indicating the undirected nature of the graph.
In a directed graph, the edges have a specific direction, meaning they go from one vertex to another and not necessarily in both directions. The adjacency matrix of a directed graph does not need to be symmetric.
Example:
Consider a directed graph with 4 vertices V = {A, B, C, D} and the following directed edges:
The adjacency matrix for this graph is:
This matrix is not symmetric, which reflects the directed nature of the graph.
Example 1: Consider the undirected graph G as shown below. Find the Adjacency matrix.
Solutions:
Example 2: Find the Adjacency matrix of graph G.
Solutions:
Example 3: Consider the undirected graph G as shown below. Find the Adjacency matrix.
Solutions:
Example 4: Find the Adjacency matrix of the graph.
Solutions:
Example 5: Plot a graph given by the following adjacency matrix
Solutions:
Example 6: Write down the Adjacency matrix of graph G.
Solutions:
(Session 2025 - 26)