Route Optimization Constraints: Which Limits Are Hard

Route optimization constraints come in two kinds, and the difference decides your data model. A hard constraint makes a route invalid: Oracle's Transportation Management documentation puts it in one line, "If any route violates any applicable constraint, the route is infeasible", read on 22 November 2026. A soft constraint costs something when you miss it, so the solver weighs it against everything else and sometimes misses it on purpose.
Three hard constraints show up in almost every build. Vehicle capacity, because a van holds what it holds. Delivery time windows, because the customer is only there between two clock times. And driver hours, which are the only one of the three set by law rather than by you: in the United States, 49 CFR 395.3 gives a property-carrying driver 11 hours of driving inside a 14 consecutive hour window, read from the eCFR API on 22 November 2026.
Everything else on a typical requirements list is softer than it looks. Balanced workloads, preferred drivers, fewest left turns, lowest fuel burn. Those are objectives with weights, not limits.
The question this post answers is which is which, and what your software has to do on the day they cannot all be satisfied at once. That last part is where most route optimization projects actually fail, and it is the part the product has to surface rather than the solver.
What is route optimization?
Route optimization is the job of deciding which vehicle visits which stops, in what order, so that total cost or total time is as low as possible while every rule you declared still holds. The formal name for the problem is the vehicle routing problem, or VRP, and Google's OR-Tools documentation treats time windows and capacity as named variants of it.
Two words in that definition carry the weight. "Cost" is whatever you tell the solver to minimise, usually distance or travel time. "Rule you declared" is the constraint. Change the second and the first changes with it, which is why a shorter route is not automatically a better one.
What are constraints in optimization?
A route optimizer respects two kinds of limit. Hard constraints cannot be broken: vehicle capacity, delivery time windows, and driver hours set by regulation. Soft constraints carry a cost when missed, so the solver trades them off. When hard constraints conflict, there is no valid route at all, and the software has to say which stop it dropped.
Locus, in its constraint-based routing article read on 22 November 2026, splits them the same way and goes one level finer. It calls hard constraints Boolean, limits that must be satisfied or the path is infeasible, and gives hazmat route compliance, vehicle capacity limits and driver hour regulations as its examples. The other kind it calls quantitative, meaning they should be optimised rather than simply satisfied, and its own table adds a third, administrative, for the limits that come from a business rule rather than from the vehicle.
That article proposes four tiers rather than two, and the middle tier is the useful one. Below the non-negotiable rules it puts firm constraints, service level commitments and premium customer delivery promises, whose violations carry measurable financial penalties. Below those sit optimization targets such as carrier cost preference and route consolidation, and below those, preferences like sustainability goals and driver familiarity with a route.
Four tiers is more structure than most builds need on day one. Three is the minimum that works: cannot break, expensive to break, nice to have. If your requirements document has one flat list, you do not yet have a specification.

