# A Serious Gaming Approach for Crowdsensing in Urban Water Infrastructure with Blockchain Support
## 4 Methodology
### Crowdsensing Model
#### 4.1.1 VRP-Based Task Allocation Model  
The VRP model represents the platform-centric approach for MCS evaluated in this paper. While there are multiple variations of VRP used for solving different problems, such as those presented in Section 2, the model was adapted to the MCS scenario proposed in Section 5.1 by defining the context and required constraints. The VRP-based task allocation model is defined as follows: players are represented by vehicles, with capacities according to the reputation levels, while distance constraints define, e.g., the maximum travel distance. Tasks are represented by customers, with fixed locations and demands set according to the assigned priorities. Each vehicle has a starting point, i.e., player home, which corresponds to a depot, while the other nodes are associated with customers. To define the mathematical model in the context of the proposed solution, we consider the following notations:  
Figure 6: Evaluation of research papers statistics over time by keywords in the title; (**a**) number of papers by year and keywords; (**b**) histogram of paper keywords. \(N\in\{1,\,2,\,\ldots,\,n\}\) set of nodes \(V\in\{1,\,2,\,\ldots,\,nv\}\) set of vehicles (players) \(D\in\{1,\,2,\,\ldots,\,nd\}\) set of depots (player homes, i.e., starting locations) \(C\in\{nd+1,\,nd+2,\,\ldots,\,nd+nc\}\) set of customers (tasks) \(q_{i}\) demand of customer \(i\) (task priority) \(C_{k}\) capacity of vehicle \(k\) (player reputation) \(d_{k}\) range of vehicle \(k\) (player distance limit) \(C_{ij}^{k}\) traveling cost between node \(i\) and node \(j\) for vehicle \(k\) \(x_{ij}^{k}\in\{0,1\}\) variable showing if the arc between \(i\) and \(j\) is traversed by vehicle \(k\) \(y_{i}\) the vehicle load after visiting customer \(i\) \(P\) penalty constant i.e., for routes that do not include a depot  
The vehicle routing problem (distance-constrained multi-depot vehicle routing problem with heterogeneous fleet capacity) can be defined by a combinatorial optimization and integer programming problem [108; 109; 110], with an objective function defined in Equation (2) that consists in minimizing the total cost, subject to a set of constraints that are presented below:  
\[\min_{x}\sum_{i=1}^{nd+nc}\sum_{j=1}^{nd+nc}\sum_{k=1}^{nv}c_{ij}^{k}x_{ij}^{k} \tag{2}\]  
Constraints in Equations (3) and (4) are imposed to ensure that each customer (task) is visited (reported/resolved) exactly once by a vehicle (player) and then the vehicle should proceed to the next customer (task). \[\sum_{i=1}^{nd+nc}\sum_{k=1}^{nv}x_{ij}^{k}=1,\;\forall j\in C \tag{3}\]  
\[\sum_{j=1}^{nd+nc}\sum_{k=1}^{nv}x_{ij}^{k}=1,\;\forall i\in C \tag{4}\]  
Constraints in Equations (5) and (6) state that each vehicle (player) must start from a depot (player home) and return to the same depot after completing the tour, while it is not required to dispatch all vehicles. \[\sum_{j=nd+1}^{nd+nc}x_{ij}^{k}\leq 1,\;\forall k\in V_{i},\;i\in D \tag{5}\]  
\[\sum_{i=nd+1}^{nd+nc}x_{ij}^{k}\leq 1,\;\forall k\in V_{j},\;j\in D \tag{6}\]  
Constraints in Equations (7) and (8) enforce the condition that each vehicle (player) must belong to a depot (player home). \[\sum_{j=nd+1}^{nd+nc}x_{ij}^{k}=0,\;\forall k\
otin V_{i},\;i\in D \tag{7}\]  
\[\sum_{i=nd+1}^{nd+nc}x_{ij}^{k}=0,\;\forall k\
otin V_{j},\;j\in D \tag{8}\]  
The route continuity constraint, i.e., flow conservation equation, is defined in Equation (9). \[\sum_{i=1}^{nd+nc}x_{ij}^{k}=\sum_{i=1}^{nd+nc}x_{ji}^{k},\;\forall\;j\in C,\; k\in V \tag{9}\]The maximum capacity constraint (player reputation) is defined in Equation (10), while the maximum range constraint (travel distance) is defined in Equation (11) for each vehicle (player). \[\sum_{i=nd+1}^{nd+nc}\sum_{j=1}^{nd+nc}q_{i}x_{ij}^{k}\leq C_{k},\ \forall k\in V \tag{10}\]  
\[\min_{x}\sum_{i=1}^{nd+nc}\sum_{j=1}^{nd+nc}\sum_{k=1}^{nv}c_{ij}^{k}x_{ij}^{k} \tag{2}\]0  
In Equation (12), the constraint further imposes route continuity and prohibits the formation of routes that do not include a depot (player home).