PyVRP is a Python package that offers a high-performance implementation of the hybrid genetic search algorithm for vehicle routing problems (VRPs). PyVRP currently supports the capacitated VRP (CVRP), the VRP with time windows (VRPTW), and prize-collecting.
The implementation builds on HGS-CVRP, but has been completely redesigned to be easy to use as a highly customisable Python package, while maintaining speed and state-of-the-art performance. This allows users to directly solve VRP instances, or implement variants of the HGS algorithm using Python, inspired by the examples in this documentation. Users can customise various aspects of the algorithm using Python, including population management, crossover strategies, granular neighbourhoods and operator selection in the local search. Additionally, for advanced use cases such as supporting additional VRP variants, users can build and install PyVRP directly from the source code.
The PyVRP package comes with pre-compiled binaries for Windows, Mac OS and Linux, and can thus be easily installed without requiring local compilation. It can be installed through pip via
pip install pyvrp
Hint
If you are new to vehicle routing or metaheuristics, you might benefit from first reading the introduction to VRP and the introduction to HGS pages. To set up an installation from source, or to run the examples listed below yourself, please have a look at the installation instructions.
Contents
Getting started
Developing PyVRP