Modularity (networks)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 9 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

. Modularity is a measure of the structure of networks or graphs which measures 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. Biological networks, including animal brains, exhibit a high degree of modularity. However, modularity maximization is not statistically consistent, and finds communities in its own null model, i.e. fully random graphs, and therefore it cannot be used to find statistically significant community structures in empirical networks. Furthermore, it has been shown that modularity suffers a resolution limit and, therefore, it is unable to detect small communities.

.]] Modularity is a measure of the structure of networks or graphs which measures 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. Biological networks, including animal brains, exhibit a high degree of modularity. However, modularity maximization is not statistically consistent, and finds communities in its own null model, i.e. fully random graphs, and therefore it cannot be used to find statistically significant community structures in empirical networks. Furthermore, it has been shown that modularity suffers a resolution limit and, therefore, it is unable to detect small communities. ==Motivation== 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. 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, 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. ==Definition== Modularity is the fraction of the edges that fall within the given groups minus the expected fraction if edges were distributed at random. The value of the modularity for unweighted and undirected graphs 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. In the most common version of the concept, the randomization of the edges is done so as to preserve the degree of each vertex. 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_ =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} . (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 a configuration model. 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 k_v , 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 (which occur when a stub is rewired to another stub from the same node) and multiple-edges between the same two nodes. Thus, even though the node degree distribution of the graph remains intact, the configuration model results in a completely random network. ==Expected Number of Edges Between Nodes== Now consider two nodes v and w , with node degrees k_v and k_w respectively, from a randomly rewired network as described above. We calculate the expected number of full edges between these nodes. Let us consider each of the k_v stubs of node v and create associated indicator variables I_i^{(v,w)} for them, i = 1, \ldots, k_v , with I_i^{(v,w)} = 1 if the i -th stub happens to connect to one of the k_w stubs of node w in this particular random graph. If it does not, then I_i^{(v,w)}=0 . Since the i -th stub of node v can connect to any of the 2m-1 remaining stubs with equal probability (while m is the number of edges in the original graph), and since there are k_w stubs it can connect to associated with node w , evidently p(I_i^{(v,w)} = 1) = E[I_i^{(v,w)}] = \frac{k_w}{2m-1} The total number of full edges J_{vw} between v and w is just J_{vw} = \sum_{i=1}^{k_v}I_i^{(v,w)} , so the expected value of this quantity is E[J_{vw}] = E\left[\sum_{i=1}^{k_v} I_i^{(v,w)}\right] = \sum_{i=1}^{k_v} E[I_i^{(v,w)}] = \sum_{i=1}^{k_v} \frac{k_w}{2m-1} = \frac{k_v k_w}{2m - 1} Many texts then make the following approximations, for random networks with a large number of edges. When m is large, they drop the subtraction of 1 in the denominator above and simply use the approximate expression \frac{k_v k_w}{2m} for the expected number of edges between two nodes. Additionally, in a large random network, the number of self-loops and multi-edges is vanishingly small. Ignoring self-loops and multi-edges allows one to assume that there is at most one edge between any two nodes. In that case, J_{vw} becomes a binary indicator variable, so its expected value is also the probability that it equals 1 , which means one can approximate the probability of an edge existing between nodes v and w as \frac{k_v k_w}{2m} . ==Modularity== Hence, the difference between the actual number of edges between node v and w and the expected number of edges between them is A_{vw} - \frac{k_v k_w}{2m} Summing over all node pairs gives the equation for modularity, Q . {{NumBlk|:| Q = \frac{1}{2m} \sum_{vw} \left[ A_{vw} - \frac{k_v k_w}{2m} \right] \frac{s_{v} s_{w}+1}{2} | }} 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. where e ij is the fraction of edges with one end vertices in community i and the other in community j: e_{ij}= \sum_{vw} \frac{A_{vw}}{2m} 1_{v\in c_i} 1_{w\in c_j} and a i 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. 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. Define S_{vr} to be 1 if vertex v belongs to group r and 0 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} For networks divided into just two communities, one can alternatively define s_v = \pm 1 to indicate the community to which node v belongs, which then leads to Q = {1\over 4m} \sum_{vw} B_{vw} s_v s_w = {1\over 4m} \mathbf{s}^\mathrm{T}\mathbf{Bs}, where s is the column vector with elements s_v . 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. ==Software Tools== There are a couple of software tools available that are able to compute clusterings in graphs with good modularity. Original implementation of the multi-level Louvain method. The Leiden algorithm which additionally avoids unconnected communities. The Vienna Graph Clustering (VieClus) algorithm, a parallel memetic algorithm. ==See also== Complex network Community structure Null model Percolation theory ==References==

Text derived from https://en.wikipedia.org/w/index.php?oldid=1366148978 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

Extracted from the cited revision's reference blocks; absent citations are not invented.