Git Product home page Git Product logo

louvain-method's Introduction


Louvain method for community detection

Original implementation doesn't print nodes membership of communities. This updated version print membership of original graph. Also with some bug-fixes.


Community detection Version 0.2 - not compatible with the previous version, see below.

Based on the article "Fast unfolding of community hierarchies in large networks" Copyright (C) 2008 V. Blondel, J.-L. Guillaume, R. Lambiotte, E. Lefebvre

This program or any part of it must not be distributed without prior agreement of the above mentionned authors.


Author : E. Lefebvre, adapted by J.-L. Guillaume Email : [email protected] Location : Paris, France Time : February 2008


Disclaimer: If you find a bug, please send a bug report to [email protected] including if necessary the input file and the parameters that caused the bug. You can also send me any comment or suggestion about the program.

Note that the program is expecting a friendly use and therefore does not make much verifications about the arguments.


This package offers a set of functions to use in order to compute communities on graphs weighted or unweighted. A typical sequence of actions is:

  1. Conversion from a text format (each line contains a couple "src dest") ./convert -i graph.txt -o graph.bin This program can also be used to convert weighted graphs (each line contain a triple "src dest w") using -w option: ./convert -i graph.txt -o graph.bin -w graph.weights Finally, nodes can be renumbered from 0 to nb_nodes - 1 using -r option (less space wasted in some cases): ./convert -i graph.txt -o graph.bin -r

  2. Computes communities and displays hierarchical tree: ./community graph.bin -l -1 -v > graph.tree

To ensure a faster computation (with a loss of quality), one can use the -q option to specify that the program must stop if the increase of modularity is below epsilon for a given iteration or pass: ./community graph.bin -l -1 -q 0.0001 > graph.tree

The program can deal with weighted networks using -w option: ./community graph.bin -l -1 -w graph.weights > graph.tree In this specific case, the convertion step must also use the -w option.

The program can also start with any given partition using -p option ./community graph.bin -p graph.part -v

  1. Displays information on the tree structure (number of hierarchical levels and nodes per level): ./hierarchy graph.tree

Displays the belonging of nodes to communities for a given level of the tree: ./hierarchy graph.tree -l 2 > graph_node2comm_level2


Known bugs or restrictions:

  • the number of nodes is stored on 4 bytes and the number of links on 8 bytes.

Version history: The following modifications have been made from version 0.1:

  • weights are now stored using floats (integer in V0.1)
  • degrees are stored on 8 bytes allowing large graphs to be decomposed
  • weights are stored in a separate file, which allows disk usage reduction if different weights are to be used on the same topology
  • any given partition can be used as a seed for the algorithm rather than just the trivial partition where each node belongs to its own community
  • initial network can contain loops is network is considered weighted
  • graph is not renumbered by default in the convert program
  • an optional verbose mode has been added and the program is silent by default
  • some portions of the code have been c++ improved (type * -> vector) These modifications imply that any binary graph file created with the previous version of the code is not comptabile with this version. You must therefore regenerate all the binary files.

Version 0.1:

  • initial community detection algorithm

louvain-method's People

Contributors

riyadparvez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.