If x is one of the K nearest neighbors of y in a dataset, is y one of the K nearest neighbors of x?

32 Views Asked by At

Suppose I have a set of vectors $X = \{x_i\}_{i=1}^n\subset \mathbb{R}^d$. Fix a vector $x\in X$ and assume that a different vector $y$ is one of the $K$ points in $X$ that is closest to $x$ in Euclidean distance. In other words, $y$ is one of the $K$ nearest neighbors of $x$. Does this mean that $x$ is one of the $K$ nearest neighbors of $y$ too?

Basically, is the statement "$x$ is one of the $K$ nearest neighbors for $y$" reflexive?

1

There are 1 best solutions below

0
On BEST ANSWER

That is not true.

Let $x=1$ and $y=0$ and let $K=1$.

Let $X=\{-\frac12, 0, 1\}$.

While $0$ is the closest neighbor of $1$, $1$ is not the closest neighbor of $0$.