Undistributed orders
If there aren't enough vehicles or couriers, individual orders may be excluded from all the routes. If it's possible and acceptable for your business to refuse some orders, you can use the following options:
- Set up the share of undistributed orders.
- Optimize routes for assigned orders.
Allowable share of undistributed orders
Specifying the share of undistributed orders is useful when orders that are far away from each other appear during planning. Making deliveries to remote locations is not economical unless there are several such deliveries. A single delivery to a remote location must keep getting transferred to a different shift until there are several orders going in this direction. The objective of this setting is to automatically designate uneconomical orders as unallocated, but only if there are not many.
When you use restrictions on the allowable share of unallocated orders, the algorithm will automatically leave the allowed number of long-distance deliveries unallocated and schedule such deliveries if their number grows.
In situations where some orders may fall into the unallocated category as a result of planning, use the scenario for Planning orders that can be rescheduled / Planning part of the orders.
How it works
In the task, set the the allowable share of unallocated orders using the max_drop_penalty_percentage
parameter. It is added to options
and indicates the maximum ratio of the total penalty for unallocated orders in the solution to the maximum possible penalty for such orders.
There is no separate parameter to set the maximum possible penalty for unallocated orders. It is the sum total of all locations.penalty.drop
values in the task.
The range of values for max_drop_penalty_percentage
is between 0
and 100
. By default, max_drop_penalty_percentage = 100
. To use this option, you need to configure several other parameters:
- Add the
penalty
parameter tooptions
. Use the
options.penalty
parameter to setdrop_penalty_percentage
for the violation and specify:penalty.drop_penalty_percentage.fixed
: A fixed penalty for violatingmax_drop_penalty_percentage
.penalty.drop_penalty_percentage.per_percent
: A penalty for each extra percent in the ratio of the total penalty for unallocated orders to the possible maximum if the calculation shows thatmax_drop_penalty_percentage
was greater than the value defined in the planning task.
- Reduce the penalty for an undelivered order in
locations.penalty.drop
(from the default value of1000000
down to a smaller number).
Request description example:
{ "options": { "date": "2018-09-01", "time_zone": 3, "quality": "normal", "max_drop_penalty_percentage": 0.4, "penalty": { "drop_penalty_percentage": { "fixed": 1000, "per_percent": 50 } } } }
Copied to clipboard
Example 1
This example includes 37 orders, 35 of which need to be delivered around Moscow, one in Kaluga, and one in the Tver region.
All the orders must be allocated to routes, so max_drop_penalty_percentage = 0
.
The default value is used as a penalty for unallocated orders.
The solution assigns all orders, including the two going to remote locations.
API request (JSON) ⋅ API response ⋅ View on map
Example 2
The same as Example 1, but max_drop_penalty_percentage = 100
. Penalties are set as follows:
penalty.drop_penalty_percentage.fixed = 100000
.penalty.drop_penalty_percentage.per_percent = 100
.
Penalty for unallocated orders: locations.penalty.drop = 1000
.
The algorithm leaves the two long-distance orders undistributed.
Restart a task to optimize routes
By default, the algorithm assigns orders and plans routes in a single planning task. If many orders remain undistributed, the routes built may not be optimal. In this case, you can configure a restart of the planning task, in which routes will be optimized only for the assigned orders.
The options.restart_on_drop
option is responsible for restarting the planning task (false
by default). If restart_on_drop
= true
, the planning task may take longer, but the resulting routes for assigned orders will be optimal.
We recommend using this option only if many undistributed orders are acceptable in the solution.