Fleet Size and Mix optimizer for heterogeneous fleets of multi-compartment vehicles
Project description
🚚 fleetmix — Fleet Size & Mix Optimizer for Multi‑Compartment Fleets
Written for transparent research, hardened for production use.
Fast, reproducible tooling for multi‑compartment vehicle fleet design in urban food distribution. This repository supports our forthcoming paper Designing Multi‑Compartment Vehicle Fleets for Last‑Mile Food Distribution Systems and doubles as a production‑grade library for industry users.
(interactive demo – coming soon)
✨ Why fleetmix?
- ⚡ Scales — >1,000 customers solved in seconds via a cluster‑first → MILP‑second matheuristic.
- 🧩 Extensible — pluggable clustering engines, route‑time estimators, and solver back‑ends.
- 🔄 Reproducible — every experiment in the journal article re‑runs with one script.
- 🖥️ User‑friendly — clean CLI, idiomatic Python API, and a lightweight web GUI.
🗺️ Table of Contents
- Installation
- Quick Start
- Architecture Overview
- Command‑Line Usage
- Python API
- Benchmarking Suite
- Repository Layout
- Paper ↔ Code Map
- Contributing
- Citation
- License
⚙️ Installation
From PyPI (coming soon)
pip install fleetmix
From Source (development)
# Clone and set up environment
git clone https://github.com/ekohan/fleetmix.git && cd fleetmix
./init.sh
# Install in editable mode
pip install -e .
🚀 Quick Start
Command‑Line Interface
# Run optimization on customer demand data
fleetmix optimize --demand customers.csv --config fleet.yaml
# Run the full MCVRP benchmark suite
fleetmix benchmark mcvrp
# Convert VRP instance to FSM format
fleetmix convert --type cvrp --instance X-n101-k25 --benchmark-type split
# Check version
fleetmix version
Python API
import fleetmix
solution = fleetmix.optimize(
demand="customers.csv",
config="fleet_config.yaml"
)
print(f"Total cost: ${solution['total_cost']:,.2f}")
print(f"Vehicles used: {len(solution['vehicles_used'])}")
Web Interface
# Launch web interface
fleetmix gui
# Or specify a custom port
fleetmix gui --port 8080
The GUI provides:
- 📥 Drag‑and‑drop CSV upload
- 🎛️ Interactive parameter tweaking
- 🔎 Real‑time optimization progress
- 🗺️ Map‑based visual results
- 📊 Excel/JSON export
🏗️ Architecture Overview
graph LR
A[Read Demand] --> B[Generate feasible clusters]
B --> C[MILP fleet‑selection]
C --> D[Merge improvement phase]
D --> E["Results (JSON | XLSX | HTML)"]
Full algorithmic details are in §4 of the paper.
🔧 Command‑Line Usage
fleetmix optimize
Run fleet optimization on customer demand data.
fleetmix optimize \
--demand customers.csv \
--config fleet.yaml \
--output results/ \
--format excel \
--verbose
fleetmix benchmark
Run the full benchmark suites shipped with Fleetmix (batch mode over all instances).
fleetmix benchmark mcvrp # All MCVRP instances
fleetmix benchmark cvrp # All CVRP instances
fleetmix convert
Convert a single CVRP / MCVRP instance into FSM format, run optimisation, and export results.
fleetmix convert --type mcvrp --instance 10_3_3_3_\(01\)
Legacy direct‑script calls still work but show deprecation warnings.
🐍 Python API
import fleetmix as fm
customers_df = ... # build a DataFrame
solution = fm.optimize(demand=customers_df, config="config.yaml")
Retrieve metrics via solution[...] keys (see docstring for full schema).
📊 Benchmarking Suite
Located under src/fleetmix/benchmarking/.
- Converters –
.vrp/.dat→ FSM tables - Parsers & Models – light dataclasses for CVRP / MCVRP metadata
- Solvers – PyVRP wrapper providing single‑ & multi‑compartment baselines
- Scripts – batch runners producing JSON/XLSX artifacts in
results/
Upper‑ and lower‑bound reference solutions are generated automatically for sanity checks.
🗂️ Repository Layout
src/fleetmix/
api.py # Python API facade
app.py # CLI (Typer)
clustering/ # capacity & time‑feasible cluster generation
optimization/ # MILP core (PuLP/Gurobi)
post_optimization/ # merge‑phase heuristic
benchmarking/ # datasets • converters • baselines
gui.py # lightweight web GUI
utils/ # I/O, logging, etc.
docs/ # code↔paper map • design notes
📝 Paper ↔ Code Map
See docs/mapping.md for a line‑by‑line crosswalk between paper sections and implementation.
🤝 Contributing
- Fork → feature branch → PR against main.
pytest -q --cov=srcmust stay green.- Follow PEP‑8, add type hints, and keep public APIs doc‑commented.
Bug reports and ideas via Issues are welcome.
📚 Citation
@article{Kohan2025FleetMix,
author = {Eric Kohan},
title = {Designing Multi‑Compartment Vehicle Fleets for Last‑Mile Food Distribution Systems},
journal = {To appear},
year = {2025}
}
🪪 License
MIT — free for academic & commercial use. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fleetmix-0.1.0b1.tar.gz.
File metadata
- Download URL: fleetmix-0.1.0b1.tar.gz
- Upload date:
- Size: 83.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e657b59f5d469858ee7822f9c51550553c995e13003ba9d8fb1f2431425c4422
|
|
| MD5 |
959c38abbb697e2e8f4ff6e5bfe9e476
|
|
| BLAKE2b-256 |
a5e0b18b82c85d9077ba12957b0392c468cee08c5a13412405295eb9f738effd
|
File details
Details for the file fleetmix-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: fleetmix-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 97.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bd43703764bccfc73e5407c5ef230552ea21514556df19b0cbc5e0385be9bbf
|
|
| MD5 |
c838867bc407e5a0d0fbad12ff82470c
|
|
| BLAKE2b-256 |
2bc50848336bf6a16d7ce81e26f58b71fe6a5b83ec56060965289045ef9a9995
|