Lably
Skip to content

Nearest neighbor search

Optimization problem in computer science

  • 10 min read
  • 3 chapters

Related on Lably

Through Optimization problem, Space (mathematics) and Triangle inequality

Formally, the nearest neighbor (NN) search problem is defined as follows: given a set S of points in a space M and a query point q∈M, find the closest point in S to q. Donald Knuth in volume 3 of The Art of Computer Programming (1973) called it the post-office problem, referring to an application of assigning to a residence the nearest post office. A direct generalization of this problem is a k-NN search, where we need to find the k closest points.

Most commonly M is a metric space and dissimilarity is expressed as a distance metric, which is symmetric and satisfies the triangle inequality. Even more common, M is taken to be the d-dimensional vector space where dissimilarity is measured using the Euclidean distance, Manhattan distance or other distance metric. However, the dissimilarity function can be arbitrary. One example is asymmetric Bregman divergence, for which the triangle inequality does not hold.

Applications

The nearest neighbor search problem arises in numerous fields of application, including:

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Robotics