Network Rewiring in the r-K Plane

We generate correlated scale-free networks in the configuration model through a new rewiring algorithm that allows one to tune the Newman assortativity coefficient r and the average degree of the nearest neighbors K (in the range −1≤r≤1, K≥〈k〉). At each attempted rewiring step, local variations Δr and ΔK are computed and then the step is accepted according to a standard Metropolis probability exp(±Δr/T), where T is a variable temperature. We prove a general relation between Δr and ΔK, thus finding a connection between two variables that have very different definitions and topological meaning. We describe rewiring trajectories in the r-K plane and explore the limits of maximally assortative and disassortative networks, including the case of small minimum degree (kmin≥1), which has previously not been considered. The size of the giant component and the entropy of the network are monitored in the rewiring. The average number of second neighbors in the branching approximation z¯2,B is proven to be constant in the rewiring, and independent from the correlations for Markovian networks. As a function of the degree, however, the number of second neighbors gives useful information on the network connectivity and is also monitored.


Introduction
Rewiring algorithms are often employed in network science to build "synthetic networks" for the mathematical modeling of dynamics or diffusion processes [1][2][3][4][5]. Usually, rewiring algorithms preserve the degree distribution of the network while changing the degree correlations and other topological features.
The "configuration model" [6] is a well established generalization of the random networks of Erdös-Renyi which yields uncorrelated networks having a pre-assigned (typically scale-free) degree distribution. It is known, however, that assortative and disassortative correlations play an important role in dynamics and diffusion on networks [7][8][9][10][11]. For this reason some algorithms have been devised, which are able to perform a degree-conserving rewiring while modifying the pair correlations in the direction of increasing assortativity or disassortativity.
It is also possible to rewire the network in order to change its clustering coefficient (see [12] and references) or other metrics, but in this work the focus is on assortativity and disassortativity as measured by the Newman coefficient r, and on the average nearest neighbors degree function k nn (k), or better on its network average K ≡ k nn (k) = ∑ k P(k)k nn (k). Here, P(k) is the degree distribution, P(h|k) denotes the conditional probability for a node of degree k to be connected to a node of degree h, and k nn (k) = ∑ k hP(h|k).
The algorithm by Xulvi-Brunet and Sokolov [13] is quite efficient for generating networks that are maximally assortative or maximally disassortative, or even have an intermediate r coefficient, if a tunable return probability is inserted in the rewiring criterion. It does not allow, however, any direct control of the degree correlations e jk or P(h|k), the r coefficient or the k nn function. (We recall that e jk is the probability for a node with excess degree j, i.e., degree (j + 1), to be connected with a node with excess degree k.).
The rewiring method proposed by Newman [1] allows in principle to generate ensembles of networks displaying, on average, any "target" two-point correlations assigned through an e jk matrix compatible with the given degree distribution. There exist several recipes for the construction of such matrices in the case of scale-free networks [1,14,15].
We have recently proposed a new algorithm [16] that is equivalent to the algorithm of [13] when applied to maximally assortative or disassortative networks, but allows at each step the control of the variation ∆r in the Newman coefficient, and therefore permits the introduction of a rewiring "temperature" T in order to tune the return probability via a standard Metropolis update.
It is known that in many classes of networks, no simple method for the creation of random networks of the class exists [3]. In these cases a Monte Carlo method is usually invoked. The desired network class is determined by an energy function, which is defined on a network configuration. The lower the function is, the more desirable are the properties of the network. For a good performance of the algorithm, the energy function should be calculable locally. That is, the change in energy between configurations should depend only on the changed links and possibly some near neighbors, so calculating the new energy should not require recalculating the energy for the entire network. Our proposed method improves previous methods since it satisfies these properties by using ∆r as energy variation.
In order to increase the convergence probability of Metropolis algorithms it is sometimes attempted to start with a high temperature, making all moves probable and covering the entire configuration space, and gradually decrease the temperature in order to approach the real energy minimum (procedure of "simulated annealing"). This is also possible in principle with our method, but it should be stressed that in general rewiring algorithms do not sample uniformly through spaces of networks (see for instance [17][18][19] and references), and that the more features one wants to preserve in the rewiring, the less successful sampling is. Therefore our rewiring algorithm, like the other cited algorithms for changing network correlations, cannot be used as a randomization procedure. Another reason for this is that these algorithms may generate multiple copies of isomorphic random networks, and so cause over-counting in the sampling.
One of the aims of this work is to clarify the relations existing among these rewiring methods and the asymptotic constraints on maximally assortative and disassortative networks found by Menche et al. [20]. Using our "∆r-rewiring" we have also been able to see the effects of extreme assortativity and disassortativity in networks with many nodes of small degree. These were not considered by the authors of [20], who took as a minimum degree a typical value k 0 = 6 and therefore found in general highly connected networks with a very large giant component.
The study of complex networks is often motivated by the interest for the dynamics of some diffusion problem on top of them. Clearly, if a mean-field approximation of the dynamics or diffusion on the network is sufficient for one's purposes, then the corresponding equations can be written, analyzed, or solved in terms of the excess-degree correlations e jk or in terms of the degree distribution P(k) plus the conditional probabilities P(h|k) (the so-called probabilistic or "Markovian" description of the network). If, on the other hand, a full realization of the network is needed (e.g., for simulations or stochastic modeling, or because one wants to take into account the effect of correlations beyond the second order), then several issues arise, for example:

