CS 637: Mathematics-II

Lecture 19: Degree Sequences, Adjacency Spectra, and Reachability

Degree Sequences and Graphicality

Degree Sequence

For a simple graph on \(n\) vertices, the degree sequence is the list of vertex degrees written in nonincreasing order:

\[ d_1 \ge d_2 \ge \cdots \ge d_n. \]

A sequence is called graphical if there exists a simple graph whose vertex degrees are exactly \(d_1,\dots,d_n\).

Immediate Necessary Conditions

  • Each degree satisfies \(0 \le d_i \le n-1\).
  • The sum of the degrees must be even, because \[ \sum_{i=1}^n d_i = 2|E|. \]
  • These conditions are necessary, but by themselves they are not sufficient.

Erdos-Gallai Criterion

A nonincreasing sequence \(d_1,\dots,d_n\) of nonnegative integers is graphical if and only if the sum of the degrees is even and, for every \(1 \le k \le n\),

\[ \sum_{i=1}^k d_i \le k(k-1) + \sum_{i=k+1}^n \min(d_i,k). \]

This criterion gives a complete test, while Havel-Hakimi gives a constructive procedure.

Quick Reality Check

Sequence Graphical? Why
\((3,3,2,2,2,2)\) Yes It survives Havel-Hakimi reductions down to the zero sequence.
\((4,4,1,1,1,1)\) No The two vertices of degree 4 would each need too many neighbors among four degree-1 vertices.

Graph Realization from Degree Sequences

Havel-Hakimi Reduction Rule

Suppose \(d_1 \ge d_2 \ge \cdots \ge d_n\). Then the sequence is graphical if and only if the reduced sequence obtained by deleting \(d_1\) and subtracting 1 from the next \(d_1\) entries is graphical, after reordering into nonincreasing form.

\[ (d_1,d_2,\dots,d_n) \leadsto (d_2-1,d_3-1,\dots,d_{d_1+1}-1,d_{d_1+2},\dots,d_n). \]

Combinatorially, we connect the highest-degree vertex to the next \(d_1\) vertices.

Worked Havel-Hakimi Example

Start with the sequence \((3,3,2,2,2,2)\).

Round Current Sequence Reduction
1 \((3,3,2,2,2,2)\) Remove 3, subtract from next 3 terms: \((2,1,1,2,2)\), then reorder to \((2,2,2,1,1)\)
2 \((2,2,2,1,1)\) Remove 2, subtract from next 2 terms: \((1,1,1,1)\)
3 \((1,1,1,1)\) Reduce to \((1,1,0)\), then to \((0,0)\)

Since the process ends at the zero sequence, the original sequence is graphical.

One Realizing Graph

A concrete realization is obtained by introducing vertices \(v_1,\dots,v_6\) and adding edges

\[ \{v_1v_2, v_1v_3, v_1v_4, v_2v_5, v_2v_6, v_3v_4, v_5v_6\}. \]

The resulting degrees are \((3,3,2,2,2,2)\).

Algorithmic Cost of Realization

If we repeatedly sort after each reduction, Havel-Hakimi gives a straightforward realization algorithm in about \(O(n^2 \log n)\) time. With more careful data structures the bookkeeping can be improved, but the key point is that graph realization is efficiently decidable and constructible.

Basic Spectral Properties of the Adjacency Matrix

Adjacency Matrix and Spectrum

For \(V=\{v_1,\dots,v_n\}\), the adjacency matrix \(A\) is defined by

\[ A_{ij} = \begin{cases} 1 & \text{if } \{v_i,v_j\}\in E,\\ 0 & \text{otherwise.} \end{cases} \]

Its eigenvalues are called the adjacency spectrum of the graph.

Symmetry Gives Real Eigenvalues

For a simple undirected graph, \(A=A^T\). Therefore:

  • all eigenvalues of \(A\) are real,
  • \(A\) has an orthonormal basis of eigenvectors,
  • there is an eigendecomposition \[ A = Q \Lambda Q^T. \]

This is the spectral reason linear algebra interacts so nicely with undirected graphs.

Three Fast Spectral Identities

