- The paper introduces the ANNGR problem and proposes the DLH framework to efficiently integrate graph range filters with ANN search.
- It leverages distance-aware labeling, Bloom filter compression, and memoization to handle complex graph topologies and reduce redundant computations.
- Experimental results indicate up to 70.3% throughput improvement and over 98.5% recall while maintaining modest space overhead on large datasets.
Approximate Nearest Neighbor Search with Graph Range Filters: A Technical Analysis
Approximate Nearest Neighbor (ANN) search under filtered conditions is increasingly critical for large-scale vector retrieval, especially as vector databases underpin a broad array of Retrieval-Augmented Generation (RAG) and AI systems. Existing filtered ANN paradigms typically support only attribute-based constraints such as numerical ranges or categorical values, which are insufficient for practical scenarios involving complex structural constraints. This paper introduces and formalizes the Approximate Nearest Neighbor Search with Graph Range Filters (ANNGR) problem: given a set of vectors, each mapped to a node in a filter graph, retrieve the top-k nearest vectors (in embedding space) whose associated nodes are within r hops from the query node in the graph.
The ANNGGR setting poses two primary technical challenges:
- Attribute explosiveness: The set of candidate nodes for the graph range constraint scales with the number of vectors, making existing attribute-partitioned indexing inefficient.
- Irregular range distributions: Real-world graph topologies induce unpredictable, overlapping, and highly irregular r-hop neighborhoods, limiting the effectiveness of precomputation or simple attribute-based filtering.
These challenges necessitate novel indexing and filtering mechanisms to enable efficient, high-quality ANN search over graph-range-constrained subsets.
Figure 1: The space and candidate distribution challenges intrinsic to the ANNGR problem, arising from complex graph topology and high attribute cardinality.
The DLH Framework: Distance-Aware Labeling with Hashing
To address ANNGR, the authors propose DLH: a distance-aware labeling index with hashing compression, designed for efficient in-range filtering after standard ANN candidate selection. DLH is built upon two technical components:
- Distance-Aware Labeling (DAL): For each node in the graph, maintain a partition of its Pruned Landmark Labeling (PLL) hubs, grouped by shortest-path distance up to r. In-range verification for two nodes reduces to computing set intersections among the corresponding DAL groups, pruned by the constraint i+j≤r for group indices.
Figure 2: An illustration of Distance-Aware Labeling, showing partitioned labeling sets indexed by path distance.
- Hash-Based Compression via Bloom Filters: Large DAL sets are compressed using Bloom filters, supporting constant-time approximate set intersection checks. To balance recall and efficiency, only sets with cardinality exceeding a threshold are hashed, while smaller sets are maintained explicitly.
Figure 3: A working example of the DLH index, with both explicit sets and Bloom filters for labeling sets.
Pruned intersection and early-stopping strategies are applied to accelerate in-range queries by leveraging the distance-awareness of labeling sets and the probabilistic guarantees of Bloom filters.
Figure 4: Overview of DLH indexing, showing ANN search pipeline, label construction, and Bloom filter integration.
The approach supports efficient post-filtering: HNSW-based candidate generation, with rapid post-hoc filtering using exact or approximate set intersections according to representation.
DLH-M: Inference-Aware Memoization
A key observation is that in ANNGR queries, the query node's labeling sets are encountered repeatedly as candidates are evaluated. DLH-M introduces a memoization strategy, precomputing and storing hash indices for the query node's explicit labeling sets. This eliminates duplicate hash computations across numerous set-Bloom filter intersections within a single query, substantially improving throughput without impacting output quality.

Figure 5: Example demonstrating memoization in DLH-M, showing the reuse of precomputed hashes for multiple candidate in-range tests.
The theoretical complexity for in-range checks thus reduces from O(dvq​<​t) per candidate (without memoization) to amortized O(dvq​<​t), where dvq​<​ is the total size of explicit labeling sets and t is the mean degree.
Experimental Evaluation
Comprehensive experiments are conducted on standard datasets (SIFT, GIST, DEEP, YFCC), each comprising one million vectors linked to synthetic Erdos-Renyi filter graphs. Multiple baselines are considered, including HNSW-based post-filtering, range-restricted pre-filtering, and recent predicate-agnostic vector-structured indices.
Throughput and Recall
DLH and DLH-M consistently deliver superior queries-per-second (QPS), improving throughput by up to 70.3% over strong baselines while maintaining recall rates above 98.5% under default Bloom filter false positive probability (FPP) of 0.01.


Figure 6: Experimental results showing QPS and recall vs. Bloom filter FPP; high recall is maintained across varying FPP.
When varying the graph range r, QPS stabilizes as r0 increases and recall remains robust, validating the scalability and insensitivity of the approach to graph density and query selectivity.


Figure 7: Experimental results on QPS and recall as graph range r1 varies, confirming stability of DLH variants.
Scalability
Throughput and recall remain stable as dataset and graph sizes increase from r2 to r3 vectors, highlighting the design's robustness for high-scale applications.


Figure 8: Scalability test showing consistent QPS and recall across increasing dataset sizes.
Space Overhead
DLH's space overhead is modest—consuming less than 1.29× the storage of the original HNSW index on large-scale datasets. DAL alone incurs substantially higher overhead, confirming the effectiveness of hash-based set compression.



Figure 9: Index size comparison of HNSW, DAL, and DLH under varying graph sparsity parameters.
Implications and Future Directions
The DLH framework concretely extends the filtered ANN paradigm, enabling applications over arbitrary graph-constrained domains such as knowledge graphs, graph-RAGs, and multi-relational agent memories. By modeling structural constraints as graph ranges and optimizing both index construction and query-time evaluation, DLH generalizes classical attribute filters to graph-structured predicates.
Theoretical implications include:
- Demonstration of pruning and early-stopping for graph-based predicates.
- Use of Bloom filters not simply for set membership, but for cardinality-aware intersections with controlled recall loss.
- Memoization as a systematic optimization in vector database queries.
Practically, the techniques could be further extended to support dynamic graphs, hierarchical filters, or multi-hop/aggregation-based structural queries. Integrating learning-based graph filters or exploring adaptive representations (beyond Bloom filters) may further increase efficiency or flexibility.
Conclusion
This work introduces the ANNGR problem, advancing the state of ANN search through the DLH and DLH-M frameworks—marrying structural graph constraints with high-performance, low-overhead vector retrieval. Empirical evidence shows that these methods outperform prior solutions in both throughput and space efficiency, while delivering near-exact recall. The approach holds strong promise for next-generation knowledge systems requiring both semantic similarity and complex graph-aware filtering (2607.00727).