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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

pyvroom-1.14.1.dev8-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.dev8-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

pyvroom-1.14.1.dev8-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.dev8-cp310-cp310-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 14.0+ ARM64

pyvroom-1.14.1.dev8-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.dev8-cp39-cp39-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9macOS 14.0+ ARM64

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5f4e96118d70d29b558b84968bd0338d1df7514ab0cdb0b31f4c3806d2f393b2
MD5 c63e5c313854df12153f2a0d2c52c15b
BLAKE2b-256 38f40fef625b8512ce5712162ddbc1c16dfcf4bd8e688bfd6714440f5293541f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6ff1985595a573a0e9a5d221989642e5d89b2253205323528f140266760dc626
MD5 c898c88425dc06b5171ad6c2e31c4029
BLAKE2b-256 19dd6ee7442e94ebca03b2c6641a226b2fb1729648914cca41967d37213c30cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 be90d493e0e4085d9438c7c5367086da64170d860b6991d4be318d065b51f5b8
MD5 3030b143fc961027181f8cbcc874dcb0
BLAKE2b-256 22d942bbff33b1966f18276802c71bf70f3792b561e1eb11c3cc72d0b8a6dc6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 107d7340f3e602b356e4c11bf3688a093c7b483c8b64eab65101c86ae3f2e330
MD5 864ea4f1046bd4d548ac16f013e8c6c8
BLAKE2b-256 4dc83019add7d8c3dd78166fa2012645d7a891c1affa8af3ee62b5bfe30e41d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 13c54ddbbf60d3ebb7ed5df15418ad6a7f7fcb5284bcf3889c93cb31aa7f1041
MD5 2848d6d9228af5d13f00631105f70440
BLAKE2b-256 b5671a1d49ba275a915f506c563e3defc2ec720399935264370c499425051704

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cd2998030a645fa9c5c64c1f5bfe18cad825dbd337dd58de21b7836a061f4699
MD5 d32a71c648b883a8df3cf2685d4006c5
BLAKE2b-256 ae8c52a96184c088a8d7381bb1a1218eb8f06b445f758e623d488b667bb63670

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 89c69c60dd208f3f2f07f36092078e1a5824c7c2411303d64614700ce05c4996
MD5 9942539ff01bfd0e68416126ef9422e9
BLAKE2b-256 695e62f274bc2ed64d98e493907764b5c255f766ce31c83d298ee718539a7407

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ccd6ccdc61ca20c59e49614ad0b55ce706ee8f63e576d271b06f199ec5cd90ae
MD5 f7234898172875934214c488441ab344
BLAKE2b-256 902d3da606fe7ea639b731a3b98f56d622b4cf3cb43fcdad6ec9c5e5a7ac63a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 edede50f6246f817bd43a21b0de575d0d359f75ace8cd8fe9728ebfc66043a12
MD5 8740b04c66c91070c65e3e68becdbce6
BLAKE2b-256 bddb4c6ad1eaf9b6c6c41577735df40bb824a3ff500f15d6e702c7a1c465e0ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3245ded48a8c7a89a45e16477537162ef97c71618eeb919756ff5ab0a6ecb38e
MD5 e0116a91780d799f3cfc6f0007418810
BLAKE2b-256 1cceaea589b1f941530ac263a80b8aeb9706053091ad1ddec7a7c437eaed5032

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 68ef7ad4f92393f77be38b40e944d442406493d00dc284c48c95c5ff8d4f2af2
MD5 72ca1b1b0b3a909357a26e2ab499764b
BLAKE2b-256 39377dc5a528117a023d270a557ce65b6af1c4b0c6c2414a8a2844f8e61d632a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 926bc7a2ba2f4c6e1c7e2d36d625bfeab83f647873ffa160da6680a35bf40ab3
MD5 4eda4e8689cc4ef973fbe047dd5c3f14
BLAKE2b-256 986d5333fef36a8642ab185fd7241b1d3e2ea25ed6c18e07ee00ea311d732974

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 37f201843e3b8f0cf1b92400c4d3bfb4dc90365c01d445ab431e71e27e3d51f0
MD5 7275891bacd8d8f3bc074dabdde81457
BLAKE2b-256 98598e3c9c1ec5a16c068c5145e8fb95c2aada0c48aa043430009c859c30203b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 521888593af6e3615ec8b6aaba5ca7ca2e66713111fa09796988c03cef30caf0
MD5 494bca0628d199f3519f5061762dd35f
BLAKE2b-256 28e90ed2ff76fe3eb1adcbd861b97e93b9f0bc0a5bb81bf091e44947b62a9212

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1e5d099d779c31238dd345d14759e9365abbfb99c65eea95894c34a86048f858
MD5 45830bac75c3a7a40c0655985e9ef383
BLAKE2b-256 a9f42a0ffbf2a75bdac567fd1201e470b90b018927a6e314a64b689c6928e39c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f874e368a430060a83726d1538955dea833acebf17987620d61b32e406fb17ff
MD5 8817760968d049605f8bdc0e13ca303f
BLAKE2b-256 f12ef1ee3bcfddb4ebc26c95288c2233800c3edf3e2030f7d4bb22d0c31f1b6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1d313cd45a4a0bf80ff5f71a0d218248217e7f5cd2cb4d15848505c549507993
MD5 0c4d387020c72118d49c8e100babba5b
BLAKE2b-256 a8df27308c77248e4d519c926d76d826c0fcc4c53844b81d6f65cfbd92f91649

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0cc96520e9994fd7fc606b7cab907a34528bf2c4c761bd4f22ead321630cd20a
MD5 720b9f33ef281df2a1919663286dc981
BLAKE2b-256 dd0b59ae963f4a6900f24df468ba0dc6bd21dbedad405b1e9f1636a7e732a04f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5cb3ca504a2c07c8094a7dd48696e94c34417467a883cc99f67f98447cd7408a
MD5 4033718fc0bd27bb40641974122ec896
BLAKE2b-256 ca5f65e0107ba639213e074fed79f441287736869e678474d026f5e477ed4b36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.14.1.dev8-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 040b7887bd801e52e0164bb91d88498e13642310a14aa1c12c1f542a1cdf20ca
MD5 408cb9564633c3a6b0447abc9c67eb64
BLAKE2b-256 e5d2cdaa84d8eff210bfff7967e5da33baab3baeaec1a4abebcfd77434417776

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