Hi,
We have the following case:
- Optimize the routing issue with
shipments
and without vehicle start and end
. Params are at optimization-first-call-params.json
- Out of this first API call result, we build
in_direct_sequence
relations to get the same execution order for shipments
because that is what matters for us. We add also the vehicle start and end
. Look at optimization-second-call-params.json
- On the second call, the API fails to assign a person due to those relations.
We wonder why the person is not able to be planned on the second call, while the relations persist the same order of the first API call.
Thanks in advance!
optimization-second-call-params.json (13.1 KB)
optimization-first-call-params.json (11.8 KB)
It seems to be a rather tight problem regarding the time windows and max_time_in_vehicle for every “delivery”. Many of them around 7:00-8:00 (25000-29000).
Did you also try to add the vehicle start and end address in the first call and only set the in_direct_sequence
relation in the second call?
In the first call, we omit the vehicle location on purpose:
The reason we add the vehicle only in the second call is to get the optimized route without the vehicle start and end. We’re optimizing the “busy-part” (Besetzt-Strecke) of the route and then we’re “just” adding the vehicle location in the 2nd call.
We don’t want, that the vehicle location changes the optimal busy-route sequence.
Therefore, since we’re using the exact same sequence as the first call returns (in_direct_sequence
), where all contraints of the shipments are already had been taken into account, the vehicle location shouldn’t make a difference in the the second.
Yes, it should still be able to solve it. But since it is a heuristic and a tight problem it might fail to find the (sometimes well hidden) optimum. If you set the start and end address already at the initial call then you will make it a bit easier for the algorithm.
What is the underlying business reason for why you omit the vehicle start and end address? Is it because you do the first call e.g. at the beginning of the month to plan the routes and only later assign people/vehicle to them? Or because you want to “just” optimize for the shipments completely ignoring the vehicle/driver costs?
Or could you theoretically add the start+end? Because if yes, then it is very likely that you also get a better route overall and also the second call with the relations is less likely to fail.
The reason is, that some of our clients only pay (or get payed) the busy-route parts where you have persons on board (“Besetzt-Strecke”). They don’t pay (or don’t get payed) for the trip parts where no person is loaded (no shipment-pickup on board).
Which means this busy-part has to be optimized ad the empty parts have to be ignored.
The empty parts of the trip (start → 1st pickup
+ last dropoff → end
) aren’t payed directly.
However, they still wanna know the whole route. That’s why we add the vehicle location in the second call.
We use the first call to get sequence of the busy-route. And then right after the first call, we do the second to get the whole trip, but we still keep the busy-route part.
Thanks a lot for explaining the business case.
Now that you mention it, it is indeed unexpected that even without the start and end address of the vehicle the shipment it is still unassigned (although without the relation it was assigned). I will forward and discuss this
(but due to holidays in parts of Germany it won’t happen this week unfortunately)
1 Like
Great, thanks a lot in advance. We’re looking forward to your answer.