Coder Social home page Coder Social logo

vatsalanarang / community-detection-algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from riteshkasat/community-detection-algorithm

0.0 0.0 0.0 39 KB

This project implements community detection algorithm using divisive hierarchical clustering (Girvan-Newman algorithm)

Python 100.00%

community-detection-algorithm's Introduction

Community Detection

This project implements a community detection algorithm using divisive hierarchical clustering (Girvan-Newman algorithm!).

It makes use of 2 python libraries called networkx and community. The project uses betweenness function and the modularity function which are a part of the networkx and the community libraries respectively. It also uses the matplotlib library for plotting the communities.

Execution Details

The python code takes two parameters, namely input file containing the graph and the output image with the community structure.

For example:

python detect_community.py input.txt image.png

#Input Parameters: input.txt: This file consists of the representation of the graph. All graphs will be undirected graphs. Each line in the input file is of the format: 1 2 where 1 and 2 are the nodes and each line represents an edge between the two nodes. The nodes are separated by one space.

image.png: This will be a visualization of the communities detected by this algorithm. Each community is represented in a unique color. Each node contains a label representing the node numbers in the input file.

#Output: The Python code outputs the communities in the form of arrays to standard output (the console). Each community is an array representing nodes in that community.

For example:

[1,2,3]

[4,5,6]

[7]

[8]

[9,10,11]

[12,13,14]

These 6 arrays represent the 6 communities in the input graph.

Also, the community graph will be stored in output file.

Sample graph for above community: alt tag

community-detection-algorithm's People

Contributors

riteshkasat 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.