liveBook · Manning

Manhattan distance

As explained in Data Without Labels

Manhattan distance is the sum of absolute coordinate differences between two points, corresponding to movement along perpendicular axes.

Manhattan distance measures the distance between two points by adding their absolute coordinate differences: |y2 − y1| + |x2 − x1|. It follows a grid-like path along perpendicular axes, so it is also called city block distance or the taxicab metric. section 2.3

Use Manhattan distance to:

  • Measure distance or similarity between observations in clustering. section 2.4.2 section 2.2
  • Consider an L1 metric when datasets have many dimensions or variables, where it may be preferable to Euclidean distance. section 2.3
  • Combine it with single, complete, group-average, or Ward linkage when developing hierarchical clustering. section 2.4.2
(2.3)

Manhattan distance = (|y2 – y1| + |x2 – x1|)

Equation 2.3 gives the coordinate-based formula for Manhattan distance. section 2.3

How Data Without Labels covers it

How deep it goes
Defines the grid-path formula, contrasts L1 with L2, and notes high-dimensional preference without detailing implementation.
Examples
Uses coordinate points, grid-like movement, and centroid or hierarchical clustering as application contexts.
What it assumes
Assumes basic coordinate and vector notation; defers detailed L1 and L2 norm review to an appendix.
What you can do after
Apply it as a distance metric when comparing clustering choices for a dataset.
How it connects
Connects clustering, similarity measurement, Euclidean distance, Chebyshev distance, cosine distance, and linkage criteria.

Also explained in

Compare how 4 books explain Manhattan distance →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.