  In this paper we consider a random graph on which topological restrictions
are imposed, such as constraints on the total number of edges, wedges, and
triangles. We work in the dense regime, in which the number of edges per vertex
scales proportionally to the number of vertices $n$. Our goal is to compare the
micro-canonical ensemble (in which the constraints are satisfied for every
realisation of the graph) with the canonical ensemble (in which the constraints
are satisfied on average), both subject to maximal entropy. We compute the
relative entropy of the two ensembles in the limit as $n$ grows large, where
two ensembles are said to be \emph{equivalent} in the dense regime if this
relative entropy divided by $n^2$ tends to zero. Our main result, whose proof
relies on large deviation theory for graphons, is that breaking of ensemble
equivalence occurs when the constraints are \emph{frustrated}. Examples are
provided for three different choices of constraints.
