Analysis of the structure of complex networks at different resolution levels

Modular structure is ubiquitous in real-world complex networks, and its detection is important because it gives insights in the structure-functionality Modular structure is ubiquitous in real-world complex networks, and its detection is important because it gives insights in the structure-functionality relationship. The standard approach is based on the optimization of a quality function, modularity, which is a relative quality measure for a partition of a network into modules. Recently some authors [1,2] have pointed out that the optimization of modularity has a fundamental drawback: the existence of a resolution limit beyond which no modular structure can be detected even though these modules might have own entity. The reason is that several topological descriptions of the network coexist at different scales, which is, in general, a fingerprint of complex systems. Here we propose a method that allows for multiple resolution screening of the modular structure. The method has been validated using synthetic networks, discovering the predefined structures at all scales. Its application to two real social networks allows to find the exact splits reported in the literature, as well as the substructure beyond the actual split.


Introduction
In 2002, Girvan and Newman [3] highlighted the relevance of community structure in complex networks and proposed a method to detect it. This work opened a new scenario that has deserved a lot of attention in recent years [4,5] specially because they identified structures which have meaning, they reveal information about roles of groups of nodes. This is the case, for example in the worldwide airports network [6], the WWW [7], biological networks [8,9,10], social networks [3,11] and the Internet [12,13], among others. The information revealed by the community structure of real networks can be very valuable and make scientists aware of accuracy and reliability of the method used to detect this substructure.
The most important advance about community detection from the previous hit [3] was given by the same authors [14], proposing a quality measure, modularity (Q), that allows to quantify the modular structure. Given a network partitioned into communities or modules, being C i the community to which node i is assigned, the mathematical definition of modularity [15] is expressed in terms of the weighted adjacency matrix w ij , that represents the value of the weight in the link between nodes i and j (0 if no link exists), and the strengths w i = j w ij as where the Kronecker delta function δ(C i , C j ) takes the values, 1 if node i and j are into the same module, 0 otherwise, and the total strength is 2w = i w i . For unweighted networks w i becomes the degree of node i, and w the total number of links of the network. The modularity of a given partition is the probability of having edges falling within modules in the network minus the expected probability in an equivalent (null case) network with the same number of nodes, and edges placed at random preserving the nodes' strength. The larger the modularity the best the partitioning is, because more deviates from the null case. Note that the optimization of the modularity cannot be performed by exhaustive search since the number of different partitions are equal to the Bell numbers [16], which grow at least exponentially in the number of nodes N. Heuristics for the optimization of modularity [17,18,19,20,21,22] have become the only feasible (in computational time), and accurate method to detect modular structure up to now.
Recently, Fortunato and Barthélemy [1] showed mathematically that the optimization of modularity has a resolution limit, raising important concerns about the reliability of the modules detected so far using this technique, or eventually using any other quality function. Using a definition of module extracted from the functional form of (1.1) they subscribe the possible existence of undetectable submodules within the modules obtained optimizing (1.1). The same limitation has been observed for other quality functions different from modularity [2].
Here we address the issue of community detection in two ways: first, clarifying the conceptual interpretation of the resolution limit, not as a problem but as a feature of quality functions that can help us to understand in deep the structure of networks, and second and most important, we provide with a method that allows the full screening of the topological structure at any resolution level using the original definition of Q. Once presented the method, we will compare it with recent approaches intended to explore, also, the substructure of networks. where the sum is over the m modules of the partition, w ss is the internal strength of module s and w s the total strength of module s. For unweighted networks w ss reduces to the number of internal links and w s to the sum of degrees of the nodes in module s. The solution we propose takes advantage of the dependence of the resolution limit on the total strength 2w. Consider the case study consisting on two identical modules with a single link connecting them to the rest of the network and only one link connecting them to each other [1], the resolution limit states that these modules will not be found, optimizing modularity, if their internal strengths are w ss < w/2 − 1 . (2.2) In [1] the authors neglect the contribution −1 in the second side of inequality (2.2), which is acceptable for large values of the total strength. Our proposal to solve this problem is to modify the total strength 2w. Let us assume that we increase the strength of every node by a quantity say r, then (2.2) will read where n s stands for the number of nodes in module s and N for the number of nodes in the network. The result of this prescription resulting in (2.3) is that by rescaling the topology by a factor r, the example above can be separated optimizing modularity, because the growth of √ r is slower than r, i.e. at some scale controlled by r both modules will be visible using optimal modularity. The problem now is how to increase the strength of nodes without altering the topological characteristics of the original network. We solve this problem by rescaling the topology defining W r , from the original weighted adjacency matrix W of the graph with entries w ij , as follows where I is the identity matrix. In terms of graphs, this new matrix represents the original network with self-loops of weight r for every node. Note that the prescription in (2.4) supposes a constant shift (translation) r of the strength of each node. The commonly analyzed structural characteristics of networks (strength distribution, weighted clustering coefficient, strength correlations of any order, etc.) remain the same in the new network because the translation of strengths does not affect the original links' weights w ij that are the building blocks of the topology. The shift only affects the property of each node individually and in the same way for all them. The spectra of the original graph is also shifted a quantity r for each eigenvalue, preserving then any property that depends on differences between eigenvalues. The eigenvectors are exactly the same. Finally, the associated Laplacian matrix of the original matrix L ij = w i δ ij − w ij , responsible for the behavior of linear dynamical processes on the network [23], is also unchanged.
The interesting property of the re-scaled topology W r is that its characteristic scale in terms of modularity has changed. Then the topological structure revealed by optimizing modularity for W r is that of large groups for small values of r, and smaller groups for large values of r, all them strictly embedded in the original topology. This fact allows for the screening of the modular structure by analyzing the optimal modular structure of W r for different values of r. Note that the rescaling of the topology is simply an elegant way to enhance the total strength of the network, without varying its topological properties, then the rescaling can be used, in principle, to analyze the structure of networks using any quality function at different resolution levels parametrized by r.

Multiple resolution method
The analysis of modules at different resolution levels that we propose, consists into optimize the modularity of the graph W r for different values of r. Denoting Q r the modularity of the network at scale r, the equivalent expression to (2.1) reads The topological scale determined by maximizing Q at which the detection of modular structure has been attacked so far, corresponds to r = 0. For positive values of r, we have access to the substructures underneath those at r = 0, and for negative values of r we have access to the superstructures. The topological scale corresponding to all nodes separated (forming their own communities) is found by maximizing Q rmax , where r max is the smallest positive value of r that satisfies w ij < (w i +r)(w j +r) 2w+N r for all i = j. And the topological scale corresponding to a unique module formed by the whole network is found by maximizing Q r min , where r min has a lower bound defined by the asymptote r asymp = − 2w N , for a detailed analysis see Appendix A. At the asymptote the total strength is zero, thus no meaningful scales can be found for values of r below it. Note that the average strength can be written as 2w+N r N = r −r asymp . To compare results at different resolution, we adopt the usual formulation in other areas of physics (optics, acoustics, etc.) where scales are prescribed as the logarithm of the ratio between the relevant parameter. Here, the difference between scales, is measured as the logarithm of the ratio between strengths log( 2w+N r 2w+N r ′ ) ≡ log( r−rasymp r ′ −rasymp ). In this new description, we have that a module is defined at each scale of description r, as the result of the maximization of Q r . Moreover, modules that exist at a certain level of description may disappear from our observation when changing the scale r while others arise. Note that nothing implies that the substructures to which we will have access at different resolution levels are necessarily hierarchical, indeed in general they will not be hierarchical. Although, in principle, all resolution scales provide some information about the topology, and are important, the detection of partitions that are more persistent than the rest when changing the resolution r is indicative of a tougher modular structure.

