Trisha Shetty (Editor)

Louvain Modularity

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Louvain Modularity

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:

Q = 1 2 m Σ i j [ A i j k i k j 2 m ] δ ( c i , c j ) ,

where

  • A i j represents the edge weight between nodes i and j ;
  • k i and k j are the sum of the weights of the edges attached to nodes i and j , respectively;
  • m is the sum of all of the edge weights in the graph;
  • c i and c j are the communities of the nodes; and
  • δ is a simple delta function.
  • 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 i , the change in modularity is calculated for removing i from its own community and moving it into the community of each neighbor j of i . This value is easily calculated by:

    Δ Q = [ Σ i n + 2 k i , i n 2 m ( Σ t o t + k i 2 m ) 2 ] [ Σ i n 2 m ( Σ t o t 2 m ) 2 ( k i 2 m ) 2 ]

    Where Σ i n is sum of all the weights of the links inside the community i is moving into, Σ t o t is the sum of all the weights of the links to nodes in the community, k i is the weighted degree of i , k i , i n is the sum of the weights of the links between i and other nodes in the community, and m is the sum of the weights of all links in the network. Then, once this value is calculated for all communities i is connected to, i is placed into the community that resulted in the greatest modularity increase. If no increase is possible, i remains in its original community. This process is applied repeatedly and sequentially to all nodes until no modularity increase can occur. Once this local maximum of modularity is hit, the first phase has ended.

    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

  • Twitter social Network (2.4 Million nodes, 38 million links) by Josep Pujol, Vojay Erramilli, and Pablo Rodriguez: The authors explore the problem of partitioning Online Social Networks onto different machines.
  • Mobile phone Network (4 Million nodes, 100 Million links) by Derek Greene, Donal Doyle, and Padraig Cunningham: Community-tracking strategies for identifying dynamic communities of different dynamic social networks.
  • 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.

    References

    Louvain Modularity Wikipedia