Tutorials › Graph Theory (Undergraduate) › The Spectrum of Complete Graphs

Spectra of Graphs · Tutorial 643 of 799

The Spectrum of Complete Graphs

Learn how the all-ones direction and its orthogonal complement give the complete adjacency spectrum, including eigenvalue multiplicities and eigenspaces.

Advanced 8 min read

What You'll Learn

  • Express the adjacency matrix of \(K_n\) using the all-ones matrix and the identity matrix.
  • Decompose any vector into a constant part and a zero-sum part.
  • Derive the eigenvalues, eigenspaces and characteristic polynomial of \(K_n\).
  • Handle the one-vertex case without assigning a spurious eigenvalue.
  • Check spectral calculations using direct matrix action, trace and multiplicity.

Why Complete Graphs Have a Simple Spectrum

In a complete graph, every pair of distinct vertices is adjacent. This uniform structure makes the adjacency matrix especially amenable to calculation: its action on a vector depends only on the sum of that vector's coordinates and on each coordinate itself. Splitting a vector into a constant part and a part whose coordinates sum to zero reveals both eigenspaces directly.

Throughout, \(K_n\) is the simple undirected complete graph on \(n\geq 1\) vertices, labelled \(1,\dots,n\). Its edge set contains every pair \(ij\) with \(1\leq i<j\leq n\). The adjacency matrix \(\mathbf{A}(K_n)\) has entry \(1\) in position \(i,j\) when \(ij\) is an edge and \(0\) otherwise. In particular, its diagonal entries are zero. We study its adjacency spectrum: the eigenvalues of this matrix, counted with their algebraic multiplicities.

Definition: The all-ones vector is \(\mathbf{1}=(1,\dots,1)^\mathsf{T}\in\mathbb{R}^n\). The zero-sum subspace is \(\mathbf{1}^{\perp}=\{x\in\mathbb{R}^n:\sum_{i=1}^n x_i=0\}\). Orthogonality here uses the usual dot product.

The all-ones vector records constant values on the vertices. The zero-sum subspace consists of vectors orthogonal to it. For any \(x=(x_1,\dots,x_n)^\mathsf{T}\), define its coordinate mean \(\bar{x}=(x_1+\cdots+x_n)/n\). Then \(x=\bar{x}\mathbf{1}+y\), where \(y=x-\bar{x}\mathbf{1}\) has coordinate sum zero. Thus every vector splits into a constant component and a zero-sum component. The two parts intersect only in the zero vector: a constant vector \(c\mathbf{1}\) has sum \(nc\), which is zero only when \(c=0\).

The Matrix Action and the Main Result

Let \(\mathbf{J}\) be the \(n\) by \(n\) all-ones matrix and \(\mathbf{I}\) the identity matrix. The complete graph has every off-diagonal adjacency entry equal to \(1\), and every diagonal entry equal to \(0\). Consequently, \(\mathbf{A}(K_n)=\mathbf{J}-\mathbf{I}\). For any vector \(x\), every coordinate of \(\mathbf{J}x\) equals the sum of the coordinates of \(x\), so

$$ \mathbf{A}(K_n)x = \left(\sum_{i=1}^n x_i\right)\mathbf{1}-x. $$

This formula is the key calculation. On a constant vector, the coordinate sum contributes a factor of \(n\); on a zero-sum vector, that contribution vanishes.

Theorem: For \(n\geq 1\), the adjacency spectrum of \(K_n\) consists of \(n-1\), with multiplicity \(1\), and \(-1\), with multiplicity \(n-1\). The eigenspace for \(n-1\) is \(\operatorname{span}\{\mathbf{1}\}\), and the eigenspace for \(-1\) is \(\mathbf{1}^{\perp}\). When \(n=1\), the latter subspace has dimension zero, so \(-1\) is not an eigenvalue.

Proof. First apply the matrix-action formula to \(\mathbf{1}\). Its coordinate sum is \(n\), so \(\mathbf{A}(K_n)\mathbf{1}=n\mathbf{1}-\mathbf{1}=(n-1)\mathbf{1}\). Thus \(n-1\) is an eigenvalue, and every scalar multiple of \(\mathbf{1}\) is in its eigenspace.

Now take \(y\in\mathbf{1}^{\perp}\). Its coordinate sum is zero, so the same formula gives \(\mathbf{A}(K_n)y=-y\). Thus every vector in \(\mathbf{1}^{\perp}\) is an eigenvector for \(-1\), unless it is the zero vector. Conversely, if \(\mathbf{A}(K_n)x=-x\), then the formula implies \((\sum_i x_i)\mathbf{1}-x=-x\), hence \((\sum_i x_i)\mathbf{1}=0\). Since \(\mathbf{1}\neq 0\), the sum of the coordinates of \(x\) is zero. Therefore this eigenspace is exactly \(\mathbf{1}^{\perp}\).

