Encyclopedia of Database Systems

2018 Edition
| Editors: Ling Liu, M. Tamer Özsu

Nearest Neighbor Query

  • Dimitris Papadias
Reference work entry
DOI: https://doi.org/10.1007/978-1-4614-8265-9_245

Synonyms

kNN query; NN 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 pP−{ p 1, p 2, …, p k} dist( p i, q) ≤ dist( p, q) ∀ 1 ≤ ik, 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 ≤ im) are q i and p i respectively, their L x distance is:
$$ {L}_x(p,q){=}{\left({\displaystyle {\sum}_{i=1\sim m}{\left|{p}_i{-}{q}_i\right|}^x}\right)}^{1/x},\mathrm{f}\mathrm{o}\mathrm{r}\ x\,{\ne}\, \infty, $$
This is a preview of subscription content, log in to check access.

Recommended Reading

  1. 1.
    Korn F, Muthukrishnan S. Influence sets based on reverse nearest neighbor queries. In: Proceeding of the ACM SIGMOD International Conference on Management of Data; 2000. p. 201–12.CrossRefGoogle Scholar
  2. 2.
    Papadias D, Tao Y, Mouratidis K, Hui K. Aggregate nearest neighbor queries in spatial databases. ACM Trans Database Syst. 2005;30(2):529–76.CrossRefGoogle Scholar
  3. 3.
    Seidl T, Kriegel H-P. Optimal multi-step k-nearest neighbor search. In: Proceeding of the ACM SIGMOD International Conference on Management of Data; 1998. p. 154–65.CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Department of Computer Science and EngineeringHong Kong University of Science and TechnologyKowloonHong Kong

Section editors and affiliations

  • Dimitris Papadias
    • 1
  1. 1.Dept. of Computer Science and Eng.Hong Kong Univ. of Science and TechnologyKowloonHong Kong SAR