Troubleshoot unassigned jobs
When the HERE Tour Planning API optimizes routes, some jobs might remain unassigned due to various reasons. In such case, the service returns reason codes to help you identify why a job could not be assigned to a vehicle. This article explains the most commonly encountered reasons and provides practical tips for resolving the corresponding issue.
How unassigned job reasons work
When the optimization algorithm cannot assign a job, it evaluates all vehicles in the fleet and returns one or more reason codes which explain why the job could not be assigned. Each reason identifies a specific constraint violation and includes details about which jobs were affected.
By default, the service returns the most frequent reason for each unassigned job. However, you can enable the multipleUnassignedReasons experimental feature to receive all applicable constraint violations for each unassigned job, grouped by affected vehicles. This provides a more comprehensive view when a job cannot be assigned for different reasons across different vehicles. For more information, see Get multiple unassigned job reasons.
Understand and troubleshoot most common reason codes for unassigned jobs
The following sections describe the most common reason codes returned when jobs cannot be assigned. Each section explains what the reason means, why it might occur, and how to resolve the issue.
SKILL_CONSTRAINT
No vehicle has the required skills to serve this job.
Possible causes:
- No vehicle in the fleet has the skill specified to serve the job
- Vehicles with matching skills lack sufficient capacity or time
Troubleshooting steps:
- Add vehicles with the matching skill to the fleet
- Remove or modify the skill requirement if it is not essential
- Verify that the skill names in jobs match those defined in vehicle types
For more information, see Assign jobs based on skills.
SKILL_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the SKILL_CONSTRAINT. In this example, Job_5 requires the flammable skill, but the vehicle does not have any skills defined. When you submit this problem, the solution will show Job_5 as unassigned with the reason code SKILL_CONSTRAINT.
SKILL_CONSTRAINT problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"skills": ["flammable"],
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job along with an accompanying notice to help you resolve the issue:
{
"unassigned": [
{
"jobId": "Job_5",
"reasons": [
{
"code": "SKILL_CONSTRAINT",
"description": "cannot be assigned due to required skill"
}
]
}
],
"notices": [
{
"code": "noVehicleWithSkillsForJob",
"title": "There is no vehicle type with matching skills for job Job_5",
"action": "Check whether skills are correctly assigned"
}
]
}TIME_WINDOW_CONSTRAINT
The job cannot be completed within its specified time window.
Possible causes:
- The job time window falls outside the vehicle's shift time
- The vehicle cannot reach the job location in time due to distance or traffic
Troubleshooting steps:
- Adjust the job time window to align with vehicle shift times
- Extend vehicle shift times to accommodate the job window
- Add more vehicles to distribute the workload
- Use historic traffic data instead of live traffic to get more predictable results
For more information, see:
- Limit the start time of activities through time windows
- Limit maximum shift time
- Understand traffic modes
TIME_WINDOW_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the TIME_WINDOW_CONSTRAINT. In this example, the shift end time has been set to ensure that the vehicle does not have sufficient time to serve all jobs in the tour. When you submit this problem, the solution will show at least one job as unassigned with the reason code TIME_WINDOW_CONSTRAINT.
TIME_WINDOW_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T06:40:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
8
],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned jobs:
{
"unassigned": [
{
"jobId": "Job_7",
"reasons": [
{
"code": "TIME_WINDOW_CONSTRAINT",
"description": "cannot be assigned due to violation of time window"
}
]
},
{
"jobId": "Job_6",
"reasons": [
{
"code": "TIME_WINDOW_CONSTRAINT",
"description": "cannot be assigned due to violation of time window"
}
]
}
]
}CAPACITY_CONSTRAINT
No vehicle has enough remaining capacity to fulfill the job demand.
Possible causes:
- All vehicles are fully or nearly loaded
- The job demand exceeds the capacity of empty vehicles
- Capacity and demand arrays are compared element by element, and at least one dimension is exceeded
Troubleshooting steps:
- Add more vehicles to the fleet
- Increase vehicle capacity if operationally feasible
- Reduce job demand if the requirement is overestimated
- Check that capacity and demand arrays have matching dimensions
- Enable reload points to allow vehicles to unload and continue
For more information, see:
CAPACITY_CONSTRAINT example:
The following section shows a sample problem configured to leave jobs unassigned due to the CAPACITY_CONSTRAINT. In this example, the vehicle has a two-dimensional capacity of [100, 50] representing weight (kg) and volume (cubic units). The demands are configured so that Job_5 ([30, 15]) is both heavy and bulky, and Job_6 ([5, 25]) is light but extremely bulky. When you submit this problem, the solution will show both jobs as unassigned because the optimization algorithm assigns Jobs 1-4, 7-8, which consume [90, 45] of capacity, leaving only [10, 5] remaining, which is insufficient for either unassigned job.
CAPACITY_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [100, 50],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [15, 5]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [20, 8]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [10, 12]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [25, 10]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [30, 15]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [5, 25]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [8, 6]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [12, 4]
}
]
}
}
]
}
}The following complete solution shows how the optimization algorithm assigns Jobs 1-4 and 7-8 to the vehicle, consuming [90, 45] of the [100, 50] capacity. This leaves only [10, 5] remaining, which is insufficient for either Job_5 ([30, 15]) or Job_6 ([5, 25]). This example demonstrates how multi-dimensional capacity constraints are evaluated: a job is unassigned if it exceeds the limit in any dimension.
CAPACITY_CONSTRAINT example solution
{
"tours": [
{
"vehicleId": "vehicle_1",
"typeId": "vehicle_1",
"shiftIndex": 0,
"stops": [
{
"location": {
"lat": 52.53097,
"lng": 13.38504
},
"time": {
"arrival": "2024-06-24T06:00:00Z",
"departure": "2024-06-24T06:00:00Z"
},
"load": [0, 0],
"activities": [
{
"jobId": "departure",
"type": "departure"
}
]
},
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"time": {
"arrival": "2024-06-24T06:01:39Z",
"departure": "2024-06-24T06:06:39Z"
},
"load": [15, 5],
"distance": 193,
"activities": [
{
"jobId": "Job_1",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"time": {
"arrival": "2024-06-24T06:08:13Z",
"departure": "2024-06-24T06:13:13Z"
},
"load": [35, 13],
"distance": 460,
"activities": [
{
"jobId": "Job_2",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"time": {
"arrival": "2024-06-24T06:14:06Z",
"departure": "2024-06-24T06:19:06Z"
},
"load": [45, 25],
"distance": 619,
"activities": [
{
"jobId": "Job_3",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"time": {
"arrival": "2024-06-24T06:20:35Z",
"departure": "2024-06-24T06:25:35Z"
},
"load": [70, 35],
"distance": 861,
"activities": [
{
"jobId": "Job_4",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"time": {
"arrival": "2024-06-24T06:28:22Z",
"departure": "2024-06-24T06:33:22Z"
},
"load": [78, 41],
"distance": 1422,
"activities": [
{
"jobId": "Job_7",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"time": {
"arrival": "2024-06-24T06:35:01Z",
"departure": "2024-06-24T06:40:01Z"
},
"load": [90, 45],
"distance": 1689,
"activities": [
{
"jobId": "Job_8",
"type": "delivery"
}
]
},
{
"location": {
"lat": 52.53097,
"lng": 13.38504
},
"time": {
"arrival": "2024-06-24T06:41:36Z",
"departure": "2024-06-24T06:41:36Z"
},
"load": [90, 45],
"distance": 1886,
"activities": [
{
"jobId": "arrival",
"type": "arrival"
}
]
}
],
"statistic": {
"cost": 26.552,
"distance": 1886,
"duration": 2496,
"times": {
"driving": 696,
"serving": 1800,
"waiting": 0,
"break": 0
}
}
}
],
"statistic": {
"cost": 26.552,
"distance": 1886,
"duration": 2496,
"times": {
"driving": 696,
"serving": 1800,
"waiting": 0,
"break": 0
}
},
"unassigned": [
{
"jobId": "Job_6",
"reasons": [
{
"code": "CAPACITY_CONSTRAINT",
"description": "cannot be assigned due to capacity of vehicle"
}
]
},
{
"jobId": "Job_5",
"reasons": [
{
"code": "CAPACITY_CONSTRAINT",
"description": "cannot be assigned due to capacity of vehicle"
}
]
}
]
}REACHABLE_CONSTRAINT
The job location is not reachable by any vehicle.
Possible causes:
- Live traffic conditions block access (for example, construction or incidents)
- The location is restricted for the vehicle type (for example, trucks on residential roads)
- The vehicle cannot access the job location as it is located within the avoid area configured for the vehicle profile
- The routing network does not include roads to reach the location
Troubleshooting steps:
- Switch to historic traffic data to avoid temporary traffic incidents
- Verify the job location coordinates are correct
- Use a different vehicle profile if restrictions apply (for example, use
carinstead oftruck) - Check whether the location is accessible through the road network
For more information, see Understand traffic modes.
REACHABLE_CONSTRAINT example:
The following section shows a sample problem configured to leave jobs unassigned due to the REACHABLE_CONSTRAINT. In this example, the car profile includes an avoid bounding box that encompasses the Job_8 location, as shown in the following example:
This makes the job unreachable because the service cannot route the vehicle profile through avoid areas. When you submit this problem, the solution shows Job_8 as unassigned because the vehicle profile restrictions prevent access to this location.
REACHABLE_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car",
"avoid": {
"areas": [
{
"type": "boundingBox",
"north": 52.531,
"south": 52.5295,
"west": 13.3825,
"east": 13.3845
}
]
}
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "REACHABLE_CONSTRAINT",
"description": "location unreachable"
}
]
}
]
}MAX_DISTANCE_CONSTRAINT
The vehicle would exceed its maximum allowed distance to serve this job.
Possible causes:
- The vehicle's maximum distance limit is too restrictive for the job distribution
Troubleshooting steps:
- Increase the maximum distance limit for vehicles if operationally feasible
- Add more vehicles with sufficient distance limits
- Relocate the vehicle depot closer to the job locations
- Remove distant outlier jobs from the problem or handle them separately
MAX_DISTANCE_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the MAX_DISTANCE_CONSTRAINT. In this example, the maximum distance limit for the vehicle is set to 2000 meters, which is insufficient to serve all jobs. When you submit this problem, the solution will show at least one job as unassigned with the reason code MAX_DISTANCE_CONSTRAINT.
MAX_DISTANCE_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1,
"limits": {
"maxDistance": 2000
}
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "MAX_DISTANCE_CONSTRAINT",
"description": "cannot be assigned due to max distance constraint of vehicle"
}
]
}
]
}SHIFT_TIME_CONSTRAINT
The vehicle cannot complete the job within its allowed shift time.
Possible causes:
- The vehicle has already used most of its maximum shift time
- Adding this job would cause the vehicle to exceed its maximum working hours
- The job is located too far to serve within the remaining shift time
Troubleshooting steps:
- Extend vehicle shift times if the local labor rules permit
- Add more vehicles to distribute the workload
- Remove or defer lower-priority jobs to free up shift time
- Reduce service durations for other jobs if they are overestimated
For more information, see:
SHIFT_TIME_CONSTRAINT example:
The following section shows a sample problem configured to leave jobs unassigned due to the SHIFT_TIME_CONSTRAINT. In this example, the vehicle type has a shiftTime limit of 2400 seconds (40 minutes) in its limits configuration, which is too short to complete all jobs. When you submit this problem, the solution shows jobs unassigned with the SHIFT_TIME_CONSTRAINT code.
SHIFT_TIME_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"limits": {
"shiftTime": 2400
},
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned jobs:
{
"unassigned": [
{
"jobId": "Job_7",
"reasons": [
{
"code": "SHIFT_TIME_CONSTRAINT",
"description": "cannot be assigned due to shift time constraint of vehicle"
}
]
},
{
"jobId": "Job_6",
"reasons": [
{
"code": "SHIFT_TIME_CONSTRAINT",
"description": "cannot be assigned due to shift time constraint of vehicle"
}
]
}
]
}LOCKING_CONSTRAINT
The job cannot be assigned because it conflicts with a relation that locks other jobs to a specific vehicle.
Possible causes:
- A
sequencerelation locks jobs to a vehicle in a strict order, and this job is not included in the sequence - The relation includes
departureandarrivalactivities, creating boundaries that prevent other jobs from being inserted - The job is excluded from a relation but needs to be assigned to the same vehicle that's already locked with other jobs
Troubleshooting steps:
- Add the job to the existing relation if it should be part of the locked sequence
- Remove the
departureand/orarrivalactivities from the relation to allow more flexibility - Change the relation type from
sequencetotourto allow jobs in any order (orflexibleto allow insertions between locked jobs) - Assign the job to a different vehicle by adding it to a separate relation
- Remove the relation if strict ordering is not required
For more information, see Use relations to replan tours.
LOCKING_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the LOCKING_CONSTRAINT. In this example, a sequence relation locks seven jobs (Job_1 through Job_7) to vehicle_1_1 in a specific order. Job_8 is not included in the relation, and because the relation enforces a strict sequence that must include departure and arrival activities, Job_8 cannot be inserted into the locked sequence. When you submit this problem, the solution shows Job_8 as unassigned with the reason code LOCKING_CONSTRAINT.
LOCKING_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [14],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
],
"relations": [
{
"type": "sequence",
"jobs": ["departure", "Job_1", "Job_2", "Job_3", "Job_4", "Job_5", "Job_6", "Job_7", "arrival"],
"vehicleId": "vehicle_1_1"
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "LOCKING_CONSTRAINT",
"description": "cannot be assigned due to relation lock"
}
]
}
]
}TOUR_ORDER_CONSTRAINT
The job violates a tour order constraint, typically due to conflicting task position requirements.
Possible causes:
- A multi-job has pickup and delivery tasks with reversed position values (delivery before pickup)
- The job's ordered task positions conflict with other jobs' position requirements in the tour
- The defined order cannot be satisfied given the tour sequence
Troubleshooting steps:
- Ensure pickup tasks have lower position values than delivery tasks in multi-jobs
- Remove or adjust position constraints that create impossible ordering requirements
- Use the
optimizeTaskPositionobjective to allow the solver more flexibility - Review the order requirements to ensure they are operationally necessary
For more information, see Control job task position.
TOUR_ORDER_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the TOUR_ORDER_CONSTRAINT. In this example, Job_6 and Job_7 have ordered positions, and Job_8 is a multi-job with both pickup and delivery tasks where the delivery (position 1) must occur before the pickup (position 2). This reversed order within the multi-job conflicts with the natural pickup-before-delivery requirement, causing the job to be unassigned. When you submit this problem, the solution shows Job_8 as unassigned with the reason code TOUR_ORDER_CONSTRAINT.
TOUR_ORDER_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
8
],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
],
"position": {
"type": "ordered",
"value": 1
}
}
]
}
},
{
"id": "Job_7",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
],
"position": {
"type": "ordered",
"value": 2
}
}
]
}
},
{
"id": "Job_8",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
],
"position": {
"type": "ordered",
"value": 2
}
}
],
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530744,
"lng": 13.384912
},
"duration": 300
}
],
"demand": [
1
],
"position": {
"type": "ordered",
"value": 1
}
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "TOUR_ORDER_CONSTRAINT",
"description": "cannot be assigned due to tour order constraint"
}
]
}
]
}MAX_STOPS_CONSTRAINT
Adding this job would exceed the vehicle's maximum allowed number of stops.
Possible causes:
- The vehicle has reached its stop limit
- The fleet-wide stop configuration is too restrictive
Troubleshooting:
- Increase the maximum number of stops for vehicles
- Add more vehicles to the fleet
- Remove lower-priority jobs to stay within the limit
For more information, see Set maximum number of stops.
MAX_STOP_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the MAX_STOPS_CONSTRAINT. Because the maximum limit is set to 7 and the total number of jobs to serve is 8, the optimization algorithm will leave one job unassigned.
MAX_STOPS_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
8
],
"amount": 1,
"limits": {
"stops": {
"maxCount": {
"value": 7
}
}
}
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "MAX_STOPS_CONSTRAINT",
"description": "cannot be assigned due to exceeding the maximum number of stops"
}
]
}
]
}MIN_STOPS_CONSTRAINT
The job cannot be assigned to a vehicle because there are not enough other jobs available for that vehicle to reach its minimum required number of stops.
Possible causes:
- The vehicle has a minimum stop requirement (for example, 10 stops) for cost efficiency
- Assigning this job to the vehicle would leave it with fewer stops than required
- There are insufficient jobs in total or available to this specific vehicle to meet the minimum
Troubleshooting steps:
- Add more jobs to the problem to allow vehicles with minimum stop requirements to reach their minimums
- Reduce or remove the minimum stop constraint if the vehicle can operate with fewer stops
- Assign vehicles without minimum stop requirements to handle jobs when demand is low
- Ensure enough jobs match the vehicle's constraints (skills, territory, time windows) to reach the minimum
For more information, see Set minimum number of stops.
MIN_STOPS_CONSTRAINT example:
The following snippet shows a sample problem configured to leave jobs unassigned due to the MIN_STOPS_CONSTRAINT. In that problem, the minimal required number of stops for the vehicle type is set to 10, while the total number of jobs in the problem is 8. Therefore, when you run this problem, the optimization algorithm will not assign any jobs to the vehicle.
MIN_STOPS_CONSTRAINT example problem
{
"configuration": {
"experimentalFeatures": [
"minStops"
]
},
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
8
],
"amount": 1,
"limits": {
"stops": {
"minCount": {
"value": 10
}
}
}
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [
1
]
}
]
}
}
]
}
}TERRITORY_CONSTRAINT
The job cannot be assigned due to territory restrictions.
Possible causes:
- The job is assigned a territory ID that the vehicle is not allowed to serve
- The territory that the vehicle is assigned to serve is configured as
strict
Troubleshooting steps:
- Assign vehicles that are authorized to serve the job's territory
- Adjust territory definitions to allow more flexibility by removing the
strictconstraint
For more information, see Optimize tours by territories.
TERRITORY_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the TERRITORY_CONSTRAINT. In this example, the vehicle is configured to serve only territory zone_north, but Job_8 is assigned to territory zone_south. Because the vehicle cannot serve jobs outside its designated territory because of the "strict": true setting, Job_8 remains unassigned. When you submit this problem, the solution shows Job_8 as unassigned with the reason code TERRITORY_CONSTRAINT.
TERRITORY_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
8
],
"amount": 1,
"territories": {
"strict": true,
"items": [
{
"id": "zone_north"
}
]
}
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300,
"territoryIds": ["zone_north"]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300,
"territoryIds": ["zone_south"]
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "TERRITORY_CONSTRAINT",
"description": "cannot be assigned due to territory constraint"
}
]
}
]
}UNREACHABLE_IN_RELATION_CONSTRAINT
The job cannot be assigned because it is part of a relation and its location is unreachable by the vehicle.
Possible causes:
- The job is included in a relation (
sequence,flexible, ortour) and falls within an unreachable area for the vehicle, for example:- An avoid area defined in the vehicle profile
- The vehicle profile restrictions (truck routes, avoid areas) prevent reaching the job location
- The routing network does not include roads to reach the location, and the relation prevents reassigning to a different vehicle
Troubleshooting steps:
- Remove the job from the relation if it doesn't need to be tied to a specific vehicle or sequence
- Adjust or remove the avoid areas in the vehicle profile to allow access to the job location
- Verify the job location coordinates are correct
- Use a different vehicle profile if restrictions apply (for example, use
carinstead oftruck) - If the job must remain in the relation, ensure its location is accessible by the assigned vehicle
For more information, see Use relations to replan tours.
UNREACHABLE_IN_RELATION_CONSTRAINT example:
In this example, a sequence relation requires Job_8 to be served before the vehicle returns to depot (arrival). However, Job_8's location falls within an avoided bounding box area defined in the vehicle profile, making it unreachable. The combination of being part of a relation AND being unreachable triggers UNREACHABLE_IN_RELATION_CONSTRAINT.
UNREACHABLE_IN_RELATION_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car",
"avoid": {
"areas": [
{
"type": "boundingBox",
"north": 52.531,
"south": 52.5295,
"west": 13.3825,
"east": 13.3845
}
]
}
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
],
"relations": [
{
"type": "sequence",
"jobs": [
"Job_8",
"arrival"
],
"vehicleId": "vehicle_1_1"
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "UNREACHABLE_IN_RELATION_CONSTRAINT",
"description": "cannot be assigned due to being unreachable and in a relation"
}
]
}
]
}MIXING_RESTRICTION_CONSTRAINT
The job cannot be assigned because it violates mixing restrictions that prohibit certain categories of goods from being transported together.
Possible causes:
- The job's category conflicts with categories already assigned to the vehicle tour (when
levelistour) - The job's category conflicts with categories currently on the vehicle (when
levelissubTour) - Multiple jobs with conflicting categories compete for the same vehicle
- The vehicle's mixing restrictions are too restrictive for the job mix
Troubleshooting steps:
- Add more vehicles or shifts to separate conflicting categories
- Change the mixing restriction level from
tourtosubTourto allow sequential handling of different categories - Remove or modify category assignments if they are not operationally necessary
- Adjust the
conflictingCategorieslists to allow compatible goods to travel together - Review whether jobs can be scheduled to avoid simultaneous transport of restricted categories
For more information, see Define mixed load restrictions.
MIXING_RESTRICTION_CONSTRAINT example:
In this example, mixing restrictions are defined at the tour level, prohibiting the vehicle from transporting both perishable and electronics categories during the same tour. Job_1 through Job_7 are assigned to the perishable category, while Job_8 is assigned to the electronics category. Since the vehicle can only serve one restricted category per tour, Job_8 becomes unassigned.
MIXING_RESTRICTION_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T07:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"mixingRestrictions": {
"level": "tour",
"restrictions": [
{
"conflictingCategories": [
"perishable",
"electronics"
]
}
]
}
}
],
"capacity": [8],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"category": "perishable",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"category": "electronics",
"tasks": {
"pickups": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "MIXING_RESTRICTION_CONSTRAINT",
"description": "cannot be assigned due to job mixing restriction"
}
]
}
]
}GROUP_CONSTRAINT
The job cannot be assigned because all jobs in a group must be served by a single vehicle sequentially, but the vehicle capacity or other constraints prevent serving all jobs from this group.
Possible causes:
- The total demand of all jobs in the group exceeds the capacity of a single vehicle
- The group has more jobs than can fit within a vehicle's capacity, shift time, or distance limits
- All available vehicles lack sufficient capacity to serve the complete group
Troubleshooting steps:
- Increase vehicle capacity to accommodate all jobs within a group
- Split large groups into smaller groups that fit within vehicle constraints
- Add more vehicles with sufficient capacity to handle complete groups
- Reduce the number of jobs per group or the demand per job
- Adjust shift times or distance limits to allow vehicles to complete entire groups
- Remove group assignments if service by a single vehicle is not operationally necessary
For more information, see Control job distribution through groups.
GROUP_CONSTRAINT example:
The following section shows a sample problem configured to leave jobs unassigned due to the GROUP_CONSTRAINT. In this example, three groups (A, B, and C) are defined with eight jobs total. Group A contains three jobs (Job_1, Job_3, Job_5), group B contains three jobs (Job_6, Job_7, Job_8), and group C contains two jobs (Job_2, Job_4). Each vehicle has a capacity of two units, and four vehicles are available.
Since all jobs from the same group must be completed before jobs from a different group can commence, and groups A and B each have three jobs while vehicle capacity is only two units, some group jobs cannot all be assigned to a single vehicle. When you submit this problem, the solution shows two jobs as unassigned with the reason code GROUP_CONSTRAINT.
GROUP_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [
2
],
"amount": 4
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300,
"groupId": "A"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300,
"groupId": "C"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300,
"groupId": "A"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300,
"groupId": "C"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300,
"groupId": "A"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300,
"groupId": "B"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300,
"groupId": "B"
}
],
"demand": [
1
]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300,
"groupId": "B"
}
],
"demand": [
1
]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned jobs:
{
"unassigned": [
{
"jobId": "Job_5",
"reasons": [
{
"code": "GROUP_CONSTRAINT",
"description": "cannot be assigned due to group constraint"
}
]
},
{
"jobId": "Job_8",
"reasons": [
{
"code": "GROUP_CONSTRAINT",
"description": "cannot be assigned due to group constraint"
}
]
}
]
}MAX_TIME_ON_VEHICLE_CONSTRAINT
The job cannot be assigned because the time it would spend on the vehicle exceeds the maximum allowed time.
Possible causes:
- The
maxTimeOnVehiclesetting for the job is too restrictive given the tour structure - The distance between pickup and delivery locations requires more travel time than allowed
- Other job service times and driving times between stops push the job's time on vehicle over the limit
- The vehicle must serve other jobs between pickup and delivery, increasing total time on vehicle
Troubleshooting steps:
- Increase the
maxTimeOnVehiclevalue to allow more time between pickup and delivery - Reduce service durations for other jobs to decrease total time on vehicle
- Remove the
maxTimeOnVehicleconstraint if it is not operationally necessary
For more information, see Limit maximum time on vehicle.
MAX_TIME_ON_VEHICLE_CONSTRAINT example:
The following section shows a sample problem configured to leave jobs unassigned due to the MAX_TIME_ON_VEHICLE_CONSTRAINT. In this example, Jobs 1 through 5 each have maxTimeOnVehicle set to 900 seconds (15 minutes). When the vehicle loads all jobs at departure, the cumulative time spent on vehicle exceeds the 900-second limit for some jobs in the tour, which results in unassigned jobs with the MAX_TIME_ON_VEHICLE_CONSTRAINT reason code.
MAX_TIME_ON_VEHICLE_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"maxTimeOnVehicle": 180,
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"maxTimeOnVehicle": 180,
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"maxTimeOnVehicle": 180,
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned jobs:
{
"unassigned": [
{
"jobId": "Job_2",
"reasons": [
{
"code": "MAX_TIME_ON_VEHICLE_CONSTRAINT",
"description": "cannot be assigned due to max time on vehicle restriction"
}
]
},
{
"jobId": "Job_1",
"reasons": [
{
"code": "MAX_TIME_ON_VEHICLE_CONSTRAINT",
"description": "cannot be assigned due to max time on vehicle restriction"
}
]
}
]
}MAX_DRIVING_TIME_CONSTRAINT
The job cannot be assigned because adding it would cause the vehicle to exceed its maximum allowed driving time.
Possible causes:
- The vehicle's
maxDrivingTimelimit is too restrictive for the number of jobs - The cumulative driving time for assigned jobs plus this job exceeds the limit
- Jobs are located far apart, requiring excessive driving time between stops
- The driving time limit does not account for the total distance coverage required
Troubleshooting steps:
- Increase the
maxDrivingTimelimit in the vehicle type'slimitsconfiguration - Add more vehicles to distribute the workload and reduce driving time per vehicle
- Remove or defer lower-priority jobs to stay within the driving time limit
- Optimize job locations or clustering to reduce total driving time
MAX_DRIVING_TIME_CONSTRAINT example:
The following section shows a sample problem configured to leave a job unassigned due to the MAX_DRIVING_TIME_CONSTRAINT. In this example, the vehicle type has a maxDrivingTime limit of 400 seconds (unrealistic value, used for demonstrative purposes only) in its limits configuration. The vehicle can serve seven jobs within this limit, but adding the eighth job would push the total driving time past the 400-second threshold. When you submit this problem, the solution shows Job_8 as unassigned with the reason code MAX_DRIVING_TIME_CONSTRAINT.
MAX_DRIVING_TIME_CONSTRAINT example problem
{
"fleet": {
"types": [
{
"id": "vehicle_1",
"profile": "car",
"costs": {
"fixed": 10.0,
"distance": 0.001,
"time": 0.002
},
"shifts": [
{
"start": {
"time": "2024-06-24T06:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
},
"end": {
"time": "2024-06-24T20:00:00Z",
"location": {
"lat": 52.53097,
"lng": 13.38504
}
}
}
],
"capacity": [8],
"amount": 1,
"limits": {
"maxDrivingTime": 400
}
}
],
"profiles": [
{
"type": "car",
"name": "car"
}
]
},
"plan": {
"jobs": [
{
"id": "Job_1",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.531757,
"lng": 13.384426
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_2",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532983,
"lng": 13.38787
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_3",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.532065,
"lng": 13.389091
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_4",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530384,
"lng": 13.391224
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_5",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530008,
"lng": 13.389562
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_6",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.529496,
"lng": 13.385547
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_7",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.528909,
"lng": 13.385381
},
"duration": 300
}
],
"demand": [1]
}
]
}
},
{
"id": "Job_8",
"tasks": {
"deliveries": [
{
"places": [
{
"location": {
"lat": 52.530533,
"lng": 13.383505
},
"duration": 300
}
],
"demand": [1]
}
]
}
}
]
}
}The following excerpt from the solution shows the constraint violation message for the unassigned job:
{
"unassigned": [
{
"jobId": "Job_8",
"reasons": [
{
"code": "MAX_DRIVING_TIME_CONSTRAINT",
"description": "cannot be assigned due to max driving time constraint of vehicle"
}
]
}
]
}NO_REASON_FOUND
This occurs when the optimization algorithm could not identify a specific reason for the job being unassigned.
Possible causes:
- You can encounter unassigned jobs with this reason when the cause is ambiguous or when multiple interacting constraints prevent assignment without a clear primary reason.
Troubleshooting steps:
- Review the problem definition for multiple conflicting constraints
- Verify that job and vehicle definitions are complete and correct
- Simplify the problem by temporarily removing optional constraints to identify the root cause
Next steps
For information on request-level issues, see API errors.
Updated 25 days ago