World Library  
Flag as Inappropriate
Email this Article

Modularity (networks)

Article Id: WHEBN0018396728
Reproduction Date:

Title: Modularity (networks)  
Author: World Heritage Encyclopedia
Language: English
Subject: Biological network, Community structure, Network science, Null model, Clique percolation method
Collection: Algebraic Graph Theory, Network Theory
Publisher: World Heritage Encyclopedia

Modularity (networks)

Modularity is one measure of the structure of networks or graphs. It was designed to measure the strength of division of a network into modules (also called groups, clusters or communities). Networks with high modularity have dense connections between the nodes within modules but sparse connections between nodes in different modules. Modularity is often used in optimization methods for detecting community structure in networks. However, it has been shown that modularity suffers a resolution limit and, therefore, it is unable to detect small communities. Biological networks, including animal brains, exhibit a high degree of modularity.


  • Motivation 1
  • Definition 2
  • Example of multiple community detection 3
  • Matrix formulation 4
  • Resolution limit 5
  • Multiresolution methods 6
  • See also 7
  • References 8
  • External links 9


Many scientifically important problems can be represented and empirically studied using networks. For example, biological and social patterns, the World Wide Web, metabolic networks, food webs, neural networks and pathological networks are real world problems that can be mathematically represented and topologically studied to reveal some unexpected structural features.[1] Most of these networks possess a certain community structure that has substantial importance in building an understanding regarding the dynamics of the network. For instance, a closely connected social community will imply a faster rate of transmission of information or rumor among them than a loosely connected community. Thus, if a network is represented by a number of individual nodes connected by links which signify a certain degree of interaction between the nodes, communities are defined as groups of densely interconnected nodes that are only sparsely connected with the rest of the network. Hence, it may be imperative to identify the communities in networks since the communities may have quite different properties such as node degree, clustering coefficient, betweenness, centrality.[2] etc., from that of the average network. Modularity is one such measure, which when maximized, leads to the appearance of communities in a given network.


Modularity is the fraction of the edges that fall within the given groups minus the expected such fraction if edges were distributed at random. The value of the modularity lies in the range [−1/2,1). It is positive if the number of edges within groups exceeds the number expected on the basis of chance. For a given division of the network's vertices into some modules, modularity reflects the concentration of edges within modules compared with random distribution of links between all nodes regardless of modules.

There are different methods for calculating modularity.[1] In the most common version of the concept, the randomization of the edges is done so as to preserve the degree of each vertex. Let us consider a graph with n nodes and m links (edges) such that the graph can be partitioned into two communities using a membership variable s. If a node v belongs to community 1, s_v = 1, or if v belongs to community 2, s_v = -1. Let the adjacency matrix for the network be represented by A, where A_{vw} = 0 means there's no edge (no interaction) between nodes v and w and A_{vw} = 1 means there is an edge between the two. Also for simplicity we consider an undirected network. Thus A_{vw} = A_{wv}. (It is important to note that multiple edges may exist between two nodes, but here we assess the simplest case).

Modularity Q is then defined as the fraction of edges that fall within group 1 or 2, minus the expected number of edges within groups 1 and 2 for a random graph with the same node degree distribution as the given network.

The expected number of edges shall be computed using the concept of Configuration Models.[3] The configuration model is a randomized realization of a particular network. Given a network with n nodes, where each node v has a node degree kv, the configuration model cuts each edge into two halves, and then each half edge, called a stub, is rewired randomly with any other stub in the network even allowing self loops. Thus, even though the node degree distribution of the graph remains intact, the configuration model results in a completely random network.

Let the total number of stubs be ln

l_{n}= \sum_{v}^{n} k_{v} =2m






Now, if we randomly select two nodes v and w with node degrees kv and kw respectively and rewire the stubs for these two nodes, then,

\text{Expectation of full edges between }v \text{ and }w ={\text{ (Full edges between }v\text{ and }w\text{)}}/{ \text{(Total number of rewiring possibilities)}}






