V3 is in beta. General availability (GA) is planned for 1 December 2026.
This page describes the V3 API (
/v3/routing). For the V2 API (/v2/vrp), see the V2 version of this page.POST /v3/routing/solve, the priority field you use to rank required tasks, and the cost model behind summary.score.
On this page a task is a job or a shipment.
How plans are compared
Every plan has ascore with three figures, compared in a fixed order. A later figure only matters when the earlier ones are equal.
violation_count: the number of hard-constraint violations. A solve result never breaks a hard constraint on its own, so this is0on/v3/routing/solveunless apinnedplan stop forces a relation breach. It can be non-zero on/v3/routing/evaluate, which scores a plan you supply.unassigned_priority: the summedpriorityof the required tasks left unassigned. Less is better, and no amount of money outweighs it: the solver never leaves a required task out to save cost.cost: money, in your currency. Travel, time, vehicle charges, every soft-constraint price, and thedrop_costof each optional task the plan chose not to serve.
unassigned_priority there is one figure: V3 ranks allowed plans by one currency-denominated total, so fewer vehicles, less travel and less waiting are prices that add up. That gives you one number to explain, and trade-offs that are priced explicitly: components shows what each term cost, and a plan’s shape is changed by changing a price.
summary.score. currency echoes objective.currency and is omitted when you did not send one.
Every price at a glance
Each row is one field ofobjective or of costs. The seven costs fields can be set on objective.costs (fleet), vehicles[].costs (vehicle) and shifts[].costs (shift), except per_used_vehicle, which has no shift level; a lower level replaces the one above it for that field only. Every amount is a plain number in your currency, and every component below is a currency amount in summary.score.components.
Prices that sit on a task, a vehicle or a depot rather than on
objective (drop_cost, time_windows[].choice_cost, target.per_late_hour, preferred_tags[].violation_cost, preferences[].violation_cost, assignment_costs[].cost, depots[].per_reload) are listed under Reading summary.score.components.
You control, the engine controls
Every trade-off below
unassigned_priority follows from the prices you set or the documented defaults, and components shows the result term by term.
Worked example: one price flips the plan
Three jobs around one depot at[3.7000, 51.0000], 10 minutes of service each, travel in a straight line at the default 50 km/h. job-c cannot be served before 09:30. Two vans start and end at the depot: van-1 works 08:00 to 17:00, van-2 only 09:30 to 10:00.
- Plan A, two routes.
van-1servesjob-athenjob-band is back at 08:39;van-2servesjob-cat 09:35. 24.9 km, no waiting. - Plan B, one route.
van-1servesjob-a,job-b, thenjob-c: it arrives at 08:37 and waits 53 minutes for the window. 18.7 km, but a route span of 1 h 45.
objective sent, the defaults apply (35 per hour, 0.20 per km, 0 per route):
Plan A wins. Plan B saves 6.2 km (1.23) but its 53 minutes of waiting sit inside the span, charged at 35 per hour, so its
time is 26.55 higher.
With per_route: 50.0:
Plan B wins: the second route now costs 50, and Plan A’s 25.31 advantage in time and distance does not cover it. Any
per_route above 25.31 flips this pair; below it, two routes stay cheaper. No tier changed, no flag was set: one price moved, and the total ranked the plans the other way.
These figures were returned by POST /v3/routing/evaluate on the two plans above. POST /v3/routing/solve on the same problem returns Plan A with no objective and Plan B with per_route: 50.0.
Priority: which tasks are kept when not all fit
Every task is required unless it carries adrop_cost. When the fleet cannot serve all required tasks, priority decides which ones the solver keeps.
Importance of a required task, from
1 to 100000000000000 (1e14). Also available as shipments[].priority. The solver maximizes the summed priority of the tasks it serves before it looks at cost.boiler-repair ranks higher: it leaves routine-check in unassigned[] with unassigned_priority: 1, where the alternative would score 5.
- A rank, not money. Priority is never traded against cost, and it never makes a task optional.
- It is a sum. Leaving out two priority-1 tasks (
unassigned_priority: 2) ranks better than leaving out one priority-3 task (unassigned_priority: 3). With every priority at the default of1,unassigned_priorityis the number of required tasks left out. A shipment counts once. - Not with
drop_cost. A task with adrop_costis optional and priced in money, so it has no priority: sending both is rejected with HTTP 400. So is aprioritybelow1or above100000000000000, with the pointer/problem/jobs/{i}/priority. - Optional tasks are not counted here. A task left out for its
drop_costadds the fee tocost(undercomponents.drop_costs), not tounassigned_priority.
Packing ranked goals into one priority
priority is one number, but you can rank several goals with it by packing them into that number. The 1e14 cap leaves room for three or four levels on a day of thousands of tasks.
The rule: list your goals from most to least important. One unit of a level must exceed the largest sum that all the lower levels can add up to across the whole request. The solver then never gains on a higher level by giving up a lower one, so plans rank level by level, like a sorted list.
For a request with at most N tasks and a bottom level that takes values 1 to R:
A task’s
priority is rank + U + (flagged ? K : 0). The largest value is R + U + K, and it must stay at or below 100000000000000. With the smallest valid weights, 20,000 tasks and ranks up to 10,000 give U = 200,000,001, K = 4,000,200,020,001 and a largest value near 4.0e12, far under the cap.
Worked example: a field-service day. The goals, in order: serve the most jobs, then keep jobs locked to a fixed time, then drop the jobs with the lowest drop order first. With up to 2,000 jobs and drop order 1 to 1,000 (a higher number keeps the job longer), take U = 2,001,000 and K = 4,005,000,000:
- One more job (
2,001,000) outweighs any change in drop order across 2,000 jobs, which is at most2,000 × 1,000 = 2,000,000. - One lock (
4,005,000,000) outweighs 2,000 jobs at any rank, which is at most2,000 × 2,002,000 = 4,004,000,000. - The largest value is
4,007,002,000. The recipe is valid for up to 2,000 jobs per request; for more, recomputeUandKfor the newN.
fixed-visit is time-locked with drop order 1000. The other two are not locked, with drop order 1000 and 1.
Read the plan, not the sum. summary.score.unassigned_priority adds up the packed values of the tasks left out. Do not decode it back into levels. A single priority is safe in JavaScript (1e14 is below 2^53), but a sum can pass 9,007,199,254,740,991, and JavaScript loses precision above that. Read summary.tasks for the counts and unassigned[] for which tasks were left out, and look their ids up in your own table of locks and ranks.
What packing cannot do:
- A level below cost never acts. Priority is compared before cost, so every packed level outranks cost. A goal that should lose to cost cannot be a level. Use
drop_costor the cost fields for it. - It ranks plans; it does not find them. Packing says which plan is better, not that the search reaches it. Asking the solver to place only some of a group, such as some crews, on a day that is over capacity is a search problem that a priority value does not solve.
What you set: costs at three levels
objective.costs and vehicles[].costs take the same nine fields; shifts[].costs takes the same minus per_used_vehicle, because a shift is one of a vehicle’s days. Each field resolves on its own: the shift’s value, else the vehicle’s, else the fleet’s, else the default. A value set lower down replaces the one above it; nothing is added on top, and every field is reported under the same score.components key at every level.
These settings sit on
objective itself, not in costs:
A worked example, with no
objective sent so the default fleet rates apply:
time.span_s: 7200) and drives 40 km, the score reads:
time is the vehicle’s own 30 per hour, which replaces the fleet’s 35, distance is 40 km at the fleet’s 0.20, and routes is the fleet’s default of 0.
time is 59.976, not 60.0. Hourly rates are rounded to a per-second rate with five decimals, and per-kilometre rates to a per-metre rate with five decimals, so 30 per hour is charged as 0.00833 per second. Expect differences of a few cents when you re-derive a cost by hand. A non-zero rate too small to survive that rounding is rejected with HTTP 400.Combinations that are rejected
Each of these returns HTTP 400 with a message describing the problem:objective.per_late_hour: 0.0. Omit the field to keep time windows hard. Every other rate accepts0.0as “priced at zero”.- A negative rate.
objective.per_delay_workdaytogether with anydrop_cost.
Reading summary.score.components
All components are always present, 0.0 when nothing priced them, and they add up to score.cost exactly.
time is priced on each route’s span, reported as routes[].time.span_s. summary.time.travel_s and routes[].time.travel_s are driving time only, so time cannot be re-derived from them.Because the span already includes waiting, an idle second is charged by per_route_hour and again by per_wait_hour when both are set. Set per_wait_hour to the premium you want on top of the hourly rate, not to the full cost of idling.The span includes driving too, so a driving second costs per_route_hour + per_drive_hour. per_route_hour also charges waiting, so it can buy less waiting with more driving. To minimise driving without charging waiting, price driving alone: send per_route_hour: 0 with per_drive_hour; per_travel_km still prices the distance (default 0.20), so send per_travel_km: 0 to price driving time alone.If you set nothing: the V3 defaults
The defaults are plain numbers in whatever currency you work in. Each rate keeps its default until you set that rate: sending only
per_travel_km leaves per_route_hour at 35.
Vehicle count is free until you price it
By default nothing is charged for using a vehicle, so the solver opens another route whenever that lowers the plan’scost, however small the saving.
There is no flag for this: the vehicle count goes down only when vehicles have a price.
To make fleet size matter, price it. Fleet-wide, in the objective object:
vehicles[].costs.per_route, when vehicles really cost different amounts. A vehicle’s own per_route replaces the fleet per_route for that vehicle; its other rates leave the fleet per_route in place.
Once a price exists, the trade-off is ordinary arithmetic. At 150 per vehicle with those travel rates, an extra route pays for itself only when it saves more than about 750 km (750 × 0.20 = 150) or about 4.3 hours (4.3 × 35 ≈ 150) elsewhere. A smaller saving does not, and the solver keeps the routes consolidated.
Droppable tasks: drop_cost
The only way to make a task optional is to say what leaving it unserved costs you.
drop_cost: the price of not serving the task, in the same currency asobjective.costs. It is part ofcost, so the task is served exactly while serving it costs less than the fee. Fees the plan paid are reported incomponents.drop_costs. On a shipment the fee covers the pair and is charged once.- A task without a
drop_costis required.
job-1 is required. job-2 may be left out for 1000 when serving it would cost more than that. Pricing is per task; there is no fleet-wide drop price.
Because a paid fee is inside cost, costs stay comparable between plans that serve different sets of optional tasks.
Diagnosing unassigned tasks: unassigned[]
Each task left out comes back in unassigned[] with a category (impossible, blocked, priced_out or time_limit), machine-readable reasons[], and relaxations[] suggesting the smallest change that would let it fit. Cost tuning does not rescue a task that a hard constraint blocks, so read these before you adjust rates. How constraints work explains how to read an entry, and Errors lists every category and reason code.
Tuning for business goals
”I want the fewest vehicles, and I know what a vehicle costs me”
Setvehicles[].costs.per_route to your real cost per vehicle per shift, or objective.costs.per_route for one fleet-wide figure. The larger it is relative to the travel rates, the more the solver consolidates.
per_route is charged for every used shift, so a vehicle that works five days pays it five times, the same as five vehicles working one day each. If your vehicles work several shifts and you want as few distinct vehicles as possible, set costs.per_used_vehicle as well: it is charged once per vehicle that serves anything, on objective.costs or vehicles[].costs.
”My subcontractors are paid per stop, with a minimum per round”
Setper_stop and min_billed_stops on the subcontracted vehicles. A used shift pays per_stop for each stop it serves, or for min_billed_stops stops when it serves fewer; a shift left unused pays nothing.
components.stops; a round of 50 stops, 125. The minimum prices a route, it does not force one: the solver may still plan a short round, or leave the shift unused, when that is cheaper overall. The minimum applies per shift, not per trip of a multi-trip shift. per_route: 0.0 here keeps a fleet per_route from applying on top.
”I want the cheapest routes and do not care about vehicle count”
Set nothing per vehicle. That is the default.”Driver time matters more than distance” (or the reverse)
Setper_travel_km to 0.0 and per_route_hour to your real hourly rate, or the other way round.
”Some time windows may be missed, at a price”
For individual tasks, settime_windows[].per_late_hour on the task’s window. For every task, set objective.per_late_hour. Either way the rate must be at least 0.0006; to keep windows hard, omit it. Lateness pricing applies to task windows only: a shift’s to (plus max_overtime_s) stays a hard limit. See How constraints work for all the soft levers.
”Some required jobs matter more than others”
Give them a higherpriority. When not everything fits, the solver keeps the highest summed priority.
”Some jobs are nice-to-have”
Give each adrop_cost: the amount you would rather pay than force the task onto an expensive route.
Related topics
How constraints work
Hard constraints, the soft levers that feed
cost, and the unassigned[] diagnosisConstraints
Every constraint field, with the JSON to send
Evaluate
Score a plan of your own, including its violations
Performance guide
The levers that affect solve time rather than plan shape