An interactive notebook
Spectral Graph Explorer
How does a collection of edges become a rate of agreement? Build a graph, give its vertices a signal, and follow the connection through its Laplacian.
- Edges · m
- 8
- Components
- 1
- Connectivity · λ₂
- 0.5858
Color shows eigenmode 2, relative to its mean.
Choose two vertices to add or remove their edge.
The spectrum of L
Each bar is an eigenvalue. Choose one to see an associated eigenvector on the graph.
The number of zero eigenvalues is the number of connected components. λ₂ is positive exactly when the graph is connected.
Eigenvector signs are arbitrary. Repeated eigenvalues admit many valid eigenvector bases; the displayed vector is one choice, not a canonical partition.
Inspect the Laplacian matrix L = D − A
| L | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| 1 | 2 | -1 | 0 | 0 | 0 | 0 | 0 | -1 |
| 2 | -1 | 2 | -1 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | -1 | 2 | -1 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | -1 | 2 | -1 | 0 | 0 | 0 |
| 5 | 0 | 0 | 0 | -1 | 2 | -1 | 0 | 0 |
| 6 | 0 | 0 | 0 | 0 | -1 | 2 | -1 | 0 |
| 7 | 0 | 0 | 0 | 0 | 0 | -1 | 2 | -1 |
| 8 | -1 | 0 | 0 | 0 | 0 | 0 | -1 | 2 |
Simple, undirected, unweighted graphs. Values are numerical approximations, rounded for display. Editing evaluates the chosen graph; it does not certify a global optimum.
Behind the controls
One graph, three descriptions
The graph records who interacts. Its quadratic form measures disagreement. Its eigenvalues tell us how fast different patterns of disagreement disappear.
From edges to eigenvalues
For a simple, undirected, unweighted graph, is the adjacency matrix and records vertex degrees. The second-smallest eigenvalue of is its algebraic connectivity. It is positive exactly when the graph is connected.
Classical spectral graph theory; Fiedler (1973).
A signal measures disagreement across edges
Assign a real value to each vertex. An edge contributes more energy when its endpoints disagree. Subtracting the mean leaves every edge difference unchanged; write .
Proof / derivation
Expand each squared edge difference and collect the terms at each vertex. The diagonal terms give and the cross terms give .
Choose an orthonormal eigenbasis with . A centered signal has no component, so its Rayleigh quotient is a weighted average of the remaining eigenvalues. This also works for a disconnected graph, where more zero eigenvalues occur.
Every nonconstant signal, after centering, gives an upper bound on the current graph's λ₂. It does not certify optimality among graphs.
The slowest mode controls diffusion
Let every edge exchange signal at unit rate. The global mean stays fixed. For a connected graph, disagreement with that mean decays at least as fast as the envelope below; starting in a eigenmode attains it.
Proof / derivation
Since , the mean is constant. Diagonalizing turns the differential equation into independent scalar decays. Every nonconstant mode of a connected graph has eigenvalue at least ; squaring its coefficient and summing proves the bound.
For a disconnected graph, each component keeps its own average. The same inequality holds with , but it no longer guarantees convergence to a single global value.
An elementary consequence of the spectral decomposition. Time is dimensionless in this explorer.
A connection to the project
An extremal example you can inspect
The complete bipartite preset joins each of two vertices to all the others. Its spectrum, counted with multiplicity, is
The public theorem proves that no simple graph on the same number of vertices and exactly edges has algebraic connectivity greater than 2. This makes a maximizer; it does not establish uniqueness. The numerical explorer lets you inspect this example, while the paper supplies the proof.
Read about the theorem study →Constructions & connections
Build a graph from smaller pieces
Cartesian products combine graphs; Cayley graphs turn group operations into edges. Hypercubes connect the two constructions. Their spectra make these relationships explicit.
Definitions and spectral formulas
Cartesian products add spectra
The vertices of are pairs . An edge changes exactly one coordinate along an edge of its factor. For simple, undirected graphs, the Laplacian is a Kronecker sum. Products of paths give grids; products of cycles give discrete tori.
Proof / derivation
If and , then is a product eigenvector with eigenvalue . These tensor products form a basis.
When both factors are connected and each has at least two vertices, the first positive sum is . Thus the slower factor determines the product's algebraic connectivity.
Fiedler (1973), property 3.4. Pairwise sums must be sorted to obtain the ordered spectrum.
Cyclic Cayley graphs turn symmetry into Fourier modes
On with , choose excluding zero and connect to modulo . The controls add both signs of each step, counting the half-turn once. This is the cyclic subfamily; Cayley graphs also exist on other groups.
Proof / derivation
Translation multiplies by a phase, giving adjacency eigenvalue . Subtract from degree and pair inverses to obtain the formula. These characters are one-dimensional group representations.
Paths reach the subgroup generated by . For nonempty , there are components: the graph is connected when this is 1. An empty set gives isolated vertices.
Godsil, Duality, §3.2. Frequencies k are not sorted; the explorer orders eigenvalues numerically.
The hypercube belongs to both constructions
For , the graph joins binary strings differing in one bit. It is both a Cartesian product of copies of and a Cayley graph on , using the coordinate vectors as steps.
Proof / derivation
Each factor contributes either 0 or 2 to a product eigenvalue. Choosing the nonconstant mode in exactly coordinates gives , in ways.
Equivalently, the characters are eigenvectors with eigenvalue , where counts the nonzero bits of . This identifies the product eigenbasis with the group characters.
Elementary product-spectrum consequence; see Pirazzini's Yale notes (2025), Example 6 and Theorem 8, for the Cayley interpretation.
Reading & interpretation
The graph editor uses simple, undirected, unweighted graphs. Values are computed numerically for the graph on screen; the tool does not search for a globally optimal graph. An eigenvector can change sign, and a repeated eigenvalue has many valid choices of eigenbasis. The colors therefore illustrate one choice of mode, rather than a unique partition.
- Miroslav Fiedler, Algebraic connectivity of graphs (1973) — classical definitions and variational properties.
- Zhu, Li, Ren & Liu, arXiv:2608.07360v2 — the public extremal theorem, including the bipartite spectrum.