Minimum Stop Load

What is Minimum Stop Load?

In heavy goods and freight delivery, dispatching a large truck to deliver a handful of lightweight parcels is rarely efficient. The vehicle incurs the same road time, fuel cost, and driver wages, but returns a fraction of the productive value of a fully loaded run. Yet, a route optimizer working to minimize distance or time may routinely make exactly these assignments.

NextBillion.ai's Route Optimization API's Min Stop Load feature provides a way to discourage this. By setting a minimum load threshold (min_stop_load) on a vehicle, you instruct the optimizer to apply a cost penalty whenever that vehicle is assigned a delivery stop with a load below the threshold. The penalty, combining a per-unit shortfall cost and an optional one-time fixed cost, steers the optimizer toward more load-efficient assignments without ever strictly blocking a task when no superior alternative is available.

Use Case: Heavy Goods Freight Delivery

Consider a regional freight operator who runs two heavy delivery trucks out of a central depot in Las Vegas. Both trucks have a payload capacity of 500 units, and the operator has established from experience that each truck run is only cost-justified when it delivers at least 150 units to any given stop.

Today's dispatch includes six customer deliveries ranging from 50 to 300 units. The challenge: several of the smaller orders (50-140 units) sit below the 150-unit efficiency threshold, but they still need to be fulfilled. The operator wants the optimizer to:

  • Prefer assigning above-threshold loads wherever possible.
  • When necessary, assign stops that are below the standard threshold. This should be done, however, with an intelligent selection process, based on the penalties associated with vehicle load thresholds.

This is precisely what Min Stop Load is designed for.

How Min Stop Load Works?

The Threshold: min_stop_load

Set at the vehicle level as an array of integers (matching the vehicle's capacity dimensions), min_stop_load defines the minimum per-stop delivery load the optimizer should prefer for that vehicle. It applies exclusively to delivery-type jobs.

The Penalties: unit and fixed

Two penalty parameters control how strongly the optimizer avoids below-threshold assignments:

  • min_stop_load_unit_penalty: Applied per unit of load shortfall at every violating stop. This penalty accumulates across all violating stops on the route. Use unit_penalty to create a proportional deterrent so that larger shortfalls cost more and nudge the optimizer to prefer stops closer to the threshold.
  • min_stop_load_fixed_penalty: One-time penalty applied to the route if any stop on that vehicle's route falls below the threshold. It is applied once regardless of how many stops violate the threshold. This makes it effective for discouraging light-load routes entirely, even when individual shortfalls are small.

The total penalty on a route is the sum of all per-stop unit penalties plus the single fixed penalty. This total is reported in the response under penalty.min_stop_load.

Configuring the Feature: Input Parameters

All Min Stop Load parameters are configured at the vehicle level. The table below summarises the three attributes:

ParameterType / LocationDescription
min_stop_loadintegerMinimum load threshold per stop. Applies only to delivery-type jobs.
min_stop_load_unit_penaltyarray of integersPenalty applied per unit of load shortfall at a stop.
min_stop_load_fixed_penaltyinteger (vehicle)A one-time fixed penalty applied to the route if any stop on that vehicle's route has a load below min_stop_load. Applied only once per route.

In our freight delivery example above, the two vehicles are configured as follows:

Vehiclemin_stop_loadunit_penalty (per unit)fixed_penalty (per route)
Vehicle 1[150][2]300
Vehicle 2[150][3]200

Example API Request & Response

Example API Request

The request below sets up two heavy freight trucks with different penalty configurations and six delivery jobs ranging from 50 to 300 units:

1
curl --location 'https://api.nextbillion.io/optimization/v2?key=<your_api_key>' \
2
--header 'Content-Type: application/json' \
3
--data '{
4
"description": "Min Stop Load Example",
5
"locations": {
6
"id": 1,
7
"location": [
8
"36.15944795,-115.20659211", // index 0 - Depot 1
9
"36.16568350874093,-115.23738137291211", // index 1 - Job 1
10
"36.15918738490483,-115.24306768034586", // index 2 - Job 2
11
"36.16653558,-115.25079129", // index 3 - Job 3
12
"36.15926628,-115.26173001", // index 4 - Job 4
13
"36.14406466,-115.23069975", // index 5 - Job 5
14
"36.15171485,-115.24091363" // index 6 - Job 6
15
]
16
},
17
"depots": [
18
{ "id": "Depot 1", "location_index": 0 }
19
],
20
"jobs": [
21
{ "id": "Job 1", "location_index": 1, "delivery": [50] },
22
{ "id": "Job 2", "location_index": 2, "delivery": [50] },
23
{ "id": "Job 3", "location_index": 3, "delivery": [140] },
24
{ "id": "Job 4", "location_index": 4, "delivery": [210] },
25
{ "id": "Job 5", "location_index": 5, "delivery": [100] },
26
{ "id": "Job 6", "location_index": 6, "delivery": [300] }
27
],
28
"vehicles": [
29
{
30
"id": "Vehicle 1",
31
"start_depot_ids": ["Depot 1"],
32
"capacity": [500],
33
"min_stop_load": [150],
34
"costs": {
35
"min_stop_load_fixed_penalty": 300,
36
"min_stop_load_unit_penalty": [2]
37
}
38
},
39
{
40
"id": "Vehicle 2",
41
"start_depot_ids": ["Depot 1"],
42
"capacity": [500],
43
"min_stop_load": [150],
44
"costs": {
45
"min_stop_load_fixed_penalty": 200,
46
"min_stop_load_unit_penalty": [3]
47
}
48
}
49
],
50
"options": { "routing": { "mode": "truck" } }
51
}'

