Capacity Management
The VRP solver provides comprehensive capacity management features to handle real-world loading constraints. From simple weight limits to complex multi-dimensional capacity tracking, this guide covers all capacity-related features.Overview
Capacity management ensures that vehicles don’t exceed their loading limits while optimizing resource utilization. The solver supports:- Multi-dimensional capacity (weight, volume, pallets, etc.)
- Dynamic capacity tracking for pickup/delivery operations
- Capacity utilization optimization
- Soft capacity constraints with violations
Basic Capacity Configuration
Single-Dimension Capacity
The simplest form uses a single capacity value:Multi-Dimensional Capacity
Handle multiple capacity constraints simultaneously:The solver tracks all capacity dimensions independently. A vehicle can only accept a job if ALL capacity dimensions have sufficient remaining space.
Pickup and Delivery Capacity
For pickup and delivery operations, capacity changes dynamically during the route:Capacity Flow Example
1
Initial State
Vehicle starts empty:
0 / 500 kg2
After Pickup
Load increases:
50 / 500 kg3
After Delivery
Load decreases:
0 / 500 kgDynamic Capacity Tracking for PDP
Pickup and Delivery Problems (PDP) require sophisticated capacity tracking as vehicle loads change throughout the route:Real-Time Capacity Updates
1
Track Current Load
The solver keeps track of the running load of each vehicle in every dimension as it moves along the route. Pickups add to the load and deliveries remove from it.
2
Validate Each Stop
Before adding a job, the solver checks:
- Can the vehicle handle the pickup load?
- Will future deliveries free enough space?
- Does the route respect capacity at all times?
3
Optimize Load Sequence
The solver may reorder stops to manage capacity:
- Group pickups early when possible
- Schedule deliveries to free space for later pickups
- Balance load throughout the route
Complex PDP Example
Here’s a real-world scenario with multiple pickups and deliveries:Capacity Timeline Visualization
Along one possible route for the example above, the load changes like this (times are illustrative):The solver ensures that at no point does the current load exceed the vehicle’s capacity in any dimension.
Common Use Cases
1. Last-Mile Delivery
Standard parcel delivery with weight and volume constraints:2. Waste Collection
Vehicles that fill up and need to visit disposal sites:3. Mixed Fleet Optimization
Different vehicle types with varying capacities:Best Practices
Handling Overloading
When capacity constraints make problems infeasible:1
Keep Partial Planning Enabled
partialPlanning is true by default, so jobs that do not fit are left unserved instead of making the whole problem fail. To list the reasons per job, also enable the explanation:2
Check Unserved Jobs
Review
unserved for jobs that couldn’t be assigned. With options.explanation.enabled, unservedReasons lists the constraints that blocked each job. TRIP_CAPACITY indicates a capacity conflict:3
Add Resources or Adjust Loads
Either add more vehicles or review if load estimates are accurate.
Performance Considerations
Optimization Tips
- Simplify When Possible: If volume rarely constrains, use weight only
- Round Values: Round loads to reasonable precision (1kg vs 1.234kg)
- Group Similar Items: Combine small items into single jobs when feasible
Capacity in Response
Capacity is enforced during planning. The response lists each trip’s visits in order, together with the jobs that could not be served:Related Features
- Pickup and Delivery - Complex paired job handling
- Vehicle Types - Different capacity per vehicle type
- Job Relations - Capacity-aware job sequencing