Tutorials › Linear Algebra › Graph Laplacian Smoothing for Noisy Measurements

Applications in Networks, Economics and Data · Tutorial 965 of 1000

Graph Laplacian Smoothing for Noisy Measurements

Learn how a Laplacian penalty balances fidelity to noisy measurements against similarity between neighboring network values.

Intermediate 9 min read

What You'll Learn

  • Define a weighted graph Laplacian and express its quadratic penalty as a sum of squared edge differences.
  • Formulate graph smoothing as minimizing data discrepancy plus a nonnegative Laplacian penalty.
  • Derive and justify the unique linear-system solution for the smoothed measurements.
  • Compute smoothed values exactly on two-node and three-node networks.
  • Explain what the smoothing guarantee says about total edge differences—and what it does not say about each edge.

Why Smooth Measurements on a Network?

Suppose a measurement is recorded at each node of a network. Two nodes joined by an edge may represent locations, devices, or groups expected to have related values. If the observations are noisy, using them unchanged can leave neighboring nodes with sharply different readings. Graph Laplacian smoothing balances two aims: stay reasonably close to the observations, while discouraging large differences across edges.

We work with a finite undirected graph on \(n\) nodes and nonnegative edge weights. A weight \(w_{ij}=w_{ji}\ge 0\) records the strength of the connection between nodes \(i\) and \(j\); a zero weight means there is no edge. Let \(\mathbf{y}\in\mathbb{R}^n\) be the observed measurements and \(\mathbf{x}\in\mathbb{R}^n\) the values to estimate. Both are columns, with one entry per node. We use the ordinary squared-error discrepancy \(\|\mathbf{x}-\mathbf{y}\|^2\), so all nodes have equal weight in this tutorial.

Definition: The weighted degree of node \(i\) is \(d_i=\sum_{j=1}^n w_{ij}\). The degree matrix is the diagonal matrix \(\mathbf{D}\) with entries \(d_i\), the weight matrix is \(\mathbf{W}=(w_{ij})\), and the graph Laplacian is \(\mathbf{L}=\mathbf{D}-\mathbf{W}\). For a tuning parameter \(\lambda\ge 0\), graph Laplacian smoothing minimizes $$ J(\mathbf{x})=\|\mathbf{x}-\mathbf{y}\|^2+\lambda\,\mathbf{x}^{\top}\mathbf{L}\mathbf{x}. $$ The first term is the data discrepancy; the second penalizes differences between connected nodes.

The parameter \(\lambda\) controls the tradeoff. At \(\lambda=0\), minimizing \(J\) returns the observations themselves. Increasing \(\lambda\) places more weight on agreement across edges. The case \(\lambda<0\) is excluded: it would reward, rather than penalize, a large Laplacian quadratic term.

What the Laplacian Penalty Measures

The definition of \(\mathbf{L}\) gives a useful identity. In the edge sum below, each unordered pair of distinct nodes is counted once; pairs with \(w_{ij}=0\) contribute nothing.

Identity: For every \(\mathbf{x}\in\mathbb{R}^n\), $$ \mathbf{x}^{\top}\mathbf{L}\mathbf{x} =\sum_{1\le i<j\le n} w_{ij}(x_i-x_j)^2. $$

Proof. Since \(\mathbf{L}=\mathbf{D}-\mathbf{W}\), the quadratic form is \(\mathbf{x}^{\top}\mathbf{D}\mathbf{x}-\mathbf{x}^{\top}\mathbf{W}\mathbf{x} =\sum_i d_i x_i^2-\sum_{i,j}w_{ij}x_ix_j\). Substituting \(d_i=\sum_j w_{ij}\), using \(w_{ii}=0\), and pairing the terms indexed by \((i,j)\) and \((j,i)\) gives \(\sum_{i<j}(w_{ij}x_i^2+w_{ij}x_j^2-2w_{ij}x_ix_j)\). Each summand is \(w_{ij}(x_i-x_j)^2\), proving the identity. \(\square\)

