Vehicle routing open-source optimization machine (VROOM)
Project description
Good solution, fast… in Python.
Pyvroom is an Python wrapper to the excellent VROOM optimization engine for solving vehicle routing problems.
The library aims to solve several well-known types of vehicle routing problems, including:
Travelling salesman.
Capacitated vehicle routing.
Routing with time windows.
Multi-depot heterogeneous vehicle.
Pickup-and-delivery.
VROOM can also solve any mix of the above problem types.
Installation
Pyvroom currently makes binaries for on MacOS and Linux (Windows is WIP).
Installation should be as simple as:
pip install pyvroom
Building from source
Building the source distributions on another OS requires:
the ./build-requirements.txt Python dependencies
asio headers installed
openssl & crypto libraries & headers installed
Optionally the C++ dependencies can be installed with conan:
conan install --build=openssl --install-folder conan_build .
Basic usage
>>> import vroom
>>> problem_instance = vroom.Input()
>>> problem_instance.set_durations_matrix(
... profile="car",
... matrix_input=[[0, 2104, 197, 1299],
... [2103, 0, 2255, 3152],
... [197, 2256, 0, 1102],
... [1299, 3153, 1102, 0]],
... )
>>> problem_instance.add_vehicle([vroom.Vehicle(47, start=0, end=0),
... vroom.Vehicle(48, start=2, end=2)])
>>> problem_instance.add_job([vroom.Job(1414, location=0),
... vroom.Job(1515, location=1),
... vroom.Job(1616, location=2),
... vroom.Job(1717, location=3)])
>>> solution = problem_instance.solve(exploration_level=5, nb_threads=4)
>>> solution.summary.cost
6411
>>> solution.routes.columns
Index(['vehicle_id', 'type', 'arrival', 'duration', 'setup', 'service',
'waiting_time', 'location_index', 'id', 'description'],
dtype='object')
>>> solution.routes[["vehicle_id", "type", "arrival", "location_index", "id"]]
vehicle_id type arrival location_index id
0 47 start 0 0 <NA>
1 47 job 2104 1 1515
2 47 job 4207 0 1414
3 47 end 4207 0 <NA>
4 48 start 0 2 <NA>
5 48 job 1102 3 1717
6 48 job 2204 2 1616
7 48 end 2204 2 <NA>
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 Distributions
Hashes for pyvroom-0.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d71ae3009fc0003b02478bd00a55769b5f2cb2e593a2e3ca9fea89a6bea2ad2a |
|
MD5 | 8b4311d417abaca5025b64717cdcc20d |
|
BLAKE2b-256 | a7cfea4309da4df9f75a15052e2ab52410608b2f47c96d6226aa7d3c84ce9e8f |
Hashes for pyvroom-0.0.12-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e54022d8806d0f815996c8f7ec1bbd296c745ce8322818e361a1706994f90b2 |
|
MD5 | f3d00fd92128d27c49348b681121d143 |
|
BLAKE2b-256 | 27e9345d89040ca6b0904029dfbe4c0f6d6bf01f609ab67b1980c880ace03c3d |
Hashes for pyvroom-0.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a84ec3c6e5fef41c20f0a399557daa5ef288c660bfa9847dcaf8fe161d93a2 |
|
MD5 | 21e25aadb1b0d25454cb4aac877e7b6f |
|
BLAKE2b-256 | 453352569823c590ce5184719c4e0f1d70fa1660e9018fed8e7de7998297a9fa |
Hashes for pyvroom-0.0.12-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db2e668f9db19a5302a48800cc487890a4017fd153c03a4521390d7448303ee |
|
MD5 | 423f1c14d7fec564dbed158d02e3d61d |
|
BLAKE2b-256 | 4a438c878c06a42f85d6c281d7810ce3cb6486fefdb7676f10b9cdd4bc61396e |
Hashes for pyvroom-0.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1dd2f4aa6bf3545dccd70bfe5de420427ec518afcaca2863aca68eb91c48d4 |
|
MD5 | a245057fd4ff6bb0d31a78452c1db63c |
|
BLAKE2b-256 | e6e2bd96e43aeabcdd08b8f5889a3349fbd32b8bdcb1a66253ef1c1701645dd6 |
Hashes for pyvroom-0.0.12-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe80161452df3fee1f3d1413a008e9e4b88b878791175da0b07740e8907ffe2e |
|
MD5 | a60422239d60f4fd33f95f1869f69388 |
|
BLAKE2b-256 | 4ef75e66ca64debebcb845d1acc7da7d9a516ef72fc9aacdf586399eb7bf1016 |
Hashes for pyvroom-0.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50a2ef27eb4fcc4906cc9fbab4af84b0a16c103f4ca6856d29bd8ea3ad0f496 |
|
MD5 | 57996007608e4212d2917c07ebe071be |
|
BLAKE2b-256 | 3e23013d81f676183aaeae6b804aa6cc6c16575f66937d89f0de6304a5c49a00 |
Hashes for pyvroom-0.0.12-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9e45756614c06251b088ed71719b4b0341aa393da5a1afe53786b4879c43195 |
|
MD5 | bf5a8c94caf492cae96a8fe7729bc8ec |
|
BLAKE2b-256 | 416cbb8d4a926a889f33585342c280e43d08e14ebe8d0800dd7a7c910eef56ab |