Total number of rewirings possible = number of stubs remaining after choosing a particular stub = ln-1= l n for large n

Thus, Expected [Number of full edges between v and w]=(kv* kw)/ln =(kv kw)/2m.

Hence, the actual number of edges between v and w minus expected number of edges between them is Avw-(kv kw )/2m. Thus using [1]

Q = \frac{1}{2m} \sum_{vw} \left[ A_{vw} - \frac{k_v*k_w}{2m} \right] \frac{s_{v} s_{w}+1}{2}






It is important to note that Eq. 3 holds good for partitioning into two communities only. Hierarchical partitioning (i.e. partitioning into two communities, then the two sub-communities further partitioned into two smaller sub communities only to maximize Q) is a possible approach to identify multiple communities in a network. Additionally, (3) can be generalized for partitioning a network into c communities.[4]

Q = \sum_{vw} \left[ \frac {A_{vw}}{2m} - \frac{k_v*k_w}{(2m)(2m)} \right] \delta(c_{v}, c_{w}) =\sum_{i=1}^{c} (e_{ii}-a_{i}^2)






where eii is the fraction of edges with both end vertices in the same community i:

e_{ii}= \sum_{vw} \frac{A_{vw}}{2m} \delta(c_v,c_w)

and ai is the fraction of ends of edges that are attached to vertices in community i:

a_i=\frac{k_i}{2m} = \sum_{j} e_{ij}

Example of multiple community detection

We consider an undirected network with 10 nodes and 12 edges and the following adjacency matrix.

Fig 1. Sample Network corresponding to the Adjacency matrix with 10 nodes, 12 edges.
Fig 2. Network partitions that maximize Q. Maximum Q=0.4896
Node ID 1 2 3 4 5 6 7 8 9 10
1 0 1 1 0 0 0 0 0 0 1
2 1 0 1 0 0 0 0 0 0 0
3 1 1 0 0 0 0 0 0 0 0
4 0 0 0 0 1 1 0 0 0 1
5 0 0 0 1 0 1 0 0 0 0
6 0 0 0 1 1 0 0 0 0 0
7 0 0 0 0 0 0 0 1 1 1
8 0 0 0 0 0 0 1 0 1 0
9 0 0 0 0 0 0 1 1 0 0
10 1 0 0 1 0 0 1 0 0 0

The communities in the graph are represented by the red, green and blue node clusters in Fig 1. The optimal community partitions are depicted in Fig 2.

Matrix formulation

An alternative formulation of the modularity, useful particularly in spectral optimization algorithms, is as follows.[1] Define Svr to be 1 if vertex v belongs to group r and zero otherwise. Then

\delta(c_v,c_w) = \sum_r S_{vr} S_{wr}

and hence

Q = \frac{1}{2m} \sum_{vw} \sum_r \left[ A_{vw} - \frac{k_v k_w}{2m} \right] S_{vr} S_{wr} = \frac{1}{2m} \mathrm{Tr}(\mathbf{S}^\mathrm{T}\mathbf{BS}),

where S is the (non-square) matrix having elements Svr and B is the so-called modularity matrix, which has elements

B_{vw} = A_{vw} - \frac{k_v k_w}{2m}.

All rows and columns of the modularity matrix sum to zero, which means that the modularity of an undivided network is also always zero.

For networks divided into just two communities, one can alternatively define sv = ±1 to indicate the community to which node v belongs, which then leads to

Q = {1\over 2m} \sum_{vw} B_{vw} s_v s_w = {1\over 2m} \mathbf{s}^\mathrm{T}\mathbf{Bs},

where s is the column vector with elements sv.[1]

This function has the same form as the Hamiltonian of an Ising spin glass, a connection that has been exploited to create simple computer algorithms, for instance using simulated annealing, to maximize the modularity. The general form of the modularity for arbitrary numbers of communities is equivalent to a Potts spin glass and similar algorithms can be developed for this case also.[5]

Resolution limit

