Skip to content

Python code implementing a stable ensemble-based graph partition algorithm (ecg) and 11 graph-aware measures (gam) for comparing graph partitions.

License

Notifications You must be signed in to change notification settings

ftheberge/graph-partition-and-measures

Repository files navigation

Graph Partition and Measures

Python3 code implementing 11 graph-aware measures (gam) for comparing graph partitions as well as a stable ensemble-based graph partition algorithm (ECG). This code is pip installable for both igraph and networkx:

Illustrative examples can be found in the following supplied notebooks:

Graph aware measures (gam)

The measures are respectively:

  • 'rand': the RAND index
  • 'jaccard': the Jaccard index
  • 'mn': pairwise similarity normalized with the mean function
  • 'gmn': pairwise similarity normalized with the geometric mean function
  • 'min': pairwise similarity normalized with the minimum function
  • 'max': pairwise similarity normalized with the maximum function

Each measure can be adjusted (recommended) or not, except for 'jaccard'. Details can be found in:

Ensemble clustering for graphs (ECG)

This is a good, stable graph partitioning algorithm. Description and applications of ECG can be found in:

new experiment

We added a new experiment over SBM (stochastic block model) graphs, and comparing the results of several clustering algorithms, including ECG, with respect to the spectral detectability threshold. Results are summmarized in this wiki and code to run this experiment is provided in this notebook.

ECG Extras

Beside providing a good, stable graph clustering method, ECG can be useful for a few other tasks:

  • We can define some refuse to cluster scores to rank the nodes in decreasing order, from the most likely to be an outlier (i.e. not part of a community) to the least likely. This can be useful for tasks such as outlier detection, but also to improve the robustness of the clustering results by leaving out nodes that are not stongly memeber of any community.
  • Another use for the derived ECG edge weights is to obtain better layouts for community graphs.
  • ECG also returns a Community strength indidcator (CSI), where values close to 1 are indicative of strong communities in the graph.

Those extra features are illustrated in the supplied notebook: ECG_extras, as well as in this wiki.

About

Python code implementing a stable ensemble-based graph partition algorithm (ecg) and 11 graph-aware measures (gam) for comparing graph partitions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published