# An Efficient Dummy-Based Location Privacy-Preserving Scheme for Internet of Things Services
## 3 Enhanced-DLP Scheme
### The Basic Idea of the Enhanced-DLP Scheme
Repeat Step (5) while the size of anonymity set \(C\) is less than \(k\). 7. If size (\(k_{b}\)) \(\leq\) 1, the Enhanced-DLP chooses \(2k-\varepsilon\) locations less than \(P\) and other \(2k-\omega\) locations greater than the \(p\) as \(4k-\omega-\varepsilon\) candidate locations from the sorted set \(S\) and denoted as \(S_{b}\). Both \(\varepsilon\) and \(\omega\) are set by users based on their privacy requirements, and \(\varepsilon\) is greater than \(\omega\). Then, the Enhanced-DLP randomly gets one location from \(S_{b}\) as a dummy location, and puts this location and the user's location \(p\) into \(C\). 8. In order to meet the requirements of k-anonymity, the Enhanced-DLP selects other \(k-2\) locations from \(S_{b}\). For the \(i^{th}\) location that Enhanced-DLP selected, The Enhanced DLP must make sure that \(H_{i}\) is the largest of the remaining positions in set \(S_{b}\). 9. If the size of set \(C\) < \(k\). Repeat Step (8). And then outputs the anonymous set \(C\). The detailed pseudo-code of the Enhanced-DLP is seen in Algorithm 1. ```
0: The set of all locations with query probability \(S\); users' location \(p\). 0: The optimal set of dummy locations \(C\). 1: Sort \(S\) in ascending order;
2:\(k_{b}\leftarrow\) Select the locations which has the same query probability as user's real location \(p\) from sorted set \(S\). 3:if size(\(k_{b}\))\(\geq k\)then
4:\(C\leftarrow\)Randomly select \(k-1\) dummy locations from \(k_{b}\). 5: Randomly insert location \(p\) into set \(C\)
6:endif
7:if\(1<size(k_{b})<k\)then
8:\(C\leftarrow\C\cup k_{b}\), \(S\gets S/k_{b}\)
9:\(C\leftarrow\C\cup p\), \(S\gets S/p\)
10: D\(\leftarrow\) Choose \(k-1\) locations less than user's location \(p\) and \(k-1\) locations greater than user's location \(p\) in the sorted list \(S\);
11:for\(i=1\); \(i<k-2\); \(i++\)do
12:\(p_{max}\leftarrow\)max(C)
13:\(p_{min}\leftarrow\)min(C)
14: Find one location from set \(D\), which is the location with maximum query probability being less than \(p_{min}\) in set \(D\), denoted as \(p_{min-max}\);
15: Find one location from set \(D\), which is the location with minimum query probability being greater than \(p_{max}\) in set \(D\), denoted as \(p_{max-min}\);
16:if\(H\left(C,p_{max-min}\right)>H(C,p_{min-max})\)then
17:\(C\gets C\cup p_{max-min}\), \(D\gets D/p_{max-min}\);
18:else
19:\(C\gets C\cup p_{min-max}\), \(D\gets D/p_{min-max}\);
20:endif
21:endfor
22:else
23:\(S_{b}\leftarrow\) Choose \(4k-\omega-\varepsilon\) candidate locations, whose \(2k-\omega\) locations less than user's location \(p\) and \(2k-\varepsilon\) locations greater than user's location \(p\) in the sorted list \(S\)
24: Randomly choose location \(i\) from set \(S_{b}\);
25:\(C\gets H\cup i\), \(S_{b}\gets S_{b}/i\);
26:for\(j=1\); \(j\leq k-2\); \(j++\)do
27: Choose one location \(h\) from \(S_{b}\), which makes sure that \(H(C,h)\) is the maximum in set \(S_{b}\);
28:\(C\gets C\cup h,S_{b}\gets S_{b}/h\);
29:endfor
30:endif
31:the optimal set \(C\). ```  
**Algorithm 1** Enhanced-DLP algorithm.