The Optimization Model of Ride-Sharing Route for Ride Hailing Considering Both System Optimization and User Fairness

: To fully take the advantages of ride-sharing ride hailing, such as high loading rate, high operating efﬁciency, and less trafﬁc resources, and to alleviate the difﬁculty of getting a taxi in urban hubs, the topic of ride-sharing route optimization for ride hailing is studied in this paper. For the multiple ride hailing ride-sharing demands and multiple ride hailing services in the urban road network in a speciﬁc period, the objective function is established with the shortest route of the system. The constraint conditions of the optimization model are constructed by considering factors of the rated passenger capacity, route rationality, passenger beneﬁts, driver beneﬁts and time window. Based on the idea of the Genetic Algorithm, the solution algorithm of the optimization model is developed. According to the supply and demand data of taxi during peak hours in the local road network in the city of Dalian, the optimization model and algorithm are used to optimize the ride-sharing route scheme. Research results indicate that the optimization model and algorithm can ﬁnd the approximate optimal solution of the system in a short time. Compared with the traditional non-ride-sharing mode, the ride-sharing scheme can not only effectively reduce the taxi empty-loaded rate and the travel cost of passengers, improve the efﬁciency of drivers, but also save energy and reduce emissions, and promote the sustainable development of urban trafﬁc.


Introduction
With the rapid development of the urban social economy, the travel demand of residents continues to increase, and the difficulty of getting a taxi is becoming challenging. Taxi is one of the important players in urban traffic, however, the transport capacity and demand at off-peak and peak hours do not always match. Due to the high operating cost, it is often in the empty-loaded state in the off-peak hours; in the peak hours, it is often difficult to take a taxi because a large number of taxis only carry one passenger. The traditional taxi ride-sharing behavior may cause excessive detour phenomenon, resulting in an increase in the passengers' travel cost and time. For ride-sharing taxis, it has the advantages of intelligent scheduling and route selection, which can offer more reasonable costs and reduce the total operating costs, so as to improve the enthusiasm of the drivers and passengers, make reasonable use of traffic resources, reduce the emission of tail gas, protect the environment, and promote the sustainable development of urban traffic. Therefore, it is necessary to study the optimization model and algorithm of the ride-sharing route for ride hailing with the objective of the shortest ride-sharing route.
Normally, there is no sanitary situation concerns in ride-sharing. However, at present, protective measures need to be taken during the epidemic period, such as using plastic sheeting to isolate the interior of taxis and wearing masks for drivers and passengers. Even if there is no ride-sharing behavior, there are potential safety hazards in the case of an epidemic situation, and protective measures are still needed.
Sustainability 2021, 13,902 3 of 17 ride-sharing route. Ma [23] proposed a solution algorithm based on optimal request-vehicle assignments for solving dynamic bi-/multi-modal ridesharing problems. After testing, this study provided a useful tool for real-time mobility-on-demand service planning and designed in a multimodal transportation network. Naoum-Sawaya et al. [24] presented a stochastic mixed integer programming model and took into account the unforeseen event of vehicle unavailability, solved by heuristic algorithm. Lee and Savelsbergh [25] started by formulating the matching problem as an integer program and designed a heuristic to solve. In addition, some scholars studied the pricing of ride-sharing taxis. For example, Zhang et al. [26] mainly studied the taxi sharing routes and constructed the sharing expense model. Ma et al. [27] discussed ride-sharing user equilibrium problem under OD-based surge pricing strategy. They discovered the ride-sharing under this strategy reduces not only the travel cost for travelers but also the deliberate detours. Di et al. [28] introduced average vehicle occupancy ratio into cost calculation to represent more realistic aspects of ride-sharing costs subdued by ride-sharing drivers and passengers. Lei et al. [29] proposed a multi-period game-theoretic model that addresses dynamic pricing and idling vehicle dispatching problems in the on-demand ride-sharing systems with fully compliant drivers and vehicles. It could help ride-sharing service providers achieve better system performance while facing spatial and temporal variations in ride-sharing demand.
In terms of the research on the ride-sharing optimization problem, many literatures focus on the system optimization. The consideration of the ride-sharing cost directly determines the interests of both drivers and passengers, but there is a game between them, so the simple cost-sharing method is usually adopted, which is controversial about fairness. However, it is a challenge to establish a fair ride-sharing route optimization model for the ride hailing, taking into account both system optimization and user fairness, and enhancing the rationality of ride-sharing. Therefore, although researchers have done some studies on taxi ride-sharing route optimization, they mainly focus on the algorithm itself. Different algorithms or operators are designed to solve the problem efficiently. The principle of system optimization and user fairness is rarely considered in the modeling. In addition, there is also a lack of constraints on the benefit of drivers and ride-sharing passengers. In view of the above gaps, this paper contributes to the existing literature on ride-sharing for ride hailing in threefold:

