Giter VIP home page Giter VIP logo

vrpy's Introduction

CircleCI codecov Codacy Badge Python 3.8 Documentation Status

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/

Benchmarks

cd tests
pytest benchmarks/

Bugs

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

vrpy's People

Contributors

torressa avatar kuifje02 avatar codacy-badger avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.