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-1.15.0rc3.tar.gz (25.7 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.0rc3-cp314-cp314-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.14Windows x86-64

pyvroom-1.15.0rc3-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.0rc3-cp314-cp314-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.14macOS 15.0+ x86-64

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

Uploaded CPython 3.14macOS 15.0+ ARM64

pyvroom-1.15.0rc3-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

pyvroom-1.15.0rc3-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.0rc3-cp313-cp313-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

pyvroom-1.15.0rc3-cp312-cp312-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.12Windows x86-64

pyvroom-1.15.0rc3-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.0rc3-cp312-cp312-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

pyvroom-1.15.0rc3-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

pyvroom-1.15.0rc3-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.0rc3-cp311-cp311-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ x86-64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

pyvroom-1.15.0rc3-cp310-cp310-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10Windows x86-64

pyvroom-1.15.0rc3-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.0rc3-cp310-cp310-manylinux_2_34_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 15.0+ x86-64

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

File metadata

  • Download URL: pyvroom-1.15.0rc3.tar.gz
  • Upload date:
  • Size: 25.7 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.0rc3.tar.gz
Algorithm Hash digest
SHA256 85f2bf6368e3ced1e5baa6c1f4f4c508221d14ca23b4d2cf8be3d3e98c4833d8
MD5 dbbbe66bdf09d656d9bc87dbba18a4fe
BLAKE2b-256 3280784a9686da80fe2f8e26b9b499b94219f551be224ff5e9817e6fab5ddb94

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0rc3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b93d933139de7115ce485a0db34600d4c59b0268a5ad0da7ffa2e035d85a2d63
MD5 728fa0b877cabe3bcc1e24c91f78312f
BLAKE2b-256 39d0e0763936007bbb6a227938ce2ed4d440c33e34e92e2b60b2164c8071a735

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d2199ceb85094f0d995e0fb6137106ef112d3e7369e0e41c8d2e5fdf47ee96a5
MD5 633cada371b9b0d04ef208895182545f
BLAKE2b-256 8337e33fa13749731b4112dfc906fb5811819de0378daab284cd74bf9679c048

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 b024292e671bdb80e9695cb08d10e3d5bc6d79e0f2526c0fb1348cbd27bc393d
MD5 655d3066d52f14384045ffabc24fea06
BLAKE2b-256 cf3a69ff8fe4d7fef4aec7ffd0528421827a030d45fb42fe973482f8539eae82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp314-cp314-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 8deaf4057dbd231bd832a4c3cc538621e8c012750f699f25c75c5354d032a947
MD5 f0e858809fbbbff38f5668c923fdf44b
BLAKE2b-256 1e3b7f713982fa0af2e52aecdc6db1e13cf1eba579e47fa1f021ad61abcdf558

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 08e611bfc22bf2b7f652b74c396b028d1174d85fe72bdece7b51fba476b87401
MD5 649c5681667f594672ed4db357f904d2
BLAKE2b-256 b060021edb6c27ad8b13d8fb153f5972ffbb6ff45826dda11b2287691d4e87d8

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0rc3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 95188affd4b7c16ca05c744b25b35e57621a74ed43bf67c6ad08db40fa656b9b
MD5 54f22d1b7f1913a45a8b08b1688fd5a9
BLAKE2b-256 2090162f2210135bd37413e4cb8d48ef4881391a46279c8df015ce7035318f39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 698185da5b96fe442688e9285eab48c6af5f3601b1ae91f40cccd982228c688b
MD5 7e61d749eac0894a13bddc8fa8063a00
BLAKE2b-256 13c59eb435c90cdc26f97b7d73a7a3a9ab5d3dbe7a7f188f16d569e8c6b12e0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 683115fc56459322ed9417063dd55fc0e1de2197a7e0ae405f96da5de896c8dd
MD5 34a64c90e45622faaadfcc2515b1b502
BLAKE2b-256 c290ba05ffbf02c2d4bef663893e304df667f4d3e7991aad94697efb0fc8c8a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f65f0a3860f712011e2017fded31f93c8a031245150746a76cd7f854a9a88497
MD5 6e4541766d969ff9ffca558bce763250
BLAKE2b-256 3762c4b4e4d37f194111f19fc84f8d2417366fccef56103744c45d4a48f637bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 700606c41c66a6c548da5a8b979fcf87a0bb026daa79392a19936313404470a5
MD5 9430623b3fae77cfa901b4b2911c8493
BLAKE2b-256 765f4138f77fab98bc174e4d175ced6970b8b398606e71103ecfc31af96acc4a

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0rc3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 70577336514dab7db7e86647d9642caf9feb49d259a5d7106d3996a0e92432fe
MD5 43d9f56ea5a73944fd2f0bef58fa5f07
BLAKE2b-256 94ae85c0af86969c6e362b2a44c94802a383107dbac33bce45d5405ee16240ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 63db0c226b1383787d4222103314d0d3a68b6268a88c51369d1bc37605465d13
MD5 2a8f146941f1303ec53cb03431df7667
BLAKE2b-256 38de257ca99bf9274d117d07bd82eb6e987e32b28549ce8aba475ad0c6dbfb31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 07fcd46207326d2d354e060ce0b0b16cda3151cdf89f75ae13b13091a466c592
MD5 95dfbe488d3277475a9e3bd0f0c03e31
BLAKE2b-256 8a7e667468d144859de70412dce3f12e85423aac16e811f178f7d235f4c98090

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a521c9d899516c4ecd174c3229515eb4e276a9a4c4ad1cdb18af4665fea5a87f
MD5 d8ee170dac49b3d4c66143e275562966
BLAKE2b-256 b93086e69859e6a5d1cb89fce8b0e211f2e004c1b3eece06973be05ef9b8fccc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c803c640dfd9b4aa59d5f54bf6451339f473cce48a40806357c8199e458d2b78
MD5 9f41f0887b9c7272eae22a471c5ba2be
BLAKE2b-256 78374ca671087af3a566ec64600b7f14e321e6c5bc4b2a153f20fa4431d48e46

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0rc3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22ef3c10b931ac210f57479a3e0d0f023a585c3167778f5ce4eac50ca7c02a32
MD5 58878c353affba684fd94b770f2b704a
BLAKE2b-256 63d96cba5516310105f32a216771dd01094719ba4649a22c01a32fd36060eccf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 588fdcecae911345fdd016524881729a11fb6a81b8e107c7ab4bb399834ab7f8
MD5 82c024402a4505d18063f82e1aab65e6
BLAKE2b-256 5d9f40fffaf52a3ec2931087735acd92688962f49a5c4bff488662f2b4507258

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d6fefd76a7b93dcda3911cb84767b1172ab0834b29671415b2e4936cd906ff8d
MD5 05563f1ea884daa3646ce62b91847865
BLAKE2b-256 48201645a826b75cc16675d14c63dcd5e26a979c9d1d35b780ae90875189649d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d339f92e866fd03aca174c77f3418ccc66dde0be3e740fccd813d8c3730ce918
MD5 d14c66c0df32bbbc22421fe5c6ef7834
BLAKE2b-256 3d3cc67217baa6dbc522facad0ab91f2b792912b57de30c228c3b34a760f7072

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f2222a4551015db5259ca3d347adc08768e456067b36ead890d32f27ab9452cc
MD5 0e1b09ca0fdf07f41fb31a4f6728d4be
BLAKE2b-256 bd73b6d955cd74247de04b4c1f34ca39082f13bd72f3c40693fd690fb2908779

See more details on using hashes here.

File details

Details for the file pyvroom-1.15.0rc3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 485b63b7314eab15ed8762b6802d9abb39cf30658d25befdf504fa206f664f43
MD5 0ea0b79b598319b867e6cdad9fbc2a69
BLAKE2b-256 b958e404fa18b2c034898461ceb207c7148c90786b760d05ef6a0fa30f5b1f0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7ffbfa996af013c134f7060fdae274d3dcc0c257eeba956c9608066235c8c66e
MD5 f9210a2bf784dd050a4455eb4d030026
BLAKE2b-256 c4e23ed703d15d9ba01d730d08f677bee11549f30d9691b51deb9f7ed438b6e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 468b112c9edcbe750b3428c67cba93a69301fdf2f968af5a70d0c32d4b96ea67
MD5 d1c9c66e3d6974362cacfff8688d3d87
BLAKE2b-256 5f6b5d6b10250d06b11aa25fc89b53900b27c7d68ce60b3894fa8e06952bc451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp310-cp310-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ab0af954e3852c65e276d1a45a4c133a895cfb126890931c83d6c6bc2cfb8b2b
MD5 f6e890bf51611a46789a7db0542a2da5
BLAKE2b-256 5dc8209e4f12604acf816e5257cb2b336c2493cd90a032dfe0ecbf4272d02f46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvroom-1.15.0rc3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b0ad2c7da6ab9931b0373de7e14f0693f2a2394c72567f66196879107b229748
MD5 d3a771f7745aee6cf19a982ecc962254
BLAKE2b-256 901ce95e3b5a121ef1d8f32f29277ddd8a4866c175a8f6e4931024e81f2f3e31

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