Code Monkey home page Code Monkey logo

veroviz's Introduction

VeRoViz: Vehicle Routing Visualization

PyPI version License

VeRoViz is a suite of tools (primarily written in Python) to easily generate, test, and visualize vehicle routing problems.

Key features of the Python tools include:

  • Generation of nodes on road networks;
  • Calculation of travel time/distance matrices using external data providers;
  • Creation of Leaflet maps to view nodes, routes, and basic geometric shapes; and
  • Generation of dynamic CesiumJS content to view 4D "movies" of vehicle routing problems.

All Python source code is hosted in this repository. Documentation, examples, contact information are available from the VeRoViz project website.


About VeRoViz

VeRoViz is an open-source project from the Optimator Lab, in the University at Buffalo's Department of Industrial & Systems Engineering.

This project began in 2018 as a tool for our research lab. It is under ongoing development.

The prototypical VeRoViz user is someone who is developing models, algorithms, or heuristics for a vehicle routing problem (entities that move between locations). Sketch can also be used as a teaching tool in the classroom to introduce vehicle routing concepts.

The aim of VeRoViz is to help such a user

  • obtain road network data,
  • sketch the locations of nodes (e.g., customers and depots),
  • visualize arcs (connections) among these nodes,
  • generate 3D movies showcasing solutions to vehicle routing problems,
  • quickly generate test problems and distance (and/or time) matrices.

VeRoViz is not an optimization package. If you're interested in vehicle routing solvers, you might consider GraphHopper, Vroom, OR-Tools, VeRyPy, or VRPy.


Contact

  • For general inquiries, send email to: [email protected].
  • Follow VeRoViz on Twitter: @veroviz_org
  • We use a GitHub issue tracker to monitor bugs and enhancement requests. Please report any issues you encounter or let us know of any new features you'd like us to incorporate in VeRoViz.

About Us

  • Lan Peng is the VeRoViz Lead Developer. He is a Ph.D. Student in the Department of Industrial and Systems Engineering at the University at Buffalo.

  • Chase Murray is the VeRoViz Project Director. He is an Assistant Professor in the Department of Industrial and Systems Engineering at the University at Buffalo.

We hope that VeRoViz adds value to your vehicle routing research. As always, we welcome your feedback (in the form of comments about how you're using the tool, issues you're experiencing, or ideas for new functionality).


How to Cite VeRoViz

If you're using VeRoViz in your research, please consider adding a citation. Our manuscript for VeRoViz is currently under review. You may view this manuscript on SSRN. Until this paper appears in a journal, you may cite VeRoViz with the following BibTeX entry:

