Robustness of community structure to node removal
Abstract
The identification of modular structures is essential for characterizing real networks formed by a mesoscopic level of organization where clusters contain nodes with a high internal degree of connectivity. Many methods have been developed to unveil community structures, but only a few studies have probed their suitability in incomplete networks. Here we assess the accuracy of community detection techniques in incomplete networks generated in sampling processes. We show that the walktrap and fast greedy algorithms are highly accurate for detecting the modular structure of incomplete complex networks even if many of their nodes are removed. Furthermore, we implemented an approach that improved the time performance of the walktrap and fast greedy algorithms, while retaining the accuracy rate in identifying the community membership of nodes. Taken together our results show that this new approach can be applied to speed up virtually any community detection method in dense complex networks, as it is the case of similarity networks.
1 Introduction
A myriad of real systems can be modeled as complex networks, where entities and their relationships are represented as nodes and edges, respectively. Examples of such systems are the Internet [1, 2], the WWW [3], transport [5, 6] and transmission systems [7]. Relevant in this modeling has been the ability of nodes to cluster into communities, defined as groups of strongly connected nodes with a few external links with the other nodes of the network. Various methods for detecting communities have been proposed [8], including waltkrap [9], fast greedy [10], edgebetweenness [11] and leading eigenvector [12]. Unprecedented patterns of topological organization could be unveiled with communities being identified for metabolic, genetic, collaborative and social networks [13, 14, 15, 16].
Major issues for these methods are not only the accuracy but also the efficiency of the algorithm, since some real networks may comprise millions of nodes [17, 18]. Actually, time efficiency is decisive for choosing the method for addressing a given problem as some methods become impractical for very large networks. This is the case of the edgebetweenness method, whose temporal complexity is in the worst case. Perhaps because of the relevance of time efficiency, other important issues have been relatively neglected. An example is the applicability of standard methods in incomplete networks, i.e., networks with imprecise information, such as missing nodes or edges. To our knowledge, only a few studies have probed the efficiency of community detection methods in incomplete networks. In Ref. [19] the authors focus on the predictability of missing edges, which is crucial for real networks resulting from incomplete experiments [20]. In information and social networks, for example, lowdegree nodes are usually undiscoverable in crawling systems, while in protein interaction networks many edges may be unknown [21]. Other related studies include the investigation of the robustness of communities when edge weights are varied and rewiring processes are applied [22, 23].
In this paper, we evaluate the robustness of two methods in discovering communities in incomplete networks generated from sampling processes. As we shall show, these methods are robust even when several nodes are missing. Furthermore, we found out that the robustness seems to be weakly dependent on the method evaluated, but there is an important dependence on the network structure. More importantly, we show that robustness in detecting communities allows us to devise a strategy that improves the time performance, while keeping the accuracy of detecting communities in dense graphs such as similarity networks. One of the major advantages of the proposed strategy is that it can be applied to virtually all standard methods, since it relies on detecting communities in sampled networks.
2 Methods
For the description of community detection methods, consider the following notation. A network is defined as , where and are respectively the set of nodes and edges. The connectivity is represented as an adjacency matrix with elements
(1) 
The degree of node is given by . is the diagonal matrix. The element is
(2) 
is the Markovian adjacency matrix. Each element , defined as , represents the probability of a random walker at node to reach node in the next time step.
The algorithms selected here to detect communities in sampled networks are the walktrap and fast greedy methods, which were chosen because they are suitable for weighted networks that are generated with our approach.
2.1 Walktrap
The walktrap community detection method relies on random walks to split the network in natural partitions. At each time step, a particle moving on the network leaps to a neighboring node, which is chosen randomly. This process is repeated many times so that a Markov chain [24] is generated. Here, the walker is allowed to leap onto a neighbor in fixed, discrete time steps. Random walks are used in walktrap to create a node similarity metric, which in turn is used to cluster nodes into communities. Two nodes and are considered similar if a random walk starting at accesses node many times. This similarity can be obtained analytically from the matrix , whose element quantifies the probability of the walker to reach node (from node ) in steps. Each element of satisfies the relation . Therefore, if node is highly connected, it will reach node only a few times. Conversely, the higher the degree of node the higher is its probability to be reached from a random walk starting at any other node. In the steady state (i.e., in the limit as ), the stationary probability becomes:
(3) 
Therefore, the parameter should not be much higher than the mixing time [24] of , otherwise the likelihood would reflect only the connectivity (see fig. 1(b)). In addition, should not take very low values because far distant nodes would be inaccessible (see fig. 1(a)).
Given the transition matrix , the distance between nodes and is given by
(4) 
where is the ith row of . This metric can be generalized to measure the similarity between two communities and . Prior to the definition of , one needs to define the probability of a node to reach node in steps. This quantity is defined as
(5) 
which represents the average likelihood of a node to reach a node . With this definition, the distance between two communities is
(6)  
After computing all pairs of distances between communities, the walktrap method follows an agglomerative approach based on the Wards method [27]. Initially, each node represents a community. Two communities and are merged if the new partition minimizes , the squared distances between nodes and their respective communities:
(7) 
where . Then, a new community arises and the old partition becomes ). Finally, the process is repeated until the expected number of communities is obtained. The detection of two communities using this method is illustrated in fig. 2(a).
Note that the distance , as defined in eq. (4), has a strong relationship with the spectra of . More specifically, can be rewritten as
(8) 
where and are respectively the eigenvalues and eigenvectors of . In view of this formulation in terms of graph spectra, in eq. (8) may be defined to consider different weighting for distinct eigenvalues, allowing thus the use of continuous random walks [25]. This generalization is achieved with the following relation
(9)  
where
(10) 
2.2 Fast greedy
Similarly to the walktrap community detection method, the fast greedy algorithm is also based on hierarchical agglomerative clustering. Initially, each node represents a community. As the algorithm is progressively applied, similar nodes are joined into communities (the similarity is established according to a given criterion) until all nodes belong to a same giant community, thus completing the dendrogram. To join two nodes, the algorithm uses the modularity , which measures the number of intracommunity edges that are higher than the expected by chance. The quantity is
(11)  
where is the fraction of edges linking nodes in community to those in community , , , is the community to which node belongs and
More specifically, the fast greedy algorithm joins two communities provided that is maximized. Note that eq. (11) can be straightforwardly computed in a weighted network provided that it has been mapped to a multigraph [26].
It is worth noting that it is not necessary to check all possible joining possibilities since only the junction of neighboring communities (i.e. communities with at least one edge linking two of their nodes) is able to increase . An example of a network with two communities identified with the fast greedy method is depicted in fig 2(b).
3 Results and discussion
3.1 Community detection in incomplete networks
The ability of the community detection algorithms to find natural clusters in incomplete networks was tested with the following methodology. We started with toy networks , henceforth referred to as original networks, generated according to the procedures described in Refs. [28, 29]. The following parameters were employed: , the number of nodes; , the average degree and , the mixing parameter (quantifies the fraction of links that are placed outside the community of the node). According to previous studies [19, 39], we chose . Values of mixing parameter above destroy the modular structure of the network. This is apparent when one observes, for example, that the normalized mutual information () [37] obtained with the walktrap in for and were and , respectively.
To create an incomplete version of , the nodes in were randomly sampled with sampling rate . The unweighted connectivity matrix becomes an weighted matrix such that , where represents the length of the shortest path linking nodes and in . This approach relying oh the random selection of nodes is similar to the one employed in the study performed in [35], which investigated the convergence of spectral clustering methods (in the machine learning context) for increasing sample size. As we shall show, the main focus of our study is to use the random selection of nodes for devising a more efficient version of traditional community detection methods. In the experiments, we used the following networks:

Network : and ,

Network : and ,

Network : and ,

Network : and ,

Network : and ,

Network : and .
To compute the accuracy rate in identifying the community structure of complex networks, consider the following definition. Let and be the community associated with node in the reference network and the community associated with the same node by one of the community detection algorithms. Note that, to quantify the accuracy rate it is not enough to compare and , because the labeling scheme employed by the algorithm might be different from the one employed to describe the communities in the reference network. For example, if and , the accuracy rate obtained from a straightforward comparison would be , even though the communities are equivalent. To consider all possible labeling schemes for , it is possible to apply the operator , which maps to every possible labeling scheme. According to the previous example, the application of to would lead to the mapping . Equivalently, and . Thus, the accuracy rate can be defined as
(12) 
where if and if . Even though the measurement defined in equation 12 is able to capture the quality of the found partition, it depends upon the computation of several permutations. To avoid such costly computation, we used instead the normalized mutual information, which can be computed as
(13) 
where and are respectively the number of real and found communities, is the number of nodes in the original community that appear in the found community , and . The normalized mutual information has been shown to perform well in practice and for this reason has been used in the community detection field [37, 38].
The ability to detect community structures in fig. 3 using the walktrap algorithm is similar for all the networks considered. The performance is very high for incomplete networks with spurious edges (i.e., when the sampling is performed with sampling rate ), as revealed by value of normalized mutual information above . When decreases and therefore less nodes are left in the incomplete network, the ability to detect communities diminishes, as one should expect. Interestingly, for all networks, there exists a threshold discriminating two regimes. When , the organization in communities disappears rapidly as decreases. In contrast, for , the community structure seems to be maintained in spite of the removal of many nodes. This is apparent for network (see fig. 3(b)), for example. Even with 60% of the nodes being discarded (), the communities are well distinguished from each other. Also, the degree of connectivity affects . The increase in causes the network to be more robust so that the modular organization does not disappear at all, an effect that becomes even more evident by comparing () and (). While in the former the threshold is , the latter displays a threshold .
Fig. 4 displays how the normalized mutual information varies with the sampling rate for the fast greedy method used to detect communities. The results are essentially similar to those of the walktrap method in fig. 3. The fast greedy method performs well when (i.e., when no node is removed), just as in the walktrap. As nodes are removed with a sampling rate , the normalized mutual information decreases at a low rate. The values of for both methods are similar, suggesting a stronger dependence on network topology. The robustness of the network (in the sense that the community structure is maintained) increases with the average connectivity , as indicated by comparing and in fig. 4.
All in all the results reveal that the community detection methods evaluated are robust for they are able to identify the modular organization even when many nodes from the original network are removed. Hence if we are interested in finding the community to which only a few nodes belong, we can choose to deliberately eliminate the other nodes from the analysis. Provided that the sampling rate is sufficiently large (i.e., ), high accuracy can be achieved with a gain in performance, since computation in smaller networks implies a decrease in computational cost. This idea of detecting community in sampled networks with a gain in temporal performance serves as motivation to the proposed method described below.
3.2 Fast community detection via sampling processes in synthetic networks
The finding that the community structure is maintained in incomplete networks derived from a random sampling process with a sampling rate motivated us to devise a method to decrease the computational cost of the walktrap and fast greedy methods. As we shall show, this gain in time performance has a low impact on the quality of the found partition provided that the network is sufficiently connected. The proposed algorithm initially randomly chooses a set such that . Then the selected nodes are connected with weights , where is the length of the shortest path linking nodes and in the complete (not sampled) network. Note that this procedure coincides with the one adopted to form incomplete networks in the previous section. In the next step, communities are discovered using any standard method. Then the membership assigned for each node in the sampled network is mapped to the corresponding node in the original network. To assign the membership of the remaining nodes in , a voting strategy over the neighbors is adopted. If most of the neighbors belong to the community , then is assigned to that node. In case of ties, the decision is postponed to the next iteration. This process is repeated until all nodes have been classified. The overall process can be summarized in 6 steps:

