Phases of Small Worlds: A Mean Field Formulation

A network is said to have the properties of a small world if a suitably defined average distance between any two nodes is proportional to the logarithm of the number of nodes, N. In this paper, we present a novel derivation of the small-world property for Gilbert–Erdös–Renyi random networks. We employ a mean field approximation that permits the analytic derivation of the distribution of shortest paths that exhibits logarithmic scaling away from the phase transition, inferable via a suitably interpreted order parameter. We begin by framing the problem in generality with a formal generating functional for undirected weighted random graphs with arbitrary disorder, recovering the result that the free energy associated with an ensemble of Gilbert graphs corresponds to a system of non-interacting fermions identified with the edge states. We then present a mean field solution for this model and extend it to more general realizations of network randomness. For a two family class of stochastic block models that we refer to as dimorphic networks, which allow for links within the different families to be drawn from two independent discrete probability distributions, we find the mean field approximation maps onto a spin chain combinatorial problem and again yields useful approximate analytic expressions for mean path lengths. Dimorophic networks exhibit a richer phase structure, where distinct small world regimes separate in analogy to the spinodal decomposition of a fluid. We find that is it possible to induce small world behavior in sub-networks that by themselves would not be in the small-world regime.

are performed makes it possible to demonstrate small-world scaling analytically in the large N limit.
There is a qualitative distinction however between the small-world scaling seen in Erdös-Renyi-Gilbert and Watts-Strogatz classes of networks.The former exhibit a smaller clustering coefficient than the latter, whereas many real world examples of small-world networks exhibit large clustering coefficients [14].Realizations of random networks that model a wider range of real systems can be obtained by specifying different degree distributions, by which one can analytically study the distribution of shortest path lengths [16][17][18][19][20], as well as the shell (i.e.differential) [21][22][23] and cycle structure [24].In many contexts of interest, networks are not static entities but rather grow over time.Analytic studies of the distribution of shortest paths have also been made in the context of network growth via node duplication, as detailed in [25,26].
Erdös-Renyi graphs are nevertheless useful in understanding the properties of real world networks through the variety of analytical results that can be proved for them 3 .Perhaps the most celebrated of these is the critical probability found in the semi-regular network structure of [15] also exists in the purely random context [10,11].There exists a threshold value of p c ∼1/N above which statements about any representative graph are almost always true.It can be demonstrated, for example, that for p > (log N )/N there will be a 'giant component' containing all nodes in the large N limit [10,28,29] 4 .The emergence of such a hub structure is central to the small-world scaling of large networks 5 .However, although one can demonstrate small-world scaling of the average distance between nodes, , in an Erdös-Renyi-Gilbert network in limiting cases where p (log N )/N (or vice versa), an analytic understanding of the approach to the transition point for remains elusive.
Furthermore, although the semi-regularity of the Watts-Strogatz class of networks permits a continuum generalization for which a variant of the mean field approximation has been proposed [32], direct application of such methods fails for Erdös-Renyi-Gilbert graphs because of the lack of an underlying lattice sub-structure 6 .In this paper, we present another variant of the mean field approximation, not predicated on a continuum generalization of the underlying graph structure that allows for an analytic demonstration of small world scaling in Erdös-Renyi-Gilbert random networks.In the case of Watts-Strogatz graphs [14,15], the underlying lattice structure results in a phase transition at p = 1/N from an ∝ N scaling to an ∝ log N scaling.For Erdös-Renyi-Gilbert graphs, the (percolation) transition occurs at a critical p c = 1/N [34][35][36] and is of a somewhat different nature due to the absence of an underlying lattice.Here, the transition is from a regime characterized by the existence of multiple disconnected components of similar size (naturally identifiable as 'domains') to a regime dominated by a single giant connected component.Moreover, we can show that the mean field approximation fails close to the critical point between these two regimes even in the large N limit due to its inability to cope with the inherent inhomogeneities when the network exists in a phase composed of multiple disconnected components.However, the utility of the approximation described here, characteristic of any mean field approximation, is that it offers analytic understanding of a restricted class of phenomena.Fortunately, the emergence of small-world scaling away from the critical point is among them.
The assumption that all nodes in a network have the same probability of forming links is evidently an idealization of real networks in which some nodes can have an increased probability of forming links.This is the case, e.g., when considering co-author linkages within a given academic field.Paul Erdös had some 240 co-authors, which is unusually large in mathematics.The ability of 3 Remarkably, the simple abstraction represented by an Erdös-Renyi network may even offer a model for certain macroscopic neuronal oscillations [27]. 4As we will see below, when p = κ/N the number of particles not in the giant component is O(N ).When κ → log N , the number of nodes not in the giant component is O(N 0 ).In other words, past the critical edge probability p * = (log N )/N , there are no longer any finite clusters in the large N limit. 5However, many interesting properties can also be inferred for sub-critical Erdös-Renyi networks, such as the degree distribution of the giant component [30], and the distribution of shortest paths across all components [31]. 6See however [33] for a network model with link randomness that interpolates between the Watts-Strogatz and Erdös-Renyi-Gilbert models.
such special nodes to reduce the path lengths was noted by Karinthy in 1929: "It's always easier to find someone who knows a famous or popular figure than some insignificant person".Fortunately, the mean field approximation is readily generalized to describe graphs containing such inequivalent nodes, and it will be shown that qualitatively new network behavior emerges from this extension.We consider a simple two family stochastic block variant of the Erdös-Renyi-Gilbert network, where links within a given family appear with fixed but distinct probabilities and links between the families appear with some finite probability and allowing for the relative sizes of these families to be arbitrary.This is not quite the widely studied planted partition stochastic block model, as we allow for the links within members of each family to appear with different probabilities, and so we will refer to this variant in what follows as a dimorphic network.
The dimorphic variant of the Erdös-Renyi-Gilbert network exhibits a richer phase structure than the standard case and is also accurately modelled by the mean field approximation provided that the network does not consist of "too many" disconnected components.One phase corresponds to the situation where the network factorizes into two strongly connected sub-networks with a limited number of 'bridge' links between them.The transition to this phase from a more homogeneous, but still disordered phase is roughly analogous to the spinodal decomposition of fluids.We also find that it is possible to induce small world behavior in a sub-network even if it does not meet the criteria to be in the small-world regime by itself, provided it connects to a sub-network that does.One can also envision a variant of the dimorphic network where the links within and between subnetworks have different weights.The formalism described here can readily be extended to describe such, and we shall pursue this possibility in subsequent investigations.
The remainder of this paper is organized as follows.In section II, we construct a formal generating functional for an arbitrary undirected weighted network, recovering the result that the associated free energy for an ensemble of Gilbert graphs corresponds to a system of non-interacting fermions residing at the edges.We also show how one can obtain formal expressions for ensemble averages of various network observables such as the average degree of the network, the degree distribution as well as the distance matrix.We note, however, that actually evaluating these quantities will be unduly cumbersome in practice.In section III we introduce a mean field approximation that facilitates the evaluation of the ensemble average of the distance matrix for Erdös-Renyi-Gilbert networks and demonstrate that it accurately reproduces the small worlds scaling away from the critical edge probability p * = (log N )/N .We show that this approximation fails as one approaches the latter critical point, and that this is to be expected since the network fragments into multiple domains.In sections IV and V, we generalize the mean field approximation to dimorphic networks and consider its different phases.The various technical details will be relegated to appendices.We offer concluding remarks in section VI, where we discuss generalizations of the mean field approximation presented here to more general varieties of network disorder.

