A new near-linear time algorithm for k-nearest neighbor search using a compressed cover tree
Yury Elkin, Vitaliy Kurlin
TL;DR
The paper addresses the exact $k$-nearest neighbor problem in metric spaces and introduces a compressed cover tree $\mathcal{T}(R)$ to achieve near-linear time in $\max\{|Q|,|R|\}$. It presents a rigorous construction procedure with time bounds $O((c_m(R))^{8}\cdot \log_2(\Delta(R))\cdot |R|)$ (and $O((c(R))^{12}\cdot \log_2|R|\cdot |R|)$ under alternative constants) and a refined $k$-NN search algorithm that uses a $\lambda$-point and a new break condition to bound iterations, yielding per-query bounds like $O\left((c_m(R))^{10}\cdot \log_2(k)\cdot \log_2(\Delta(R)) + |\bar{B}(q,5d_k(q,R))|\cdot \log_2(k)\right)$ and a fixed-constant version $O\left(\log_2(k)\cdot(\log_2|R|+k)\right)$. The results remove gaps in prior analyses, enabling rigorous near-linear performance for exact $k$-NN on large-scale datasets and informing applications in geometric data science and materials informatics.
Abstract
Given a reference set $R$ of $n$ points and a query set $Q$ of $m$ points in a metric space, this paper studies an important problem of finding $k$-nearest neighbors of every point $q \in Q$ in the set $R$ in a near-linear time. In the paper at ICML 2006, Beygelzimer, Kakade, and Langford introduced a cover tree on $R$ and attempted to prove that this tree can be built in $O(n\log n)$ time while the nearest neighbor search can be done in $O(n\log m)$ time with a hidden dimensionality factor. This paper fills a substantial gap in the past proofs of time complexity by defining a simpler compressed cover tree on the reference set $R$. The first new algorithm constructs a compressed cover tree in $O(n \log n)$ time. The second new algorithm finds all $k$-nearest neighbors of all points from $Q$ using a compressed cover tree in time $O(m(k+\log n)\log k)$ with a hidden dimensionality factor depending on point distributions of the given sets $R,Q$ but not on their sizes.
