Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supply cost matrix and duration matrix separately #415

Closed
iedmrc opened this issue Dec 14, 2020 · 3 comments · Fixed by #555
Closed

Supply cost matrix and duration matrix separately #415

iedmrc opened this issue Dec 14, 2020 · 3 comments · Fixed by #555

Comments

@iedmrc
Copy link
Contributor

iedmrc commented Dec 14, 2020

Hi,

We provide VROOM a customized cost matrix rather than letting VROOM fetch from OSRM (As it is already supported by VROOM). But manipulating the cost matrix deforms time windows due to durations are the same as the cost matrix. It'd be nice if we could pass a duration matrix along with a cost matrix. Then VROOM could optimize the cost matrix but check time windows by looking up to the duration matrix.

Thanks!

@valerivp
Copy link

That would be fantastic!

@jcoupey
Copy link
Collaborator

jcoupey commented Dec 15, 2020

Currently we optimize on overall travel time so we're using travel times as sole cost option. Regardless of how costs are computed (custom matrix or based on other metrics), the real change here would be to switch to a generic notion of cost, whatever that means. This would require to adjust all places where costs/gains are used throughout the solving phase, which is a deep dive in the codebase.

Benefits of this work would include:

  • support for user-provided cost matrix
  • support for user-provided cost functions (fixed cost for vehicle usage and additional cost proportional to travel time and/or distance)

This is also somehow related to #394 if you think cost functions/matrices should be vehicle-dependant. In that prospect, this would require the same kind of deep technical changes to the codebase, but also solving adjustments to account for heterogeneous costs across vehicles. Adding the notion of a fixed cost for a vehicle also requires touching existing local search operators.

@graham8
Copy link

graham8 commented Jun 8, 2021

It would be good if a simple option to equate cost with distance travelled could be introduced. This is because providers such as openrouteservice can be wrong about how fast some roads can be travelled. Current proposed workaround is

  • run optimisation based on fastest route
  • calculate average speed from travel time and distance travelled
  • obtain distance matrix and scale by average speed to obtain normalised travel-time matrix
  • run optimisation again using travel-time matrix

@jcoupey jcoupey mentioned this issue Aug 20, 2021
8 tasks
@jcoupey jcoupey added this to the v1.11.0 milestone Sep 14, 2021
@jcoupey jcoupey added the API label Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants