- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Adjacency Matrices and their properties
Adjacency Matrix is used to represent a graph. We can represent directed as well as undirected graphs using adjacency matrices. Following are the key properties of an Adjacency matrix.
An Adjacency Matrix A[V][V] is a 2D array of size V × V where V is the number of vertices in a undirected graph.
If there is an edge between Vx to Vy then the value of A[Vx][Vy] = 1 and A[Vy][Vx]=1, otherwise the value will be zero.
For a directed graph, if there is an edge between Vx to Vy, then the value of A[Vx][Vy]=1, otherwise the value will be zero.
Adjacency Matrix of an Undirected Graph
Let us consider the following undirected graph and construct the adjacency matrix −
Adjacency matrix of the above undirected graph will be −
Adjacency Matrix of a Directed Graph
Let us consider the following directed graph and construct its adjacency matrix −
Adjacency matrix of the above directed graph will be −
- Related Articles
- Planar Graphs and their Properties
- Pendent Vertex, Isolated Vertex and Adjacency of a graph
- Adjacency lists in Data Structures
- Differentiate between metal and non-metal on the basis of their chemical properties.
- C++ Program to Implement Adjacency List
- C++ Program to Implement Adjacency Matrix
- Dijkstra’s Algorithm for Adjacency List Representation
- Prim’s MST for Adjacency List Representation
- How can ethanol and ethanoic acid be differentiated on the basis of their physical and chemical properties?
- C++ Program to Represent Graph Using Adjacency Matrix
- C++ Program to Represent Graph Using Adjacency List
- Difference Between Matrices and Arrays in Python?
- What difference in the properties of oil and water enable their separation by a separating funnel ?
- The presence of __________ Ca in acids is responsible for their acidic properties.