Skip to content

Python implementation of the Louvain method for community detection

License

Notifications You must be signed in to change notification settings

tzyl/louvain-communities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

louvain-communities

Python implementation of the Louvain method for detecting communities introduced in [1] built on top of the NetworkX framework with support for randomizing node order.

Requirements

  • Python 3
  • NetworkX 1.11

Usage

First install the package using:

python setup.py install

Then import the package and use on a NetworkX graph:

import networkx as nx
from louvain import detect_communities


G = nx.karate_club_graph()
partition = detect_communities(G)
# Randomized node order
partition = detect_communities(G, randomized=True)

See the Jupyter notebook for an example of visualising with matplotlib.

References

[1]Blondel V.D., Guillaume J.-L., Lambiotte R., Lefebvre E. (2008) Fast unfolding of communities in large networks. J. Stat. Mech. P10008 (https://arxiv.org/abs/0803.0476)

About

Python implementation of the Louvain method for community detection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages