Skip to content

saref/PyGenStabilityOne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyGenStabilityOne

PygenStabilityOne is a community detection algorithm that leverages Markov stability (through the PyGenStability algorithm) as well as machine learning to return a single robust partition at a suitable scale that is consistent with the structure of the network, without requiring any information/assumption about the partition (number of communities, scale, resolution) from the user.

flowchart-pygenone

Installation

First, clone the repository with the following command:

git clone https://github.com/saref/PyGenStabilityOne.git

Then, either manually install all of the dependencies listed in requirements.txt, or install them all at once with:

pip install -r requirements.txt

Note: It is recommended to use this library with Python 3.11 in order to avoid dependency issues.

Usage

To use PyGenStabilityOne, simply:

  • Import the pygenstability_one function from the pygenstability_one library.
  • Call pygenstability_one with an nx.Graph network as input.

Then, PygenStabilityOne will return a list of the communities detected in the network (where each community is represented by a list of node labels).

from pygenstability_one import pygenstability_one
graph = nx.read_gml("ABCD_0.gml", destringizer=int) # The graph should be an nx.Graph graph
coms = pygenstability_one(graph) # The returned value is a list of detected communities

See example.ipynb for example code that can be run locally.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published