LARGE DEVIATIONS IN RANDOMLY COLOURED RANDOM GRAPHS

Models of random graphs are considered where the presence or absence of an edge depends on the random types (colours) of its vertices, so that whether or not edges are present can be dependent. The principal objective is to study large deviations in the number of edges. These graphs provide a natural example with two different non-degenerate large deviation regimes, one arising from large deviations in the colourings followed by typical edge placement and the other from large deviation in edge placement. A secondary objective is to illustrate the use of a general result on large deviations for mixtures.


Introduction
This paper considers, in the first instance, the following model for random graphs. Each vertex is independently assigned one of a finite number of colours, drawn from a set Σ, and then the presence of an edge is determined independently with a probability that depends on the colours of its two vertices. Thus there are two sources of variation, the generation of the colours and the subsequent generation of the edges. In such a model, the colouring induces some correlations in whether or not edges arise. The colouring itself is regarded as invisible: it is the characteristics of the resulting random graph which are the focus of attention. These models with correlation structure were introduced in [10] and the motivation for the construction and areas of application for the model are discussed in [4]: however, familiarity with these two treatments is neither assumed nor needed here. This mechanism for producing correlated graphs has been considered also in [5] and [9], both of which refer to an earlier version of this paper. One of the referees reminded us that the model is closely related the model for inhomogeneous random graphs introduced, and examined closely, in [3] -it would fall within that framework if, when there were n vertices, n times the probability of an edge depended only on its vertices' colours.
290 DOI: 10.1214/ECP.v14-1478 Throughout, graphs will be finite and undirected, without loops or multiple edges. Given n, the number of vertices, and k = |Σ|, the finite number of colours, each vertex is coloured independently, receiving colour i with probability s i > 0. The probability that an edge between a vertex of colour i and one of colour j arises is p i j ; thus P = (p i j ) is symmetric. We will consider the family of such models as n varies, with k, s T = (s 1 , s 2 , . . . , s k ) and P being fixed. Let α be the overall probability that an edge arises, so that α = s T Ps. Note that if every entry in P is equal to α this framework will be equivalent to the classical model of random graphs G(n, α) (see [2]), once the colours are ignored. We use P and E for probability and expectation associated with these models. Let be the number of edges present and let c n = n(n − 1)/2 be the number of potential edges. Then E = c n α. Let P n be the probability distribution of /c n . The probability of a large deviation in the number of edges is considered: P( > c n β) (= P n {(β, ∞)}) for β > α, for example. Large deviation theorems show that this probability is, very roughly, e −I(β)a(n) for suitable I and a(n), and when such a result holds, ignoring some details of formulation supplied later, a large deviation principle (LDP) holds with constants (a(n)) and rate I. Here, qualitatively, two regimes may be anticipated. When some distribution of colours can produce an expected number of edges at least as large as c n β it will be enough to consider the probability of getting extreme colourings of this kind together with the typical number of edges for the colouring. Since this is an unusual outcome from the n independent random colourings it is plausible, based on standard large deviation theory, that a(n) = n in this case. When β cannot be obtained in this way, it will be necessary for the number of edges (which arise from c n independent variables given the colouring) to be exceptional too, and then it is plausible that a(n) = c n . The main result here confirms these speculations and specifies the function I in the two regimes. Before the main theorem can be stated, notation to describe I is needed. The Fenchel dual of φ : R → R is the convex function Let A(θ ) i j = log(1 − p i j + p i j e θ ) and let ∆ be the set of probability distributions on Σ, the set of colours, where elements of ∆ are viewed as k-vectors with non-negative components adding to 1. and (1.2) Theorem 1.1. Suppose vertices are coloured independently from k colours with probabilities (s 1 , s 2 , . . . , s k ).
(ii) P n satisfies an LDP with constants (c n ) and rate Φ( y) = inf{φ * x ( y) : x ∈ ∆}. Note that (i) and (ii) both hold for all y. This does not contradict the idea that there are two distinct regimes provided Φ is zero when Ψ is finite and non-zero. This is the relevance of the next result, which needs a little more notation. Define: m = inf{x T Px : x ∈ ∆} and M = sup{x T Px : x ∈ ∆}; l = inf{x T I(p i j = 1)x : x ∈ ∆} and L = sup{x T I(p i j > 0)x : x ∈ ∆}.
These are attained because ∆ is compact, and l ≤ m ≤ M ≤ L. Note that m and M are the extremes for the (normalised) expected number of edges as the proportions of colours vary.      In G(n, α), m = α = M , and so the 'inner' large deviation regime (with constants (n) and rate Ψ) is degenerate. The approach produces, without much difficulty, results for some more general models. For example, it is not essential to colour each vertex independently, what matters is that the distributions of the numbers of colours obeys a suitable LDP (which it does in the independent case). This is formulated precisely in Theorem 5.1. Section 2 illustrates how Theorem 1.1 applies in an example with two colours and a slight extension. Section 3 describes the general large deviation results used. Section 4 looks at the large deviation behaviour of the number of edges given that the colouring is according to some fixed proportions asymptotically. In Section 5, these results combine with suitable assumptions about the colouring to prove Theorem 1.1. Theorem 1.2 is proved in Section 6. Finally, in Section 7 the possibilities of drawing colours from a larger set and associating a random variable that takes values other than zero and one with every edge are discussed briefly.