1.
Under the premise of system optimization, the user fairness is considered, which makes the long detour travel bear less cost and get more cost compensation. This fills the gap of previous literature which only considers system optimization.

2.
In the optimization model, the benefits of drivers and passengers are taken into account to ensure the enthusiasm of ride-sharing, which fills the gap of the existing optimization model for a ride-sharing route. 3.
The crossover operator and mutation operator are improved in the model, and the order of chromosome coding of infeasible solution is adjusted to update it into feasible solution, and on this basis, the optimization is carried out.
The research results show that the implementation of ride-sharing ride hailing mode can reduce the empty-loaded rate of vehicles and improve the occupancy rate of passengers. It can not only create more benefits for passengers and drivers, but also realize the reasonable allocation of resources. At the same time, it is conducive to moderate control of taxi scale, relieve urban traffic pressure and energy consumption, environmental pollution and so on, which promotes the sound and stable development of urban economy and the green sustainable development of urban traffic.
The remainder of this paper is organized as follows. Section 2 gives the problem description and model assumptions of the optimization model for ride-sharing route. Section 3 is the construction of the optimization model. Using the soft time window and benefit of drivers and passengers to restrict, it can ensure the fairness of users and the enthusiasm of drivers and passengers. In Section 4, we design a Genetic Algorithm to solve the optimization model. Then, a case study is conducted to verify the optimization effect and application feasibility of the ride-sharing route optimization model for ride hailing based on Genetic Algorithm in Section 5. Finally, Sections 6 and 7 present the discussions and conclusions of this paper.

Problem Description
The task of optimizing the ride-sharing route for ride-sharing ride hailing is an extension of vehicle routing problems with time windows (VRPTW). The following questions are considered in the optimization.
(1) Combinatorial optimization problem Within a certain period, that is, the system refresh time, there are r pairs of travel demand in the road network. The optimization seeks the best combination of matching passengers to a vehicle to yield the least total operating mileage of the ride hailing service system.
(2) Taxi assignment problem During the above period, there are k taxis in the road network. The algorithm assigns taxis to the above passengers to obtain the optimal ride-sharing scheme of the system.
(3) The shortest path problem When the scheme of the ride-sharing route is determined, the node order of each taxi ride-sharing demand is given. Then, the shortest path between adjacent nodes needs to be solved. This is a classic problem that can be solved by a classic algorithm, so it is not discussed in this paper.
For the research and modeling of problem 1 and 2, the following mathematical description can be made: There are r pairs of travel demand in the road network (1,2, . . . , r). Each of them corresponds to a unique pair of starting and ending points. There are also k taxis available for ride-sharing (1,2, . . . , k). The rated passenger capacity of taxi is Q. In the road network, the number of passengers in taxi s at point i after getting on and off is q s i . The time window given by passengers is [T j1, T j2 ]. Under the conditions of q s I ≤ Q and ArrT s j ≤ T j2 , the optimal ride-sharing scheme with the shortest total operating mileage of the system is obtained to minimize the total mileage of the system.

Assumptions
The optimization model of ride-sharing route for ride hailing follows the basic assumptions: All taxis run at a constant speed on the road network; The time window conditions for booking passengers are fixed and known; The travel time of taxis arriving at the destination can be predicted; Passengers node positions are based on the demand pair. If the nodes coincide, the distance between two nodes is represented by the right-of-way of 0; The number of passengers required for each pair is no more than the taxi capacity.

