A Utility Method for the Matching Optimization of Ride-Sharing Based on the E-CARGO Model in Internet of Vehicles

The Internet of Vehicles (IoV) is the extension of the Internet of Things (IoT) technology in the field of transportation systems. Ride-sharing is one of intelligent travel applications in IoV. Ride-sharing is aimed at taking passengers with similar itineraries and time arrangements to travel in the same car according to a certain matching rule. To effectively integrate transport capacity resources and reduce the number of cars on the road, ride-sharing has become a popular and economical way of travel. The matching and optimizing of drivers and passengers are the core contents of a ride-sharing application system. This paper mainly studies the dynamic real-time matching of passengers and drivers in IoV, considering the main factors such as travel cost, car capacity, and utility. The matching problem is formulated in a ride-sharing system as a Role-Based Collaboration (RBC). A new utility method for the matching optimization of ride-sharing is present. In this paper, we establish a model for simulating the assignment of ride-sharing with the help of the Environments-Classes, Agents, Roles, Groups, and Objects (E-CARGO) model. The objective function and formal definitions are proposed. The utility and time of optimal matching are obtained by using the Kuhn-Munkres algorithm on the revenue matrix. The experimental results show that the proposed formal method based on the E-CARGO model and utility theory can be applied in the ride-sharing problem. Numerical experiments show that the matching time cost increases with the increase of the number of drivers and passengers participating in the ride-sharing system. When the number of drivers and passengers is different, one-to-many matching takes the least time, and one-to-one matching takes more time. When the number of drivers and passengers is the same, the time cost of one-to-one matching increases sharply with a certain value (bigger than 800). Compared with other matching methods, the time spent by the one-to-many method is reduced by 30%. The results show that the proposed solution can be applied to the matching and pricing in a ride-sharing system.