•
Is it possible to build any desired assortative or disassortative network, defined at the probabilistic level through a suitable "theoretical" e jk matrix, using a Newman rewiring, at least at the ensemble level? What is in this respect the role of the asymptotic constraints on r? Can the asymptotic constraints tell us in advance that a certain theoretical e jk is impossible to be implemented in a real network?
• Among the networks obtained through a Xulvi-Brunet-Sokolov rewiring or our ∆r rewiring, will one find the desired assortative or disassortative network? If yes, with what accuracy is this possible, compared to the Newman rewiring? • How do the results (and their level of fluctuations and uncertainty) change if we modify the degree distribution, and especially the probability of the nodes with the lowest degree? Will a giant component always be present? If the network is much fragmented, what are the consequences for diffusion processes?
As this work was progressing, we gradually realized that such issues are hard to solve in general terms. We found partial answers, but we chose to leave most of them for a forthcoming publication. Still the efforts described in this work have already led to some useful spin-offs. In an attempt to obtain a better characterization of the rewiring process, we have represented the state of the network in an r-K plane trying to use K as a "coordinate" independent from r. This brought us first to a revision of the meaning and of the properties of K (Sections 2, 2.1, and 2.2) and then to establish a new general relation between the variations of r and K in a rewiring step (Sections 2.3 and 2.4). This relation has been proven theoretically and verified numerically through the rewiring code. The code has also allowed to guess some related properties of the quantityz 2,B (average number of second neighbors in the branching approximation), which have been proven theoretically in Section 3, although they are not strictly necessary for the rest of the present work.
In Section 4, we describe the main features of the rewiring code and the procedure for the calculation of the entropy of the generated networks. In Section 5.1 we describe the "rewiring trajectories" in the r-K plane obtained for some different values of the scale-free exponent γ (γ = 2.25, 2.5, 2.75, 3) starting from uncorrelated networks and performing an assortative or disassortative rewiring at a low temperature, i.e., with small return probability. For some of the cases a qualitative description is given of the "super-assortative" and "super-disassortative" asymptotic networks generated. Section 5.2 describes the preliminary results of the assortative rewiring in equilibrium at variable temperature T, with a plot showing the case γ = 2.5, as a function of T, the values of the entropy S, of r , K , and the size of the giant component. Section 6 contains our conclusions.

The Function "Average Degree of the First Neighbors" K N
The quantity k nn (k) N , introduced by Boguñá et al. [21], is defined as: We shall denote it for simplicity K, or K N , since for a given type of network it depends only on its size, namely on the number N of nodes (related in turn to the maximum degree n, for scale-free networks, through the Dorogovtsev-Mendes criterion as detailed in Equation (3)). Since k nn (k) amounts to the average degree of the first neighbors of a node of degree k and P(k) is the probability that such a node is present, K N is the average degree of the first neighbors taken over the entire network, or better the average degree of the first neighbors of a randomly chosen node. Generally speaking, K N is strongly related to the diffusion properties of the network. The definition above is probabilistic, and used for Markovian networks and for applications to mean-field equations on these networks. If we have complete knowledge of the network, we can compute K exactly by just looking at the first neighbors of each node and computing a total average of their degrees (see Section 4).
The authors of [21] prove that as a function of N, K N is diverging when N → ∞ in a scale-free network with exponent 2 < γ ≤ 3, for any kind of correlations (at least when the function k nn (k) has a certain form). This property is employed to conclude that in the "thermodinamic" limit of large N, phenomena of epidemic diffusion always propagate to the entire network, no matter how small the contagion probability is ("absence of epidemic threshold"). The intuitive reason is that although the average number of neighbors k tends to a constant for large N, the average degree of these neighbors tends to infinity. This means that each node is very close to a hub from which the epidemics can easily spread.
In the following two sub-sections we give some examples of computation of the function K N in Markovian networks, as an introduction to the results obtained through the rewiring of real networks.

Uncorrelated Networks
For an uncorrelated network we obtain for K N a simple expression. We have in this case: Therefore k nn (k) does not depend on k: where we have used the normalization condition ∑ n k=1 P(k) = 1 and the last inequality is due to the fact that in general k 2 ≥ k 2 .
The inequality K N ≥ k expresses the well-known property that in an uncorrelated network, from the point of view of one node looking at its first neighbors, on the average "my friends have more friends than me" (because their average degree is K N and my degree is k). As we shall see, this property is also numerically confirmed for correlated networks, at least in the scale-free case.
The dependence from N in the expression of Equation (2) for K N arises as follows. First note that when we consider a finite network with maximal degree n, the normalization condition of P(k) is ∑ n k=1 P(k) = 1. Therefore the properly normalized degree distribution P(k) for a scale-free network is: The quantities k and k 2 , respectively equal to ∑ n k=1 kP(k) and ∑ n k=1 k 2 P(k), depend on n through the factor c n,γ and the upper limit of the sum. However, in the limit of large n the factor c n,γ tends to a constant and ∑ n k=1 kP(k) is convergent for 2 < γ ≤ 3; the dependence of K N on n comes from the divergent series ∑ n k=1 k 2 P(k). Approximating with an integral the dependence of the series on its upper limit, we obtain for large n: Of course, for k close to 1 the integral is not a good approximation of the series; furthermore, if the sum starts from a value k min > 1, the factor c n,γ has a substantial dependence on k min (see Table 1), as we shall later see in some examples. Here, however, we are interested into the divergent dependence of K on n.
In order to relate the maximum degree n to the number of nodes N we make recourse to the integral criterium of Dorogovtsev-Mendes [22], which states that the probability to have in the network a node with degree in the range (n, +∞) must be equal to 1, implying: From this we obtain the known relation: An example of exact values of the various quantities involved is given in Table 1.

Correlated Networks
In order to obtain K N for a correlated network we must compute numerically the sum over k starting from an explicit expression for k nn (k), if known, or else expressing also k nn (k) as a sum, according to its definition k nn (k) = ∑ n h=1 hP(h|k). A simple formula which defines assortative correlations has been proposed by Vazquez and Weigt [14] and has been employed in [24] for diffusion studies. It is a linear combination of an uncorrelated term and a totally assortative term proportional to δ hk , namely: where r ranges from 0 to 1 and coincides with the Newman assortativity coefficient. From this matrix one obtains: It follows that for fixed n (which also fixes k and k 2 ), when r → 1 one has K N → k , corresponding to the fact that in the case of extreme assortativity each node is only connected with other nodes having the same degree. We shall show in forthcoming work, however, that for a real scale-free network this limit is purely hypothetical, because the function k nn (k) cannot increase linearly for large k, but eventually must decrease. Further evaluations of K N as a function of N for assortative networks, built using a different set of P(h|k) matrices [15,25], and for disassortative networks will be given elsewhere.
In any case, for fixed N the value of K is quite useful in characterizing the network and depends strongly on the type of correlations, on the scale-free exponent and on the minimum degree. A first example is given in Table 1 for Markovian networks. Then in Sections 5.1 and 5.2 we investigate the behavior of K for real rewired networks. An exact direct calculation of K from the list of links of a real network can be efficiently implemented and compared with the average value of K obtained from the k nn function.