Results
We show the results of our method investigating the modular structure at multiple resolution levels (different scales), for examples of synthetic and real complex networks. A first approach on synthetic networks is illustrative for validation of the procedure when different coexistent topological scales are imposed by construction. We have also analyzed the modular structure of real networks. In general, in real cases, the results are more difficult to assess because nothing from the topology indicates the existence a priori of more relevant structure in the network, and only the corroboration a posteriori of the structure found with known facts about the (social, biological, etc.) meaning of it can give reliability to any method. In the experiments, we have studied between 100 and 500 values of r inside the interval (r asymp , r max ] for synthetic networks, and 1000 values of r for real networks. All the experiments have been cross checked using two modularity optimization heuristics: extremal optimization [20], and a new proposal for the optimization of modularity based on tabu search (see Appendix B for details), repeating each one 20 times and keeping the partition obtained at the optimal value of Q r .
In figure 1 we have screened the whole range of topological scales for three synthetic networks, representing the number of modules obtained at the optimal partition for Q r , and the network analyzed highlighting the partition at two representative scales indicated by (I) and (II). Although the networks studied may have more than two relevant scales, we have just drawn two of them chosen among the most representative ones. First we have computed the modular structure in a hierarchical scale-free network with 125 nodes, RB 125, proposed by Ravasz and Barabasi [24]. In figure 1a we plot the modular structure found, which shows three different scales that deserve discussion. We observe clearly persistent structures in 5 and 25 communities respectively, that account for the subdivisions more significant in the process, showing two hierarchical levels for the structure. Additionally, the most stable partition in terms of resolution does not correspond to any of the previous ones, but it corresponds to the partition in 26 modules (the same as the one in 25 modules, but isolating the main hub). The partition in 5 modules and the partition in 26 modules are highlighted on the original network. This result is in perfect correspondence with the synchronization patterns produced on this network using coupled oscillators [23].
Another network example used is the H 13-4 network [23], which corresponds to a homogeneous in degree network with two predefined hierarchical levels, being 256 the number of nodes, 13 the number of links of each node with the most internal community (formed by 16 nodes), 4 the number of links with the most external community (four groups of 64 nodes), and 1 more link with any other node at random in the network. In figure 1b we represent the network and its corresponding modular structure at different scales. Both hierarchical levels are revealed by the method as they correspond to the original construction of the network: the first hierarchical level consisting in 4 groups of 64 nodes, and the second level consisting in 16 groups of 16 nodes.
Finally, we have used the FB network proposed by Fortunato and Barthélemy [1] to demonstrate the resolution limit of modularity (at r = 0). It consists in two cliques of 20 nodes linked with two small cliques of 5 nodes. At r = 0 the best partition cannot separate the two small cliques. In figure 1c we observe that the partition searched by the authors, formed by the four cliques isolated in their own communities, is obtained by increasing the resolution r, showing that the resolution limit of modularity is overcome by the method in region (II).
We have also studied a couple of social networks for which explicit knowledge about its modular structure is available, see figure 2. These particular networks, formed by social acquaintances between individuals, have the main characteristic that after a period of study decomposed in perfectly identifiable parts. The challenge is to find the modular structure of these parts without previous knowledge about the real partition. The optimization of modularity at r = 0 fails to provide this information, and no other method has been able to find the real partitioned structure. However, the most representative scales in terms of resolution optimizing Q r obtained by applying our method correspond exactly to the real splittings.
First, we have investigated the classical social network of the Zachary's karate club [25], accounting for the study over two years of the friendships between 34 members of a karate club at a US university in 1970. The network in question was divided, at the end of the study period, in two groups after a dispute between the club's administrator and the club's instructor, which ultimately resulted in the instructor leaving and starting a new club, taking about half of the original club's members with him. The analysis of this data has been a paradigmatic benchmark to test the accuracy of community detection algorithms. Zachary constructed a weighted network using different social measures, see figure 2a, although many times in the physics literature the network has been considered unweighted for simplicity or tradition, missing important information in the process.
The goal of any community detection algorithm trying to identify modules on this network should be to find the actual split occurred, assigning perfectly the nodes to the two known resulting clubs. The first approach to this goal was given by Girvan and Newman in [3], where they used a divisive method that produced a hierarchical tree representing the whole modular structure. They found that the first network splitting obtained by the method assigned correctly all nodes except node number 3. However, no measure about the quality of the partition was introduced at that time, and then all levels of the hierarchical tree were equivalent, with no way to have a preference for any partition. In [14], the same authors introduced the modularity measure Q and reported that the best structure in the hierarchy, in terms of the value of Q, was a partition in four groups and not two as expected. From this point on, many authors have analyzed this network and have provided the best values of Q obtained. Today it is well accepted that the best partition in terms of modularity of the Zachary's unweighted network is achieved for four groups with a value of Q = 0.419. We have applied our method to screen the modular structure of the original weighted network at all resolution scales of r. The results in figure 2a show that the most stable level of resolution is precisely the partition resulting in the two groups representing the two clubs, with no mismatch of any individual.
The second network analyzed is the dolphins social network of Lusseau et al. [26]. This network was constructed from observations of a community of 62 bottle nose dolphins over a period of seven years from 1994 to 2001. The nodes in the network represent the dolphins, and the ties between nodes represent the associations between dolphin pairs occurring more often than expected by chance. There is evidence [27] that a temporary disappearance of the dolphin denoted SN100, led to the fission of the dolphins community in the two identifiable parts shown in figure 2b. The optimization of modularity at r = 0 does not produce the expected split, but a partition in five communities with Q = 0.518. Other approaches as the one exposed in [28] neither success to find the real division. Our method allows to reveal all the modular structure in the whole range of resolution, indicating that the most stable solution in terms of resolution of optimal Q r corresponds exactly to the two partitions observed in this animal social network.

Discussion
The variation of topological scales so far is mediated by the variation of the parameter r. The meaning of this parameter is that of a resistance to become part of a community, in the scope of modularity. For positive values of r, we have access to the substructures below those at r = 0 (corresponding to the original scale at which modularity was defined by Newman), and for negative values of r we have access to the superstructures. The screening of different scales of descriptions should be useful to get deeper in the understanding of complex networks. Here we present a discussion about the role of the different topological scales beyond its statical definition, revealing their implications in dynamical process on top of networks. After that we will also compare our method with another possible approach to the mesoscale, and finally we give a perspective about the significance of the mesoscale in contrast with the commonly accepted one-scale of description.

The contact with physics
The results show that there exist several intermediate scales of description of the complex networks, the topological mesoscale. These scales are revealed by intervals of values of the resistance r, for which the optimal partition does not change, see figure 1. The obvious question at this point is: what are these scales representative for? The answer of this question is not trivial, and is intrinsically related to the functioning of the complex network as a substrate for different dynamical processes, communication and friendship in social networks, cognitive task in neural networks, or different levels of aggregation of computers in the Internet, for example. Our guess is that a simple dynamical process on top of a complex networks, should somehow reveal the topological mesoscale also in terms of temporal patterns. To check this hypothesis, we have implemented a synchronization dynamics on top of different topologies following [23,29]. The dynamics corresponds to the non-linear interaction between oscillators connected following the links of the complex networks. Analyzing the temporal meta-stable patterns emerging in the evolution towards complete synchronization, we corroborate our initial guess.
The temporal mesoscale of the dynamics of synchronization (of phase oscillators) near the synchronization attractor are governed by the solutions of the linear dynamics: where k is a constant, θ j are the phases of the nodes and L ij the Laplacian matrix of the network.
To identify patterns of synchronization in time, we use [23] a discretization of the matrix ρ ij = cos(θ i − θ j ) where · · · stands for the average over different realizations of the initial conditions. In all cases presented here we have averaged 10 5 realizations, and used a discretization threshold of 0.999. We observe that the intermediate scales that are revealed by the synchronization process are in agreement with those found by the topological method proposed here. The method allows not only to identify the number of communities at different scales but also to determine which nodes form these communities.
We show the corroboration of these claims in a set of synthetic networks, where the modular structure at different scales is imposed by construction. In figure 3, we sketch first the topology of a simple model of hierarchical network [24], and the comparison between the specific communities found at different resolution levels, and the synchronization patterns observed in the path towards synchronization. The synthetic network of 25 nodes used combines the scale-free property with a high clustering coefficient, and can be iterated, following the scheme plotted in figure 3a, to have many hierarchical levels. The results of the comparison reveal a strong equivalence between both processes, the static resolution method at different scales (different values of the resistance), and the groups of synchronized nodes in time. In figure 4 we extend this comparison for three more network structures: H 13-4 corresponding to the homogeneous in degree network described in section 3; equivalently the H 15-2 network [23] corresponds to a homogeneous in degree network with two predefined hierarchical levels, being 256 the number of nodes, 15 the number of links of each node with the most internal community, 2 the number of links with the most external community, and 1 more link with any other node at random in the network; the RB 125 network has been used also in section 3 and corresponds to the same scheme exposed in figure 3a adding a new hierarchical level. The plots here represent, in log-log scale, the number of communities as a function of the translated resistance r − r asymp , and time. The correspondence between the patterns is highlighted, and again the correspondence is overwhelming.
Obviously, the functioning of real complex networks can rely on dynamical processes very different from the synchronization process exposed here, however it is still instructive to see how a simple nonlinear process reflects the mesoscale of complex networks, or from another view point, to see how the topology of the networks imposes dynamical (temporal) scales in their functioning.