Parameter Definition
The notations used throughout this paper are listed in Table 1. Earliest arrival time of the taxi T j0 Driver arrives at point j at the latest without penalty T j2 Latest arrival time of the taxi r 1 Driver late penalty factor r 0 Traditional taxi fare per kilometer c 0 Starting price of traditional taxi D 0 Starting price kilometer of traditional taxi D r Direct mileage of passengers in group r ∝ Ride-sharing discount rate β Extra detour discount rate Decision variables Passengers are required to pay for online taxis fees G r Detour ratio in ride-sharing mode H s Benefits of taxi s serving the whole journey in a traditional way

Objective Function
In this paper, the objective function (1) is established with the shortest ride-sharing route of the ride hailing service system.

Vehicle Path Constraints
Vehicle path constraints represent the basic rules for ride-sharing ride hailing on the road network [30].
Equations (2) and (3) ensure that there is only one car for any starting and ending points. Equation (4) ensures that the vehicle arriving at any node is the same vehicle departing from the node. In order to ensure its effectiveness, the distance from each passenger demand point to the starting point of taxi departure is assumed to be 0, that is, the reverse distance is defined as 0; the forward distance is still the actual distance. In this way, when the taxi reaches the last demand ending point, it can be regarded as returning to the starting point of departure. Equation (5) ensures that any pair of demands must be served by the same taxi. If there are two or more groups of demands with the same starting point or ending point, the nodes will be marked with different numbers.

Rated Capacity Constraints
In the process of taxi ride-sharing service, the number of passengers in the car at any time should be less than or equal to its rated passengers.
Equation (6) represents the relationship between decision variables, indicating that there must be only one taxi passing on any arc (i, j) where passengers are present. Equation (7) restricts the capacity of each arc in order to ensure that the number of passengers in the taxi is not greater than the maximum loading capacity Q.

Time Window Constrains
When passengers accept taxi ride-sharing service, they always expect the taxi to arrive within their expected time frame. Therefore, passengers need to provide the expected arrival time interval [T j1, T j2 ], which is the time window condition. T j0 is taken as the critical point of the passenger's tolerance deterioration and then the soft time window constraint is used in the paper, which is different from the hard time window constraints of previous studies, as shown in Figure 1.
Sustainability 2021, 13, x FOR PEER REVIEW 7 of 17 The time when the taxi s reaches point j from point i can be represented by Equation (8). Equation (9) is used for sub-ring elimination, ensuring the arrival order of two adjacent points.
The time of taxi s passing through the point i and point j can be computed by Equation (10).
The time constraint reflects the time window limitation in the process of vehicle service, and also stipulates the behavior rules of vehicles arriving at the service point in different time periods. The specific constraints are shown as Equation (11) to Equation (13). Equation (11) indicates that the actual arrival time of the taxi should be less than the latest arrival time T j2 requested by the passenger. Equation (12) indicates that the moment when the taxi s reaches point i is less than the earliest arrival time given by the passenger. Then the taxi s must wait at the point i until the passenger arrives at the earliest arrival time before leaving the point i. Equation (13) indicates that when the taxi s arrives at point i between the earliest arrival time of the passenger and the latest arrival time of the taxi, the taxi arrival time is considered to be the same as the departure time.
When the taxi arrival time is later than the optimal arrival time T a0 , it means that the passenger needs to wait for the taxi to arrive, and the tolerance of the passengers begins to deteriorate. In this case, the taxi driver should bear the loss of passengers. Therefore, its penalty function P s a can be calculated by Equation (14). For the actual operation time T a0 < ArrT s a < T a2 , the penalty function P s a , which is the increased operating cost, will be considered in the following section.

