Skip to main content

Ensuring vehicles complete all drop-offs before pickups

The Stateless Optimization API allows you to define efficiency constraints for vehicles, enabling various operational scenarios. One such scenario is ensuring that vehicles complete all drop-offs (deliveries) before returning to perform any pickups.

To enforce this behavior, you can apply the following efficiency constraint to the relevant vehicle, provided that the nodes share the same demand type (e.g., weight):

Do all drop offs first

"efficiency": {
"constraints": [
{
"demand_name": "weight",
"unloaded_max_capacity": 0,
"unloaded_overcapacity_check_strict": true
}
]
}

This configuration enforces a strict overcapacity check for the demand type weight. It defines a maximum capacity of 0 after a series of consecutive drop-offs, effectively preventing the vehicle from performing pickups until all drop-offs are completed.