Closed tdeenes closed 2 years ago
Hi, thanks for feedback!
Regarding your question, few approaches possible:
use order
feature on pragmatic format which specifies order of the job tasks in the tour:
order
property info: https://reinterpretcat.github.io/vrp/concepts/pragmatic/problem/jobs.html#tasks
tour-order
objective info: https://reinterpretcat.github.io/vrp/concepts/pragmatic/problem/objectives.html#scalar-objectives
With this approach, you put different order on different job tasks depending on their demand (massive demand gets lower order meaning serving earlier in the tour). You can control your objective function preferences using objectives
property on the problem definition
implement a new constraint/objective pair specifically for you use case. This would require some coding, example of such logic can be order
feature: https://github.com/reinterpretcat/vrp/blob/master/vrp-core/src/solver/objectives/tour_order.rs
add a new post processing step. Pre/post processing api is defined here: https://github.com/reinterpretcat/vrp/blob/master/vrp-core/src/solver/processing/mod.rs
Please note, that my focus was mostly on exposing solver functionality through pragmatic format, so there might be some disparities in programming api in contrast to json format usage.
Thank you for the quick reply and the tips!
First of all, thank you for the wonderful library, it works really great and produces high-quality solutions for our use cases.
I am wondering if it is possible to introduce dynamic costs in the optimization. In particular, I would like to take into account load-dependent transport costs. Especially if the weight of the goods is highly unequal in a tour, it might be worth visiting the clients with massive demands first, so that we can save the extra consumption and amortization costs. Can you give me a hint where to start with the implementation? Note that it might not be required to implement these variable costs at the global optimization level, which might slow down the whole optimization substantially - we could just add it as a post-processing step at the level of individual tours to optimize the order of visits.