Penalty for unused depots

A planning task may list all depots used by the company. At the same time, not all depots are needed to load and unload orders. To prevent the algorithm from planning unnecessary visits to depots where couriers don't need to load or unload orders, use the penalty options.penalty.unused_depot.

The penalty has three components:

  • starting, a penalty for each unused initial depot. By default, it is set to 0.

  • middle, a penalty for each unused intermediate depot. By default, it is set to 10000.

  • ending, a penalty for each unused final depot. By default, 0.

Note

If a courier needs to return to the depot at the end of the run, (return_to_depot = true), but doesn't unload any orders there, a penalty penalty.unused_depot.ending will be charged. To avoid such penalties, allow the courier not to return to the depot at the end of the run.

If a task has this penalty, you can see the following metrics in the response:

  • total_unused_depot_penalty: Total penalty for unused depots of all types.

  • total_unused_starting_depot_count: Number of unused initial depots.

  • total_unused_middle_depot_count: Number of unused intermediate depots.

  • total_unused_ending_depot_count: Number of unused final depots.

Example

Two couriers deliver 40 orders. The task mentions five depots, but orders can only be loaded on four of them. Couriers shouldn't start their routes at the depot (visit_depot_at_start = false), but they should return to the depot at the end of the run (return_to_depot = true). They can load additional orders at intermediate depots (allow_different_depots_in_route = true). A penalty of penalty.unused_depot with each component amounting to 20,000 is set for visiting depots without loading and unloading.

In the solution, one courier starts from the depot and loads orders, while the other starts not from the depot and first collects pickup orders. Both couriers deliver orders and return to the depot without unloading any orders at the end of their routes. As a result, a double penalty.unused_depot.ending penalty is charged. You can see it in the metrics total_unused_ending_depot_count = 2 and total_unused_depot_penalty = 40,000.

API request (JSON)API responseView on map

Contact support