Skip to main content
. 2023 Jan 19;25(2):201. doi: 10.3390/e25020201
Algorithm 2: Anonymous Query Set Generation Algorithm
Input: k, Z′, S, R, Local cache location dataset O, User’s current location loc
Output: Anonymous location set Z
1: Z = ;
2: if length(Z′) ≥ k − 1
3:         sort points in Z′ by predicted probability;
4:         return Z = the first k − 1 points in Z′ + {loc + Lap(εi)};
5: else
6:         Z = Z′;
7:         S′ = points in S that are in the range R;
8:         sort points in S′ by query probability;
9:         i = 0;
10:       while length(Z) < k − 1 do
11:                 if S′[i] is not in Z and S′[i] is not in O
12:                         Z + = S′[i];
13:                         if length(Z) == k − 1
14:                                 break;
15:                 i + + ;
16:       return Z = Z + {loc + Lap(εi)};