Writing a graph as a matrix
Spectral graph theory studies a graph through the eigenvalues and eigenvectors of a matrix built from it. Three matrices do most of the work. For an undirected graph on vertices:
- the adjacency matrix , with when and are adjacent (or the edge weight);
- the degree matrix , diagonal, with ;
- the Laplacian .
For the path :
Every row sums to zero, because each diagonal degree is cancelled by that many off-diagonal s. The name comes from calculus: applied to a function on the vertices, measures how far sits from its neighbours, the discrete analogue of the Laplace operator.
Definition: The spectrum of a graph is the multiset of eigenvalues of one of these matrices. Since is real and symmetric, its eigenvalues are real and it has an orthonormal basis of eigenvectors, so we can order them .