Comparison with other methods
Some authors have proposed algorithms to extract the hierarchical organization of complex networks by modifying the objective function [30], or by searching local minima of the modularity landscape [31]. These approaches differ conceptually from ours and  Comparison between topological scales and dynamical scales of synchronization. The plots represent, in log-log scale, the number of communities as a function of (a) the translated resistance r − r asymp , and (b) time. Dashed red lines are a guide to the eye to emphasize the correspondence between the plateaus observed. Legends refer to the network structure (see text for details). also in practice: i) the modification of the quality function [30] does not always provide with the correct substructure of networks; ii) the method based on the screening of local minima of modularity [31] is designed assuming that the structure is hierarchical, which is not the case in many real networks.
The method proposed by Sales-Pardo et al. is specifically designed to unravel the hierarchical structure in networks. The comparison with our method is then not possible within our more general scope of any topology. For hierarchical networks, their method will find the hierarchy of scales, as ours also does, however, for non-hierarchical networks, their method can only produce nested communities, in contrast with ours. Conceptually, the difference can be summarized as follows: hierarchies imply multiple scales of description, but the implication does not hold in reverse.
The method proposed by Reichardt and Bornholdt (R&B) [30] was not designed to avoid the resolution limit of modularity but to offer a way to connect modularity with statistical physics. The main idea by the authors is to tune the null model (i.e. change the quality function) and then to obtain other partitions by maximizing the new quality functions. Indeed in [2] the authors interestingly showed that the R&B method has the same resolution problems envisioned in [1] for modularity. The problem is that the R&B method consisting into varying γ (the prefactor that multiplies the null model) is not equivalent to tune the resolution of Newman's modularity. The authors in [2] recognize that if the size distribution of the communities is broad, like in collaboration networks or school friendship networks, there is no single proper value of γ for the optimal resolution. The main difference with our method is that, no matter the size distribution of communities to be broad or not, the rescaling of the topology method that we present finds all the topological structure correctly because it is designed to this end.
To support the above discussion we have built a toy model network with a simple topology but difficult for community detection algorithms because it includes communities of different sizes, some of them sparse and other dense, see figure 5. The network model is small enough to have a clear vision of the modules, and to be attacked with computationally costly techniques in reasonable time. While our method succeeds in the process, the R&B method fails. The results of our method and the R&B method varying γ are presented in figure 5.
It is worth noticing that the parameter γ in R&B approach does not correspond to any value of r. Only when γ = 1 and r = 0 both definitions become equal, and are exactly Newman's original definition. Rewriting Q r in (2.5) in terms of nodes, and comparing it to the R&B modularity for both prescriptions to be equivalent for all partitions, one must show that If i = j, the relationship between r and γ becomes which is only fulfilled for r = 0 and γ = 1, the trivial case stated before, because otherwise one would have different values of γ for each pair of nodes i and j. Therefore, there is no transformation of Q r into Q R&B γ , and they are screening different things.

