This feature is configurable via .json
input, without the need for code customization and is available for both the Marketplace app and Platform. You can find a list of all available features here.
This how-to guide assumes you already completed the get started with vehicle routing tutorial.
Field name | Required | Data type | SI Unit | Defined on | Example | Configurable via defaults |
---|---|---|---|---|---|---|
unplanned_penalty | No | int | NA | stop | {"unplanned_penalty": 123} | ✅ |
Vehicle routing problems are infeasible if no solution satisfies the set of considerations specific to the problem. For example, stop quantities may exceed a vehicle's capacity, in which case the vehicle can not service all stops. Another example is a vehicle having to fulfill start time windows but not being able to arrive at a certain stop in the desired time frame. When a problem is infeasible, no solution is returned.
The unplanned_penalty
is defined on the stops. It is added to the objective (value function) for every stop that is not planned. It allows for a solution to be feasible by leaving stops unplanned. The solver will only plan stops if it will improve the objective score. For example if travel duration is the only objective the increase in travel duration should be less than the unplanned score.
If no penalty value is defined for a stop, a large value is used (1,000,000). This is set in place because if a stop has an unplanned_penalty
equal to zero, the stop will never be planned. Any unplanned penalties added to the input (including the ones in the stop defaults section) override the generic default. It is important to make sure that the unplanned penalty is sufficiently large to avoid stops being unplanned due to other penalties dwarfing it (if that is not the intent).
Here is an example defining unplanned penalties. A sample output obtained after solving the problem is also shown.