---
title: Proximity Graphs with Filter Support
url: https://www.emergentmind.com/topics/proximity-graphs-with-filter-support
type: topic
---

# Proximity Graphs with Filter Support

A proximity graph with filter support is a graph-based data structure or index designed to efficiently answer similarity or pattern queries under user-specified constraints or filters. These filters often operate over attribute metadata, lifespans, or arbitrary user predicates, and are integrated directly into the graph construction or traversal algorithms. This approach enables single-stage search processes for tasks such as attribute-constrained nearest neighbor search, range-filtered similarity search, temporal pattern mining under durability constraints, and robust support for arbitrary filter types and selectivities. The following sections review the principal methodologies and theoretical innovations underpinning proximity graphs with filter support, representative solution frameworks, analytical properties, and empirical findings in the literature.

## 1. Formal Problem Models and Taxonomy

The general proximity graph with filter support problem can be formalized as follows:

- Given a dataset of vectors $\{v_i\} \subset \mathbb R^d$ and corresponding attribute tuples $(a_{i1},\ldots,a_{im})$ or temporal labels,
- Given a dissimilarity function $\mathrm{dist}(\cdot, \cdot)$ (commonly Euclidean or cosine),
- Given a filter or predicate $f: V \to \{\mathrm{true}, \mathrm{false}\}$, often with structural or semantic domain,
- Find the top $K$ nearest neighbors to a query $q$ among those $v$ satisfying $f(v)=\mathrm{true}$, or enumerate subgraphs that satisfy additional filter conditions (such as temporal durability or aggregate attribute coverage) [2210.14958][2403.16312][2409.02571][2602.10258].

These filter types include:
- **Arbitrary user predicates:** as in AIRSHIP, where $f$ is a black-box function [2210.14958].
- **Numeric attribute ranges:** e.g., RFANN queries as $[a_l, a_r]$ [2409.02571].
- **Equality, Boolean, and subset-based filters:** e.g., label, tag or attribute conjunction filters [2602.10258].
- **Temporal durability constraints:** where both structure and persistence (e.g., intersection of lifespans) define valid subgraphs [2403.16312].

A table of prominent scenarios:

| Task Type                          | Filter Type            | Key Reference       |
|-------------------------------------|------------------------|--------------------|
| Constrained ANN                     | Boolean/user predicate | [2210.14958]       |
| Range-filtered ANN                  | Numeric range          | [2409.02571]       |
| Robust filtered ANN (multi-type)    | Arbitrary              | [2602.10258]       |
| Durable pattern mining              | Temporal/lifespan      | [2403.16312]       |

## 2. Graph Structures: Index Construction and Attribute Integration

Three primary strategies have emerged to couple proximity graph construction with filter-awareness:

### 2.1 Filter-Agnostic Graph with Online Filtering

Classical proximity graphs (e.g., HNSW or Vamana) are constructed ignoring filters; filters are enforced only during query traversal or as a post-processing step. This allows arbitrary filters without index change but incurs efficiency and recall penalties under selective filters [2210.14958].

### 2.2 Multi-Graph or Segment-Tree Approaches

For range or categorical filters, a collection of "elemental" proximity graphs is precomputed—each indexing a subset (segment) of the dataset according to the attribute's value, such as segment tree partitions for contiguous ranges. At query time, a valid subgraph is dynamically assembled by on-the-fly union or traversal of relevant segment graphs. Space complexity is $O(n m \log n)$ for degree $m$ [2409.02571].

### 2.3 Joint Attribute Graphs (JAG) Framework

Attributes are mapped to continuous "attribute distances" and "filter distances," producing a unified structure. At each construction layer, the typical vector distance is combined lexicographically with capped attribute distances under a set of thresholds $T$. Edges are allocated and pruned such that the resulting index remains robust to different filter selectivities and types [2602.10258].

In the temporal/durable graph case, filter support is enabled structurally through interval trees and cover trees/quadtree indexing over both vector and temporal/lifespan axes [2403.16312].

## 3. Filter-Aware Query Algorithms

Efficient query processing in proximity graphs with filter support leverages either explicit or implicit filter integration:

### 3.1 AIRSHIP: Constrained Search with User-Defined Functions

Search begins from sampled "seed" points known to satisfy $f(\cdot)$ (via an $O(s)$-size sample, $s \ll n$) and employs a two-directional traversal using two priority queues: one for filter-satisfied nodes and one for others. The $\alpha$-fractional heuristic enforces a balance between exploitation within filter-satisfying clusters and exploration into yet-unsatisfied neighborhoods. Nodes are added to result heaps only if $f(v) = \mathrm{true}$ [2210.14958].

### 3.2 iRangeGraph: Dynamic Range-Constrained Traversal

For RFANN, a search is initialized from the median rank of the range-filtered interval. Edges for each node are selected on-the-fly from the $O(\log n)$ elemental graphs covering the relevant range. The beam search is performed only over nodes within $[L,R]$, with expansion determined by the segment tree [2409.02571].

### 3.3 JAG: Unified Greedy-Search Over Attribute and Filter Distances

JAG applies a greedy beam search over a single graph. At query time, candidate neighbors are ranked lexicographically by $(\text{filter distance}, \text{vector distance})$, ensuring traversal is guided toward filter-satisfying regions while maintaining vector similarity. Because edge selection at index construction covers all relevant attribute thresholds, no dead-ends arise for any filter type or sparsity [2602.10258].

### 3.4 Enumeration of Durable Patterns

Temporal proximity graphs support queries for $\tau$-durable patterns (triangles, paths, etc.) via near-linear time algorithms, using interval trees for lifespan overlap and cover/quadtree structures for proximity [2403.16312]. Incremental data structures enable reporting only new patterns as durability thresholds are changed interactively.

## 4. Complexity, Robustness, and Empirical Evaluation

### 4.1 Complexity

- **AIRSHIP**: For sample size $s$ and $T$ visited nodes, $O(s + T (d + \log T))$ query time, usually with $T \ll n$ [2210.14958].
- **iRangeGraph**: Space and build time $O(n m \log n)$; per-node edge-selection in $O(m + \log n)$, beam search of $O(k)$ candidates for top-$k$ queries [2409.02571].
- **JAG**: Index build time $O(n |T| l_b R)$ ($l_b=$beam size, $R=$degree, $|T|=$#thresholds), query time $O(l_s R)$ [2602.10258].
- **Durable patterns**: Preprocessing $O(n \varepsilon^{-O(d)} \log^{3} n)$, pattern enumeration and update cost $O(\text{OUT} \cdot \varepsilon^{-O(d)} \log^3 n )$ [2403.16312].

### 4.2 Robustness Across Filter Types

- JAG achieves recall and throughput that remain robust to filter type, selectivity, and correlation with embedding similarity. Attribute and filter distances ensure the graph is navigable under arbitrary constraints [2602.10258].
- iRangeGraph matches "oracle" (pre-materialized) approaches in recall and QPS, but with feasible space and construction cost [2409.02571].
- AIRSHIP demonstrates throughput improvements of $10\times$–$100\times$ over post-filtered HNSW for $p\in[0.1,0.9]$ selectivities [2210.14958].
- Durable pattern enumeration scales linearly on large ($n>10^6$) proximity graphs [2403.16312].

Empirical evaluations consistently focus on large-scale benchmarks such as SIFT1M, MNIST, LAION, YFCC10M, and web-scale retrieval contexts [2210.14958][2409.02571][2602.10258].

## 5. Optimization Strategies and Parameterization

Key algorithmic strategies and their parameter considerations include:

- **Seed sampling:** For filters with retention $p>0$, sample $s\approx c/p$ to have about $c$ satisfied seeds (AIRSHIP) [2210.14958].
- **Mixing ratio $\alpha$:** Adaptive $\alpha$-balancing in AIRSHIP for optimal trade-off between cluster exploitation and exploration [2210.14958].
- **Segment tree design:** Balancing segment size and depth determines iRangeGraph's index size and edge-redundancy [2409.02571].
- **Joint threshold selection:** Multiple attribute thresholds in JAG's construction ($T$) enable consistent performance across selectivities; 3-4 thresholds empirically suffice [2602.10258].
- **Beam and degree parameters:** Search and build beam sizes ($l_b, l_s$), and graph degrees ($m, R$) define the QPS/recall/space trade-off envelope [2210.14958][2409.02571][2602.10258].

Recommended settings (for $p \gtrsim 0.1$ or moderate selectivity): $M=32,64$ (graph degree), $s = \min(5000, 5/p)$ (sample size), $\alpha$ matched to graph neighbor statistics, $m=16$–$64$ (degree in iRangeGraph), $|T|=3$–$4$ (thresholds in JAG).

## 6. Extensions and Applications

Proximity graphs with filter support generalize to:

- Multi-attribute filtered search (e.g., combination of range and categorical attributes), with probabilistic edge sampling and query-guided neighbor selection [2409.02571][2602.10258].
- Temporal networks and mining of resilient or persistent structures, enabled by combining proximity and interval/durability constraints, supporting interactive pattern analytics [2403.16312].
- Robust integration in retrieval and recommendation systems where filters range from simple tags to arbitrary complex Boolean logic [2210.14958][2602.10258].

A plausible implication is that filter-supporting proximity graphs increasingly serve as the backbone for large-scale vector search systems that must efficiently answer filtered queries at web scale, without precomputing dedicated indices for every possible filter configuration.

## 7. Comparative Summary

A synthesis of modern approaches:

| Method        | Filter Support       | Index Structure                | Complexity        | Recall/QPS Robustness              |
|---------------|---------------------|--------------------------------|-------------------|------------------------------------|
| AIRSHIP       | Arbitrary, arbitrary| Single proximity graph + seeds | $O(s + T d)$      | High ($p>0.1$), scalable           |
| iRangeGraph   | Numeric range       | $O(\log n)$ segment graphs     | $O(n m \log n)$   | Near-oracle with $O(n m \log n)$   |
| JAG           | Arbitrary (label, range, subset, Boolean) | Single graph with attribute distances | $O(n|T|l_b R)$ | Uniform; outperforms state-of-art  |
| Durable Graph | Temporal/durability | Cover tree + interval trees    | $O(n \varepsilon^{-O(d)} \log^3 n)$| Scalable to millions; exact in $\ell_\infty$ |

These architectures collectively establish the state-of-the-art in filter-aware similarity and pattern search, demonstrating empirical and theoretical performance nearly matching filter-specialized or filter-naive oracular baselines, but at practical space and compute budgets. For full constructions, algorithms, and analytical proofs, see the cited works [2210.14958][2403.16312][2409.02571][2602.10258].

Source: https://www.emergentmind.com/topics/proximity-graphs-with-filter-support