Table of Contents
Fetching ...

PyVRP: a high-performance VRP solver package

Niels A. Wouda, Leon Lan, Wouter Kool

TL;DR

PyVRP is an open-source Python package that implements a high-performance hybrid genetic search ($HGS$) for vehicle routing problems, focusing on the VRP with time windows ($VRPTW$) but designed for easy extension to other VRP variants. It blends Python-level flexibility with performance-critical components implemented in C++, featuring a modular architecture built around a genetic algorithm, a high-performance local search, and a diverse population management framework. The approach delivers state-of-the-art results on VRPTW benchmarks and competitive performance on CVRP, illustrating strong practical impact for researchers and practitioners aiming to rapidly prototype and benchmark VRP variants. By providing pre-compiled binaries, extensive documentation, and extensible components, PyVRP lowers the barrier to building and evaluating advanced VRP solvers in real-world scenarios.

Abstract

We introduce PyVRP, a Python package that implements hybrid genetic search in a state-of-the-art vehicle routing problem (VRP) solver. The package is designed for the VRP with time windows (VRPTW), but can be easily extended to support other VRP variants. PyVRP combines the flexibility of Python with the performance of C++, by implementing (only) performance critical parts of the algorithm in C++, while being fully customisable at the Python level. PyVRP is a polished implementation of the algorithm that ranked 1st in the 2021 DIMACS VRPTW challenge and, after improvements, ranked 1st on the static variant of the EURO meets NeurIPS 2022 vehicle routing competition. The code follows good software engineering practices, and is well-documented and unit tested. PyVRP is freely available under the liberal MIT license. Through numerical experiments we show that PyVRP achieves state-of-the-art results on the VRPTW and capacitated VRP. We hope that PyVRP enables researchers and practitioners to easily and quickly build on a state-of-the-art VRP solver.

PyVRP: a high-performance VRP solver package

TL;DR

PyVRP is an open-source Python package that implements a high-performance hybrid genetic search () for vehicle routing problems, focusing on the VRP with time windows () but designed for easy extension to other VRP variants. It blends Python-level flexibility with performance-critical components implemented in C++, featuring a modular architecture built around a genetic algorithm, a high-performance local search, and a diverse population management framework. The approach delivers state-of-the-art results on VRPTW benchmarks and competitive performance on CVRP, illustrating strong practical impact for researchers and practitioners aiming to rapidly prototype and benchmark VRP variants. By providing pre-compiled binaries, extensive documentation, and extensible components, PyVRP lowers the barrier to building and evaluating advanced VRP solvers in real-world scenarios.

Abstract

We introduce PyVRP, a Python package that implements hybrid genetic search in a state-of-the-art vehicle routing problem (VRP) solver. The package is designed for the VRP with time windows (VRPTW), but can be easily extended to support other VRP variants. PyVRP combines the flexibility of Python with the performance of C++, by implementing (only) performance critical parts of the algorithm in C++, while being fully customisable at the Python level. PyVRP is a polished implementation of the algorithm that ranked 1st in the 2021 DIMACS VRPTW challenge and, after improvements, ranked 1st on the static variant of the EURO meets NeurIPS 2022 vehicle routing competition. The code follows good software engineering practices, and is well-documented and unit tested. PyVRP is freely available under the liberal MIT license. Through numerical experiments we show that PyVRP achieves state-of-the-art results on the VRPTW and capacitated VRP. We hope that PyVRP enables researchers and practitioners to easily and quickly build on a state-of-the-art VRP solver.
Paper Structure (29 sections, 1 figure, 3 tables)

This paper contains 29 sections, 1 figure, 3 tables.

Figures (1)

  • Figure 1: Detailed statistics collected from a single run of Listing \ref{['lst:pyvrp']}. The top-left figure shows the average diversity of the feasible and infeasible sub-populations. It is clear from this figure that periodic survivor selection improves diversity. The middle-left figure shows the best and average objectives of both sub-populations, which improve over time as the search progresses. The bottom-left figure shows iteration runtimes (in seconds), including a trendline. Finally, the figure on the right plots the best observed solution.