![]() | ||
The Louvain Method for community detection is a method to extract communities from large networks created by Vincent Blondel, Jean-Loup Guillaume, Renaud Lambiotte and Etienne Lefebvre. The method is a greedy optimization method that appears to run in time O(n log n).
Contents
Modularity Optimization
The inspiration for this method of community detection is the optimization of Modularity as the algorithm progresses. Modularity is a scale value between -1 and 1 that measures the density of edges inside communities to edges outside communities. Optimizing this value theoretically results in the best possible grouping of the nodes of a given network, however going through all possible iterations of the nodes into groups is impractical so heuristic algorithms are used. In the Louvain Method of community detection, first small communities are found by optimizing modularity locally on all nodes, then each small community is grouped into one node and the first step is repeated.
Algorithm
The value to be optimized is modularity, defined as a value between -1 and 1 that measures the density of links inside communities compared to links between communities. For a weighted graph, modularity is defined as:
where
In order to maximize this value efficiently, the Louvain Method has two phases that are repeated iteratively.
First, each node in the network is assigned to its own community. Then for each node
Where
The second phase of the algorithm, it groups all of the nodes in the same community and builds a new network where nodes are the communities from the previous phase. Any links between nodes of the same community are now represented by self loops on the new community node and links from multiple nodes in the same community to a node in a different community are represented by weighted edges between communities. Once the new networks is created, the second phase has ended and the first phase can be re-applied to the new network.
Previous Uses
Comparison to Other Methods
When comparing modularity optimization methods, the two measures of importance are the speed and the resulting modularity value. A higher speed is better as it shows a method is more efficient than others and a higher modularity value is desirable as it points to having better defined communities. The compared methods are, the algorithm of Clauset, Newman, and Moore, Pons and Latapy, and Watika and Tsurumi.
-/- in the table refers to a method that took over 24hrs to run. This table (from ) shows that the Louvain method outperforms many similar modularity optimization methods in both the modularity and the time categories.