Skip to main content

VRPy

VRPy is a python framework for solving Vehicle Routing Problems (VRP) including:

  • the Capacitated VRP (CVRP),

  • the CVRP with resource constraints,

  • the CVRP with time windows (CVRPTW),

  • the CVRP with simultaneous distribution and collection (CVRPSDC),

  • the CVRP with heterogeneous fleet (HFCVRP).

Check out the docs to find more variants and options.

Simple example

>>> from networkx import DiGraph
>>> from vrpy import VehicleRoutingProblem

# Define the network
>>> G = DiGraph()
>>> G.add_edge("Source",1,cost=1,time=2)
>>> G.add_edge("Source",2,cost=2,time=1)
>>> G.add_edge(1,"Sink",cost=0,time=2)
>>> G.add_edge(2,"Sink",cost=2,time=3)
>>> G.add_edge(1,2,cost=1,time=1)
>>> G.add_edge(2,1,cost=1,time=1)

# Define the customers demands
>>> G.nodes[1]["demand"] = 5
>>> G.nodes[2]["demand"] = 4

# Define the Vehicle Routing Problem
>>> prob = VehicleRoutingProblem(G, load_capacity=10, duration=5)

# Solve and display solution value
>>> prob.solve()
>>> print(prob.best_value)
3
>>> print(prob.best_routes)
{1: ["Source",2,1,"Sink"]}

Install

pip install vrpy

Requirements

cspy

NetworkX

numpy

PuLP

Documentation

Documentation is found here.

Running the tests

Unit Tests

cd tests
pytest unittests/

Bugs

Please report any bugs that you find in the issues section. Or, even better, fork the repository on GitHub and create a pull request. Any contributions are welcome.

Metadata

Release files for vrpy 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vrpy 0.5.1
File Size Uploaded Provenance Actions
vrpy-0.5.1.tar.gz 140.0 kB Without provenance Details for vrpy-0.5.1.tar.gz

Release files / vrpy-0.5.1.tar.gz

Download URL vrpy-0.5.1.tar.gz
Size 140.0 kB
Tags Source
SHA-256 checksum
How to use checksums
953d5cabe6ae7d4b58439f9e85cb899b3ce912bddc5ca9184947abef39bfbd7e
BLAKE2b-256 checksum
How to use checksums
b98415ebdf4ed4a250c28bae25e98a31b7fda78abd0b5d713d48e7843b18dc93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Security for vrpy 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page