Online Community Detection for Large Complex Networks
Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence. Pages 1903-1908.
© 2013 International Joint Conferences on Artificial Intelligence
Abstract
Complex networks describe a wide range of systems in nature and society. To understand the complex networks, it is crucial to investigate their internal structure. In this paper, we propose an online community detection method for large complex networks, which make it possible to process networks edge-by-edge in a serial fashion. We investigate the generative mechanism of complex networks and propose a split mechanism based on the degree of the nodes to create new community. Our method has linear time complexity. The method has been applied to six real-world network datasets and the experimental results show that it is comparable to existing methods in modularity with much less running time.
- [Ahn et al., 2010] Y.Y. Ahn, J.P. Bagrow, and S. Lehmann. Link communities reveal multiscale complexity in net- works. Nature, 466(7307):761-764, 2010.
- [Albert and Barabási, 2002] R. Albert and A.L. Barabási. Statistical mechanics of complex networks. Reviews of Modern Physics, 74(1):47, 2002.
- [Barabási and Albert, 1999] A.L. Barabási and R. Albert. Emergence of scaling in random networks. Science, 286(5439):509-512, 1999.
- [Barrat et al., 2004] A. Barrat, M. Barthelemy, R. Pastor- Satorras, and A. Vespignani. The architecture of complex weighted networks. Proceedings of the National Academy of Sciences, 101(11):3747-3752, 2004.
- [Boccaletti et al., 2006] Stefano Boccaletti, Vito Latora, Yamir Moreno, Martin Chavez, and D-U Hwang. Com- plex networks: structure and dynamics. Physics Reports, 424(4):175-308, 2006.
- [Brandes et al., 2008] U. Brandes, D. Delling, M. Gaertler, R. Gorke, M. Hoefer, Z. Nikoloski, and D. Wagner. On modularity clustering. IEEE Transactions on Knowledge and Data Engineering, 20(2):172-188, 2008.
- [Chan and Yeung, 2011] E.Y.K. Chan and D.Y. Yeung. A convex formulation of modularity maximization for com- munity detection. In Proceedings of the Twenty-Second International Joint Conference on Artificial Intelligence, pages 2218-2225. AAAI Press, 2011. IJCAI
- [Chen et al., 2009] Jiyang Chen, Osmar R. Zaïane, and Randy Goebel. Detecting communities in social networks using max-min modularity. In SDM, pages 978-989, 2009.
- [Chen et al., 2011] W. Chen, Z. Liu, X. Sun, and Y. Wang. Community detection in social networks through com- munity formation games. In Proceedings of the Twenty- Second International Joint Conference on Artificial Intel- ligence, pages 2576-2581. AAAI Press, 2011. IJCAI
- [Clauset et al., 2004] A. Clauset, M.E.J. Newman, and C. Moore. Finding community structure in very large net- works. Physical Review E, 70(6):066111, 2004.
- [Fortunato and Barthelemy, 2007] S. Fortunato and M. Barthelemy. Resolution limit in community de- tection. Proceedings of the National Academy of Sciences, 104(1):36-41, 2007.
- [Good et al., 2010] B.H. Good, Y.A. de Montjoye, and A. Clauset. Performance of modularity maximization in practical contexts. Physical Review E, 81(4):046106, 2010.
- [Lancichinetti and Fortunato, 2009] A. Lancichinetti and S. Fortunato. Community detection algorithms: a com- parative analysis. Physical Review E, 80(5):056117, 2009.
- [Leicht and Newman, 2008] E.A. Leicht and M.E.J. New- man. Community structure in directed networks. Physical Review Letters, 100(11):118703, 2008.
- [Leskovec et al., 2005] J. Leskovec, J. Kleinberg, and C. Faloutsos. Graphs over time: densification laws, shrink- ing diameters and possible explanations. In Proceedings of the eleventh ACM SIGKDD International Conference on Knowledge Discovery in Data Mining, pages 177-187. ACM, 2005.
- [Leskovec et al., 2007] J. Leskovec, J. Kleinberg, and C. Faloutsos. Graph evolution: densification and shrinking diameters. ACM Transactions on Knowledge Discovery from Data (TKDD), 1(1):2, 2007.
- [Leskovec et al., 2009] J. Leskovec, K.J. Lang, A. Dasgupta, and M.W. Mahoney. Community structure in large net- works: Natural cluster sizes and the absence of large well-defined clusters. Internet Mathematics, 6(1):29-123, 2009.
- [Leskovec et al., 2010] Jure Leskovec, Kevin J Lang, and Michael Mahoney. Empirical comparison of algorithms for network community detection. In Proceedings of the Nineteenth International Conference on World Wide Web, pages 631-640. ACM, 2010.
- [Li and Schuurmans, 2011] W. Li and D. Schuurmans. Mod- ular community detection in networks. In Proceedings of the Twenty-Second International Joint Conference on Ar- tificial Intelligence, pages 1366-1371. AAAI Press, 2011. IJCAI
- [Mitzenmacher, 2004] M. Mitzenmacher. A brief history of generative models for power law and lognormal distribu- tions. Internet Mathematics, 1(2):226-251, 2004.
- [Newman, 2003] M.E.J. Newman. The structure and func- tion of complex networks. SIAM Review, 45(2):167-256, 2003.
- [Newman, 2004a] M.E.J. Newman. Analysis of weighted networks. Physical Review E, 70(5):056131, 2004.
- [Newman, 2004b] M.E.J. Newman. Detecting community structure in networks. The European Physical Journal B- Condensed Matter and Complex Systems, 38(2):321-330, 2004.
- [Newman, 2006] M.E.J. Newman. Modularity and commu- nity structure in networks. Proceedings of the National Academy of Sciences, 103(23):8577-8582, 2006.
- [Ratti et al., 2010] C. Ratti, S. Sobolevsky, F. Calabrese, C. Andris, J. Reades, M. Martino, R. Claxton, and S.H. Strogatz. Redrawing the map of great britain from a net- work of human interactions. PLoS One, 5(12):e14248, 2010.
- [Szell et al., 2012] M. Szell, R. Sinatra, G. Petri, S. Thurner, and V. Latora. Understanding mobility in a social petri dish. Scientific Reports, 2, 2012.
- [Wu et al., 2011] L. Wu, X. Ying, X. Wu, and Z.H. Zhou. Line orthogonality in adjacency eigenspace with applica- tion to community partition. In Proceedings of the Twenty- Second International Joint Conference on Artificial Intel- ligence, pages 2349-2354. AAAI Press, 2011. IJCAI
- [Ziv et al., 2005] E. Ziv, M. Middendorf, and C.H. Wig- gins. Information-theoretic approach to network modu- larity. Physical Review E, 71(4):046117, 2005.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
Complex networks describe a wide range of systems in nature and society [Barrat et al., 2004]. Frequently cited examples include the Internet, a network of routers and computers connected by physical links, and the citation network, a network of papers linked by citations. To understand the formation, evolution, and function of complex networks, it is crucial to investigate their internal structure, not only for uncovering the relations between internal structure and functions in complex networks, but also for practical applications in many disciplines such as biology and sociology [Ratti et al., 2010; Szell et al., 2012].
The problem of community detection is one of the outstanding issues in the study of network structure. A wide variety of community detection methods have been developed to serve different scientific needs. For example, [Ahn et al., 2010] reinvent communities as groups of links rather than nodes and show that this unorthodox approach successfully reconciles the antagonistic organizing principles of overlapping communities and hierarchy. [Ziv et al., 2005] propose a principled information-theoretic algorithm for community detection. However, when processing large complex networks, most existing community detection methods become impractical owing to the requirement that the whole network structure be available at each step of the method. For this reason, there has been a strong interest for online community detection method which make it possible to detect community without accessing the whole network structure at each step.
∗Author for correspondence
In this paper, we consider the generative mechanism of complex networks which has mainly not been considered in past studies and propose an online community detection method. Our method has O(m) time complexity and O(nk) space complexity. The results of applying our method and some other feasible methods to real-world network datasets suggest that our method is scalable and competitive in performance.
2 RelatedWork
Traditional methods of community detection, such as spectral bisection, the Kernighan-Lin algorithm and hierarchical clustering based on similarity measures are not ideal for the types of real-world network datasets with which current research is concerned [Newman, 2004b]. Modularity is a recently introduced quality measure for community detection. It was first proposed in [Newman, 2004b]. [Good et al., 2010] describe the performance of modularity maximization in practical contexts and present a broad characterization of its performance in such situations. However, [Fortunato and Barthelemy, 2007] find that modularity optimization may fail to identify communities smaller than a scale which depends on the total size of the network and on the degree of interconnectedness of the communities. A check of the communities obtained through modularity optimization is thus necessary.
Modularity can be generalized in a principled fashion to incorporate the information contained in edge such as direction and weightiness. [Leicht and Newman, 2008] consider the problemof finding communities in directed networks. [Newman, 2004a] point out that weighted networks can in many cases be analyzed using a simple mapping from a weighted network to an unweighted multigraph. [Lancichinetti and Fortunato, 2009] generate directed and weighted networks with built-in community structure and show how modularity optimization performs on their benchmark.
A wide variety of modularity optimization methods have been developed [Leskovec et al., 2010]. For example, [Clauset et al., 2004] present a hierarchical agglomeration algorithm for detecting community. [Newman, 2006] show that the modularity can be expressed in terms of the eigenvectors of a characteristic matrix for the network and that this expression leads to a spectral algorithm for community detection. [Chen et al., 2011] introduce a game-theoretic framework to address the community detection problem based on the social networks structure. [Li and Schuurmans, 2011] propose an iterative rounding strategy for identifying the communities that is coupled with a fast constrained power method that sequentially achieves tighter spectral relaxations. [Chan and Yeung, 2011] propose a convex relaxation scheme to give an iterative algorithm which solves the general kpartition problem. [Wu et al., 2011] first projects node coordinates to the unit sphere and then applies the classic k-means to find communities. [Chen et al., 2009] present a new community mining measure, max-min modularity, which considers both connected pairs and criteria defined by domain experts in finding communities, and then specify a hierarchical clustering algorithm to detect communities in networks. A recent comparative analysis of community detection algorithms is in [Lancichinetti and Fortunato, 2009].
3 Online Community DetectionMethod
3.1 Preliminaries
A network G = {V,E} is a set of n nodes V = {v1, v2, . . . , vn} connected by a set of m edges E = {eij = {vi, vj}}. The network considered here is undirected, unweighted and without self-loops or isolated node. Let P = {C1, . . . ,CK} denote a partition of V , it is a division of V into K non-overlapping and non-empty communities Ck that cover all of V . As a performance measure for the quality of the partition, modularity was first proposed in [Newman, 2004b] and can be expressed as
where edg(Ck) = |{eij|vi ∈ Ck and vj ∈ Ck}| is the number of intra-community edges within Ck and deg(Ck) is the degree of Ck defined as deg(Ck) = ∑vi∈Ck deg(vi) where deg(vi) is the degree of node vi. Hence community detection can be formulated as an optimization problem
and [Brandes et al., 2008] prove the conjectured hardness of this problem both in the general case and with the restriction to number of partitions K.
3.2 Analysis of network expansion
Unlike most previous approaches, we consider networks as a result of expanding. It is growing by the addition of new edges. Given an existing network Gt-1 = {Vt-1,Et-1}, there are three cases for a new edge et = {vi, vj} to be added in Gt-1, namely, (a)link a new node to an existing node, {vi, vj} ∩ Vt-1 = {vi} or {vi, vj} ∩ Vt-1 = {vj}; (b)link two existing nodes, {vi, vj} ⊆ Vt-1; (c)link two new nodes, {vi, vj} ∩ Vt-1 = ∅(See Fig. 1).
Correspondingly, we do modularity optimization in a incremental way. For initial network G0 = ∅, it is clearly that the best partition P is an empty set too. For subsequent networks Gt, t = 1, 2, . . ., we derive our algorithm under those three cases separately as follow.

