Distance metrics are used by proximity-based models to find certain paths between two points.
One of the best applications of distance metrics is in the travelling salesman problem where nearest neighbour, an approximation algorithm, is usually utilized. Aside from combinatorial optimization, distance metrics are also widely used in classification, clustering, and special relativity problems.
In this article, we will tackle one of the basic distance metrics, named after the German mathematician Hermann Minkowski—the Minkowski distance.
Minkowski distance is a distance metric, or a similarity measurement, between two points in a normed vector space. It uses a parameter which represents the order of the norm.
Let’s say we have and denoted as:
The distance of two points can be measured by getting the absolute value of the difference of and ( ). Hence, to get the distances of all points ( ), the formula will be in the form of:
To satisfy the Minkowski distance, adding (which, again, represents the order of the norm) completes the equation:
Minkowski distance can also be derived as:
Orders of the norm
The order of the norm (denoted by the parameter ) varies the distance norm of the points.
The case where is equivalent to the Manhattan distance—named after the rectilinear street layout of Manhattan since it measures the distance between two points in a city if we can only travel along orthogonal city blocks.
Manhattan distance can be calculated using:
The case where is equivalent to the Euclidean distance (or the Pythagorean distance, since it can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem).
Euclidean distance can be calculated using:
Therefore, Minkowski distance can also be considered as a generalization of both the Euclidean distance and the Manhattan distance.
The parameter can extend to more than the value of to that is equal to the Chebyshev distance. Having violates the triangle inequality—an advanced topic that is out of the scope of this article.
Applications of Minkowski distance
Minkowski distance is widely used in machine learning (classification, clustering, and feature extraction) and special relativity (Minkowski space) problems.
One example is in Chess programming. The Minkowski distance at can be used in the static evaluation of the late endgame, where for instance races of the two king to certain squares is often an issue—or in so called Mop-up evaluation, which considers the Manhattan-Distance between winning and losing king.
has its best usage in calculating the length of a line segment between the two points. It is widely used in geocoding/reverse geocoding applications, such as finding the distance between the geocoded point and the true address location is computed to evaluate the positional accuracy of a geocoding procedure.
Top comments (0)