# Stable Matching of Users in a Ridesharing Model
## 2 The Proposed Model
### Reputation System  
The proposed model uses a _reputation system_ to assign a level of trust to each user regarding the quality of the service provided. In particular, this work uses a version of the EigenTrust algorithm of [41] to obtain, manage, and assign a reputation to each user (of type \(p\) or \(d\)) in the ridesharing system. This algorithm uses the notion of _transitive trust_, where the trust value of each user is generated from the authentic opinion of those with whom they have directly interacted. All users participate in the calculation of the trust values in a distributed way in peer-to-peer systems, making it easily scalable and efficient in terms of computational complexity [42; 43]. The EigenTrust algorithm outputs a global trust value, or global reputation, for each user on the system. Assume a set of users \(U=\{u_{1},u_{2},\ldots,u_{n}\}\) in the ridesharing system, where every \(u_{i}\in U\) is a user of type \(p\) or \(d\) interchangeably. By using the EigenTrust algorithm, a user \(u_{i}\) evaluates every transaction or service received by a user \(u_{j}\) in the ridesharing system. Let \(Y_{u_{i}\to u_{j}}\) be the set of services that \(u_{i}\) received from \(u_{j}\), then the _local reputation_ of \(u_{j}\) consists of the aggregation of the evaluation results performed by \(u_{i}\). The local reputation of \(u_{j}\) from the perspective of \(u_{i}\) is defined in Equation (6). \[m_{u_{i}}(u_{j})=\sum_{z\in Y_{u_{j}\to u_{j}}}Y_{u_{i}}(z), \tag{6}\]  
where \(Y_{u_{i}}\) is a function that evaluates the transaction or the service provided by \(u_{j}\) based on the following metrics:  
* [noitemsep,topsep=0 pt]
* Punctuality. This metric has a value of \(+1\) if the service provided by \(u_{j}\) starts on time; otherwise, the value is \(-1\). * Cordiality. This metric has a value of \(+1\) if the service of \(u_{j}\) was kind and respectful; otherwise, the value is \(-1\). * Satisfaction. This metric has a value of \(+1\) if the service provided by \(u_{j}\) fulfilled the expectations; otherwise, the value is \(-1\). * Safety. This metric has a value of \(+1\) if the service provided by \(u_{j}\) and the users involved in it are considered 'trustworthy'; otherwise, the value is \(-1\). The reputation that \(u_{i}\) locally assigns to \(u_{j}\), denoted as \(m_{u_{i}}(u_{j})\), is normalized considering the previous rated users. This normalization seeks to avoid that arbitrary values can be assigned to'malicious' users and that users with more services prevail over others. Equation (7) presents a normalized version of \(m_{u_{i}}(u_{j})\) when \(\sum_{j}\max(m_{u_{i}}(u_{j}),0)\
eq 0\). If \(u_{i}\) does not know anyone or does not trust anyone, then \(\hat{m}_{u_{i}}(u_{j})=1/(n-1)\) where \(i\
eq j\). \[\hat{m}_{u_{i}}(u_{j})=\frac{\max(m_{u_{i}}(u_{j}),0)}{\sum_{j}\max(m_{u_{i}}( u_{j}),0)}. \tag{7}\]  
Note that negative scores are truncated to 0 in Equation (7). This truncation prevents the'selfishness' of some users from assigning arbitrarily low values to good users. It also avoids the _whitewashing_ of poor services since there is no distinction between those services and the new ones. Local reputation values are disseminated and aggregated based on a _transitive reputation_ schema to compute a global reputation in the system. Under this scheme, \(u_{i}\) estimates the reputation \(\hat{r}^{0}_{u_{i}}(u_{k})\) from any unknown user \(u_{k}\). To perform such an estimation, \(u_{i}\) requests the local reputation of \(u_{k}\) to each user of type \(u_{i}\) with whom \(u_{k}\) has interacted, i.e., \(\hat{m}_{u_{i}}(u_{k})\). Thus, the trust value that \(u_{i}\) assigns to \(u_{k}\) is based on the opinions of its acquaintances, as expressed in Equation (8).