Step 1: Select randomly a set of nodes from the original network.

Step 2: Create an incomplete network whose edges weights are inversely proportional to the distances in the original network.

Step 3: Identify the communities in the simplified network using any standard community detection method (e.g., walktrap or fast greedy).

Step 4: Transfer the memberships obtained in the incomplete network to the original network.

Step 5: Propagate labels according to a voting strategy over neighbors.

Step 6: Repeat step 5 until all nodes have been classified.
The process of detecting communities with the above method is illustrated in the original toy network displayed in fig. 5(a). The two communities are divided by a dashed line. Highlighted nodes represent those selected randomly. Initially, an incomplete network comprising the nodes randomly selected from the original network is formed (fig. 5(b)). After detecting the communities in the incomplete network (fig. 5(c)), the membership of each node is transferred to the original network, giving rise to the configuration depicted in fig. 5(d). Then the label propagation phase takes over until all nodes are classified. The result of the first iteration is displayed in fig. 5(e). Note that node has been classified as belonging to the ‘green’ community because it is connected to two nodes belonging to the ’green’ community and just one belonging to the ’yellow’ community. On the other hand, node was incorrectly classified as ’green’ because it is connected to another ’green’ node. The final configuration after the second iteration is shown in fig. 5(f).
The efficiency of the proposed technique was verified in the networks  . The results obtained using the walktrap method in step 3 is displayed in fig. 6. In each subplot, the upper curve refers to the normalized mutual information in assigning communities, while the bottom one shows the normalized processing time – the speedup (i.e. the time spent in performing the six steps divided by the time spent by the community detection method running directly on the original network). Interestingly, the accuracy rates after step 6 are similar to those in figs. 3 and 4, thus indicating that the accuracy of our method strongly depends on the ability to detect the communities in the sampled, incomplete networks (step 3). Provided that this detection is correct, the membership labels are propagated with minimum error. The curves of time performance reveal that it is feasible to achieve a high accuracy rate while improving time performance. For instance, in network our method reaches a value of and increases time performance in about 60%. The comparison between and shows that the proposed method is even more effective when the average connectivity of the original network takes high values. While a sampling rate of 30% yields an partition with in , the same sampling rate yields an accuracy rate of in network . In the latter, our method runs around 10 times faster than the same algorithm running on the original network. With regard to the fastgreedy method, similar results were obtained (see fig. 7).
To probe whether the community structure found after removing some nodes of the original network is significant, the following experiment was carried out. For each sampled network created in step 2, we generated 20 equivalent randomized versions. We then identified the communities in these random networks in order to verify if the generated partition is as accurate as the one generated with the sampled networks obtained in step 2. The results comparing sampled and randomized versions of are shown in Table 1. Note that the normalized mutual information obtained in sampled networks is much larger than the one obtained in random networks, thus confirming the significance of the found communities. Similar results have been found for the other synthetic networks (results not shown).
0.10  0.106  0.012  0.023 
0.15  0.645  0.007  0.008 
0.20  0.507  0.005  0.011 
0.25  0.730  0.003  0.003 
0.30  0.720  0.005  0.008 
0.35  0.869  0.002  0.002 
0.40  0.960  0.002  0.003 
0.45  0.944  0.003  0.003 
0.50  0.982  0.003  0.003 
0.55  1.000  0.001  0.002 
0.60  1.000  0.001  0.001 
0.65  1.000  0.001  0.001 
0.70  0.972  0.002  0.001 
0.75  1.000  0.001  0.001 
0.80  1.000  0.001  0.001 
0.85  1.000  0.001  0.002 
0.90  1.000  0.001  0.001 
0.95  1.000  0.001  0.001 
In the light of the behavior displayed in figs. 6 and 7, the average connectivity seems to play a crucial role on the curves for accuracy versus sampling rates. A more detailed analysis of the relationship between the sampling rate and accuracy rate was conducted on networks and , with the results for the walktrap being shown in fig. 8. It is clear that the tuning of affects the threshold . Whenever takes sufficiently low values (e.g. in fig. 8(a)), the community structure fades away even with high sampling rates. These results suggest that the strategy developed here is especially useful when the original network is very connected. Actually, our method is most suitable to detect communities in weighted, complete networks [30], for the sampling process ensures that both the number of nodes and edges decreases, thus assuring an enhancement in time performance.
The robustness of the network was also studied in networks comprising four communities. In this case, we noted that the quality of the partitions decreased after the removal of a few nodes (see fig. S3). Therefore, in networks with a high number of overlapping communities, more efficient sampling node should be considered.
3.3 Fast community detection via sampling processes in real networks
To complement the investigation of the properties of the proposed methodology to detect modular structures, we verified the influence of sampling nodes on the discriminability of communities in real networks. The following similarity networks were studied: the email network ( and , see [41]) and the network of political blogs ( and , see [40]). The results are shown in fig. 10. In this figure, the relative accuracy represents the fraction , where and are the normalized mutual information obtained in the sampled and original networks, respectively. The email network turned out to be less resilient than the other synthetic networks studied in Section 3.2. This is apparent when one notes that the accuracy decreases even when a small amount of nodes are removed. In this case, the walktrap method seems to be more robust than the fast greedy. The network of political blogs, on the other hand, displayed a more robust behavior for the accuracy as more nodes are removed. Interestingly, the relative accuracy remains high when about 50% of the nodes are disregarded. Concerning the variability of the normalized mutual information across distinct sampled networks, we observed low values of coefficient of variation (see fig. 10). In general, as expected, the highest values of variability occurred for the lowest values of the sampling rate .
In this section, as proof of principle, we verified that our method can be applied in two real networks. However, further studies should clarify which conditions should be fulfilled so that the gain in performance via sampling nodes still provides good partitions. As noted for the synthetic networks, the gain in performance may depend upon the mixing parameter, the average connectivity and other factors. For this reason, we believe that the proposition of novel sampling heuristics that are able to maintain the original modular structure will improve the efficiency of the proposed technique both in synthetic and real networks.
4 Conclusion
We have demonstrated that the walktrap and fast greedy algorithms are suitable to accurately identify communities even if many nodes of the real network were missing, which is a key issue in network theory for the many cases of incomplete information. Inspired by this robust behaviour, we devised a technique to detect the modular structure of dense networks (such as similarity networks) that is based on the application of standard methods in sampled networks. Our method provided high accuracy rates while improving the time performance in networks.
As for future work, we are planning to devise an approach to identify automatically the best sampling rate that provides optimized gain in temporal complexity, given a fixed margin of error in accuracy. An important adaptation will be developed to adapt the algorithm in networks with lower average degree. We also intend to conceive novel ways to propagate the memberships of nodes in step 5 of our method through techniques similar to those used in semisupervised pattern recognition [32]. Another possibility is to investigate the applicability of novel sampling techniques to further improve the accuracy and time performance. Finally, one could verify the effect of sampling in multiresolution community analysis [33] and in networks with overlapping community structure [34].
Acknowledgments
The authors are grateful to São Paulo Research Foundation (FAPESP) (grant numbers 2013/067174 and 2014/208300).
References
References
 [1] M. Faloutsos, P. Faloutsos, Faloutsos C, Computer Communication Review 29 (1999) 251.
 [2] G. Siganos, M. Faloutsos, P. Faloutsos, C. Faloutsos, IEEE/ACM Trans. Netw. 11 (2003) 514.
 [3] R. Albert, H. Jeong, AL BarabÃ¡si, Nature 401 (1999) 130.
 [4] R. Guimera, S. Mossa, A. Turtschi, L. A. N. Amaral, Proc. Natl. Acad. Sci. U.S.A. 102 (2005) 7794.
 [5] S. Porta, P. Crucitti, V. Latora, Physica A 369 (2006) 853.
 [6] A. Schadschneider, Physica A 313 (2002) 153.
 [7] B.A. Carreras, V.E. Lynch, I. Dobson, D.E. Newman, Chaos 14 (2004) 643.
 [8] S. Fortunato, Phys. Rep. 486 (2010) 75.
 [9] P. Pons, M. Latapy, J. Graph Algorithms Appl. 10 (2008) 191.
 [10] M.E.J. Newman, Phys. Rev. E 69 (2004) 066133.
 [11] M. Girvan, M.E.J. Newman, Proc. Natl. Acad. Sci. U.S.A. 99 (2002) 7821.
 [12] M.E.J. Newman, Phys. Rev. E 74 (2006) 036104.
 [13] D.M. Wilkinson, B.A. Huberman, Proc. Natl. Acad. Sci. U.S.A. 101 (2004) 5241.
 [14] P. Holme, M. Huss, H. Jeong, Bioinformatics 19 (2003) 532.
 [15] M.P. Viana, D.R. Amancio, L.F. Costa, J. Informetr. 7 (2013) 371.
 [16] P.M. Gleiser, L. Danon, Adv. Complex Syst. 6 (20030 565.
 [17] J. Kleinberg, S. Lawrence, Science 294 (2001) 1849.
 [18] S. Redner, EPJ B 4 (1998) 131.
 [19] B. Yan, S. Gregory, J. Phys. A 44 (2011) 495102.
 [20] E. Sprinzak, S. Sattath, H. Margalit, J. Mol. Biol. 327 (2003) 919.
 [21] R. Guimerà R., M. SalesPardo, Proc. Natl. Acad. Sci. U.S.A. 106 (2009) 22073.
 [22] D. Gfeller, JC Chappelier, P.L. Rios, Phys. Rev. E 72 (2005) 056135.
 [23] B. Karrer, E. Levina, M.E.J. Newman, Phys. Rev. E 77 (2008) 046119.
 [24] J.R. Norris, Markov Chains, Cambridge University Press, Cambridge (1998).
 [25] E.W. Montroll, G.H. Weiss, J. Math. Phys. 6 (1965) 167.
 [26] Newman M E J 2004 Phys. Rev. E 70 056131
 [27] J.H. Ward, JASA 58 (1963) 236.
 [28] A. Lancichinetti, S. Fortunato, Phys. Rev. E 80 (2009) 016118.
 [29] A. Lancichinetti, S. Fortunato, F. Radicchi, Phys. Rev. E 78 (2008) 046110.
 [30] G.F. Arruda, L.F. Costa, F.A. Rodrigues, Physica A 391 (2012) 6174.
 [31] G. Daraganova, P. Pattison, J. Koskinen, B. Mitchell, A. Bill, M. Watts, S. Baum, Soc. Networks 34 (2012) 6.
 [32] H. Gweon, J. Tenenbaum, L.E. Schulz, Proc. Natl. Acad. Sci. U.S.A. 107 (2010) 9066.
 [33] J. Zhang, K. Zhang, X. Xu, C.K. Tse, M. Small, New J. Phys. 11 (2009) 113003.
 [34] A. Lancichinetti, S. Fortunato, J. Kertesz, New J. Phys. 11 (2009) 033015.
 [35] Luxburg U V, Bousquet O and Belkin M 2004 Proc. Annual Conference on Learning Theory
 [36] Zachary W W 1977 J. Anthropol. Res. 33 452–473
 [37] Danon L, DíazGuilera A, Duch J and Arenas A 2005 J. Stat. Mech. P09008.
 [38] Fred A and Jain A 2003 Proc. of IEEE Computer Society Conference on Computer Vision and Pattern Recognition
 [39] Yan B and Gregory S 2012 Phys. Rev. E 85 056112
 [40] Adamic L A and Glance N 2005 Proc. of the Workshop on the Weblogging Ecosystem
 [41] Guimera R, Danon L, DiazGuilera A, Giralt F and Arenas A 2003 Phys. Rev. E 68 065103(R)