Every weight and every squared difference in this sum is nonnegative. Thus \(\mathbf{x}^{\top}\mathbf{L}\mathbf{x}\ge 0\), and the penalty is small when strongly connected nodes have similar estimated values. If a graph has several disconnected parts, there is no penalty connecting different parts: only pairs with positive edge weight appear in the sum.

Deriving the Smoothing System

The quadratic objective can be written in matrix form as \(J(\mathbf{x})=\mathbf{x}^{\top}(\mathbf{I}_n+\lambda\mathbf{L})\mathbf{x}-2\mathbf{y}^{\top}\mathbf{x}+\mathbf{y}^{\top}\mathbf{y}\). The Laplacian is symmetric, so \(\mathbf{I}_n+\lambda\mathbf{L}\) is symmetric as well. The identity above also shows that for any nonzero \(\mathbf{z}\), \(\mathbf{z}^{\top}(\mathbf{I}_n+\lambda\mathbf{L})\mathbf{z} =\|\mathbf{z}\|^2+\lambda\mathbf{z}^{\top}\mathbf{L}\mathbf{z}>0\). A symmetric matrix with this property is called positive definite.

Theorem (Unique smoothed estimate): For a finite undirected graph with nonnegative weights and any \(\lambda\ge 0\), the objective \(J\) has a unique minimizer. It is the solution of $$ (\mathbf{I}_n+\lambda\mathbf{L})\mathbf{x}=\mathbf{y}, \qquad\text{so}\qquad \mathbf{x}=(\mathbf{I}_n+\lambda\mathbf{L})^{-1}\mathbf{y}. $$

Proof. Write \(\mathbf{A}=\mathbf{I}_n+\lambda\mathbf{L}\). The positivity established above implies that \(\mathbf{A}\mathbf{z}=\mathbf{0}\) forces \(\mathbf{z}=\mathbf{0}\): multiplying by \(\mathbf{z}^{\top}\) gives \(\mathbf{z}^{\top}\mathbf{A}\mathbf{z}=0\), which is possible only for \(\mathbf{z}=\mathbf{0}\). Thus the square matrix \(\mathbf{A}\) has trivial null space. By the Invertible Matrix Theorem, it is invertible, so there is a unique \(\mathbf{x}_*=\mathbf{A}^{-1}\mathbf{y}\) satisfying \(\mathbf{A}\mathbf{x}_*=\mathbf{y}\).

For any other candidate \(\mathbf{x}=\mathbf{x}_*+\mathbf{h}\), expand the objective using symmetry of \(\mathbf{A}\): \(J(\mathbf{x})=J(\mathbf{x}_*)+2\mathbf{h}^{\top}(\mathbf{A}\mathbf{x}_*-\mathbf{y})+\mathbf{h}^{\top}\mathbf{A}\mathbf{h}\). The middle term is zero because \(\mathbf{A}\mathbf{x}_*=\mathbf{y}\). If \(\mathbf{h}\ne\mathbf{0}\), positive definiteness gives \(\mathbf{h}^{\top}\mathbf{A}\mathbf{h}>0\), and hence \(J(\mathbf{x})>J(\mathbf{x}_*)\). If \(\mathbf{h}=\mathbf{0}\), then \(\mathbf{x}=\mathbf{x}_*\). Therefore \(\mathbf{x}_*\) is the unique minimizer. \(\square\)

The theorem justifies a direct computational procedure: construct \(\mathbf{L}\), form \(\mathbf{I}_n+\lambda\mathbf{L}\), and solve the resulting linear system. For small examples we can display the solution by hand; for larger networks, a linear-system solver is used. The equation is a consequence of minimizing the stated objective, not a separate smoothing rule.

Worked Examples

Worked Example: Smoothing Two Connected Measurements

Two nodes are joined by an edge of weight \(1\), and their observations are \(0\) and \(4\). Find the smoothed values when \(\lambda=1\).

