- This repository provides the implementation of the paper QSRP: Efficient Reverse
$k$ -Ranks Query Processing on High-dimensional Embeddings. - This is a fast algorithm for the reverse
$k$ -ranks query in high dimensionality.
-
Linux OS (Ubuntu-20.04).
-
g++ 9.4.0(or higher version) andOpenmp. -
openblas,eigen3,armadillo,boost-1.80andspdlog- For Ubuntu user, please see the comments in
build-project.shfor fast installation
- For Ubuntu user, please see the comments in
-
CUDA (optional)
- You can set
USE_CUDAas OFF in CMakeLists.txt to disable CUDA
- You can set
cd reverse-k-ranks/
sh build-project.sh
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j 16
# In run_rkr.py, change the `index_dir` and `dataset_dir` to your directory
python3 run_rkr.py
The code runs the dataset included in reverse-k-ranks/dataset/
In run_rkr.py:
GridIndex: the Grid method shown in the framework
Rtree: the MPA method in the paper
QS: QSRP without regression-based pruning
QSRPNormalLP: the QSRP method
QSRPUniformLP: the QSRP-DT method, see Figure 17 in the paper
US: Uniform Sample, the sampling-based baseline solution
In run_rkr_update.py
QSRPNormalLPUpdate is the QSRP update method shown in the paper
QSUpdate is the update version of QS
We have used LIBPMF (https://www.cs.utexas.edu/~rofuyu/libpmf/) as the matrix factorization model to generate the embedding.
To download the dataset, you can refer to https://drive.google.com/drive/folders/1UloY14usLHJxSGVdoharyUUPc7nAcPdl?usp=sharing