Skip to main content

Section 8.1 Partition Functions and Homomorphism Counting

Recall from Section 4.2 that \(\hom(G,H)\) denotes the number of homomorphisms from a graph \(G\) to a graph \(H\text{.}\) As it turns out, if we slightly generalize the notion of \(\hom(G,H)\) to a “weighted” version by replacing \(H\) with a matrix, then we obtain the notion of a “partition function” which is heavily studied by statistical physicists. A major focus of this chapter is on bounding these partition functions under certain conditions on the graph \(G\text{.}\)

Definition 8.1.1.

Let \(W\) be a symmetric \(k\times k\) matrix with non-negative entries where \(W(i,j)\) denotes the entry on the \(i\)th row and \(j\)th column of \(W\text{.}\) Let \(a\) be a vector of length \(k\) with non-negative entries and let \(a(i)\) be the \(i\)th entry of \(a\text{.}\) For any graph \(G\text{,}\) define
\begin{equation*} \hom(G,(a,W)):=\sum_{f:V(G)\to[n]}\prod_{v\in V(G)}a(f(v))\prod_{uv\in E(G)}W(f(u),f(v)). \end{equation*}
We simply write \(\hom(G,W)\) to mean \(\hom(G,(a,W))\) where \(a\) is the all-ones vector.
In the physics literature, \(\hom(G,(a,W))\) is known as the partition function of \(G\) with respect to spin system \((a,W)\text{.}\) We will usually (but not always) follow terminology that is more familiar to a mathematician (as that is what the author is comfortable with), but we will occasionally discuss physics terminology as it arises.

Example 8.1.2.

Many interesting graph-theoretic quantities can be captured by \(\hom(G,(a,W))\text{.}\) For example, if
\begin{equation*} W_{\text{ind}}=\begin{bmatrix}1&1\\ 1&0\end{bmatrix}, \end{equation*}
then \(\hom\left(G,W_{\text{ind}}\right)\) is equal to the number of independent sets in \(G\text{.}\) Can you see why? Note that you can think of this matrix as the adjacency matrix of a 2-vertex graph with one edge between the vertices and one loop.

Example 8.1.3.

The independence polynomial of a graph \(G\) is the function
\begin{equation*} p_G(\lambda)=\sum_{I\in\mathcal{I}(G)}\lambda^{|I|} \end{equation*}
where \(\mathcal{I}(G)\) is the collection of all independent sets in \(G\text{.}\) Note that the coefficient of \(\lambda^\ell\) in the independence polynomial is equal to the number of independent sets of \(G\) of cardinality \(\ell\text{.}\) Can you see how to represent the independence polynomial in terms of the function \(\hom(G,(a,W))\) for a certain choice of \(a\) and \(W\text{?}\)

Example 8.1.4.

Find a closed form for \(p_{K_{d,d}}(\lambda)\text{.}\) That is, an expression that does not contain a summation symbol.

Example 8.1.5.

A well-known example in the statistical physics literature is the so-called “Widom--Rowlinson model”. The partition function of this model is equal to \(\hom(G,W_{\text{WR}})\) where
\begin{equation*} W_{\text{WR}}=\begin{bmatrix}1&1&0\\ 1&1&1\\ 0&1&1\end{bmatrix}. \end{equation*}
Note that you can think of this matrix as the adjacency matrix of a 3-vertex graph obtained by taking a 3-vertex path and adding a loop on all three vertices.
Note that if \(W\) is the adjacency matrix of a graph \(H\text{,}\) then \(\hom(G,W)\) is precisely equal to \(\hom(G,H)\text{.}\) Therefore, the above definition generalizes the homomorphism counting function from graphs to matrices. However, as we will see in Proposition 8.1.6, \(\hom(G,(a,W))\) can be approximated by \(\hom(G,H)\) for a graph \(H\) and so choosing to deal with matrices instead of graphs is mainly a matter of convenience. That is, it is sometimes useful to use vectors and matrices to put a “weight” on vertices or edges in a graph in a way that you can’t naturally do with more “rigid” graph theory terminology.

Proof.

