  We consider the hermitian random matrix model with external source and
general polynomial potential, when the source has two distinct eigenvalues but
is otherwise arbitrary. All such models studied so far have a common feature:
an associated cubic equation (spectral curve), one of whose solutions can be
expressed in terms of the Cauchy transform of the limiting eigenvalue
distribution. This is our starting point: we show that to any such spectral
curve (not necessarily given by a random matrix ensemble) it corresponds a
unique vector-valued measure with three components on the complex plane,
characterized as a solution of a variational problem stated in terms of their
logarithmic energy. We describe all possible geometries of the supports of
these measures; in particular the third component, if non-trivial, lives on a
contour on the plane. This general result is applied to the random matrix model
with external source, under an additional assumption of uniform boundedness of
the zeros of a sequence of average characteristic polynomials in the large
matrix limit. It is shown that any limiting zero distribution for such a
sequence can be written in terms of a solution of a spectral curve, and thus
admits the variational description obtained in the first part of the paper. As
a consequence of our analysis, we obtain that the density of this limiting
measure can have only a handful of local behaviors: sine, Airy and their higher
order type behavior, Pearcey or yet the fifth power of the cubic (but no higher
order cubics can appear). We also compare our findings with the most general
results available in the literature, showing that once an additional symmetry
is imposed, our vector critical measure contains enough information to recover
the solutions to the constrained equilibrium problem that was known to describe
the limiting eigenvalue distribution in this symmetric situation.
