ManhattanDistance[u,v]
gives the Manhattan or "city block" distance between vectors u and v.


ManhattanDistance
ManhattanDistance[u,v]
gives the Manhattan or "city block" distance between vectors u and v.
Details

- Manhattan distance is effectively the sum of of differences across all dimensions.
- ManhattanDistance[u,v] is equivalent to Total[Abs[u-v]]. »
Examples
open all close allBasic Examples (2)
Scope (2)
Properties & Relations (5)
Manhattan distance is a sum of absolute differences:
ManhattanDistance is equivalent to a Norm of a difference:
ManhattanDistance is greater than or equal to ChessboardDistance:
BrayCurtisDistance is a ratio of Manhattan distances:
MeanDeviation as a scaled ManhattanDistance from the Mean:
Tech Notes
Related Guides
History
Text
Wolfram Research (2007), ManhattanDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/ManhattanDistance.html.
CMS
Wolfram Language. 2007. "ManhattanDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ManhattanDistance.html.
APA
Wolfram Language. (2007). ManhattanDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ManhattanDistance.html
BibTeX
@misc{reference.wolfram_2025_manhattandistance, author="Wolfram Research", title="{ManhattanDistance}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ManhattanDistance.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_manhattandistance, organization={Wolfram Research}, title={ManhattanDistance}, year={2007}, url={https://reference.wolfram.com/language/ref/ManhattanDistance.html}, note=[Accessed: 13-August-2025]}