Three decisions hide inside the word optimize
"Add route optimization" is almost never one piece of work. It is three, and different constraints bind at each one.
Assignment decides which vehicle or which person gets a stop at all. The constraints here are about matching: does this vehicle have the right temperature control, does this driver hold the right licence, is this stop inside the territory. The breakdown of what a logistics build costs module by module separates assignment from routing for exactly this reason, and the two carry different hours. The same split shows up away from freight entirely, in how a field service build matches technicians to jobs.
Routing decides the order of the stops already assigned. This is where capacity, time windows and travel time live, and this is the part that is computationally hard.
Tracking decides what you tell everybody once the vehicle is moving. The constraints here are freshness and accuracy rather than feasibility, and they are a different build again, with its own view of how an ETA model decays with distance.
Mixing the three is the most common scoping error in this area. A team buys a routing API, discovers that nothing in it knows which driver is qualified for a hazmat load, and then writes the assignment layer anyway, late and under pressure.
Capacity is rarely one number, and that changes your schema
Capacity sounds like one number and is usually three. Weight, volume and stop count all cap a route, and a parcel round normally hits the stop count first while a pallet round hits weight first.
OR-Tools models this as a dimension, a quantity that accumulates along a route and has a maximum. The capacitated vehicle routing problem, or CVRP, is the base case: each location has a demand, each vehicle has a capacity, and the solver may not exceed it. Once you have more than one kind of cargo, that Google documentation, read on 22 November 2026, describes extending the model with separate capacity callbacks and dimensions for each type.
Write that down before anyone calls an API, because it changes your schema. One capacity field becomes a set of named dimensions with a unit each, and every stop needs a demand in every dimension. Retrofitting a second dimension after launch means touching every order record you have.
Slot capacity is the same constraint wearing different clothes. It appears as the delivery slot limits in a quick commerce build, where the cap is how many orders a window can absorb, which is capacity measured in promises rather than in kilograms. It appears a third time upstream, where what a warehouse system has to know about stock decides whether a stop can even be loaded.
A time window is two numbers, and the service time is not one of them
Customers who are only available during specific time windows are exactly what the vehicle routing problem with time windows models, per the OR-Tools VRPTW documentation read on 22 November 2026. The model carries a travel time matrix rather than a distance matrix, because the quantity being constrained is arrival time.
Three things make this harder than it reads.
The window applies to arrival, not to completion, unless you say otherwise. A 15 minute unload at a stop with a 60 minute window is 15 minutes the vehicle is not travelling, and if your model constrains only arrival, that time comes out of the slack on the stops after it rather than out of the window you declared.
Early arrival is usually not allowed either. A driver who reaches a dock 40 minutes early waits, and that wait is time the solver should have spent somewhere else. The OR-Tools VRPTW example reports a solution window at each location, the feasible arrival times inside the wider declared window, which is the number worth showing a dispatcher.
And travel time is not a fixed property of a pair of addresses. It depends on departure time, so the matrix you fetched at 06:00 is wrong by 17:00. That is a cost question as much as a modelling one, and the matrix arithmetic behind a routing API bill is what decides how often you can afford to refetch it.
Of the three hard constraints, driver hours are the one set by law
In the United States the limits on a property-carrying commercial driver are not a policy you set. They are 49 CFR 395.3, and the section opens with its own exception: "Except as otherwise provided in § 395.1". Read through the eCFR API on 22 November 2026, the section gives these figures.
Limit | Figure | The condition that comes with it |
|---|---|---|
Off duty before driving | 10 consecutive hours | Required at the start of a work shift |
Driving window | 14 consecutive hours | Begins when the driver comes on duty after 10 consecutive hours off duty |
Driving inside that window | 11 hours | A total, inside the 14 hour period |
Driving before a break | 8 hours | Except for drivers who qualify for either of the short-haul exceptions in 395.1(e)(1) or (2) |
The break itself | 30 consecutive minutes | Off duty, sleeper berth, or on duty not driving, or a combination of those |
Weekly ceiling | 60 hours in 7 consecutive days | If the carrier does not operate commercial motor vehicles every day of the week |
Weekly ceiling | 70 hours in 8 consecutive days | If the carrier does operate commercial motor vehicles every day of the week |
Restart | 34 or more consecutive hours off duty | The regulation says a period may end this way, so it is permitted, not required |
Four of those conditions are load bearing and are usually lost when somebody writes "the 60/70 hour rule" into a ticket.
The 60 and 70 hour ceilings are an either/or, and the thing that selects between them is not fleet size or state. It is whether the employing motor carrier operates commercial motor vehicles every day of the week. One field on the carrier record, set once, changes which rolling window your software has to compute.
The 30 minute break rule does not reach drivers who qualify for either of the short-haul exceptions in 395.1(e)(1) or (2). So a short-haul fleet and a long-haul fleet running on the same software need that exception as a per-driver attribute, not a global setting.
The 34 hour restart is written as something a period of 7 or 8 consecutive days may end with. Modelling it as automatic overstates how much capacity a driver has.
And the whole section is subject to 395.1. A rule engine built from the headline numbers alone will be wrong for every driver the exceptions cover.
The practical consequence for a build is that hours of service is a stateful constraint. Capacity resets when the van is emptied. A driver's 70 hour clock does not reset at the depot gate, so the optimizer needs the last 8 days of duty status for every driver before it can tell you whether tomorrow's plan is legal. That history comes out of the logging device, which is why the signals a telematics platform has to store overlap so heavily with the inputs a route optimizer needs.
A note on scope. These figures are the US rule for property-carrying vehicles and nothing else. The European driving time regulation sets different numbers, and it is deliberately absent here: the EUR-Lex copy of it returned an empty response on 22 November 2026, and quoting a figure nobody could read from the primary source is guessing with a citation attached.
How do you solve a vehicle routing problem?
You do not write the search yourself. You express the problem as a model and hand it to a solver. In practice that means four things: a travel time or distance matrix between every pair of locations, a demand per stop in each capacity dimension, the constraints as declared limits, and an objective to minimise.
OR-Tools is the usual open starting point and names the variants directly, CVRP for capacity and VRPTW for time windows. Commercial transportation management suites wrap the same idea with a fleet and scenario constraint set, which is the context for the Oracle line quoted at the top of this post. The money is not in the solver: what a transport management system costs to build puts most of the hours on the carrier and lane master data, the load tender flow and the trading partner integrations.
The work is in the inputs. A solver with a clean model and a wrong matrix returns a confident, unusable plan, and nothing in the output tells you which of the two was broken.
What happens when a problem has no solution
This is the question your product design actually turns on. The OR-Tools capacity documentation gives it a heading of its own, asking what happens if a problem has no solution, and answers that a routing problem with constraints might not have a feasible solution.
Its penalties and dropping visits page is more direct. Where the total demand at all locations exceeds the total capacity of the vehicles, it says, no solution is possible, so the vehicles must drop visits to some locations, and the problem is how to decide which visits to drop. Read on 22 November 2026.
The mechanism is a penalty per location. Drop a visit and its penalty is added to the total distance, and the solver then minimises distance plus the sum of the penalties for everything dropped. Google's own summary of that page states the trade plainly: larger penalties push the solver towards fulfilling as many deliveries as possible, while smaller penalties let it drop locations when dropping helps.
So the penalty is a business decision disguised as a solver parameter. The number you put on a dropped stop is the price you are willing to pay in distance to keep that stop. A contracted customer and a goodwill delivery should not carry the same figure, and if they do, somebody chose that by accident.
Three things follow for the product, and none of them is the solver's job.
Something has to decide the penalty per stop from data you already hold, such as contract tier or promise date. Something has to record the reason a stop was dropped, because "capacity exceeded" and "no driver hours left" send a dispatcher to two different fixes. And somebody has to be told before the vehicle leaves, which is a workflow rather than an optimization.
The constraints this post does not give you a number for
Two categories belong on a real requirements list and are missing here on purpose.
Road restrictions are real: axle weight limits, low bridges, and urban access windows that bar a vehicle class at certain hours. They are also jurisdiction by jurisdiction, and no road authority source was read for this post, so no figure is printed. Treat them as a data sourcing problem rather than a modelling one. The model is easy, a forbidden edge in the graph. The hard part is a maintained feed of which edges are forbidden for which vehicle profile today.
Savings claims are the other. Percentages for fuel or mileage reduction are easy to find in this market, and no primary source for one was read for this post, so none is printed here. If the number matters to your business case, measure it on your own routes before and after.

