Fast and exact fixed-radius neighbor search based on sorting

Xinye Chen, Stefan Güttel
12/15/2022
cs.IRcs.DS

Official code: nla-group/snn (29 stars, Python, MIT, last commit 2025-09-26).

Abstract

Fixed-radius near neighbor search is a fundamental data operation that retrieves all data points within a user-specified distance to a query point. There are efficient algorithms that can provide fast approximate query responses, but they often have a very compute-intensive indexing phase and require careful parameter tuning.

Show full abstract

Therefore, exact brute force and tree-based search methods are still widely used. Here we propose a new fixed-radius near neighbor search method, called SNN, that significantly improves over brute force and tree-based methods in terms of index and query time, provably returns exact results, and requires no parameter tuning. SNN exploits a sorting of the data points by their first principal component to prune the query search space. Further speedup is gained from an efficient implementation using high-level Basic Linear Algebra Subprograms (BLAS). We provide theoretical analysis of our method and demonstrate its practical performance when used stand-alone and when applied within the DBSCAN clustering algorithm.

View on arXivView PDF

Code Implementations(1)

nla-group/snnOfficial100%
MIT

An efficient Python library for fast fixed-radius nearest neighbor search

294Python, C++Sep 4, 20221 years agoMIT
nearest-neighbor-search

Similar Papers

Cite this paper

@article{chen2022fast,
  title  = {Fast and exact fixed-radius neighbor search based on sorting},
  author = {Xinye Chen and Stefan Güttel},
  year   = {2022},
  eprint = {2212.07679},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.07679}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.07679.svg)](https://codeofpaper.com/paper/2212.07679)

Discussion