Adjacency matrices
Introduction / Definition
An adjacency matrix records whether pairs of vertices are connected. For a simple undirected graph, the matrix is symmetric and contains 0 or 1. Matrix powers can encode numbers of walks. Adjacency matrices connect graph theory with linear algebra.
Syntax / Mathematical Form
Aᵢⱼ=1 if {vᵢ,vⱼ}∈E; otherwise 0
Detailed Explanation
For a simple undirected graph there are zeros on the diagonal and A=Aᵀ. The sum of row i gives the degree of vertex i. The entry (Aᵏ)ᵢⱼ counts walks of length k from i to j.
Example / Worked Example
Path 1−2−3 has A = [ 0 1 0 ] [ 1 0 1 ] [ 0 1 0 ].
Output / Result
The matrix is symmetric and row sums are 1,2,1.
Important Points / Notes
- Symmetric for undirected graphs.
- Row sums give degrees in simple graphs.
- Aᵏ counts walks of length k.
Mini Practice Question
Write the adjacency matrix of a triangle K₃.