written 8.5 years ago by |
Suppose we have a set of points, called a space. A distance measure on this space is a function d(x, y) that takes two points in the space as arguments and produces a real number, and satisfies the following axioms:
d(x, y) ≥ 0 (no negative distances).
d(x, y) = 0 if and only if x = y (distances are positive, except for the distance from a point to itself).
d(x, y) = d(y, x) (distance is symmetric).
d(x, y) ≤ d(x, z) + d(z, y) (the triangle inequality).
The triangle inequality is the most complex condition. It says, intuitively, that to travel from x to y, we cannot obtain any benefit if we are forced to travel via some particular third point z. The triangle-inequality axiom is what makes all distance measures behave as if distance describes the length of a shortest path from one point to another.