Adjacency Matrix
Learn how to represent a graph as an adjacency matrix.
We have already defined graphs in
One such representation is the adjacency matrix representation. Using this representation, graphs can be stored as two-dimensional arrays.
Adjacency matrix for a simple graph
An adjacency matrix for a
- The row and column are associated with the same vertex, say .
- The value