Logistics & Mobility// definition

The travel-time matrix: the input that decides the plan

In short

A travel-time matrix is the table of durations between every pair of stops that a route solver reads in place of the road network. Two properties decide whether the plan is drivable: it is asymmetric, because A to B and B to A are different roads, and it is time-dependent, so one matrix built at 09:00 misprices every leg driven after 16:00.

Key takeaways

  • The solver optimises the matrix, not the road. Every error in the table becomes a plan nobody can drive.
  • Cells grow with the square of stops: 401 nodes is 160,801 entries, and doubling the day quadruples the build.
  • A matrix is directional. One-way systems and banned turns make the return leg a different duration.
  • Know which departure time yours was built at. One morning matrix understates every afternoon leg in a city.
  • Calibrate against recorded arrivals, not the provider. The correction is per corridor and per hour.

A travel-time matrix is a table with one row and one column per location, holding the driving duration from each place to every other. It is what a routing solver actually optimises against. The road network, the traffic model and the map provider all disappear into it before the search begins, so anything wrong in the table is wrong in the plan and invisible afterwards.

Most implementations build one matrix per plan and treat it as a property of the map. It is not. It is a photograph of the network taken at one departure time, in one direction, for one vehicle class.

Every pair, both directions, and what that costs

A depot plus 400 stops is 401 nodes, which is 160,801 cells. Double the day to 800 stops and it is 641,601. The growth is quadratic, so matrix construction, not the search, is usually what makes a morning solve late. If the plan is not ready when the vans are loaded, look at the build before blaming the optimiser — the split is set out in the plan is not ready when the depot opens, and the strategies for making a daily rebuild affordable belong to caching a matrix without burning the quota.

Why A to B is not B to A

Symmetric matrices are an assumption inherited from textbook problems, and in a city they are wrong by minutes on short legs. One-way systems, central reservations that force a loop to turn round, banned right turns, gradients on a loaded vehicle and single-direction tolls all make the return trip a different journey.

A matrix is also specific to one vehicle class, because the graph itself changes with the vehicle: a heavy vehicle is barred from edges a van uses freely, which is the argument in vehicle profiles, height, weight and turn bans. A mixed fleet needs more than one matrix, and reusing the van matrix for the rigids is not a conservative approximation.

Which clock your matrix was built at

Value sourceRight forFails when
Free-flow, from the road graph and speed limitsRural and trunk legs, overnight runs, sanity checksUsed in a city at any hour. Understates peak legs badly and consistently.
Historical typical, by day of week and time of dayNext-day planning, the default for a morning solveThe day is atypical: a holiday, an event, a closed bridge, a strike.
Live traffic at request timeMid-shift re-planning and the leg the vehicle is on nowUsed for a whole next-day matrix, where it prices tomorrow at today's incident.
Three sources of travel-time values and what each is honestly good for

The practical question is not which is best but which one yours used, and at what departure time. Time-dependence means the honest object is a set of matrices, one per departure band, and most engines approximate it with two or three: a morning build, a midday build, an evening build. Whether you rebuild at all is part of the trade in daily optimisation versus fixed master routes.

Calibrating against what the fleet actually drove

You already own the ground truth. Every completed route is a set of observed leg durations, and the correction is worth more than a better provider because it captures your vehicles, your loads and your drivers.

  1. Take arrival and departure timestamps per stop from the tracking feed. Entry and exit events give you both ends of a leg — see geofence triggers: entry, exit and dwell.
  2. Subtract the time at the kerb. Observed departure minus observed arrival is service, not travel, and mixing them inflates the matrix at exactly the stops with a queue — the decomposition is in service time, the number nobody measures.
  3. Bucket the residuals by corridor and hour, not by vehicle. A ratio of observed to predicted per corridor and hour band is stable enough to apply; a per-driver ratio is noise.
  4. Apply the correction as a multiplier and re-measure the next week. Corridors where the multiplier exceeds about 1.3 are usually a restriction or an access problem, not traffic.

The solver is not optimising your city. It is optimising a table somebody generated at nine in the morning and nobody has checked since.

This calibration loop is a small, permanent piece of software rather than a one-off analysis, and it is the part most worth owning outright when planning sits inside a wider product build. It belongs with the rest of the routing, dispatch and optimisation plumbing in the logistics systems it feeds.

Frequently asked questions

Short answers to the follow-ups this page tends to raise.

What is a travel time matrix in route optimisation?

It is a table holding the driving duration between every pair of locations in the problem, which the solver reads instead of the road network. The matrix is built first, then the search runs entirely inside it, so the plan can only be as realistic as the durations it was given.

What is the difference between a distance matrix and a travel-time matrix?

A distance matrix holds kilometres and a travel-time matrix holds minutes, and the two rank routes differently as soon as speeds vary. Distance is stable and cheap, which is why it survives as a fallback, but a plan optimised on distance in a city will happily choose a slow direct road over a faster ring route.

Does the travel-time matrix need rebuilding every day?

Rebuild it whenever the stop set changes materially, which for most delivery operations means daily. Legs between fixed locations, such as depot to depot, change slowly and can be cached for weeks; legs to today's customers cannot be cached at all because those pairs have never existed before.

How wrong is a symmetric matrix in practice?

Wrong enough to change sequences on short urban legs, where a one-way loop can add several minutes in one direction only. On long inter-city legs the asymmetry is usually small. The risk is that the error is systematic rather than random, so it biases every plan in the same direction instead of averaging out.

  • route optimisation
  • travel time
  • traffic data
  • dispatch
// shipped work

The work behind this page

Builds from our portfolio that this page draws on.

Working on something in this space?

Tell us where you are in a sentence or two. We'll tell you honestly whether we're the right team, and what a sensible first slice of the work looks like.

Start the conversation