Synonyms
NN query; kNN query
Definition
Given a dataset P and a query point q, a k nearest neighbor (kNN) query returns the k closest data points p 1 ,p 2 ,...,p k to q. For any point p∈P−{p 1 ,p 2 ,...,p k }: dist(p i , q)≤dist(p, q) ∀ 1≤i≤k, where dist depends on the underlying distance metric. The usual metric is the L x norm, or formally, given two points q, p whose coordinates on the i-th dimension (1≤i≤m) are q i and p i respectively, their L x distance is:
Most work on spatial and spatio-temporal databases focuses on Euclidean distance (i.e., L 2 ), but alternative definitions have been used in various domains (e.g., road networks, time series).
Key Points
Nearest neighbor search constitutes an important component for several tasks such as clustering, outlier...
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsRecommended Reading
Korn F. and Muthukrishnan S. Influence sets based on reverse nearest neighbor queries. In Proc. ACM SIGMOD Int. Conf. on Management of Data, 2000, pp. 201–212.
Papadias D., Tao Y., Mouratidis K., and Hui K. Aggregate nearest neighbor queries in spatial databases. ACM Trans. Database Sys., 30(2):529–576, 2005.
Seidl T. and Kriegel H-P. Optimal multi-step k-nearest neighbor search. In Proc. ACM SIGMOD Int. Conf. on Management of Data, 1998, pp 154–165.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer Science+Business Media, LLC
About this entry
Cite this entry
Papadias, D. (2009). Nearest Neighbor Query. In: LIU, L., ÖZSU, M.T. (eds) Encyclopedia of Database Systems. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-39940-9_245
Download citation
DOI: https://doi.org/10.1007/978-0-387-39940-9_245
Publisher Name: Springer, Boston, MA
Print ISBN: 978-0-387-35544-3
Online ISBN: 978-0-387-39940-9
eBook Packages: Computer ScienceReference Module Computer Science and Engineering