Optimize routes for single-vehicle tours
When you need to optimize routes for one vehicle operating independently, the HERE Tour Planning API provides the singleVehicle endpoint that is specifically designed for small fleet routing problems. This endpoint delivers faster response times and lower cost per transaction compared to the standard multi-vehicle endpoint, making it ideal for high-throughput scenarios such as driver apps, real-time route adjustments, or courier services with independent vehicle optimization.
The singleVehicle endpoint supports up to 200 tasks per request and delivers higher throughput, providing a cost-effective solution for small fleet scenarios.
Note
- For more information about the
singleVehicleendpoint pricing, contact your regional HERE representative.- The
singleVehicleendpoint is an ALPHA feature, which means it is new or experimental and under active development. Alpha features are provided for testing and feedback purposes. They may change significantly or might not become generally available.
When to use the singleVehicle endpoint
Use the singleVehicle endpoint when you want to:
- Optimize routes for a single vehicle: Plan efficient routes for individual delivery vehicles (for example, small courier operations).
- Enable driver-side re-optimization: Allow drivers to re-sequence stops in real-time through mobile applications.
- Reduce costs: Benefit from lower transaction costs compared to the multi-vehicle endpoint for small fleet scenarios.
- Handle high-volume requests: Support high-throughput scenarios with frequent route recalculations.
- Simplify routing problems: Focus on essential routing features without the complexity of multi-vehicle fleet coordination.
Supported features
The singleVehicle endpoint supports the following tour-planning features:
Objectives
You can optimize routes based on different priorities by using objectives:
minimizeUnassigned: Prioritize assigning all jobs to the vehicleminimizeCost: Minimize the total cost based on the vehicle's cost configurationminimizeDistance: Reduce the total driving distanceminimizeDuration: Minimize the total time spent on the routevisuallyAppealingTours: Optimize for routes that appear more intuitive on a map
NoteThe
visuallyAppealingToursobjective is part of theadvancedObjectivesALPHA feature which is under active development. For more information, see Objectives.
Relations
Use relations to control job execution order:
sequence: Enforce a specific order for job visitsflexible: Allow flexible sequencing within defined constraints
Vehicle and stop configuration
- Stop-based duration: Configure time spent at each stop
- Clustering nearby stops: Group geographically close jobs for walking delivery
- House keys: Handle access requirements for delivery locations
- Job categories and customer IDs: Organize and track different types of deliveries
- Side of street preferences: Specify which side of the street to approach
- Name hints: Provide location names for easier driver navigation
- Profile limits: Apply vehicle-specific constraints such as height or weight restrictions
- Mixing restrictions: Control which jobs can be combined in the same vehicle
- Service time at locations: Specify how long each stop takes
- Breaks: Schedule driver breaks during shifts
- Start and end locations: Define where the vehicle begins and ends its route
Routing and scheduling
- Traffic optimization: Use real-time or historical traffic data
- Time windows: Define when jobs must be completed
- Soft time windows: Allow flexible arrival times with penalties
Unsupported features in comparison with the multi-vehicle endpoint
The singleVehicle endpoint does not support the following features:
- Territories
- Skills
- Job order/position
- Reloads
- Multi-jobs
- Alternative locations
- Compartments
- EV charging
- Fuel
- Speed factor
- Rest times / duty rules
- Job priority, job
costFactor - Parking (
parkingIds,plan.shared) - Excess costs, cost per job, cost per waiting time
- Flexible groups
- Custom matrices
TipUse the multi-vehicle
/problemsor/problems/asyncendpoints when your routing problem requires any of these features.
Limits compared with multi-vehicle endpoints
The singleVehicle endpoint applies the following limits as compared with the standard /problems and problems/async endpoints:
| Feature | singleVehicle | Multi-vehicle endpoints |
|---|---|---|
| Rate limit | Higher throughput | Lower throughput |
| Vehicle types | Maximum 1 type | Multiple types supported |
| Vehicle instances | Maximum 1 vehicle | Multiple instances supported |
| Tasks per request | Maximum 200 tasks | 500 tasks (sync) or 7,000 tasks (async) |
| Tasks per job | Maximum 1 task (pickup or delivery) | Multiple tasks supported |
| Time windows per task | Maximum 1 time window | Multiple time windows supported |
| Shifts per vehicle | Maximum 1 shift | Multiple shifts supported |
| Breaks per shift | Maximum 1 break | Multiple breaks supported |
| Profiles per fleet | Maximum 1 profile | Multiple profiles supported |
| Capacity dimensions | Maximum 1 capacity unit | Multiple capacity dimensions supported |
| Solve time limit | Maximum 30 seconds | Maximum 300 seconds (sync) or 18,000 seconds (async) |
| Stagnation time limit | Maximum 5 seconds | Maximum 300 seconds (sync) or 18,000 seconds (async) |
| Objectives | Maximum 4 objectives | Maximum 6 objectives |
| Advanced objectives | Maximum 5 groups | Maximum 8 groups |
For more information on specific limits, see API Reference.
NoteThe
singleVehicleendpoint enforces these limits through strict request validation. If your request exceeds any of these limits, the API returns a400 Bad Requesterror with detailed information about which constraint was violated. If you're unsure whether your use case fits the endpoint constraints, start by testing with a small sample request.For more information, see Understand API errors.
Rate limiting and metering
The singleVehicle endpoint provides higher throughput compared to the standard endpoint. This higher throughput capacity is designed to support real-time use cases such as driver apps that need frequent route updates.
TipIf you are building a driver app or a system that requires frequent route recalculations, the
singleVehicleendpoint's higher rate limit and lower cost per transaction make it the preferred choice.
Scenario: Optimize a scooter delivery route in an urban area
Consider a scenario where a courier service uses scooters for last-mile deliveries. Each courier operates independently with a single scooter handling a mix of pickups and deliveries throughout the day. The service needs to optimize the route for each courier to minimize travel distance and ensure all deliveries are completed within their time windows.
In this example, a courier starts their shift at 6:00 AM and must complete 12 jobs by 4:00 PM. The route includes:
- Morning pharmacy deliveries with strict time windows (such orders that must arrive before 9:00 AM)
- Lunch-time restaurant deliveries with narrow time windows (11:30 AM to 12:30 PM for hot food)
- A mandatory lunch break between 12:00 PM and 1:00 PM
- Afternoon deliveries and pickups that can be completed anytime between 1:00 PM and 4:00 PM
- Sequence constraints where certain pickups must happen immediately before their corresponding deliveries (using relations)
- Minimization of travel distance to reduce fuel consumption and increase sustainability
The scooter has a capacity of 10 packages, and the optimization uses the minimizeDistance objective to create an eco-friendly route.
Create a sample request body
The following JSON demonstrates a typical request to the singleVehicle endpoint:
Click to expand/collapse the sample JSON
{
"objectives": [
{
"type": "minimizeUnassigned"
},
{
"type": "minimizeDistance"
}
],
"fleet": {
"types": [
{
"profile": "vehicle",
"amount": 1,
"capacity": [
10
],
"costs": {
"time": 0.005,
"distance": 0.0002,
"fixed": 100
},
"id": "vehicle_1",
"shifts": [
{
"start": {
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": "2024-12-04T06:00:00Z"
},
"end": {
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": "2024-12-04T16:00:00Z"
},
"breaks": [
{
"times": [
[
"2024-12-04T12:00:00Z",
"2024-12-04T13:00:00Z"
]
],
"duration": 1800
}
]
}
]
}
],
"profiles": [
{
"name": "vehicle",
"type": "scooter"
}
]
},
"plan": {
"jobs": [
{
"id": "pharmacy_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.8587,
"lng": 4.37958
},
"times": [
[
"2024-12-04T06:00:00Z",
"2024-12-04T09:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "pharmacy_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85649,
"lng": 4.38333
},
"times": [
[
"2024-12-04T06:00:00Z",
"2024-12-04T09:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "restaurant_pickup",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 420,
"location": {
"lat": 50.85927,
"lng": 4.3848
}
}
],
"demand": [
2
]
}
]
}
},
{
"id": "restaurant_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 180,
"location": {
"lat": 50.8612,
"lng": 4.38393
},
"times": [
[
"2024-12-04T11:30:00Z",
"2024-12-04T12:30:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "restaurant_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 180,
"location": {
"lat": 50.85973,
"lng": 4.38204
},
"times": [
[
"2024-12-04T11:30:00Z",
"2024-12-04T12:30:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "premium_package_pickup_1",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85741,
"lng": 4.38228
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "premium_package_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85511,
"lng": 4.38596
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85521,
"lng": 4.38014
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85789,
"lng": 4.38855
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_pickup_1",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85659,
"lng": 4.37964
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_3",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85937,
"lng": 4.38805
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_4",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85626,
"lng": 4.38824
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
}
],
"relations": [
{
"type": "sequence",
"jobs": [
"restaurant_pickup",
"restaurant_delivery_1",
"restaurant_delivery_2"
],
"vehicleId": "vehicle_1_1"
},
{
"type": "sequence",
"jobs": [
"premium_package_pickup_1",
"premium_package_delivery_1"
],
"vehicleId": "vehicle_1_1"
}
]
}
}Make the API call
To submit this problem to the singleVehicle endpoint, make a POST request to:
POST https://tourplanning.hereapi.com/v3/problems/singleVehicleInclude your OAuth Bearer token in the Authorization header:
Authorization: Bearer <YOUR_TOKEN>For more information about obtaining Bearer tokens and making API requests, see Get started with HERE Tour Planning API.
The following section provides the full request, as demonstrated in the previous example:
curl --location 'https://tourplanning.hereapi.com/v3/problems/singleVehicle' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_TOKEN>' \
--data '{
"objectives": [
{
"type": "minimizeUnassigned"
},
{
"type": "minimizeDistance"
}
],
"fleet": {
"types": [
{
"profile": "vehicle",
"amount": 1,
"capacity": [
10
],
"costs": {
"time": 0.005,
"distance": 0.0002,
"fixed": 100
},
"id": "vehicle_1",
"shifts": [
{
"start": {
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": "2024-12-04T06:00:00Z"
},
"end": {
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": "2024-12-04T16:00:00Z"
},
"breaks": [
{
"times": [
[
"2024-12-04T12:00:00Z",
"2024-12-04T13:00:00Z"
]
],
"duration": 1800
}
]
}
]
}
],
"profiles": [
{
"name": "vehicle",
"type": "scooter"
}
]
},
"plan": {
"jobs": [
{
"id": "pharmacy_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.8587,
"lng": 4.37958
},
"times": [
[
"2024-12-04T06:00:00Z",
"2024-12-04T09:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "pharmacy_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85649,
"lng": 4.38333
},
"times": [
[
"2024-12-04T06:00:00Z",
"2024-12-04T09:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "restaurant_pickup",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 420,
"location": {
"lat": 50.85927,
"lng": 4.3848
}
}
],
"demand": [
2
]
}
]
}
},
{
"id": "restaurant_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 180,
"location": {
"lat": 50.8612,
"lng": 4.38393
},
"times": [
[
"2024-12-04T11:30:00Z",
"2024-12-04T12:30:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "restaurant_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 180,
"location": {
"lat": 50.85973,
"lng": 4.38204
},
"times": [
[
"2024-12-04T11:30:00Z",
"2024-12-04T12:30:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "premium_package_pickup_1",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85741,
"lng": 4.38228
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "premium_package_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85511,
"lng": 4.38596
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_1",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85521,
"lng": 4.38014
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_2",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85789,
"lng": 4.38855
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_pickup_1",
"tasks": {
"pickups": [
{
"places": [
{
"duration": 300,
"location": {
"lat": 50.85659,
"lng": 4.37964
}
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_3",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85937,
"lng": 4.38805
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
},
{
"id": "afternoon_delivery_4",
"tasks": {
"deliveries": [
{
"places": [
{
"duration": 240,
"location": {
"lat": 50.85626,
"lng": 4.38824
},
"times": [
[
"2024-12-04T13:00:00Z",
"2024-12-04T16:00:00Z"
]
]
}
],
"demand": [
1
]
}
]
}
}
],
"relations": [
{
"type": "sequence",
"jobs": [
"restaurant_pickup",
"restaurant_delivery_1",
"restaurant_delivery_2"
],
"vehicleId": "vehicle_1_1"
},
{
"type": "sequence",
"jobs": [
"premium_package_pickup_1",
"premium_package_delivery_1"
],
"vehicleId": "vehicle_1_1"
}
]
}
}'Solution interpretation
The API response includes the solution JSON file whose format is identical to the one you obtain by making requests to problems or problems/async endpoints, as shown in the following example:
Click to expand/collapse the sample JSON
{
"statistic": {
"cost": 188.0456,
"distance": 6878,
"duration": 17334,
"times": {
"break": 1800,
"driving": 1288,
"serving": 3240,
"stopping": 0,
"waiting": 11006,
"intraStop": 0
},
"costs": {
"distance": 1.3756000000000002,
"fixed": 100,
"time": 86.67
},
"intraStopDistance": 0
},
"tours": [
{
"shiftIndex": 0,
"statistic": {
"cost": 188.0456,
"distance": 6878,
"duration": 17334,
"times": {
"break": 1800,
"driving": 1288,
"serving": 3240,
"stopping": 0,
"waiting": 11006,
"intraStop": 0
},
"costs": {
"distance": 1.3756000000000002,
"fixed": 100,
"time": 86.67
},
"intraStopDistance": 0
},
"stops": [
{
"activities": [
{
"jobId": "departure",
"type": "departure",
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": {
"end": "2024-12-04T08:52:23Z",
"start": "2024-12-04T06:00:00Z",
"arrival": "2024-12-04T06:00:00Z"
}
}
],
"load": [
9
],
"time": {
"arrival": "2024-12-04T06:00:00Z",
"departure": "2024-12-04T08:52:23Z"
},
"distance": 0,
"location": {
"lat": 50.85826,
"lng": 4.38365
}
},
{
"activities": [
{
"jobId": "pharmacy_delivery_2",
"type": "delivery",
"location": {
"lat": 50.85649,
"lng": 4.38333
},
"time": {
"end": "2024-12-04T08:58:23Z",
"start": "2024-12-04T08:53:23Z",
"arrival": "2024-12-04T08:53:23Z"
}
}
],
"load": [
8
],
"time": {
"arrival": "2024-12-04T08:53:23Z",
"departure": "2024-12-04T08:58:23Z"
},
"distance": 343,
"location": {
"lat": 50.85649,
"lng": 4.38333
}
},
{
"activities": [
{
"jobId": "pharmacy_delivery_1",
"type": "delivery",
"location": {
"lat": 50.8587,
"lng": 4.37958
},
"time": {
"end": "2024-12-04T09:05:00Z",
"start": "2024-12-04T09:00:00Z",
"arrival": "2024-12-04T09:00:00Z"
}
}
],
"load": [
7
],
"time": {
"arrival": "2024-12-04T09:00:00Z",
"departure": "2024-12-04T09:05:00Z"
},
"distance": 786,
"location": {
"lat": 50.8587,
"lng": 4.37958
}
},
{
"activities": [
{
"jobId": "restaurant_pickup",
"type": "pickup",
"location": {
"lat": 50.85927,
"lng": 4.3848
},
"time": {
"end": "2024-12-04T09:14:04Z",
"start": "2024-12-04T09:07:04Z",
"arrival": "2024-12-04T09:07:04Z"
}
}
],
"load": [
9
],
"time": {
"arrival": "2024-12-04T09:07:04Z",
"departure": "2024-12-04T09:14:04Z"
},
"distance": 1409,
"location": {
"lat": 50.85927,
"lng": 4.3848
}
},
{
"activities": [
{
"jobId": "restaurant_delivery_1",
"type": "delivery",
"location": {
"lat": 50.8612,
"lng": 4.38393
},
"time": {
"end": "2024-12-04T11:33:00Z",
"start": "2024-12-04T11:30:00Z",
"arrival": "2024-12-04T09:15:53Z"
}
}
],
"load": [
8
],
"time": {
"arrival": "2024-12-04T09:15:53Z",
"departure": "2024-12-04T11:33:00Z"
},
"distance": 1963,
"location": {
"lat": 50.8612,
"lng": 4.38393
}
},
{
"activities": [
{
"jobId": "restaurant_delivery_2",
"type": "delivery",
"location": {
"lat": 50.85973,
"lng": 4.38204
},
"time": {
"end": "2024-12-04T11:37:59Z",
"start": "2024-12-04T11:34:59Z",
"arrival": "2024-12-04T11:34:59Z"
}
}
],
"load": [
7
],
"time": {
"arrival": "2024-12-04T11:34:59Z",
"departure": "2024-12-04T11:37:59Z"
},
"distance": 2681,
"location": {
"lat": 50.85973,
"lng": 4.38204
}
},
{
"activities": [
{
"jobId": "break",
"type": "break",
"location": {
"lat": 50.85521,
"lng": 4.38014
},
"time": {
"end": "2024-12-04T12:30:00Z",
"start": "2024-12-04T12:00:00Z",
"arrival": "2024-12-04T12:00:00Z"
}
},
{
"jobId": "afternoon_delivery_1",
"type": "delivery",
"location": {
"lat": 50.85521,
"lng": 4.38014
},
"time": {
"end": "2024-12-04T13:05:00Z",
"start": "2024-12-04T13:00:00Z",
"arrival": "2024-12-04T11:40:41Z"
}
}
],
"load": [
6
],
"time": {
"arrival": "2024-12-04T11:40:41Z",
"departure": "2024-12-04T13:05:00Z"
},
"distance": 3577,
"location": {
"lat": 50.85521,
"lng": 4.38014
}
},
{
"activities": [
{
"jobId": "afternoon_pickup_1",
"type": "pickup",
"location": {
"lat": 50.85659,
"lng": 4.37964
},
"time": {
"end": "2024-12-04T13:11:03Z",
"start": "2024-12-04T13:06:03Z",
"arrival": "2024-12-04T13:06:03Z"
}
}
],
"load": [
7
],
"time": {
"arrival": "2024-12-04T13:06:03Z",
"departure": "2024-12-04T13:11:03Z"
},
"distance": 3941,
"location": {
"lat": 50.85659,
"lng": 4.37964
}
},
{
"activities": [
{
"jobId": "premium_package_pickup_1",
"type": "pickup",
"location": {
"lat": 50.85741,
"lng": 4.38228
},
"time": {
"end": "2024-12-04T13:15:50Z",
"start": "2024-12-04T13:11:50Z",
"arrival": "2024-12-04T13:11:50Z"
}
}
],
"load": [
8
],
"time": {
"arrival": "2024-12-04T13:11:50Z",
"departure": "2024-12-04T13:15:50Z"
},
"distance": 4200,
"location": {
"lat": 50.85741,
"lng": 4.38228
}
},
{
"activities": [
{
"jobId": "premium_package_delivery_1",
"type": "delivery",
"location": {
"lat": 50.85511,
"lng": 4.38596
},
"time": {
"end": "2024-12-04T13:21:17Z",
"start": "2024-12-04T13:17:17Z",
"arrival": "2024-12-04T13:17:17Z"
}
}
],
"load": [
7
],
"time": {
"arrival": "2024-12-04T13:17:17Z",
"departure": "2024-12-04T13:21:17Z"
},
"distance": 4666,
"location": {
"lat": 50.85511,
"lng": 4.38596
}
},
{
"activities": [
{
"jobId": "afternoon_delivery_4",
"type": "delivery",
"location": {
"lat": 50.85626,
"lng": 4.38824
},
"time": {
"end": "2024-12-04T13:26:08Z",
"start": "2024-12-04T13:22:08Z",
"arrival": "2024-12-04T13:22:08Z"
}
}
],
"load": [
6
],
"time": {
"arrival": "2024-12-04T13:22:08Z",
"departure": "2024-12-04T13:26:08Z"
},
"distance": 4919,
"location": {
"lat": 50.85626,
"lng": 4.38824
}
},
{
"activities": [
{
"jobId": "afternoon_delivery_2",
"type": "delivery",
"location": {
"lat": 50.85789,
"lng": 4.38855
},
"time": {
"end": "2024-12-04T13:33:01Z",
"start": "2024-12-04T13:28:01Z",
"arrival": "2024-12-04T13:28:01Z"
}
}
],
"load": [
5
],
"time": {
"arrival": "2024-12-04T13:28:01Z",
"departure": "2024-12-04T13:33:01Z"
},
"distance": 5428,
"location": {
"lat": 50.85789,
"lng": 4.38855
}
},
{
"activities": [
{
"jobId": "afternoon_delivery_3",
"type": "delivery",
"location": {
"lat": 50.85937,
"lng": 4.38805
},
"time": {
"end": "2024-12-04T13:38:18Z",
"start": "2024-12-04T13:34:18Z",
"arrival": "2024-12-04T13:34:18Z"
}
}
],
"load": [
4
],
"time": {
"arrival": "2024-12-04T13:34:18Z",
"departure": "2024-12-04T13:38:18Z"
},
"distance": 5805,
"location": {
"lat": 50.85937,
"lng": 4.38805
}
},
{
"activities": [
{
"jobId": "arrival",
"type": "arrival",
"location": {
"lat": 50.85826,
"lng": 4.38365
},
"time": {
"end": "2024-12-04T13:41:17Z",
"start": "2024-12-04T13:41:17Z",
"arrival": "2024-12-04T13:41:17Z"
}
}
],
"load": [
0
],
"time": {
"arrival": "2024-12-04T13:41:17Z",
"departure": "2024-12-04T13:41:17Z"
},
"distance": 6878,
"location": {
"lat": 50.85826,
"lng": 4.38365
}
}
],
"typeId": "vehicle_1",
"vehicleId": "vehicle_1_1"
}
]
}The following figure provides the solution visualization:
The solution demonstrates how the singleVehicle endpoint efficiently optimizes a scooter courier's daily route. All 12 jobs are assigned and completed in sequence, respecting all constraints:
- Time window compliance: Morning pharmacy deliveries arrive by 9:00 AM, restaurant deliveries are completed within their 11:30 AM–12:30 PM window, and afternoon jobs finish by 1:41 PM.
- Break scheduling: The mandatory 30-minute lunch break scheduled to start between 12:00 PM–1:00 PM (between rush-hour and afternoon deliveries).
- Sequence constraints: Restaurant items are picked up, then delivered in the correct order. Premium packages are picked up before delivery.
In addition, this solution showcases how minimizeDistance and minimizeUnassigned objectives work together to create an eco-friendly, high-efficiency route suitable for modern courier services.
Next steps
- For more information about request structure and available options, see the API Reference.
- To understand how to interpret the solution returned by the API, see Solution.
- To learn how to optimize routes based on different priorities, see Objectives.
- For troubleshooting unassigned jobs, see Troubleshoot unassigned jobs.
Updated 8 days ago