This repository contains the tests and experiments of the Contiguity Constrained Clustering method. This method is based on the Leiden algorithm, with a modified objective function based on Ward's Linkage.
This repository tests the Leiden algorithm with Modularity, Wards Linkage, and Contiguity Constrained Clustering on two datasets.
The requirements.txt
contains all the dependencies except for the locally bundled libraries.
This repository has certain expectations of bundled libraries.
First is the usage of the Leidenalg built by Traag et al. I use a fork of both their python layer Ledienalg here and the C++ layer Libleidenalg located here
The build_libleidenalg.sh
script has been modified to import my version of the libleidenalg
The build system is a bit hackish, but what is in build_local.sh
should more or less work if you replace the CONDA_DIR
variable with the path to your conda directory.
Basically you need to manually move the dylib generated by the build_libleidenalg.sh
and pip install
everytime you rebuild the project.
Otherwise this project expects the Barcelona data in the Barcelona/
directory and the Shenzen data in the data/
directory.
The current method for detecting disconnected communities is extremely inefficient. However given that I was testing only on networks of 600-1500 nodes, it was not an issue. However to use this method on much larger networks, optimizations of this method will need to be made, likely some form of memoization.