Benefit Constraints of Passengers and Drivers
The benefit constraints of passengers and drivers are the formulation of pricing rules for ride-sharing taxis, which ensures the social feasibility of ride-sharing taxi operation. Equation (15) defines the traditional taxi charging standard.
From the passenger's point of view, in order to improve the operating benefits, the cost savings of ride-sharing passengers must be taken into account. Otherwise, passengers will lose interest in taxi ride-sharing service. Therefore, it is necessary to ensure that the cost of the ride-sharing service is less than or equal to the price of traditional taxis.
Equation (16) defines the detour discount rate and ensures that the vehicle detour mileage does not exceed 1.6 times the direct path. Equation (17) indicates the passenger's ride fee to be paid for the non-ride-sharing mode. Equation (18) indicates the passenger's ride fee for the ride-sharing mode. It also ensures that the ride-sharing route with long detour distance has a better discount rate to obtain more travel compensation cost. Therefore, the unfairness of different groups of passengers caused by the different ride-sharing detour distance is taken into account.
From the driver's point of view, it is also necessary to ensure that the benefits providing ride-sharing services are not lower than those of traditional non-ride-sharing mode in order to increase the enthusiasm of ride-sharing services. Equation (19) represents the driver's minimum earnings standard, that is, the earnings of driving the same mileage in traditional non-sharing mode. Equation (20) ensures that the driver's earnings should be greater than or equal to the minimum standard earnings.
According to the Sections 2 and 3, the methods directly relevant to this paper, that address the ride-sharing optimization problem, are listed in Table 2.

Genetic Algorithm
In this section, we use Genetic Algorithm to solve the optimization model of ridesharing route, and the reasons are as follows. Genetic Algorithm directly takes the feasible solution of the objective function as the search information, and the process is simple; Genetic Algorithm has the characteristics of group search and better global search; Genetic Algorithm optimization mechanism is based on probability rules, which makes the search more flexible; the problem adopts natural number coding scheme, which is easy to understand and easy to implement by Genetic Algorithm.

Chromosome Coding
In this paper, the chromosome is coded by a decimal number [31]. The solution vector of the route optimization model can be coded into a chromosome with a length of 2r + 3k + 1 (0, s 1 , i 1 , i 2 , . . . , i a , 0, s 2 , i a+1 , i a+2 , . . . , i b , 0, s j , i j . . . , 0, s k , i c , . . . i r , 0). There are k taxis providing ride-sharing services in the system, and each sub-path has a taxi to complete the ride-sharing service. In each segment of the code, the second natural number s j represents the taxi number currently providing ride-sharing services. The third natural number i r represents the node number of the current location of the taxi providing ride-sharing service. The subsequent code i indicates the starting and ending number of each ride-sharing demand. Since each pair of ride-sharing demands corresponds to a starting point and an ending point, the total number of codes in this category is 2r.

Fitness Evaluation
The objective function is used to construct fitness evaluation, and roulette is used to ensure that individuals with better fitness have a higher probability of being selected.

Improved Crossover Operator
The chromosomes with the highest fitness in each generation are directly copied into the next generation. The other chromosomes are crossed with a probability of 0.6 [14,32]. Due to the constraints of ride-sharing route optimization problem and the demand for the order of getting on and off, if a simple crossover operator is used, a large number of infeasible solutions would be generated. Therefore, the improved crossover operator is proposed in this paper.
For two parental chromosomes, select a section between the third element and first zero element for members that does not end with zero, then simple crossover is implemented to generate two offspring chromosomes.
For the offspring chromosomes, choose natural numbers that are repeated after crossing. If the number is in a non-crossing position, it is deleted. If it is within the crossing position, it is reserved. If there is a travel demand point that has not been visited in the offspring, the natural number corresponding to the point should be complemented outside the crossing position of chromosomes.
According to the taxi ride-sharing route optimization model, deleting point pairs from a route does not affect its feasibility. At the same time, after counting the lost point pairs of chromosomes in offspring, they are inserted into chromosomes according to the previous insertion steps. The strategy of retaining excellent individuals is adopted for new individuals. Only when the fitness of the new individual is better than that of the old one, the chromosome will be updated.

Improved Mutation Operator
The mutation adopts the internal two positions exchange method, and the mutation operation is carried out with the probability of 0.1 [14,32]. Firstly, the mutation pos1 and pos2 are randomly selected from the demand starting point, and then the two mutated positions are exchanged and delete the corresponding ending points. Finally, the ending point is inserted at a random position in the sub-path of its corresponding starting point, and the strategy of retaining excellent individuals is also adopted for the new individuals.

Case Study
Mobile devices and ubiquitous connectivity make it easier than ever to collect data, such as GPS technology, CRAWDAD dataset, Floating Car Data, and Big-data [4,[33][34][35].
The city of Dalian is selected for the case study. The taxi travel demands within 5 min during peak hours are used. In this case, we use the demand point data obtained by taxi software, and its longitude and latitude are picked up by electronic map. The starting position data of the taxi driving are shown in Table 3. The road network is shown in Figure 2. tion data of the taxi driving are shown in Table 3. The road network is shown in Figure 2. According to the survey information, the time window of each demand point is tj1, tj0 = tj1 + 4, tj2 = tj0 + 2, as shown in Table 4. According to the survey information, the time window of each demand point is t j1 , t j0 = t j1 + 4, t j2 = t j0 + 2, as shown in Table 4. The taxi operating cost parameters adopt the current standard of Dalian. The starting mileage is 3 km, the starting price is 10 CNY, and the unit price is 2 CNY/km. The price of No. 92 gasoline is 5.85 CNY/L, and the fuel consumption of a taxi is assumed to be 8 L per 100 km. After conversion, the fuel cost is 0.468 CNY/km. The taxi's rated passenger capacity is 4, the initial number of passenger is 0, and the average speed is 40 km/h. The ride-sharing discount rate α is 0.9, and the detour discount rate β is 0.4.
The Genetic Algorithm is programmed with MATLAB. The initial population size is 80. After 300 generations of evolution, the fitness function tends to be stable, and the final result is obtained. After three runs, the fitness function is obtained, as shown in Figure 3. The taxi operating cost parameters adopt the current standard of Dalian. The starting mileage is 3 km, the starting price is 10 CNY, and the unit price is 2 CNY/km. The price of No. 92 gasoline is 5.85 CNY/L, and the fuel consumption of a taxi is assumed to be 8 L per 100 km. After conversion, the fuel cost is 0.468 CNY/km. The taxi's rated passenger capacity is 4, the initial number of passenger is 0, and the average speed is 40 km/h. The ridesharing discount rate α is 0.9, and the detour discount rate β is 0.4.
The Genetic Algorithm is programmed with MATLAB. The initial population size is 80. After 300 generations of evolution, the fitness function tends to be stable, and the final result is obtained. After three runs, the fitness function is obtained, as shown in Figure 3.  According to Figure 3, it can be found that in the results of three runs, the objective function tends to be stable after 75 iterations. The total mileage of plan a, plan b, and plan c are 92.033 km, 96.852 km, and 92.676 km respectively. Among them, the optimal combination is plan a, as shown in Figure 4. According to Figure 3, it can be found that in the results of three runs, the objective function tends to be stable after 75 iterations. The total mileage of plan a, plan b, and plan c are 92.033 km, 96.852 km, and 92.676 km respectively. Among them, the optimal combination is plan a, as shown in Figure 4. At the same time, using the branch and bound method, the optimal total driving distance is 88.841 km. The specific route and operation time of the two algorithms are shown in Table 5.  At the same time, using the branch and bound method, the optimal total driving distance is 88.841 km. The specific route and operation time of the two algorithms are shown in Table 5. In addition to this case, this study has also done case studies of other scales, which are not presented due to the length. In different scales, the operation time of Genetic Algorithm and Branch and bound is shown in the Table 6. From the comparison of the operation time of the Genetic Algorithm and Branch and bound in Table 6, it can be seen that the operation time of the Genetic Algorithm increases little when the actual road network becomes larger, while the operation time of Branch and bound increases significantly. Moreover, with the increase of road network, Branch and bound will exceed the refresh time of the system, and may not get a feasible solution. Therefore, when the scale is expanded to the urban road network level, the operation time of the accurate algorithm is too long and the solution fails, which can not meet the needs of real-time, and is unacceptable in the real network ride-sharing route planning for ride hailing.
As the accuracy and efficiency of the route optimization results are the necessary conditions for the algorithm to be put into actual operation, the Genetic Algorithm is used for six operations in this case, and the results are as shown in Figure 5.
According to the optimization mileage in Figure 5, after six runs, the maximum difference is only 6.218 km, which is less than 6.58% of the total mileage for ride-sharing. Therefore, the objective function value calculated by the Genetic Algorithm designed in this paper fluctuates in a reasonable range.
For the ride-sharing route optimization scheme and non-ride-sharing scheme under the same demand conditions, driver earnings, driver fuel costs, and passenger costs are compared as shown in Table 7.
According to the data analysis in Table 7, in terms of vehicle use, there are 13 groups of demand pairs in this case. For the traditional taxi operation mode, 13 taxis are required to jointly complete the task. Under this ride-sharing scheme, only 6 taxis are used, of which the empty-loaded rate is only 8%. According to the survey data, the average empty-loaded taxi rate in Dalian is about 35%. It proves that the scheme can effectively reduce the demand for taxis and the average empty-loaded rate. In terms of driver earnings, the driver earnings of each ride-sharing taxi are greater than or equal to the maximum earnings of a single driver in the non-sharing taxi scheme. It indicates that ride-sharing scheme can fully protect the interests of taxi drivers and their interest in providing ride-sharing service. In terms of passenger cost, the cost paid by each group of passengers under the ride-sharing scheme is less than or equal to that of the non-ride-sharing scheme. It indicates that the ride-sharing scheme not only saves the cost of passengers but also guarantees their enthusiasm to choose ride-sharing service. In terms of driver fuel cost, under the scheme of ride-sharing, the fuel consumption of vehicles is less, and the fuel cost borne by drivers is also less. It means that ride-sharing can reduce fuel consumption of vehicles, reduce environmental pollution and promote green development of urban transportation.
From the comparison of the operation time of the Genetic Algorithm and Branch and bound in Table 6, it can be seen that the operation time of the Genetic Algorithm increases little when the actual road network becomes larger, while the operation time of Branch and bound increases significantly. Moreover, with the increase of road network, Branch and bound will exceed the refresh time of the system, and may not get a feasible solution. Therefore, when the scale is expanded to the urban road network level, the operation time of the accurate algorithm is too long and the solution fails, which can not meet the needs of real-time, and is unacceptable in the real network ride-sharing route planning for ride hailing.
As the accuracy and efficiency of the route optimization results are the necessary conditions for the algorithm to be put into actual operation, the Genetic Algorithm is used for six operations in this case, and the results are as shown in Figure 5.
According to the optimization mileage in Figure 5, after six runs, the maximum difference is only 6.218 km, which is less than 6.58% of the total mileage for ride-sharing. Therefore, the objective function value calculated by the Genetic Algorithm designed in this paper fluctuates in a reasonable range. For the ride-sharing route optimization scheme and non-ride-sharing scheme under the same demand conditions, driver earnings, driver fuel costs, and passenger costs are compared as shown in Table 7.   Nowadays, although ride-sharing service is only welcomed by some groups, and most of them are young and middle-aged men [4], according to the above case study, in the future, if we can reasonably guide people to choose ride-sharing service, it can not only save energy and reduce emissions, but also can cooperate with the government's sustainable development policy, which functions to reduce operating costs of the city and save energy, so as to maximize social interests and benefit the whole society.

Compared with the Traditional Vehicle Routing Problem
To the best of our knowledge, the vehicle routing problem (VRP) has always been one of the most challenging problems, which involves the design of optimal routes for the fleet and has high practicability. In fact, the ride-sharing ride hailing problem is also a problem evolved from VRP.
Consistent with the relevant research on VRP [36], the ride-sharing ride hailing problem also realize the organization of appropriate routes through algorithms to meet the needs of customers. Although there are some similarities between the ride-sharing ride hailing and VRP, it has its unique particularity. In traditional vehicle routing problem, the vehicles have fixed stations and starting points, and they must return to the origin after completing the service [37]. In this paper, the starting points of ride hailing are different. There is no fixed station for ride hailing, so there is no need to wait in the same station. After the service is finished, the taxis can continue to serve without returning to the starting points. In addition, different passengers correspond to the different starting and ending points. Therefore, there is an order problem for taxi passengers to get on and off.

Compared with the Existing Researches on the Ride-Sharing Ride Hailing
The ride hailing ride-sharing is an effective sharing economy mode that can increase utilization ratio of vehicle and relieve traffic pressure in cities. Some studies on the ridesharing ride hailing only provide ride-sharing services for passengers from the same starting points, different ending points or different starting points and the same destination [38][39][40]. However, the meeting points are not specified in this paper, which can carry out ride-sharing services for passengers at different starting and ending points, so as to save passengers' travel time and cost and meet the needs of more passengers.
In most cases, the ride hailing ride-sharing only aims to achieve the system optimization, seeking to minimize vehicle mileage, passenger travel time, maximize the number of passengers, etc. [14,19]. However, detour is a common phenomenon of ride-sharing vehicles in reality, so only when the system is optimized, it will be unfair to some passengers. In this paper, detour ratio is defined, and the system is constrained by the detour ratio, taking into account the benefit of each passenger, so that the system can achieve the optimal, while taking into account the fairness of users, and make the sharing route more reasonable.
Regarding pricing, the research on ride-sharing considers different travel costs that are roughly proportional to vehicle-miles [38]. Some studies propose a cost sharing model [26,32,38]. However, these cost models ignore the cost of the detour. In this paper, based on the principle of user fairness, the detour ratio is used to limit the detour distance of the sub-path, and combined with the detour discount rate, the taxi fare is constrained, so that the longer the detour distance of the ride-sharing sub-path is, the more the cost compensation can be obtained. In addition, both the driver's income and the passenger's cost are considered in this paper, which ensures that the driver's income is higher than that of the traditional non-ride-sharing mode, and the passenger's cost is less than that of the traditional non-ride-sharing mode.
In the existing study of the ride-sharing ride hailing problem [30], the constraint with time window is added, but the hard time window limit used in some studies does not consider the time of both the driver and the passenger. Different from the limitation of hard time window, the soft time window is set in the ride-sharing ride hailing mode in this paper, which takes into account the time of drivers and passengers, and provides more space for the global route planning. There is also a ride-sharing model with soft time window [40,41], but on this basis, a more comprehensive consideration is given and a penalty function is set. When passengers need to wait for taxi arrival, the loss of this part will be borne by taxi drivers.
In order to solve the problem of ride hailing ride-sharing, single objective optimization, multi-objective optimization and other models are proposed. In order to find the optimal route for solving these models, various heuristic algorithms and exact algorithms are developed and used [16,42,43]. In this paper, both Genetic Algorithm and branch and bound algorithm are adopted, and the two algorithms are compared to verify the feasibility of the model. The Genetic Algorithm with short running time is adopted to meet the demand of real-time taxi scheduling.

Conclusions
This paper studies the optimization problem of ride-sharing route for ride hailing, which aims at the model establishment and rate optimization of ride hailing route, and designs a solution algorithm based on Genetic Algorithm. The main conclusions are as follows: The optimization model of the ride-sharing route for ride hailing is constructed, and the objective function is established with the shortest ride-sharing route of the ride hailing service system. The passenger capacity, the rationality of the route, the soft time window, and the cost benefit are considered as constraints, considering both system optimization and user fairness, which realize the purpose of ride-sharing route optimization.
The optimization model solving algorithm based on Genetic Algorithm is designed to search for a global approximate optimal solution with fewer iterations, and it has high consistency with the true solution. Compared with the exact algorithm, it greatly reduces the operation time, and it is found that the numerical value fluctuates little after running many times, which proves that the effectiveness and stability of Genetic Algorithm, and meets the needs of on-demand carpooling service, matching passengers, and making timely decisions on vehicle route planning.
Through the comparison of the driver's income, passenger cost, and the number of vehicles used between ride-sharing and non-ride-sharing of online ride hailing, it can be seen that the ride-sharing scheme has great advantages in saving taxi resources, reducing the cost of ride-sharing passengers, and improving the earnings of taxi drivers, which promotes the sustainable economic development of the taxi market. At the same time, the implementation of ride-sharing mode can save energy and reduce emissions, and promote ecological sustainability.
Due to the limitation of survey resources and research conditions, the scale of the road network and the scale of ride-sharing demand in the case study are both small, and the passenger time window condition is an assumed parameter. Nevertheless, the general rules of theoretical modeling and algorithm design in this study can still be used as a good reference. The results have important theoretical value and practical significance for the application and development of the combined route optimization problem, the improvement of intelligent level of urban taxi traffic, and the development and promotion of urban traffic sustainability.