Petersen graph
Double-click empty space to add a vertex · edge mode: drag between vertices (again for a parallel edge), click a vertex for a loop · right-click deletes one edge / loop / vertex · deletes the selection · Esc deselects

Graph Spectra

Draw a graph or pick a preset; the adjacency matrix and its eigendata update live. Click an eigenvalue to paint its eigenvector on the graph.

Presets
Graph
Import / export edge list
Matrix
Click a cell to add an edge (diagonal = loop), shift- or right-click to remove one. Hover to highlight it on the drawing. Drag the panel's left edge to widen it and the matrix box's bottom-right corner to make it taller; the whole matrix.
Copy as
Eigendata
λexact?multcert.eigenvectors
About

Eigenvalues are computed with the cyclic Jacobi method (the matrices here are all real symmetric), then grouped into eigenspaces at a tolerance of 10−7. Each eigenvalue is tested against small closed forms — integers, rationals, quadratic surds (p ± qd)/r, and 2cos(kπ/m) — and shown symbolically when one matches to 10−9. Treat those labels as strong hints, not proofs.

For integer matrices (A, L, Q, Seidel) the characteristic polynomial p is computed exactly over ℤ by the Faddeev–LeVerrier recurrence in BigInt arithmetic (automatically for n ≤ 64, on request up to 120).

Certificates. Each recognized eigenvalue λ yields a candidate minimal polynomial q ∈ ℤ[x]: xr for an integer, x² + bx + c for a quadratic surd (irreducible since the discriminant is not a square), or Ψn, the minimal polynomial of 2cos(2π/n), computed exactly from the cyclotomic polynomial Φn(x) = xφ(n)/2Ψn(x + 1/x). The exact multiplicity e = max{e : qe | p} is found by repeated exact division; ✓ means e ≥ 1, and ! flags a disagreement between e and the numerically observed multiplicity (trust e). When the product of all certified factors equals p, the spectrum is fully determined as a multiset by pure integer arithmetic — the floating-point eigenvalues only served to guess the factors. Eigenvalues with no recognized closed form get a second pass: those of equal observed multiplicity m are multiplied into a monic polynomial S numerically, rounded to ℤ[x], and Sm | p is checked exactly — on success they are certified (✓*) as roots of the exact factor S, though S is not checked for irreducibility. Anything left over is shown as a bracketed cofactor. For the normalized Laplacian ℒ the same is done through the integer matrix M = lcm(deg)·D−1A, which is similar to lcm(deg)·(I − ℒ), with isolated vertices contributing the factor x directly.

Multigraphs: parallel edges fan out as curves and loops are drawn as circles; Aij is the number of edges between i and j, and each loop adds 1 (or 2, selectable) to the diagonal. Degrees are the row sums of A, so with either convention L = D − A has row sums zero and loops drop out of L entirely; a loop counted once shifts the adjacency spectrum by exactly the loop count when every vertex has the same number of loops. Complement and the presets other than the Multigraphs group work with simple graphs.

Eigenvector painting: vertex fill is red for positive entries and blue for negative, with radius proportional to |entry|; the entries are listed below the table. For a repeated eigenvalue the basis shown is whatever orthonormal basis Jacobi happened to land on.

Keyboard: V move, A add vertex, E add edge, D delete, F fit, S spring layout, C circle layout, 19 jump to the k-th eigenvalue.