Here’s the idea. Take a set of \(n\) vertices and split them randomly into sets \(V_1,\dots,V_k\) where the probability that a vertex is in \(V_i\) is equal to \(a_i/A\) independently of all other vertices. Then, between \(V_i\) and \(V_j\text{,}\) we put a random set of edges by including each edge with probability \(W(i,j)/c\) independently of all other edges. Note that, since \(W\) is symmetric, this is the same as adding these edges with probability \(W(j,i)/c\text{.}\) Let \(H_n\) be the resulting graph.
Now, let \(G\) be an arbitrary graph. Our goal is to show that, as \(n\) tends to infinity, \(\frac{\hom(G,H_n)}{n^{|V(G)|}}\) tends to \(\frac{\hom(G,(a,W))}{A^{|V(G)|}c^{|E(G)|}}\) with probability one. Let us first compute the expected value of the left side. Given a function \(f:V(G)\to H_n\text{,}\) let \(1_f\) be the “indicator random variable” which is equal to \(1\) if \(f\) is a homomorphism and \(0\) otherwise. Then
\begin{equation*} \hom(G,H_n)=\sum_{f:V(G)\to V(H_n)}1_f \end{equation*}
and so, by linearity of expectation,
\begin{equation*} \mathbb{E}(\hom(G,H_n))=\sum_{f:V(G)\to V(H_n)}\mathbb{E}(1_f) = \sum_{f:V(G)\to V(H_n)}\mathbb{P}(f\text{ is a homomorphism}). \end{equation*}
If we let \(\varphi\) be a uniformly random function from \(V(G)\) to \(V(H_n)\) chosen independently of all of the random choices made so far, then, for any fixed \(f:V(G)\to V(H_n)\text{,}\) we have \(\mathbb{P}(\varphi=f)=\frac{1}{n^{|V(G)|}}\text{.}\) Therefore, by linearity of expectation,
\begin{equation*} \mathbb{E}\left(\frac{\hom(G,H_n)}{n^{|V(G)|}}\right)= \sum_{f:V(G)\to V(H_n)}\frac{1}{n^{|V(G)|}}\mathbb{P}(f\text{ is a homomorphism}) \end{equation*}
\begin{equation*} =\sum_{f:V(G)\to V(H_n)}\mathbb{P}(\varphi=f)\mathbb{P}(f\text{ is a homomorphism})=\mathbb{P}(\varphi\text{ is a homomorphism}) \end{equation*}
where the last equality uses independence of the events. Now, let’s make some observations about \(\mathbb{P}(\varphi\text{ is a homomorphism})\text{.}\) We can lower bound it as follows using standard properties of conditional expectation:
\begin{equation*} \mathbb{P}(\varphi\text{ is a homomorphism}) \geq \mathbb{P}(\varphi\text{ is an injective homomorphism}) = \mathbb{P}(\varphi\text{ is a homomorphism}\mid \varphi\text{ is injective})\mathbb{P}(\varphi\text{ is injective}) \end{equation*}
\begin{equation*} = \mathbb{P}(\varphi\text{ is a homomorphism}\mid \varphi\text{ is injective})(1-\mathbb{P}(\varphi\text{ is non-injective})) \geq \mathbb{P}(\varphi\text{ is a homomorphism}\mid \varphi\text{ is injective}) - \mathbb{P}(\varphi\text{ is non-injective}). \end{equation*}
Similarly, we get the following upper bound
\begin{equation*} \mathbb{P}(\varphi\text{ is a homomorphism})\leq \mathbb{P}(\varphi\text{ is an injective homomorphism})+\mathbb{P}(\varphi\text{ is not injective})\leq \mathbb{P}(\varphi\text{ is a homomorphism}\mid \varphi\text{ is injective}) + \mathbb{P}(\varphi\text{ is non-injective}). \end{equation*}
The probability that \(\varphi\) is not injective is \(O(1/n)\text{;}\) do you see why? So,
\begin{equation*} \mathbb{E}\left(\frac{\hom(G,H_n)}{n^{|V(G)|}}\right) = \mathbb{P}(\varphi\text{ is a homomorphism}\mid\varphi\text{ is injective}) \pm O(1/n). \end{equation*}
Now, \(\mathbb{P}(\varphi\text{ is a homomorphism}\mid\varphi\text{ is injective})\approx \frac{\hom(G,(a,W))}{A^{|V(G)|}c^{|E(G)|}}\text{.}\) To verify this requires some thinking about how the function \(\hom(G,(a,W))\) works. Putting this together, we should get that
\begin{equation*} \mathbb{E}(\hom(G,H_n)) = \frac{n^{|V(G)|}\hom(G,(a,W))}{A^{|V(G)|}c^{|E(G)|}} \pm O(n^{|V(G)|-1}). \end{equation*}
After this, the last step is to use a “concentration inequality” to get that \(\hom(G,H_n)\) is very close to its expected value with probability tending to 1 as \(n\to\infty\text{.}\) This is a very standard fact for anyone who has seen a lot of applications of the “probabilistic method” but, since we may not have this background, let us give the details.

