Skip to content

a. Installation

János Czentye edited this page Aug 3, 2023 · 1 revision

Environment

Our implementations require Python3.10 or above. The following code snippet can be used to set up the latest Python environment on Ubuntu.

sudo add-apt-repository -y 'ppa:deadsnakes/ppa' && sudo apt update
sudo apt install python3.11-dev python3.11-dev
sudo curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.11

SLAMBUC package

The easiest way to get our algorithms collected in SLAMBUC is to install the package from PyPI repository.

python3.11 -m pip install slambuc

However, for the latest changes, it can be installed directly from GitHub as follows.

python3.11 -m pip install --no-cache-dir git+https://github.com/hsnlab/SLAMBUC.git

Tree plotting relies on networkx's internal plotting feature that generates a layout based on the graphviz tool and its python frontend. Thus, in that case, the related dependencies must be installed first.

sudo apt-get install graphviz graphviz-dev
python3.11 -m pip install pygraphviz

External solvers can also be used in LP-based algorithms that require the given solver packages to be preinstalled and available for the PuLP frontend. Currently, the following solvers are tested.

It is worth noting that CPLEX's python wrapper docplex (as a replacement for PuLP) is left behind the latest Python version. For using this API, requirements are prepared separately for Python3.10.

python3.10 -m pip install -U -r requirements_py3.10.txt

For solving constrained shortest path problems (CSP), we apply solution methods from cspy.

Test harness and performance validation

Our repository contains separate test scripts under the tests folder for validating the input/output formats and call parameters. These codes also serve as examples for using the different implementations of our package.

For comparative analyses, we also implemented a test harness under validation to automatize test executions with generated test input graphs from validation/data and monitor elapsed time and memory demands of tested algorithms initiated as separate sub-processes.

To install additional dependencies, run the following commands.

python3.11 -m pip install slambuc[tests]      # For executing tests
python3.11 -m pip install slambuc[validation] # For using our test harness framework

Development and contribution

If you would like to contribute, add a feature, or just play with the implementations, the development environment can be set up with the following commands.

git clone https://github.com/hsnlab/SLAMBUC.git
python3.11 -m pip install -U -r SLAMBUC/requirements.txt
python3.11 -m pip install --ignore-requires-python --no-deps -e SLAMBUC/
# OR
cd SLAMBUC && make install-req && make dev-install

## Remove editing-mode package outside of repo root
python3.11 -m pip uninstall slambuc
# OR
make uninstall

Clone this wiki locally