Definition: The distance between two points measured along axes at right angles. In a plane with p1 at (x1, y1) and p2 at (x2, y2), it is |x1 - x2| + |y1 - y2|.
Generalization (I am a kind of ...)
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 Lm distance for more detail.
Also known as rectilinear distance, Minkowski's L1 distance, taxi cab metric, or city block distance.
Hamming distance can be seen as Manhattan distance between bit vectors.
Wikipedia entry for Taxicab geometry. Comparison between Manhattan and Euclidean distance. Weisstein's World of Math calls it taxicab metric.
If you have suggestions, corrections, or comments, please get in touch with Paul E. Black.
Entry modified 31 May 2006.
HTML page formatted Tue Dec 6 16:16:32 2011.
Cite this as:
Paul E. Black, "Manhattan distance", in Dictionary of Algorithms and Data Structures [online], Paul E. Black, ed., U.S. National Institute of Standards and Technology. 31 May 2006. (accessed TODAY) Available from: http://www.nist.gov/dads/HTML/manhattanDistance.html