Algorithm 2. SNN query.
| 1: Input: Query vector q; user-specified radius R; output from Algorithm 1 |
| 2: Compute |
| 3: Compute the sorting score of xq, i.e., |
| 4: Select candidate index range J so that for all |
| 5: Compute using the precomputed |
| 6: Return: Points xj with according to Eq. (4) |