Skip to main content

Vehicle routing open-source optimization machine (VROOM)

Project description

Python Vehicle Routing Open-source Optimization Machine

gh_action codecov pypi

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)
4041

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyvroom-0.1.0-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pyvroom-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pyvroom-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

pyvroom-0.1.0-cp312-cp312-macosx_14_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

pyvroom-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

pyvroom-0.1.0-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

pyvroom-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

pyvroom-0.1.0-cp311-cp311-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

pyvroom-0.1.0-cp311-cp311-macosx_14_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

pyvroom-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

pyvroom-0.1.0-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

pyvroom-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

pyvroom-0.1.0-cp310-cp310-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

pyvroom-0.1.0-cp310-cp310-macosx_14_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

pyvroom-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pyvroom-0.1.0-cp39-cp39-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.9Windows x86-64

pyvroom-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

pyvroom-0.1.0-cp39-cp39-manylinux_2_28_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

pyvroom-0.1.0-cp39-cp39-macosx_14_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

pyvroom-0.1.0-cp39-cp39-macosx_13_0_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file pyvroom-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyvroom-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for pyvroom-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 be701bc0299d03ae8879f34f2f0b58c4bd92f3180a008ef72432c7b66e5b39a8
MD5 9e70908c9dff91a1cb94c0b6c6c227cf
BLAKE2b-256 d7a79a98cb4f169496ffc91db095aaa68a64b29a28c68d78d10dcc42e6a2658a

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f82609ec69e9ec3c31d62428de3628681d5d3b5a332550987e39b55e978bcea
MD5 538f056f07d9989a0c8785e8c9667114
BLAKE2b-256 e6c084049f3bd994c7dff42f25eae59af0ffe57a2a576ebcdec70f8bf01b88a4

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e8ec58f7293b77b4390a5ec08460f4495e0dba21450dcd7968c8dce9ad61f454
MD5 cad0f1a17ad2dddbab9cf1f01d566bc1
BLAKE2b-256 98f25beb16a9edf183de9d1efb76a38729a4554990e90fe83eb7d000f2ed7da6

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a60f036d226c0abc3145a4ba2f6c7bae6e2a2422638bfa6d20b8b94546925195
MD5 62cd3ad67152182b63706c9c80a59ce8
BLAKE2b-256 5aa65920bee3e41614d5ec26285602ba0222ea6be359dbed99891574db9cd547

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dffe87b724ee7a89ba39da8af59e2c5d363b4d7253459dc67ab930db7f809d8a
MD5 b32b1882f4792ed44a161da25464f8fa
BLAKE2b-256 7f28da952458d976de5e9808af73cdb5c50f65d9f704d47416ae08c8df6d6164

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyvroom-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for pyvroom-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b24ff4d4a64b471e45f315a463f69bb216837725e13463c4514c07d5145ca539
MD5 7869b9fc0e54c573de2659a92e2d03c1
BLAKE2b-256 974af2baaebf4bbe066007023d52317934c5312406801d1a099f351b0217ddd3

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ada94b4030d420b900ceb1b6df5dd85c7ecbdf37daefc5db1fba3fc6ad882c82
MD5 612ca68e7afb76375180d6fd12c4ddf1
BLAKE2b-256 b1b474c6c10272ee81930ab82134914ec8acc5282a3656b54de1263d443e3c13

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0aade0a11c330b481ac146f7914e4f2298a45a01d1b3f3da93a2b1b28ca5033d
MD5 46376782a66cb6c6dca2e550ab3b3729
BLAKE2b-256 f70827dd934a6f71b3fb4b4bcd0f67e116882eab5d80a5b598e73a8a6ba4937e

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e59d34129f9efed06801679a01c071e8aacc33e981e06aaa176487669216e99c
MD5 10b6b33b877d9052543dde3756695f74
BLAKE2b-256 855275b4b17b7c5d4eeb2183b5d0bb2863e14ee12e4c87ff6b07a2a68de83147

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 77870bb3e07d9610ec80784e81c9220329bfe3071b7a83bc920cc053e50560f2
MD5 a68ffc180b14379a996e3c90330258ec
BLAKE2b-256 a0c8af63af57bf2c70483474609e66f52f3a7516d358667763a87ef3d2b1c9d1

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyvroom-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for pyvroom-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b328b274ef57cfe61d5241711333bab65bfab02871e795c8c0fb47fe55667b0a
MD5 cc8a16cf4164056745153e8ab7b7b979
BLAKE2b-256 39fd365563ae1870559d18980620735a1ffd7a7c0b1811c73d0888e511c8550c

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c53b2c8b0819a7b798feec2ee86e9c28ec8bde76f80871b1d8bf8ca4d0f323a3
MD5 2348036f1cef6e66f49bba2dd2f966b1
BLAKE2b-256 135d3c37036da5d7d69d48d60fbe7500cb5e79ecbe7dd500acf5580fcbd22294

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2c61a746a017146f99ba581459dd00863c92f587dd1b43812032901d87eeea3d
MD5 d787ac004acf78c0b2cce43821a80b0e
BLAKE2b-256 14bf5f2d399484ad2cca5f64975102a5e0c633d490dfcfcdf437d29add3e49af

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bec2a4e140c77edcb198b486cf478c4d023499aae3404ed3e1e7a2b27a2f5763
MD5 82b77df810f817ef4ced2c8b8611ff75
BLAKE2b-256 258f59ef453f7cf3c675eb376928041f0e0ef36e182a3ae1cf876d57eb395548

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 99662ff6ccc38ed0c8af6c68da03bf56f2942e95f2b38336ef87b0203665ba05
MD5 e31076dc3a281078b5e9ddb5a77b4ddb
BLAKE2b-256 07de2769b95e728bec2bd98d1db075003973ff139d6e023f2e772e0d46325aac

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyvroom-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for pyvroom-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 01bd14253679bd17b5a9eebdd087b60b974e0c13405c0796875ae741fff4d726
MD5 f7bdad4318c157544fac7a56fa1188c1
BLAKE2b-256 40c80a437cd47653db0f454fcd820dd7337cf51b96f15b14282373d2c7ae5b9b

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d1f82912d1ccf617cad455f15d013229096a92eed9a170818df65bf7eefeab6c
MD5 4bfab22c84dfa22fd74f6f6ae9fa372a
BLAKE2b-256 7432ad5aa41af3ac9701e9554282c059e319a0afe2d207605c354c336224c8f0

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2b22b8327316dded1c48644ad2f0bd9cc0ffb9f5bec7230ba9eaed959b063434
MD5 62c6d6875614b3420b8692ba6b9daa15
BLAKE2b-256 f85cfa52d85d36054f2f248b1c43c8978dc1ec285d1aacf19995c17bab4f9777

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e37f9d8c954b8e0e5e55419c937ed8e9713e18885b3e93e4bd7a9308fb14941f
MD5 cb6a8030fa65bd04db5a181b9a1487da
BLAKE2b-256 4a34da520fd6f19d3b58b3180a96b86da3e3960b11bebaed3ba0a304e8eedb56

See more details on using hashes here.

File details

Details for the file pyvroom-0.1.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.1.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 82a7506623cf0922b7cdfded0e134bddeacc59086bd12d6f2af8827eab4b96f8
MD5 0d01ad3cfb863897244688883905109a
BLAKE2b-256 d56df7480140b72cad07391032c1031af419be2809f2f3a543b29a71c1fd69cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page