Learn Before
Concept

Manhattan Distance (p=1)

Manhattan distance, also known as city block distance, is the number of units one must traverse to get from point X to point Y along a grid-like path. Each step involves a change in value across exactly one dimension. In machine learning, Manhattan distance is often preferred over higher values of pp for high-dimensionality data due to simpler computation and relative robustness against the curse of high dimensionality. More formally, let xix_i be the value of point X across the ii-th dimension, and let yiy_i be the value of point Y across the ii-th dimension. In nn dimensions, the Manhattan distance between points X and Y is: d(X,Y)=i=1nxiyid(X,Y) = \sum_{i=1}^n|x_i - y_i|. This metric is an instantiation of the Minkowski distance formula where p=1p=1.

0

1

Updated 2026-06-19

Tags

Data Science