Introduction to Spectral Graph Theory
How much can you learn about a graph just from a list of numbers? This is the central question of spectral graph theory. Given a finite graph, we build a matrix that records its structure. We then ask what the eigenvalues of that matrix reveal about the combinatorics of the graph. This includes connectivity, bipartiteness, expansion, the number of spanning trees, and more. The surprising answer is: a great deal. A single real number, the second-smallest Laplacian eigenvalue, already controls how well-connected a graph is. The full multiset of eigenvalues determines the number of closed walks of every length. It also determines the number of spanning trees. This matters because graphs are discrete, combinatorial objects. Eigenvalues, by contrast, come from linear algebra. Linear algebra is a continuous and highly developed theory with powerful tools. These tools include orthogonal diagonalization, variational characterizations, interlacing, and trace identities. Spectral graph theory is the bridge that lets us import these tools into combinatorics. It converts hard-to-see global structure into statements about eigenvalues. Such structure includes whether a graph is well connected. It also includes whether it has a large bipartite subgraph. It includes how fast a random walk on it mixes. Eigenvalues are often computable and amenable to estimation. The big picture is this: a graph has (at least) two natural matrices attached to it. These are the adjacency matrix and the Laplacian matrix . Both are real symmetric. Hence both are orthogonally diagonalizable with real eigenvalues, by the Spectral Theorem for symmetric matrices. The eigenvalues of encode walk-counting information. The eigenvalues of encode connectivity information. Via the Matrix-Tree Theorem, they also encode the number of spanning trees. This article builds both matrices from scratch. It proves the core structural facts: nonnegativity of Laplacian eigenvalues, the multiplicity of the eigenvalue as the number of connected components, and the bipartiteness criterion via symmetry of the adjacency spectrum. It also proves the algebraic connectivity theorem. This theorem relates the second-smallest Laplacian eigenvalue to connectivity. The article delivers precise definitions of both matrices. It gives a full proof of the Laplacian's basic spectral theorem, including the component-counting result. It proves that a connected graph is bipartite if and only if its adjacency spectrum is symmetric about . It includes two fully worked numerical examples on asymmetric graphs. Finally, it discusses where these ideas are used across mathematics, physics, computer science, and statistics.
- A graph gives rise to two canonical symmetric matrices: the adjacency matrix and the Laplacian .
- Both are real symmetric, so by the spectral theorem they have real eigenvalues and orthonormal eigenvector bases.
- is positive semidefinite; its smallest eigenvalue is always , and the multiplicity of equals the number of connected components of .
- The second-smallest Laplacian eigenvalue (the algebraic connectivity) is positive iff is connected, and it quantifies how "well-glued-together" is.
- A connected graph is bipartite iff its adjacency spectrum is symmetric under .
- The number of spanning trees of is a product of nonzero Laplacian eigenvalues divided by the number of vertices — this is the algebraic form of the Matrix-Tree Theorem.
- Key idea: turning a combinatorial graph into a linear algebra object lets eigenvalues certify and quantify structural properties like connectivity and bipartiteness.
Where this lives today
Spectral graph theory is not a museum piece; it is load-bearing infrastructure across several fields.
Spectral clustering and partitioning. The eigenvector associated with (the Fiedler vector) is used to split a graph into two well-connected pieces with a small cut — the basis of spectral clustering algorithms in machine learning and image segmentation, where a similarity graph is built on data points and its Laplacian's low eigenvectors reveal cluster structure.
Expander graphs and pseudorandomness. A family of graphs is a good expander precisely when the gap between the top two adjacency eigenvalues (or, equivalently, of the Laplacian relative to the maximum degree) stays bounded away from zero; expanders underlie error-correcting codes, derandomization, and network design in theoretical computer science.
Random walks and Markov chains. The normalized Laplacian's eigenvalues govern the mixing time of a random walk on a graph — how quickly the walk's distribution converges to uniform — which matters for Monte Carlo sampling algorithms and for analyzing web-scale random surfer models such as PageRank.
Chemistry and physics. Hückel molecular orbital theory computes bonding/antibonding energy levels of conjugated hydrocarbons as eigenvalues of the molecule's adjacency matrix, an early and direct physical application predating much of the graph-theoretic formalization.
Cryptography and coding theory. Strongly regular graphs and their prescribed eigenvalue structure underlie constructions of optimal error-correcting codes and combinatorial designs, connecting spectral graph theory to algebraic coding theory.
Network science and robustness. Algebraic connectivity is used as a quantitative robustness measure for communication and power networks: a larger signals that more edges must be removed to disconnect the network, informing infrastructure design against targeted or random failures.
Ask the tutor: How does the algebraic connectivity relate quantitatively to the edge-connectivity and vertex-connectivity of a graph?
Let be a finite, simple, undirected graph with and . (Simple means no loops and no multiple edges; the theory extends to multigraphs, but we fix this setting throughout.)
Adjacency matrix. The adjacency matrix is defined entrywise by
Since is simple and undirected, for all and , so is a real symmetric matrix with zero diagonal.
Degree matrix. is the diagonal matrix with .
Laplacian matrix. The (combinatorial) Laplacian is
Equivalently, fixing an arbitrary orientation of each edge , let have in coordinate , in coordinate , and elsewhere, and let be the matrix with columns (the incidence matrix). Then
This second formula is independent of the chosen orientation, since flipping an orientation negates a column of , leaving unchanged. The spectrum of (respectively ) is its multiset of eigenvalues, always listed with algebraic multiplicity. Because and are real symmetric matrices, all their eigenvalues are real (this follows from the Spectral Theorem), and we adopt the convention of ordering the Laplacian spectrum as
Intuition
Think of the adjacency matrix as an operator that moves mass along edges: if assigns a value to vertex , then is the sum of over the neighbors of . Iterating counts walks: the entry equals the number of walks of length from to . This is why the adjacency spectrum controls global counting statistics such as the number of closed walks (the trace of ) and, via the Matrix-Tree Theorem and companion identities, other enumerative invariants. The Laplacian has a complementary, more geometric role: it measures disagreement across edges. For ,
a sum of squared differences across every edge (we prove this identity below). This quadratic form is visibly , and it is exactly when is constant on each connected component — capturing connectivity as an algebraic condition. This is the reason , the smallest nonzero possible Laplacian eigenvalue, serves as a connectivity gauge: making small means you can find a nonconstant that changes very little across most edges, i.e., the graph can be almost split into two loosely connected pieces (a small "cut").
Central theorems
Let be a finite simple graph on vertices with Laplacian , and let be its eigenvalues. Then: 1. (Quadratic form identity.) For every ,
2. (Positive semidefiniteness.) is symmetric positive semidefinite; hence all its eigenvalues are real and nonnegative, i.e. . 3. (Kernel = constants on components.) The all-ones vector satisfies . More precisely, the nullspace (kernel) of is exactly the space of vectors that are constant on each connected component of . 4. (Multiplicity of counts components.) The multiplicity of the eigenvalue in the spectrum of equals the number of connected components of . In particular, is connected iff .
We prove each part in turn, using only the definitions above and basic linear algebra (real symmetric matrices, quadratic forms, and dimension counting for kernels).
Part 1 (quadratic form identity). Recall where is the incidence matrix with one column per edge (with an arbitrarily fixed orientation, say at , at ). Then for any ,
The vector has, in the coordinate indexed by edge (oriented ), the entry
since column has a in row , a in row , and elsewhere. Squaring and summing over all edges gives
which is exactly the claimed identity. (Note the right-hand side does not depend on the choice of orientation, since ; this is consistent with our earlier remark that itself is orientation-independent.)
Part 2 (positive semidefiniteness). is symmetric because (or directly, is symmetric since is diagonal and is symmetric). By Part 1, for every ,
a sum of squares, so is positive semidefinite. By the Spectral Theorem, a real symmetric matrix can be written with orthogonal and real. If is a unit eigenvector for eigenvalue , then by positive semidefiniteness. Hence every eigenvalue of is , justifying the ordering (we will show is actually attained in Part 3).
Part 3 (kernel characterization). First, . The -th entry of is , and the -th entry of is as well (the row sums of equal the vertex degrees, by definition of ). So for every , i.e. . This proves , so is indeed an eigenvalue (justifying ). More generally, suppose . Since is positive semidefinite and , Part 1 gives
A sum of squares is zero iff every term is zero, so for every edge . Since two vertices in the same connected component are joined by a path, and is constant across each edge of that path, is constant on each connected component. This shows . Conversely, if is constant on each component, then for every edge the endpoints lie in the same component (edges only join vertices within a component), so , hence every term of the sum in Part 1 vanishes and . Since is symmetric positive semidefinite, implies : writing and , we get with all , forcing whenever , so has for all (either because or because ); hence and . This shows the reverse inclusion. Combining both inclusions:
Part 4 (multiplicity of ). Let be the number of connected components of . By Part 3, consists exactly of vectors constant on each ; such a vector is determined by the constants it takes on , so the indicator vectors (each on and elsewhere) form a basis of : they are linearly independent (disjoint supports) and every constant-on-components vector is a linear combination . Hence
Because is symmetric and thus diagonalizable (again by the Spectral Theorem), the geometric multiplicity of every eigenvalue equals its algebraic multiplicity. In particular the algebraic multiplicity of the eigenvalue equals . Finally, since eigenvalues are listed in nondecreasing order , the multiplicity of being means (with the convention nonexistent if , i.e. no edges). In particular (connectedness) holds iff , i.e. iff only equals .
∎is connected if and only if . The quantity is called the algebraic connectivity of (sometimes denoted ), and it is precisely when is disconnected.
Immediate from Part 4 above: connected means , i.e. multiplicity of eigenvalue is exactly , i.e. . Conversely if then the multiplicity of is so , i.e. is connected.
∎Let be a connected finite simple graph with adjacency matrix , and let be its eigenvalues. Then is bipartite if and only if the spectrum of is symmetric about , i.e. for all (equivalently: is an eigenvalue with multiplicity iff is, with the same multiplicity ).
() Suppose is bipartite with parts (, every edge joining to ). Order the vertices with all of first, then ; in this ordering has block form
for some matrix , because there are no edges within or within . Let , a diagonal orthogonal matrix (). Compute
So and are similar matrices (), hence they have the same characteristic polynomial:
more directly: similar matrices have identical eigenvalues with identical multiplicities, since . Thus the characteristic polynomial of equals that of . If is an eigenvalue of with multiplicity , then is a root of multiplicity of , hence of , i.e. is a root of multiplicity of evaluated appropriately — concretely, means the polynomial satisfies (using by definition of ). So for all , which means is a root of of multiplicity iff is a root of of multiplicity . Applying this with : multiplicity of equals multiplicity of . Since this holds for every eigenvalue, the full spectrum is symmetric under negation, which is precisely the claim .
() Suppose the spectrum of is symmetric about . We must show is bipartite; we argue by contradiction using the trace of odd powers of . Recall the standard walk-counting fact: for every ,
This is proved by induction on directly from matrix multiplication: number of closed walks of length (no loops, consistent), and , which counts walks of length from to a neighbor of , extended by the edge back... more precisely one shows generally counts walks of length from to by induction on , and specializing gives the claim. Now suppose, for contradiction, that is not bipartite. Since is connected, by the standard characterization of bipartiteness (a connected graph is bipartite iff it has no odd cycle) contains an odd cycle, say of length , on some vertex set including ; traversing this cycle from around and back gives a closed walk of length starting and ending at . Hence for some , and therefore
On the other hand, the trace of is the sum of the -th powers of the eigenvalues:
(This uses with orthogonal, so and trace is similarity-invariant: .) But by hypothesis the spectrum is symmetric about : pairing with (multiplicities matching exactly as required by ), every term in the sum is cancelled by a corresponding term from its partner eigenvalue (odd powers negate under sign flip), so
This contradicts . Hence our assumption was false, and must be bipartite.
∎Worked examples
Example 1: the "paw" graph (asymmetric, non-regular). Let have vertex set and edges — a triangle on with a pendant edge to attached at vertex . This graph is deliberately irregular (degrees ) and not bipartite, to avoid any hidden symmetry. Adjacency matrix.
Its characteristic polynomial is computed by expanding :
Expanding along the last row: entries are , so
with appropriate cofactor signs. Concretely, expand along row 4: the term for column 3 (entry ) has cofactor sign , and its minor is . Expanding this minor along its last column gives . So this term contributes . The term for column 4 (entry ) has cofactor sign , and its minor is . This is the characteristic polynomial (in -style) of the triangle 's adjacency structure; direct expansion:
So this term contributes . Adding both contributions:
So the characteristic polynomial is . As a check, the sum of eigenvalues equals , consistent with the coefficient of being . Also 's constant term relation: , and indeed matches the constant term of up to sign convention , ; direct computation of (expanding row 4: only entry contributes, cofactor ; that determinant expands to , so contribution is ) gives . Matches. Numerically solving gives four real roots approximately
(sum , consistent with trace ; not symmetric about , consistent with not bipartite, since it contains the triangle ). Laplacian matrix. Degrees are , so
We know with eigenvector (check: row 1 gives ; row 3 gives ; row 4 gives — confirmed). Since is connected (visibly: ––– all reachable), Theorem [Basic spectral facts about the Laplacian] guarantees . The characteristic polynomial of is ; using and known , plus the Matrix-Tree relation below, we can get the remaining eigenvalues without full expansion. By the Matrix-Tree Theorem, the number of spanning trees equals any cofactor of , and also equals
Direct combinatorial count of spanning trees of the paw graph: we need spanning trees of a -vertex graph with edges ; a spanning tree has edges, and removing any one edge from a graph with exactly one cycle (the triangle ) and one bridge () gives a spanning tree iff we don't disconnect it: the bridge must always be kept (removing it disconnects vertex ), and we must remove exactly one edge of the triangle to kill the cycle while keeping connectivity — all choices work. So . Then , and . Numerically solving the cubic factor of (degree-3 factor with sum , and product ) alongside the sum of pairwise products (which equals the coefficient data from 's coefficient) gives approximately
(product — to present a fully honest computation we instead solve numerically: the characteristic polynomial of is ; factoring out the known root of the cubic — check , so is not a root; instead solve numerically, giving roots approximately , with product ). Given the arithmetic subtlety, we verify directly is trustworthy (elementary counting above), and we report the Laplacian spectrum as
rounded to three decimals (these satisfy sum and product of nonzero ones , and ; the small residual discrepancy is rounding — exact roots of are irrational and the exact product of all three roots is by Vieta, not ; since should equal by Matrix-Tree, and Vieta's product of the cubic's roots is , this signals we must double check : reconsider — the paw graph actually has spanning trees counted as follows: total spanning trees of a graph with one triangle and one pendant edge is (number of spanning trees of triangle, which is ) times (forced inclusion of bridge, way) ; Vieta says product of roots of is (constant term with sign ), and Matrix–Tree states hence . Re-examining the combinatorics: a spanning tree needs edges out of the present; removing one edge from each gives a spanning tree ( trees), and removing the edge disconnects vertex , giving additional trees — so indeed , not . This exposes an arithmetic error in deriving the characteristic polynomial of above, not in the combinatorics.) Rather than let a shaky quartic expansion stand, we settle this example by trusting the two independently reliable facts — by direct, elementary enumeration, and by direct entrywise summation of degrees — and we present the Laplacian spectrum via consistency: , , . Solving numerically the correctly-normalized cubic for the true middle coefficient (obtainable as the sum of principal-minor-type Laplacian data, namely over unordered pairs among , which equals half of restricted to nonzero eigenvalues) requires . Computing directly from the matrix: rows contribute . So , and . So the genuine cubic is , which factors as — checking: , times : . ✓. Roots , product ✓, sum ✓. So the corrected, verified Laplacian spectrum of the paw graph is
This matches , agreeing with the direct count. (Lesson embedded in this example: always cross-check a spectral computation against an independent combinatorial invariant such as or .)
Example 2: a graph on vertices with a cut vertex (checking and disconnection sensitivity). Let be the "bull-minus" graph: vertices , edges — again a triangle with a path –– hanging off it. Degrees: .
is connected (it's a tree plus one extra edge closing the triangle), so by the theorem is guaranteed without further computation — this alone certifies connectivity spectrally. To also illustrate the sensitivity of , consider deleting edge (the bridge connecting the triangle to the tail): the resulting graph has two components, (a triangle) and (an edge), so by Part 4 of the theorem the multiplicity of eigenvalue jumps from to , i.e. exactly. This shows explicitly how removing the single bridge edge collapses from a strictly positive value to zero — the qualitative content of algebraic connectivity as a "how many bridges stand between you and disconnection" gauge. We compute directly: the only cycle in is the triangle ; edges are bridges and must be kept in every spanning tree. As in Example 1, we get to choose which of the triangle edges to delete, giving . By Matrix-Tree, , and .
Counterexample
The theorem " is bipartite iff is symmetric about " was stated for connected . Drop connectedness and the forward direction can fail to be meaningfully testable, but more importantly the intended equivalence can produce a false impression if one is careless about how disconnected spectra combine. Consider
is bipartite; is not; so itself is not bipartite (it contains a triangle, an odd cycle). The adjacency spectrum of a disjoint union is the multiset union of the two spectra. For : eigenvalues (symmetric about ). For : eigenvalues (not symmetric about , since it contains a lone with no matching ). The union spectrum is , which is not symmetric about (there is no eigenvalue to pair with ). In this instance the asymmetry correctly flags non-bipartiteness, so no contradiction arises yet — but the point of the connectivity hypothesis is deeper: the proof of the reverse direction crucially used that has a single odd cycle whose closed walk forces , and that connectedness lets us invoke "connected + no odd cycle bipartite." Consider instead
two disjoint edges. Each contributes spectrum , so , symmetric about , and indeed is bipartite (each component is). This case is consistent. But now examine
(a triangle disjoint union a star , whose spectrum is , symmetric about , since a bipartite graph's adjacency spectrum is always symmetric — a fact provable the same way as the connected case, via the same permutation-similarity argument, without needing connectivity for the forward direction). 's spectrum is asymmetric. The union spectrum is asymmetric overall (the lone has no partner), correctly flagging that , containing a triangle, is not bipartite. The genuine failure mode surfaces when a non-bipartite disconnected graph happens to have components whose asymmetries algebraically cancel, producing a symmetric union spectrum despite the graph not being bipartite. This can indeed occur: take where we search for a graph whose spectrum is the negation of 's multiset , namely . No simple graph on vertices has this spectrum (the trace of the adjacency matrix is always , but ✓ trace works; however realizing requires a graph with , giving , i.e. the triangle itself — but the triangle's spectrum is , not ; no simple graph on vertices realizes ). This illustrates that constructing an explicit cancelling counterexample takes real work — precisely because the forward direction of the theorem ("bipartite symmetric spectrum") holds unconditionally, even without connectedness, by the same similarity-transform argument applied to each component separately, or to the whole disconnected graph at once (partition into a global bipartition, which exists iff every component is bipartite). What breaks without connectedness is only the converse's clean contrapositive proof strategy (using a single odd cycle and its trace contribution): for a disconnected non-bipartite graph, one must argue componentwise rather than using one global odd-cycle trace argument, and the theorem's proof as given genuinely requires connectedness to identify " has an odd cycle" with a nonzero trace-of-odd-power argument applied to the whole graph cleanly. In fact the theorem's converse remains true without connectedness (apply it to each connected component: the whole spectrum is symmetric iff each component's is, since the spectrum of a disjoint union is the union of spectra and one shows separately that symmetry of the total multiset need not force symmetry of each summand — so the componentwise argument needs additional care), which is exactly why we stated the theorem only for connected graphs: the proof technique demonstrated relies essentialy on connectivity to license the odd-cycle-existence step, even though the conclusion has a more delicate extension to the disconnected case that is beyond this article's scope.
Scope, edge cases & common traps
| Situation | What happens | Common mistake |
|---|---|---|
| has isolated vertices | Each isolated vertex contributes an extra to and a row/column of zeros to | Forgetting isolated vertices inflate the multiplicity of beyond "number of nontrivial components" |
| disconnected, components | has with multiplicity exactly ; is the union of component spectra | Assuming pins down which two vertices are disconnected — it only certifies disconnection, not location |
| bipartite but disconnected | Adjacency spectrum is still symmetric (forward direction holds regardless of connectivity) | Believing the converse also needs no connectivity — the given proof genuinely uses it |
| Multigraphs / weighted graphs | still positive semidefinite with the same quadratic-form proof, using edge weights | Applying unweighted spanning-tree counts (Matrix-Tree) without inserting the weights |
| Regular graphs (-regular) | , a clean linear relation | Assuming this shift formula holds for non-regular graphs — it does not, since is no longer a multiple of |
The mathematician behind it
Origins · 1 minGustav Kirchhoff and how this was discovered
Kirchhoff is best known to physicists for his circuit laws, but his 1847 paper on electrical networks introduced exactly the matrix (in effect) to compute resistances and count spanning configurations in a network — the origin of the Matrix-Tree Theorem and, retrospectively, the graph Laplacian. His approach to circuits as graphs, with currents and voltages satisfying linear equations governed by this matrix, anticipated by more than a century the modern spectral graph theory built on Kirchhoff's matrix.
Why is the Laplacian more useful than the adjacency matrix for connectivity questions?
The Laplacian's quadratic form directly measures disagreement across edges, so its kernel captures exactly the vectors that are constant on connected components — a fact with no equally clean adjacency-matrix analogue. This gives an immediate, provable link between and the number of components, and hence between and connectivity. The adjacency matrix instead naturally encodes walk-counting, which is a different (though related) kind of structural information, less directly tied to cut structure and disconnection.
Does a large algebraic connectivity always mean a graph is "highly connected" in the vertex-connectivity sense?
There is a real relationship but not an equivalence: it is a theorem (Fiedler) that , the vertex connectivity, for any non-complete graph, so large does imply a lower bound on how many vertices must be removed to disconnect . However can be much smaller than , and the two quantities capture related but distinct notions — is a continuous, spectral, "average-case cut size" measure, while vertex connectivity is a worst-case combinatorial invariant.
Can two non-isomorphic graphs have the same adjacency spectrum?
Yes — such graphs are called cospectral (or isospectral) graphs, and they exist even among small graphs (the smallest cospectral pairs of simple graphs occur on or vertices depending on which matrix is used). This shows the spectrum does not determine the isomorphism class of a graph in general, in contrast to what one might hope given how much structural information eigenvalues encode; the study of exactly which invariants are or are not "spectrally determined" is an active area building on Graph Isomorphism as a baseline notion of sameness.
Why must the graph be simple (no loops, no multi-edges) for these definitions?
Loops would add nonzero diagonal entries to , and multi-edges would make entries larger than ; both are easy to accommodate by generalizing (loops contribute to the diagonal of by convention, multi-edges give integer entries in ), but the clean identity and its consequences (positive semidefiniteness, component-counting) extend immediately to weighted multigraphs with positive weights by replacing each squared term with . We restrict to simple graphs purely for notational clarity in stating and proving the core theorems.
How does the Matrix-Tree Theorem connect to the Laplacian spectrum?
The (weighted) Matrix-Tree Theorem states that the number of spanning trees of a connected graph on vertices equals any cofactor of , and this cofactor equals , the product of the nonzero Laplacian eigenvalues divided by . This gives a purely spectral formula for spanning tree counts, complementing the determinant-based statement of Cayley's Formula and Matrix-Tree Theorem and providing an independent numerical check on any computed Laplacian spectrum, as used explicitly in the worked examples above.
Is the Laplacian eigenvalue the same as what's called the "spectral gap"?
Usage varies. In the Laplacian setting, (the algebraic connectivity or Fiedler value) is often itself called the spectral gap, since it is the gap between and the rest of the spectrum. In the adjacency-matrix or normalized-Laplacian setting used for expander graphs, "spectral gap" more commonly refers to the gap between the largest eigenvalue and the second-largest, which governs random walk mixing and expansion; both usages measure a version of "how far the graph is from being disconnected or badly connected," but they are defined via different matrices and different ends of the spectrum.
What goes wrong if I try to apply these theorems to directed graphs?
The adjacency matrix of a directed graph need not be symmetric, so the Spectral Theorem no longer applies: eigenvalues can be complex, and there may not be an orthonormal eigenbasis. The Laplacian for directed graphs is typically defined asymmetrically (using out-degrees or in-degrees) and is not positive semidefinite in general, so the component-counting theorem and the quadratic-form identity both fail as stated. Directed spectral graph theory exists but requires substantially different tools (singular values, or symmetrized Laplacians), which is why this article restricts attention to simple undirected graphs.