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

>>> groups = solution.routes[solution.routes.type == "job"].groupby("vehicle_id")["id"].apply(lambda x: set(x.dropna().astype(int)))
>>> groups[47] == {1414, 1515} and groups[48] == {1616, 1717}
True

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)
>>> 3800 < sol.summary.duration < 4200
True

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.10.

  • Intel MacOS (or Rosetta2) at least version 15.0.

  • Apple Silicon MacOS at least version 15.0.

  • Windows on AMD64.

  • Linux on x86_64 and Aarch64 given glibc at least version 2.34.

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 Distribution

pyvroom-0.15.dev3.tar.gz (2.5 MB view details)

Uploaded Source

Built Distributions

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

pyvroom-0.15.dev3-cp314-cp314-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.14Windows x86-64

pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.14macOS 15.0+ x86-64

pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

pyvroom-0.15.dev3-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pyvroom-0.15.dev3-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pyvroom-0.15.dev3-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pyvroom-0.15.dev3-cp310-cp310-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file pyvroom-0.15.dev3.tar.gz.

File metadata

  • Download URL: pyvroom-0.15.dev3.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvroom-0.15.dev3.tar.gz
Algorithm Hash digest
SHA256 2f60382df66d611b7c5e8766b852e412d56cae12600b74e55121696abb2a07d1
MD5 e1ab7508bc81b3e42d56d4422a81aec5
BLAKE2b-256 fb6d4de377b4c1efd3e948d9356de90f4a8689830af8a1a4bd1b4ca2cd5f3adf

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b1bce2e3cb5c0ccfef66560f5b2fdb4c44ff8de830409a79fa3db28def6b3754
MD5 88a1b662d6f70f4cc85c702464eeee6d
BLAKE2b-256 56cd0904257be10783f15612d1917f56d02f13eec1d86bc384df03cd5d716753

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1c629205779c9dd88d6612894a9ec63c896723f4b1faa14e81a6c231ed564ab7
MD5 33db6e54d908a71bbf2bbe27bc0ceb5d
BLAKE2b-256 b181557222825801c9e15d48646674ac458d3f90ca3faefb9de0886959c76abc

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 8f8705cb1e09381e04c2c3f8a994b0d2c21bebd169096d5a46582140c7706a26
MD5 1f05c5e23c1f39d12430ab047258412e
BLAKE2b-256 89f3d1d349f2d9ea656b085aaff59e456332035c3129778d77c383bb6a684d87

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 435c8d44dfbd748b2c86a4a8260a13a9c5e2fad14652ac6f288ca229c8373030
MD5 0a468fc42815aab3d326f305f677d471
BLAKE2b-256 2fd074f867f32c31f13a1d1ace1f3a2b8f1520aa2e521d9cc1d3b1c576969bb2

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 61e0e0d9727ce6d9bd63c80e4c88a4b0d10730d0f8626b36f81a5947c5acad1f
MD5 16569a4b4a4cac387b7bb7ae7e88f003
BLAKE2b-256 17aa1ea335feb2dd69fb8e91e9af0b9738d9b33151b2a201a3c3cb45b7a5d9d5

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2840a52d754548ff83f26d6d702ebd1bc22fc6615bcb1403ea65f7dae4852c27
MD5 76b042a2099854652a3b4791a2c0d19b
BLAKE2b-256 9213332c3f5c77bddaab40354b4c2cd40b848fbf46748056a1e20a0cefb97328

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 463489eda5d94454a4f9f0885a1f879c4a39d46c58c069f81872c9cfa7c5ff08
MD5 132bf246a3cfb749d5487d4cff311a6c
BLAKE2b-256 70acd7cad20ddcfdc45d9a682897412911d5de76627bd2662fc1cbb46b87a840

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f8ae6f21d6a1dfb56881e41db2bd0a35f326ea5cb4cfa229c55616b6dd6f9247
MD5 c0c7aac7771a34bab7f75293b064decf
BLAKE2b-256 775c37720b99b89d3a62228f75512019900ec17a091a22147ae1e1db91d0ebff

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 82d45be59663499305c11d6bf847cd1b831ac33256676df2e30087372dbe60a9
MD5 9aef2dfefab66acc2bbaeee0e783e869
BLAKE2b-256 6718acd44310ff9125ef9cadaffed6955400649ea6fb96c0e9654ee619097f18

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2c8de81140c8408ade605eb26ce07941fbabbb63bc86f64ddf24a40c810a7a85
MD5 f87c13e5372ba719b995ab48ac74e8cc
BLAKE2b-256 c214ad1e746a6b067e98dd1f70f70ea48f1ba95ada63f48397e1f4e0890f1e97

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6fb93b0a06889792e06075547f9bd25e11dbaea005c795b3a4688c980372154a
MD5 8a40e887d5b800d5b699728d55234bf9
BLAKE2b-256 7466f4d4f630fa5b50c401dc2612e0970981d12d0f85a1f97a807920e770d509

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c9e60bd27b19b9272dd0fc7b04bf40f04290f399f3abaf2817326b7d277c442a
MD5 5e714b1f6f32c7f627856a796c2dedff
BLAKE2b-256 e7750baec9ad31ee7778fe0e46a53aacaa7dea3424898aec24d06cbe1ea38bed

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c958af490657bff64b33af37ebf523cc95004e6ef3c962b36dea8abc5cf233b5
MD5 26bae672c31c053071ede531de0324e1
BLAKE2b-256 fde21e122de0186d389f59e1cf85511c54ed6b4405dff0a5f866834c893424d9

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 9111b0498d61900774fe188a62b2b9303af20866285d622747f50bed9bc27f4b
MD5 8087aa2a2a83e42e6d1f6f0224ee38d3
BLAKE2b-256 4c3f083b4f33263fdf96ac778a0ba83cd2a0beb1eda56b450fab98b17fe40ecb

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ff65ffbba0a988050ae02874bb749f3cdd23f2f63d9299f0a51eabad6dc001ba
MD5 8dd6c57a4e33c2db82bca3190260c36f
BLAKE2b-256 155ce3b2d01fe7feeaa0d1386b32513c1ef8e15e55ac9cc0c06b268acb5c11ca

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 473718ca85652ea87f81d43f516f7b1b88bd9e45d201942390273afe24935ea1
MD5 49071f7e21c9722c34e904fdd4257a80
BLAKE2b-256 35452e539cbb152cea43d8a2dd9e529101e2a51c55206b5987d5e838ea2376b6

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 694c786555f8a28d3d1602b3734482b6f805eb74b46b11314e984c0dd6a1b540
MD5 93a7f2b1e0a45ca237e93eb8609622be
BLAKE2b-256 8fa1bbf1c9d555b068a17328e5546c8a104a6afacac3c68f07a412816fcc139f

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6006a6fcc701ed32332aeb3733460c9a78a92f450021df1d9fca41ca13f3ac27
MD5 78cc8b408cb971c109cafbad0e08e173
BLAKE2b-256 f8ee9fbd4f9278ea1fc220069bd58f1704d4edceffcf380906d288b76fa72bec

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 36b12456868d4139e3f98e0ecf2f8484fbde550afbcf6be99402e8577e1e0edc
MD5 7c8cbfb8df72a1a2b888b8f6d1032ea6
BLAKE2b-256 10b432029ccaf0d54a70acde7a1cb66ada216f8c7c78b738b379e563ba86dc2b

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 46e4c3a58cd11b90be89a9f4d9dd75eb7c8b83df794e4c68e9b6a89949c024bb
MD5 4c89a6c927da211028152a4902975345
BLAKE2b-256 4baa8f5a5054bed0770118493d6cf290449ee97975aefe969892c9ff29d9a936

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e39bba637f31be0ead2712830b5e85764c9a379836a408e6f52d65c6376df365
MD5 74787c4635ca5987764d00442d82f23a
BLAKE2b-256 40a485cae74fc9f4b4fe6c5a571a13c16a4cbc3ab82e67134efeee6faee771ed

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 230e6ed521bb69bb6808a091bcc59eb02907052eb93d72da60ee6f112925899e
MD5 4f4c25f6134650fefb2dbf8ad75fb916
BLAKE2b-256 7b142fb9431245ac323df093793587b9a9f6b4c400523cd43cb708c8b7993dea

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 063a2648bf58c6e47e95666d800c78337a424526c744d75b6c85ac7409865b35
MD5 b1387de8b6adf06fbc69c3f80bd40efa
BLAKE2b-256 16e1ab862d399e71918bfcef7e5ebdd4038ecaa2b61a0dc23fc6b386733a0e5b

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 02d57fd89944f1b97c22be8f143359bfe9749df5c33f2ff6c218b6322d5a8232
MD5 d07ae9ee98a38893dba66b74255044d9
BLAKE2b-256 39b8e7489fd4df366bfc142cfd40c7b45007175bb5c7f1933dd966a2eea226d2

See more details on using hashes here.

File details

Details for the file pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-0.15.dev3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a872bf7e12edf52c4997246c801e129bc04086eb70c90f6186fdd63b43dc09c9
MD5 e484102ffb4152f8816e7b2499490428
BLAKE2b-256 74af5a28e4b4bdc179ec8d8bb9bb8127cadfbda41716a6dd20054f951fd52735

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