Unassigned 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:

Allowable share of unassigned orders

Specifying the share of unassigned 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 unassigned, but only if there are not many.

When you use restrictions on the allowable share of unassigned orders, the algorithm will automatically leave the allowed number of long-distance deliveries unassigned and schedule such deliveries if their number grows.

In situations where some orders may fall into the unassigned 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 allowable share of unassigned orders using the max_drop_penalty_percentage parameter. It is added to options and indicates the maximum ratio of the total penalty for unassigned orders in the solution to the maximum possible penalty for such orders.

There is no separate parameter to set the maximum possible penalty for unassigned 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 10. By default, max_drop_penalty_percentage = 100. To use this option, you need to configure several other parameters:

  1. Add the penalty parameter to options.

  2. Use the options.penalty parameter to set drop_penalty_percentage for the violation and specify:

    • penalty.drop_penalty_percentage.fixed: A fixed penalty for violating max_drop_penalty_percentage.

    • penalty.drop_penalty_percentage.per_percent: A penalty for each extra percent in the ratio of the total penalty for unassigned orders to the possible maximum if the calculation shows that max_drop_penalty_percentage was greater than the value defined in the planning task.

  3. Reduce the penalty for an undelivered order in locations.penalty.drop (from the default value of 1,000,000 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
            }
        }
    }
}

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 unassigned orders.

The solution assigns all orders, including the two going to remote locations.

API request (JSON)API responseView 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 = 100,000.

  • penalty.drop_penalty_percentage.per_percent = 100.

Penalty for unassigned orders: locations.penalty.drop = 1000.

The algorithm leaves the two long-distance orders unassigned.

API request (JSON)API responseView on map

Restart a task to optimize routes

By default, the algorithm assigns orders and plans routes in a single planning task. If many orders remain unassigned, 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.

Note

We recommend using this option only if many unassigned orders are acceptable in the solution.

Contact support