Skip to main content
QUICK REVIEW

[Paper Review] Graph Reordering for Cache-Efficient Near Neighbor Search

Benjamin Coleman, Santiago Segarra|arXiv (Cornell University)|Apr 7, 2021
Advanced Image and Video Retrieval TechniquesComputer Science38 references5 citations
TL;DR

This paper proposes graph reordering as a cache-optimization technique to accelerate graph-based approximate near neighbor search, particularly in hierarchical navigable small-world (HNSW) indices. By reordering nodes to improve memory locality, the method reduces cache misses and achieves up to 40% faster query times with negligible overhead compared to index construction.

ABSTRACT

Graph search is one of the most successful algorithmic trends in near neighbor search. Several of the most popular and empirically successful algorithms are, at their core, a simple walk along a pruned near neighbor graph. Such algorithms consistently perform at the top of industrial speed benchmarks for applications such as embedding search. However, graph traversal applications often suffer from poor memory access patterns, and near neighbor search is no exception to this rule. Our measurements show that popular search indices such as the hierarchical navigable small-world graph (HNSW) can have poor cache miss performance. To address this problem, we apply graph reordering algorithms to near neighbor graphs. Graph reordering is a memory layout optimization that groups commonly-accessed nodes together in memory. We present exhaustive experiments applying several reordering algorithms to a leading graph-based near neighbor method based on the HNSW index. We find that reordering improves the query time by up to 40%, and we demonstrate that the time needed to reorder the graph is negligible compared to the time required to construct the index.

Motivation & Objective

  • Address poor memory access patterns in graph-based near neighbor search that lead to high cache miss rates.
  • Improve query performance in large-scale embedding search systems where low latency is critical.
  • Evaluate whether graph reordering—typically used in graph analytics—can accelerate near neighbor search, a task with distinct access patterns.
  • Determine the cost-benefit trade-off of reordering algorithms in the context of long-lived, heavily queried search indices.
  • Identify which reordering strategies are most effective for near neighbor graphs, given their unique structural properties.

Proposed method

  • Apply six state-of-the-art graph reordering algorithms—including objective-based (Gorder, RCM) and lightweight (degree-based) methods—to HNSW indices.
  • Reorder nodes to group frequently accessed neighbors in contiguous memory regions, improving CPU cache utilization during graph traversal.
  • Use beam search as the access pattern model to guide reordering, reflecting the typical node access behavior in HNSW query execution.
  • Measure performance on standard benchmarks (SIFT100M, GIST, DEEP100M) using query time and cache miss rate as key metrics.
  • Compare reordering overhead to index construction time to assess practical feasibility in production settings.
  • Evaluate the impact of reordering on recall and index structure, confirming it does not alter search behavior or accuracy.

Experimental results

Research questions

  • RQ1Can graph reordering significantly reduce cache misses and improve query performance in HNSW-based near neighbor search?
  • RQ2Which reordering strategies—objective-based or lightweight—yield the best performance gains for near neighbor graphs?
  • RQ3How does the time cost of reordering compare to the time required to construct the HNSW index in real-world deployments?
  • RQ4Does the effectiveness of reordering vary with dataset size, dimensionality, or per-sample storage cost?
  • RQ5Can reordering synergize with other optimization techniques like quantization or dimensionality reduction in graph-based search?

Key findings

  • Graph reordering reduces query time by up to 40% on large-scale datasets like DEEP100M and SIFT100M, especially in high-recall regimes.
  • Objective-based reordering methods such as Gorder and RCM consistently deliver the highest speedups, with 10–40% improvements depending on dataset size and recall level.
  • The time required to reorder the graph is typically an order of magnitude smaller than HNSW index construction time, making it practical for production use.
  • Lightweight reordering algorithms based on local node features (e.g., degree clustering) are ineffective for near neighbor graphs, likely due to pathological degree distributions.
  • Reordering is index-agnostic and applicable to any graph-based search method relying on sequential node traversal, suggesting broad compatibility.
  • The benefits of reordering are amplified when combined with dimensionality reduction or quantization, as smaller subspaces improve cache locality further.

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.