Lesson 5 of 13 9 min · 123 words From lecture slides
Manhattan distance (L1)
Sum of absolute coordinate differences — the 'taxicab' distance on a grid.
The Manhattan distance, also called taxicab distance or the L1 norm, measures distance in a grid-like space: the sum of the absolute differences of the coordinates.
In n dimensions, for A(a₁, …, aₙ) and B(b₁, …, bₙ):
Worked example: and give .
Like every metric it is non-negative, zero only when A = B, symmetric, and satisfies the triangle inequality d(A,B) ≤ d(A,C) + d(C,B).
It is used for grid-based pathfinding (games, city-block navigation), in clustering and classification algorithms such as k-means and k-NN, in optimisation where movement is restricted to orthogonal directions, and in robotics.
Formula to remember
Jacobian matrix
Slides
Derivative of a vector-valued function; how it transforms local space.
Quick check · +5 XP