II. RANDOM NETWORKS FROM RANDOM MATRICES
Various properties of a network can be obtained from its associated adjacency matrix, A. All diagonal elements are 0.For unweighted networks, the off-diagonal element A ij is 1 if nodes i and j are connected by an edge and otherwise 0. For weighted networks the non-vanishing entries of A ij can be any real positive number 7 .Undirected networks have symmetric adjacency matrices; directed networks do not.It is clear that random networks can be described by the associated ensemble of random adjacency matrices defined by a particular probability measure.
Given a probability measure P (A) over the space of N × N real matrices where we can define the generating functional such that expectation values of arbitrary powers of the adjacency matrix can be obtained from successive derivatives of Z[J] The Gilbert-Erdös-Renyi model [11] corresponds to an unweighted, undirected network of N nodes, where a link between any two nodes occurs with a fixed probability p.The associated probability measure is given by8 Computation of the generating functional Z[J] for any given probability measure is straightforward since the measure and the source term factorize as It follows directly from Eq. 5 that We can also define the generating function, W [J], for all connected correlation functions as which from Eq. 7 is given by Since the pre-factor in Eq. 7 serves only to normalize Z[0] = 1, it can be discarded provided that all moments are obtained by dividing Eq. 4 by Z[0].The generating function for Gilbert random graphs then becomes with a corresponding free energy W [J] given by We note that the above corresponds to the free energy for an 'exponential random graph' obtained from a probability measure that maximizes the Gibbs entropy subject to a particular set of constraints [37].As noted in [37], the partition function Eq. 10 and free energies Eq. 11 correspond to a system of non-interacting fermions localized on the links.This is made even more apparent when one calculates the one particle occupation numbers: Taking the appropriate derivatives of Eq. 10 with respect to the source components J ij , one can obtain ensemble averages of any network observable that can be expressed in terms of the adjacency matrix.In the case of unweighted networks for instance, the average number of paths of length k connecting nodes i and j, defined as # ij (k) is given precisely by Eq. 4: The degree of the i th node in any given network realization is given by the bilinear form (e i , Au) where e i is the i th unit vector, and where u = e j is the vector with 1 in all of its entries.Therefore the ensemble averaged degree of the i th node, defined as k i , is given by Note that this need not be the same for all i as the P ij in Eq. 2 need not be the same for all links connecting nodes i, j.The average degree of the entire network, k , can be obtained as The analogs of the above expressions for general heterogeneous networks can also be found, for instance in [38][39].The average value of the shortest path length between any two nodes is of particular interest in this investigation.This first requires us to specify the notion of a distance on a network.For a general weighted network, a natural (although by no means unique) choice is provided by the analog of effective conductance in an electrical circuit [40]: where the sum includes all possible paths connecting nodes i and j.For the unweighted networks to be considered here, this reduces to the usual notion of the minimum number of links connecting nodes i and j.In this case, the diagonal elements of the distance matrix D are defined as 0, and the off-diagonal elements are smallest number of links connecting any pair of nodes (which can be infinite if no such path exists).The average distance between any two nodes is thus given by Proving the small worlds property for a given class of random networks thus consists in proving the limiting behavior lim Depending on the particular realization of network randomness, the resulting distance matrix can prove to be disconnected.This means that D can be brought into block diagonal form by a similarity transform involving a permutation matrix The individual blocks will correspond to connected component graphs, and the off-diagonal block entries will be infinite.In such cases, it seems natural to define an average distance exclusively on the basis of sums performed within the distinct connected components.
There are a variety of algorithms for obtaining the distance matrix of a particular network given its adjacency matrix, for instance Dijsktra's algorithm and its variants [41].In the special case of an unweighted network, however, one can also obtain a formal expression for the distance matrix in terms of the adjacency matrix.Given that the k th power of the adjacency matrix has entries A k ij that count the number of paths of length k between nodes i and j, the shortest distance between any two nodes i, j is given by the first power k for which A k ij = 0. Therefore, An analytic approximation to the minimum function (exact in the limit Λ → ∞) is given by where the offset of the Heaviside step function could be any real number between 0 and 1.In particular, we wish to calculate the ensemble expectation value of the above expression, that is As it stands, Eq.21 is calculationally cumbersome.It is tempting to bring the expectation value in Eq.21 inside the logarithm by perhaps assuming that network disorder is "annealed", or (by some abuse of terminology) invoking a variant of the replica trick [42,43].It is unclear if either assumption is justified.Moreover, with the exception of Edwards-Anderson type (Gaussian) disorder for weighted networks [43] (requiring the more general metric Eq.16), it is unclear if any calculational advantage is to be gained.Rather, in the next section we will suggest a way to approximate the above for the special case of unweighted networks using a particular variant of the mean field approximation.