Example API Response

The condensed response below shows routes for both vehicles. All 6 jobs are assigned ("unassigned": 0). Inline comments flag each stop's violation status. Both routes carry a penalty.min_stop_load value:

1
{
2
"description": "Min Stop Load Example",
3
"result": {
4
"code": 0,
5
"summary": {
6
"cost": 1662, "routes": 2, "unassigned": 0,
7
"duration": 1662, "distance": 14532
8
},
9
"routes": [
10
{
11
"vehicle": "Vehicle 1",
12
"cost": 643,
13
"steps": [
14
{ "type": "start", "depot": "Depot 1", "load": [400], "distance": 0 },
15
{ "type": "job", "id": "Job 6", "load": [100], "distance": 3840 }, // delivery=300, ok
16
{ "type": "job", "id": "Job 5", "load": [0], "distance": 6018 }, // delivery=100 < 150
17
{ "type": "end", "load": [0], "distance": 6018 }
18
],
19
"delivery": [400], "distance": 6018,
20
"penalty": { "min_stop_load": 400 }
21
// 1 violation: Job 5 (shortfall 50 x unit_penalty 2) + fixed_penalty 300 = 400
22
},
23
{
24
"vehicle": "Vehicle 2",
25
"cost": 1019,
26
"steps": [
27
{ "type": "start", "depot": "Depot 1", "load": [450], "distance": 0 },
28
{ "type": "job", "id": "Job 1", "load": [400], "distance": 3497 }, // delivery=50 < 150
29
{ "type": "job", "id": "Job 2", "load": [350], "distance": 4746 }, // delivery=50 < 150
30
{ "type": "job", "id": "Job 3", "load": [210], "distance": 6863 }, // delivery=140 < 150
31
{ "type": "job", "id": "Job 4", "load": [0], "distance": 8514 }, // delivery=210, ok
32
{ "type": "end", "load": [0], "distance": 8514 }
33
],
34
"delivery": [450], "distance": 8514,
35
"penalty": { "min_stop_load": 830 }
36
// 3 violations: (100x3)+(100x3)+(10x3) = 630 unit + 200 fixed = 830
37
}
38
]
39
},
40
"status": "Ok"
41
}

Interpreting the Output

To evaluate Min Stop Load compliance, compare each stop's delivery load against the vehicle's min_stop_load threshold. The route-level penalty.min_stop_load field reports the total penalty accumulated across all violating stops. Its absence would confirm all stops met the threshold.

Stop-by-Stop Violation Summary

The table below shows each job's delivery load, whether it falls below the 150-unit threshold, the calculated shortfall, and which vehicle it was assigned to:

JobDelivery Loadvs. Threshold (150)ShortfallAssigned ToViolation?
Job 150Below100Vehicle 2⚠️ Yes
Job 250Below100Vehicle 2⚠️ Yes
Job 3140Below10Vehicle 2⚠️ Yes
Job 4210Above-Vehicle 2✅ No
Job 5100Below50Vehicle 1⚠️ Yes
Job 6300Above-Vehicle 1✅ No

Vehicle 1 Analysis

Route: Depot -> Job 6 -> Job 5 -> End

  • Job 6 delivers 300 units - above the 150-unit threshold. No violation.
  • Job 5 delivers 100 units - 50 units below the threshold. Unit penalty: 50 x 2 = 100.
  • A Fixed penalty of 300 is triggered once because at least one stop violated the threshold.
  • Total: 100 + 300 = 400. Matches penalty.min_stop_load: 400 in the response.

Vehicle 2 Analysis

Route: Depot -> Job 1 -> Job 2 -> Job 3 -> Job 4 -> End

  • Job 1 delivers 50 units - shortfall 100. Unit penalty: 100 x 3 = 300.
  • Job 2 delivers 50 units - shortfall 100. Unit penalty: 100 x 3 = 300.
  • Job 3 delivers 140 units - shortfall 10. Unit penalty: 10 x 3 = 30.
  • Job 4 delivers 210 units - above threshold. No violation.
  • Fixed penalty of 200 triggered once (first violation on this route).
  • Total unit penalties: 300 + 300 + 30 = 630. Plus fixed 200 = 830. Matches "penalty.min_stop_load": 830 in the response.

What We Learned?

This example illustrates several important takeaways about how Min Stop Load behaves in practice:

  • Penalty configuration determines which vehicle absorbs light loads: The optimizer assigned all three sub-threshold orders (Jobs 1, 2, 3) to Vehicle 2, whose lower fixed penalty made it the less costly choice for accumulating light stops. Fine-tuning the ratio of fixed to unit penalties per vehicle lets you control exactly which vehicles in your fleet take on inefficient assignments.
  • Fixed penalty acts as a route-level deterrent; unit penalty acts per stop: A high fixed penalty makes any route containing even one light stop expensive, hence useful for protecting premium or high-cost vehicles from small orders entirely. A high unit penalty creates a proportional cost that scales with how far below the threshold the load is consequently, useful for steering borderline cases.
  • Soft constraints always guarantee full delivery coverage: All 6 jobs were assigned despite multiple threshold violations ("unassigned": 0). Min Stop Load shapes the optimizer's preferences - it never blocks an assignment when fulfillment coverage requires it.

Explore other powerful features that the NextBillion.ai's Route Optimization API can solve seamlessly.