My questions is: What is the "real" difference between Reverse nearest neighbor(RNN) and Nearest neighbor(NN) queries? In my opinion, these two should return same result.


1 Answer 1


The definition given by

Papadias D., Tao Y. (2009) Reverse Nearest Neighbor Query. In: LIU L., ÖZSU M.T. (eds) Encyclopedia of Database Systems. Springer, Boston, MA

states that

Given a multi-dimensional dataset $P$ and a point $q$, a reverse nearest neighbor (RNN) query retrieves all the points $p\in{P}$ that have $q$ as their nearest neighbor.

As a simple example, consider the 1D point set $P=[a,b,c]=[0,2,3]$. Then we have \begin{align} \mathrm{NN}(a) &= b \\ \mathrm{NN}(b) &= c \\ \mathrm{NN}(c) &= b \end{align} So \begin{align} \mathrm{RNN}(a) &= \emptyset \\ \mathrm{RNN}(b) &= \{a,c\} \\ \mathrm{RNN}(c) &= b \end{align} Does this help?

  • 1
    $\begingroup$ I got the logic, Exactly what i was looking for simple yet informative. Thank you! $\endgroup$
    – user331172
    Commented May 29, 2017 at 4:21
  • 1
    $\begingroup$ @GeoMatt22 The reverse nearest neighbour relation is not a symmetric relation. $\endgroup$
    – Dylan
    Commented May 29, 2019 at 13:34
  • 1
    $\begingroup$ Could you include a full reference in case the link goes dead in the future? $\endgroup$ Commented Jun 7, 2020 at 11:09
  • 1
    $\begingroup$ @RichardHardy done. $\endgroup$
    – GeoMatt22
    Commented Jun 8, 2020 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.