Case (a): link a new node to an existing node. Without loss of generality, we assume vi is the existing node and vj is the new node. It is easy to prove that a partition with maximum modularity has no community that consists of a single node with degree one. It seems that we should assign vj to an existing community. However, this greedy approach will almost certainly lead to a local maximum. In worst case, all nodes are in a same community and result in zero modularity. Hence a split mechanism is necessary.
Let us recall the generative mechanism of complex networks. The first widely accepted model for the observed stationary scale-free distributions of complex networks was proposed by [Barab´asi and Albert, 1999] and its importance is recognized by academia [Newman, 2003; Boccaletti et al., 2006]. It is based on two generic mechanisms: (a) networks expand continuously by the addition of new nodes; (b) new nodes attach preferentially to communities that are already well connected. Specifically, a new node vj will attach an existing node vi with probability p(vi) in proportion to the degree of node vi.
In other words, it is abnormal to observe a new node attaching an existing node with few edges and this phenomenon may indicate the emergence of a new community. This inspire us to split the new node to a new community with probability psplit that decreases with increases in the degree of the existing node. And the limit of psplit, as the degree of the existing node approaches infinite, should be zero. We choose psplit inversely proportional to the degree of the existing node.

Here we use deg(vi)+1 instead of deg(vi) to avoid deterministic split when deg(vi) = 1. Fig. 2 depict our split mechanism. When a new node attaches to an existing node with degree two, it join the same community of the existing node; when another new node attaches to the previous new node with degree one, it split to a new community.
For a complete review of the statistical mechanics of network topology and dynamics of complex networks, one can refer to [Albert and Barab´asi, 2002]. And [Mitzenmacher, 2004] briefly survey some other generative models that lead to scale-free distributions.
Case (b): link two existing nodes. Existing nodes may belong to a same community or not(See Fig. 3). If both nodes belong to a same community, the new edge just increase the number of intra-community edges in the community so we do nothing. If they belong to different communities, we evaluate ∆q(vi, vj), which is defined as modularity gain for node vi moving from it's community Ck(i) to node vj's community Ck(j), and ∆q(vi, vj)'s counterpart ∆q(vj, vi). If either of them larger than zero, we move one node according to maximum modularity gain principle.
Notice that ∆q(vi, vj) can be calculated in constant time through follow equation
where deg(vi,Ck) = |{eij|vj ∈ Ck}| is number of edges from the node vi to community Ck and Ck(i) is the community which the node vi belongs to.
We can improve modularity via other types of adjustments. For example, the modularity gain of merging two communities Ck(i) and Ck(j) is
where deg(Ck(i),Ck(j)) is number of edges between community Ck(i) and community Ck(j). Sometimes ∆q(Ck(i), Ck(j)) can be positive and significantly larger than ∆q(vj, vi) and ∆q(vi, vj). However, merging two communities may cause that subsequent optimazitions suffer from overlarge community size. For the sake of simplicity, we do not take those complex adjustments.
Case (c): link two new nodes. As a partition of maximum modularity does not include disconnected communities, those two nodes should not join any existing communities but form a new community themselves.
3.3 The proposed algorithm
Taken together, our method take a sequence of edges as input and do modularity optimization incrementally. If only one node of current edge belongs to the existing network, we split another node to a new community with probability inversely proportional to the degree of the existing node; If both nodes of current edge belong to the existing network but they belong to different communities, we move one node according to maximum modularity gain principle; If neither node of current edge belongs to the existing network, we just assign them to a new community. Obviously, our online community detection algorithm has O(m) time complexity. And the space complexity is O(nk) because we need to store deg(vi,Ck) for calculating modularity gain in constant time. The algorithm is summarized in Algorithm 1.

