Counting the minimum number of stops for active vehicles only

The minimal_stops parameter (see Limit the number of stops per shift) works on all specified vehicles. Using it can cause the algorithm to build a route for all your vehicles, even if fewer are needed for delivery. This approach helps avoid penalties for violating the limit on the minimum number of stops.

The ignore_min_stops_for_unused option is useful if you need to consider the following conditions when planning:

  • There are more vehicles than necessary for order delivery, and you need to optimize the number of vehicles on the route.

  • A certain minimum number of stops is required.

In this case, set the option's value to true so that penalties only apply to the vehicles already involved.

By default, ignore_min_stops_for_unused = false. In this case, penalties for violating minimal_stops apply to all specified vehicles.

Example 1

There are 5 vehicles in the courier service's fleet. 15 orders need to be delivered today. minimal_stops = 3: Each vehicle must make at least 3 stops. penalty.stop_lack.per_stop = 2000: The penalty for each stop below the minimum number is 2000. ignore_min_stops_for_unused = false.

When a route is built under these conditions, all vehicles are involved, even if a smaller number would be enough. This is how the algorithm minimizes the overall cost: in this case, the penalties for violating the minimum number of stops outweigh the profit from using fewer vehicles.

API request (JSON) API response View on map

Example 2

The same as in Example 1, but ignore_min_stops_for_unused = true.

The algorithm also plans 15 deliveries, but it only allows you to use the vehicles that are already involved instead of all the vehicles available. In this case, all routes meet the minimal_stops restriction.

API request (JSON) API response View on map

Contact support