\[ \sum_{i=1}^n \lambda_i = \operatorname{tr}(A) = 0, \qquad \sum_{i=1}^n \lambda_i^2 = \operatorname{tr}(A^2) = 2|E|. \]

If \(G\) is \(d\)-regular, then

\[ A\mathbf{1} = d\mathbf{1}, \]

so \(d\) is an eigenvalue of \(A\) with eigenvector \(\mathbf{1}\).

Spectral Radius and Degree

If \(\Delta\) is the maximum degree, then the spectral radius satisfies

\[ \rho(A) \le \Delta. \]

For regular graphs, equality is immediate because the degree itself is an eigenvalue.

Small Examples

Graph Adjacency Eigenvalues Comment
\(P_2\) \(1,-1\) Symmetric around 0 and \(\lambda_1^2+\lambda_2^2=2=2|E|\)
\(K_3\) \(2,-1,-1\) The graph is 2-regular, so 2 appears as an eigenvalue
\(C_4\) \(2,0,0,-2\) Again, the sum is 0 and the sum of squares is 8

Undirected Reachability and Its Algorithmic Cost

Reachability Problem

Given an undirected graph \(G\) and two vertices \(s\) and \(t\), determine whether there is a path from \(s\) to \(t\).

\[ s \leadsto t \quad \Longleftrightarrow \quad s \text{ and } t \text{ lie in the same connected component.} \]

Walk Counting via Powers of \(A\)

The \((u,v)\)-entry of \(A^k\) counts the number of walks of length \(k\) from \(u\) to \(v\). Hence \(u\) reaches \(v\) if and only if there exists some \(0 \le k \le n-1\) with

\[ (A^k)_{uv} > 0. \]

Equivalently, if

\[ R = I + A + A^2 + \cdots + A^{n-1}, \]

then \(u\) reaches \(v\) exactly when \(R_{uv} > 0\).

Spectral Viewpoint on Walks

Since \(A\) is symmetric, we can write \(A = Q \Lambda Q^T\). Therefore

\[ A^k = Q \Lambda^k Q^T. \]

This means the growth of walk counts is governed by the eigenvalues of \(A\). Spectral information is very useful for understanding global structure, but it is not the cheapest way to answer a plain reachability query.

Cost Comparison

Method Input Model Goal Typical Cost
BFS or DFS Adjacency list One-source or one-pair reachability \(O(n+m)\)
BFS or DFS Adjacency matrix One-source or one-pair reachability \(O(n^2)\)
Repeated matrix powers Dense matrix algebra Reachability through walk counts Naively \(O(n^4)\)
Transitive closure / dense matrix methods Matrix-based All-pairs reachability Usually \(O(n^3)\) or better with fast matrix multiplication
Full spectral decomposition Symmetric matrix Global spectral analysis About \(O(n^3)\) preprocessing

Algorithmic Moral

For undirected reachability, the right algorithmic primitive is graph search. Spectral properties of the adjacency matrix explain walk structure and support deeper analysis, but BFS or DFS is asymptotically and conceptually simpler for deciding whether \(s\) can reach \(t\).

A Connectivity Remark

When one studies connectivity spectrally, the Laplacian \(L=D-A\) is often more convenient than the adjacency matrix. Reachability itself, however, is still most efficiently handled by traversing the graph.

What to Remember

From Degrees to Graphs

  • A degree sequence is graphical if it can be realized by a simple graph.
  • Erdos-Gallai gives a complete test.
  • Havel-Hakimi gives a constructive reduction and often an explicit realization.

From Graphs to Linear Algebra

  • For undirected graphs, the adjacency matrix is symmetric.
  • Therefore all adjacency eigenvalues are real.
  • Trace identities connect eigenvalues back to edge counts.

One-Lecture Summary

  1. Degree sequences tell us which local degree patterns are globally realizable.
  2. The adjacency spectrum packages structural information into eigenvalues and eigenvectors.
  3. Powers of the adjacency matrix encode walks, which ties spectral ideas to reachability.
  4. Even so, for plain undirected reachability, BFS or DFS remains the preferred algorithm.

Suggested Follow-Up Questions

  • How does the Laplacian spectrum detect connected components?
  • What changes when the graph is directed rather than undirected?
  • How do spectral gaps relate to expansion and random walks?
🏠