4 Experiments
In this section, we present experimental results of our online community detection method and compare it with some other methods. For simplicity, we use OL to refer to our method, CNM to refer to an agglomerative method [Clauset et al., 2004] and Eig to refer to the eigenvector-based method [Newman, 2006].
We use six real-world network datasets from Stanford Large Network Dataset Collection 1 , which commonly used by other researchers for community detection, their edge sizes varying from 93,439 to 1,992,636(See Table 1). These datasets are
- ca-CondMat: Collaboration network of Arxiv Condensed Matter [Leskovec et al., 2007];
- ca-HepPh: Collaboration network of Arxiv High Energy Physics [Leskovec et al., 2007];
- ca-AstroPh: Collaboration network of Arxiv Astro Physics [Leskovec et al., 2007];
- cit-HepTh: Arxiv High Energy Physics paper citation network [Leskovec et al., 2005];
- cit-HepPh: Arxiv High Energy Physics paper citation network [Leskovec et al., 2007]
- web-Stanford: Web graph of Stanford.edu [Leskovec et al., 2009].
The edges should be processed in order of creation. However, the datasets do not have timestamps on the edges. We process the edges in order of their appearance in the raw dataset file.
1 http://snap.stanford.edu/data/

| Network | Node Size | Edge Size |
|---|---|---|
| ca-CondMat | 23,133 | 93,439 |
| ca-HepPh | 12,008 | 118,489 |
| ca-AstroPh | 18,772 | 198,050 |
| cit-HepTh | 27,770 | 352,285 |
| cit-HepPh | 34,546 | 420,877 |
| web-Stanford | 281,903 | 1,992,636 |

