Skip to main content

A command line interface for VRP solver

Project description

crates.io build downloads codecov CodeScene Code Health dependency status DOI

VRP example

Description

This project provides the way to solve multiple variations of Vehicle Routing Problem known as rich VRP. It provides custom hyper- and meta-heuristic implementations, shortly described here.

If you use the project in academic work, please consider citing:

@misc{builuk_rosomaxa_2023,
    author       = {Ilya Builuk},
    title        = {{A new solver for rich Vehicle Routing Problem}},
    year         = 2023,
    doi          = {10.5281/zenodo.4624037},
    publisher    = {Zenodo},
    url          = {https://doi.org/10.5281/zenodo.4624037}
}

Design goal

Although performance is constantly in focus, the main idea behind design is extensibility: the project aims to support a wide range of VRP variations known as Rich VRP. This is achieved through various extension points: custom constraints, objective functions, acceptance criteria, etc.

Getting started

For general installation steps and basic usage options, please check next sections. More detailed overview of features and full description of the usage is presented in A Vehicle Routing Problem Solver Documentation.

Probably, the easiest way to learn how to use the solver, would be to play with interactive tutorial, written as jupyter notebook.

Installation

You can install vrp solver using four different ways:

Install with Python

The functionality of vrp-cli is published to pypi.org, so you can just install it using pip and use from python:

pip install vrp-cli
python examples/python-interop/example.py # run test example

Alternatively, you can use maturin tool to build solver locally. You need to enable py_bindings feature which is not enabled by default.

Additionally, to jupyter notebook mentioned above, you can find extra information in python example section of the docs. The full source code of python example is available in the repo which contains useful model wrappers with help of pydantic lib (reused by tutorial as well).

Install from Docker

Another fast way to try vrp solver on your environment is to use docker image (not performance optimized):

  • run public image from Github Container Registry:
    docker run -it -v $(pwd):/repo --name vrp-cli --rm ghcr.io/reinterpretcat/vrp/vrp-cli:1.23.0
  • build image locally using Dockerfile provided:
docker build -t vrp_solver .
docker run -it -v $(pwd):/repo --rm vrp_solver

Please note that the docker image is built using musl, not glibc standard library. So there might be some performance implications.

Install from Cargo

You can install vrp solver cli tool directly with cargo install:

cargo install vrp-cli

Ensure that your $PATH is properly configured to source the crates binaries, and then run solver using the vrp-cli command.

Install from source

Once pulled the source code, you can build it using cargo:

cargo build --release

Built binaries can be found in the ./target/release directory.

Alternatively, you can try to run the following script from the project root:

./solve_problem.sh examples/data/pragmatic/objectives/berlin.default.problem.json

It will build the executable and automatically launch the solver with the specified VRP definition. Results are stored in the folder where a problem definition is located.

Usage

You can use vrp solver either from command line or from code:

Use from command line

vrp-cli crate is designed to use on problems defined in scientific or custom json (aka pragmatic) format:

vrp-cli solve pragmatic problem_definition.json -m routing_matrix.json --max-time=120

Please refer to getting started section in the documentation for more details.

Use from code

If you're using rust, then you can simply use vrp-scientific, vrp-pragmatic crates to solve VRP problem defined in pragmatic or scientific format using default metaheuristic. For more complex scenarios, please refer to vrp-core documentation.

If you're using some other language, e.g. java, kotlin, javascript, python, please check interop section in documentation examples to see how to call the library from it.

Contribution policy

open source, limited contribution

The goal is to reduce burnout by limiting the maintenance overhead of reviewing and validating third-party code.

Please submit an issue or discussion if you have ideas for improvement.

Status

Experimental.

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.

vrp_cli-1.23.0-cp310-none-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

vrp_cli-1.23.0-cp310-none-win32.whl (1.7 MB view details)

Uploaded CPython 3.10Windows x86

vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARMv7l

vrp_cli-1.23.0-cp310-cp310-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

vrp_cli-1.23.0-cp310-cp310-macosx_10_12_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file vrp_cli-1.23.0-cp310-none-win_amd64.whl.

File metadata

  • Download URL: vrp_cli-1.23.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for vrp_cli-1.23.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 ce5ce84db5ab0e15607be119390e4fb04f12d7958eaa5711aeb449f3119c0eee
MD5 6793e6352c201c3a61d0f7eaf9280cfc
BLAKE2b-256 8f680e4f87d7c4c51239c73738ae49e2a2967f3e1f6a2d06d7169d64315a2787

See more details on using hashes here.

File details

Details for the file vrp_cli-1.23.0-cp310-none-win32.whl.

File metadata

  • Download URL: vrp_cli-1.23.0-cp310-none-win32.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for vrp_cli-1.23.0-cp310-none-win32.whl
Algorithm Hash digest
SHA256 39c3d9eb1f61a972b0d5ada0afe5bc1ca5f262e36cb94cd232984c1c450ee581
MD5 eba519d652e360359961b7698d656c53
BLAKE2b-256 97ad90727499fec856b72cad3bfb1925181b3797774eee96d2cad38508401dd6

See more details on using hashes here.

File details

Details for the file vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9765324fac2cee6d16957d3034f1a25b50c6fc31027fb585db8fece6ab80c8c
MD5 7031a3cc13d75f3e9cd57e932edddcf3
BLAKE2b-256 715fbfb29485a6daec2e4c01b5c15317e556d1572553a3a62522243b0954513e

See more details on using hashes here.

File details

Details for the file vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for vrp_cli-1.23.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 fe5b2df02aa94a1e9ad36ea9a2e8fe1ac3af82e0c8d1858f1c3aaff752d392da
MD5 9d90290a02688f9aecf2c0cdae1ce7f7
BLAKE2b-256 6135b3cb73aa527fbe7067505ddad8194afb571f13714ecde1c54d0f79d4da86

See more details on using hashes here.

File details

Details for the file vrp_cli-1.23.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vrp_cli-1.23.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d9594ccc29f2816dbe7cb1455f1f668f98baf976e497ecb4fd985ae33bdd12e2
MD5 4145661ce06e1ed85312f14f19aa5f81
BLAKE2b-256 9c4f5a299ee991ba36a32597074a124b791f2de179bcb786696ef60a01bf8ee3

See more details on using hashes here.

File details

Details for the file vrp_cli-1.23.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vrp_cli-1.23.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 813b01000ffe4d42f5b035b63311a4eb5fb3393ec0d7dc92edaca7ec5c9e65dc
MD5 1622f904a8657f55ae40a69bcd9de0af
BLAKE2b-256 482312250aa46bb3f3bc0a2b410a8f28d4c1902b3d0412691ab4ef0204074d6c

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