Introduction
The Internet of Vehicles (IoV) is a huge and interactive network composed of vehicle locations, speed, routes, and other information. Through the Internet technology, all vehicles can transmit all kinds of information to the central processing unit. This vast vehicle information can be analysed and processed in the computer technology, so as to calculate the best route of different vehicles, timely report the road conditions, and arrange the signal lamp cycle. Ride-sharing is one of the representatives of intelligent travel applications in IoV.
With the development of economy, the number of private cars is increasing in cities. Although it is convenient for travel with the increase of urban car, it also brings a series of problems, such as traffic congestion, excessive consumption of oil resources, and environmental pollution. Traffic congestion in cities is a universal phenomenon. In order to solve traffic congestion and environmental pollution problems, the matching and optimizing problems have been researched extensively in a ride-sharing system. Technologies such as IoV and GPS real-time positioning provide support and guarantee for ride-sharing application systems. Data sharing is privacy-preserved towards passengers and drivers in IoT [1,2]. The economic aspects of shared mobility systems have attracted more and more applications and attention [3]. Ride-sharing travel services have been proved to be an effective way, which could make full use of traffic resources, alleviate the shortage of parking spaces, reduce environmental pollution, and optimize social benefits [4]. In addition, ride-sharing travel services allow passengers and drivers to share the travel cost, which is also considerable. With the continuous progress of mobile Internet technologies and the popularity of Internet mobile devices, ride-sharing travel, which is simple, safe, flexible, efficient, and economical, will be more popular in the future.
Ride-sharing travel refers to a travel mode. The passengers with the same or similar travel paths are assigned to travel together in the same vehicle according to a matching mode. The passengers share the travel cost together in a certain driving interval. A ride-sharing application system mainly considers to complete the optimal pricing strategy and vehicle scheduling strategy in combination with geographical locations and time information [5]. In a ridesharing application system, it matches the passenger sending the ride request with the nearby driver whose car has vacant seats. The passenger sends the ride request including the departure place, time, and destination for traveling. Then, the ride-sharing application system returns the approximate fee to the passenger according to a certain pricing rule. After accepting and confirming the fee, the passenger can be match to a nearby driver. In case of one driver and many passengers, when the driver's car still has vacant seats, some passengers with similar paths will be assigned to travel together according to a certain matching strategy. After the completion of the ride-sharing travel, passengers will pay a certain fee. If it is a single passenger mode, only a single passenger can be match to a single driver at the ride-sharing time. As the driver can only match one passenger's request each time, the next matching will be carried out only after the passenger is delivered to the destination.
A driver may only pick up one passenger or may be willing to pick up two or more passengers when there are vacant seats. Similarly, each passenger may choose to take a driver's car alone or share it with other passengers. An effective incentive mechanism [6] can attract more and more passengers and drivers to participate in a ridesharing system. A cost-sharing mechanism [7,8] for ride-sharing can solve the problem of vehicles with no passengers in a ride-sharing system. Furthermore, effective and incentive mechanisms can improve the service level of sharing systems [9]. The existing riding-share relationships between the drivers and passengers are shown in Table 1. No matter which travel mode was selected, the matching method of passengers and drivers is the core of a ridingsharing system.
From the perspective of leaders, utility theory is a theory used by leaders in decision-making. From the perspective of consumers, utility theory refers to the satisfaction of consumers from consuming certain goods, which is the core of consumer behavior theory.
In riding-share travel, the passengers' satisfaction can be expressed by their utility. The utility function is used to quantify the satisfaction [10]. The actual utility function describes the quantitative relationship between the utility obtained by passengers and their travel choices in ridesharing. In addition, the utility function can measure the satisfaction of passengers in different travel choices.
Many problems have been formalized and solved in collaboration [11][12][13]. Role-Based Collaboration (RBC) was initially proposed to support natural collaboration through computer-based systems. The E-CARGO model is proposed by Canadian scholar Professor Zhu, which denotes Environments-Classes, Agents, Roles, Groups, and Objects. We concentrate on the online dynamic matching problem between passengers and drivers. A utility method for the matching problem of ride-sharing was proposed. In this paper, the method combines RBC and the E-CARGO model [14][15][16][17] to model the matching of the ride-sharing problem. Agents, roles, groups, and the relationship between them are defined. The ride-sharing optimization problem is formalized as a group role assignment (GRA) problem. The formal definitions and objective function are present. Under the constraints of vacant seats and acceptable flexible time, the optimization matching scheme is obtained by maximizing the revenue of a ride-sharing system. On the distance profit matrix, Kuhn-Munkres algorithm [18][19][20] is used to obtain the optimal matching matrix and time based on GRA.
GRA constructs a group by assigning roles to its members or agents to achieve its highest performance. In the proposed model, a driver is regarded as a role, and a passenger is regarded as an agent. In the system, current agents and roles are our focus. The problem is to find a role assignment matrix that makes the group workable, where each agent is assigned at most one role. In this situation, GRA seeks to find a matching matrix with the maximum revenue of the revenue matrix for a ride-sharing system.
According to the matching strategies and core factors affecting passengers' choice of travel in a ride-sharing application system, the specific contributions of this paper are shown as follows.
(1) We propose a new utility method for the ridesharing matching based on the E-CARGO model Table 1: The ride-sharing relationships between drivers and passengers.

One passenger Many passengers
One driver One-to-one matching between drivers and passengers One-to-many matching between drivers and passengers according to passengers' routes and time

Many drivers
One passenger transferring to different drivers' car according to his travel routes One-to-one or one-to-many matching for many times, respectively, according to the routes and time of passengers and drivers 2 Wireless Communications and Mobile Computing with utility and seat number constraints. We formulate the matching problem in ride-sharing application system as a RBC problem. To better understand the GRA process, we develop a matching model, in which drivers can be match to more than one passenger in a flexible time (2) This is the first paper that considers the utility between passengers and drivers in terms of matching and pricing based on the E-CARGO model. This paper contributes a novel way to study the matching problem in ride-sharing from the perspective of utility. When the number of drivers and passengers is the same, the utility of one-to-one matching between drivers and passengers is approximately equal to one-to-many matching. When the number of drivers and passengers is different, the utility of one-to-one matching is the least The experiments present that the utility has an impact on the revenue in a ride-sharing system. The advantages of the proposed method in terms of economic efficiency, matching incentives are demonstrated in the numerical experiments. The results show that our solutions are practical in terms of matching optimization and predicting behaviors The rest of the paper is organized as follows. The related works are introduced in Section 2. The E-CARGO model, travel utility, model formulation, and algorithm analysis are introduced in Section 3. It formally specifies the ridesharing problem with the E-CARGO model and utility theory. Experiments and analyses are illustrated in Section 4. This paper concludes and points our further research in Section 5.