We use C# to implement our algorithm 2 . For comparison, we employ implementation of CNM algorithm and Eig algorithm in igraph package 3 in R software 4 . Both CNM algorithm and Eig algorithm are written in C language. We carry out experiments on a Windows based Genuine Intel(R) CPU i3 @ 3.20GHz machine with 4.00GB memory.
Maximum and average modularity and variance of modularity over 10 runs by OL as well as modularity over 10 runs by Eig and CNM are reported in Table 2. We can see that OL outperforms Eig consistently for all six datasets and outperforms CNM except the last dataset, and the gap between OL and CNM in the last dataset is less than 0.02. The variance is low, so we need not run multiple times.
Average running time(in seconds) over 10 runs by OL, Eig and CNM are reported in Table 3 and Fig. 4. OL also has significantly advantage in terms of running time. It is linear in edge size as we expected. For networks with two millions of edges, it can give result in six seconds which is six hundred times faster than CNM.
To evaluate the convergence speed of OL, we plot the average temporal modularity over 10 runs by OL(See Fig. 5). We can see that OL can give a acceptable modularity immediately after process start and the modularity becomes stable in early stage for all six datasets.
5 Conclusion
In this paper we have examined the problem of detecting community in large complex networks, which is formulated as an optimization problem in which one searches for the maximum of the quantity known as modularity over possible partition of a network. We have considered the generative mechanism of complex networks and presented a new method which allows us to perform online modularity maximization. The method has been applied to a variety of realworld network datasets and our experiments give very encouraging results. Not only is the proposed method scalable in terms of both time and space complexity, but it also gives competitive performances. Our future research will consider the use of quality measures other than modularity for solving the community detection problem under an online optimization framework, as well as apply the method to directed and weighted complex networks.
2 Our C# implementation can be downloaded from http://www.cs.zju.edu.cn/people/gpan/
3 http://igraph.sourceforge.net/
4 http://www.r-project.org/
Acknowledgments
The authors want to thank anonymous reviewers for helpful comments. This work was supported by National Key Basic Research Program of China(2013CB329504) and Qianjiang Talent Program of Zhejiang(2011R10078).
@inproceedings{ijcai2013p281,
title = {Online Community Detection for Large Complex Networks},
author = {Zhang, Wangsheng and Pan, Gang and Wu, Zhaohui and Li, Shijian},
booktitle = {Proceedings of the Twenty-Third International Joint Conference on
Artificial Intelligence, {IJCAI-13}},
publisher = {AAAI Press / International Joint Conferences on Artificial Intelligence},
editor = {Francesca Rossi},
pages = {1903--1908},
year = {2013},
month = {8},
url = {https://ijcai.org/proceedings/2013/281},
}
TY - CPAPER TI - Online Community Detection for Large Complex Networks AU - Zhang, Wangsheng AU - Pan, Gang AU - Wu, Zhaohui AU - Li, Shijian T2 - Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence, IJCAI-13 PB - AAAI Press / International Joint Conferences on Artificial Intelligence PY - 2013 SP - 1903 EP - 1908 UR - https://ijcai.org/proceedings/2013/281 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: