Vehicle routing open-source optimization machine (VROOM)
Project description
Python Vehicle Routing Open-source Optimization Machine
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.
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>
Usage with a routing engine
>>> import vroom
>>> problem_instance = vroom.Input(
... servers={"auto": "valhalla1.openstreetmap.de:443"},
... router=vroom._vroom.ROUTER.VALHALLA
... )
>>> problem_instance.add_vehicle(vroom.Vehicle(1, start=(2.44, 48.81), profile="auto"))
>>> problem_instance.add_job([
... vroom.Job(1, location=(2.44, 48.81)),
... vroom.Job(2, location=(2.46, 48.7)),
... vroom.Job(3, location=(2.42, 48.6)),
... ])
>>> sol = problem_instance.solve(exploration_level=5, nb_threads=4)
>>> print(sol.summary.duration)
2714
Installation
Pyvroom currently makes binaries for on macOS and Linux. There is also a Windows build that can be used, but it is somewhat experimental.
Installation of the pre-compiled releases should be as simple as:
pip install pyvroom
The current minimal requirements are as follows:
Python at least version 3.9.
Intel MacOS (or Rosetta2) at least version 14.0.
Apple Silicon MacOS at least version 14.0.
Windows on AMD64.
Linux on x86_64 and Aarch64 given glibc at least version 2.28.
Outside this it might be possible to build your own binaries.
Building from source
Building the source distributions requires:
Download the Pyvroom repository on you local machine:
git clone --recurse-submodules https://github.com/VROOM-Project/pyvroom
Install the Python dependencies:
pip install -r pyvroom/build-requirements.txt
Install asio headers, and openssl and crypto libraries and headers. For mac, this would be:
brew install openssl@1.1 brew install asio
For RHEL:
yum module enable mariadb-devel:10.3 yum install -y openssl-devel asio
For Musllinux:
apk add asio-dev apk add openssl-dev
The installation can then be done with:
pip install pyvroom/
Alternatively it is also possible to install the package from source using Conan. This is also likely the only option if installing on Windows.
To install using Conan, do the following:
cd pyvroom/
conan install --build=openssl --install-folder conan_build .
Documentation
The code is currently only documented with Pydoc. This means that the best way to learn Pyvroom for now is to either look at the source code or use dir() and help() to navigate the interface.
It is also useful to take a look at the VROOM API documentation. The interface there is mostly the same.
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
File details
Details for the file pyvroom-1.14.0.tar.gz
.
File metadata
- Download URL: pyvroom-1.14.0.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97bfa9ba9afda322eb16d7b3d8e5f6564cc98b8d20f35ef1dec288eb452bf436 |
|
MD5 | fe7033e0a69613916cb877ee6e9bfa57 |
|
BLAKE2b-256 | 077f5b151bcf6a1cc785298f6c66587375da23a7e5383a5dc2e365de75d815b1 |
File details
Details for the file pyvroom-1.14.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cf4eec4e75fdd8dd7874c1792cde97c18f9d18e9a37978b37bb93ec878ffcfc |
|
MD5 | a90e61118502e29719f0f45958962f87 |
|
BLAKE2b-256 | 7f7d3455ab4e71dd53fb042eff0693a15ea142e3b8da5fee565260d58d57d29b |
File details
Details for the file pyvroom-1.14.0-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4661d8b95311e41988dc7f717ec3f5dfbc34c7ab743081736838f29a7db6185e |
|
MD5 | bbe7d26156577164e66c9e8019ba8e66 |
|
BLAKE2b-256 | 3beae1de438dded6db46ba55f45624860c65074e6ce490ef7981cd358ab84e53 |
File details
Details for the file pyvroom-1.14.0-cp312-cp312-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp312-cp312-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae431500b28db2659461dd06a37d8c7fcfaac9192cb8d3cef134394c99d88bc5 |
|
MD5 | 9171ba9ae65c1768b20ba9b3ce1b089c |
|
BLAKE2b-256 | 6886708588bc7e779b08a943cf232afc5ac01a751728818405c5cea365a0ac83 |
File details
Details for the file pyvroom-1.14.0-cp312-cp312-macosx_14_0_arm64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81502b5b0f418a7150b4407e2ba11f9d7e8d66235b202af901fc5f4a200e962d |
|
MD5 | bbc3d057aaa5e5d512d5e5ac725e0d24 |
|
BLAKE2b-256 | a3e616c384711758139428fa70f6a1e3b420f3a20941e9ce274a23bffe86200d |
File details
Details for the file pyvroom-1.14.0-cp312-cp312-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp312-cp312-macosx_13_0_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.12, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e591076c3c15a866b9696a7002d61e17c91138d86e9a643729dec1c902040b77 |
|
MD5 | 683f042f2245dfa7767f08ec01a48ee0 |
|
BLAKE2b-256 | af2e9e4bbf7e67477e4a99a5249ae8924e8df2b45bd623d0d15c8d8dc717ceee |
File details
Details for the file pyvroom-1.14.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fe02b94f1968a67b9bf8919af5a1c3d4dc0b6d8fe32a236a7f306eff7c25df8 |
|
MD5 | 3cc962ed6ef26b704c1070d9a3615698 |
|
BLAKE2b-256 | d36fcadc457400a1bddf8d3d48ce866ea51ace15cb2190c6f18c710c3e58005f |
File details
Details for the file pyvroom-1.14.0-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d92339e5976f867568d82fb6dc02234798cc4ff3765dfb805aadda6195e804bf |
|
MD5 | fea2864baec5e08cbdfc91986cbc61e3 |
|
BLAKE2b-256 | 082a0b78fe916a6da9f3356d5d3d52a0a95cf0234e2afaa50f29df190757887e |
File details
Details for the file pyvroom-1.14.0-cp311-cp311-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp311-cp311-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3302c2b6c9eefa13671e403c1719c68c9b694c7e785e42770524d8c676b3170e |
|
MD5 | 73237ad3bce6c3bd2a954b52a236bc01 |
|
BLAKE2b-256 | f183c344495f46d88ea5c71e6f29091be3b466d156125b901da4fd8d6f405b4f |
File details
Details for the file pyvroom-1.14.0-cp311-cp311-macosx_14_0_arm64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c450916a214c158836d40db909f09bcf9bad416d59e17de141fb436c38d126 |
|
MD5 | d0e2483aa42bcb38c95bac8964e4441b |
|
BLAKE2b-256 | 0ec000e1a7e970fc0445e36b32fa8a30d5efb3371421eb74a2507efd32c9f7c3 |
File details
Details for the file pyvroom-1.14.0-cp311-cp311-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp311-cp311-macosx_13_0_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.11, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5810e367490e4b13bf324a2bbbbf65273a1a512ec06eaab646a71e4bef8b39a7 |
|
MD5 | bfff4fd14a1fd00a999de06825cd36ee |
|
BLAKE2b-256 | 8ba05824ee8b949646c5c3a0c316bfa17bb6eaff80bb143b4b14be0a7d575102 |
File details
Details for the file pyvroom-1.14.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61e1d32cdbb59a9e105f517c42f97b1d5c29a9aab478b09f2585204d229d3a3b |
|
MD5 | 7720e0aa67ff0f7a031c52069b17168a |
|
BLAKE2b-256 | 53bf6e4c91985e3bd7983c627c5b1938035879f530fa1af12d6819d2a2cebb70 |
File details
Details for the file pyvroom-1.14.0-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccbdfeee3217358f0dd24fa1664c94ad1655f76a9b65e372c6db14b4599998b5 |
|
MD5 | 2ce0b7c53529b4ec549057e657db67b9 |
|
BLAKE2b-256 | aa655b7422fe57e1ecac47c2fc2dc50f502bb3522d1b14d21f479dd8bbf534c0 |
File details
Details for the file pyvroom-1.14.0-cp310-cp310-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp310-cp310-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7254ee3b19f72f89115af7a594082ee1691f3dd8d9e859b5d80e0dbe3f6a312b |
|
MD5 | 29182db4a3e7654c230450fa791f7354 |
|
BLAKE2b-256 | ea298df9d2bce3574c84d74bb850f36d16358b85dfe899061602eb6b33347803 |
File details
Details for the file pyvroom-1.14.0-cp310-cp310-macosx_14_0_arm64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a172e39c2626ac0d32a985ecf7ed10ab15cf88805dcb817d71923524fec289b |
|
MD5 | 916015c2f4648a6a6e6f8c580c659c91 |
|
BLAKE2b-256 | ffb3e0230057e39021788cf85d760ddfb1867d24388cda291348f160e360092e |
File details
Details for the file pyvroom-1.14.0-cp310-cp310-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp310-cp310-macosx_13_0_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.10, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3408c588b8a7a00aa5deaa4580c08e2812a2a18d9ac2e26726880368604b0d75 |
|
MD5 | 17b4c7ac5229b7e1fc07bad0d216f90b |
|
BLAKE2b-256 | 26df3c6592a8bb26d272146d04bff6737d0a920b4feaa8031c3cf30891965551 |
File details
Details for the file pyvroom-1.14.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5336bfca308e81bd248fd29309ce5a6cd68f76b078f800093bf3f52254437fd6 |
|
MD5 | 971829371082ec4fbfebbd91c067b916 |
|
BLAKE2b-256 | 2f41450749b6abf0b29ce4dc284abd3ecdcb46ff28acb8778092649eaf12a8a9 |
File details
Details for the file pyvroom-1.14.0-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3d82fe4641664203f9c97643e64ca3157461d21772e41fc4c37dce20785dd99 |
|
MD5 | 5a800484473aa2041d8c89a62e120580 |
|
BLAKE2b-256 | 4951d936105336796b5a00c4c253802b3d601c403b0bd681ca2f1b64f6ea605c |
File details
Details for the file pyvroom-1.14.0-cp39-cp39-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp39-cp39-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41e7b8c66496915d76aa5b626a1860e40e51dc592ac792218b4c3f88e561f88b |
|
MD5 | e30d23e8262663440507695b636b1a9f |
|
BLAKE2b-256 | bca80f9b26595844b13ec22245c8e5b9bb54c0e54fb96dddf348b3d6d3722705 |
File details
Details for the file pyvroom-1.14.0-cp39-cp39-macosx_14_0_arm64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp39-cp39-macosx_14_0_arm64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.9, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d302e7205b8ff64c0dac819db9375e2a2671de9501c07f39b4e8e97e8d409206 |
|
MD5 | 64fdc8c837364f15364de33046d5b69a |
|
BLAKE2b-256 | 0120aaf78104dfe9a85b582bd311d98a5d27817aa95af735d306232f06837a8b |
File details
Details for the file pyvroom-1.14.0-cp39-cp39-macosx_13_0_x86_64.whl
.
File metadata
- Download URL: pyvroom-1.14.0-cp39-cp39-macosx_13_0_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.9, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 982250c899b9f699f6ef4458289f72e54c08744e0a0ed5aa739d3fa22c23c432 |
|
MD5 | 95ca12c5908323c012d44f3a8ed09dd3 |
|
BLAKE2b-256 | bf2d7e2ac2c1e4db3f54b6e22cc3d040b41061bdb12df86b16b72b2d7f4c50ac |