Local Variation of K
The variation of K in a rewiring step is obtained using its definition as the average degree of the first neighbors of each node, averaged over the whole network. Let A, B, C, D denote respectively the degrees of the nodes a, b, c, d involved in the rewiring (see Figure 1). Let σ a denote the sum of the degrees of the first neighbors of the node a, which are not involved in the rewiring, and similarly define σ b , σ c , σ d . Before the rewiring the averages s a , s b , s c , s d of the degrees of the first neighbors of a, b, c, d are: After the rewiring, these quantities become: Therefore the change in the total average K is: σ a Each node has in general other neighbors, not depicted; the sum of the degrees of the neighbors of a not involved in the rewiring is denoted in the text as σ a , and similarly for b, c, d.

Relation between the Local Variations of K and r
In previous work [16] we found an expression for the local variation of the Newman coefficient in a rewiring of the same kind as in Figure 1. The variation is given by: where L is the number of links in the network and σ 2 q is the denominator of the fraction which defines r, namely: jk(e jk − q j q k ) , Here e jk is the probability of finding in the network a link between nodes with excess-degrees j and k and q k = ∑ n−1 j=0 e jk is the excess-degree distribution. Note that q k and σ 2 q depend on the degree distribution but not on the correlations. Also note that in [16] a slightly different notation is used, in which A, B, C, D denote directly the excess-degrees. However, since: we can safely use Equation (6) according to the conventions of this paper, where A, B, C, D are the degrees and not the excess-degrees.
After some algebraic manipulations it is possible to express the variation ∆K in Equation (5) in terms of ∆r, thus establishing a relation between two quantities which have very different definitions and topological meaning. We find: This holds for each rewiring. The factor −Lσ 2 q /(2N) is fixed for a given degree distribution, while the factor (AD + BC)/(ABCD) clearly depends on the nodes involved; we only know a priori that it is always positive, and as a consequence ∆K is always opposite to ∆r and ∆K = 0 if and only if ∆r = 0. For the rewiring trajectories described in Section 5.1 the ratio ∆K/∆r, averaged over many rewirings, turns out to be approximately constant for a given degree distribution; see data in Table 2.

The Average Number of Second Neighborsz 2,B
The condition for the existence of a giant component in an uncorrelated network with arbitrary degree distribution has been first found by Molloy and Reed [26] and is expressed by the inequality: Later the same condition has been proven by Newman, Strogatz, and Watts with the method of the generating functions, which also allows one to find the size of the giant component [27]. In [27] the inequality in Equation (10) is reformulated in an intuitive way by stating that the giant component exists whenz 2 > k , wherez 2 is the average number of second neighbors and k (the average degree) can also be interpreted as the average number of first neighbors. A crucial underlying assumption is that the network is locally a branching structure; moreover, being the network uncorrelated, one supposes that there are no preferences in linking behavior depending on the node degrees and that therefore it makes sense to consider total averages likez 2 and k .
We are now going to define a quantity that is closely related toz 2 and will show that starting from the intuitive "percolation" conditionz 2 > k , Equation (10) can be immediately obtained without using the generating functions.
We call this quantity "average number of second neighbors in the branching approximation" and denote it byz 2,B . It is a network average likez 2 , but includes by definition multiple counting in the case of shared second neighbors. More precisely, if one node a 0 has a second neighbor b in common with other h nodes a 1 , . . . , a h , then b is counted h + 1 times in the averagez 2,B . The two quantities z 2 andz 2,B coincide if the network is a pure branching structure, without nodes that have second neighbors in common with other nodes.
According to this definition,z 2,B can be obtained as: because the probability for a node to have degree k is P(k), the node has k first neighbors and their average degree is k nn (k). Let us computez 2,B for an uncorrelated network: This expression gives the Molloy-Reed condition if we requirez 2 > k and admit that the network is a locally branching structure such thatz 2 z 2,B . Equation (11) forz 2,B is interesting in itself and we have used our code for the configuration model with rewiring in order to test it. The code generates a list, called the "Friends" list, of the first neighbors of each node. The list is updated and used in many parts of the program, for instance after the first wiring of the stubs, in order to check that the nodes' degrees match the prescribed degree distribution. It is also used at the end of the rewiring cycles, in order to find the giant component of the final network, and possibly for the numerical solution of diffusion equations in first or second closure approximation. It is straightforward to use the Friends list to also obtain the number of second neighbors of each node, because the degrees of the nodes do not change in the rewiring and are stored in a vector "Degrees[i]", with i = 1, . . . , N, fixed from the degree distribution before the wiring. The contribution toz 2,B from each node is obtained as the sum of (degree of each friend − 1). The total network averagez 2,B is the sum of the contributions of all nodes, divided by N. One can check that the exact value obtained in this way is well approximated by the probabilistic value in Equation (11).
Somewhat unexpectedly, the exact obtained value ofz 2,B is accurately reproduced in each simulation with the same degree distribution, signaling that it is not affected by the rewiring. In fact, the following two properties hold, which are not difficult to prove but cannot be found in the literature, to the best of our knowledge. (Property ofz 2,B ). For Markovian networks which satisfy the Network Closure Condition hP(k|h)P(h) = kP(h|k)P(k),z 2,B does not depend on the correlations but only on the degree distribution, and it is equal to the value k 2 − k obtained for an uncorrelated network having that degree distribution (Equation (13)).

Property 1
In fact the first term on the r.h.s. in Equation (11), namely ∑ k P(k)kk nn (k), is equal to k 2 , as already noted in [21]: (because ∑ k P(k|h) = 1). The second term is equal to k , which is fixed if the degree distribution is fixed. Property 2 (Property ofz 2,B ).z 2,B does not change in a binary rewiring which preserves the degree distribution.
This is a direct consequence of the definition of the rewiring (see Figure 1). Let σ a denote, as before, the sum of the degrees of the first neighbors of the node a which are not involved in the rewiring, and similarly define σ b , σ c , σ d . Let A, B, C, D denote the degrees of the nodes. The total number of second neighbors of the four nodes involved in the rewiring is equal, before the rewiring, to: After the rewiring we have: and the two quantities are equal.
These properties offer a strong indication for the absence of epidemic threshold in correlated large scale-free networks with 2 < γ ≤ 3. In fact, in this range of γ,z 2,B diverges when N → ∞. Denoting by λ the contagion probability for one single contact, consider an infected node randomly chosen, thus with the average degree k . The probability that the node infects one of its neighbors is k λ, which tends to zero if λ is very small. However, the probability that the node infects one of its second neighbors is (for a locally branching structure) equal toz 2,B λ 2 , and this quantity can stay finite even as λ → 0, because of the divergence ofz 2,B , independently from the degree correlations.

