There are a couple of references that i think are pretty decent about this subject:
- Potts Model and Related Problems in Statistical Mechanics (see chapter 1.5);
- The Potts Model (see also, Knot Theory and Statistical Mechanics).
These two refs talk about the chromatic polynomial: roughly speaking, you can have the number of states in the Potts model be analogous to a certain number of colors, and the chromatic polynomial emerges from the Partition Function of the system (after a suitable change of variables).
A key concept in this game is called block variables, that is, you simply walk through your lattice looking for same-state sites and binding adjacent ones together. After performing this operation in the whole lattice, you end up with "blocks" of "same state" sites, which you just define as your "new variables" and call them "block variables".
Note that you can only do this because, in principle, you have a finite system and a finite sum defining your Partition Function: in this sense, "block variables" are nothing more than a simple re-arrangement of the sum defining the Partition Function. Then, your original Partition Function,
$$ \mathcal{Z} = \sum_{{s}} e^{-\beta\, \sum_{\langle i\, j\rangle} \delta_{s_i,\, s_j}} = \sum_{{s}} \prod_{\langle i\, j\rangle} e^{-\beta\, \delta_{s_i,\, s_j}} \; ; $$
can be re-written as,
$$ \mathcal{Z} = \sum_{{s}} \prod_{\langle i\, j\rangle} (1 + v\, \delta_{s_i,\, s_j}) \; ; $$
where $ v = e^{-\beta} - 1$; and you can derive the chromatic polynomial from this last expression.
One way to think about this problem is as follows: think you have an initial and a final state, i.e., an initial lattice configuration and a final one, where the configuration is a given "spin" ("state") distribution or, analogously, a given "color" distribution.
If you think of your "colors" as "billiard balls", you can think of the process of going from the initial to the final state as a sequence of scatterings among all sites of your lattice. This way you can build an oriented graph from the initial state descending to the final one and, in some sense, the "extremization" (minimization) of the Partition Function is a sorting algorithm to run through this graph in an "efficient" way.
Anyway, I hope this gives you a flavor of how things work.