An Example
To show the results above can be made more explicit in some cases, we let |Σ| = 2, and let p be the probability of an edge between vertices of the same colour and q the probability of an edge between opposite colours. Letting x = (x, 1 − x) T , we have and so m = min (p + q)/2, p , M = max (p + q)/2, p , l = 0 and L = 1. The regime described in part (i) of Theorem 1.1 is examined in the first lemma and that described in part (ii) in the second.
is easily solved to give the roots 1 Then x( y) is the smaller of these two roots. There are just two candidate distributions to minimise over in the formula in Theorem 1.1(i): (x( y), 1 − x( y)) T and (1 − x( y), x( y)) T . Using s ≤ 1/2 eliminates the second of these.

Hence the optimum choice for x in the definition is either 'all one colour' (when y ≥ M ) or 'equal proportions of the two colours' (when y ≤ m). Furthermore
If q > p then φ * (1/2,1/2) and φ * (1,0) are interchanged in the formula above for Φ.
and similarly, when y ≥ M , the supremum may be restricted to θ > 0. By (1.1) is positive for θ < 0 and negative for θ > 0. For y < m, a value of 2x(1 − x) closer to its maximum will give a smaller value of φ * x ( y) for fixed y; and 2x(1− x) is maximised when x = 1/2. This gives the asserted form for Φ( y) in these cases. Similarly, when y > M , it is θ > 0 that matters and now (2.3) has to minimised, which occurs when x is either 0 or 1. When q > p, (2.3) is negative for θ < 0 and positive for θ > 0, interchanging the optimal mixtures.
In Lemma 2.2 the regime in Theorem 1.1(ii) arises by first picking the colouring to maximise (or minimise) the expected number of edges and then obtaining a large deviation in the number of edges from that colouring. However, the choice of the best colouring in Theorem 1.1(ii) need not arise in this way. To illustrate this, consider now three colours, with the matrix P given by Then it is easy to show that m and M are the same as if only the first two colours were considered. The minimum number of expected edges is obtained when the first two colours occur with probability one-half each.
and so in addition we can choose is obtained by minimising φ * x ( y) over the possible colourings. One possible x is (1/2, 1/2, 0) T and so Lemma 2.2 gives Considering y = 0, Thus, for y ≥ 0, but sufficiently small, the colouring (1/2, 1/2, 0) T , which gives the minimum expected number of edges, is certainly not the optimal one in Theorem 1.1(ii).