The Rewiring Algorithm
In the first part of the algorithm, the "wiring" part, we generate a series of 2L "stubs" with given degree distribution, like in any implementation of the configuration model. The exact procedure for assigning the degrees to the hubs has two possible alternatives and has been described in [16]. In the first alternative ("cumulative hubs"), the probability of hubs for which P(k) · N < 1 is cumulated with increasing k until it exceeds 1, at which point the hub is created and the accumulation starts again. In the second alternative ("random hubs"), hubs of degree k are created entirely at random with probability P(k) · N.
For a description of the linking of the stubs the reader is referred to [16]. Details of this procedure are little relevant because the extensive rewiring that follows cancels any memory of the initial wiring scheme.
When we perform a rewiring step, we choose at random two links in the current list of links describing the network, say (a, b) and (c, d) (nodes are identified by a sequential number in the range 1, . . . , N, so a, b, c, d denote this number). With a probability of 50% we exchange a and b, to avoid any asymmetry, and then we build the new links (a, c), (b, d). In order to avoid the formation of loops, the rewiring is not performed if a = c or b = d. The formation of multi-links (more than one link between the same two nodes) is avoided through a check of the adjacency matrix [A ab ], which is computed from the list of links before the rewiring cycle and updated after each rewiring according to formulas: (plus the symmetrical variations for A ba etc.). The knowledge of the adjacency matrix also allows one to compute the Shannon entropy of the network (see [28] and references) by ensemble-averaging A over sub-cycles. For instance, consider a typical rewiring cycle with 100 sub-cycles of 10 4 steps each, for a network with N = 10 3 . The values of A ab , with a, b = 1, . . . , N at the end of each sub-cycle are averaged to compute S according to the formula: The number of sub-cycles is increased until the result stabilizes. The averages of r and K are also computed in the same way. A long rewiring process of this kind is used to compute S and other quantities as functions of the temperature; see results in Section 5.2.
When the rewiring temperature is very low one can actually observe that the value of r changes by 10 −5 or less, and the entropy becomes very small. This is because when the network is very close to its maximum possible assortativity or disassortativity, almost all rewiring steps are rejected, changes in r are very small and the adjacency matrix remains practically constant (thusĀ ab is either very close to 0 or 1, with small contribution to S).
In its present form the algorithm has been applied to relatively small networks (N < 10 4 nodes), because the double sum involved in the calculation of the entropy has N 2 terms and the average adjacency matrixĀ requires much memory. For such values of N the part of the code which performs the rewiring is quite fast, taking at most a few seconds to complete. If one wants to apply the rewiring to larger networks without computing the entropy, a check of the adjacency matrix A will still be needed (especially in the assortative case) in order to avoid the formation of multi-link. However, in that case A should be handled as a sparse integer matrix, thus lowering the memory requirements.

Trajectories of Assortative and Disassortative
Rewiring in the r-K Plane at Low T Let us first describe the "trajectories" (see examples in Figures 2 and 3), which are generated in the r-K plane when we make a rewiring of the assortative kind, i.e., with the rewiring step always accepted when ∆r > 0 and accepted with probability exp(−|∆r|/T) when ∆r < 0. The rewiring cycles described in this section are relatively short, in comparison to those of Section 5.2, in which we need to reach equilibrium, and T can be large.
The starting point of each trajectory is a network generated through a completely random rewiring. Note that especially for the lower values of γ this "configuration model" network is not uncorrelated, but displays some structural disassortativity.
We observe at the beginning a rapid increase of r along the trajectory. For instance, for a network with 1500 nodes, in Figure 2 the data points represent the values of r and K during 80 sub-cycles of 100 rewirings each. The temperature T is chosen to be quite low, compared to the magnitude order of the variation ∆r. The latter is of the order of 10 −3 as deduced from Equation (6) and Table 2. With these values and units, a temperature of 10 −6 is sufficiently low to give a very small return probability in the Metropolis algorithm and to make the networks evolve quickly and almost without fluctuations towards their maximum possible assortativity.
The points on the trajectory are seen to converge to a final spot, and typically if we perform 50 sub-cycles of 10,000 steps (not shown in the figure), which take about one second to be completed, the values of r and K become constant up to the sixth decimal digit. This value, however, depends on the degrees of the hubs effectively present in the network and is reproducible in different runs only if the hubs are generated with the method of cumulative probability (see Section 4).
If at this stage we compute the Shannon entropy S according to Equation (14), we find S = 0 exactly. This means that at this temperature the assortative rewiring causes the network in the long run to evolve towards a unique "asymptotic" state. The maximum and minimum values (asymptotic values) that can be obtained for the r coefficient of scale-free networks have been extensively studied in [20]. Those results, however, are referred to networks whose minimum degree is relatively large, typically k min = 6; such networks are usually completely connected (giant component equal to 100%). In this work we take instead k min = 1, because we are also interested in the network "fragmentation" caused by the strong assortativity and disassortativity. The giant component we find can be very small, down to 10% or less. Most of the asymptotic networks consist, in the assortative case, of isolated couples made of nodes of degree k = 1, and then of long chains with variable length, open or closed, made of nodes of degree k = 2. Such structures can be easily identified in a complete graphical representation of the network or more "economically" in the table of the values of the number z 2 of second neighbors of each node. For instance, for each node of degree 1 belonging to a couple we obviously have z 2 = 0, and for each node of degree 2 belonging to a chain we have z 2 = 2 (except at the ends of the chain). Another less obvious occurrence observed in strongly disassortative networks is shown in Figure 4 and involves nodes of degree 3.
In the extreme assortative case the giant component contains all the major hubs, strongly connected among themselves. From the strongly connected core depart long chains (see an example in Figure 5) whose connection or disconnection to the core affects the size of giant component, but has very little influence on the value of r. In other words, a rewiring in which long chains are connected or disconnected at their ends can easily occur also at low temperature, with little effect on r and on the entropy.
In the extreme disassortative case, especially for γ close to 3, it may happen that the network is completely fragmented and there is no giant component. One example is shown in Figure 6. These kinds of networks have been studied theoretically in [29]. In addition, in this case the table of values of the number z 2 of second neighbors is useful in order to identify some patterns without the need to visualize the entire network. For instance, all the hubs of the network in Figure 6 have z 2 = 0 exactly. Figure 5. An example of a maximally assortative network with γ = 3, k min = 2. The minimum degree has been taken greater than 1 in this example in order to avoid the formation of isolated couples, which make up the large majority of maximally assortative networks if k min = 1. The length of the chains and their connection or disconnection to the the giant component have only a little effect on the total r coefficient, and can therefore vary in each realization, even at a very low temperature (here T = 10 −6 ).

