  We show that large deviation properties of Erd\"os-R\'enyi random graphs can
be derived from the free energy of the $q$-state Potts model of statistical
mechanics. More precisely the Legendre transform of the Potts free energy with
respect to $\ln q$ is related to the component generating function of the graph
ensemble. This generalizes the well-known mapping between typical properties of
random graphs and the $q\to 1$ limit of the Potts free energy. For
exponentially rare graphs we explicitly calculate the number of components, the
size of the giant component, the degree distributions inside and outside the
giant component, and the distribution of small component sizes. We also perform
numerical simulations which are in very good agreement with our analytical
work. Finally we demonstrate how the same results can be derived by studying
the evolution of random graphs under the insertion of new vertices and edges,
without recourse to the thermodynamics of the Potts model.