Which is the "best" scale of description of complex networks?
The question about the determination of the "best" scale of description of a complex network is natural, but ill posed in the current scenario. Throughout the paper we have stated that the more "stable" partitions, in terms of persistence maximizing Q r when varying the scales with r, are somehow more relevant in the topological description of  the mesoscale. Their existence is an observed fact: some partitions are more persistent than others when changing the resolution scale of the topology. We think that this fact is not surprising, as it is not in many physical systems: phenomena that are observed persistently over a wide range of scales vanish at other scales, and others emerge. In general, these more persistent phenomena are usually more important to understand the system. More stable partitions are relevant in the sense that they usually have known meaning, but we cannot state that other partitions not so prevalent are uninformative. All them are embedded in the topology and give their particular information.
Summarizing what we think about the determination of the "best" or "more relevant" scale of description, we can say that the existence of relevant scales of description of a complex network should unavoidably pass through the definition of "relevant". Throughout the paper we have never tried to define "relevant" directly from the results obtained with our method, but a posteriori. We use, in the case of synthetic networks and real networks, the information that we have a priori (e.g. knowledge about the hierarchy imposed by construction, or known splits) to determine which scale is more relevant and then to check whether it is found by the method. What we observe is that these relevant scales are usually related to partitions that are significantly persistent (stable) at different scales (variation of r). However, to invert the argument is not straightforward. It is true that one could invent a function that peaks at the scales we see in reality that are known, as for example a function that accounts for the homogeneity of the obtained communities, but this inevitably imposes new conditions to the definition of module. Matching the discussion above let us expose the following: if it exists such a function that indicates the most "relevant" scale of description (and then partition), why not use this function as the objective function to optimize? This argument is strong because it implies that to determine if any scale is more important than others one must optimize a different quality function designed to this end, not modularity.