Figure 6.
Maximally disassortative network with γ = 2.75, k min = 1. The network is completely fragmented into "stars" (compare [29]). For all hubs the number of second neighbors is exactly zero.

Equilibrium Rewiring at Variable T
In this subsection we report some preliminary results from assortative rewiring cycles performed at variable temperature, in the range 10 −5 ≤ T ≤ 10 −2 . These rewiring cycles consist of several long sub-cycles (typically 100 sub-cycles of 10 4 rewiring steps), such that the equilibrium is attained and entropy can be measured by averaging the adjacency matrix on each sub-cycle. We recall (see Section 5.1) that the value of the temperature for the rewiring algorithm must refer to the magnitude order of the variations of r, and this depends in turn on the number of nodes.
The data are still quite noisy and more statistics need to be accumulated for different values of γ, followed by extension to the case of disassortative rewiring. One of the objectives of these measurements is to verify the conjecture of [28] that disassortative networks are entropically favored. Another interesting suggestion from the data in Figure 7 is that there is a correlation between K and the size of the giant component, as T varies. The exact anticorrelation between r and K according to Equation (9) is also evident. 1 Figure 7. Assortative rewiring in equilibrium at different temperatures T. (Network of 1000 nodes, with γ = 2.5, k min = 1.) The entropy per node S/N is shown, along with the average degree of the first neighbors K, the Newman assortativity coefficient r multiplied by 10 (note the slight structural disassortativity at high temperature), and the fractional size of the giant component multiplied by 10.

Conclusions
The method of assortative and disassortative rewiring at variable T that we presented in this work appeared to be quite effective for the generation of correlated scale-free networks. At each step of the rewiring process, our algorithm permitted a control of the variations of the assortativity coefficient r and of the average degree of the nearest neighbors K. The two variations were actually connected through a general relation that we have proven in Section 2.4.
We also proved that the average numberz 2,B of second neighbors in the branching approximation was constant in the rewiring. This property provided further evidence for the absence of epidemic threshold in scale-free networks with exponent γ in the range 2 < γ ≤ 3.
If we represented an assortative or disassortative rewiring process at low temperature (i.e., with low return probability) in a r-K plane, we obtained an almost linear trajectory converging towards a point, which represents the maximally assortative or disassortative network having the given degree distribution. The position of the trajectory in the plane and its (negative) slope depended on the exponent γ. In general, the value of K was smaller for assortative networks, compared to uncorrelated or disassortative networks having the same degree distribution. For a fixed value of r, K was larger when γ was smaller, therefore the trajectories with small γ lie in the upper part of the plane.
The features of super-assortative and super-disassortative networks were found to depend quite strongly, for a given γ, on the minimum and maximum degree present in the network.
Preliminary evaluations of the network entropy, the size GC of the giant component, K and r as functions of the rewiring temperature confirmed the exact anti-correlation between r and K and indicated a positive correlation between K and GC.