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

Option to provide custom costs matrix #132

Open
ilibar-zpt opened this issue Sep 26, 2023 · 4 comments
Open

Option to provide custom costs matrix #132

ilibar-zpt opened this issue Sep 26, 2023 · 4 comments

Comments

@ilibar-zpt
Copy link

Would be great to have an option to provide a custom costs matrix alongside travelTimes and distances.

As far as I understand using custom costs matrix is the only viable way to explicitly disincentivize taking frequent A->B routes without affecting either distances or times calculation.

In case such a matrix is provided then fleet.vehicles.costs.{distance,time} should be ignored/disallowed.

@reinterpretcat
Copy link
Owner

That's possible to do, however, technically, solver uses not only cost calculated as linear combination of time and distance, but additionally applies some penalties to guide search in proper direction (specified by local objectives which might be different from global ones).

Maybe you can give a bit more insights what kind of the problem you need to solve with custom costs.

@ilibar-zpt
Copy link
Author

  1. Arbitrary business requirements like "we want to reduce amount of warehouse visits by same vehicle", where constructing less optimal set of tours is preferable than doing multiple pickup rounds by same vehicle
  2. Actually modelling toll roads effect on final route costs

@reinterpretcat
Copy link
Owner

I think the easiest and less surprising way would be to model these costs not like replacement of duration/distance, but rather add it on top. This could be done relatively easily I guess.

@ilibar-zpt
Copy link
Author

Yeah, that should do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants