Skip to main content
. 2024 Mar 29;10:e1929. doi: 10.7717/peerj-cs.1929

Algorithm 2. SNN query.

1: Input: Query vector q; user-specified radius R; output from Algorithm 1
2: Compute xq:=qμ
3: Compute the sorting score of xq, i.e., αq:=xqTv1
4: Select candidate index range J so that |αjαq|R for all jJ
5: Compute d:=x¯(J)X(J,:)Txq using the precomputed x¯=[xi¯]
6: Return: Points xj with dj(R2xqTxq)/2 according to Eq. (4)