# A Search Efficient Privacy-Preserving Location-Sharing Scheme in Mobile Online Social Networks
## 7 Simulation and Results
### Simulation Setup  
The simulations are implemented by using JAVA programming language and conducted on a Windows machine with an Intel Core-i5 2.6 GHz, 16 GB RAM, and Microsoft Windows 7 OS. For pseudo-random function, we choose the hash function SHA-256 with an output size of 32 byte. Since the efficiency of querying strangers' locations directly relates to the number of strangers randomly selected by \(SNS\), we focus the research on the performance of querying friends' locations. In general, the grid structure is generated by the system and it does not change frequently. In addition, for an issuing user \(U\), the friend threshold distance of \(U\) is also usually set as a constant since it is meaningless to adjust \(d_{f}\) frequently when his/her privacy is not threatened. Therefore, in the process of querying friends' locations, we mainly focus on four parameters that directly relate to the performance of location-sharing systems. These four parameters are the number of users, the number of pseudo-IDs for each user, the number of friends for each user, and the query distance. The specific parameter settings of our simulations are shown in Table 3. In Table 3, \(n\) is the total number of users, and \(k\) is the number of pseudo-IDs for each user. \(GS\) represents the grid structure composed of 20 \(\times\) 20 grid cells and the size of each grid cell is 1 km \(\times\) 1 km. \(d_{f}\) indicates the threshold distance for friends. \(l\) means the query distance and \(f\) is the number of friends for each user. The performance metrics used in this paper are the query time and the effective users. The effective users are the number of users' pseudo-IDs sent from \(SNS\) to \(LS\), and the query time is the time cost on distance comparison function based on the number of the effective users. In addition, UDPLS allows an issuing user \(U\) to set the access control policy to resist attacks from trust-less friends, which leads to the result that a small number of \(U\)'s friends can not share locations with \(U\), so we set the proportion of \(U\)'s trust-less friends to be 1%. To compare the performance of our scheme with that of other schemes (i.e., MobiShare, UDPLS and CenLocShare), we set different parameter variables as follows:  
1. Under the condition of querying friends' locations, ten locations are randomly selected as the initial locations of an issuing user. The total number of users \(n\) is set to be 1000 and the users are randomly distributed throughout the grid structure. The number of pseudo-IDs for each user \(k\) and the query distance \(l\) of the issuing user are set as 10 and 5 km, respectively. The number range of friends for each user \(f\) changes from 50 to 90. We execute 100 times and then calculate the average number of effective users and the average time cost under different \(f\). The above settings are named scenario-1, which is used to explore the effect caused by \(f\). 2. Under the condition of querying friends' locations, ten locations are randomly selected as the initial locations of an issuing user. The total number of users \(n\) is set to be 1000 and the users are randomly distributed throughout the grid structure. The number of pseudo-IDs for each user \(k\) and the number of friends for each user \(f\) are set as 10 and 50, respectively. The query distance \(l\) of the issuing user changes from 1 km to 5 km. We execute 100 times and then calculate \begin{table}
\begin{tabular}{c c c} \hline \hline
**Item** & **Attribute** & **Specification** \\ \hline \(n\) & Variate & 1000–2500 \\ \(k\) & Variate & 10–30 \\ \(GS\) & Constant & 20 \(\times\) 20, 1 km \(\times\) 1 km \\ \(d_{f}\) & Constant & 5 km \\ \(l\) & Variate & 1–5 km \\ \(f\) & Variate & 50–90 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameter settings. the average number of effective users and the average time cost under different \(l\). The above settings are named scenario-2, which is used to research the effect caused by \(l\). 3.