(definition)

**Definition:**
The distance between two points measured along axes at right angles. In a plane with p_{1} at (x_{1}, y_{1}) and p_{2} at (x_{2}, y_{2}), it is |x_{1} - x_{2}| + |y_{1} - y_{2}|.

**Generalization** (I am a kind of ...)

*L _{m} distance*.

**See also**
*Euclidean distance*, *Hamming distance*.

*Note:
This is easily generalized to higher dimensions. Manhattan distance is often used in integrated circuits where wires only run parallel to the X or Y axis. See links at L_{m} distance for more detail. *

Also known as *rectilinear* distance, Minkowski's L_{1} distance, taxi cab metric, or city block distance.

* Hamming distance can be seen as Manhattan distance between bit vectors.*

Author: PEB

Wikipedia entry for Taxicab geometry. Comparison between Manhattan and Euclidean distance. Weisstein's World of Math calls it taxicab metric.

Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul Black.

Entry modified 11 February 2019.

HTML page formatted Wed Mar 13 12:42:46 2019.

Cite this as:

Paul E. Black, "Manhattan distance", in
*Dictionary of Algorithms and Data Structures* [online], Paul E. Black, ed. 11 February 2019. (accessed TODAY)
Available from: https://www.nist.gov/dads/HTML/manhattanDistance.html