Each node has degree \(1\), so \(\mathbf{D}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\), \(\mathbf{W}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\), and \(\mathbf{L}=\begin{bmatrix}1&-1\\-1&1\end{bmatrix}\). The smoothing system is therefore \((\mathbf{I}_2+\mathbf{L})\mathbf{x}=\mathbf{y}\):

$$ \begin{bmatrix}2&-1\\-1&2\end{bmatrix} \begin{bmatrix}x_1\\x_2\end{bmatrix} = \begin{bmatrix}0\\4\end{bmatrix}. $$

The first equation gives \(2x_1-x_2=0\), hence \(x_2=2x_1\). Substituting into the second equation gives \(-x_1+2(2x_1)=4\), so \(3x_1=4\), \(x_1=\tfrac43\), and \(x_2=\tfrac83\).

Check: \(2(\tfrac43)-\tfrac83=0\) and \(-\tfrac43+2(\tfrac83)=4\), so multiplication by the system matrix returns \(\mathbf{y}\). The original edge difference is \(4\); the smoothed difference is \(\tfrac83-\tfrac43=\tfrac43\).

Worked Example: A Three-Node Path

Consider the path with edges \(1\)--\(2\) and \(2\)--\(3\), both of weight \(1\). The observations are \(\mathbf{y}=(0,3,0)^{\top}\), and \(\lambda=1\). Find the smoothed values.

The degrees are \(1,2,1\), so the Laplacian and smoothing system are

$$ \mathbf{L}=\begin{bmatrix}1&-1&0\\-1&2&-1\\0&-1&1\end{bmatrix}, \qquad \begin{bmatrix}2&-1&0\\-1&3&-1\\0&-1&2\end{bmatrix} \begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} = \begin{bmatrix}0\\3\\0\end{bmatrix}. $$

The equations are \(2x_1-x_2=0\), \(-x_1+3x_2-x_3=3\), and \(-x_2+2x_3=0\). The first gives \(x_2=2x_1\), and the third gives \(x_2=2x_3\), so \(x_1=x_3\). Substituting \(x_2=2x_1\) and \(x_3=x_1\) into the middle equation gives \(-x_1+6x_1-x_1=3\), hence \(4x_1=3\). Therefore \(\mathbf{x}=(\tfrac34,\tfrac32,\tfrac34)^{\top}\).

Check: The first matrix product entry is \(2(\tfrac34)-\tfrac32=0\); the second is \(-\tfrac34+3(\tfrac32)-\tfrac34=3\); and the third is \(-\tfrac32+2(\tfrac34)=0\). The observations have edge differences \(3\) and \(-3\); the estimates have differences \(\tfrac34\) and \(-\tfrac34\).

Worked Example: Smoothing an Unequal Pattern

Use the same three-node path and \(\lambda=1\), but take observations \(\mathbf{y}=(1,0,0)^{\top}\). Solve for the estimate and check the system.

The system matrix is unchanged. Its equations are \(2x_1-x_2=1\), \(-x_1+3x_2-x_3=0\), and \(-x_2+2x_3=0\). The first equation gives \(x_2=2x_1-1\), and the third gives \(x_3=\tfrac{x_2}{2}\). Substituting \(x_1=\tfrac{x_2+1}{2}\) and \(x_3=\tfrac{x_2}{2}\) into the middle equation yields \(-\tfrac{x_2+1}{2}+3x_2-\tfrac{x_2}{2}=0\). Thus \(2x_2-\tfrac12=0\), so \(x_2=\tfrac14\), \(x_1=\tfrac58\), and \(x_3=\tfrac18\).

Check: \(2(\tfrac58)-\tfrac14=1\), \(-\tfrac58+3(\tfrac14)-\tfrac18=0\), and \(-\tfrac14+2(\tfrac18)=0\). Hence the system matrix times \((\tfrac58,\tfrac14,\tfrac18)^{\top}\) equals \((1,0,0)^{\top}\), as required.

