Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Nearest Neighbor Search

Searching Algorithm

Nearest neighbor search is the optimization problem of finding the point within a given set that is closest, by some measure of dissimilarity, to a given query point. Donald Knuth called it the post-office problem, by analogy with assigning a residence to its nearest post office; a natural generalization, k-nearest neighbor search, finds the k closest points rather than just one. Most practical implementations work in a metric space, where dissimilarity is expressed through a distance function such as Euclidean or Manhattan distance, though some methods use dissimilarity measures that are not true metrics. The problem underlies techniques across many fields, including pattern recognition, statistical classification, computer vision, computational geometry, cryptanalysis, database retrieval, DNA sequencing, spell checking, plagiarism detection, cluster analysis and, more recently, vector databases and retrieval-augmented generation systems built on embeddings.

Facts
Time Complexity
Time Complexity (category)
Linear Time -- O(n) 1
Classification
Design Technique
Branch and Bound 1
Connections

In Field

Source Wikipedia: Nearest neighbor search

Uses Design Technique

Sources
1. Wikipedia: Nearest neighbor search
  • Lead section
    Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem of finding the point in a given set that is closest (or most similar) to a given point.
  • In Group: Proximity and Monotone Matrix Search Algorithms, Introduction
    Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem of finding the point in a given set that is closest (or most similar) to a given point.
  • In Field: Algorithms and Complexity Theory, Lead sentence
    Nearest neighbor search (NNS), as a form of proximity search, is the optimization problem of finding the point in a given set that is closest (or most similar) to a given point.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.