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-1.14.1.dev9-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

pyvroom-1.14.1.dev9-cp312-cp312-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.12macOS 13.0+ x86-64

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

Uploaded CPython 3.11Windows x86-64

pyvroom-1.14.1.dev9-cp311-cp311-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.11macOS 13.0+ x86-64

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

Uploaded CPython 3.10Windows x86-64

pyvroom-1.14.1.dev9-cp310-cp310-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

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

Uploaded CPython 3.10macOS 13.0+ x86-64

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

Uploaded CPython 3.9Windows x86-64

pyvroom-1.14.1.dev9-cp39-cp39-manylinux_2_28_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9macOS 14.0+ ARM64

pyvroom-1.14.1.dev9-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-1.14.1.dev9-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8eac2b484e6e7d13a2e86c1421441c14ffbf75a9a2f65c4058a64b93b711a933
MD5 8341d3113695e83e3500010d3dd8167d
BLAKE2b-256 0fae023c18737a115150cbab2602180145e41c37801ac3faf5b7f37dcda398a8

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 367c0521a5600377e55991e6e9e13bcc51dd4228a9991a18d2c73189211a37b0
MD5 adedbcd429bb394f30a8f40b913b97ff
BLAKE2b-256 edb73e7035073cac536251ac3a8ddda52e6924506f9db313bbfeef62503dae85

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 13af1e7e511b975bb55c5b6fd252a9d5ae546ed2079fc42b85558680d03dadd6
MD5 acb00f3b3a5f27ddb2fd5fb68ec673ff
BLAKE2b-256 90d12d1a3be5a2439037dde9ae5a40294a11168bae038a8f3d34491e6a5c155a

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ce4db4215eab3ab85cecb8f484a43175e4d5a0c1563bf4e4d6a19b4add65c38c
MD5 535b6c3cd7bd99a8cb9c57021ea56046
BLAKE2b-256 67b38c9ddcad299bab0e462bf3b04e1991625862756fd9826afd5490fdf699da

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 425c59c0a419f33a97c09c58076e92e47b906f0e2f36eed3fede3e663d6ed629
MD5 9d20d0a993b877754a079abc096f19dd
BLAKE2b-256 39639591880d6d11c1a5c8d5202ccd5cf8769b02a56a9dd949ddd7efc70cda32

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2b231afb3dab2e72d4d49c1456e6c9db6470f01dbf72b89c9c543637fcdc3256
MD5 c653a1a6e4d5e3c9f86d862e98c701ba
BLAKE2b-256 72583e6ad251cf8c42577d16d8ce056af6a832c95e9922d807852482fe0f75f7

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d9462f39d6c202d0f48886d2e8c5534a42ac28d79a60ded9e57a6be4e12782d
MD5 64970a0656974b9431c475a9fabe8ddf
BLAKE2b-256 a6b6fdf0dd33a155c0893a61dd9bdde3d2a0ed9c02754ab5c1447bad7d637619

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3470c02fab77f539ea0cf5dab4338bad4002c73594374063d64b46ede092963e
MD5 534fa9ead153fd8c0103ee5c796e4a98
BLAKE2b-256 8666e9a3162979a3b86ee0338a297efbe65decd3627007d8c773fbf7b5593438

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 883e3ae7409a247a4cf9903cf79d53c89fa7bf0a4385036fcb89db0490c2ea3d
MD5 91b3b94333518662e672ece7bbf4fb84
BLAKE2b-256 1719c375ce35b2b72d837325e2fbe000299d920178c8691f69485e6dbdf9c43b

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4f961ede7112e44eba5a3cb71d50b30c412565896e6843775654fd02bb54e437
MD5 04ac62f37754ec219455ee55fe7e8743
BLAKE2b-256 c14b46f50c8a36ce5057351864e1b6bca97b5696fd2e886af32c39b79a2d81d0

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0a3a3d3a67da44af25a82cbf99e42cffb1b4f3f59dc13b6db3e3c0f3a4f902be
MD5 7de83d7f3be9142223294c07007d596a
BLAKE2b-256 b1774e127675832c0b28669e73377c3516308b2a223bf7f9e7383105345bdeba

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 39ebc71ebdc69b5ef79402997d5f401086a57faea2eaeeb8a3ef7d9b3c746ddf
MD5 2f92057d73bc579904de7eedec5e0ee3
BLAKE2b-256 64a12e83c5d0d25cf462c01e20982485ee8cce7ad03bee5160104ecbc681623e

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc4ae61de9238eca96c351f6617cefa2651ca09c284495ae40ebc348a16cea81
MD5 ed2359e7d41884ac1febb8ca7c32a475
BLAKE2b-256 246c208709d3f9a48a0d9c6a2abfbeec5886df1de498404f8274310b91400221

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 43149c66ebf34e1d203937336d69b05c3c6f5242c44e955c96bdce0047149d4d
MD5 bea0750daf720dcd195fa2f3e4b4f76e
BLAKE2b-256 100c387cd42947911b2372e5bdc84a7434d45741be1febf2cc57448f6419eedc

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f0fe12a03db228d7f09a2a4fcaa97eae53eed7cc7df4e4e924ebd6ed51ccc302
MD5 a6a359b9a342930b6b869bd8045ab7b8
BLAKE2b-256 d569cf8e3a56a0647b82ac1232159fea778b325056219e53d95a58bd2e1f7b5d

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0498b0a447fcbcca645b0bd2ef935ffa34d38e1c22140333c2af4cd42ec64416
MD5 63e49c1b98781dd34aa654166cb8ba63
BLAKE2b-256 206fb553d8ee1467d9428d812653498a886aeb4b5930563b61f30c976ba4e449

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 58655bbc49b6737118b7d69144b44e2a7c5b009288333da3a11946e7dc9e9e9b
MD5 827eecb02490e22e93a133233f16c4f2
BLAKE2b-256 3b095566d45bc9054f03b4defda41409e6e3f2d625027e71e9d9fcac2a3a89d3

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 370cbc74add7ce5ba21ca7da8115ed88790a1cd5a9ff728931a0f9e96ec33331
MD5 73ed81b39d46b847d0ad534d827268ce
BLAKE2b-256 2ce0b068b50724cc693a5504783abd8219947bf0c04e1d339ecee9fcb1f81b4e

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d1f180838793464926127b8dd0fac4c035ee8ccb8acd3c81e2071d8e7ac7431f
MD5 ed3e00d1d9bcbc4c69bcdbc43f880bc5
BLAKE2b-256 7666cabfc5e62b8f33a01e44def836183ec260701336c086cfe773cc987f3aab

See more details on using hashes here.

File details

Details for the file pyvroom-1.14.1.dev9-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev9-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dce13b8605610cfaf993f479d7454846ba31a5cfc0fb07d89d4ace586b203271
MD5 81e9d0b3a3c69f19a7fc450bb662c92d
BLAKE2b-256 829258235611724a2c42aed0684a8ae14dc96189afff453a3b64054bbcfbc627

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