Adjacency Matrix
Explore how adjacency matrices are used to represent graphs as two-dimensional arrays, capturing connections between vertices. Learn the properties of adjacency matrices for simple and non-simple graphs, including symmetry, row and column sums, and how these relate to vertex degrees. Understand the significance of matrix definitions for loops and multiple edges to better work with graph algorithms.
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