Grid-Index Algorithm for Reverse Rank Queries

Yuyang Dong, Hanxiong Chen, Jeffrey Xu Yu, Kazutaka Furuse, Hiroyuki KitagawaEDBT 2017

In modern database systems, Top-k queries are ubiquitous: "Given my preferences, what are the best products for me?" However, for manufacturers and marketers, the inverse is often more valuable. The Reverse Rank Query (RRQ) asks: "Given this new product, which customers would find it among their top choices?"

While conceptually simple, RRQs are computationally demanding. A recent study by Yuyang Dong and colleagues introduces the Grid-Index Algorithm (GIR), a novel approach that eschews complex tree structures in favor of a high-speed, approximate scan. This method effectively bypasses the "curse of dimensionality" that has long plagued traditional spatial indexing.

The Challenge of High Dimensionality

Reverse Rank Queries require calculating the inner product (a weighted sum of attributes) between a product and every user preference in a database. Traditionally, researchers relied on R-trees to prune the search space by grouping data into Minimum Bounding Rectangles (MBRs). If an entire rectangle falls outside the target range, the points within it are skipped.

Geometric representation of user preferences and product attributes in a reverse rank query space.

However, as the number of dimensions ($d$) increases, these MBRs begin to overlap significantly. In spaces where $d > 6$, the "filterable space" for R-trees shrinks toward zero. Mathematical analysis shows that in 10 dimensions, only about 0.8% of the space might be effectively pruned. Consequently, tree-based methods often become slower than a simple linear scan due to the overhead of managing the complex hierarchy.

The Grid-Index Algorithm (GIR)

The GIR approach shifts the focus from spatial hierarchy to CPU efficiency. Recognizing that CPU cycles—specifically multiplications—are the primary bottleneck in high-dimensional queries, GIR implements a three-step optimization process:

  1. The Grid-Index: The attribute value range is divided into $n$ equal partitions. The algorithm pre-calculates a 2D array containing the multiplication results for all possible partition combinations.
  2. Approximate Vectors: Data points and user preferences are converted into compact bit-string "approximate vectors" of partition indices, minimizing memory and I/O overhead.
  3. Filtering via Bounds: During a query, GIR performs a rapid lookup of Lower ($L$) and Upper ($U$) score bounds. If a point's $U$ bound is worse than the query threshold, it is discarded. Crucially, expensive multiplications are only performed for the tiny fraction of points where bounds overlap the query score.

By using a $32 \times 32$ grid, the algorithm can filter out more than 99% of data points using only simple additions, which are significantly faster for modern CPUs than multiplications.

Experimental Results

The authors evaluated GIR against state-of-the-art tree-based algorithms, BBR and MPA, using both synthetic and real-world datasets (including HOUSE, COLOR, and DIANPING).

CPU time comparison between GIR (labeled as SIM) and traditional tree-based methods (BBR, MPA) as dimensionality increases from 2 to 20.

The results demonstrate clear "Dimensionality Dominance." While tree-based methods may hold a slight edge in very low dimensions ($d < 4$), their performance degrades exponentially as dimensionality grows. In contrast, GIR remains remarkably stable. At $d=20$, GIR is orders of magnitude faster than its R-tree-based counterparts. Furthermore, GIR scales linearly with dataset size, making it highly suitable for large-scale market analysis involving millions of users.

Conclusion and Future Directions

The Grid-Index Algorithm proves that for high-dimensional reverse rank queries, a "smart scan" powered by approximation and CPU optimization outperforms traditional spatial indexing. Future work aims to refine the grid structure for skewed data distributions and optimize the algorithm for sparse vectors, where user preferences often contain many zero-value attributes.

Summary updated

BibTeX
@inproceedings{dong2017grid,
  author = {Yuyang Dong and Hanxiong Chen and Jeffrey Xu Yu and Kazutaka Furuse and Hiroyuki Kitagawa},
  title = {{Grid-Index Algorithm for Reverse Rank Queries}},
  booktitle = {EDBT},
  year = {2017},
  doi = {10.5441/002/edbt.2017.28},
}
Figure