Likewise, if \(\mathbf{A}(K_n)x=(n-1)x\), then \((\sum_i x_i)\mathbf{1}-x=(n-1)x\), or \((\sum_i x_i)\mathbf{1}=nx\). Since \(n\geq1\), this says \(x=(\sum_i x_i/n)\mathbf{1}\); the eigenspace is exactly \(\operatorname{span}\{\mathbf{1}\}\). The constant subspace has dimension \(1\). The zero-sum subspace has dimension \(n-1\), because its vectors are determined freely by their first \(n-1\) coordinates, with the last coordinate forced to be the negative of their sum. These subspaces have zero intersection and their dimensions add to \(n\). Choosing a basis from each therefore gives a basis of \(\mathbb{R}^n\) consisting of eigenvectors. In this basis the matrix is diagonal, with one diagonal entry \(n-1\) and \(n-1\) diagonal entries \(-1\). This proves the stated algebraic multiplicities as well as the eigenspaces. If \(n=1\), the zero-sum subspace has dimension zero; the only eigenvalue is \(n-1=0\). \(\square\)

In particular, the characteristic polynomial, with the convention \(\det(\lambda\mathbf{I}-\mathbf{A})\), is

$$ \det\bigl(\lambda\mathbf{I}-\mathbf{A}(K_n)\bigr) = \bigl(\lambda-(n-1)\bigr)(\lambda+1)^{n-1}. $$

The basis argument in the proof justifies this product: in an eigenvector basis, \(\lambda\mathbf{I}-\mathbf{A}(K_n)\) is diagonal, and its determinant is the product of its diagonal entries. For \(n=1\), the factor \((\lambda+1)^0\) is \(1\), leaving the characteristic polynomial \(\lambda\).

Worked Examples

Worked Example: The Triangle \(K_3\)

Let \(V=\{1,2,3\}\) and \(E=\{12,13,23\}\), so this graph is \(K_3\). Its adjacency matrix and the theorem's eigenvalues are

$$ \mathbf{A}(K_3)= \begin{pmatrix} 0&1&1\\ 1&0&1\\ 1&1&0 \end{pmatrix}, \qquad 2\text{ (multiplicity }1\text{)},\quad -1\text{ (multiplicity }2\text{)}. $$

The eigenspace for \(2\) is spanned by \((1,1,1)^\mathsf{T}\); multiplying the matrix by this vector gives \((2,2,2)^\mathsf{T}=2(1,1,1)^\mathsf{T}\). A basis for the zero-sum subspace is \((1,-1,0)^\mathsf{T}\) and \((1,0,-1)^\mathsf{T}\). Direct multiplication sends these vectors to \((-1,1,0)^\mathsf{T}\) and \((-1,0,1)^\mathsf{T}\), respectively, which are their negatives.

For an additional check on an arbitrary vector, take \(x=(2,0,-1)^\mathsf{T}\). Its mean is \((2+0-1)/3=1/3\), so its constant part is \((1/3,1/3,1/3)^\mathsf{T}\) and its zero-sum part is \((5/3,-1/3,-4/3)^\mathsf{T}\). The decomposition predicts \(\mathbf{A}x=2(1/3,1/3,1/3)^\mathsf{T}-(5/3,-1/3,-4/3)^\mathsf{T}=(-1,1,2)^\mathsf{T}\). Direct row-by-row multiplication gives \((0\cdot2+1\cdot0+1\cdot(-1),\,1\cdot2+0\cdot0+1\cdot(-1),\,1\cdot2+1\cdot0+0\cdot(-1))=(-1,1,2)^\mathsf{T}\), as required.

Check: the characteristic polynomial is \((\lambda-2)(\lambda+1)^2\). The eigenvalues sum to \(2-1-1=0\), matching the matrix trace \(0+0+0=0\).

Worked Example: Four Vertices and Three Independent Zero-Sum Directions

Let \(V=\{1,2,3,4\}\) and \(E=\{12,13,14,23,24,34\}\), the edge set of \(K_4\). The theorem gives eigenvalue \(3\) on the constant vectors and eigenvalue \(-1\) on the three-dimensional zero-sum subspace. One basis for that subspace is

$$ u_1=(1,-1,0,0)^\mathsf{T},\qquad u_2=(1,0,-1,0)^\mathsf{T},\qquad u_3=(1,0,0,-1)^\mathsf{T}. $$

