Vehicles
A vehicle represents a driver or truck with a start location, optional end location, capacity, and working shifts.- start / end — depot locations as
[longitude, latitude]. Ifendis omitted, the vehicle returns tostart. - shifts — working time windows (ISO 8601). At least one shift is required.
- capacity — per-dimension limits, e.g.
[100]for weight or[50, 30]for weight + volume. - skills — capability tags. A vehicle can only serve jobs whose required skills are a subset of the vehicle’s skills.
- max_distance / max_duration — optional route length limits.
Jobs
A job is a task to be performed at a location — a delivery, pickup, or service visit.- location —
[longitude, latitude](GeoJSON order) - demand — capacity consumed per dimension
- service_duration — time in seconds spent at the location
- time_windows — when the job can be served (ISO 8601
from/topairs) - skills — required vehicle capabilities
- committed_vehicle — optionally lock a job to a specific vehicle ID
Distance matrices
V3 automatically fetches road-network distance and duration matrices from Solvice Maps. You don’t need to provide a matrix unless you have custom distances. To supply a custom matrix, include it inoptions.matrix:
Constraints
The solver respects these constraints (hard — never violated):| Constraint | Description |
|---|---|
| Capacity | Vehicle load never exceeds capacity on any dimension |
| Time windows | Jobs served within their allowed time windows |
| Skills | Vehicle must have all skills required by the job |
| Vehicle range | Maximum distance or duration per route |
| Sequence | Job A must be served before job B on the same route |
| First job | A job must be the first stop on its route |
| Committed vehicle | A job must be assigned to a specific vehicle |
Objective
The solver minimizes a lexicographic objective:- Minimize unassigned jobs (highest priority — assign as many jobs as possible)
- Minimize cost (weighted sum of travel time or distance, and number of vehicles)
Relations
Relations express ordering or grouping constraints between jobs:| Type | Meaning |
|---|---|
SEQUENCE | Jobs must appear in the listed order on the same route |
FIRST_JOB | Each listed job must be the first stop on its route |