Proof.

Let \(e_1,\dots,e_{\binom{n}{2}}\) be the edges of the complete graph with vertex set \(V(H_n)\) listed in an arbitrary order. Imagine we start with a graph with vertex set \(V(H_n)\) and no edges and, for each \(i\) between \(1\) and \(\binom{n}{2}\text{,}\) one by one, we “reveal” whether \(e_i\in E(H_n)\) or \(e_i\notin E(H_n)\text{.}\) We can think of this as revealing the value of the indicator random variables \(1_{e_1\in E(H_n)},1_{e_2\in E(H_n)},\dots\) one by one.
Now, define a sequence of random variables \(X_0,\dots,X_{\binom{n}{2}}\) as follows. First, we define \(X_0 = \mathbb{E}(\hom(G,H_n))\text{.}\) We think of \(X_0\) as representing our “best guess” of the value of \(\hom(G,H_n)\) before we have revealed any edges at all. Now, reveal the value of \(1_{e_1\in E(H_n)}\) and let \(X_1\) be the expected value of \(\hom(G,H_n)\) given the value of \(1_{e_1\in E(H_n)}\text{.}\) That is, it is the average of \(\hom(G,H_n)\) over all choices of the indicator functions of all edges except for \(e_1\text{.}\) And continue in this way; that is, \(X_2\) is the expectation of \(\hom(G,H_n)\) after revealing the first two edges, and so on. Then \(X_{\binom{n}{2}}\) is simply equal to \(\hom(G,H_n)\) (because all of the edges have been revealed and there is no more “randomness” remaining). The sequence \(X_0,\dots,X_{\binom{n}{2}}\) forms something which is known as a “martingale” which just means that if we take \(X_k\) and “forget” the outcome of the edge \(e_k\) by averaging out over all possibilities of \(1_{e_k\in E(H_n)}\text{,}\) then we just end up the random variable \(X_{k-1}\text{.}\) Note that, in the martingale that we have defined, we have \(|X_k-X_{k-1}|=O(n^{|V(G)|-2})\) for all \(1\leq k\leq \binom{n}{2}\text{.}\) This is because revealing any edge can boost the number of homomorphisms from \(G\) to \(H\) by at most \(O(n^{|V(G)|-2})\text{,}\) and so it can only increase the expected number of such homomorphisms by at most this amount as well. So, by Azuma’s Inequality,
\begin{equation*} \mathbb{P}(|\hom(G,H_n) - \mathbb{E}(\hom(G,H_n))|>\log(n)\cdot n^{|V(G)|-1}) = \mathbb{P}(|X_{\binom{n}{2}}-X_0| >\log(n)\cdot n^{|V(G)|-1}) \leq 2\exp\left(\Omega\left(\frac{-\log^2(n)\cdot n^{2|V(G)|-2}}{2\binom{n}{2}n^{2|V(H)|-4}}\right)\right) \end{equation*}
\begin{equation*} \leq \exp(-\Omega(\log^2(n))) \leq 1/n^2 \end{equation*}
where the last inequality holds for large enough \(n\text{.}\)
Now, to finish the proof, we note that \(\sum_{n=1}^\infty \frac{1}{n^2}< \infty\text{.}\) A standard result in probability is the “Borel-Cantelli Lemma” which says that, if the sum of the probabilities of countably many events is finite, then the probability that infinitely many of the events hold is zero. So, combining this with the claim, we get that, with probability one, the event
\begin{equation*} \{|\hom(G,H_n) - \mathbb{E}(\hom(G,H_n))| \leq \log(n)\cdot n^{|V(G)|-1}\} \end{equation*}
holds for all but finitely many \(n\text{.}\) So, putting everything together, we get that
\begin{equation*} \lim_{n\to\infty}\frac{\hom(G,H_n)}{n^{|V(G)|}}=\frac{\hom(G,(a,W))}{A^{|V(G)|}c^{|E(G)|}} \end{equation*}
with probability one.
Our focus in this chapter will be on the following question: For a given pair \((a,W)\text{,}\) which graph \(G\) maximizes or minimizes \(\hom(G,(a,W))\) under certain constraints on \(G\text{?}\) Our main focus will be on the pairs \((a,W)\) in the examples in this section, and close relatives of them.