Abstract
Thanks to recent developments in ride-hailing transit services throughout the world, the peer-to-peer (P2P) ride-matching problem has been actively considered in academia in recent years. P2P ride-matching not only reduces travel costs for riders but also benefits drivers by saving them money in exchange for their additional travel time. However, assigning riders to drivers in an efficient way is a complex problem that requires focusing on maximizing the benefits for both riders and drivers. This study aims to formulate a multi-driver multi-rider (MDMR) P2P ride-matching problem, based on rational preferences and cost allocation for both driver and rider, which also allows riders to transfer between multiple drivers for their travels if needed. Tabu Search (TS) for system-optimal ride-matching and a Greedy Matching (GM) algorithm for stable ride-matching were developed to solve ride-matching cases. The results show that the developed algorithm can successfully solve the proposed P2P MDMR ride-matching problem. MDMR P2P ride-matching can be used in areas where not much demand for ride-sharing exists, or for long-distance travel. Also it can be applied to designs for a more efficient on-demand transit network which can allow for transfers between routes. Moreover, the comparison of results between two implemented approaches shows that system-optimal centralized ride-matching can bring more cost savings for all participants in the system, although it may not always be stable when riders and drivers can choose their ride-matching for their own maximum benefit.
In recent years, ride-sharing has become an important element of urban transportation. Thanks to emerging smartphones and mobile apps, it has become easy to connect travelers and drivers offering ride-sharing through these on-demand transit services ( 1 ). In the United States, major ride-hailing companies like Uber and Lyft have invested substantial funding in improving shared services to travelers. For example, Uber, a ride-hailing company, has the ride-sharing option called UberPool, which offers cheaper prices than those of ride-hailing services.
Although many studies have shown that shared ride-hailing services provide financial advantages and benefits to transportation networks over regular ride-hailing services, shared ride-hailing mobility services still have some issues that raise questions about their efficiency ( 2 ). Shared ride-hailing mobility may also increase deadheading for the ride provider and consequently increase travel time for ride requesters, which makes the system less efficient, with higher vehicle-miles traveled (VMT) ( 3 ). Recently, scholars have considered peer-to-peer ride-sharing services to solve these issues.
A peer-to-peer ride-matching service (P2P RMS) is similar in many aspects to ride-hailing services; however, some fundamental differences make it more profitable in certain situations. Mainly, shared ride-hailing services are provided by transportation network companies (TNC); both the operator and ride provider should financially benefit from the service, and ride providers make trips just for the money without any other purpose. In P2P RMSs, ride providers have their own trips and need to be compensated for the additional travel to provide a service, so trip costs for the ride requester will be cheaper than the trip costs of the ride-hailing company ( 4 ). Moreover, the stability of matching is an issue that is highlighted in P2P RMSs, where drivers and riders can only be matched when there is a reasonable cost saving for them. The flexibility of the ride-sharing system is a key factor that makes the system profitable for both drivers and riders, and in the current market, this flexibility is more easily achieved than at any time before, thanks to app-based platforms and developed algorithms ( 5 ).
This study proposes a novel stable P2P ride-matching problem (RMP) to optimize the multi-driver, multi-rider matching and routing problem, allowing riders to transfer between drivers (vehicles) and share a ride with other riders. Then, it develops optimal algorithms to solve the proposed problems based on Tabu Search (TS), and Greedy Matching (GM) approaches. This study also compares the performance of the proposed model for stable and non-stable matching cases. The main motivation of this study is to have better insight into practical comparisons of stable and non-stable matching algorithms and also into use of transfer points to optimize matching drivers and riders (whether short-distance travel or long-distance) in the transportation network. Allowing riders to transfer between vehicles may increase the chance of having more possible feasible matches between participants, and will also reduce the cost by decreasing the total traveled distance in the system, which will benefit both the rider and the driver. Furthermore, considering transfer points can be useful in areas with a low ride-sharing demand and less access to public or paratransit systems. The results of this study could be utilized by TNCs and on-demand shared mobility service agencies. The organization of this study is as follows: The next section provides a comprehensive review of background studies. The third section describes the proposed problem and two algorithms to solve the model. Section four discusses the performance of the developed algorithms on a hypothetical example, and, finally, the last section concludes this research.
Literature Review
With the emerging shared transit modes in urban areas, scholars have studied the RMP widely in recent decades. The RMP is basically a combinatorial optimization problem that aims to find matches between drivers who are willing to provide rides and riders who need rides by considering feasibility and profitability constraints. RMPs are mainly associated with transit modes that can deliver and pick up passengers simultaneously by request; therefore, RMPs are often considered as demand-responsive and dial-a-ride problem (DARP) studies.
In the past few decades, DARPs have been widely considered by scholars. Generally, the homogeneity of the variables and the status of passengers’ request orders are the main challenges that motivate scholars to optimize DARPs ( 6 ). The homogeneity of the problem is related to adding variables that make the model more realistic, like multi-hubs ( 7 ), varying vehicle capacity, transfer of passengers ( 8 ), and the degree of circuity (DOC) (9, 10). Alternatively, the system’s flexibility in serving passengers has been increased by transforming the problem from static to dynamic, so the transit system can accept a new request while operating ( 11 ).
In DARPs, ride providers are considered as a separate entity as an operator, while in P2P RMP the ride operator can be considered as a user of the system ( 12 ). Furthermore, with DARPs, the availability of vehicles and ride requests is known in advance, while in a P2P RMP, this availability is not deterministic as riders will be matched to ride providers by considering spatial–temporal availability after readiness of the ride providers and feasibility of matching. This special attribute makes the P2P RMP more complicated than DARP, especially when other constraints need to be considered, such as allocating riders with special needs to specific ride providers ( 13 ) or considering the time window constraint for each rider ( 14 ). Stiglic et al. ( 15 ) introduced the concept of meeting points in the RMP. An optimal algorithm has been developed to maximize the number of matched drivers and riders to save ride providers’ driving distance. The concept of the transfer station, applied by Masoud and Jayakrishnan ( 13 ), can make the ride-matching system more efficient by increasing the chance of matching between more riders and drivers. The transfer stations work as given spots where riders can be switched to another driver to continue their trips. The transfer stations are not necessarily located at drivers’ starting or end points; however, serving riders at transfer stations could be more acceptable to drivers as it makes for less complexity and confusion ( 13 ).
Generally, in past related studies, RMPs have been categorized by complexity, as single-driver single-rider (SDSR), single-driver multiple-rider (SDMR), and multiple-driver multiple-rider (MDMR). Agatz et al. ( 16 ) investigated a single-driver and single-rider P2P RMP to optimize unmatched announcements, aiming to maximize the saved travel distance of the drivers. They believed the performance of driver–rider matching is highly dependent on the spatial–temporal status of the ride requesters. Boyacı et al. ( 17 ) solved a one-way vehicle-sharing problem using a simulation approach aimed at maximizing the net revenue for the operator and net benefits for users.
Considering the ability of riders to transfer between drivers makes the problem more complicated. A few scholars have considered the MDMR RMP. Masoud and Jayakrishnan ( 13 ) developed a multi-hop P2P ride-sharing system as a binary optimization problem in which a rider was able to transfer between multiple drivers. They used a decomposition algorithm to solve the model optimally. In another work by Masoud and Jayakrishnan ( 12 ), they developed a flexible ride-sharing system as a dynamic, real-time, and multi-hop system with the ability to find itineraries for a rider by means of optimally routing drivers. Following this study, Tafreshian and Masoud ( 18 ) proposed a one-to-many RMP based on a graph partitioning algorithm that grouped journeys into several sub-problems.
Recently, some studies focused on rational aspects of ride-sharing participants (both ride provider and ride requester). Preferences considering saving money for riders and drivers are the main focus of these studies. Silva et al. ( 19 ) considered a quota traveling salesman problem with passengers (QTSP) to solve the RMP, to increase the flexibility of the model for serving riders in meeting points (alighting and boarding). Although their model aimed to increase satisfaction for both riders and the driver, the proposed model neglected the stability of matching. Wang et al. ( 20 ) developed a stable ride-matching model to fairly distribute cost allocation between driver and rider; however, they considered an average cost saving between driver and rider, which is unfair in some matches. Furthermore, their proposed model was an SDSR problem that was limited to realistic and substantial service. Ma et al. ( 21 ) modified the algorithm by introducing the theory of two-sided matching to solve the ride-sharing stable matching problem by considering cases in which a driver may receive identical benefits for a match with a rider which turned the problem into a stable matching problem with incomplete preference. Also, their developed model was an SDMR problem which is more useful than SDSR.
Since the P2P RMP was recognized as an NP-hard problem ( 22 ), most of the past studies used heuristics and metaheuristics to solve the problem; however, some other studies were based on the goal and scale of the problem using a simulation-based approach (22–26). The objective functions of the previous related research included maximizing the number of rider and driver matches (14, 15, 24, 27–30), maximizing the total number of assignments (31–33), optimizing system costs and benefits (14, 17, 30 , 34 ), travelers’ mode choice (35–37), and optimizing total distance savings (16, 22, 24).
Although various types of the P2P RMP have received considerable attention in recent years, little knowledge is available about the stable MDMR problem allowing transferring riders between multiple vehicles. Only one study by Peng et al. ( 33 ) considered a stable MDMR problem to optimize matching assignment and pricing; however, their model was unable to permit riders to transfer between multiple drivers. Therefore, this study has two main contributions beyond the reviewed studies. First, it proposes a novel two-stage integer programming model for the MDMR problem according to the SDMR matching problem’s extension. Second, it develops an optimal algorithm to solve the stable MDMR problem considering rational preferences and cost allocation for drivers and riders while allowing a rider to transfer between multiple drivers. Another contribution of this study is to solve the proposed model for both stable and non-stable forms and compare the total cost savings.
Methodology
As discussed in the literature review section, two main approaches in the ride-matching strategies are stable matching and non-stable matching. The stable matching system is a decentralized system, while a non-stable matching system is a centralized system. Although the stable matching approach provides a stable solution, it may not provide the most efficient peer-to-peer ride-matching for the entire system because of the smaller total number of matches as a result of only including rational matches for both the rider and the driver. Therefore, in general, non-stable matching provides more matches in the system, while this may not be individually optimal for both drivers and riders in some circumstances. Figure 1 shows a simple example network with two drivers (D1 and D2) and two riders (R1 and R2). Assume that the cost of trips is commensurate with the shortest distance traveled to reach the destinations. In Figure 1, the vertices represent the location related to origin (shown with superscript “O”) or destination (shown with superscript “D”) of the rider (R)/driver (D), the arrows show the connection between locations, and the value on the arrows indicates the cost of a ride between the two vertices—which is directly related to distance between the two locations. Without ride-sharing, each rider/driver rides from his/her origin to his/her destination (using routes, D1O–D1D, D2O–D2D, R1O–R1D, R2O–R2D); consequently, each trip costs $6 (total system cost is $24). However, with ride-matching, if R1 and D1, as well as R2 and D2 are matched, for system optimization, the cost per match is $10 (with route DO–RO–RD–DD, accordingly cost of $2 + $6 + $2) and total system cost becomes $20 ($10 + $10), which cuts $4 from the individual trips.

Example of ride-sharing network.
Although the system-optimal ride-sharing solution ensures system cost minimization, those ride-matchings are not stable because D1 and R2 ride-matching lowers their travel costs from $10 to $9.20 (with route D1O–R2O–R2D–D1D, and a consequent cost of $1.60 + $6 + $1.60), and they will not accept the system-optimal ride-matching. Considering the ride-matching of D1 and R2, it is optimal for R1 and D2 to ride individually with a total cost of $12 rather than to have ride-matching. Thus, in this case, the total system cost increases to $21.20 ($6 + $6 + $9.20) from the system-optimal solution of $20. This ride-matching that gives individual cost minimization is called stable ride-matching. It is a more realistic ride-matching solution when the individuals choose their own ride-matching.
Problem
In this paper, a many-to-many ride-sharing system is considered for which the centralized system matches groups of riders and drivers and offers itineraries to drivers. The system begins its work when a set of participants requests trips as drivers or riders. Each participant applies for an origin and a destination within an allowable time window. All origins and destinations of drivers and riders are considered as potential transfer stations. A transfer station is a meeting location where a rider can be transferred to another driver so as to complete his/her trip. Furthermore, riders can choose their maximum allowed transfers between vehicles, and drivers can decide the maximum number of passengers on board at the same time during their entire trip. Therefore, each time a rider or a driver applies for a trip in the system, the information about these preferences is requested and registered.
The model should be able to consider a case in which a driver can provide a ride from the rider’s origin to the rider’s destination and also from the rider’s origin to the transfer point. We considered that the participants cooperated with the system for the financial efficiency of the service as well as for personal-interest goals such as the effect on the environment. Therefore, the objective of the problem is considered as being to maximize the total travel distance savings of all participants, which also corresponds to minimizing total travel costs. In this problem, a rider can take all of his/her trip with one driver or can be switched to another driver in the middle of his/her trip at a transfer station. According to whether it would minimize total travel costs, the mathematical model decides whether a rider should be switched to another driver in the middle of his/her trip. In this regard, the model considers all possible cases of matches (a set with n drivers and m riders that has at most 2n×2m possible matches) where the number of participants in the match is less than a predefined value, and calculates the optimal costs of these matches; therefore, the model chooses the best case by comparing the total costs of each matching.
In many-to-many ride-sharing systems, riders may be assigned to multiple drivers, transferring between multiple vehicles. Therefore, the system sets the location where each driver picks up and drops off the rider. When the system matches a set of riders with a set of drivers, it means that the trip timing of all participants becomes coordinated as the itineraries. Matches and trips offered by the system should satisfy the participants, or they may choose not to accept the offer, and they will no longer use the system. Two important aspects of participant satisfaction are the timing and cost of their trip. We assume that matches and itineraries are feasible only if they fulfill the timing requirements of all participants as a constraint. There may be ride-sharing matches that satisfy the participants’ timing constraints but do not generate positive vehicle-mile savings. Indeed, to consider a match as feasible, the involved participants should also benefit with respect to the travel cost when accepting the offer. As just mentioned, when the system matches a set of riders with a set of drivers, the trip timing of all participants becomes coordinated as the itineraries. Therefore, in case of one participant’s delay, the mutual dependence of the time scheduling of participants may result in delay to other participants grouped in a match. To overcome this issue, the maximum number of participants in each match is restricted. When a set of drivers are matched with a set of riders, an optimization problem is solved to determine the itinerary of each of the participants and their start and end time of the trip. We assume that the vehicle-mile savings (cost savings or benefits) of sharing a ride are divided equally between the ride’s participants. Another option is to divide the cost saving of a ride among the participants of the match, according to each participant’s trip distance when driving alone.
A good ride-sharing system should produce matches that are stable; we define stability as the concept notation in cooperative game theory. In fact, we call a solution stable when no groups of riders and drivers prefer to depart from their current partners and match together, the latter including the case in which a subset of riders or drivers prefer to reject some of their current partners. Riders and drivers may not use the system if they believe they can establish a better match with higher cost saving on their own. The following are the known parameters of the problem.
Parameters:
Let A and B represent the set of all non-empty subsets of R and D, respectively. We introduce the set
To model the problem, the preference lists of all groups of participants should be known. The preference list of a group of riders/drivers consists of the set of feasible matches ranked based on the corresponding best ride-share cost savings. The best ride-share with the maximum cost saving between any two groups of the drivers and riders, along with the associated cost saving, can be determined through the model (formulations 11 to 30) in the next subsection. The solution of the model also determines whether a match is feasible or not.
We denote the preferences with the following notation: a
By definition of sets A and B, the problem can be modeled as a generalized matching problem between members of sets A and B. Whenever a match is established between two groups of riders and drivers, the members of the two sets share rides together and the trip timing of all participants becomes correlated with their itineraries. To the best knowledge of the current document authors, unlike SDMR, the MDMR ride-sharing problem is not formulated as a matching problem so far. Let
subject to
The objective (1) maximizes the total cost saving of the system, which coincides with minimizing the total travel cost. Constraint sets 2 and 3 force each rider (driver) to be matched with at most one group of drivers (riders). Constraint 4 forces the model to generate a stable solution. These constraints state that each pair of riders (set
In fact, at least one of the three outcomes below must happen for each pair of riders
Members of the set
Members of the set
To be precise, the stability constraints (4) can be replaced with the following constraints, where
Constraints 6 and 7 define
Feasibility and Profitability Conditions of Ride-Matching
When a set of drivers b is matched with a set of riders a, the problem of finding the best itinerary for each driver is modeled through restricting the set of drivers and riders to the members included in the sets a and b denoted by SD and SR and by using four sets of decision variables as defined in the following. Moreover, the set of stations is restricted to the ones included in the largest polyhedral generated by connecting the riders and drivers in the match. In fact, the model (formulations 11 to 30) inputs a subset of stations
In the proposed formulation, an equal number of stops for each driver, denoted by
Then the formulation is as follows:
subject to
Equation 11 presents the objective function of the problem, minimizing the total distance traveled by all drivers. Constraints 12 to 16 force the model to satisfy the rider’s and driver’s latest arrival and earliest departure times. Constraint sets 17 to 19 enforce that the number of times a driver enters a transfer station equals the number of times he or she leaves the transfer station. Constraint set 20 directs the drivers out of their original transfer stations and constraint 21 ensures that drivers end their trips at their destination transfer stations. Constraint sets 22 to 24 route riders in the network. Constraint set 25 ensures that vehicle capacities are not exceeded and ensures that riders are accompanied by drivers throughout their trips. Constraints 26 and 27 limit the total number of transfers between vehicles for each rider. Constraint 28 ensures that riders leave a transfer station after they have arrived at it.
Then,
The designed problem may have unmatched riders and drivers if the timing constraint is not satisfied. In this case, the match between the set of riders and the set of drivers is considered as infeasible. Moreover, as mentioned earlier, there may be ride-share matches that satisfy the participants’ timing constraints but do not generate positive vehicle-mile savings, which are also considered infeasible matches. Thus, preference lists can be incomplete. Furthermore, when a set of riders are matched with a set of drivers, one does not expect the solution to generate disjoint itineraries for a subset of riders. However, in the optimal solution of presented formulations 11 to 31, disjointed itineraries can be generated and the output of these formulations is used as an input for formulations 1 to 4. For example, let D = {d1,d2,d3}t and R = {r1,r2,r3}. The solution may result in drivers d1 and d2 routing riders r1 and r2 to their destinations and driver 3 accompanying rider 3 throughout his/her trip. In this circumstance, the drivers’ routes are alike, r3 is matched with d3 and the set {r1,r2} is matched with the set {d1,d2}. Indeed, the disjointed itinerary is infeasible for formulations 1 to 4; thus, this solution is unstable and will not be chosen in the matching problem. This is because the trip cost associated with one of the disjointed sets can be increased when matching r3 with d3 and the set {r1,r2} with the set {d1,d2}. Therefore, the match will be considered infeasible in the second phase of the solution process. In fact, the solution process consists of two stages. In the first stage, parameter
The model (formulations 11 to 30) is an NP-hard problem and solving the model within a reasonable time for even medium sizes is difficult. However, as mentioned before in the document, the model inputs a subset of riders SR and a subset of drivers SD as a matched group, and finds the best itinerary for each driver in SD such that all riders and drivers start their trips from their corresponding origins and end at their destinations in the allowed timing while the total cost savings of the trips are maximized. To overcome the issue caused by the dependence of the time scheduling of participants of a match to each other, the maximum number of participants in each match is restricted. Thus, one expects the sets SD and SR which are the inputs of the model to be small sets with cardinality mostly <3.
Optimization Methods
Two algorithms, TS and GM, were selected to solve the proposed problem. The GM algorithm is useful when matched samples with similar balanced characteristics are generated. The GM considers one-to-one and one-to-many matched pairs, while it does not allow for sampling with replacement ( 38 ). This GM algorithm has been widely used in ride-sharing studies to compute maximum matches (39–42). The TS metaheuristic is known for its speed and ability to escape from local minima; however, the main advantage of TS which makes this algorithm suitable for ride-matching rests in its ability to set moving distance to search the optimal solution, while the algorithm can automatically adjust its parameters and change the direction of search. The TS metaheuristics have been implemented for solving ride-sharing/ride-matching problems thanks to the algorithm’s ability to set searching moving distance as an integer (35, 43). In the following, a GM heuristic is presented to solve Equations 1 to 5.
Greedy Matching (GM) Algorithm
Select the match (a,b) with the largest cost saving per participant. Note that the cost saving per participant of a match between set a and set b is determined by
Remove the members of sets a and b from the set of riders and drivers, respectively. Moreover, for each
Repeat step 1 and 2 until no feasible matches remain.
Let the algorithm solution be a Greedy Matching solution that is not stable. By definition, there must then exist a pair (a,b) for which
Proof (by contradiction):
Let (a,b) be the first match selected in the GM solving procedure for which the set of riders a or drivers b are not united to match in the maximum cost-saving solution. For example, the set
Note that the set of riders
If riders and drivers, though, are never indifferent between any two possible matches, the GM algorithm generates the best stable solution with the maximum cost saving for the system. However, in the presence of indifference, randomly selecting the pair with the maximum cost saving per participant may lead to the loss of optimality. In this circumstance, all possible outcomes of the GM algorithm should be checked and the one with the maximum objective value is the best solution. Although for most cases the total number of this outcome is not large, finding the best stable matching using the GM algorithm is possible.
Tabu Search (TS) Algorithm
To calculate the effect of the selfish behaviors of the participants, Equations 1 to 3 and 5 are solved by employing a TS algorithm. The TS algorithm starts with a potential solution to the problem generated by using two random permutations of riders and drivers, where a rider and a driver with the same index in the two permutations are matched. This solution is considered as the bestMatch so far. Next, in each iteration of the algorithm, neighbors of the bestMatch are created in the hope of finding an improved solution. The algorithm considers solutions as neighbors if one driver and one rider, at most, are separated from their previous fellow travelers. The disjointed rider and driver may be matched or may join independent itineraries. Furthermore, there is a possibility for both to not match with anyone in the neighbor solution and continue their trips individually. The disjointed rider and driver and their new positions should be selected so that the neighbor solution satisfies feasibility. For each new solution, the objective function is calculated, and the algorithm moves to the next iteration by selecting the neighbor with the most improvement in the objective value as the new bestMatch solution. The iteration continues until it reaches MaxIteration. To determine the new objective value, there is no need to calculate the cost savings for all matches as the algorithm investigates the differences of the previous solution and its neighbor. Moreover, a match score is determined between any two pairs of the participants initialized to zero. In each iteration of the algorithm this score is updated as neighbors are created. The difference of the objective value of the neighbor solution and the current bestMatch is calculated. Then, if this value is greater (smaller) than zero, 1 is added (reduced) to (from) the match score of the new fellow travelers of the disjointed rider and driver and 1 is reduced (added) from (to) their previous co-travelers. The match score of any two participants falls under a specific value called MinimumMatchScore; the two are added to the tabu list and cannot be co-travelers for the next candidate solutions, in a particular number of iterations. Then the match score of the pair is set to zero again. Furthermore, the algorithm allows the tabu list to include at most a constant number of tabu pairs represented by TabuTenure. Each time a new tabu pair is added to the tabu list and makes the list’s length greater than TabuTenure, the oldest pair in the tabu list gets removed. Finally, the whole TS algorithm, from generating a random initial solution to reaching the MaxIteration iterations, is repeated a specific number of times denoted by MaxAlgorithmRepeat and the best match among these runs of the algorithm is selected as the best solution. Figure 2 shows the developed TS algorithm to solve the proposed P2P RMP. The platform of programming algorithms is MATLAB 2019a.

Developed Tabu Search algorithm to solve the problem.
Example
The proposed model was applied to a numerical experiment in a hypothetical network to demonstrate its performance in solving the problem. The experiment considered 10 riders and 10 drivers in the problem instance; transfer station locations and participant origins and destinations (selected from the transfer stations) were generated randomly. The algorithms were coded in MATLAB 2019a and all the models were performed on a computer with CPU Intel® Core(TM) i5-7400 3 GHz and 16 GB of RAM. The calculation times required to perform the GM and the TS algorithms for the hypothetical example were 34.2 and 45.1 s, respectively.
In Figure 3, origins and destinations of the participants are shown. To differentiate the drivers as well as the riders, each has a unique number, shown in Figure 3. For example, D2 represents the driver number 2.

Destinations and origins of the participants in the generated problem instance.
Next, preference lists were created for all groups of riders and drivers. To create the preference lists, the cost savings of the matches were determined. Moreover, to make the computations faster, for each rider and a pair of two drivers, the algorithm determines the best interface transfer station for the rider to move between the two drivers. In this problem, the total number of transfers between vehicles for each rider is limited to two transfers.
The TS and the GM heuristic algorithms explained earlier in the document were used to solve the generated instance. The parameters were set as following.
As mentioned before, the optimal stable solution can be obtained using the GM algorithm; however the TS algorithm produces an unstable solution. The difference between the objective values of the solutions generated using the two methods represents the “price of anarchy,” which shows the outcome of the selfish behavior of the participants in a practical ride-sharing setting.
The conclusions of the GM and the TS algorithms for the total cost saving of the ride-sharing system is determined as 7969.3 (meters) and 7604.8 (meters), respectively. In this sense, the price of anarchy is 364.5 (meters) which is a significant value in contrast to the cost savings. In fact, the total ride-sharing system cost saving can be increased by 4.8% if based on satisfaction level of the riders. Table 1 represents the results of algorithms for the proposed example. The total cost per kilometer has been considered as 35 cents, in accordance with the last travel reimbursement fees issued by the IRS ( 44 ), and the monetary saving calculation has been considered based on dollars per kilometer.
Results of Algorithms for the Proposed Example
As shown in Table 1, the total saving of the TS algorithm is higher than the GM algorithm because the GM algorithm provides an exact solution through a stable model while the TS algorithm is a metaheuristic approach and finds a near to system-optimal solution. Therefore, the TS model cannot be considered stable, but it opens doors to compromise between riders and drivers most likely to maximize the number of matches or the shared travel distances, which will bring more cost savings in the system.
In Figures 4 and 5, the participants who are grouped together as a match are connected with lines of the same color as their destinations and the transfer stations are shown in a red circle in these figures. As shown in Figure 4, itineraries as in the solution generated by TS algorithm, the matched groups are drivers 2, 4, and 8 with riders 8, 9, and 10 and drivers 3 and 10 with riders 2 and 4. As intended, some drivers (e.g., D2) carried a single rider (e.g., R8), while other drivers (e.g., D10) carried multiple riders (e.g., R2 and R4). Some riders (e.g., R9) were carried by a single driver (e.g., D4), while other riders (e.g., R4) were carried by multiple drivers (e.g., D10 and D3). Other drivers and riders not in the figure were unmatched for one of two reasons: either there was no match with cost saving for these riders and any of the respective drivers, or available matches were not possible because of the presence of at least one of the drivers in more cost-effective groups.

Itineraries of the matched drivers and riders in the solution generated running the Tabu Search algorithm.

Itineraries of the drivers and single riders’ paths in the solution generated running the Greedy Matching algorithm.
As shown in Figure 5, the GM algorithm consists of three groups of matched drivers and riders. In one group, drivers 2, 4, and 5 are matched with riders 3, 4, and 9. In the second group, drivers 3 and 10 are matched with riders 2 and 8. In the third group, drivers 9 and 7 are matched with riders 2 and 7. Like the results from the TS algorithm in Figure 5, some drivers (e.g., D10) carried a single rider (e.g., R2), while other drivers (e.g., D2) carried multiple riders (e.g., R9 and R4). Some riders (e.g., R4) were carried by a single driver (e.g., D2), while other riders (e.g., R2) were carried by multiple drivers (e.g., D3 and D10).
Conclusion
In recent years, shared mobility has become more available and attractive because of its economic efficiency, environmental advantages, and social equity aspects, especially where traditional transit service is not available. Among the shared mobility modes, P2P ride-sharing is considered the most economical and desirable because each individual involved in the ride-sharing has a purpose for their travel, and drivers only need to be compensated for the additional travel distance and costs, which makes the ride-sharing more affordable for riders compared with ride-hailing or shared ride-hailing services. P2P ride-sharing not only requires trust between drivers and riders, but it also requires technological advancement to match drivers and riders efficiently. Recent studies have improved ride-matching algorithms; however, this problem still has room for improvement because of its complexity in respect of consideration of spatial and temporal constraints with financial feasibility—to achieve minimization of total travel distance while maximizing the benefits for both drivers and riders.
In this research, a MDMR P2P RMP based on rational preferences and cost allocation for both driver and rider was developed, and TS and GM algorithms were formulated. With the MDMR algorithm, not only can drivers transport multiple riders in their trips but also riders can transfer between multiple drivers for their journeys if needed. A hypothetical example was developed to evaluate the performance and the computational efficiency of the proposed algorithms, and the developed algorithms could successfully solve the proposed P2P MDMR RMP.
One important result of this study comes when we compare the results of the models in two forms of stable matches and non-stable matches. The TS algorithm provides a near-optimal solution for system cost savings in which a better matching performance between riders and drivers is expected rather than the stable form of the model generated by the GM algorithm. Obviously, the metaheuristic approach using TS is seeking to minimize the total costs by relaxing stability constraints in the model; therefore, more cost savings and matches are expected in this approach than would be expected with a stable model. The maximization of the total cost saving of the system depends on how the rider and driver(s) can compromise on costs and trade-off. Therefore, ride-sharing should consider incentive policies and reduce some constraints to boost the flexibility of the non-stable approach to maximize the number of matches.
In most short-distance travel, ride transfer may not look practical. However, for long-distance travel, finding a feasible ride-match may be very difficult, and with a ride-transfer option it is possible to increase ride-matching and reduce total costs. Also, this ride-matching with ride-transfer algorithm can be used for multiple on-demand flexible transit routings. Since the proposed algorithm has a main focus on long-distance trips, this makes the algorithm more applicable in rural areas where fewer transportation options are available and travel distances are relatively longer. The results show that a centralized ride-matching system may convince the driver of the potential for a profitable service in rural areas; it may also eventually make the whole system more profitable (or less costly) in rural areas.
Future research could add more specific matching constraints between drivers and riders, such as same-gender matching, and also use other metaheuristics and solving approaches. In addition, other heuristic methods could be tested so that the efficiency of the algorithm can be improved. Moreover, the proposed P2P RMP introduces a set of transfer stations randomly before matching the drivers and riders and then finds the optimal transfer station among the existing stations. Future studies should find the optimal locations of transfer stations before the matching and also consider more factors such as the waiting times for vehicles and transfers in the model.
Footnotes
Author Contributions
The authors confirm contribution to the paper as follows: study conception and design: YL and AN; data collection: AN, MM, YL; analysis and interpretation of results: AN, YL, MM; draft manuscript preparation: AN, YL, MM. All authors reviewed the results and approved the final version of the manuscript.
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by the Urban Mobility & Equity Center at Morgan State University and the University Transportation Center(s) Program of the US Department of Transportation.
