Skip to main content

Community Detection


The notion of community in a graph represents similarly to what it represents in the real world. Different social circles are examples of such communities. Analogously, in graphs, community represents a partition of a graph, ie a set of nodes. M. Girvan and M. E. J. Newman argue that nodes are more strongly connected within a community, i.e. there are more edges, while on the other hand, nodes are sparsely connected between communities themselves.


Community detection labels each node with a community label. Here, labels are colored in different colors.

There are more potential candidates to address community detection. Among the more popular algorithms are:

  1. Louvain community detection - based on modularity optimization - measures network connectivity within a community
  2. Leiden community detection - adjustment of Louvain's algorithm that introduces one level of refinement and brings together strongly connected communities
  3. Label propagation - a machine learning technique that assigns labels to unmarked nodes and modifies them with respect to neighbors




Unfortunately, Community Detection is not yet implemented within the MAGE project. Be sure to raise the issue on the GitHub repo and ping us to speed up the development. ☝️

Use cases​


One obvious usage of community detection is within the finance industry. Fraudsters often think alike and act in criminal rings. That enables them to be more efficient. However, such rings can easily be discovered with community methods from their interactions/shared resources.


One major threat to freedom are terrorist groups. Such groups can organize their activities through social media channels. Once one of the users is exposed as a potential threat, others can be revealed by analyzing their community on social networks.

Interests are usually shared within the community. To target a specific audience, community detection can be used to recommend certain products among users that are sharing interests.


As stated above in the social networks application. Similar can be applied to the retail industry. Targetting like-minded people to access the same products is the crucial thing in marketing.