  We propose an exact summation method to compute thermodynamic observables in
integrable quantum field theories. The key idea is to use the matrix-tree
theorem to write the Gaudin determinants that appear in the cluster expansion
as a sum over graphs. For theories with a diagonal S-matrix, this method is
more powerful than the standard Thermodynamic Bethe Ansatz (TBA) technique as
it is exact to all orders of powers in inverse volume. We have obtained using
this method the TBA equation, the excited state energies in finite volume, the
Leclair-Mussardo formula for one point functions, the finite-temperature
boundary entropy and cumulants of conserved charges in Generalized Gibbs
Ensembles. Moreover, the graph expansion can also be regarded as an alternative
to algebraic manipulations involving Gaudin determinants. We have applied this
idea to derive the equations of state and other transport properties in
Generalized Hydrodynamics. For theories with a non-diagonal S-matrix, the
description of a complete set of states is more involved and it is not known
how a cluster expansion can be implemented. It is nevertheless possible to
apply the direct summation method in reverse and interpret known TBA equations
with complex strings in terms of diagrams.