What to write down before anyone calls a routing API
The specification, not the integration, is the deliverable of the first week. Nine lines, and each one is a question with a single answer.
Line | The question it answers |
|---|---|
Capacity dimensions | Which quantities accumulate along a route, and in what unit |
Demand per stop | What each stop consumes in every dimension |
Time windows | Earliest and latest arrival, and whether early arrival waits |
Service time | How long the vehicle is stationary at each stop |
Vehicle profile | Which vehicle may serve which stop, and why not |
Driver eligibility | Licences, skills, territory, and the hours already worked |
Regulated hours | Which rule set applies, and which exceptions each driver qualifies for |
Objective | The single quantity being minimised |
Drop policy | The penalty per stop, and who is told when one is dropped |
The last line is the one that is almost always missing, and it is the one that turns an optimizer into a product. Coverage and beat planning for distributors is the same shape of problem in a different industry, where a stop missed this cycle has to resurface in the next one rather than disappear.
A route optimizer rarely fails by returning a bad route. It fails in one of two other ways. It returns a plan that was legal in the model and impossible on the road, because a constraint nobody wrote down turned out to be real. Or it returns nothing at all, with no explanation of which rule it could not satisfy, which leaves a dispatcher guessing at eleven at night. Both are specification failures rather than algorithm failures, and both are cheap to prevent in the week before anyone picks a solver. That holds across logistics software development generally: the rules are the build, and the solver is the easy part.
Frequently asked questions
Vehicle capacity, delivery time windows and driver hours are the three hard constraints in almost every build. Capacity is usually several limits at once, covering weight, volume and stop count. Time windows constrain arrival time rather than completion. Driver hours are set by regulation rather than by the operator, which is what makes them different from the other two.
A hard constraint makes a route invalid if broken. Oracle's Transportation Management documentation states that if any route violates any applicable constraint, the route is infeasible, read on 22 November 2026. A soft constraint carries a cost when missed, so the solver weighs it against the objective and may choose to miss it. Vehicle capacity is hard. A preferred driver is soft.
Under 49 CFR 395.3, read through the eCFR API on 22 November 2026, a property-carrying driver takes 10 consecutive hours off duty before driving, and may then drive for a total of 11 hours inside a 14 consecutive hour window. Driving is not permitted once more than 8 hours of driving time have passed without a consecutive 30 minute interruption, except for drivers who qualify for either of the short-haul exceptions in 395.1(e)(1) or (2). The whole section opens with "Except as otherwise provided in § 395.1".
It depends on the carrier, not the driver. 49 CFR 395.3(b) sets 60 hours in any period of 7 consecutive days if the employing motor carrier does not operate commercial motor vehicles every day of the week, and 70 hours in any period of 8 consecutive days if it does. Your software needs that one fact about the carrier before it can compute either window.
There is no route that satisfies every constraint, so the software has to let stops be dropped and say which ones. Google's OR-Tools documentation explains that where total demand exceeds total vehicle capacity, no solution is possible and the vehicles must drop visits to some locations. The usual mechanism is a penalty per location, added to the route cost whenever that visit is skipped.
By setting a penalty on each one. The solver minimises travel distance plus the sum of the penalties for every dropped location, so the penalty is the price in distance you will pay to keep that stop. Google's documentation notes that larger penalties push towards serving as many deliveries as possible and smaller penalties allow dropping where it helps. Derive the figure from contract tier or promise date rather than setting it globally.
It depends which kind of API you mean. A directions or distance matrix call gives you travel times and an ordering for a handful of stops, and nothing in it enforces capacity, time windows or driver hours across a fleet or tells you which stop to drop when the plan is infeasible. A fleet routing service is a solver with a bill attached: the documentation for [Google's Route Optimization API](https://developers.google.com/maps/documentation/route-optimization/overview), read on 22 November 2026, lists vehicle capacity, time windows, and drivers' work hours and breaks among the constraints you can set. So the real choice is between running a solver such as OR-Tools yourself and paying for one, with a maps API supplying the matrix underneath either way.

Vikas Choudhary
Vikas has around fifteen years of experience building software and now builds generative AI systems at Zyneto. His work covers retrieval augmented generation, agentic AI, knowledge graphs, AI memory, and the evaluation and guardrails that decide whether any of it is safe to put in front of customers. He has shipped enterprise copilots, document AI, chatbots and predictive analytics for e-commerce, fintech and marketing teams, and works day to day in Python, JavaScript and SQL. He follows multimodal models, business process automation and enterprise AI security closely, and mentors engineers moving into AI. He writes about architecture, inference cost and the failure modes that only show up at production scale.
Zyneto builds custom software, AI and automation
Tell us what you are building and we will reply with a clear next step.









