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)
>>> 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 asio glpk

    For RHEL:

    dnf module enable mariadb-devel:10.3
    dnf install -y openssl-devel asio glpk-devel glpk-utils

    For Musllinux:

    apk add asio-dev openssl-dev glpk-dev glpk-utils
  • 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=missing --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-1.15.0.dev21.tar.gz (25.4 kB view details)

Uploaded Source

Built Distributions

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

pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.14macOS 15.0+ x86-64

pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

pyvroom-1.15.0.dev21-cp310-cp310-macosx_15_0_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ x86-64

pyvroom-1.15.0.dev21-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-1.15.0.dev21.tar.gz.

File metadata

  • Download URL: pyvroom-1.15.0.dev21.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvroom-1.15.0.dev21.tar.gz
Algorithm Hash digest
SHA256 c880ec623849954d08bd112cfa1858c80b1364df163f8524687e966d60edec7f
MD5 390916e613c55f9cc7b072ec1caf0c19
BLAKE2b-256 974ebd0ffcbe59928bf3776b2920dc8627d3dc4b99bbb8be2f19e8c1d893a617

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7a0cf8e2f4147076afd741e9547302f5f0b136a80be7ec863c1f1698020239a9
MD5 aedf6410429930c375f3cce578b3f1d1
BLAKE2b-256 e8726dbf63644cc1c063e2fd90227f15e818b81768d9497c7fc27832e349a188

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 9d5c3eacce45fcaaeb968435eb6602f999ea37d2e67a023e6748456310539d9f
MD5 b9f6d3f64341b547c3f52c4dd3a8a4d8
BLAKE2b-256 e78b1fa2317b3c94c0fe62d3644418f7628fa00777ea729fb0de3b4e0101788b

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ab73a6eb0246c8451f9f0c63897c21ff0368e6e7d47ca9aef6a1cd3d3cfd3566
MD5 d55eee4f62a45c60fe9b2fa626fd53ac
BLAKE2b-256 4537eacd6de267a20dca942a60156f99b358f12e6ee73ff50dc4c839b8c5660d

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3b0d21f500241a4b34b95b11ae4b809920dba7adf78974c5fd92a8e3de22bcd0
MD5 2ef83ed7983cddae15918a36f46126e7
BLAKE2b-256 7d2ea1a805f00e65188d595753ad3d29be5f78d2c7df97caf0ea6d5c56a903d2

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca2f375ef177e9b358c8a35e23cff34ef6a7549a872453fdba09ea25008bb9c2
MD5 444997a6e04c391a5cc44ebc16d44fe7
BLAKE2b-256 c1c80c14b68f4f37811140c2acf08ca4442c59087d5108c95d7c61d1eda5680c

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 57ac1b6515bf4924302570dc24d8170f719301e1021e582a23cab440c53f7306
MD5 de0be24b55de76c99075f1a6e2275d29
BLAKE2b-256 ab33b7c3e10d4f9d7fea50b23f968875845575afa28a7d871f108ed3f0e75da6

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 74e2036a7bd3db9ed8b464de841906a5b347d6db1be355475b68f1e524e30274
MD5 5878417cdbacbc2afc9483e13650dac0
BLAKE2b-256 cd0ee9c040c024199374a477a95665fc33fccef6d6eb9c1fb8d78085d5093fb5

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 301d32a2b7d4aafd4182220243a8711cdf972e269ce91dfa41c9f4f34b2575d8
MD5 4bc008a8091627ac7ac3afb0745604cd
BLAKE2b-256 d4cd7b9a212734ad4b32d416128e477750b9b8eba27b5423411ea210a71bc057

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a05ce3aa77373533e81895df645be7305e6a5fa93299489956ec81da211cf984
MD5 d5a8322a460a34d45259f2d4055e8daa
BLAKE2b-256 9576466ed3c24d93f5bd47d61388993afc539e4275796e8300567242117fcebc

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 62f8b9a2870d1a41187380e3f9344a619484767b02d752089ef6eaeecf1a6d66
MD5 7df33106d9abc77a565b7924e04bc920
BLAKE2b-256 f64f599713d91282058ce8d5eec9e5b9e733491a2d93c128a0570fb1183ea5cc

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 251beffea6c6e1a38f37392356eed42824fe0f24176d31d07a9152beddf8a763
MD5 faae43aed652b52dea5ad20e932d3a49
BLAKE2b-256 266e60beb8dccb4975c0baa481743deb134e8ff0c61f05fcca60d12779d2113d

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 88baa5d63ceeb3b2741a693f9bb880f12b13c9af426ed874e553581cdf62a6f4
MD5 0348242fc31f50fdff824ababdfdf19d
BLAKE2b-256 b331929f0634c380e3a906f19a7a34835d9fda339791f9c1ceeb4b8226fade21

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5314f78eacb94c00b6af73972f1c5c579416171915f4b474aec923b0b646db5b
MD5 535a325629fc5b61a187987cee1b8c54
BLAKE2b-256 6517f477bc141fbc388e145aa5eb76119be153151c01eb069ce7f0aedd92df74

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a62ac31efd224d83f9a8def1d74a0b227eadfaca0344a74f6677fc795e8673d5
MD5 b944953f0fe420d46e25be899605c525
BLAKE2b-256 bbf8470e166ae5db85ef84b097648896abcd440e398ccf46883ffdddc1d608d8

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 1c7489bb4ec010545b6edcf49851cd145b7418eb53dceb27b4bad062103a4a1f
MD5 5cef9ebfad3d9d47ef4a88fc0ad3e439
BLAKE2b-256 07ff1754366c116d6ff44a537c5aba2d608d217ae3d91d032490034df0c36220

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6f03b2c29f11cca24d5fd99376e2249bfda478ae41229a4de15469e52b7cbee5
MD5 0f3c1aa4d50b0f4896c95f00e50d1fe9
BLAKE2b-256 d731a20f4108c0acae8bd5cdf50b0276909bb0923b891bddcc237a3538bf9194

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 848a30d7eeecd22df23e19ea55bfde7ad0a8287512776aaab9ac8dc323fa5d9a
MD5 f7288828e2a19f8a872c3e4f7137b2da
BLAKE2b-256 206b4d3f00021757cdeef922261a9176510c354db56cc56db5ce775b105464a2

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e173f03351bad55a724d5bc45d1ad00456ce0f4d38a3851e517ef921f87ab44f
MD5 267f1069a82b5336f4a9d3b9414f90a5
BLAKE2b-256 405989616da3a8458904e902632fe92c39c0bef2ef4aa62abdd9cf037fd83e7f

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp310-cp310-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 10ad3cfceebda55d68f7336c19933ac55c8fa767270c3749c5cb829722495bbb
MD5 3459c371583420e8286b18e537c6303b
BLAKE2b-256 b89bfe7281ef4cbef65ecfb0db433c7cc2c0d59e5aac5e3d4e877667d352849b

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0.dev21-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0.dev21-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d3f79a1f9f9875d88da0aa9b5964957f28616f5dbb3fd3cb9a8e35a7e31275dd
MD5 679fb85819d1eee03646a5c7c6e12951
BLAKE2b-256 016021e76988614a1e634cf39b706c2c6ce755453d15d577e62a0691b4aea4fc

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