What the Smoothing Guarantee Says

Theorem (Aggregate edge differences do not increase): If \(\lambda>0\) and \(\mathbf{x}_*\) minimizes \(J\), then $$ \mathbf{x}_*^{\top}\mathbf{L}\mathbf{x}_* \le \mathbf{y}^{\top}\mathbf{L}\mathbf{y}. $$ Equivalently, the total weighted sum of squared differences across edges for the estimate is no greater than that for the observations.

Proof. Since \(\mathbf{x}_*\) minimizes \(J\), its objective value is at most the value at the candidate \(\mathbf{y}\). Since \(\|\mathbf{y}-\mathbf{y}\|^2=0\), this gives \(\|\mathbf{x}_*-\mathbf{y}\|^2+\lambda\mathbf{x}_*^{\top}\mathbf{L}\mathbf{x}_* \le\lambda\mathbf{y}^{\top}\mathbf{L}\mathbf{y}\). The squared norm is nonnegative, so \(\lambda\mathbf{x}_*^{\top}\mathbf{L}\mathbf{x}_* \le\lambda\mathbf{y}^{\top}\mathbf{L}\mathbf{y}\). Dividing by the positive number \(\lambda\) proves the result. By the edge-sum identity, these quadratic forms are precisely the total weighted squared edge differences. \(\square\)

This is an aggregate guarantee, not a claim that every individual edge difference must shrink. On the three-node path with \(\mathbf{y}=(0,0,1)^{\top}\) and \(\lambda=1\), solving the system gives \(\mathbf{x}_*=(\tfrac18,\tfrac14,\tfrac58)^{\top}\). The first edge difference grows from \(0\) to \(\tfrac18\), while the second shrinks from \(1\) to \(\tfrac38\). The total squared difference falls from \(1\) to \((\tfrac18)^2+(\tfrac38)^2=\tfrac{10}{64}\). Smoothing can redistribute differences among edges even as it reduces their weighted total.

Common Pitfall: Reversing the Sign

A sign error can turn smoothing into the opposite operation. For the two-node graph with \(\mathbf{L}=\begin{bmatrix}1&-1\\-1&1\end{bmatrix}\), observations \((0,4)^{\top}\), and \(\lambda=1\), the correct equation is \((\mathbf{I}_2+\mathbf{L})\mathbf{x}=\mathbf{y}\), whose solution is \((\tfrac43,\tfrac83)^{\top}\). A mistaken minus sign would instead use \((\mathbf{I}_2-\mathbf{L})\mathbf{x}=\mathbf{y}\), that is, \(\begin{bmatrix}0&1\\1&0\end{bmatrix}\mathbf{x}=(0,4)^{\top}\). This gives the incorrect answer \((4,0)^{\top}\), whose edge difference is \(4\), not a smoothed version of the observed difference.

The correction is to return to the objective: the penalty is \(+\lambda\mathbf{x}^{\top}\mathbf{L}\mathbf{x}\), so the system matrix is \(\mathbf{I}_n+\lambda\mathbf{L}\). For \(\lambda\ge0\), its quadratic form is the sum of the squared norm and a nonnegative penalty; that positivity is also what ensures a unique solution.

Check Your Understanding

Use the definitions and results above to answer these questions. For each computed estimate, verify it by multiplying by the smoothing system matrix.

  1. For two nodes joined by an edge of weight \(2\), write the degree matrix, weight matrix, and Laplacian.
  2. For that two-node graph, take observations \((0,2)^{\top}\) and \(\lambda=1\). Find the smoothed estimate.
  3. Explain why \(\mathbf{x}^{\top}\mathbf{L}\mathbf{x}\ge0\) for every \(\mathbf{x}\), including when the graph is disconnected.
  4. State the linear system that gives the unique minimizer for a general graph in this tutorial.
  5. Does the aggregate smoothing theorem guarantee that every edge difference decreases? Give the reason for your answer.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon