Feeds:
Posts

## A Note on the Graph Laplacian

A short note on how the Graph Laplacian is a natural analogue of the Laplacian in vector analysis.

For a twice differentiable function $f$ on the euclidean space, the Laplacian of $f$, $\Delta f$ is the div(grad($f$)) or the divergence of the gradient of $f$. Let’s consider the laplacian in two dimensions:

$\displaystyle \Delta f(x,y) = \nabla \cdot \nabla f(x,y) = \frac{d^2 f(x,y)}{dx^2} + \frac{d^2 f(x,y)}{dy^2}$

To get an intuition about what it does, it is useful to consider a finite difference approximation to the above:

$\displaystyle \Delta f(x,y) \approx \frac{f(x+h,y) + f(x-h,y) + f(x,y+h) + f(x,y-h) - 4f(x,y)}{h^2}$

The above makes it clear that the Laplacian behaves like a local averaging operator. Infact the above finite difference approximation is used in image processing (say, when h is set to one pixel) to detect sharp changes such as edges, as the above is close to zero in smooth image regions.

____________________________

The finite difference approximation intuitively suggests that a discrete laplace operator should be natural. At the same time, the Graph Theory literature defines the Graph Laplacian as the matrix $L = D - A$ (where $D$ is the degree matrix and $A$ the adjacency matrix of the graph $G$, both are defined below). It is not obvious that this matrix $L$ follows from the div(grad(f)) definition mentioned above. The purpose of this note is to explicate in short on how this is natural, once the notion of gradient and divergence operators have been defined over a graph.

First of all the two most natural matrices that can be associated with a graph are defined below:

____________________________

There are two natural matrices that are used to specify a simple graph $G = (V,E)$ with vertex set $V =\{1, \dots, n \}$ and edge set $E = \{1, \dots, m \}$: The Adjacency matrix $A$ and the Incidence matrix $\nabla$.

The Adjacency matrix is defined as a $n \times n$ matrix such that:

$\displaystyle A_{u,v} = \begin{cases} 1 & \mbox{if } uv \in E \\ 0 & \mbox{otherwise} \end{cases}$

To define the $m \times n$ incidence matrix $\nabla$, we need to fix an orientation of the edges (for our purpose an arbitrary orientation suffices), then:

$\displaystyle \nabla_{e,v} = \begin{cases} -1 & \text{if } v \text{ is initial vertex of edge } e \\ +1 & \text{if } v \text{ is terminal vertex of edge } e \\ 0 & \text{if } e \text{ is not incident on vertex } v \end{cases}$

Now suppose we have a real valued function $f$ over $V$, $f: V \to \mathbb{R}$. For $G$, we view this as a column vector indexed by the vertices.

Similarly let $g$ be a real valued function over the edges $E$, $g: E \to \mathbb{R}$ (again, we view this as a row vector indexed by the edges).

Now, consider the following map: $f \mapsto \nabla f$ (which is now a vector indexed by $E$). The value of this map at any edge $(\nabla f) (e)$ is simply the difference of the values of $f$ at the two end points of the edge $e$ i.e. $f_u - f_v$. This makes it somewhat intuitive that the matrix $\nabla$ is some sort of a difference operator on $G$. Given this “difference operator” or “discrete differential” view, $(\nabla f)$ can then be viewed as the gradient that measures the change of the function $f$ along the edges of $G$. Thus the map $f \mapsto \nabla f$ is just the gradient operator.

Like the above, now we consider the following map: $g \mapsto \nabla^{T} g^T$ (which is now a vector indexed by $V$). Recall that $g$ was defined on the edges. The value of this map at any vertex $(g \nabla)(v)$ is $\displaystyle \sum_{e \text{ exits } v} g_e - \sum_{e \text{ enters } v} g_e$. If we were to view $g$ as describing some kind of a flow on the edges, then $(g \nabla)(v)$ is the net outbound flow on the vertex $v$, which is just the divergence. Thus the map $f \mapsto g \nabla$ is just the divergence operator.

Now consider $f \mapsto \nabla^{T} \nabla f$ (note that this makes sense since $\nabla f$ is a column vector), going by the above, this should be the divergence of the gradient. Thus, the analogy with the “real” Laplacian makes sense and the matrix $L_G = \nabla^{T} \nabla$ is appropriately called the Graph Laplacian.

Using the definition of $\nabla$, a simple computation yields the following for $L_G$:

$\displaystyle L_{G{u,v}} = \begin{cases} -1 & \mbox{if } uv \in E \\ deg(u) & \mbox{if } u =v \end{cases}$

Looking at the above and recalling the definition for the adjacency matrix $A$, it is easy to see that $L_G = D - A$, where $D$ is the diagonal matrix with $D_{u,u} = deg(u)$. This is just the familiar definition that I mentioned at the start.

PS: From the above it is also clear that the Laplacian is positive semidefinite. Indeed, consider $f ^TL f$, which is written as $f^T \nabla^T \nabla f =\|\nabla f\|^2 = \sum_{(u,v) \in E} (f_u - f_v)^2$