# A Reputation-Based Collaborative User Recruitment Algorithm in Edge-Aided Mobile Crowdsensing
## 4 Reputation-Based Collaborative User Recruitment Algorithm
### Process of Reputation-Based Collaborative User Recruitment Algorithm  
To help the cloud platform find the most suitable participant to accomplish the task efficiently and qualitatively, we propose a reputation-based collaborative user recruitment algorithm (RCUR) by introducing the user reputation method and collaborative sensing with the purpose of achieving a higher task completion rate and bigger coverage. It is a task-centered algorithm to improve the benefits of tasks and cloud platforms. Then we apply the greedy algorithm to help us solve the problem. The specific process of the RCUR algorithm is described as follows and shown in Algorithm 1.  
After the cloud platform \(P\) publishes the tasks \(\theta=\left(\theta_{1},\theta_{2},\ldots,\theta_{j}\right)\) from some applications or the requesters, these mobile users \(U\) volunteer to take part in these tasks, and they will choose what kinds of tasks to participate in according to the information provided on the tasks. According to Equation (2), in order to achieve the goal of maximizing the sensing spatial coverage area of the tasks, the problem of user recruitment can be expressed as \(Maximize\Sigma\Re_{\theta_{j}}\). However, it is difficult to find the optimal user set for the whole task. Hence, the greedy algorithm is used to solve this issue. We divide the whole problem into several sub-problems and find the optimal solution for each sub-problem. In our system, for each task \(\theta_{j}\), the cloud platform \(P\) will select the users who are close to the task in time and space and whose costs are less than the reward as the candidates. It will form a subset of users \(S_{Cnn}=(u_{1},u_{2},\ldots,u_{x})\) for the task \(\theta_{j}\). Then the user reputation module will evaluate the performance of the users in \(S_{Cnn}\) and update their past reputation scores \(\sigma_{u_{i}}(t^{-})\). Then \(P\) calculates the user's instantaneous reputation score \(\sigma_{u_{i}}^{inst}(t)\). Finally, \(P\) can attain the user \(u_{i}\) reputation score \(\sigma_{u_{i}}(t)\) for the task \(\theta_{j}\) at time \(t\).  
```
0:
1:for\(u\) in \(U\)do
2:\(D_{u_{i},\theta_{j}}\leq D_{\max},t_{u_{i}}\in t_{\theta_{j}}\)
3: form the candidate set \(S_{Can}=(u_{1},u_{2},\ldots,u_{x})\)
4:end
5:for\(u\) in \(S_{Can}\)do
6: Update their past reputation scores \(\sigma_{u_{i}}(t^{-})\)
7: Calculate the user instantaneous reputation score \(e_{u_{i}}^{inst}(t)\)
8: Get the user \(u_{i}\) reputation score \(\sigma_{u_{i}}(t)\)
9: Calculate \(f_{u}\) of \(u\in S_{Can}\)
10: Select \(u_{i}\in S_{Can}\) who has max \(f_{u}\)
11:end
12:if\(S_{Can}=\varnothing\)
13: Calculate \(f_{S_{u}}\) of \(S_{u}\)
14: Select \(S_{n}\) that Maximize \(f_{S_{n}}\)
15:end
```  
**Algorithm 1**A reputation-based collaborative User Recruitment algorithm (RCUR) in edge-aided MCS  
Next, for each task \(\theta_{j}\), we establish a fitness function \(f_{u}\) that is based on the user reputation and cost for the task to recruit the most suitable user to meet the requirements of the task. However, in some areas with insufficient or very few users, we further utilize the static nodes to supplement and replace the users to collect the sensing information for the tasks. After that, we comprehensively consider the locations, sensing radius, and cost, then deduce the fitness function \(f_{S_{n}}\) for the task to recruit the optimal static node.  
In different conditions, our proposed RCUR algorithm presents two fitness functions \(f_{u}\) and \(f_{S_{u}}\), then selects the most suitable participant based on the highest value of the fitness function to accomplish the tasks. For all tasks, the greedy algorithm is adopted to help the cloud platform select the most suitable user or edge node for each task. When all tasks time end, the user or the edge node for each task will form the solution set for all tasks.