I would like to use the “costs” parameter for vehicles in the “Optimization” API in your Python package. However, in the source code it seems that it is not supported. Is that done on purpose? If so, can it be changed?
The background for this is that I hope to use distance-based costs for my vehicles instead of time-based ones so I can optimize routes based on the shortest instead of the fastest path.
Hey,
I am unsure whether the costs parameter does what you want to use it for - the VROOM API documentation on this parameter is a bit unclear to me.
Depending on how many locations you have, you could consider using a custom matrix, calculated from directions requests using the shortest profile instead of recommended.
However, it should be rather easy to extend the python package to accept a cost parameter - feel free to open a PR about this.
Best regards
Thanks!
Yes, I am also not entirely sure about the about the VROOM API - the description doesn’t say much about how a lot of the parameters work internally. I would like to give it a try though because it could really help me if it works the way I hope it does, so I will open that request if it works.
The distance endpoint from openrouteservice is great overall, but it doesn’t provide optimization (except by using the VROOM API internally from what it looks like in the SDK package) and that means I can’t use it to optimize using the shortest profile.
A custom matrix would require a potentially very large amount of directions requests since a few routes do indeed have six or more locations - that would stack up very fast. So I believe I will have to refrain from using that.