# Stable Matching of Users in a Ridesharing Model
## 4 Experimental Simulations
### Case Study  
This section presents a small case study of the ridesharing model introduced in Section 2. Suppose a driver \(d\) bidding a ridesharing service in the Metropolitan Zone of Guadalajara (MZG), Mexico. Commuting data are taken from the Google Maps platform, generating potential routes with real costs, times, and distances. Assume that \(d\) offers \(\sigma_{d}=2\) available seats for a ridesharing service, driving a small vehicle with a 1.6-L, 16-valve, four-cylinder engine with a combined fuel economy of 27 miles per gallon (mpg) and a fuel price of 83.30 Mexican pesos per gallon of regular gasoline. The user \(d\) publishes the route \(R_{d}=v_{0}a_{1}v_{1}a_{2}\cdots a_{k}v_{k}\) in the ridesharing system, where \(v_{0}\) represents the origin and \(v_{k}\) the destination. Figure 7 shows the route \(R_{d}\) considering the location points (20.4767, \(-103.4484\)) and (20.7439, \(-103.4285\)) as origin and destination, respectively. The total length of this route is \(\hat{w}(R_{d})=22.3\) miles with an estimated travel time \(t_{d\to R_{d}}=57\) min, and a transfer cost \(c(R_{d})=\$68.80\) Mexican pesos calculated by Equation (2). Figure 6: The approximated PoS of the solutions of the proposed algorithm. (**a**) PoS behavior in the increment of the number of passengers and drivers. (**b**) boxplot considering all the combinations. Figure 7: The route \(R_{d}\) (shown in blue) in which driver \(d\) offers a ridesharing service in the Metropolitan Zone of Guadalajara, Mexico. Assume three passenger users \(p_{1}\), \(p_{2}\), and \(p_{3}\), which seek to arrive at their destinations using public transportation based on the commuting data presented in Table 1. Given these data, they seek to improve their travel conditions by requesting a ridesharing service. As observed, user \(p_{1}\) has the exact origin and destination points as those contemplated in \(R_{d}\), but with a significant difference in traveling times due to their transportation mean. Furthermore, user \(p_{2}\) also intersects in the destination point of \(R_{d}\). Therefore, the ridesharing system proposes potential joint routes implying the following types of ridesharing: identical \(R_{p_{1}d}\), inclusive \(R_{p_{2}d}\), and partial \(R_{p_{3}d}\) (see Section 2). For simplicity's sake, suppose all users have a departure time of 9:00 am and a predefined slack time of ten minutes. Each passenger \(p\in\{p_{1},p_{2},p_{3}\}\) independently evaluates the savings produced by sharing its trip with \(d\) through the joint route \(R_{pd}\). The travel savings are measured in terms of cost and time savings by Equation (5). The cost savings for any \(p\), denoted as \(z_{p\to R_{pd}}\), is computed by the difference of the transfer costs when \(p\) travels in \(R_{pd}\) instead of \(R_{d}\), as expressed in Equation (3). The transfer costs depend on the route's total length, the vehicle's characteristics, or the trip's estimated fees. Table 2 shows the cost savings for \(p\) and \(d\) when they travel via \(R_{pd}\). On the other hand, time savings rely on the difference between the estimated travel times when \(p\) shares its trip or not, i.e., \(t_{p\to R_{p}}-t_{p\to R_{pd}}\). Additionally, an implicit loss of time is assumed by considering a delay in which \(d\) arrives to the origin point of \(R_{pd}\) at the instant of time \(t_{d\to R_{pd}}^{0}\). Considering that \(\eta_{p}=10\), \(t_{p\to R_{pd}}^{0}\) = 9:00, and \(t_{d\to R_{pd}}^{0}\) > 9:00 in Equation (4), the total time savings for \(d\) and \(p\), denoted as \(t_{d}(R_{pd})\) and \(t_{p}(R_{pd})\), respectively, are also shown in Table 2.  
Notice that the estimated cost savings for the passengers when they share their trip is low (even negative) due to the cheaper costs of traveling via public transportation; however, the total time savings for all cases are significant. Because of these noteworthy differences in time, the slack time is not necessarily limited to the ten minutes considered initially.