Each vector has coordinate sum \(0\), so the matrix-action formula gives \(\mathbf{A}(K_4)u_i=-u_i\) for each \(i\). The three vectors are linearly independent: in \(a u_1+b u_2+c u_3=0\), the second, third and fourth coordinates are \(-a,-b,-c\), so \(a=b=c=0\). They therefore give all three independent directions in that eigenspace. Also \(\mathbf{A}(K_4)\mathbf{1}=3\mathbf{1}\), since each row has three ones.

For a direct check using a vector that has both components, take \(x=(1,2,0,1)^\mathsf{T}\). The coordinate sum is \(4\), its mean is \(1\), and its zero-sum part is \(y=(0,1,-1,0)^\mathsf{T}\). Thus the formula gives \(\mathbf{A}x=4\mathbf{1}-x=(3,2,4,3)^\mathsf{T}\), equivalently \(3\mathbf{1}-y=(3,2,4,3)^\mathsf{T}\). Directly summing the other three coordinates in each row gives \((2+0+1,\,1+0+1,\,1+2+1,\,1+2+0)=(3,2,4,3)^\mathsf{T}\).

Check: the characteristic polynomial is \((\lambda-3)(\lambda+1)^3\), of degree \(1+3=4\), the matrix order. The eigenvalue sum is \(3-1-1-1=0\), agreeing with the zero diagonal and trace \(0\).

Worked Example: The One-Vertex Complete Graph

Let \(V=\{1\}\) and \(E=\varnothing\). This is \(K_1\), and its adjacency matrix is the \(1\) by \(1\) zero matrix \((0)\). The all-ones vector is \((1)^\mathsf{T}\); the matrix sends it to \((0)^\mathsf{T}=0(1)^\mathsf{T}\), so the sole eigenvalue is \(0=n-1\).

The zero-sum condition on a vector \((x_1)^\mathsf{T}\) is \(x_1=0\), so the zero-sum subspace contains only the zero vector and has dimension \(0=n-1\). There is no nonzero eigenvector with eigenvalue \(-1\). The characteristic polynomial is \(\det((\lambda))=\lambda\), also obtained from \((\lambda-0)(\lambda+1)^0=\lambda\).

Check: the single eigenvalue has multiplicity \(1\), the matrix order, and equals the matrix's only entry. The \(-1\) term in the general formula contributes zero copies, not an additional eigenvalue.

Common Mistakes and Useful Checks

A common error is to infer that the degree of a regular graph is an eigenvalue of multiplicity \(n\). Regularity does show that the all-ones vector is an eigenvector: for \(K_4\), every row sum is \(3\), so \(\mathbf{A}\mathbf{1}=3\mathbf{1}\). But this establishes just one eigenvector direction, not that every vector has eigenvalue \(3\). For example, \(u=(1,-1,0,0)^\mathsf{T}\) has coordinate sum zero, and the complete-graph formula gives \(\mathbf{A}(K_4)u=-u\), not \(3u\). The correct spectrum is \(3\) once and \(-1\) three times.

For \(K_n\) with \(n\geq2\), quick consistency checks are available. The eigenvalue multiplicities must add to \(1+(n-1)=n\), the matrix order. Their sum is \((n-1)+(n-1)(-1)=0\), which agrees with the trace because the adjacency matrix has zero diagonal. These checks can catch an arithmetic or multiplicity error, but the vector decomposition is what proves the spectrum. The \(n=1\) case is covered separately by the same formula: the multiplicities are \(1\) and \(0\), and the only eigenvalue is \(0\).

The split also explains why no other eigenvalues can occur. Every vector is a sum of a constant vector and a zero-sum vector, and the matrix acts on those two subspaces by scalar multiplication. Since those subspaces together span the entire vector space, there is no remaining direction on which a different eigenvalue could appear.

Check Your Understanding

Use the matrix-action formula and the eigenspace description to answer each question.

  1. For \(K_5\), state both eigenvalues, their multiplicities, and the dimensions of their eigenspaces.
  2. Find a basis for the zero-sum eigenspace of \(K_3\), and verify the eigenvalue of each basis vector.
  3. For \(K_4\) and \(x=(0,1,2,1)^\mathsf{T}\), find the coordinate mean and zero-sum component, then compute \(\mathbf{A}(K_4)x\) in two ways.
  4. Explain why the one-vertex graph has no eigenvalue \(-1\), even though \(-1\) appears in the general spectrum formula.
  5. For \(n\geq2\), use the multiplicities to check the degree and the sum of the adjacency eigenvalues of \(K_n\).