Modularity is a graph metric that quantifies how strongly a network divides into communities—groups of nodes that are densely connected internally but sparsely connected to the rest of the graph. High modularity means the graph has clear, well‑defined clusters; low modularity means its structure is closer to random (Wikipedia)
What does modularity measure?
Modularity compares the actual number of edges inside communities against a potential number possible based on the node degrees. If a community has more internal edges than expected, it contributes positively to modularity; if not, it contributes little or even negatively. This makes modularity a powerful tool for community detection, used in algorithms such as Louvain and Leiden
Why is modularity important?
Modularity helps researcher understand the structure of the elements in biological, social and technological networks (protein interactions, blog communities etc). It provides a quantitative mechanism to evaluate how meaningful the community partitions are. It is the modularity metric that helps algorithms to separate individual items into meaningful communities.
Modularity = How dense if the network?
If we consider the graph as a crowd of people in a party:
- Some people form tight groups chatting together.
- Others wander between groups.
- A few stand alone.
Modularity measures how strong and meaningful those groups are.
High modularity → clear, tight clusters
Low modularity → everyone mingling randomly
Modularity can help understand groups within a large network. This helps identify friends circles in social networks, fraud communities in financial transaction groups, and protein complexes in biology.
The following diagram illustrates the concept very well:



Leave a Reply