# Communities and modularity > A community is a group of people tied more to each other than to the rest. How modularity and the Louvain method find them, shown on Zachary's karate club. Source: https://netgraf.isik.co/learn/community-detection Updated: 2026-09-24 A community is a group of people who are more tied to each other than to the rest of the network. Community detection finds those groups from the ties alone. Modularity is the score it maximises: how many more ties fall inside the groups than chance would predict. ## Modularity ``` Q = (1 / 2m) * sum over pairs i, j of [ A(i,j) - k(i) k(j) / 2m ] * same(i, j) ``` m is the number of ties, A(i,j) is 1 when i and j are tied, k is degree, and same(i, j) is 1 when both are in the same group. Q runs up to 1; above about 0.3 is usually taken as clear structure. Mark Newman's modularity compares each group's internal ties with the number you would expect if the same people kept their degrees but were wired at random. Trying every possible split is impossible for all but tiny networks, so algorithms search for a good one. The Louvain method (Blondel and colleagues, 2008), which Netgraf uses, merges people and then groups greedily while modularity keeps rising. ## Zachary's karate club Wayne Zachary recorded the friendships among 34 members of a university karate club just before a dispute between the instructor (Mr. Hi) and a club officer (John A.) split it in two. The split followed the friendship network so closely that community detection run on the pre-split ties recovers almost exactly who left with whom. It is the standard test for every new algorithm. Louvain typically finds four groups rather than two: the two factions, each with a tighter core. ## In Netgraf The Insights panel lists **Groups**: "people who are more tied to each other than to anyone else", each named after its best-connected member. Choose **Colour the map by group** and every dot takes its community's colour while the lines go neutral. ## Questions ### Why does community detection give different results each time? Most algorithms, Louvain included, make choices that depend on the order people are visited, and several splits can score almost the same modularity. Small differences between runs are normal; large ones mean the network has no strong group structure. ### Can a person belong to two communities? Not in Louvain, which puts each person in exactly one group. Overlapping methods, such as the SLPA algorithm Kumu uses, allow it. Overlap is realistic but harder to read on a map. ## Example maps - https://netgraf.isik.co/m/zachary-karate-club ## References - Newman, M. E. J. (2006). Modularity and community structure in networks. PNAS, 103(23), 8577-8582. https://doi.org/10.1073/pnas.0601602103 - Blondel, V. D., Guillaume, J.-L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of communities in large networks. Journal of Statistical Mechanics, P10008. https://doi.org/10.1088/1742-5468/2008/10/P10008 - Zachary, W. W. (1977). An information flow model for conflict and fission in small groups. Journal of Anthropological Research, 33(4), 452-473. https://doi.org/10.1086/jar.33.4.3629752