III. SMALL WORLDS -A MEAN FIELD DESCRIPTION
In this section we consider a "mean field" description of Gilbert-Erdös-Renyi random networks.Although this description is not exact, it will be seen to provide a semi-quantitative description of their properties.For the case of unweighted networks, we see from Eq. 19 that the elements of the distance matrix D ij give the length of the shortest path between nodes i and j.This is simply the smallest integer k such that A k ij is non-zero.It should be clear that no such shortest path can involve any repeated indices in the product of the k adjacency matrices since this would correspond to backtracking over a previous step.The determination of the distribution of shortest path lengths involves two steps.First, we must determine the probability that A k ij is non-zero for a given value of k.This is given as one minus the probability that A k ij vanishes subject to the constraint that there are no repeated indices in the intermediate summations within the matrix product.One simply computes the probability that the string A ii 1 A i 1 i 2 ...A i k−1 i k vanishes, where i 1 ...i k−1 are summed over subject to the constraint that no index is repeated.From this, one sees immediately that the probability, p k , that there will be a shortest, non-backtracking path 9 of length k between the nodes i, j is given by where The probabilities p k represent a true ensemble average for the unweighted network.The second part of the calculation requires us to modify the p k by imposing the constraint that there is no path of length less than k that connects the nodes in question.Since it is difficult to impose this constraint exactly, we will proceed as follows.The ensemble average probability, q k , that there does not exist a shortest path of length k is 1 − p k .Using this ensemble averaged quantity, the probability that the shortest path will be exactly of length k (and no shorter), denoted as P (k) can be estimated as We note that there is also some probability, P ∞ , that there will be no path of any length connecting two nodes.This probability is readily seen to be As we shall see shortly, this quantity is directly relates to the size of the largest connected component (c.f. the quantity F ∞ in [23]).With the inclusion of this additional term (which can be 0), the probability distribution function (PDF) will have the correct normalization for N = 10 4 (blue dotted), 10 6 (blue dashed), and 10 8 (black).Using Eq. 31 we find that x mode = 7.93, 12.12 and 16.32 respectively, consistent with k mode being identified by [x mode ] ± as discussed below Eq. 31.
These results would be exact if the matrices A k for various values of k were uncorrelated.Unfortunately, this is not the case.The operation of ensemble averaging does not commute with other aspects of the computation and should be performed last.It is thus an approximation to make use of ensemble averaged values of q k in the calculation of the P (k), and it remains to be seen whether this approximation is reliable 10 .We note, however, the strong similarity of this approximation to the mean field approximation familiar from statistical mechanics and many-body physics.Mean field results can be useful provided that the system is homogeneous with correlations/fluctuations that are sufficiently small.Determination of the degree of reliability of mean field results in the present case will require comparison with simulations.
In the following examples of mean field results and their comparison with the results of simulations, we will consider the choice This is motivated by our wish to model systems for which the properties of the individual nodes (e.g., the average number of links per node, κ) are independent of the size of the system.Although more elaborate choices of p might be appropriate for specific systems, their adoption would require physical justifications that are beyond the scope of our investigation.The simulations were done over ensembles consisting of 10 2 samples, and converge rapidly away from the critical point.Fig. 1 shows the values of P (k) determined by Eqs.22 -24 for several values of N .Consistent with small-worlds expectations, the peak of the distribution increases logarithmically with N and its width is roughly independent of N .Thus, relevant features of this distribution can be determined from a number of terms proportional to log N .Although we have verified the validity of the mean field approximation for different values of N up to N = 10 3 , note that it very challenging to perform simulations for values of N as large as those shown in Fig. 1.This figure provides a strong indication of small worlds behavior for this choice of κ, although we shall see below that this result is not true in general.
An analytic expression of how the mean field description captures these essential features of the distribution of path lengths can be obtained by considering the maximum value (i.e., the mode) of the P (k) distribution for large N .In fact, this expression will also tell us when we are in the small-worlds domain.From Eq. 24 we see that The distribution will have an extremum whenever this ratio is equal to one.Imposing this condition implies that Replacing k with the continuous variable x, using the analytic approximation Γ(N +α)/Γ(N ) → N α as N → ∞, and using the fact that, for example, we see that Eq. 29 is equivalent to the condition Numerically evaluating the root of the above for τ as a function of κ, and solving for x which we identify as x mode results in11 where r(κ) is the root of Eq. 30.Given that k is a discrete variable, whose continuous generalization x attains a maximum at some value, the most we can conclude is that k mode is either of the nearest integers rounded up or down around the value obtained from Eq. 31, denoted [x mode ] ± .As seen in Fig. 1, this provides a reasonably accurate determination of the mode of the PDF given by Eq. 24.
Note, however, the singular behaviour of k mode when the average number of links per node is κ ≤ 1.This is related to the fact that, for sufficiently small κ, the P (k) decrease monotonically with k and no local maximum exists, due to the fragmentation of the network into disconnected components.Moreover, we note that Eq. 31 diverges as 1/(κ − 1) as κ → 1 from above, in agreement with the divergence found for the mean path lengths in [31].
To see this more clearly, Fig. 2 shows the dependence of P ∞ on the average number of links per node, κ, as determined by the mean field result Eq. 25.As one passes through the critical edge probability p * = (log N )/N (which we rederive shortly), mean field results suggest that the composition of the network undergoes a significant change -an expected result from the perspective of percolation theory [34][35][36].For p > p * , essentially all nodes are linked to one another in a genuine small world state.For p < p * the network exists in a phase composed of a multitude of clusters of small size.In such a phase, there will be a significant number of nodes that are not linked.In other words, the mean field approximation predicts that P ∞ → 1 for κ N .We see from the figure that this transition becomes increasingly sharp with increasing N .It is tempting to regard P ∞ , or rather (1 − P ∞ ) 1/2 as an order parameter and to view this as a mean field indication of a phase transition at κ = 1.However, mean field descriptions of phase transitions are known to be incorrect for many systems (e.g., the Ising model in one and two dimensions) as a consequence of its failure to account for significant fluctuations near a critical point, rendering meaningless any simple averaged descriptions of the system.In fact, we are obliged to consider an entirely different quantity not obtainable from our mean field approximation (although well understood in the context of percolation theory [35,36]) as the order parameter pertaining to the phase transition in Erdös-Renyi-Gilbert random networks.We identify this order parameter in the next subsection, and turn to the question of how to interpret the mean field approximation in addition to comparing with simulations.

