GithubHelp home page GithubHelp logo

vishalbelsare / demon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giuliorossetti/demon

0.0 0.0 0.0 137 KB

DEMON: a local-first discovery method for overlapping communities.

Home Page: doi:10.1145/2629511

License: BSD 2-Clause "Simplified" License

Python 99.32% Shell 0.68%

demon's Introduction

DEMON - Overlapping Community Discovery.

Test and Coverage (Ubuntu) Coverage Status pyversions PyPI version Updates DOI PyPI download month

DEMON logo

Community discovery in complex networks is an interesting problem with a number of applications, especially in the knowledge extraction task in social and information networks. However, many large networks often lack a particular community organization at a global level. In these cases, traditional graph partitioning algorithms fail to let the latent knowledge embedded in modular structure emerge, because they impose a top-down global view of a network. We propose here a simple local-first approach to community discovery, able to unveil the modular organization of real complex networks. This is achieved by democratically letting each node vote for the communities it sees surrounding it in its limited view of the global system, i.e. its ego neighborhood, using a label propagation algorithm; finally, the local communities are merged into a global collection.

Note: Demon has been integrated within CDlib a python package dedicated to community detection algorithms, check it out!

Citation

If you use our algorithm please cite the following works:

Coscia, Michele; Rossetti, Giulio; Giannotti, Fosca; Pedreschi, Dino "Uncovering Hierarchical and Overlapping Communities with a Local-First Approach" ACM Transactions on Knowledge Discovery from Data (TKDD), 9 (1), 2014.

Coscia, Michele; Rossetti, Giulio; Giannotti, Fosca; Pedreschi, Dino "DEMON: a Local-First Discovery Method for Overlapping Communities" SIGKDD international conference on knowledge discovery and data mining, pp. 615-623, IEEE ACM, 2012, ISBN: 978-1-4503-1462-6.

Installation

In order to install the package just download (or clone) the current project and copy the demon folder in the root of your application.

Alternatively use pip:

pip install demon

or conda

conda install -c giuliorossetti demon

Demon is written in python and requires the following package to run:

  • networkx
  • tqdm

Implementation details

Execution

The algorithm can be used as standalone program as well as integrated in python scripts.

Standalone

python demon filename epsilon -c min_com_size

where:

  • filename: edgelist filename
  • epsilon: merging threshold in [0,1]
  • min_community_size: minimum size for communities (default 3 - optional)

Demon results will be saved on a text file.

Input file specs

Edgelist format: tab separated edgelist (nodes represented with integer ids).

Row example:

node_id0    node_id1

As python library

Demon can be executed specifying as input:

  1. an edgelist file
import demon as d
dm = d.Demon(network_filename="filename.tsc", epsilon=0.25, min_community_size=3, file_output="communities.txt")
dm.execute()
  1. a networkx Graph object
import networkx as nx
import demon as d

g = nx.karate_club_graph()
dm = d.Demon(graph=g, epsilon=0.25, min_community_size=3)
coms = dm.execute()

The parameter file_output, if specified, allows to write on file the algorithm results. Conversely, the communities will be returned to the main program as a list of node ids tuple, e.g.,

[(0,1,2),(3,4),(5,6,7)]

demon's People

Contributors

giuliorossetti avatar pyup-bot avatar flaprimo avatar lapidshay 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.