The graph Laplacian and cohomology
I'm leading a directed study with a student about spectral graph theory this semester. (Long story short, he was in my linear algebra class, another student saw a cool thing about clustering using eigenvalues of the graph Laplacian in Tim Chartier's book, and the three of us did some summer research work about it.) This means that I am learning a lot of stuff about graph theory and linear algebra, and this often bleeds out into other weird branches of mathematics. Here's a good example, the moral of which is that if something is hard or annoying, you may be looking at it wrong.
Suppose that $G$ is a graph with vertex set $V(G)$ and edge set $E(G)$. Build the degree matrix $D$ (a diagonal matrix indexed by the vertices whose diagonal entries are given by the degree of each vertex) and the adjacency matrix $A$ (a matrix indexed by the vertices such that $A(v,u) = 1$ if $v$ is adjacent to $u$ and $0$ otherwise). The graph Laplacian is the matrix $L = D - A$.
Pick some function $f:V(G) \to \Reals$. It's useful to think of $f$ as a column vector in $\Reals^{\vert V \vert}$. The Rayleigh quotient of $f$ with respect to the Laplacian is defined as:
The notes we were looking at assert the following:1
We wanted to better understand this calculation, because the Rayleigh quotient is important for picking out eigenvalues of $L$. The denominator ends up being straightforward, but in the numerator, I dragged us lengthwise through the following honestly horrific calculation, which you should not look very hard at other than to note that it involves double sums, index gymnastics, overly-clever relabeling, and every other bad thing.
Any time a calculation turns out this terrible and requires this many weird tricks, that's a good sign that the approach you have chosen is somehow, morally, the wrong choice. So I went fishing on math twitter.
OKAY SO let's say L is the Laplacian matrix of a graph G, and f is some function from V(G) to R. It's true that <f, Lf> = sum (f(u)² - f(v)²), where the sum is over all the pairs of adjacent vertices u and v. Is there a *good* way to see this?
— Dr Spencer Bagley 🏳️🌈 (@sbagley) January 17, 2023
(Please ignore the typos, lol.)
The consensus of a couple of my smart twitter pals was that you have better luck if you think of $L$ not as $D-A$ – which was, ultimately, the choice that led to every other bad thing in that calculation above – but instead as $B B^T$. But who is this mysterious $B$, you ask? Good question.
$B$ is the incidence matrix. The rows of $B$ are indexed by the vertices of $G$, and the columns of $B$ are indexed by the edges of $G$. Put some kind of orientation on all the edges; I don't care what it is. Then:
(Note, btw, that I don't care if you choose the opposite sign convention for $B$; everything still works out the same.)
You should spend one to four minutes convincing yourself that $B B^T = D - A$; just kinda imagine what happens on each row. Once you've done that, you can think about $B$ itself. If you know what homology is (which, uh, maybe I do sometimes?), you may be thinking to yourself, huh, $B$ is some kind of linear map $B:E(G) \to V(G)$ to where $B(e) = u -v$, gee whiz, that sounds like the boundary operator. You're right! What's more, $B^T$ is therefore the coboundary operator. After all, a graph is nothing more than the 1-skeleton of a simplicial complex, so we may as well do homology stuff to it.
One more kinda complication here is that we started with a function $f:V(G) \to \Reals$ – that is, a vertex form – which we wanted to think about as $f\in\Reals^V$. Maybe we actually want to do some de Rham cohomology, then. That's fine; $B^T$ is still the coboundary operator. Specifically, $B^Tf(u, v) = f(u) - f(v)$. You can think of $B^T:\Reals^V\to\Reals^E$ or you can think of $B^T:\Omega^0(G) \to \Omega^1(G)$, whichever you like more.
Here is the punchline of this blog post. With this setup, the Rayleigh quotient calculation becomes a one-liner:
And if you don't think that kicks ass, then you can get the hell out of my face.
-
NB that things are set up a little differently there, using the normalized Laplacian, but this Rayleigh quotient calculation works out the same way. ↩