# Minkowski distance

The Minkowski distance or Minkowski metric is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance. It is named after the German mathematician Hermann Minkowski.

## Definition

The Minkowski distance of order ${\displaystyle p}$ (where ${\displaystyle p}$ is an integer) between two points

${\displaystyle X=(x_{1},x_{2},\ldots ,x_{n}){\text{ and }}Y=(y_{1},y_{2},\ldots ,y_{n})\in \mathbb {R} ^{n}}$

is defined as:

${\displaystyle D\left(X,Y\right)=\left(\sum _{i=1}^{n}|x_{i}-y_{i}|^{p}\right)^{\frac {1}{p}}}$

For ${\displaystyle p\geq 1}$, the Minkowski distance is a metric as a result of the Minkowski inequality. When ${\displaystyle p<1}$, the distance between (0,0) and (1,1) is ${\displaystyle 2^{1/p}>2}$, but the point (0,1) is at a distance 1 from both of these points. Since this violates the triangle inequality, for ${\displaystyle p<1}$ it is not a metric. However, a metric can be obtained for these values by simply removing the exponent of ${\displaystyle 1/p}$. The resulting metric is also an F-norm.

Minkowski distance is typically used with ${\displaystyle p}$ being 1 or 2, which correspond to the Manhattan distance and the Euclidean distance, respectively. In the limiting case of ${\displaystyle p}$ reaching infinity, we obtain the Chebyshev distance:

${\displaystyle \lim _{p\to \infty }{\left(\sum _{i=1}^{n}|x_{i}-y_{i}|^{p}\right)^{\frac {1}{p}}}=\max _{i=1}^{n}|x_{i}-y_{i}|.\,}$

Similarly, for ${\displaystyle p}$ reaching negative infinity, we have:

${\displaystyle \lim _{p\to -\infty }{\left(\sum _{i=1}^{n}|x_{i}-y_{i}|^{p}\right)^{\frac {1}{p}}}=\min _{i=1}^{n}|x_{i}-y_{i}|.\,}$

The Minkowski distance can also be viewed as a multiple of the power mean of the component-wise differences between P and Q.

The following figure shows unit circles (the set of all points that are at the unit distance from the centre) with various values of ${\displaystyle p}$: