HOME

TheInfoList



OR:

Modularity is a measure of the structure of
networks Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...
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 the study of complex networks, a network is said to have community structure if the nodes of the network can be easily grouped into (potentially overlapping) sets of nodes such that each set of nodes is densely connected internally. In the part ...
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

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/math>. 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 In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph. In the special case of a finite simp ...
for the network be represented by A, where A_=0 means there's no edge (no interaction) between nodes v and w and A_ = 1 means there is an edge between the two. Also for simplicity we consider an undirected network. Thus A_ = A_. (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 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^ for them, i = 1, \ldots, k_v, with I_i^ = 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^=0. Since the i-th stub of node v can connect to any of the 2m-1 remaining stubs with equal probability, and since there are k_w stubs it can connect to associated with node w, evidently : p(I_i^ = 1) = E _i^= \frac The total number of full edges J_ between v and w is just J_ = \sum_^I_i^, so the expected value of this quantity is : E _= E\left sum_^ I_i^\right= \sum_^ E _i^= \sum_^ \frac = \frac 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 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_ 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.


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_ - \frac Summing over all node pairs gives the equation for modularity, Q. It is important to note that 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_= \sum_ \frac 1_ 1_ and ''a''''i'' is the fraction of ends of edges that are attached to vertices in community ''i'': : a_i=\frac = \sum_ e_


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_ to be 1 if vertex v belongs to group r and 0 otherwise. Then : \delta(c_v,c_w) = \sum_r S_ S_ and hence : Q = \frac \sum_ \sum_r \left A_ - \frac \rightS_ S_ = \frac \mathrm(\mathbf^\mathrm\mathbf), where S is the (non-square) matrix having elements S_ and B is the so-called modularity matrix, which has elements : B_ = A_ - \frac. All rows and columns of the modularity matrix sum to zero, which means that the modularity of an undivided network is also always 0. 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 = \sum_ B_ s_v s_w = \mathbf^\mathrm\mathbf, where s is the column vector with elements s_v. This function has the same form as the Hamiltonian of an Ising
spin glass In condensed matter physics, a spin glass is a magnetic state characterized by randomness, besides cooperative behavior in freezing of spins at a temperature called 'freezing temperature' ''Tf''. In ferromagnetic solids, component atoms' magne ...
, a connection that has been exploited to create simple computer algorithms, for instance using
simulated annealing Simulated annealing (SA) is a probabilistic technique for approximating the global optimum of a given function. Specifically, it is a metaheuristic to approximate global optimization in a large search space for an optimization problem. ...
, 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.


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. 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.


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 In graph theory, a loop (also called a self-loop or a ''buckle'') is an edge that connects a vertex to itself. A simple graph contains no loops. Depending on the context, a graph or a multigraph may be defined so as to either allow or disallow ...
, which increases (''r>0'') or decreases (''r<0'') the aversion of nodes to form communities; 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. 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 been shown that these methods have limitations when communities are very heterogeneous in size.


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.{{citation , title = Vienna graph clustering repository , date=13 April 2021, url=https://github.com/VieClus/VieClus


See also

*
Complex network In the context of network theory, a complex network is a graph (network) with non-trivial topological features—features that do not occur in simple networks such as lattices or random graphs but often occur in networks representing real ...
*
Community structure In the study of complex networks, a network is said to have community structure if the nodes of the network can be easily grouped into (potentially overlapping) sets of nodes such that each set of nodes is densely connected internally. In the part ...
*
Null model In mathematics, for example in the study of statistical properties of graphs, a null model is a type of random object that matches one specific object in some of its features, or more generally satisfies a collection of constraints, but which is ...
*
Percolation theory In statistical physics and mathematics, percolation theory describes the behavior of a network when nodes or links are added. This is a geometric type of phase transition, since at a critical fraction of addition the network of small, disconnecte ...


References

Network theory Algebraic graph theory
Networks Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...