A measure of the strength of a network's division into modules (also called clusters, communities, or cliques). Modular networks have higher connectivity within modules and low connectivity between modules. Modularity is often employed as an optimization criterion in algorithms for detecting community structure in networks.
The classic definition of modularity for binary, undirected networks is
$$ Q = \sum_{i=1}^{c} (e_{ii}-a_{i}^2)$$
Where $e_{ii}$ is the fraction of all edges that lie within module $i$, $a_{i}^2$ is the expected fraction of edges lying within module $i$, and $c$ is the number of communities.
Modularity can be extended to weighted networks by replacing $e_{ii}$ with the proportion of the sum of all edge weights that lies within modules, and $a_{i}^2$ with the expected proportion.
Modularity has been extended in various other ways, for example, to accommodate directed networks, bipartite networks, or tripartite networks.