Frank Chen

Collecting stories by foot, lens, and occasional propeller

← Back to Posts

Part 1: Different distance measures in spatial interaction models

Distance in a spatial interaction model can mean straight-line separation, road-network distance, travel time, or broader travel cost. This tutorial compares the main options and explains when each is appropriate.

Tutorials 8 Mar 2026

In a spatial interaction model (SIM), distance is often written as a simple symbol such as d{ij}d_\{ij\}. That makes it look as if distance is a single, obvious quantity.

In practice, it is a modelling choice.

When we say a household is “close” to a store, we might mean:

  • the store is nearby in straight-line space
  • the store can be reached by a short road journey
  • the store can be reached quickly
  • the trip feels easy because it is cheap, safe, and convenient Each of these meanings can produce different model results.

Why the choice matters

Suppose a neighbourhood in south Leeds is choosing between two supermarkets.

  • Store A is 1.8 km away in straight-line distance, but a railway line and limited bridge crossings make the driving route closer to 3.0 km.
  • Store B is 2.2 km away in straight-line distance, but it sits on a main road and can be reached in 2.4 km. If the model uses Euclidean distance, Store A appears closer. If the model uses network distance, Store B becomes more accessible. The ranking of stores changes because the definition of distance changes.

That is not a minor technical detail. In a SIM, the distance term directly affects how much spending or travel flow is allocated to each destination.

1. Euclidean distance

Euclidean distance is the straight-line distance between two points. It is the shortest geometric separation in a flat coordinate system.

dij=(xixj)2+(yiyj)2 d_{ij} = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}

This is the most common measure in classroom examples and spreadsheets because it is:

  • easy to calculate
  • transparent to explain
  • efficient when many origin-destination pairs are involved It is often a sensible first step in a teaching exercise because it keeps attention on the logic of the model rather than the complexity of routing data.

However, Euclidean distance also makes a strong assumption: it treats movement as if people could travel directly across space. Real journeys rarely work like that. Roads bend, rivers block movement, and buildings create barriers.

Euclidean distance is therefore best understood as a simplified proxy for accessibility, not a literal journey length.

2. Manhattan or rectilinear distance

In some urban settings, movement is constrained to a grid of perpendicular streets. In those cases, Manhattan distance can be useful.

Instead of drawing a direct diagonal line, it adds horizontal and vertical movement:

dijmanhattan=xixj+yiyj d_{ij}^{\text{manhattan}} = |x_i - x_j| + |y_i - y_j|

This measure is often larger than Euclidean distance because travellers cannot cut diagonally across city blocks.

It is most appropriate when:

  • the street pattern is strongly grid-based
  • walking or driving follows orthogonal blocks
  • a quick approximation is needed without building a full network model Its weakness is that few cities are perfect grids. Once road layouts become irregular, Manhattan distance can be just as misleading as Euclidean distance, only in a different way.

3. Network distance

Network distance measures the length of the shortest route through a transport network, such as roads, footpaths, or rail links.

This is often more realistic than Euclidean distance because people travel along connected infrastructure rather than directly across the map.

For a grocery trip, a route may involve:

  • leaving a cul-de-sac
  • joining a local distributor road
  • using a roundabout
  • entering a retail park from a single access point All of those steps add length. Two stores that appear equally close on a map may have very different road distances if one is badly connected.

Network distance is usually a better measure when:

  • route structure matters
  • barriers such as rivers or railways are important
  • the study area has cul-de-sacs, ring roads, or limited crossings Its main cost is additional data and computation. You need a usable network, not just a pair of coordinates.

4. Travel time

Travel time asks a different question. Instead of “How far is the route?” it asks “How long will the trip take?”

That can be more behaviourally realistic because people often respond more strongly to time than to kilometres.

Two stores might both be 3 km away, yet one could be:

  • 5 minutes away by car on a fast arterial road
  • 14 minutes away through congested local streets Travel time incorporates speed, delay, and sometimes service frequency. Depending on the model, it can include:
  • speed limits
  • junction delays
  • congestion
  • public transport waiting time
  • interchange penalties For retail analysis, travel time is often more useful than physical distance when the goal is to approximate actual behaviour rather than simply compare geometry.

5. Generalised cost and perceived distance

Sometimes even travel time is too narrow.

Travellers may care about parking charges, bus fares, steep slopes, unsafe crossings, or the stress of a complicated journey. In those cases analysts sometimes use a broader impedance measure, often called generalised cost.

This can combine several components into one resistance term, such as:

  • in-vehicle time
  • walking time
  • waiting time
  • monetary cost
  • comfort or perceived effort For example, a store reached by a short bus ride may still feel inconvenient if the service is infrequent and the final walk crosses a major road. Measured distance is short, but perceived effort is high.

Perceived distance is harder to observe directly, yet it helps explain why people do not always choose the mathematically closest destination.

A simple comparison

The table below shows how the same three stores can look different depending on the measure used.

StoreEuclidean distanceNetwork distanceTravel time
Store A1.8 km3.0 km10 min
Store B2.2 km2.4 km6 min
Store C2.5 km2.7 km7 min

If we rank stores by Euclidean distance, Store A comes first. If we rank them by network distance or travel time, Store B looks best.

This is why the phrase “the nearest store” is incomplete unless we also say how nearness is being measured.

Which measure should we use in a SIM?

There is no universally correct answer. The best measure depends on the question, the scale of analysis, and the data available.

A practical rule is:

  • use Euclidean distance for teaching, prototyping, and simple spreadsheet models
  • use Manhattan distance only when the urban form is strongly grid-like and a quick approximation is acceptable
  • use network distance when the structure of routes and barriers matters
  • use travel time when behaviour is shaped more by speed and delay than by physical length
  • use generalised cost when travel involves multiple modes, fares, waiting, or strong differences in perceived effort In other words, the goal is not to find the one best distance measure for every project. The goal is to choose the measure that best represents movement in the specific situation being studied.

For this course

In the teaching spreadsheet, Euclidean distance is a reasonable choice because it is simple, visible, and easy to reproduce. It lets students focus on how the SIM works.

For real retail forecasting, accessibility planning, or transport policy analysis, network distance or travel time is usually more defensible.

Further readings

Related tutorials on this site: