Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The measure of separation between two entities or locations that may or may not be connected, such as two points.


More specifically, a "measure of separation" is usually considered a distance when it satisfies three axiomatic properties:

  1. All distances are non-negative. The distance can be zero if and only if it is measured between a location and itself.

  2. Distances are symmetric: the distance between A and B is the distance between B and A.

  3. Distances satisfy the triangle inequality: the distance between A and C can never exceed the sum of the distances from A to B and from B to C. In other words, the length of the path ABC can never be less than the actual distance from A to C.

Satisfying these criteria can be critical for some algorithms, such as certain clustering procedures. On occasion these criteria can be relaxed, especially that of symmetry. For example, shortest distances within cities having one-way streets may change when the roles of origin and destination are reversed.

history | excerpt history