Skip to content

Taxicab Metric

Definition

The taxicab distance between points x=(x1,x2,…,xn)\boldsymbol{x}=(x_1,x_2,\ldots,x_n) and y=(y1,y2,…,yn)\boldsymbol{y}=(y_1,y_2,\ldots,y_n) in an nn-dimensional real coordinate space Rn\mathbb{R}^n with fixed Cartesian coordinate system is:

d1(x,y)=∑i=1n∣yi−xi∣.d_1(\boldsymbol{x},\boldsymbol{y})=\sum_{i=1}^{n}|y_i-x_i|.

The taxicab norm, or known as ℓ1\ell^1 norm, of x=(x1,x2,…,xn)\boldsymbol{x}=(x_1,x_2,\ldots,x_n) is calculated as:

∥x∥1=∑i=1n∣xi∣.\|\boldsymbol{x}\|_1=\sum_{i=1}^{n}|x_i|.

The coordinate sum defines a norm length, and subtracting two points gives a metric distance. Its triangle inequality follows by adding ∣xi−zi∣≤∣xi−yi∣+∣yi−zi∣|x_i-z_i|\le|x_i-y_i|+|y_i-z_i| over the coordinates.


Interpretation

The taxicab distance represents the distance a taxi would travel between two points when restricted to cardinal directions (north, south, east, west) without moving diagonally or in any other curved path. It adds the coordinate differences instead of combining them by Pythagoras, so it is the pp-metric with p=1p=1.

Two points (0, 0) and (5, 4) on a grid joined by a staircase path of length 9, the taxicab distance, a second staircase of the same length, and the straight segment of length about 6.4.

The red staircase has taxicab length d1(x,y)=5+4=9d_1(\boldsymbol{x},\boldsymbol{y})=5+4=9. Any monotone staircase between the points has the same length, whereas the blue straight segment has Euclidean length d2(x,y)=52+42≈6.4d_2(\boldsymbol{x},\boldsymbol{y})=\sqrt{5^2+4^2}\approx6.4.

In the taxicab norm ∥x∥1=∣x1∣+∣x2∣\|\boldsymbol x\|_1=|x_1|+|x_2| the unit circle is a diamond. Drag x\boldsymbol x: the 11-norm is always at least the Euclidean norm.

The diamond-shaped unit circle shows how the taxicab norm weighs directions: the point (12,12)(\tfrac{1}{2},\tfrac{1}{2}) has taxicab norm 11, the same as (1,0)(1,0), although it is closer to the origin in the Euclidean sense. In general d2≤d1≤n d2d_2\le d_1\le\sqrt{n}\,d_2 on Rn\mathbb{R}^n, the upper bound by the Cauchy-Schwarz inequality. In the figure, 9≤2⋅41≈9.069\le\sqrt{2}\cdot\sqrt{41}\approx9.06, close to equality because the two coordinate differences are almost equal. These bounds make the two metrics strongly equivalent: they give different numbers but the same convergent sequences.

A common slip is to think that the taxicab distance depends only on the geometry of the plane. It depends on the chosen axes, which is why the definition fixes a Cartesian coordinate system: the vectors (1,0)(1,0) and (12,12)(\tfrac{1}{\sqrt{2}},\tfrac{1}{\sqrt{2}}) have the same Euclidean length 11, one being a rotation of the other, but taxicab norms 11 and 2\sqrt{2}.


Key Results

  • The closed unit ball in the taxicab norm is an nn-dimensional cross-polytope, e.g., a diamond in R2\mathbb{R}^2 and a regular octahedron in R3\mathbb{R}^3.

Examples

  • d1((0,1), (2,−1))=4d_1((0,1),\,(2,-1))=4.
  • ∥(−3,1)∥1=4\|(-3,1)\|_1=4.

Prerequisites

Sources

Aliases: Manhattan metric, taxicab distance, taxicab norm, rectilinear distance, L1 distance Keywords: Manhattan distance Symbols: real numbers, square root, sum

Last updated: 20 October 2026 03:02