This repository contains several implementations of algorithms for fair k-center clustering. For the latest version visit the github repository. The algorithms are implemented mostly in Python, with performance-sensitive parts implemented in Rust.
First, you need to install Rust.
Then, you can use micromamba,
you can setup the environment using the provided env.yaml file:
micromamba create -f env.yaml
micromamba activate fair-clustering
After that, you can compile the Rust extension used by the software using the following command:
maturing develop --release
All datasets used in the experimental evaluation are downloaded and preprocessed
when needed. See datasets.py
for details.
If you want to download and preprocess all datasets in one go, you can use:
python datasets.py
Datasets are stored in HDF5 files with the following structure:
datacontains the points of the datasetdata-PCAcontains the PCA rotation of the dataset (used mainly for visualization)colorsis the vector of each point's colors
These data files can be processed using the very convenient h5py library in Python.
The experiments reported in the paper are run using the code in the script experiments.py.
You need a copy of Cplex to run the experiments, so that then you can run
python experiments.py ~/your/path/to/cplex $EXPERIMENT
Where $EXPERIMENT is one of
exhaustivemapreducestreaming