  Combining tree decomposition and transfer matrix techniques provides a very
general algorithm for computing exact partition functions of statistical models
defined on arbitrary graphs. The algorithm is particularly efficient in the
case of planar graphs. We illustrate it by computing the Potts model partition
functions and chromatic polynomials (the number of proper vertex colourings
using Q colours) for large samples of random planar graphs with up to N=100
vertices. In the latter case, our algorithm yields a sub-exponential average
running time of ~ exp(1.516 sqrt(N)), a substantial improvement over the
exponential running time ~ exp(0.245 N) provided by the hitherto best known
algorithm. We study the statistics of chromatic roots of random planar graphs
in some detail, comparing the findings with results for finite pieces of a
regular lattice.