Related Works
Travel cost can be reduced through cost-sharing in a ridesharing system. Travelers who do not own private cars make travel more convenient by ride-sharing. Ride-sharing services may be provided by private car owners or public service providers. Gong et al. [21] propose the technique which has been introduced to realize the privacy-preserving distributed service recommendation. If the ride-sharing application system is private, the provider can get commission or advertising revenue. If it is a public system, there may be a social goal, such as reducing pollution and traffic congestion. However, no matter what the nature of the ride-sharing system is, it is necessary to complete the matching of drivers and passengers. Generally speaking, there are some specific objectives to be considered in the matching, such as minimizing the vehicle mileage or the travel time or maximizing the number of participants or revenue in a ride-sharing system. High success matching rate will stimulate more participants to participate in ride-sharing. In this paper, the modeling and matching methods in ride-sharing are proposed.
The application system of ride-sharing travel generally requires passengers to provide departure time. In the area of obtaining participants' time preference, Long et al. [22] present a ride-sharing problem with travel time uncertainty and propose a matching model considering travel time uncertainty. Due to various uncertain factors, the passengers' time preference cannot always be satisfied. Lopez et al. [23] propose a new formal attack model. Their research shows that people are more concerned about the guarantee of travel time. In addition to the time factor, other factors will also affect the success of matching between passengers and drivers. The data uploading in ride-sharing systems suffers novel challenges on privacy preservation [24]. For example, people may prefer to share a car with familiar people. Women feel more secure when taking a female driver's car. In short, the more restrictions on potential passengers when choosing coriding partners, the more difficult it will be to find a successful match for a passenger [25]. Unlike the aforementioned preference, this paper proposed a utility method to measure participants' preference, which is more universal.
If a driver has enough flexible time, he may be willing to provide services for multiple passengers. The driver can pick up passengers one by one or take more than one passenger at the same time. With assigning many passengers to a driver, the ride-sharing application system will provide a feasible optimal route to minimize the travel cost. Javier et al. [26] propose and construct a mathematical model for real-time high-capacity ride-sharing. The model can be extended to a large number of passengers and trips and dynamically generate optimal routes according to online demand and vehicle locations. Calvo and Fabio [27] propose an integrated system for the organization of a ride-sharing service, in which there is an optimization module solving heuristically the specific routing problem. This paper combines the E-CARGO model with utility theory to establish travel matching model, improve the utilization of available seat capacity, maximize platform revenue, and rationalize resource matching.
When people choose to travel together, they consider not only the time factor but also hope to share the travel cost and reduce the cost through ride-sharing. Therefore, many scholars have studied the cost sharing methods in ridesharing. Wang et al. [28] have studied various cost sharing strategies. They provided the necessary conditions for cost sharing strategies to maintain participation or reduce cars. In literature [29], considering the difference of travel distance, a cost sharing method in proportion to distance is proposed. The cost is apportioned in proportion to the distance. Kleiner et al. [30] proposed a method to determine the driver's compensation based on the auction mechanism. In this method of determining remuneration, it is necessary to take into account the evaluation of drivers. For drivers, the cost they are willing to pay is between the cost of driving a private car alone and the cost of taking a taxi. The higher the compensation and commission for the driver is, the longer the acceptable length of the detour in the driver's mind.
There are also studies focusing on pricing policy in ridesharing systems. Sun et al. [31] point out that there are fewer restrictions on the access to the ride-sharing market and less strict supervision on pricing. They present the impact of labor supply elasticity on market labor supply from the 3 Wireless Communications and Mobile Computing perspective of supply and demand in economics. Cachon et al. [32] study the surge pricing strategy. The provider is paid a fixed commission at a dynamic price. It is concluded that all stakeholders can benefit from the platform with selfscheduling ability under the surge pricing strategy. These papers focus on pricing policy but ignore the utility of passengers in a ride-sharing system. When the more utility of passengers is obtained, they will be willing to pay more for a certain route of their travel.
In terms of matching for dynamic ride-sharing systems, Wang et al. [33] introduce some mathematical methods to establish stable matches. They consider the stability of ride-sharing matches and propose optimization approaches. Peng et al. [34] propose a stable matching model for the ride-sharing. The objective function of the model is minimizing travel cost of the passengers. They also illustrate the main factors affecting the successful matching rate. Zkan [35] researches the interplay between pricing and matching decisions of a ride-sharing firm. He proves that the optimization matching strategies effect on the performance of a ride-sharing application system. A utility method for the matching optimization of ride-sharing based on the E-CARGO model is proposed, which describes a real scenario in a ride-sharing problem and considers the overall system's utility.

