Minkowski distance is a family of distances between points represented by coordinate vectors, obtained by taking the th root of the sum of the th powers of their absolute coordinate differences. For , it is the distance induced by the -norm and defines a metric on finite-dimensional real coordinate space. Named after Hermann Minkowski, the family includes Manhattan distance at , Euclidean distance at , and, as a limiting case, Chebyshev distance at . It is widely used in geometry, numerical computation, and data analysis.
Definition
For two points and in , and a real parameter , the Minkowski distance is
Here, is the absolute value of the difference in coordinate . Equivalently,
The limiting case is defined by
and satisfies
The parameter , sometimes called the order of the distance, controls how coordinate differences are aggregated. Larger values give greater relative emphasis to the largest differences.
The same formula applies to vectors with complex coordinates when absolute value is replaced by complex modulus.
Important special cases
Manhattan distance
For ,
Also called city-block distance or taxicab distance, it measures the total coordinatewise displacement. On an unobstructed rectangular street grid, it gives the shortest route length when travel is restricted to coordinate directions.
Euclidean distance
For ,
This is the usual straight-line distance in Euclidean space, obtained from the Pythagorean theorem. It is the member of the family induced by the standard inner product.
Chebyshev distance
For ,
Also called maximum distance, it depends only on the largest coordinate difference. In two dimensions, it describes the minimum number of king moves between squares on an unobstructed chessboard when horizontal, vertical, and diagonal moves each have unit cost.
For example, if and , their absolute coordinate differences are and , so
Metric properties
For every , Minkowski distance satisfies:
Nonnegativity: .
Identity of indiscernibles: if and only if .
Symmetry: .
The triangle inequality:
For finite , the triangle inequality follows from Minkowski’s inequality,
Minkowski distance is translation invariant and scales uniformly:
Every member of the family is unchanged by permutations of coordinates and by sign reversals applied consistently to corresponding coordinates. In dimensions at least two, however, only is invariant under all Euclidean rotations. For other values of , the chosen coordinate axes are part of the geometry.
Geometry and comparison between orders
The closed unit ball is
with . Each is a convex set.
In two dimensions, the unit ball is:
- a diamond with vertices on the coordinate axes for ;
- a circular disk for ;
- a square aligned with the coordinate axes for .
For , the unit balls are strictly convex: their boundaries contain no nontrivial straight line segments. Consequently, a straight segment is the unique shortest path between two points, up to reparameterization. At and , distinct shortest paths can occur.
For a fixed vector and ,
where . Thus the unnormalized distance between a fixed pair of points is nonincreasing as increases.
These bounds also show that all Minkowski distances on a fixed finite-dimensional space generate the same topology: they have the same convergent sequences and open sets. They need not, however, produce the same nearest neighbors or the same ordering of pairwise distances.
Weighted and normalized forms
A weighted Minkowski distance is commonly defined as
It is equivalent to ordinary Minkowski distance after rescaling coordinate by . Strictly positive weights preserve the metric properties. If some weights are zero, distinct vectors differing only in those coordinates can have zero distance; the result is then a pseudometric rather than a metric on the full coordinate space.
A normalized version is
For fixed and , normalization multiplies all distances by the same positive constant and therefore preserves nearest-neighbor rankings. Its dependence on differs from that of the unnormalized distance: as a power mean of the absolute differences, is nondecreasing with .
Weighting conventions are not uniform. A formula using inside the sum assigns an effective coefficient , rather than .
Exponents below one
The same algebraic expression is sometimes called a Minkowski distance for , but it is not generally a metric.
For example, let , , and . Then
so the triangle inequality fails. The associated expression is a quasi-norm, and its unit ball is not convex in dimensions at least two.
There is an important distinction between this expression and its th power. For ,
does define a metric, because for nonnegative . The outer exponent is what prevents the usual formula from satisfying the triangle inequality.
Applications and limitations
Minkowski distances are used in nearest-neighbor search, cluster analysis, pattern recognition, and other areas of machine learning. The parameter supplies a family of geometries rather than a universally optimal similarity measure.
At , absolute discrepancies are added directly. At , larger discrepancies receive greater relative emphasis through squaring. At , only the largest discrepancy determines the distance. For a fixed query and finite , minimizing is equivalent to minimizing
because taking a positive th root preserves order. Nevertheless, the powered expression generally is not itself a metric when .
Several issues affect interpretation:
- Coordinate scale: A variable measured in numerically larger units can dominate the distance. Rescaling coordinates changes their relative influence.
- Dependence between variables: Ordinary Minkowski distance does not account for covariance. Mahalanobis distance provides a different construction using a covariance matrix.
- Large discrepancies: Larger places greater relative emphasis on unusually large coordinate differences. A smaller does not by itself guarantee a statistically robust procedure.
- High dimensionality: In some high-dimensional data models, distances concentrate and become less discriminative, an aspect of the curse of dimensionality.
- Meaning of coordinates: Numerical encodings of categories do not automatically justify treating their differences as meaningful distances.
For numerical evaluation with large finite , directly computing may overflow or underflow. If
an equivalent scaled formula is
The normalized differences lie in , reducing the risk of overflow in the powers. When , the distance is zero.
Relation to function spaces and spacetime
Minkowski distance is the finite-dimensional counterpart of the norm-induced distance on spaces, where sums are replaced by integrals:
In this setting, functions equal almost everywhere are identified so that zero distance corresponds to the same element of the space. The finite-dimensional equivalence of all -norms does not extend unchanged to infinite-dimensional spaces: different exponents can impose genuinely different integrability conditions.
Despite the shared name, Minkowski distance is not the spacetime interval of special relativity. The latter uses an indefinite quadratic form that distinguishes timelike, spacelike, and null separations; it is not a nonnegative metric of the kind defined above.