Conclusions
In conclusion, motivated by the recent finding that the optimization of modularity has a resolution limit, related to the characteristic scale imposed by the total strength (sum of weights) of the network, we propose a multiple resolution procedure that allows the optimization of modularity process to go deep into the structure. The main idea consists in to re-scale the topology by defining a new network from the original one, providing each node with a self-loop of the same magnitude r. The new network presents the same characteristics that the original network in terms of connectivity, but allows the search of modules at different topological scales. We have provided examples of the modular substructure found in synthetic and real complex networks. The results are sets of partitions that screen the full range of structural modules from individual nodes up to the whole network in each particular scale.
The analysis of the results reveal that some topological scales are more persistent (stable) in terms of resolution than others. These stable scales provide with specific information about the main modular aspects of the structure: in the synthetic networks analyzed, they correspond to the predefined structural scales imposed ad hoc; and in real networks they correspond exactly to previous knowledge about the networks, that has not been recovered by any other method studying these network topologies up to now. With this method, we release optimization of modularity from resolution problems, and give new ideas about the description of complex networks. The existence of several scales of description of complex networks, has deep analogies with the common study of complex systems in physics, where different models have been formulated at different spatial scales to get insight in different aspects of their phenomenology.
then Q r in (A.5) is maximized when δ(C i , C j ) = 0 , ∀i = j, i.e. modularity attains its maximum when all nodes are isolated in clusters of just one node. In terms of the resistance they simply become second order inequalities, which can easily be solved for all pairs of nodes joined by an edge. Thus, r max is the minimum value of r which satisfies all these inequalities, and for r > r max all nodes are separated in the optimal community configuration.
Appendix A.1.2. All nodes in the same community Let us analyze the behaviour of modularity just to the right of the asymptote r asymp = − 2w N . For convenience, we write the resistance as where ǫ is a small positive constant. The first term of modularity in (A.4) can be split in the following way: being a the sum of weights of edges connecting different communities. If there are two or more communities then a > 0, otherwise a = 0. The analysis of the second (null case) term of (A.4) requires a communities expansion: where b > 0, and b ∼ O(ǫ 2 ) only if all strengths are equal; on the contrary, b ∼ O(1). Therefore, which has an asymptotic behavior lim ǫ→0 + Q rasymp+ǫ = −∞ if two or more communities , 0 if only one community . (A. 13) This means that, for values of the resistance just above the asymptote, the optimal communities configuration is that with all nodes together in a single module that corresponds to the whole network.
Appendix A.2. Resistance limiting cases for weighted directed networks Let w ij ≥ 0, i = j be the weight of an arc that goes from the i-th to the j-th node, where w ij = 0 if there is no link between them. We suppose that this network is connected in the weak sense (weak connected components), i.e. the connected components are found as if the arcs were undirected; otherwise, each connected component should be analyzed one by one.
The natural generalization of modularity to cope with directed networks was introduced in [32], and is expressed as where the input and output strengths of the network are 16) and its total strength is The addition of a common resistance r to all nodes may be understood as the definition of a new network with weights The strengths of this network are and its total strength is Now, the modularity (A.14) of the new network is calculated as which may also be written as Note that D r does not depend on the community partition.
Appendix A.2.1. All nodes isolated If we have then Q r in (A.23) is maximized when δ(C i , C j ) = 0 , ∀i = j, i.e. modularity attains its maximum when all nodes are isolated in clusters of just one node. In terms of the resistance they simply become second order inequalities, (2w+Nr)(w ij +w ji ) < (w out i +r)(w in j +r)+(w out j +r)(w in i +r) , ∀i < j , (A.26) which can easily be solved for all pairs of nodes joined by an arc. Thus, r max is the minimum value of r which satisfies all these inequalities, and for r > r max all nodes are separated in the optimal community configuration.
Appendix A.2.2. All nodes in the same community The analysis of this case follows the same steps as in Appendix A.1.2, yielding also to (A.12): The only difference is that now: Unlike for undirected networks, the value of b is not guaranteed to be positive, and then: This means that, only if b is positive for all the different community partitions, for values of the resistance just above the asymptote, the optimal communities configuration is that with all nodes together in a single module that corresponds to the whole network. Otherwise, the modularity will raise to +∞ for the maximum modularity configuration, and the single module structure might not be present for any value of the resistance.

Appendix B. Optimization of the modularity using the Tabu heuristic
We propose a new method to optimize the modularity based on Tabu search [33]. The algorithm proceeds as follows: starting from an initial solution (a partition in groups of nodes of the network), S Init, an iterative process that explores the search space begins, stepping from the solution of the current iteration, S Iter, to one of its neighbors, S Neig. The neighborhood is composed by the partitions that are obtained from the current solution by the application of a local operator called move. In our case, the move operator acts on a node at a time moving it from its current community to another selected at random, or creating a new one. Among the solutions in the neighborhood the best one is chosen to become the new current solution for the next iteration of the algorithm.
In order to escape from local optima, a list of tabu moves is used. This tabu list stores and forbids the most recently accepted moves and it is updated as the algorithm proceeds, so that a move just added to the list is removed from it after a certain number of iterations (Tabu Tenure) have passed. However, tabu moves are allowed when they lead to an improved solution. Once a solution is accepted, the node moved to obtain this solution is inserted into the tabu list, in order to prevent the movement of the same node during the next Tabu Tenure iterations, unless this move leads us to the best solution found until that moment. We used a logarithmic function on the number of nodes as the number of idle iterations needed to stop the search. The main advantage of this algorithm is that it is a mixture of divisive and agglomerative processes, avoiding the drawbacks of both single strategies. Moreover, the iterative process can start from any initial partition, which is adequate for the mesoscale determination, since the optimal partitions for nearby values of the resistance are frequently similar. In terms of computational cost, the tabu heuristic is equivalent to other stochastic optimization methods such as simulated annealing or genetic algorithms.