Covariance structure behind breaking of ensemble equivalence in random graphs

For a random graph subject to a topological constraint, the microcanonical ensemble requires the constraint to be met by every realisation of the graph (`hard constraint'), while the canonical ensemble requires the constraint to be met only on average (`soft constraint'). It is known that breaking of ensemble equivalence may occur when the size of the graph tends to infinity, signalled by a non-zero specific relative entropy of the two ensembles. In this paper we analyse a formula for the relative entropy of generic discrete random structures recently conjectured by Squartini and Garlaschelli. We consider the case of a random graph with a given degree sequence (configuration model), and show that in the dense regime this formula correctly predicts that the specific relative entropy is determined by the scaling of the determinant of the matrix of canonical covariances of the constraints. The formula also correctly predicts that an extra correction term is required in the sparse regime and in the ultra-dense regime. We further show that the different expressions correspond to the degrees in the canonical ensemble being asymptotically Gaussian in the dense regime and asymptotically Poisson in the sparse regime (the latter confirms what we found in earlier work), and the dual degrees in the canonical ensemble being asymptotically Poisson in the ultra-dense regime. In general, we show that the degrees follow a multivariate version of the Poisson-Binomial distribution in the canonical ensemble.

1 Introduction and main results

Background and outline
For most real-world networks, a detailed knowledge of the architecture of the network is not available and one must work with a probabilistic description, where the network is assumed to be a random sample drawn from a set of allowed configurations that are consistent with a set of known topological constraints [8].Statistical physics deals with the definition of the appropriate probability distribution over the set of configurations and with the calculation of the resulting properties of the system.Two key choices of probability distribution are: (1) the microcanonical ensemble, where the constraints are hard (i.e., are satisfied by each individual configuration); (2) the canonical ensemble, where the constraints are soft (i.e., hold as ensemble averages, while individual configurations may violate the constraints).
(In both ensembles, the entropy is maximal subject to the given constraints.) In the limit as the size of the network diverges, the two ensembles are traditionally assumed to become equivalent, as a result of the expected vanishing of the fluctuations of the soft constraints (i.e., the soft constraints are expected to become asymptotically hard).However, it is known that this equivalence may be broken, as signalled by a non-zero specific relative entropy of the two ensembles (= on an appropriate scale).In earlier work various scenarios were identified for this phenomenon (see [9], [2], [5] and references therein).In the present paper we take a fresh look at breaking of ensemble equivalence by analysing a formula for the relative entropy, based on the covariance structure of the canonical ensemble, recently put forward by Squartini and Garlaschelli [7].We consider the case of a random graph with a given degree sequence (configuration model) and show that this formula correctly predicts that the specific relative entropy is determined by the scaling of the determinant of the covariance matrix of the constraints in the dense regime, while it requires an extra correction term in the sparse regime and the ultra-dense regime.We also show that the different behaviours found in the different regimes correspond to the degrees being asymptotically Gaussian in the dense regime and asymptotically Poisson in the sparse regime, and the dual degrees being asymptotically Poisson in the ultra-dense regime.We further note that, in general, in the canonical ensemble the degrees are distributed according to a multivariate version of the Poisson-Binomial distribution [12], which admits the Gaussian distribution and the Poisson distribution as limits in appropriate regimes.
Our results imply that, in all three regimes, ensemble equivalence breaks down in the presence of an extensive number of constraints.This confirms the need for a principled choice of the ensemble used in practical applications.Three examples serve as an illustration: (a) Pattern detection is the identification of nontrivial structural properties in a real-world network through comparison with a suitable null model, i.e., a random graph model that preserves certain local topological properties of the network (like the degree sequence) but is otherwise completely random.
(b) Community detection is the identification of groups of nodes that are more densely connected with each other than expected under a null model, which is a popular special case of pattern detection.
(c) Network reconstruction employs purely local topological information to infer higherorder structural properties of a real-world network.This problem arises whenever the global properties of the network are not known, for instance, due to confidentiality or privacy issues, but local properties are.In such cases, optimal inference about the network can be achieved by maximising the entropy subject to the known local constraints, which again leads to the two ensembles considered here.
Breaking of ensemble equivalence means that different choices of the ensemble lead to asymptotically different behaviours.Consequently, while for applications based on ensemble-equivalent models the choice of the working ensemble can be arbitrary and can be based on mathematical convenience, for those based on ensemble-nonequivalent models the choice should be dictated by a criterion indicating which ensemble is the appropriate one to use.This criterion must be based on the a priori knowledge that is available about the network, i.e., which form of the constraint (hard or soft) applies in practice.The remainder of this section is organised as follows.In Section 1.2 we define the two ensembles and their relative entropy.In Section 1.3 we introduce the constraints to be considered, which are on the degree sequence.In Section 1.4 we introduce the various regimes we will be interested in and state a formula for the relative entropy when the constraint is on the degree sequence.In Section 1.5 we state the formula for the relative entropy proposed in [7] and present our main theorem.In Section 1.6 we close with a discussion of the interpretation of this theorem and an outline of the remainder of the paper.

Microcanonical ensemble, canonical ensemble, relative entropy
For n ∈ N, let G n denote the set of all simple undirected graphs with n nodes.Any graph G ∈ G n can be represented as an n × n matrix with elements if there is a link between node i and node j, 0 otherwise. (1.1) Let C denote a vector-valued function on G n .Given a specific value C * , which we assume to be graphical, i.e., realisable by at least one graph in G n , the microcanonical probability distribution on G n with hard constraint C * is defined as where is the number of graphs that realise C * .The canonical probability distribution P can (G) on G n is defined as the solution of the maximisation of the entropy subject to the normalisation condition G∈Gn P can (G) = 1 and to the soft constraint C = C * , where • denotes the average w.r.t.P can .This gives where is the Hamiltonian and is the partition function.In (1.5) the parameter θ must be set equal to the particular value θ * that realises C = C * .This value is unique and maximises the likelihood of the model given the data (see [3]).
The relative entropy of P mic w.r.t.P can is [10] S n (P mic | P can ) = and the relative entropy α n -density is [7] where α n is a scale parameter.The limit of the relative entropy α n -density is defined as We say that the microcanonical and canonical ensemble are equivalent on scale α n (or with speed α n ) if and only if1 s α∞ = 0. ( Clearly, if the ensembles are equivalent with speed α n , then they are also equivalent with any other faster speed α ′ n such that α n = o(α ′ n ).Therefore a natural choice for α n is the 'critical' speed such that the limiting α n -density is positive and finite, i.e. s α∞ ∈ (0, ∞).In the following, we will use α n to denote this natural speed (or scale), and not an arbitrary one.This means that the ensembles are equivalent on all scales faster than α n and are nonequivalent on scale α n or slower.The critical scale α n depends on the constraint at hand as well as its value.For instance, if the constraint is on the degree sequence, then in the sparse regime the natural scale turns out to be α n = n [9], [2] (in which case s α∞ is the specific relative entropy 'per vertex'), while in the dense regime it turns out to be α n = n log n, as shown below.On the other hand, if the constraint is on the total numbers of edges and triangles, with values different from what is typical for the Erdős-Renyi random graph in the dense regime, then the natural scale turns out to be α n = n 2 [5] (in which case s α∞ is the specific relative entropy 'per edge').Such a severe breaking of ensemble equivalence comes from 'frustration' in the constraints.
Before considering specific cases, we recall an important observation made in [9].The definition of H(G, θ ) ensures that, for any , the canonical probability is the same for all graphs having the same value of the constraint).We may therefore rewrite (1.8) as where G * is any graph in G n such that C(G * ) = C * (recall that we have assumed that C * is realisable by at least one graph in G n ).The definition in (1.10) then becomes which shows that breaking of ensemble equivalence coincides with P mic (G * ) and P can (G * ) having different large deviation behaviour on scale α n .Note that (1.13) involves the microcanonical and canonical probabilities of a single configuration G * realising the hard constraint.
Apart from its theoretical importance, this fact greatly simplifies mathematical calculations.
To analyse breaking of ensemble equivalence, ideally we would like to be able to identify an underlying large deviation principle on a natural scale α n .This is generally difficult, and so far has only been achieved in the dense regime with the help of graphons (see [5] and references therein).In the present paper we will approach the problem from a different angle, namely, by looking at the covariance matrix of the constraints in the canonical ensemble, as proposed in [7].
Note that all the quantities introduced above in principle depend on n.However, except for the symbols G n and S n (P mic | P can ), we suppress the n-dependence from the notation.

Constraint on the degree sequence
The degree sequence of a graph G ∈ G n is defined as In what follows we constrain the degree sequence to a specific value k * , which we assume to be graphical, i.e., there is at least one graph with degree sequence k * .The constraint is therefore The microcanonical ensemble, when the constraint is on the degree sequence, is known as the configuration model and has been studied intensively (see [8,9,4]).For later use we recall the form of the canonical probability in the configuration model, namely, and with the vector of Lagrange multipliers tuned to the value θ * = (θ * i ) n i=1 such that (1.17) Using (1.12), we can write where Ω k is the number of graphs with degree sequence k, is the probability that the degree sequence is equal to k under the canonical ensemble with constraint k * , G k denotes an arbitrary graph with degree sequence k, and P can G k is the canonical probability in (1.15) rewritten for one such graph: In the last expression, x * i = e −θ * i , and θ = (θ * i ) n i=1 is the vector of Lagrange multipliers coming from (1.16).

Relevant regimes
The breaking of ensemble equivalence was analysed in [2] in the so-called sparse regime, defined by the condition max It is natural to consider the opposite setting, namely, the ultra-dense regime in which the degrees are close to n − 1, max 1≤i≤n This can be seen as the dual of the sparse regime.We will see in Appendix B that under the map k * i → n − 1 − k * i the microcanonical ensemble and the canonical ensemble preserve their relationship, in particular, their relative entropy is invariant.
It is a challenge to study breaking of ensemble equivalence in between the sparse regime and the ultra-dense regime, called the dense regime.In what follows we consider a subclass of the dense regime, called the δ-tame regime, in which the graphs are subject to a certain uniformity condition.
where p * ij are the canonical probabilities in (1.15)-(1.17).Remark 1.2.The name δ-tame is taken from [1], which studies the number of graphs with a δ-tame degree sequence.Definition 1.1 is actually a reformulation of the definition given in [1].See Appendix A for details.
It is natural to ask whether, conversely, condition (1.24) implies that the degree sequence is δ ′ -tame for some δ ′ = δ ′ (δ).Unfortunately, this question is not easy to settle, but the following lemma provides a partial answer.

Linking ensemble nonequivalence to the canonical covariances
In this section we investigate an important formula, recently put forward in [7], for the scaling of the relative entropy under a general constraint.The analysis in [7] allows for the possibility that not all the constraints (i.e., not all the components of the vector C) are linearly independent.For instance, C may contain redundant replicas of the same constraint(s), or linear combinations of them.Since in the present paper we only consider the case where C is the degree sequence, the different components of C (i.e., the different degrees) are linearly independent.
When a K-dimensional constraint C * = (C * i ) K i=1 with independent components is imposed, then a key result in [7] is the formula where is the K × K covariance matrix of the constraints under the canonical ensemble, whose entries are defined as and i (Q) > 0 the i-th eigenvalue of the K × K covariance matrix Q.This result can be formulated rigorously as Formula 1.1 ( [7]).If all the constraints are linearly independent, then the limiting relative entropy α n -density equals with α n the 'natural' speed and The latter is zero when where Note that 0 ≤ I K,R ≤ K. Consequently, (1.32) is satisfied (and hence τ α∞ = 0) when lim n→∞ K n /α n = 0, i.e., when the number K n of constraints grows slower than α n .

Remark 1.4 ([7]
). Formula 1.1, for which [7] offers compelling evidence but not a mathematical proof, can be rephrased by saying that the natural choice of α n is αn = log det(2πQ). (1.33) Indeed, if all the constraints are linearly independent and (1.32) holds, then τ αn = 0 and We now present our main theorem, which considers the case where the constraint is on the degree sequence: . This case was studied in [2], for which α n = n in the sparse regime with finite degrees.Our results here focus on three new regimes, for which we need to increase α n : the sparse regime with growing degrees, the δtame regime, and the ultra-dense regime with growing dual degrees.In all these cases, since lim n→∞ K n /α n = lim n→∞ n/α n = 0, Formula 1.1 states that (1.30) holds with τ αn = 0. Our theorem provides a rigorous and independent mathematical proof of this result.
Theorem 1.5.Formula 1.1 is true with τ α∞ = 0 when the constraint is on the degree sequence and the degree sequence belongs to one of the following three regimes: • The sparse regime with growing degrees: • The δ-tame regime (see (1.15) and Lemma 1.3): (1.38) • The ultra-dense regime with growing dual degrees: In all three regimes there is breaking of ensemble equivalence, and (1.40)

Discussion and outline
Comparing (1.34) and (1.40), and using (1.33), we see that Theorem 1.5 shows that if the constraint is on the degree sequence, then in each of the three regimes considered.Below we provide a heuristic explanation for this result (as well as for our previous results in [2]) that links back to (1.18).In Section 2 we prove Theorem 1.5.
Poisson-Binomial degrees in the general case.Note that (1.18) can be rewritten as where is the multivariate Dirac distribution with average k * .This has the interesting interpretation that the relative entropy between the distributions P mic and P can on the set of graphs coincides with the relative entropy between δ[ k * ] and Q[ k * ] on the set of degree sequences.
To be explicit, using (1.19) and (1.20), we can rewrite (1.43) We note that the above distribution is a multivariate version of the Poisson-Binomial distribution (or Poisson's Binomial distribution; see Wang [12]).In the univariate case, the Poisson-Binomial distribution describes the probability of a certain number of successes out of a total number of independent and (in general) not identical Bernoulli trials [12].In our case, the marginal probability that node i has degree k i in the canonical ensemble, irrespectively of the degree of any other node, is indeed a univariate Poisson-Binomial given by n − 1 independent Bernoulli trials with success probabilities {p * ij } j =i .The relation in (1.42) can therefore be restated as where PoissonBinomial[ k * ] is the multivariate Poisson-Binomial distribution given by (1.43), i.e., (1.45) The relative entropy can therefore be seen as coming from a situation in which the microcanonical ensemble forces the degree sequence to be exactly k * , while the canonical ensemble forces the degree sequence to be Poisson-Binomial distributed with average k * .It is known that the univariate Poisson-Binomial distribution admits two asymptotic limits: (1) a Poisson limit (if and only if, in our notation, j =i p * ij → λ > 0 and j =i (p * ij ) 2 → 0 as n → ∞ [12]); (2) a Gaussian limit (if and only if p * ij → λ j > 0 for all j = i as n → ∞, as follows from a central limit theorem type of argument).If all the Bernoulli trials are identical, i.e., if all the probabilities {p * ij } j =i are equal, then the univariate Poisson-Binomial distribution reduces to the ordinary Binomial distribution, which also exhibits the well-known Poisson and Gaussian limits.These results imply that also the general multivariate Poisson-Binomial distribution in (1.43) admits limiting behaviours that should be consistent with the Poisson and Gaussian limits discussed above for its marginals.This is precisely what we confirm below.
Poisson degrees in the sparse regime.In [2] it was shown that, for a sparse degree sequence,  2 → 0 under which the Poisson distribution is retrieved from the Poisson-Binomial distribution [12].In particular, the condition in (1.21) includes both the case with growing degrees included in Theorem 1.5 (and consistent with Formula 1.1 with τ α∞ = 0) and the case with finite degrees, which cannot be retrieved from Formula 1.1 with τ α∞ = 0, because it corresponds to the case where all the n = α n eigenvalues of Q remain finite as n diverges (as the entries of Q themselves do not diverge), and indeed (1.32) does not hold.
Poisson degrees in the ultra-dense regime.Since the ultra-dense regime is the dual of the sparse regime, we immediately get the heuristic interpretation of the relative entropy when the constraint is on an ultra-dense degree sequence k * .Using (1.47) and the observations in Appendix B (see, in particular (B.2)), we get (1.49) where ℓ * = (ℓ * i ) n i=1 is the dual degree sequence given by ℓ In other words, under the microcanonical ensemble the dual degrees follow the distribution δ[ ℓ * ], while under the canonical ensemble the dual degrees follow the distribution Q[ ℓ * ], where in analogy with (1.48), Similar to the sparse case, the multivariate Poisson-Binomial distribution (1.43) reduces to a product of marginal, and asymptotically Poisson, distributions governing the different degrees.Again, the case with finite dual degrees cannot be retrieved from Formula 1.1 with τ α∞ = 0, because it corresponds to the case where Q has a diverging (like n = α n ) number of eigenvalues whose value remains finite as n → ∞, and (1.32) does not hold.By contrast, the case with growing dual degrees can be retrieved from Formula 1.1 with τ α∞ = 0 because (1.32) holds, as confirmed in Theorem 1.5.
Gaussian degrees in the dense regime.We can reinterpet (1.41) as the statement (1.51) where Normal[ k * , Q] is the multivariate Normal distribution with mean k * and covariance matrix Q.In other words, in this regime i.e., the multivariate Poisson-Binomial distribution (1.43) is asymptotically a multivariate Gaussian distribution whose covariance matrix is in general not diagonal, i.e., the dependencies between degrees of different nodes do not vanish, unlike in the other two regimes.Since all the degrees are growing in this regime, so are all the eigenvalues of Q, implying (1.32) and consistently with Formula 1.1 with τ α∞ = 0, as proven in Theorem 1.5.Note that the right-hand side of (1.51), being the relative entropy of a discrete distribution with respect to a continuous distribution, needs to be properly interpreted: the Dirac distribution δ[ k * ] needs to be smoothened to a continuous distribution with support in a small ball around k * .Since the degrees are large, this does not affect the asymptotics.
Crossover between the regimes.An easy computation gives we see that, as we move from the sparse regime with finite degrees to the sparse regime with growing degrees, the scaling of the relative entropy in (1.46) nicely links up with that of the dense regime in (1.51) via the common expression in (1.41).Note, however, that since the sparse regime with growing degrees is in general incompatible with the dense δ-tame regime, in Theorem 1.5 we have to obtain the two scalings of the relative entropy under disjoint assumptions.By contrast, Formula 1.1 with τ α∞ = 0, and hence (1.35), unifies the two cases under the simpler and more general requirement that all the eigenvalues of Q, and hence all the degrees, diverge.Actually, (1.35) is expected to hold in the even more general hybrid case where there are both finite and growing degrees, provided the number of finite-valued eigenvalues of Q grows slower than α n [7].
Other constraints.It would be interesting to investigate Formula 1.1 for constraints other than on the degrees.Such constraints are typically much harder to analyse.In [5] constraints are considered on the total number of edges and the total number of triangles simultaneously (K = 2) in the dense regime.It was found that, with α n = n 2 , breaking of ensemble equivalence occurs for some 'frustrated' choices of these numbers.Clearly, this type of breaking of ensemble equivalence does not arise from the recently proposed [7] mechanism associated with a diverging number of constraints as in the cases considered in this paper, but from the more traditional [10] mechanism of a phase transition associated with the frustration phenomenon.
Outline.Theorem 1.5 is proved in Section 2. In Appendix A we show that the canonical probabilities in (1.15) are the same as the probabilities used in [1] to define a δ-tame degree sequence.In Appendix B we explain the duality between the sparse regime and the ultra-dense regime.

Proof of the main theorem
In Section 2.2 we prove Theorem 1.5.The proof is based on two lemmas, which we state and prove in Section 2.1.

Preparatory lemmas
The following lemma gives an expression for the relative entropy.Lemma 2.1.If the constraint is a δ-tame degree sequence, then the relative entropy in (1.12) scales as where Q is the covariance matrix in (1.27).This matrix Q = (q ij ) takes the form Proof.To compute q ij = Cov Pcan (k i , k j ) we take the second order derivatives of the loglikelihood function . Indeed, it is easy to show that the first-order derivatives are [3] and the second-order derivatives are This readily gives (2.2).The proof of (2.1) uses [1, Eq. (1.4.1)], which says that if a δ-tame degree sequence is used as constraint, then where Q and p * are defined in (2.2) and (A.2) below, while e C is sandwiched between two constants that depend on δ: From (2.6) and the relation H(p * ) = − log P can (G * ), proved in Lemma A.1 below, we get the claim.
The following lemma shows that the diagonal approximation of log(det Q)/nf n is good when the degree sequence is δ-tame.Lemma 2.2.Under the δ-tame condition, with Q D = diag(Q) the matrix that coincides with Q on the diagonal and is zero off the diagonal.
Proof.We use [6,Theorem 2.3], which says that if (2.9) Here, A = Q −1 D Q off , with Q off the matrix that coincides with Q off the diagonal and is zero on the diagonal, λ i (A) is the i-th eigenvalue of A (arranged in decreasing order), λ min (A) = min 1≤i≤n λ i (A), and ρ(A) = max 1≤i≤n |λ i (A)|.
(1) Since Q is a symmetric matrix with real entries, det Q exists and is real.
(2) This property holds thanks to the δ-tame condition.Indeed, since which implies that 0 (2.11) (3) It is easy to show that A = (a ij ) is given by where q ij is given by (2.2).Since q ij = q ji , the matrix A is symmetric.Moreover, since q ii = j =i q ij , the matrix A is also Markov.We therefore have (2.13) From (2.10) and (2.12) we get (2.14) This implies that the Markov chain on {1, . . ., n} with transition matrix A starting from i can return to i with a positive probability after an arbitrary number of steps ≥ 2. Consequently, the last inequality in (2.13) is strict.
We next show that Here, π = (π i ) n i=1 is the invariant distribution of the reversible Markov chain with transition matrix A, while µ min (L) = min 1≤i≤n λ i (L) and γ = min 1≤i≤n a ii , with L = (L ij ) the matrix such that, for i = j, L ij = 1 if and only if a ij > 0, while L ii = j =i L ij .
We find that π i = 1 n for 1 ≤ i ≤ n, L ij = 1 for 1 ≤ i = j ≤ n, L ii = n − 1 for 1 ≤ i ≤ n, and γ = 0. Hence (2.17) becomes where the last inequality comes from (2.14).To get (2.16) it therefore suffices to show that f ∞ = lim n→∞ f n = ∞.But, using the δ-tame condition, we can estimate and both bounds scale like 1 2 log n as n → ∞.

Proof of Theorem 1.5
Proof.We deal with each of the three regimes in Theorem 1.5 separatetely.
The sparse regime with growing degrees.Since k * = (k * i ) n i=1 is a sparse degree sequence, we can use [2, Eq. (3.12)], which says that  Because the degrees are growing, we also have (2.28) Both sides tend to 2 as n → ∞, and so (2.27) follows.

A Appendix
Here we show that the canonical probabilities in (1.15) are the same as the probabilities used in [1] to define a δ-tame degree sequence.For q = (q ij ) 1≤i,j≤n , let be the entropy of q.For a given degree sequence (k * i ) n i=1 , consider the following maximisation problem: Since q → E(q) is strictly concave, it attains its maximum at a unique point.
Lemma A.1.The canonical probability takes the form where p * = (p * ij ) solves (A.2).In addition, Proof.It was shown in [2] that, for a degree sequence constraint, , where θ * has to be tuned such that On the other hand, the solution of (A.2) via the Lagrange multiplier method gives that where φ * has to be tuned such that

B Appendix
We explain the duality between the sparse regime and the ultra-dense regime.Let k * = (k * i ) n i=1 be an ultra-dense degree sequence, .20) where g(k) = log k! k k e −k is defined in (1.53).Since the degrees are growing, we can use Stirling's approximation g(k) = 1 2 log(2πk) + o(1), k → ∞, to obtain n i=1 g(k ij − g ij (G * )) = 0, (A.9)where the last equation follows from the fact thatj =i g ij (G * ) = j =i p * ij = k * i , 1 ≤ i ≤ n. (A.10)