Modularity compares the number of edges inside a cluster with the expected number of edges that one would find in the cluster if the network were a random network with the same number of nodes and where each node keeps its degree, but edges are otherwise randomly attached. This random null model implicitly assumes that each node can get attached to any other node of the network. This assumption is however unreasonable if the network is very large, as the horizon of a node includes a small part of the network, ignoring most of it. Moreover, this implies that the expected number of edges between two groups of nodes decreases if the size of the network increases. So, if a network is large enough, the expected number of edges between two groups of nodes in modularity's null model may be smaller than one. If this happens, a single edge between the two clusters would be interpreted by modularity as a sign of a strong correlation between the two clusters, and optimizing modularity would lead to the merging of the two clusters, independently of the clusters' features. So, even weakly interconnected complete graphs, which have the highest possible density of internal edges, and represent the best identifiable communities, would be merged by modularity optimization if the network were sufficiently large.[6] For this reason, optimizing modularity in large networks would fail to resolve small communities, even when they are well defined. This bias is inevitable for methods like modularity optimization, which rely on a global null model.[7]

Multiresolution methods

There are two main approaches which try to solve the resolution limit within the modularity context: the addition of a resistance r to every node, in the form of a self-loop, which increases (r>0) or decreases (r<0) the aversion of nodes to form communities;[8] or the addition of a parameter γ>0 in front of the null-case term in the definition of modularity, which controls the relative importance between internal links of the communities and the null model.[5] Optimizing modularity for values of these parameters in their respective appropriate ranges, it is possible to recover the whole mesoscale of the network, from the macroscale in which all nodes belong to the same community, to the microscale in which every node forms its own community, hence the name multiresolution methods. However, it has recently been demonstrated that these methods are intrinsically deficient and their use will not produce reliable solutions.[9] [10] [11]

See also


  1. ^ a b c d e Newman, M. E. J. (2006). "Modularity and community structure in networks". Proceedings of the National Academy of Sciences of the United States of America 103 (23): 8577–8696.  
  2. ^ Newman, M. E. J. (2007). Palgrave Macmillan, Basingstoke, ed. "Mathematics of networks". The New Palgrave Encyclopedia of Economics (2 ed.). 
  3. ^ Remco van der Hofstad (2013). "Random Graphs and Complex Networks". 
  4. ^ Clauset, Aaron and Newman, M. E. J. and  
  5. ^ a b Joerg Reichardt and Stefan Bornholdt (2006). "Statistical mechanics of community detection". Physical Review E 74 (1): 016110.  
  6. ^ Santo Fortunato and Marc Barthelemy (2007). "Resolution limit in community detection". Proceedings of the National Academy of Sciences of the United States of America 104 (1): 36–41.  
  7. ^ J.M. Kumpula, J. Saramäki, K. Kaski , and J. Kertész (2007). "Limited resolution in complex network community detection with Potts model approach". European Physical Journal B 56 (1): 41–45.  
  8. ^ Alex Arenas, Alberto Fernández and Sergio Gómez (2008). "Analysis of the structure of complex networks at different resolution levels". New Journal of Physics 10 (5): 053039.  
  9. ^ Andrea Lancichinetti and Santo Fortunato (2011). "Limits of modularity maximization in community detection". Physical Review E 84: 066122.  
  10. ^ Ju Xiang and Ke Hu (2012). "Limitation of multi-resolution methods in community detection". Physica A: Statistical Mechanics and its Applications 391 (20): 4995–5003.  
  11. ^ Ju Xiang, Xin-Guang Hu, Xiao-Yu Zhang, Jun-Feng Fan, Xian-Lin Zeng, Gen-Yi Fu, Ke Deng and Ke Hu (2012). "Multi-resolution modularity methods and their limitations in community detection". European Physical Journal B 85 (10): 1–10.  

External links

  • M. E. J. Newman (2006). "Modularity and community structure in networks". Proc. Natl. Acad. Sci. U.S.A. 103 (23): 8577–8582.  
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.