Skip to content

CPMpy/waste-collection

Repository files navigation

Waste Collection Interactive Solving Demo

An interactive web application demonstrating some of the research conducted by Prof. Tias Guns's lab (KU Leuven) within the Tuples Trustworthy AI project. More specifically, it covers parts of the Waste Collection use case (as provided by the industrial partner Optit).

This codebase only includes the work on visualising / explaining previously generated solutions, not how these solutions were generated in the first place. With the demo, an expert planner (user) can explore and compare different solutions against each other. The trade-off between KPI metrics can be studied and with the help of a simulator the robustness of different solutions can be compared. Individual solutions can be analysed in more detail. Once a preferred solution has been selected, the planner can give feedback in the form of a "request for re-optimisation":

  • A single vehicle route can be selected for re-optimisation, after which a subset of the assigned garbage bins will be exchanged with a neighbouring vehicle route, re-balancing the workload in the search for an improved solution.
  • The selection of routes for re-optimisation can be automated with the use of a Large Neighbourhood Search (LNS) on top of the CPMpy library. A target objective can be selected after which the LNS will repeatedly destroy and repair the given solution in search for improvement.

drawing


1. Setup

For easy setup, a docker-compose file is provided (Requires docker to be installed). Simply run:

docker compose up

The demo's webserver should now be listening on port 5006

Alternatively, one can do a manual install:

  1. Create a python==3.10 virtual environment e.g. using pyenv
    # install python 3.10
    pyenv install 3.10
    pyenv local 3.10
    # create virtual environment
    python -m venv .venv
    # activate virtual environment
    # - Windows
    .venv\Scripts\activate
    # - Linux (depending on shell)
    source .venv/bin/activate
  2. Install the project / dependencies e.g. using uv (recommended, a really fast package manager for python)
    pip install uv
    uv sync
    or with poetry
    pip install poetry
    poetry install

2. Usage

To start the web application:

python -m panel serve ./app/main.py

3. Overview

Here we will give a small overview of what is included in this demo.

3.1. Clustering

All garbage bins to be collected can be subdivided into clusters depending on their assigned garbage truck. The demo includes a visualisation of these cluster assignments.

drawing

By selecting one of such clusters, the rest of the UI will update accordingly by visualising more detailed information on that particular vehicle route.

3.2. Routes

Once a cluster has been selected, some details on the accompanying vehicle route (physical location and KPI metrics) will get displayed.

drawing

drawing

3.3. KPIs

More detailed KPIs comparing multiple solutions against each other can also be found:

drawing

drawing

drawing

The distribution bar charts can be used a a selection / filtering operator as to gain insight into which clusters belong to which catergory.

drawing

By selecting rows within the KPI table one can switch between the different solutions as to look at one in more detail.

3.4. Simulator

A separate "simulator" popup window is available as to compare the robustness of different solutions against each other. What gets simulated is the effects of an increase in total garbage volume on the achievability of a solution. The original problem description assumes only 85% of garbage bins will be placed outside on a pickup day. The simulator evaluates situations where this percentage were to increase. The higher the curve, the more robust the solution to an increase in garbage volumes.

drawing

3.5. Feedback

The user can now give feedback on a selected cluster / route by requesting for a re-optimisation (re-balancing a subset of garbage bins between two vehicles through a destroy and repair operation).

drawing

This destroy and repair process can be automated through an LNS loop.

drawing


4. Acknowledgements

EU flag This project has received funding from the European Union’s HORIZON-CL4-2021-HUMAN-01 research and innovation programme under grant agreement No. 101070149

EU flag

EU flag

About

Waste collection interactive solving, developed for the Tuples Trustworthy AI project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •