Skip to main content
QUICK REVIEW

[Paper Review] Graph-based Nearest Neighbor Search: From Practice to Theory

Liudmila Prokhorenkova, Aleksandr Shekhovtsov|arXiv (Cornell University)|Jul 1, 2019
Advanced Image and Video Retrieval TechniquesComputer Science36 references19 citations
TL;DR

This paper provides the first rigorous theoretical analysis of graph-based nearest neighbor search (NNS) in the dense regime ($d \ll \log n$), showing that greedy search on nearest neighbor graphs achieves $O(n^{1/d} \cdot M^d)$ query time. It proves that strategically added shortcut edges reduce steps to $O(\log^2 n)$, and beam search significantly improves accuracy, especially in high dimensions, offering theoretical justification for widely used heuristics in practice.

ABSTRACT

Graph-based approaches are empirically shown to be very successful for the nearest neighbor search (NNS). However, there has been very little research on their theoretical guarantees. We fill this gap and rigorously analyze the performance of graph-based NNS algorithms, specifically focusing on the low-dimensional (d << \log n) regime. In addition to the basic greedy algorithm on nearest neighbor graphs, we also analyze the most successful heuristics commonly used in practice: speeding up via adding shortcut edges and improving accuracy via maintaining a dynamic list of candidates. We believe that our theoretical insights supported by experimental analysis are an important step towards understanding the limits and benefits of graph-based NNS algorithms.

Motivation & Objective

  • To close the theoretical gap in understanding graph-based nearest neighbor search (NNS) algorithms, which are widely used in practice but lack formal guarantees.
  • To analyze the performance of greedy search on nearest neighbor graphs in the dense regime ($d \ll \log n$), assuming uniform distribution on a sphere.
  • To theoretically justify two key heuristics used in practice: shortcut edges for faster convergence and beam search for improved accuracy.
  • To evaluate the practical viability of theoretical assumptions by proposing and testing a dimensionality reduction technique (dim-red) that uniformizes and densifies datasets.

Proposed method

  • Analyzes greedy search on nearest neighbor graphs under uniform distribution on a $d$-dimensional sphere, deriving query time complexity as $O(n^{1/d} \cdot M^d)$.
  • Introduces a method to add long-range shortcut edges with power-law distributed connection probabilities, inspired by Kleinberg’s small-world model, to reduce the number of search steps.
  • Proves that properly constructed shortcut edges reduce the number of steps to $O(\log^2 n)$, significantly improving query efficiency.
  • Analyzes beam search (dynamic candidate list) as a heuristic to improve accuracy, showing it reduces the required graph degree, especially in high dimensions.
  • Proposes a practical transformation technique called 'dim-red' that maps real datasets to lower-dimensional, denser, and more uniform spaces to make theoretical assumptions applicable.
  • Empirically validates theoretical findings on both synthetic and real datasets, comparing kNN, HNSW, and dim-red-enhanced variants under controlled settings.

Experimental results

Research questions

  • RQ1What is the theoretical query time complexity of greedy search on nearest neighbor graphs in the dense regime ($d \ll \log n$)?
  • RQ2Can the addition of long-range shortcut edges improve the asymptotic query time of graph-based NNS, and if so, under what conditions?
  • RQ3How does beam search (dynamic candidate list) affect the accuracy and required graph degree in high-dimensional settings?
  • RQ4To what extent can theoretical insights derived from uniform distributions be applied to real-world datasets through data transformation?

Key findings

  • The query time complexity of greedy search on nearest neighbor graphs is $O(n^{1/d} \cdot M^d)$, which grows with dimension but remains sublinear in $n$ for $d \ll \log n$.
  • Properly added shortcut edges reduce the number of search steps from $O(n^{1/d})$ to $O(\log^2 n)$, significantly accelerating convergence.
  • Beam search reduces the required graph degree by up to 100× in high dimensions (e.g., from 2000 to 20 for $d=16$) while maintaining low step count, improving accuracy without increasing storage.
  • The dim-red technique, which maps data to a denser, more uniform space, enables theoretical guarantees to be applied to real datasets, leading to performance gains—e.g., outperforming HNSW on GIST dataset.
  • For $d=2$, beam search has minimal impact, but its effect grows substantially with $d$, confirming its value in high-dimensional settings.
  • Theoretical predictions on step count and required degree align with empirical results: step count drops from 200 to 4 as $d$ increases from 2 to 16, while beam search keeps degree low.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.