@Misc{veroviz2020,
    title        = {{VeRoViz}: A Vehicle Routing Visualization Toolkit}, 
    author       = {Lan Peng and Chase Murray},
    year         = {2020},
    howpublished = {\url{https://ssrn.com/abstract=3746037}},
    note         = {Accessed: 2021-05-10}
}

Contribute to VeRoViz

We welcome contributions from the vehicle routing community. Please, help us make VeRoViz better!

Here's how you can help:

  1. Report bugs/errors/oddities. This helps us know if something's broken.
  2. Suggest a new feature. We tried to think of all of the clever ways people might use VeRoViz, but we probably forgot something. Let us know what you think would help make your life easier.
  3. Submit a pull request. If you have some code that would fix an issue and/or improve VeRoViz, a pull request is the best way to incorporate that code into the package. We haven't had any pull requests from outside collaborators, so we haven't yet worked out our preferred workflow. So, if you're thinking of contributing code, please send us an email first, so we can jointly decide the best way to collaborate.

Links

  • Project Website - Includes installation instructions, documentation, and other relevant information.
  • PyPI Website - VeRoViz may be installed via pip.
  • Change Log - A summary of changes associated with each new release of VeRoViz.
  • FAQs - Frequently asked questions.
  • License - VeRoViz is distributed under the MIT license.
  • Credits - This project is made possible by numerous other software packages.

veroviz's People

Contributors

cmurray3 avatar isaac0821 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

veroviz's Issues

Improve code readability by using formatter (black or yapf)


This improvement was suggested by one of the extremely helpful reviewers of the paper titled "VeRoViz: A Vehicle Routing Visualization Toolkit" (https://dx.doi.org/10.2139/ssrn.3746037). See also #36, #37, #38, #39, and #40.



The original reviewer comment appears below:

This is personal preference, but standardising the Python formatting by the use of some formatter (e.g. black or yapf) makes the code more readable. Also, I had issues with the tabs/spacing when I was editing some snippets, this would be avoided with such formatting tools.

CESIUMDIR environment variable not recognized

Bug Description
CESIUMDIR environment variable is not recognized in jupyter notebook even after describing its path

To Reproduce
Describe the path of CESIUMDIR in pico ~/.profile.
For e.g export CESIUMDIR="/Users/akhilsinghchauhan/Downloads/IE\ 670\ Dr.chase/Cesium-1.7$

Screen Shot 2021-02-12 at 12 37 30 AM

Even after describing the full path of the CESIUMDIR environment variable, it is not recognized
Screen Shot 2021-02-10 at 5 12 03 PM

Python Version:

  • [] Python 3

VeRoViz Version:


It's a good idea to verify that you're working with the latest version of VeRoViz:

'Your current installed version of veroviz is 0.4.3. You are up-to-date with the latest available version.'

Operating System :

  • Mac
  • Windows
  • Linux
  • other

Browser [chrome, safari]

Adding "expDurationSec“ parameter in veroviz.getShapepoints3D module

When I used the getShapepoints2D function, there was the expDurationSec parameter, which allows my vehicle to travel in the expected seconds on a road. However, when I wanted to do a similar thing in getShapepoints3D, there wasn't any 'expDurationSec'. I did not find any other parameter that can be replaced with the expDurationSec in this 3D function.

It would be nice to have 'expDurationSec' so any drone can travel slowly to its destination in the 3D model.

These are the documentation:
getShapepoints2D
getShapepoints3D

Error on createArcsFromNodeSeq() function

Please use the template below to submit your bug report.

Describe the bug
when using createArcsFromNodeSeq() function, it generates error. (see below screenshot)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Should create arcs based on node sequence

Screenshots
Screenshot 2023-12-02 at 9 32 53 PM

Python Version (please complete the following information):

  • Python 2
  • Python 3

VeRoViz Version:

# Paste the result of the following Python command:
myArcs = vrv.createArcsFromNodeSeq(initArcs = arcs,
                                   nodeSeq  = route['truck'], 
                                   nodes    = belgium_df, 
                                   objectID = 'Truck')

Operating System (please complete the following information):

  • Mac
  • Windows
  • Linux
  • other
  • Browser [e.g. chrome, safari]
  • Version [e.g., 16.04 or Windows 10]

Additional context
Add any other context about the problem here.

Add function to import from TSP/VRP benchmark instances

In an effort to increase VeRoViz adoption, it would be nice to include a functionality to import some of the popular/classical TSP/VRP benchmark instances.

Many of these use (x,y) coordinates, so we'll need to include an option for the user to provide a lat/lon reference point (and some measure of the distance scale for the (x,y) coordinates.

This was inspired by #38 .


Here are some places to start:

Improve Performance


This improvement was suggested by one of the extremely helpful reviewers of the paper titled "VeRoViz: A Vehicle Routing Visualization Toolkit" (https://dx.doi.org/10.2139/ssrn.3746037). See also #36, #37, #38, #39, and #40.


There are several places where performance can be improved. [We might want to split these into separate issues]

  • API curl requests (e.g. in _queryOSRM.py) are inefficient.
    • Having a curl request for each pair of origin-destination coordinates is slow. Is this necessary? Different APIs already have this distance/duration-matrix functionality already available (e.g. for ORSM see http://project-osrm.org/docs/v5.22.0/api/#route-service). This would also resolve issue #16.
    • [Why did we have the single curl requests? Was there are reason for this?]
  • getTimeDist2D (and hence getTimeDistFromLocs2D) is slow.
    • Need to implement numpy-based computations.
    • In getTimeDist2D, the coordinates are traversed twice in the inner functions; once for the loading of the distance / time from the chosen data-source (e.g. osrmGetTimeDist) and then again in getTimeDistFromLocs2D. Clearly, this can be simplified by querying the API and filling the matrix in a single for-loop.
  • generateNodes is slow.
  • Take a look at similar issues with all data providers (not just OSRM).

The original reviewer comment appears below:

... I have some comments relating to performance, mostly relating to the OSRM queries.
I understand this is not a focus of this library, however, if it is to be used for instance generation, I would suggest a revision of some functions.
Particularly, I'd like to see performance enhancements relating to the following:

  • API curl requests (e.g. in _queryOSRM.py)
  • getTimeDist2D (and hence getTimeDistFromLocs2D) where most of the time is spent.
  • generateNodes

I'm not sure if this is just my machine, but it doesn't scale particularly well.
For 5 customers (as in the paper demo notebook) function 2. (getTimeDist2D) takes up to 16 seconds while with 100 customers I killed it after 30 minutes. This can be easily improved.

I think this is due to the following:

  • Having a curl request for each pair of origin-destination coordinates. I'm not sure this is necessary as different APIs already have this distance/duration-matrix functionality already available (e.g. for ORSM see http://project-osrm.org/docs/v5.22.0/api/#route-service). This would also resolve issue #16.
  • Matrix operations in pure Python: I've briefly looked at the functions and most of the matrix operations can be sped up. As numpy is an already declared dependency, I would suggest migrate some matrix operations (where possible) to use the numpy equivalent. For example, in the getTimeDist2D case, the coordinates are traversed twice in the inner functions; once for the loading of the distance / time from the chosen data-source (e.g. osrmGetTimeDist) and then again in getTimeDistFromLocs2D. Clearly, this can be simplified by querying the API and filling the matrix in a single for-loop.

It seems that the main issue is with the curl requests, as there's no problem with getTimeDist3D even for 100 nodes (faster than getTimeDist2D even for 5 nodes).

I have seen similar cases with some of the other data sources, so would suggest a revision of these.

Improve README file


This improvement was suggested by one of the extremely helpful reviewers of the paper titled "VeRoViz: A Vehicle Routing Visualization Toolkit" (https://dx.doi.org/10.2139/ssrn.3746037). See also #36, #37, #38, #39, and #40.



The original reviewer comment appears below:

To aid with the contributing I suggest ... [a] more elaborate README file: most of the information is all already included in the webpages, however I think it helps to repeat it in the repository as well. Particularly,

  • Contact details
  • Contributing guidelines (how you'd want people to contribute to the project)

Improve Package Maintainability (unit tests and cont. integ.)


This improvement was suggested by one of the extremely helpful reviewers of the paper titled "VeRoViz: A Vehicle Routing Visualization Toolkit" (https://dx.doi.org/10.2139/ssrn.3746037). See also #36, #37, #38, #39, and #40.



The original reviewer comment appears below:

To match the quality of the work, I would suggest a series of unit tests to test the validity of the basic functionality. Along with this, I would like to see a continuous integration suite (GitHub workflows, travisci, ...) to run these unit tests (every time there is a commit to a certain branch, pull request, etc). This is very easy to set up and really helps.

Add Interface to VRP Solver(s)


This improvement was suggested by one of the extremely helpful reviewers of the paper titled "VeRoViz: A Vehicle Routing Visualization Toolkit" (https://dx.doi.org/10.2139/ssrn.3746037). See also #36, #37, #38, #39, and #40.



The original reviewer comment appears below:

... I would suggest to interface with an existing VRP solver.
With the existing work, I think adding a simple interface to an existing solver would complete the package quite nicely and will bring higher usage from the community already using the solver that need tools like VeRoViz.
Under certain assumptions, it should be straightforward.
There are many open-source solvers or heuristics for Python, for example, the well-known OR-Tools (https://developers.google.com/optimization/routing/vrp), VeRyPy (https://github.com/yorak/VeRyPy), or VRPy (https://github.com/Kuifje02/vrpy).

If the extra dependency is not wanted, this can be clearly stated as an optional feature in the
installation instructions (similarly as is done with Cesium).}

Error Code 429: Too Many Requests

Please use the template below to submit your bug report.

Describe the bug
In my case study, there is a depot that has 4 vehicles on 4 different routes. The total no. of customers needs to be visited are around 22 and a depot. When I am assigning fewer customers to 1st 3 vehicles (around 1 or two), the 4th vehicle who has to cover all the remaining customers is giving me an error like Error Code 429: Too Many Requests (sometimes. not always). Secondly when I am combining the codes of all the 4 vehicles is a single "Spyder-Python" file, it fails to execute anything. Furthermore, I am unable to change the pin color of my depot through a loop, to distinguish it from the customers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
    4. See error

Expected behavior
I want to show all the routes of my vehicles on a single map with the different pin of my depot through "Spyder Environment". I am planning to run the code with Python's GUI platform.

Screenshots
image

image

Python Version (please complete the following information):

  • Python 3

VeRoViz Version:

# Paste the result of the following Python command:
import veroviz as vrv
vrv.checkVersion()

'Your current installed version of veroviz is 0.3.1. You are up-to-date with the latest available version.'

Operating System (please complete the following information):

VeRoViz Code.zip

Windows 10]

Additional context
Add any other context about the problem here.

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.