E-CARGO Model. The E-CARGO model is proposed by
Canadian scholar Professor Zhu based on the research and discussion of role collaboration theory [36][37][38]. The E-CARGO model has been applied in assignment problems and recommendation systems. It is the research and extension of the basic theory of role distribution. The experiment shows that this method is efficient and reliable. The E-CARGO model is suitable for modeling social systems and economic systems with the formal analysis. In this paper, the engineering theory method based on role collaboration and the E-CARGO model is abstracted, and the ridesharing application is modeled.
In the E-CARGO model, a system ∑can be described as a nine-tuple ∑ : ≔ hC, O, A, M, R, E, G, S 0 , Hi, where C is a set of classes, O is a set of objects, A is a set of agents, M is a set of messages, R is a set of roles, E is a set of environments, G is a set of groups, S 0 is the initial state of the system, and H is a set of users. In such a system, A and H and E and G are tightly coupled sets. A user and his agent can play a role together. Each group works in the same environment, and the environment has a normative effect on the groups. In the E-CARGO model, each agent plays only one role at a time.
Many problems in reality can be formalized and specified with the E-CARGO model [39][40][41]. Firstly, the problem is decomposed into subproblems, and the roles and agents are determined. Secondly, the relationships and constraints between roles and agents are described by constraints. Thirdly, agents are assigned to roles and groups. The assignment results are evaluated through the evaluation criteria. Then evaluation and assignments are performed circularly to meet evaluation criteria indicators. Finally, the final assignment scheme is determined. In the following ridesharing model, we focus on agents (A) and roles (R). The following formal definitions can be taken as a part of the E-CARGO model.

Travel Utility.
In the utility theory, utility refers to the satisfaction that customers get in the process of exchanging goods. Utility function is often used to model different consumption behaviors and measure social welfare or satisfaction of a consumer [42]. The utility function is used to identify different customers' behavior [43]. Passengers usually consider travel experience and actual conditions to select travel modes. In the utility theory, passengers always choose the trip modes that can maximize their personal utility.
The drivers and passengers in a ride-sharing system can be regarded as participating agents. When the utility obtained by each participating agent is strictly greater than that obtained without participating, and no other protocol provides greater utility for all agents, it can be regarded as that all agents spontaneously participate in the system game.
Passengers prefer to travel with acquaintances or similar age people. Due to objective factors affecting travel mode such as travel cost, convenience, and time, there is great randomness to a certain extent. In the utility function, we mainly consider the following core factors: (i) Expenses incurred in a driver to passenger matching with a profit matrix (ii) Time cost (iii) Cost of privacy protection (iv) Cost due to lack of reputation We assume that the relationship between utility and core factors and attributes is linear. The utility function can be established with RBC as follows: where α,β,γ, and δ are the weight coefficients of the core factors. When the drivers' revenue increases, the drivers' utility also increases. When passengers' payment increases, the passengers' utility decreases. There is a negative correlation between the passengers' travel utility and the travel cost. The weight coefficient value α in the driver utility function is bigger than that in the passenger utility function. There is a positive correlation between the drivers' travel utility and revenue.
We assume that all pick-up arrangements are completed within an acceptable time range. Therefore, there is little difference in the utility weight coefficient value β of time cost in the driver and passenger utility functions. Passengers pay more attention to privacy and reputation. Therefore, the weight coefficients γ and δ of privacy cost and reputation cost are bigger than those of drivers under the same cost.