A. Mean fields and simulations
Before comparing the mean field results with simulations, we first consider the probability that a given node is a "hermit" with no links to any of the remaining (N − 1) nodes, which is one of the few results that can be determined exactly without the necessity of simulations.This probability is given by ( which approaches exp[−κ] in the limit of large N .This is an exact statement valid for all κ and N .Evidently, the number of nodes which have no connection with the largest small-worlds cluster must be greater than or equal to the number of such hermits.The latter can be similarly estimated via the assumption that for large enough N , the fraction of nodes contained in the largest cluster does not depend on N (although it does depend on κ).Denoting this fraction as f cluster , we realize that if we were to add one more node and if f cluster is to remain unchanged, the probability that this new node not belong to the largest cluster must be 1 − f cluster .That is which in the large N limit implies This is in fact the order parameter relevant to the percolation phase transition in Erdös-Renyi-Gilbert random networks [34][35][36].Unfortunately, this is not obtainable from our mean field approximation, which focuses on the links of the network as opposed to the number of nodes in the largest cluster.We note that Eq. 34 has only the trivial solution f cluster = 0 for κ < 1, whereas it also admits a non-trivial positive solution for κ ≥ 1, which also depicts simulations of the largest cluster size.Eq. 34 has the formal solution [30] where W (z) is the Lambert W function12 .However, by considering the quantity fcluster = 1−f cluster and defining κ = log N , one can rewrite Eq. 34 as Starting with fcluster = 0 and iterating the equation repeatedly, one obtains a power series expansion in (log N )/N and read off the general series coefficients to obtain the exact solution from which it is clear that fcluster → 0, or f cluster → 1 as N → ∞.
In order to compare the percolation order parameter f cluster with the mean field order parameter P ∞ , we realize that in the large N limit, the fraction of connected pairs of nodes is approximated to leading order by f 2 cluster .Hence, the fraction that are not connected is given by 1 − f 2 cluster .Thus, by comparing (1 − P ∞ ) 1/2 to f cluster , one can make a fairer determination as to whether the mean field order parameter accurately captures the nature of the phase transition 13 .As can be seen from Fig. 3 we see that the mean field results appear to get the nature of the phase transition wrong by suggesting a first-order transition (given the evident discontinuity developing in the thermodynamic limit) rather than the second-order transition suggested by the analytic approximation for f cluster .This failure of the mean field approximation is neither surprising nor alarming, and merely highlights its expected failure whenever fluctuations invalidate the mean field treatment.Nevertheless, the approximation ought to improve rapidly as one moves away from the critical point, which we now investigate numerically.It should come as no surprise that when the network consists of a giant connected component, the mean field approximation works well given the high dimensionality of system set by N .
We performed a series of simulations of the PDF for the quantities P (k) that describe the probability that the shortest path between two nodes will be of length k.The results of such a check are shown in Figs. 4 -6 for an ensemble size of a 100 samples of a system of N = 500 nodes with κ of 0.3, 1.5, and 3.0, respectively.Here, we have chosen to neglect the single term P ∞ .Thus, the final term in Eq. 26 has been neglected and the remaining terms renormalized so that their sum is 1.For the cases κ = 0.3 and 3.0, the system is expected to be relatively homogeneous.
In the former case, κ is simply too small for large clusters and thus large distances, k, to form.Although P ∞ is not negligible, it has no effect other than the renormalization of the P (k) shown in the figure.In the latter case, we have seen that the largest cluster is formed predominantly by the merger of smaller clusters.As can be seen from Eq. 32, all that remains is a small (i.e., exp[−κ]) fraction of isolated nodes in the large N limit.In both cases, the resultant homogeneity of the networks is relatively high, and the agreement between mean field and simulated results is reasonably good.In fact, for the sub-critical value of κ = 0.3, the exact distribution of shortest paths is known to be exponential, and given by [31] where we see from Fig. 4 that the mean field is in excellent agreement with the former.That the simulation differs is an artifact of the finite size of the simulated system.The case shown in Fig. 5 is rather different since the value of κ = 1.5 has been chosen so that the largest cluster in the simulation contains half of the nodes.The ensemble of adjacency matrices is expected to be maximally heterogeneous with considerable differences between its various elements.In short, the mean field description should be at its worst.Specifically, we should expect that the root-mean-square (rms) deviation of the P (k) should be relatively large and that the agreement with mean field results should be rather poor.
To conclude this section, we have presented a mean field description of the properties of an ensemble of randomly drawn adjacency matrices.This description is sufficiently simple to be applied to networks of size 10 7 or larger.It correctly describes the qualitative transition of the system from an set of unconnected nodes to one dominated by a single small-worlds connected network containing an increasing fraction of nodes as the number of links per node grows.This result was obtained by making the conservative assumption that the average number of links per node, κ, is independent of the size of the system, N .Any monotonic growth in κ as a function of N would necessarily result in a genuine small world involving the participation of all nodes in the thermodynamic limit N → ∞.Since many popular models build in small worlds behaviour by construction, we consider it appealing that random networks show similar behaviour generically.As expected, the mean field description fails to capture the true nature of the small world phase transition.Nevertheless, its description of the distribution of the distances between nodes appears to be quite reliable for all values of κ considered here.Thus, it is with some confidence that we can now turn to the more challenging and potentially more interesting topic of small worlds and dimorphic networks.
We now consider a two family stochastic block model in which m out a total of N nodes form links with each other with probability p s while the remaining N −m nodes form links with each other with probability p w .A planted partition model would correspond to the situation where p s = p w , and the balanced planted partition model would correspond to the situation where furthermore, m = N/2 [45].The probability that a link is formed between nodes in different families is p I .That is, the network factorizes into two independent Erdös-Renyi-Gilbert sub-networks with associated probabilities p s and p w respectively, with bridge links between the sub-networks appearing with probability p I .The subscripts s and w (strong and weak) are meant to suggest our eventual interest in the regime where one family is much more strongly connected than the other, although in what follows we allow them to be arbitrary 14 .
It is convenient to partition the index i ⊂ {1, ..., N } into lower case Latin a ⊂ {1, ..., m} for nodes in the 'strong' family and Greek α ⊂ {m + 1, ..., N } for nodes in the 'weak' family, so that the corresponding random adjacency matrix is given by p(A ab = 1) = p s (39) The generalization of the mean field approximation to the dimorphic network consists of calculating the probability that the shortest paths between two nodes i, j will be of length k.For k = 2 this can be done straightforwardly: In order to proceed for k > 2, it is useful to note that, for a string of adjacency matrix elements with the summation over the indices yet to be performed, the probability that this string vanishes is given by (no summation over indices) (41) where α 0 counts the number of times a pair of indices are both draw from the set {a} and α 1 counts the number of times a pair of indices are both draw from the set {α}.Therefore, the probability that there is a shortest path of length k between any two nodes i, j is given by where the subscripts {s, I, w} denote whether the pair of nodes i, j are both in set a, have mixed indices a, β or are both in α respectively, and Γ k,{s,I,w} α 0 α 1 counts the number of distinct ways in which the combination α 0 , α 1 appears in the sum without any repeated indices.The challenge is to calculate the combinatorial factors Γ k,{s,I,w} α 0 α 1 (see Appendix C), to determine the quantities q k,s := 1 − p k,s etc. and to construct the analogues of Eq. 24 with similar expressions for P I (k) and P w (k).These correspond to the probability that there will be a shortest path of length k beginning and ending in the strong linked sub-network (P s ), beginning and ending in the weak linked sub-network (P w ) or beginning in one and ending in the other (P I ).(The construction of these three quantities -the dimorphic analogues of the mean field approximation to the P (k) given by Eq. 24 -is presented in Appendix B.) As we note in the appendix, the calculation of the requisite combinatorial factors above maps onto the problem of computing the numbers of consecutively aligned spins on a finite spin chain with fixed boundary conditions.As we show in the next section, dimorphic networks evidently exhibit a rich phase structure.This includes a phase where small worlds behavior is induced in the weakly connected sub-network even if it is not itself within the small-worlds regime.

V. PHASES OF SMALL WORLDS IN DIMORPHIC NETWORKS
In the following, we consider the dimorphic network to consist of a 'strong' sub-network with p s well within what would be the small-world regime if it were an independent network and vary p w and p I .We find three distinct phases for the network which can be classified as disordered small worlds, spinodal small worlds, and induced small worlds.For each of these, we compare the results of simulations with our mean-field approximation, which as we shall see, remains accurate in these distinct phases provided the network as a whole does not decompose into too many disconnected components.In what follows, we consider the natural parameterization for dimorphic network probabilities where, as above, the full network consists of N nodes, the strong sub-network contains m nodes, and the weak sub-network contains N − m nodes.

A. Disordered small worlds
In this regime, we consider κ s = κ w = κ I such that individually, each κ i 2, chosen to keep the network fragmentation to a minimum to ensure the validity of the mean-field approximation.In Fig. 7, we see that the mean-field approximation accurately compares to simulations.By varying N , one also finds the small world scaling of paths that begin and end with a given subnetwork, or beginning in one and ending in another.The distinction between the sub-networks is not particularly relevant in this regime, and one can consider this network globally as a disordered small world, as can readily verified by increasing N and m.

B. Spinodal small worlds
In this regime, we consider κ s , κ w 2, with κ s , κ w κ I > κ I crit , where we have defined With these parameters, the network decomposes into two strongly connected sub-networks with a small number of bridge links between them.The critical value for κ I can be understood as the value much below which the strong and weak sub-networks fail to form any links between them.Precisely at the critical value, any given realization of the network will be as likely as not to form bridge links between the strong and weak sub-networks.Were one to begin in the disordered smallworlds regime and decrease κ I until it is much less than κ s and κ w , but still greater than κ I crit , the network would undergo a transition roughly analogous to spinodal decomposition in a fluid, wherein two phases co-exist and the transition occurs instantaneously due to the absence of any nucleation or latent energy difference between the two phases.We again compare the results of our mean-field approximation to simulations in Fig. 8, where we find good agreement for the mean and modes of the distributions.By virtue of the bridge links, one finds small world scaling in the spinodal regime for each type of path -whether beginning or ending in a given sub-network, or beginning in one and ending in another, as depicted in Fig. 9.
Here, the ratio m/N is kept fixed as N is increased.

C. Induced small worlds
In this regime, we consider κ s 2, κ w < 1 κ I 1 and once more compare the results of our mean-field approximation to simulations.In Fig. 10, we see that even when the weak subnetwork is not expected to be in the small world regime, the presence of bridge links with sufficient probability (κ I = 20 in this example) connects the individual nodes of the weak sub-network to the strong sub-network such that small world scaling is recovered for nodes that begin and end in the weak sub-network.That is, small world behavior can be induced in sub-networks that, by themselves, are not in the small world regime.This is straightforward to understand intuitivelyin the limit where the weak sub-network is completely disconnected, any bridge links will induce a connected sub-network out of the disconnected network.The average length for paths that begin and end in the connected part of the weak sub-network will thus be on average simply the average distance within the strong network + 2 for the hop back and forth.Although we require that the network not have too many disconnected components for the validity of the mean-field approximation, this simple reasoning does seem to hold for parameter values consistent with the validity of the mean-field treatment, as seen in Fig. 11.

VI. DISCUSSION
In this paper, we introduced a novel mean-field approximation for random networks.The motivations for such an approximation is many-fold.A priori, one sees the immediate need for some sort of systematic approximation by first constructing the generating functional for arbitrary  realizations of network randomness, from which ensemble averages of quantities of interest can be derived in principle.Even simple quantities of interest, such as the average of the elements of the distance matrix prove to be far too cumbersome to evaluate even in idealized examples.The motivation for the particular mean-field approximation introduced in section III was to explore the scaling behavior of average network distances, and that it should also be applicable to a wider variety of contexts.That is, even in cases where an underlying lattice sub-structure can't be appealed to, or when we introduce disorder in varying forms.
The mean field approximation immediately yields a network order parameter (1 − P ∞ ) 1/2 (Eq.25), requiring suitable interpretation.The existence of a critical point at p = 1/(N −1) is manifest, however, as discussed in section III.One of the more predictable features of mean-field approximations its failure when ensemble fluctuations can no longer be neglected.As reasoned in section III, this is precisely the case as one approaches the phase transition, as depicted in Fig. 12 15 , and in Figs. 4 -6.The utility of the mean-field approximation is manifest in its generalizability to various forms of network disorder.The dimorphic variant of the stochastic block model studied in section IV exhibits a rich phase structure.It is intended as a model of network disorder where not all nodes are the same but can connect to other nodes with varying probabilities.The machinery introduced here suggests an immediate generalization to weighted networks where the dimporphism is extended to the weights and will be the subject of a followup study [46].Furthermore, these results can in principle extend to stochastic block models with more than two families.As discussed in the appendix, this requires the calculation of combinatorial factors obtainable by constructing the generating function for auto-correlations over an n−symbol alphabet, where n is the number of families.Our ultimate aim, is to arrive at as analytic understanding of various features of a prototype for disordered Gilbert-Erdös-Renyi networks and to apply the insights gained to various biological, sociologial and epidemiological systems.α 0 in Eq. 42 corresponds to the number of consecutive 0's, and α 1 corresponds to the number of consecutive 1's in any given resulting binary string.Let's take k = 3 as an illustrative examplethe summation over the block indices for p k,s results in where we color coded A j 1 red and A j 2 as blue.As we can see, the summation over the block indices when viewed as a string run over 00, 01, 10 and 11, i.e. from 0 to 2 2 in binary.Affixing 0's at the beginning and end of the string results in 0000 (three consecutive pairs of 0's, so α 0 = 3, α 1 = 0, k − α 0 − α 1 = 0, cf.Eq.B4), 0010 and 0100 (one consecutive pairs of 0's, so α 0 = 1, α 1 = 0, k − α 0 − α 1 = 2, cf.Eqs.B5 and B6) and 0110 (one consecutive pairs of 1's, so α 0 = 0, α 1 = 1, k −α 0 −α 1 = 2, cf.Eqs.B7).The remaining summation over distinct combinations of the lower indices yields the exponents in Eqs.B4 -B7.Repeating the exercise affixing 0, 1 and 1, 1 to the beginning and end of the binary strings that run from 00 → 11 yields where the combinatorial problem has been reduced to computing the different Γ k,{s,I,w} α 0 ,α 1 , which count the number times α 0 consecutive 0's and α 1 consecutive 1's appear in the set of 2 k−1 strings formed by writing 0 → 2 k−1 in binary (with each number being a string of n 0 0's and n 1 1's) and affixing 0's to the beginning and end of this representation for p k,s , 0 and 1, and 1's for p k,I and p k,w respectively.Note that when we set N = m and p s = p I = p w we recover the answer for a single component network found in the previous section.

FIG. 5 :
FIG. 5: Comparison of simulated network (orange dashed) with the mean field approximation (gray) for p = 1.5/(N − 1); N = 500.Graph on left is a representative draw from the ensemble.

FIG. 7 :
FIG. 7: Comparison of simulations (orange dashed) with the mean field approximation (gray): P s (k), P I (k) and P w (k) for κ s = 5, κ w = 2 and κ I = 3 for m = 20, N = 500.Depicted below are two representative largest connected component draws from the simulation ensemble.

FIG. 8 :
FIG. 8: Comparison of simulations (orange dashed) with the mean field approximation (gray): P s (k), P I (k) and P w (k) for κ s = 7, κ w = 5 and κ I = 0.2 for m = 20, N = 500.Depicted below are two representative largest connected component draws from the simulation ensemble.

FIG. 10 :
FIG. 10: Comparison of simulations (orange dashed) with mean field approximation (gray): P s (k), P I (k) and P w (k) for κ s = 7, κ w = 0.3 and κ I = 20 for m = 20, N = 500.Depicted below are two representative largest connected component draws from the simulation ensemble.

FIG. 12 :
FIG. 12: Approaching maximal failure of the mean field approximation close to the critical point at κ = 1: Comparison of simulated network (orange dashed) with mean field (gray) for p = 1.1/(N − 1); N = 500, along with representative draw from the graph ensemble.