Fair cost allocation for ridesharing services - modeling, mathematical programming and an algorithm to find the nucleolus

02/19/2019 ∙ by Wei Lu, et al. ∙ Amazon Texas A&M University 0

This paper addresses one of the most challenging issues in designing an efficient and sustainable ridesharing service: ridesharing market design. We formulate it as a fair cost allocation problem through the lens of the cooperative game theory. A special property of the cooperative ridesharing game is that its characteristic function values are calculated by solving an optimization problem. Several concepts of fairness are investigated and special attention is paid to a solution concept named nucleolus, which aims to minimize the maximum dissatisfaction in the system. Due to its computational intractability, we break the problem into a master-subproblem structure and two subproblems are developed to generate constraints for the master problem. We propose a coalition generation procedure to find the nucleolus and approximate nucleolus of the game. Experimental results showed that when the game has a non-empty core, in the approximate nucleolus scheme the coalitions are computed only when it is necessary and the approximate procedure produces the actual nucleolus. And when the game has an empty core, the approximate nucleolus is close to the actual one. Regardless of the emptiness of the game, our algorithm needs to generate only a small fraction (1.6 constraints to compute the approximate nucleolus. The proposed model and results nicely fit systems operated by autonomous vehicles.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Ridesharing services, whose aim is to gather travelers with similar itineraries and compatible schedules, are able to provide substantial environmental and social benefits through reducing the use of private vehicles. When the operations of a ridesharing system are optimized, it can also save travelers a significant amount of transportation cost. The economic benefits associated with ridesharing in turn attract more travelers to participate in ridesharing services and thereby improve the utilization of transportation infrastructure capacity.

An optimized ridesharing service is usually designed to minimize the system-wide travel cost. This is beneficial in the society’s point of view, assuming each agent accepts the system’s assignment. This is, however, a strong assumption considering agents might form their own ridesharing groups if they find doing so is more of their own interest.

Recall that the agents of ridesharing system participate in this system in the hope of saving travel cost. So it is up to the ridesharing service provider to decide how the travel cost would be shared among customers after a ridesharing plan is proposed and accepted by the customers. This is a non-trivial task because if the agents find the cost allocation scheme unfair, they may leave the system and form their own ridesharing group in the long run. This fair cost-allocation situation is critical to the sustainability of a ridesharing system and thus is the motivation of the study in this paper.

The ridesharing cost allocation problem is modeled as a cooperative game. Cooperative game theory, due to its close relation to combinatorial optimization, has drawn significant attention of the operations research community. Since its introduction by

(von Neumannn and Morgenstern, 1944), cooperative game theory has developed several solution concepts that aim to resolve the benefits (cost) allocation issues among cooperative players. In this paper, we are primarily concerned with a particular cost allocation solution concept - the nucleolus. The nucleolus of a cooperative game has several nice properties. Intuitively, it is a solution to the cost allocation problem that minimizes the maximal dissatisfaction among the customers.

The concept of nucleolus was first suggested by (Schmeidler, 1969) and since then was developed by (Shapley, 1967) and (Maschler et al., 1979). Although the nucleolus has several game theoretic virtues, the computation of nucleolus is very difficult. In fact, for a n-player game, as the size of the characteristic function grows exponentially with the number of players, any enumeration algorithm that computes the nucleolus that requires the entire information of the characteristic function takes time, assuming the characteristic function is readily available. Moreover, as will be shown in later section, finding the characteristic function value of ridesharing game involves solving an optimization problem related to the Traveling Salesman Problem (TSP), which is NP-hard itself. This means the computation of the nucleolus of ridesharing game can easily become intractable and more efficient algorithm needs to be developed.

In this paper, we propose a nucleolus-finding algorithm for the ridesharing game by successively solving a number of linear and integer programs. The linear programming (LP) problem for nucleolus calculation was first studied by

Kopelowitz (1967) and stimulated several LP-based algorithms for nucleolus computation. Dragan (1981) suggested an algorithm for computing the nucleolus by generating the minimal balanced sets of the player set. Our nucleolus-finding procedure combine the LP-based algorithm with the constraint generation framework proposed in (Hallefjord et al., 1995), such that the explicit information of the characteristic function of a ridesharing coalition is only computed when it is “dissatisfied”. In this way the computational burden is significantly reduced.

Note that the constraint generation approach was first proposed in (Gilmore and Gomory, 1961) and was successfully applied to solving the cutting stock problem. Utilizing a similar idea, (Göthe-Lundgren et al., 1996) studied the basic vehicle routing game (VRG) in which a fleet with homogeneous capacity are available. The authors analyzed the properties of this game and proposed a nucleolus-finding procedure based on coalition generation. (Engevall et al., 2004) generalized the model of (Göthe-Lundgren et al., 1996) to consider vehicles with heterogeneous capacities and studied a real-world case based on their model.

The recent prosperity of ridesharing services has spurred a growing attention from the research community. There are some game-theoretic studies, either from a cooperative or non-cooperative perspective, that focus on the mechanism and stability of ridesharing recommendations. Shen et al. (2016) proposed an online ridesharing mechanism that satisfy ex-post incentive compatibility, individual rationality, and budget-balance in a non-cooperative context. Zhang et al. (2016) designed a double auction based discounted trade reduction mechanism for dynamic ridesharing pricing that is individual rational, incentive compatible, budget balancing and has a larger trading volume. Gopalakrishnan et al. (2016) studied the costs and benefits of dynamic ridesharing by introducing the notion of sequential individual rationality and sequential fairness. Wang et al. (2018) introduced the concept of stable matches, understanding and addressing the gap and trade-off between the wholistic optimal matchings of and the optimal matchings from individual rider’s perspective. From a cooperative game theoretic perspective, Bistaffa et al. (2017, 2015a, 2015b) tackled the coalition formation and payment allocation for the so-called social ridesharing problem, in which the feasible coalitions of a set of commuters are restricted by a social network represented by a graph. The authors focused on the solution concept of kernel-stable payments.

To sum up, this paper advances the state of the art as the following. In contrast with the previous related work in which the existence of several restrictions (fixed driver/rider roles, possible coalitions limited by social network, etc.) significantly reduces the search space, our model has no such restrictions and therefore is more general. Second, to our best knowledge, our work is the first attempt that computes the nucleolus which is provably the most stable payment allocation scheme, compared to other concepts such as kernel and core, in the context of ridesharing cost allocation.

This paper is organized as follows. In Section 2, a formulation of the ridesharing cost allocation problem is developed from a game theory perspective and the properties of the characteristic function are analyzed. Section 3 discusses the fairness issues in the ridesharing game regarding the core and the nucleolus. A coalition generation scheme is then developed to compute the nucleolus. The constraint generation subproblem is explicitly formulated by a mathematical formulation related to the ridesharing optimization problem. In Section 4, numerical experiments are conducted and the performance of the proposed nucleolus procedure is evaluated. Finally, conclusions and future research ideas are presented in Section 5.

2 Ridesharing Optimization Problem From A Game Theory Perspective

Consider a set of ridesharing participants and denote it by . Each participant wants to travel from her origin to her destination . Each participant can potentially be the driver. Denote the capacity of a vehicle by . Consider the subsets of participants that do not exceed the vehicle capacity, i.e. . For each such participant subset , assume the feasible route with minimum cost is known. Here by feasible it means the following conditions are met

  1. the route starts from an agent origin and ends at his destination.

  2. Let . For every agent , precedes in .

Denote by the cost of such a feasible route and by the set of feasible routes with minimal cost. Let if participant (both and ) is served by route and otherwise. The ridesharing optimization problem (RSP) can be formulated as

s.t. (2)

In the formulation if feasible route is selected and otherwise. Constraints (2) guarantee that each participant is covered by exactly one route. Note that the coefficient in the objective function is obtained by finding the minimal cost route that covers the participants for which , that is, by finding the solution to the corresponding TSP with precedence constraints.

It is noted that this formulation is characterized by its large number of columns. Therefore, this formulation is practically solvable by a column generation solution method. Similar approaches were successfully applied to the vehicle routing problems (VRP) (Balinski and Quandt, 1964; Desrochers et al., 1992, see). When we solve the RSP with a column generation approach, it is of our interest to reduce the number of columns. We show this is possible as follows.

We first introduce the definition of the profitable ridesharing route.

Definition 1 (profitability)

Denote by the corresponding minimum cost feasible route of participant subset . is non-profitable if there exists two non-empty subsets such that . A route is defined profitable otherwise.

Intuitively, a shared-ride route becomes non-profitable if by ridesharing the participants end up spending more money on the transportation cost.

The following proposition shows that we only need to consider a subset of the columns when solving RSP.

Proposition 1

Let be an optimal solution to RSP, i.e. . Then must be a profitable route.

Proof by contradiction. Let be an optimal solution to RSP. Suppose there exists such that is a non-profitable route. Let be the corresponding participants that are covered by this route. Then by definition there must be two non-empty subsets such that . Since all the customers that are covered by are also covered by and , we can get a new feasible solution to RSP by substituting with , and while keep all the other variables unchanged. This feasible solution has a strictly less cost than . Contradiction.

From a game theory perspective, we denote each ridesharing participant, , by a player and each subset of participants, , by a coalition.

The ridesharing cost allocation problem is the problem of finding a “fair” cost allocation scheme for the ridesharing optimization problem (RSP).

A cooperative ridesharing game is defined by specifying a travel cost for each coalition. The game is defined by a ridesharing group , and a characteristic function from the set of all possible coalitions (sub-ridesharing group) of players in to a set of payment schemes satisfying . Here denotes the power set of . In the context of RSP game the characteristic function can be seen as the travel cost occurring if coalition

is formed. Each coalition can be defined by a binary vector


Define as the objective value of a mathematical program. For all coalitions , let be the solution to the following mathematical program

s.t. (5)

Intuitively, represents the cost of an optimal route that covers the players in , i.e. the players for which .

When studying a cooperative game, it is of great interest to study the properties of its characteristic function. Assuming that the singleton coalitions have a positive cost, we prove that the characteristic function of the RSP game is monotonic and subadditive. Interested readers can find the proof in the Appendix. It is noteworthy that subadditivity implies larger coalitions save more. So it is always beneficial to include more people to participant in ridesharing and this is a desirable property of the RSP game.

Denote a coalition whose cardinality is smaller than the vehicle capacity () as a feasible coalition and otherwise as an infeasible coalition. Denote by the set of feasible coalitions. Then we get

In addition, denote a coalition such that by a profitable coalition and otherwise by a nonprofitable coalition.

(a) Profitable Coalition,
(b) Nonprofitable Coalition,
Figure 1: Profitable vs. nonprofitable coalition

Figure 1 gives an example where forming a coalition will not always produce desirable results: instead of reducing total transportation cost as Figure 1LABEL:sub@p, Figure 1LABEL:sub@np actually increases the total cost, meaning it doesn’t make much sense to form such a coalition. In this case the players are better off on their own. Note that the profitability of forming a coalition in a large extent depends on the relative geo-locations of the players.

3 Fairness and Stability in RSP Game

3.1 The core and the nucleolus

3.1.1 The core

Let be the cost allocated to agent , . The core of the RSP game is the set of the cost allocation plans , such that


The above inequalities can be interpreted as no single player or coalition should make a payment that is greater than their cost on their own. A cost allocation scheme that is in the core is a good allocation as no coalition has the incentive to leave the grand coalition. An inequality in (8) is called a core defining inequality (CDI).

It is observed that the number of CDIs is in the scale of . As will be shown in later sections, in order to find the core and the nucleolus efficiently, it is important and of our great interest to reduce the number of CDIs. This is possible through the following propositions.

Proposition 2

Any CDI with a nonprofitable coalition , is not needed in (8).

Consider any nonprofitable coalition , . Denote by the players in . By definition of nonprofitable coalition we have . Note that all individual players are also singleton coalitions. It follows that

Proposition 3

For a RSP game with non-empty core, any CDI with an infeasible coalition , is not needed in (8).

Similar to (Göthe-Lundgren et al., 1996), let , be an infeasible coalition. Denote by the corresponding optimal routes and the disjoint feasible coalitions corresponding to the optimal routes. Since we have and , then we have the following

From Proposition 2 and Proposition 3 we have

Thus, when the core of the RSP game is non-empty, the only characteristic function values of our interests are those corresponding to profitable and feasible coalitions. This, as will be stated in later sections, reduces the size of the coalition-generating subproblem dramatically. Note that the calculation of for a coalition is equivalent to solving the corresponding traveling salesman problem with pick-up and drop-off constraints (TSPPD) for the customers for which .

3.1.2 The nucleolus

In a cooperative ridesharing game, in which players share travel cost, allocations are the payments each player need to pay. That is to say, cooperative ridesharing game (RSP game) is a cost game.

Let denote the cost characteristic function of a cooperative ridesharing game. Then the function gives the amount of collective cost a group of players need to pay through forming a coalition. In an RSP game, the excess of for a coalition is defined as and measures the amount of cost-saving of coalition in the allocation , compared to . Note that when is negative, it means the sum of the cost of in the allocation must exceed . Thus measures the dissatisfaction of in the allocation

. Recall that the core is defined as the set of imputations such that

for all coalitions , then we have that an imputation is in the core if and only if all its excesses are positive or zero. Denote by the excess vector of whose elements are arranged in non-decreasing order, that is, . Then a cost allocation vector is in the core if and only if it is efficient and . Consider the lexicographic ordering of excess vectors: for two payment vectors , we say is lexicographically greater than if such that and . Denote this ordering by .

Definition 2 (Nucleolus)

The nucleolus of a RSP game is the lexicographically maximal imputation. Denote the nucleolus by and let be the set of imputations, then we have

Intuitively, the nucleolus is by definition the fairest cost allocation plan because it minimizes the maximal dissatisfaction of all the coalitions in the ridesharing system. Remember that a coalition is a subset of all the ridesharing groups. As a result, on the condition that the core is nonempty, the nucleolus is the center of the core, and a ridesharing system that implements the nucleolus as the cost sharing plan is provably the most stable. It is of our interest to investigate the non-emptiness of the core of RSP game because the definitions of nucleolus and the core are related. In fact, the following example shows that the core of RSP game may be empty.

Figure 2: A three player example

The transportation costs of three players are given in Figure 2. Assuming that each player’s vehicle has a capacity of one extra passenger seats, the characteristic function of this 3-player game is then defined by , (e.g., ), (e.g., ) and . The optimal route configuration is, for example, and . We show the calculation of nucleolus of this example in Table 1.

As an initial guess, we try . In Table 1, we find that the minimum excess happens at coalition and . These are the coalitions with maximum dissatisfaction. To improve this, we must increase both and . This involves decreasing , and will decrease the excess for at the same rate. Also note that player and player have symmetrical roles in this game, thus we can conclude that the best scenario occurs when the excesses for , and are all equal. Solving the equations,

we find the nucleolus of this game is and (note that ).

S c(S) e(y, S) (4, 4, 4)
1 5 1
2 5 1
3 5 1
1 and 2 7 -1
2 and 3 7 -1
1 and 3 9 1
Table 1: Calculation of nucleolus - empty core

Interestingly, if we increase the capacity of the vehicles to two extra seat, then we obtain a game with a nonempty core. In this case, the characteristic function is defined in the following fashion. For the singleton coalitions and the 2-coalitions, characteristic function values remain the same. However, for the grand coalition . The optimal route configuration is, for example, . The calculation of nucleolus of this example is shown in Table 2.

S c(S) e(y, S) (3, 3, 3)
1 5 2 4/3
2 5 2 10/3
3 5 2 4/3
1 and 2 7 1 5/3
2 and 3 7 1 5/3
1 and 3 9 3 5/3
Table 2: Calculation of nucleolus - nonempty core

Initially, we try . In Table 2, we find that the minimum excess happens at coalition and . These are the coalitions with maximum dissatisfaction. To improve this, we must increase both and . This involves decreasing , and will decrease the excess for at the same rate. Also note that player and player have symmetrical roles in this game, therefore we can conclude that the best scenario we can achieve happens when the excesses for , and are all equal. Solving the equations,

we find the nucleolus of this game is . Here, and the nucleolus of this game is the center of the core.

3.2 An algorithm to find the nucleolus

As discussed before, finding a nucleolus will ensure the ridesharing system implements the provably fairest cost allocation plan to the users, which also ensures the stability of the system. A procedure to calculate the nucleolus is developed in this paper and with sufficient amount of computational resources, a system that is able to handle realistically large-scale ridesharing service system can be developed. In a nutshell, the proposed algorithm starts with the least core, and continues with lexicographic optimization through iterating between the master problem and the subproblems. We detail this procedure below.

3.2.1 The master problem

Since the nucleolus is in the least core, which minimizes the maximal dissatisfaction, we start with the solution to the following maximin problem

which can be transformed to a linear program

s.t. (10)

Notice that the LP program has constraints, and computing involves solving the corresponding TSPPD. So the LP program can easily become intractable. We therefore approach this problem with a constraint generation procedure. Hallefjord et al. (1995) has suggested such an approach for linear programming games. Göthe-Lundgren et al. (1996) has used a similar approach to solve the vehicle routing problem (VRP) game.

Since before searching for the nucleolus, we should already know the solution to the corresponding RSP, thus the optimal route configuration, we can start with the coalitions corresponding to the optimal routes. Besides, the singleton coalitions’ cost values are readily available. Denote by the available coalitions, then can be replaced by the following relaxed problem

s.t. (13)

If the solution to () is unique, let it be , i.e. , then is the nucleolus of the game. If the solution to () is not unique, we continue to find the greatest among the with . We continue this process until the solution to the linear program is unique. At stage the master LP problem to be solved is

s.t. (16)

The solution to the last program in this series is the nucleolus of this game. Let be the dual variable corresponding to constraint . Let denote the set of coalitions whose corresponding constraints are binding, that is, .

The essential idea of constraint generation approach is trying to find the nucleolus with explicit information of only a small portion of the entire coalition set. This goal is realized by finding the most violated constraint that is not yet included in via a subproblem after the master problem is solved at each stage. Denote the optimal solution to by . The constraint that is violated the most, aka the most unhappy coalition given the cost allocation scheme , is obtained through solving the following subproblem

This nucleolus-finding procedure for a ridesharing game is developed based on the theories and techniques proposed in Dragan (1981) and Kopelowitz (1967) and a general constraint generation framework proposed in Hallefjord et al. (1995). The pseudocode of this procedure is given in Algorithm 1. First, at stage the master LP problem is solved and both the primal and dual solutions are returned. Second, a subproblem is solved and the least satisfied constraint () that is not yet included is identified. If , then we include in and resolve with newly included constraint . This stage iterates between the master problem and the subproblem until no coalition violates the rationality constraints of the master problem (i.e. ). When this is achieved, we identify the active and binding constraints, reformulate the master problem (modify and ) and proceed to the next stage (). This process continues until the solution to the master problem is unique. And this last solution is the nucleolus of the RSP game. Note that in the procedure SP.addCut(), a cut of the type of inequality (42) is added to the subproblem to prevent the duplication of row associated with coalition .

The following two subsections will discuss two formulations of subproblem . In particular, we will discuss how the second formulation reduces the complexity of the overall procedure by utilizing the aforementioned propositions.

input : Geolocations of customers
output : Nucleolus of the ridesharing game
t 1 ;
STOP false ;
while !STOP do
       Solve a master problem ;
       Solve a subproblem ;
       if  then
             SP.addCut() ;
       end if
             STOP true ;
             for every active and binding constraint  do
                   STOP false ;
             end for
       end if
end while
Algorithm 1 Procedure of finding the nucleolus of a cooperative ridesharing game

3.3 Coalition generation subproblem – general

Recall in the nucleolus-finding scheme described in Algorithm 1, it involves finding the most violated constraint in the subproblem. This is equivalent to finding the “least satisfied” subset of customers with a given allocation proposal. A general formulation of the subproblem is thus

() (19)

Constraints (20) are preventing the re-generation of constraints.

Note that calculating is equivalent to solving the RSP model for customers , i.e. those . This implies that we can formulate the subproblem explicitly. Denote by the graph of the RSP game with vertex set and edge set . Here vertex is the “dummy” depot such that any edge incident with it has a cost of . is the origin (destination) vertex set of players in . Each player is associated with a profit (prize) equal to . The subproblem of the constraint generation procedure is to find a subset of customers in which maximizes the total prize minus the total cost, while conforming to certain constraints.


This problem can be termed as prize-collecting RSP (see Balas (1989) for an analogy of TSP and prize-collecting TSP). Constraints (24) make sure that a tour starts at origin and ends at destination. Constraints (25) - (28) are the continuity constraints. Constraints (29) are a group of subtour-elimination constraints (SECs) first proposed by Miller et al. (1960). Here are continuous variables called node potentials that indicate the visit order of node in the tour, while denotes the maximal number of nodes a vehicle can visit in a tour. This parameter can be used to specify the seat capability of vehicles. Generally won’t exceed 10. Constraints (30) ensure that a customer’s origin precedes his destination. Constraints (31) ensure that each node is visited by exactly one vehciel. Constraints (32) make sure that a customer’s origin and destination are visited by the same vehicle. The intuitive meaning of constraints (34) and (35) is that if edge is selected in the solution then nodes must be served by the same vehicle. This set of constraints serve as a bridge between variables (indicating whether an edge is selected) and variables (indicating whether a node is served by a particular vehicle). Here and are large numbers.

3.4 Coalition generation subproblem – non-empty core

Recall that when the RSP game has a non-empty core, the only coalitions that are non-redundant are the feasible coalitions (Proposition 3). Notice that is the minimum cost of a feasible route that covers the origin and destination of all the players in , that is, those . This inspires us to formulate the subproblem explicitly. Let be the graph with vertex set and edge set . Here vertex is the “dummy” depot such that any edge incident with it has a cost of . is the origin (destination) vertex set of players in . Each player is associated with a profit (prize) equal to . The constraint generation subproblem finds a feasible route in which maximizes the total prize minus cost, while conforming to the ridesharing problem constraints, such as capacity, precedence and maximum travel distance per passenger.

Denote the edge selection variable in the graph by . This problem is represented by

s.t. (41)

Constraints (42) put the restriction that a constraint that is generated before is not generated again. Constraints (41) are the capacity constraints and (43) forces a tour to start at origin and end at destination. Constraints (46), (47), (48) and (49) are the flow balancing constraints for each vertex. Constraints (50) are the subtour elimination constraints and (51) are the precedence constraints.

It is noteworthy that the propositions in Section 3.1 help reduce the complexity of Algorithm 1 significantly. This contribution is twofold. First, when the RSP game has a non-empty core, only feasible coalitions need to be considered in the subproblem (). Second, although both prize-collecting RSP () and prize-collecting TSPPD () are NP-hard, prize-collecting RSP involves rider partitioning, therefore is much more difficult to solve than prize-collecting TSPPD, which concerns a single route with limited number of stops.

4 Experiments

We have implemented the nucleolus algorithm (with both and as subproblem) in Java with CPLEX 12.6 and the Concert library. In this section, we first show the results of nucleolus algorithm with as subproblem. Because is much easier to solve than , and the coalitions needed are much fewer in than in , nucleolus algorithm with can not only calculate the nucleolus when the RSP has a non-empty core, but can also be used to find an approximate nucleolus when the corresponding RSP has an empty core. Next, we show a comparison between the nucleolus and the approximate nucleolus, obtained by using the nucleolus algorithm with and as the subproblem, respectively.

4.1 Approximate nucleolus

We report results for two instances of the 10-player problem, which is the largest problem we have solved. As will be shown later, the computational bottleneck is not at the nucleolus algorithm but at solving the corresponding ridesharing optimization problem (RSP). The data set111The data sets can be downloaded from http://www.diku.dk/~sropke/ we used in the experiments were selected from Dumitrescu et al. (2010). The origins and destinations of customers were randomly generated in the square . The Euclidean distances were used. Table 3 shows the geographical locations of the players. After solving the RSP MIP model, the optimal ridesharing plan is , , , , , . These, along with other singleton coalitions are used to generate the initial constraints of the master LP problem.

At stage three constraints are generated by solving the subproblem. They correspond to the coalitions of , , and . Active constraints corresponding to coalitions , and are then identified at the end of stage . At stage , we notice that the solution to the master problem is unique, thus we find the approximate nucleolus. The approximate nucleolus of this game is listed in the last column of Table 3.

In total, out of constraints are needed to compute the approximate nucleolus, which is only a very small fraction ().

( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )


Table 3: Data and approximate nucleolus of prob10c

In our second experiment of prob10d (see Table 4), the optimal ridesharing configuration is , , , , and . At stage 1, four constraints are generated after via solving the subproblem. They correspond to the coalitions of , , and . At stage , the master LP problem is found to have a unique solution. This solution is thus the approximate nucleolus of this game. The approximate nucleolus is listed in the last column of Table 4. In total, constraints were needed to compute the approximate nucleolus.

( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )
( ) ( )


Table 4: Data and approximate nucleolus of prob10d

It is noteworthy to point out that the computational time for both instances is very small (less than 10s), indicating the bottleneck is the optimization solution method.

4.2 Nucleolus vs. approximate nucleolus

In this subsection we conduct two experiments to compare the actual nucleolus and the approximate nucleolus. Finding the actual nucleolus by using Algorithm 1 with as subproblem is a very time-consuming process. In our first example, problem8a, it takes hours to find the actual nucleolus. In our second example, problem8b, the time it takes to find the actual nucleolus goes up to hours.

The actual nucleolus cost and approximate nucleolus cost are summarized in Table 5 and Table 6. As we can see, the solutions obtained by the approximate nucleolus algorithm are a close approximation for the actual nucleolus in both cases.

It is of our interest to see the computational performance of Algorithm 1 using and . In problem8a, a total of constraints are generated by , comparing to a total of constraints generated by . In problem10d, a total of coalitions are generated by , comparing to a total of only coalitions generated by . Note that the total number of coalitions (not including the empty set and the universal set) is for problem8a and problem8b. Therefore, Algorithm 1 using generated and of the total constraints to find the nucleolus in problem8a and problem8b, respectively. So Algorithm 1 using is more like an enumeration procedure. Thus is much more computationally efficient than , since the number of constraints generated by are significantly higher than that of . This along with the fact that is much harder to solve than explains the significant time difference between Algorithm 1 using and .

In Figure 3 and 4 we measure the Euclidean distance between the incumbent nucleolus and the actual nucleolus () as the algorithm iterates. These two figures show the solution path of the algorithm in both cases. As can be seen, in both cases, the algorithm found the nucleolus before it stopped. This happened before the 20th iteration in problem8a, and before constraints were generated in problem8b. It means the majority of the running time of this algorithm is consumed after the actual nucleolus is found.

Nucleolus Cost
Table 5: Nucleolus vs. approximate nucleolus – problem8a
Nucleolus Cost
Table 6: Nucleolus vs. approximate nucleolus – problem8b
Figure 3: Solution path – problem8a
Figure 4: Solution path – problem8b

5 Conclusions

We studied an important problem faced by ridesharing service provider: how to allocate cost among ridesharing participants to ensure sustainability and fairness. This fair cost allocation problem was modeled as a cooperative game. A special property of the cooperative ridesharing game is that its characteristic function values are calculated by solving an optimization problem. To better understand this game, we further studied the characteristic function and proved it to be monotone, subadditive, but non-convex (meaning the core can be empty). The most fair allocation plan is identified by the nucleolus of the RSP game. We then proposed an iterative constraint-generation algorithm (Algorithm 1) for calculating it in two situations – the game has an empty core and the game has a non-empty core. In both cases the algorithm utilizes an explicitly formulated MIP as the subproblem to generate constraints. When the game has an empty core, the algorithm uses as the subproblem and becomes an enumeration procedure to find the nucleolus of the game. When the game has a non-empty core, this algorithm uses as the subproblem which utilizes the special properties of the RSP game such that the characteristic function values are computed only when they are needed. Therefore the number of subproblems (an NP-hard optimization problem) that need to be solved is significantly reduced. Experiments showed that by adopting this algorithm with only a small fraction () of the coalition constraints were needed to find the nucleolus. It is also found in the experiments where the emptiness of the RSP game is unclear, the algorithm with

can be used to find an approximate nucleolus that is close to the actual one. This indicates that our proposed algorithm is promising in finding nucleolus of dynamic, large-scale RSP game and that since a cooperative game theory modeling approach does not necessarily differentiate drivers and riders explicitly, our model, the mathematical programs and the algorithm proposed in this paper also have very promising application in an autonomous vehicle ridesharing systems. We can see a few interesting and promising future research directions related to this study. First, efficient heuristics for the subproblems can be developed. Second, with such efficient algorithms in hand, we can further investigate the interaction between the vehicle capacity and the cost allocation, which we believe will provide insight on the intrinsic nature of ridesharing game. Besides, we started our study with the motivation of designing mathematical models and algorithms for the most general case of ridesharing scenario with the least amount of assumptions on the coalition etc. However in the real world, the existence of certain situations can significantly simplify the calculation. For instance, in the case some of the ridesharing participants have formed a coalition on their own, we can exploit these structural properties to simplify the coalition generation scheme and expedite the nucleolus calculation.


The authors would gratefully acknowledge the kind support from the Dissertation Fellowship of Texas A&M University. We are grateful to anonymous reviewers whose valuable suggestions have led to a considerable improvement in the organization and presentation of this manuscript.


  • Balas (1989) Egon Balas. The prize collecting traveling salesman problem. Networks, 19(6):621–636, 1989.
  • Balinski and Quandt (1964) M. L. Balinski and R. E. Quandt. On an integer program for a delivery problem. Operations Research, 12(2):300–304, 1964.
  • Bistaffa et al. (2015a) Filippo Bistaffa, Alessandro Farinelli, Georgios Chalkiadakis, and Sarvapali D. Ramchurn. Recommending fair payments for large-scale social ridesharing. In Proceedings of the 9th ACM Conference on Recommender Systems, RecSys ’15, pages 139–146, New York, NY, USA, 2015a. ACM.
  • Bistaffa et al. (2015b) Filippo Bistaffa, Alessandro Farinelli, and Sarvapali D. Ramchurn. Sharing rides with friends: A coalition formation algorithm for ridesharing. In

    Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence

    , AAAI’15, pages 608–614. AAAI Press, 2015b.
  • Bistaffa et al. (2017) Filippo Bistaffa, Alessandro Farinelli, Georgios Chalkiadakis, and Sarvapali D. Ramchurn. A cooperative game-theoretic approach to the social ridesharing problem. Artificial Intelligence, 246:86 – 117, 2017.
  • Desrochers et al. (1992) Martin Desrochers, Jacques Desrosiers, and Marius Solomon. A new optimization algorithm for the vehicle routing problem with time windows. Operations Research, 40(2):342–354, 1992.
  • Dragan (1981) I. Dragan. A procedure for finding the nucleolus of a cooperativen person game. Zeitschrift für Operations Research, 25(5):119–131, 1981.
  • Dumitrescu et al. (2010) Irina Dumitrescu, Stefan Ropke, Jean-François Cordeau, and Gilbert Laporte. The traveling salesman problem with pickup and delivery: polyhedral results and a branch-and-cut algorithm. Mathematical Programming, 121(2):269–305, 2010.
  • Engevall et al. (2004) Stefan Engevall, Maud Göthe-Lundgren, and Peter Värbrand. The heterogeneous vehicle-routing game. Transportation Science, 38(1):71–85, February 2004.
  • Gilmore and Gomory (1961) P. C. Gilmore and R. E. Gomory. A linear programming approach to the cutting-stock problem. Operations Research, 9(6):849–859, 1961.
  • Gopalakrishnan et al. (2016) Ragavendran Gopalakrishnan, Koyel Mukherjee, and Theja Tulabandhula. The costs and benefits of ridesharing: Sequential individual rationality and sequential fairness. CoRR, abs/1607.07306, 2016. URL http://arxiv.org/abs/1607.07306.
  • Göthe-Lundgren et al. (1996) Maud Göthe-Lundgren, Kurt Jörnsten, and Peter Värbrand. On the nucleolus of the basic vehicle routing game. Mathematical Programming, 72(1):83–100, 1996.
  • Hallefjord et al. (1995) Åsa Hallefjord, Reidun Helming, and Kurt Jørnsten. Computing the nucleolus when the characteristic function is given implicitly: A constraint generation approach. International Journal of Game Theory, 24(4):357–372, 1995.
  • Kopelowitz (1967) A. Kopelowitz. Computation of the Kernels of Simple Games and the Nucleolus of N-person Games. Defense Technical Information Center HEBREW UNIV JERUSALEM (Israel) DEPT OF MATHEMATICS, 1967.
  • Maschler et al. (1979) M. Maschler, B. Peleg, and L. S. Shapley. Geometric properties of the kernel, nucleolus, and related solution concepts. Mathematics of Operations Research, 4(4):303–338, 1979.
  • Miller et al. (1960) C. E. Miller, A. W. Tucker, and R. A. Zemlin. Integer programming formulation of traveling salesman problems. J. ACM, 7(4):326–329, October 1960.
  • Schmeidler (1969) David Schmeidler. The nucleolus of a characteristic function game. SIAM Journal on Applied Mathematics, 17(6):pp. 1163–1170, 1969.
  • Shapley (1967) Lloyd S. Shapley. On balanced sets and cores. Naval Research Logistics Quarterly, 14(4):453–460, 1967.
  • Shen et al. (2016) Wen Shen, Cristina V. Lopes, and Jacob W. Crandall. An online mechanism for ridesharing in autonomous mobility-on-demand systems. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI’16, pages 475–481. AAAI Press, 2016.
  • von Neumannn and Morgenstern (1944) J. von Neumannn and O. Morgenstern. Theory of games and economic behavior. Princeton University Press, Princeton, New Jersey, 1944.
  • Wang et al. (2018) Xing Wang, Niels Agatz, and Alan Erera. Stable matching for dynamic ride-sharing systems. Transportation Science, 52(4):850–867, 2018.
  • Zhang et al. (2016) J. Zhang, D. Wen, and S. Zeng. A discounted trade reduction mechanism for dynamic ridesharing pricing. IEEE Transactions on Intelligent Transportation Systems, 17(6):1586–1595, June 2016.


We show the RSP game has the following properties. From here on we denote by the mathematical program that defines the characteristic function value of , i.e. .

Proposition 4 (Monotonicity)

The characteristic function of the RSP game is monotone, that is, .

Proof by contradiction. Suppose there exists and . Let be an optimal solution to . Let .

For , we construct a feasible solution to in the following manner. Let

Let be the solution constructed in the above way. Denote by the set of selected routes. Intuitively, we keep those routes in that covers at least one player in and discard those don’t.

It is known that must satisfy

Because , then must satisfy

This is equivalent to

So is a feasible solution to . In addition, since the cost matrix is positive, the route cost is also positive. Therefore the cost of is less than , which is less than . Note that is the optimal cost, so this is a contradiction.

Proposition 5 (Subadditivity)

The characteristic cost function of RSP game is subadditive, i.e., .

Let , be the optimal solution to , , respectively. Because and , must cover all the players in , i.e. is a feasible solution to . Since this solution has an objective value equal to , we have .