Optimizing an urban meal delivery platform
  • Jupyter Notebook 97%
  • HTML 2%
  • Python 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 03:52:11 +01:00
.forgejo Name merge commits after the merged branch 2026-11-28 01:33:40 +01:00
docs Use double quotes 2026-11-28 03:26:13 +01:00
migrations Add flake8-sfs 2026-11-28 03:34:40 +01:00
research Remove trailing whitespace 2026-11-27 14:29:29 +01:00
scripts Add a "deps-upgrade-check" session ... 2026-11-27 12:48:51 +01:00
src/velofy Add flake8-unused-arguments 2026-11-28 03:48:50 +01:00
tests Apply shared fixtures to whole test classes 2026-11-28 03:52:11 +01:00
.git-blame-ignore-revs Ignore the double quotes commit in git blame 2026-11-28 03:28:49 +01:00
.gitignore Ignore PyCharm's .idea/ folder 2021-09-12 16:51:10 +02:00
.gitmodules Move the paper repository to Forgejo as velofy-forecasting 2026-11-24 11:15:38 +01:00
.pre-commit-config.yaml Run the local nox hooks serially 2026-11-28 02:00:30 +01:00
alembic.ini Add database migrations 2020-08-11 10:29:58 +02:00
LICENSE.txt Update the email address 2026-11-24 11:39:14 +01:00
noxfile.py Add flake8-unused-arguments 2026-11-28 03:48:50 +01:00
pyproject.toml Add flake8-unused-arguments 2026-11-28 03:48:50 +01:00
README.md Remove the "fix-branch-references" session ... 2026-11-27 12:48:51 +01:00
requirements.txt Export requirements.txt with pre-commit 2026-11-27 15:11:39 +01:00
uv.lock Add flake8-unused-arguments 2026-11-28 03:48:50 +01:00

Urban Meal Delivery

This repository holds code analyzing the data of an undisclosed urban meal delivery platform (UDP) operating in France from January 2016 to January 2017. The goal is to optimize the platform's delivery process involving independent couriers.

Structure

The analysis is structured into the following stages that iteratively build on each other.

Data Cleaning

The UDP provided its raw data as a PostgreSQL dump. This notebook cleans the data extensively and maps them onto the ORM models defined in the velofy package that is developed in the src/ folder and contains all source code to drive the analyses.

Due to a non-disclosure agreement with the UDP, neither the raw nor the cleaned data are published as of now. However, previews of the data can be seen throughout the research/ folder.

Tactical Demand Forecasting

Before any optimizations of the UDP's operations are done, a demand forecasting system for tactical purposes is implemented. To achieve that, the cities first undergo a gridification step where each pickup location is assigned into a pixel on a "checker board"-like grid. The main part of the source code that implements that is in this file. Visualizations of the various grids can be found in the visualizations/ folder and in this notebook.

Then, demand is aggregated on a per-pixel level and different kinds of order time series are generated. The latter are the input to different kinds of forecasting *Models. They all have in common that they predict demand into the short-term future (e.g., one hour) and are thus used for tactical purposes, in particular predictive routing (cf., next section). The details of how this works can be found in the first academic paper published in the context of this research project and titled "Real-time Demand Forecasting for an Urban Delivery Platform" (cf., the repository with the LaTeX files). All demand forecasting related code is in the forecasts/ sub-package.

Predictive Routing

Shift & Capacity Planning

Installation & Contribution

To play with the code developed for the analyses, you can clone the project with git and install the contained velofy package and all its dependencies in a virtual environment with uv:

git clone ssh://git@git.webartifex.de/alexander/velofy.git

and

uv sync --extra research

The --extra option is necessary as the non-develop dependencies are structured in the pyproject.toml file into dependencies related to only the velofy source code package and dependencies used to run the Jupyter environment with the analyses.

Contributions are welcome. Use the issues tab. The project is licensed under the MIT license.