Large deviations: general results
The sequence of probability measures (P n ) on a (Polish) space Ω obeys a large deviation principle (LDP) with constants (a n ), tending to infinity, if there is a lower semi-continuous (lsc)  G(n, α). The next result, which is a version of the Gärtner-Ellis Theorem, assumes much less about S n . Theorem 3.1. Suppose (S n ) is a sequence of random variables, and (a n ) is a sequence of constants with lim n→∞ a n = ∞; let P n be the distribution of S n /a n . Define φ n (θ ) = a −1 n log(E(e θ S n )). Assume that lim exists pointwise and is finite and differentiable for all θ . Then (P n ) satisfies the LDP with constants (a n ) and rate function φ * .
Proof. See Whenever x or x n are used they are members of ∆, the probability distributions on the set of colours, even when this is not made explicit. Let N n be the vector-valued random variable which gives the number of vertices of the various colours. Let ∆ n ⊂ ∆ be the set of possible values for n −1 N n . Let Q n x be the conditional distribution of /c n when the number of vertices is n and the actual distribution of vertex colours is x ∈ ∆ n . Let µ n be the distribution over ∆ n of n −1 N n that arises from selecting colours independently according to s. The marginal distribution of /c n , P n , which is all that is seen when colours are invisible, is obtained by mixing over x with µ n , and is given by This suggests that the behaviour of P n should be understood through large deviation results for mixtures. That motivated a separate study reported in [1], extending results in [6] and [8].
The general result gives conditions for (P n ) given by (3.5) to obey an LDP when (µ n ) and (Q n x ) satisfy suitable LDPs. Specialising the general result (specifically, Theorem 1 in [1] simplified using Lemma 3 and Proposition 4 there) to the framework here gives the following, which does not actually require that µ n arises from independent colouring. Theorem 3.2. Suppose that (i) µ n satisfies an LDP with constants (a n ) and good rate function ψ; (ii) whenever x n ∈ ∆ n and x n → x ∈ ∆, (Q n x n ) satisfies an LDP with constants (a n ) and rate λ x ( y); lsc in ( y, x), jointly.
Then P n satisfies an LDP with constants (a n ) and rate Furthermore, if, for each x, λ x ( y) is a good rate function then λ is good.
Note that this theorem needs an LDP with the same constants for both the mixing distribution and the conditional distribution. In either case, these may not be the 'natural' constants for the LDP. To deal with this the next lemma gives a simple result on changing the constants in any LDP. Lemma 3.3. On , let (P n ) obey an LDP with constants (a n ) and rate I.
(i) If a n /b n → 0 and {x : I(x) < ∞} is dense in then (P n ) obeys an LDP with constants (b n ) and rate that is zero everywhere.
(ii) If b n → ∞, a n /b n → ∞ and I is zero at a single point z then (P n ) obeys an LDP with constants (b n ) and rate that is zero at z and infinity elsewhere.
Proof. For the first part, since log P n {F } ≤ 0 the required bound on log P n {F } certainly holds. Now note that the bound on log P n {G} in (3.4) is finite, because every open set contains a member of any set that is dense in , and so converges to zero when multiplied by a n /b n . For the second part, note first that the bound involving log P n {G} is automatic if z / ∈ G, as is the bound involving log P n {F } if z ∈ F . Now suppose z / ∈ F . Then, since I is lsc and z is its only zero, inf{I( y) : y ∈ F } > 0 and so multiplying the bound in (3.4) by a n /b n gives the required infinite limit. The remaining case arises when z ∈ G. Then z / ∈ G c , where G c is the (closed) complement of G, and so inf{I( y) : y ∈ G c } > 0. Now the original LDP gives, rather comfortably, that P n {G c } → 0. This implies that log P n {G} → 0, which is more than enough to ensure that b −1 n log P n {G} → 0.
Clearly, information on the large deviation behaviour of (Q n x n ) is needed to apply Theorem 3.2. The independence of the edge placement given the colouring means this is fairly easy to deal with, using Theorem 3.1. That is the next topic.

LDPs conditional on the colouring
The main objective in this section is to prove the following theorem concerning the conditional distribution of the number of edges given the colouring.
Theorem 4.1. When x n ∈ ∆ n and x n →x, (Q n x n ) obeys an LDP with constants (c n ) and rate φ * x , and φ * x ( y) is lsc in ( y, x).
The following lemma is a routine exercise using the independence of the edges given the colouring, that is given N n . The second and third are even easier.
, where A and φ x are defined just before Theorem 1.1.

Lemma 4.4. The mean of the distribution Q n
x is x T Px.
Theorem 3.1 relies on properties of the (suitably scaled) logarithm of the moment generating function. With a view to applying that theorem, let

Lemma 4.5.
If n −1 j n ∈ ∆ n , so that j n is a possible vector of numbers of vertices of each colour when there are n vertices, and n −1 j n →x, then Hence, using Lemma 4.3, The limit's differentiability is a consequence of A ′ i j (t) being bounded uniformly in (i, j) in any neighbourhood of θ and dominated convergence; its convexity follows from being the limit of convex functions; A(0) = 0 implies that φ x (0) = 0 for every x. For the last part, use [11,Theorem 12.2] to see that φ * * x = φ x and then [11, Theorem 27.1(e)] to complete the proof. Proof. Suppose x n →x and y n → y. Then, for any ε > 0, there is a finite θ such that and so, since φ x n (θ ) → φ x (θ ) by Lemma 4.3, as required.
Using the explicit form of A Proof of Theorem 4.1. Apply Lemmas 4.5 and 4.6 and Theorem 3.1.

Lemma 4.7.
Suppose that b n → ∞ and b n /c n → 0. When x n ∈ ∆ n and x n →x, (Q n x n ) obeys an LDP with constants (b n ) and rate λ x , where λ x (x T Px) = 0 and λ x ( y) = ∞ elsewhere. Furthermore λ x ( y) is lsc in ( y, x).
Proof. The LDP and the form of λ x follow directly from Lemma 3.3(ii) and the last part of Lemma 4.5. A routine verification shows λ x ( y) is lsc.

LDPs for the number of edges
The next result does not presume that the distribution of colours on n vertices, µ n arises from independent choices. Theorem 1.1 will be derived by specialisation from this one. (ii) Suppose the colouring (µ n ) obeys an LDP with constants (c n ) and rate function that is zero throughout ∆. Then (P n ) satisfies an LDP with constants (c n ) and rate Φ( Proof. The first part is an application of Theorem 3.2 and Lemma 4.7. Note that, because ∆ is compact, the rate function that is identically zero on ∆ is good. Now the second part is an application of Theorems 3.2 and 4.1. The next result show that independent colourings produce (µ n ) with the right properties for both parts of Theorem 5.1.

Lemma 5.2.
For independent colouring with a finite number of possible colours, (µ n ) obeys an LDP with constants (n) and good rate function (on ∆). Furthermore, (µ n ) obeys an LDP with constants (c n ) and rate function that is zero everywhere.
Proof. When N n has a multinomial distribution, the distributions of n n = n −1 N n satisfy an LDP with constants (n) and rate given by

Properties of the rate functions
In this section Theorem 1.2 is proved after giving three preliminary Lemmas. The arguments rely heavily on the fact that ∆ is compact. Lemma 6.1. Suppose the convex functions φ n converge to φ, which is necessarily convex, as n → ∞.
Without the assumption that ψ is finite on ∆ the proof of Lemma 6.3 still works to show that Ψ is monotone when finite either side of its minimum. However, it may be infinite for some values within On the other hand, when y = l direct calculation shows that φ * x (l) < ∞ for any x that provides the infimum in the definition of l. Considering θ → ∞ shows that Φ( y) = ∞ for y > L and Φ(L) < ∞. This proves the 'only if' part of (v). Take y < m. By Lemma 6.2 we know that for ε > 0 there is a suitable x * such that Since y < m, both φ * x * ( y − ε) and φ * x * ( y) are strictly positive, by part (iv). Hence there must be some δ > 0 such that Hence Φ( y − ε) ≥ Φ( y) + δε which gives strict monotonicity when Φ( y) is finite. Furthermore taking y −ε = l and using Φ(l) < ∞ shows that Φ( y) is finite for l < y < m. The range M < y < L is handled similarly. This completes the proof of (v) and (vi).

Extensions
Suppose that the set of available colours, Σ, is a Polish (i.e. complete, separable metric) space and P is continuous on Σ × Σ. Let ∆ be the set of probability distributions on Σ (equipped with the Lévy metric, which gives the topology of weak convergence of distributions and makes it a Polish space, see  For fixed θ , A(θ ) is a bounded continuous function on Σ × Σ and the product measure x n × x n on Σ × Σ converges weakly to x × x. Proof. By Sanov's Theorem ([7, §6.2]) the first part of Lemma 5.2 holds, and the rate is finite exactly for those x ∈ ∆ that are absolutely continuous with respect to s. These are dense in ∆. Thus, using Lemma 3.3(i), the second part of Lemma 5.2 holds also. Now apply the generalised version of Theorem 5.1.
The second direction for extension associates a random variable with each pair of vertices that is more general than the indicator variables for the presence of that edge. Let M (σ 1 , σ 2 ; θ ) be the moment generating function of a random variable associated with an edge with vertices of colours σ 1 and σ 2 , with mean m(σ 1 , σ 2 ). Assume, for each θ , that M (σ 1 , σ 2 ; θ ) is a bounded continuous function on Σ×Σ, with a derivative that is bounded uniformly in Σ×Σ on a neighbourhood of any θ . For x ∈ ∆ let s 1 and s 2 be independent colours selected using x and let φ x (θ ) = log EM(s 1 , s 2 ; θ ) and m x = Em(s 1 , s 2 ). Finally, let be the sum of the variables over the edges and P n be the distribution of /c n . The next result is obtained by working through the details of the arguments leading to Theorem 5.1 and checking that nothing has changed. Theorem 7.2. (i) Suppose the colouring (µ n ) obeys an LDP, with constants (b n ), and good rate function, ψ, and (b n /c n ) → 0. Then P n satisfies an LDP with constants (b n ) and rate Ψ( y) = inf{ψ(x) : m x = y}.
(ii) Suppose ∆ is compact and the colouring (µ n ) obeys an LDP with constants (c n ) and rate function that is zero throughout ∆. Then P n satisfies an LDP with constants (c n ) and rate Φ( y) = inf{φ * x ( y) : x ∈ ∆}.

Other models
In the spirit of [3], the probability that an edge between a vertex of colour i and one of colour j could be p i j (n) when there are n vertices, with np i j (n) → c i j < ∞. Various large deviations for this model are obtained in [9]. Here we consider only the number of edges. Following the development in §4, large deviations arising from edge placement conditional on an asymptotic colouring will have constants (n), with a colouring of x giving φ * x ( y) = y(log y − log x t Cx) − y + x t Cx, which is, of course, the rate for a Poisson distribution with mean x t Cx. This is jointly lsc in ( y, x). Thus, when the colouring (µ n ) obeys an LDP with constants (n), and a good rate function, ψ, Theorem 3.2 give the overall large deviation rate for the number of edges with constants (n) to be