https://github.com/pankajr141/comdet
The purpose of packge is to detect relationship between graph nodes. It detects the overall community structure
https://github.com/pankajr141/comdet
community community-detection graph-algorithms graph-nodes louvain-algorithm louvain-community-detection
Last synced: 4 months ago
JSON representation
The purpose of packge is to detect relationship between graph nodes. It detects the overall community structure
- Host: GitHub
- URL: https://github.com/pankajr141/comdet
- Owner: pankajr141
- Created: 2013-12-11T04:43:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-18T04:14:27.000Z (over 10 years ago)
- Last Synced: 2025-02-20T11:49:13.507Z (4 months ago)
- Topics: community, community-detection, graph-algorithms, graph-nodes, louvain-algorithm, louvain-community-detection
- Language: Python
- Homepage:
- Size: 195 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
comdet
======
Comdet stands for community detection.
In the study of complex networks, a network is said to have community structure if the nodes of the network can be easily grouped into (potentially overlapping) sets of nodes such that each set of nodes is densely connected internally.comdet is used to detect community among graph nodes. Its based on lovain method
Pypi page for comdet module is at
https://pypi.python.org/pypi/comdet/
It is based on louvain method for community detection problem in given graph nodes
https://sites.google.com/site/findcommunities/
Installation
-------------
Easy install
```shell
easy_install comdet
````Pip:
```shell
$pip install comdet
```or just download the package from here and use it as stand alone.
Usage
-------------
####Sample python file
```
from comdet import comdet
result = comdet.detect("input", debug=True)
print result
```####Interface.
Following iterface is used to interact with comdet package
```
comdet.detect(inputfile, nop = -1, debug = False)
```
* inputfile - The inputfile to the package.
* nop - number of passes upto which the community detection will run. by default it is infinity.
* debug - used to debug information####Input file
Input files contains space separated src dst pair of graph nodes
eg.
```shell
DL0 DL4
DL3 DL6
DL8 DL2
DL4 DL3
DL2 DL2
DL3 DL4
DL2 DL8
DL8 DL4
DL0 DL7
DL10 DL4
DL9 DL6
DL8 DL6
DL2 DL8
DL9 DL10
DL8 DL8
DL4 DL9
.
.
.
```
####OutputOutput is nested list of community structure.
```shell
[[[[['DL23', 'DL19', 'DL27']], [['DL28', 'DL26', 'DL20'], ['DL44'], ['DL38', 'DL46', 'DL42'], ['DL10', 'DL6', 'DL1', 'DL2', 'DL0'], ['DL34', 'DL37']]]]]
```
```
The above output consist of 4 passes.
Pass 1 =>
1Group1 - ['DL23', 'DL19', 'DL27']]
1Group2 - ['DL28', 'DL26', 'DL20']
1Group3 - ['DL44']
1Group4 - ['DL10', 'DL6', 'DL1', 'DL2', 'DL0']
1Group5 - ['DL34', 'DL37']Pass2 =>
Now nodes of previous pass group together to form mode strong community.
2Group1 - [1Group1]
2Group2 - [1Group2, 1Group3, 1Group4, 1Group5]Pass3 =>
3Group1 - [2Group1, 2Group3]Pass4 =>
4Group1 - [3Group1]Pass5 =>
5Group1 - [4Group1]
Now as the number of community in pass4 and Pass5 are same the processing stops and pass 4 output is taken.
```