  We show by direct calculation that the replica and cavity methods are exactly
equivalent for the spectrum of Erdos-Renyi random graph. We introduce a
variational formulation based on the cavity method and use it to find
approximate solutions for the density of eigenvalues. We also use this
variational method for calculating spectra of sparse covariance matrices.
