Table of Contents
Fetching ...

Graph-Based Approximate Nearest Neighbor Search Revisited: Theoretical Analysis and Optimization

Xinran Ma, Zhaoqi Zhou, Chuan Zhou, Qi Meng, Zaijiu Shang, Guoliang Li, Zhiming Ma

TL;DR

This work addresses graph-based ANNS by focusing on Sparse Neighborhood Graph (SNG) and bridging theory with practice. It develops a martingale-based framework to analyze SNG construction, proving a tight out-degree bound of $O(n^{2/3+\epsilon})$ and a logarithmic search path length $O(\log n)$, while introducing a marginal optimality principle to select the truncation parameter $R$. The resulting principled optimization yields significant reductions in index construction time (2x–9x in some settings) and competitive or improved query performance compared to standard binary-search tuning. Empirical validation on large-scale benchmarks and a non-uniform GMM dataset confirms the theoretical predictions and demonstrates robust scalability and efficiency gains for practical deployment in systems like DiskANN/HNSW-like pipelines.

Abstract

Graph-based approaches to approximate nearest neighbor search (ANNS) have achieved remarkable success in enabling fast, high-recall retrieval on billion-scale vector datasets. Among them, the Sparse Neighborhood Graph (SNG) has emerged as a widely adopted graph structure due to its superior search performance. However, the theoretical understanding of SNG remains limited, leading to reliance on heuristic-based and often suboptimal truncation strategies. In this work, we aim to bridge the gap between theory and practice by providing formal guarantees for graph-based ANNS methods and proposing principled optimization strategies for the truncation parameter. By characterizing the index construction process through martingale-based analysis, we show that the degree of the index graph is $O(n^{2/3+ε})$, where $ε$ is an arbitrarily small constant. Furthermore, we prove that the expected search path length during query processing is $O(\log n)$. Based on these theoretical insights, we introduce a novel and principled method for selecting the truncation parameter $R$ in SNG. Experimental results demonstrate that our method achieves comparable or superior performance in terms of query latency and Recall@10 compared to commonly used binary search heuristics, while yielding 2x to 9x speedups in overall index construction.

Graph-Based Approximate Nearest Neighbor Search Revisited: Theoretical Analysis and Optimization

TL;DR

This work addresses graph-based ANNS by focusing on Sparse Neighborhood Graph (SNG) and bridging theory with practice. It develops a martingale-based framework to analyze SNG construction, proving a tight out-degree bound of and a logarithmic search path length , while introducing a marginal optimality principle to select the truncation parameter . The resulting principled optimization yields significant reductions in index construction time (2x–9x in some settings) and competitive or improved query performance compared to standard binary-search tuning. Empirical validation on large-scale benchmarks and a non-uniform GMM dataset confirms the theoretical predictions and demonstrates robust scalability and efficiency gains for practical deployment in systems like DiskANN/HNSW-like pipelines.

Abstract

Graph-based approaches to approximate nearest neighbor search (ANNS) have achieved remarkable success in enabling fast, high-recall retrieval on billion-scale vector datasets. Among them, the Sparse Neighborhood Graph (SNG) has emerged as a widely adopted graph structure due to its superior search performance. However, the theoretical understanding of SNG remains limited, leading to reliance on heuristic-based and often suboptimal truncation strategies. In this work, we aim to bridge the gap between theory and practice by providing formal guarantees for graph-based ANNS methods and proposing principled optimization strategies for the truncation parameter. By characterizing the index construction process through martingale-based analysis, we show that the degree of the index graph is , where is an arbitrarily small constant. Furthermore, we prove that the expected search path length during query processing is . Based on these theoretical insights, we introduce a novel and principled method for selecting the truncation parameter in SNG. Experimental results demonstrate that our method achieves comparable or superior performance in terms of query latency and Recall@10 compared to commonly used binary search heuristics, while yielding 2x to 9x speedups in overall index construction.

Paper Structure

This paper contains 33 sections, 9 theorems, 69 equations, 11 figures, 3 tables, 3 algorithms.

Key Result

Theorem 1

Given a dataset $P$ of $n$ points in $d$-dimensional space, with probability $1$, the maximum out-degree in the constructed SNG is bounded by $O(n^{2/3 + \epsilon})$ for any small constant $\epsilon > 0$.

Figures (11)

  • Figure 1: Comparison of total graph construction time
  • Figure 2: Query performance across varying $\alpha$ values on SIFT1M
  • Figure 3: Query performance across varying $\alpha$ values on GIST1M
  • Figure 4: Query performance across varying $\alpha$ values on DEEP1M
  • Figure 5: Degree distribution of GMM dataset
  • ...and 6 more figures

Theorems & Definitions (22)

  • Theorem 1
  • Theorem 2
  • Definition 3: Martingale
  • Lemma 4: Dynamic Property of $S'_t$
  • Definition 5: $M$-$t$ Level
  • Lemma 6: Pruning Probablity in SNG Construction
  • proof
  • Lemma 8: Sublinear Time Progress
  • proof : Sketch Proof
  • proof : Sketch Proof
  • ...and 12 more