  We prove large deviation principles (LDP) for the invariant measures of the
multiclass totally asymmetric simple exclusion process (TASEP) and the
multiclass Hammersely-Aldous-Diaconis (HAD) process on a torus. The proof is
based on a combinatorial representation of the measures in terms of a
\emph{collapsing procedure} introduced in \cite{A} for the 2-class TASEP and
then generalized in \cite{FM1}, \cite{FM2} and \cite{FM3} to the multiclass
TASEP and the multiclass HAD process. The rate functionals are written in terms
of variational problems that we solve in the cases of 2-class processes.
