  We show that the partition function of the logarithmic sector of critical
topologically massive gravity which represents a series expansion of
composition of functions, can be expressed as a sum over rooted trees. Our work
brings a connection between integrable hierarchies of mathematical physics,
combinatorial Hopf algebras and rooted trees, by explaining how the
$\tau$-functions of the (potential) Burgers and KP integrable hierarchies
appearing in the partition function of log gravity conceal the Hopf algebra of
composition of functions, known as the Fa\`a di Bruno algebra, of the same type
as the celebrated Connes-Kreimer Hopf algebra of rooted trees and Feynman
diagrams. In particular, the Hurwitz numbers appearing in the partition
function arise as coefficients of isomorphism classes of rooted trees. A
parallel is drawn between our findings and established results in the
statistical physics literature concerning certain systems with quenched
disorder on trees, associated to nonlinear partial differential equations
admitting traveling wave solutions. This should be of particular interest in
view of a further description of the disorder observed in log gravity.
