ManhattanDistance

ManhattanDistance[u,v]

gives the Manhattan or "city block" distance between vectors u and v.

Details

Examples

open allclose all

Basic Examples  (2)

Manhattan distance between two vectors:

Manhattan distance between numeric vectors:

Scope  (2)

Compute distance between any vectors of equal length:

Compute distance between vectors of any precision:

Applications  (2)

Cluster data using Manhattan distance:

Demonstrate the triangle inequality:

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 ChebyshevDistance:

BrayCurtisDistance is a ratio of Manhattan distances:

MeanDeviation as a scaled ManhattanDistance from the Mean:

Introduced in 2007
 (6.0)