Model Formulation.
In a ride-sharing system, it is necessary to consider the acceptable time range, profit income, 4 Wireless Communications and Mobile Computing and vacant seats for vehicle scheduling matching and transfer modes. In order to save travel cost and time, passengers may transfer.
In a ride-sharing system, a driver role is defined as R : ≔ < n, I, Ac, Ap, No, Q 1 > , where n is the identification of the driver role; I : ≔ < M in , M out > denotes the message set processed by the driver roles of the ridesharing system, where M in expresses the incoming messages and M out expresses the outgoing messages; Ac expresses a set of agents who are currently playing this role, that is, a set of passengers who are matched to the drivers; Ap expresses a set of agents who are potential to play this role, that is, a set of passengers that may be matched; No expresses a set of objects that can be obtained by the agent playing this role, mainly including traveling passengers on the way together; and Q1 expresses the minimum evaluation value required for the agent to play this role, i.e., travel revenue. In the ride-sharing system, role R represents a car driver who will be matched to passengers.

Definition 2. Agent A.
In a ride-sharing system, a passenger agent is defined as A : ≔ < n, Rc, Rp, Ng, Qr > , where n is the identification of the passenger agent; Rc expresses a role that the agent is playing, that is, the driver of a car in which the passenger agent is riding; Rp expresses a set of roles that this agent may play in the future, i.e., the driver who will be matched due to transfers in the travel; Ng indicates the group number that this agent belongs to; and Qr expresses the evaluation value of this agent for each role in the set of roles. In the ride-sharing system, agent A expresses a passenger who sends out the message about the departure time, place, and destination.
Definition 3. L represents the passenger vector matched to the drivers, i.e., the number of passengers that each driver can be matched to within a certain time range.
Definition 4. The profit matrix Q of driver picking up passengers is a mxn matrix, where Q ½i, j represents the revenue of the driver role jð0 ≤ j < nÞ picking up the passenger agent i ð0 ≤ i < mÞ.
Definition 5. The matching matrix T is an mxn matrix, where T ½i, j represents whether the agent i is matched to the role j. T ½i, j = 1 indicates that the agent i is matched to the role j. T ½i, j = 0 indicates not. T ½2, 2 = 1 represents the third passenger agent is matched to the third driver role.
Definition 6. When the number of passengers carried by the driver role R in the same time is less than or equal to the maximum passenger capacity of the car, the driver role R is operable, i.e., ∑ m i=0 T½i, j ≤ L½j.
Definition 7. Passengers may transfer many times from the departure to the destination. L a ½i ð0 ≤ i < mÞ indicates the maximum transfer times of passenger agent i. L a ½i = 0 indi-cates that the passenger agent is not matched to a driver, and the sharing request fails.
Definition 8. L½j ∈ Ν(0 ≤ j < n) is a driver role range vector, where N is a natural number. In a ride-sharing travel system, it represents the maximum number of passengers carried by a car. For example, the maximum number of passengers carried by a 5-seat car at the same time is 4, i.e., L½j = 4.
Definition 9. After determining the matching matrix T, the total revenue r is the sum of all drivers' revenue, i.e., r = ∑ n−1 j=0 ∑ m−1 i=0 Q½i, j × T½i, j. The solution process of total income is to multiply the revenue matrix Q by the matching matrix T.
In the many drivers to many passenger mode, one driver can pick up more than one passenger. It is assumed that there is an intersection between ride time and distance. It is in a flexible and acceptable time range. Let m represent the number of passenger agents and n represent the number of driver roles. There are N seats in cars. Each passenger can transfer many times. The main objective is to maximize the total revenue r of all drivers picking up and transporting passengers. Let U d represent drivers' utility and U p represent passengers' utility. To encourage more drivers and passengers to participate in the ride-sharing system, the gap between driver utility and passenger utility should be within a reasonable range. A utility constraint is added to the following model.
where expression (3) is a 0-1 constraint, and it represents whether the passenger i is matched to the driver role j; (4) guarantees passengers are allocated according to the number of vacant seats; (5) indicates the maximum transfer times of the passenger i; and (6) indicates the utility constraint between drivers and passengers.

Case Analysis.
It is assumed that 10 passengers send ride requests at the same time within a certain acceptable distance. There are 4 drivers available for dispatching. The cars all have 5 seats. Passengers do not transfer. According  [18,19] is O (m 3 ), which is better than the exhaustive search method. The above problem can be transformed into integer programming to solve the maximum matching matrix T. The algorithm is described as follows:

Simulation Experiments and Result Analysis
The experimental platform is shown in Table 2. To check the applicability and performance of the proposed model, the experiments are conducted. The values of the revenue matrix Q are produced randomly between 0 and 10. We let m = f100, 200, ⋯, 900,100g, n = m, m = 2n, L½j ∈ ½0, 1, 2, ε = 0:2.
According to the revenue matrix, simulate the scenarios with the same and different number of drivers and passengers as follows.
4.1. Nonutility Scenario. The utility of drivers and passengers is not considered. For each scale, the matching times in Kuhn-Munkres algorithm are collected. The total revenue r is shown with m = n and m = 2n in Figure 1. Tables 3 and  4 show the matching times with m = n and m = 2n.

Utility
Scenario. The utility of drivers and passengers is considered. In utility scenario, we let ε = 0:2. The utility of one-to-one and one-to-many matching when m = n and m = 2n is shown in Figure 2. The time of one-to-one and one-to-many matching when m = n and m = 2n is shown in Figure 3.
The experiments indicate that the greater the gap between the number of passengers and drivers, the less the total revenue and utility. When the number of drivers and passengers is the same, the utility of one-to-one matching between drivers and passengers is approximately equal to one-to-many matching. When the number of drivers and passengers is different, the utility of one-to-one matching is the least.
In terms of the time spent on matching, Figure 3 shows that the time cost increases with the increase of the number of drivers and passengers participating in the ride-sharing   system. When m is bigger than a certain value (m > 600), time cost increases sharply in both matching methods. When the number of drivers and passengers is different, one-to-many matching takes the least time, and one-to-one matching takes more time. When the number of drivers and passengers is the same, the time cost of one-to-one matching increases sharply with m > 800. The results show that our solutions are practical.

Conclusions
The matching optimization is a general problem in a ridesharing system. In this paper, under the constraints of vacant seats and passenger transferring, the matching problem in the ride-sharing system is formally modelled based on the E-CARGO model. First, the E-CARGO model and travel utility are introduced. Next, the proposed method is formalized. Then, algorithm analysis is provided. Finally, the Kuhn-Munkres algorithm is used to solve the optimal matching matrix. The analysis of time performance shows that the proposed method is practical.
In the future work, we will further study methods to solve matching optimization problems. To improve the matching rate and time performance, we will improve the algorithm to meet the real-time requirements of dynamic ride sharing matching. We plan to study the relationship between pricing and matching based on the E-CARGO model and utility theory. Besides, to attract more and more passengers and drivers to participate in the ride-sharing system, utility incentive mechanism is also the direction and content of our research in the future.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
The authors declare that they have no conflicts of interest regarding the publication of this paper.