We explore issues of dynamic supply and demand in ride sharing services such as Lyft and Uber, where demand fluctuates over time and geographic location. We seek to maximize social welfare which depends on taxicab locations, passenger locations, passenger valuations for service, and the distances between taxicabs and passengers. Our only means of control is to set surge prices, then taxicabs and passengers maximize their utilities subject to these prices.
We study two related models: a continuous passenger-taxicab setting, similar to the Wardrop model, and a discrete (atomic) passenger-taxicab setting. In the continuous setting, every location is occupied by a set of infinitesimal strategic taxicabs and a set of infinitesimal non-strategic passengers. In the discrete setting every location is occupied by a set of strategic agents, taxicabs and passengers, passengers have differing values for service.
We expand the continuous model to a time-dependent setting and study the corresponding online environment.
The utility for a strategic taxicab that drives from to and picks up a passenger at is the surge price at minus the distance from to . The utility for a strategic passenger at that gets service is the value of the service to the passenger minus the surge price at .
Surge prices are in passenger-taxicab equilibrium if there exists a min cost flow that moves taxicabs about such that (a) every taxicab follows a best response, (b) all strategic passengers at with value above the surge price for , are served and (c) no strategic passengers with value below are served (non-strategic infinitesimal passengers are always served).
This paper computes surge prices such that resulting passenger-taxicab equilibrium maximizes social welfare, and the computation of such surge prices is in poly time. Moreover, it is a dominant strategy for passengers to reveal their true values.
We seek to maximize social welfare in the online environment, and derive tight competitive ratio bounds to this end. Our online algorithms make use of the surge prices computed over time and geographic location, inducing successive passenger-taxicab equilibria.
In the sharing economy111Also known as the “gig” economy. individual self-interested suppliers compete for customers. According to PWC, the sharing economy is projected to exceed billion USD within 8 years. Lyft and Uber are prime examples of such systems. According to [16, 11] it is the users who gain the majority of the surplus from such systems, and significantly so. Contrawise, many studies suggest negative societal issues in the sharing economy (e.g., see [20, 12, 21, 3]).
Unlike salaried employees of livery firms, drivers for Uber (and other “gig” suppliers) are free to decide when they are working and what calls/employment to accept. E.g., drivers can refuse to accept a call if it is too far away. To increase supply (and reduce demand) Uber introduced “surge pricing” which is a multiplier on the base price when demand outstrips supply. The surge price can be different at different locations.
In the past pricing schemes resulted in what was theorized to be negative work elasticity . In their work it is suggested that drivers impose upon themselves “income targets”. This means that drivers will work until they reach their target income for the day causing them to extend their hours in times of low payouts. Recent studies suggest that this is false, surging prices in times of peak demand seems to conjure positive work elasticity , allowing supply and demand to balance more efficiently.
1.1 Network Model, Surge Pricing, Utility, and Passenger-Taxicab Equilibria
Our goal is to maximize social welfare, defined as the sum of valuations of the users serviced by taxicabs, minus the cost associated with providing such service. We do so by setting surge prices (one per location), and let the system reach equilibrium. Our surge pricing schemes have several additional features such as envy freeness.
We consider two related settings:
A continuous setting where supply and demand consist of infinitesimal quanta, supply and demand are modeled as fractional quantities at locations. This is analogous to the non-atomic traffic model used in Wardrop equilibria .
Here we assume that the taxicabs are strategic and respond to changing surge prices whereas passengers are non-strategic so that demand is insensitive to price (alternately, one may view these passengers as having high value for service).
The cost for a taxicab at location to serve a customer at location is the distance from to .
Our goal here is to set a surge price at every location so as to incentivize taxicabs to act in a way that maximizes social welfare, i.e., all possible demand is serviced while the sum of distances traversed is minimized.
A discrete setting where both taxicabs and passengers are strategic, and every taxicab and passenger is associated with some location.
In this setting both demand and supply may change as a function of the surge price. Every passenger has a value for service and every taxicab has a cost for service at a given location, e.g., the distance to the location.
Our goal here is to maximize social welfare (the sum of the values for the served customers minus the sum of costs of the taxicabs to do so).
At every location , we set a surge price , that incentivizes taxicabs to serve passengers in a manner that maximizes social welfare.
Moreover, maximizing social welfare is not only in equilibrium but also envy free.
Every passenger at whose value is strictly greater than is served, and no passenger at with value strictly less than is served.
We define the utility for a taxicab at to serve a passenger at as the surge price at , , minus the distance from to . A passenger at with value has utility to be served by a taxicab, and utility zero if she takes no taxicab. Clearly, a passenger at with will refuse to take a taxicab.
We introduce the notion of a passenger-taxicab equilibria, for both continuous and discrete settings. A flow is a mapping from the current supply to some new supply. A flow has an associated cost which is the sum over edges of the flow along the edge times the length of the edge. A flow is said to be a min cost flow that maps the current supply to the new supply if it achieves the minimal cost for moving the current supply to the new supply (this cost is also called the min earthmover cost).
A passenger-taxicab equilibria consists of a vector of surge prices, where is the surge price at location , current supply , new supply and demand , such that, for any min cost flow from to , every taxicab and every passenger maximize their utility. I.e., no taxicab can improve its utility by doing anything other than following the flow, every passenger at who has value greater than is in and is served. Every passenger at who has value less than is not served.
The surge prices are poly time computable. In the continuous setting this is polynomial in the number of locations, in the discrete setting this is polynomial in the number of passengers and taxicabs.
1.2 Maximizing Social Welfare in an Online Setting via Surge Pricing
We consider an online setting based on the continuous setting, where the time progresses in discrete time steps. In each time step the following occurs: First, a new demand allocation appears. Second, the online algorithm determines a new supply. Given an allocation of supply and demand, the demand served at a location is the minimum between the supply and demand at the location. The social welfare is the difference between the total demand served and the total movement cost, summed over all locations and time steps. The main new crux of our model is that the online algorithm (principal) can not impose a new supply allocation, but is limited to setting surge prices. If flow is a flow equilibrium arising from these surge prices — strategic suppliers follow flow . Our results on surge prices for flow equilibria imply that the online algorithm has flexibility in selecting the desired supply.
Trivially, for any metric, a simple algorithm that randomizes the start setting and doesn’t move achieves a competitive ratio, where is the number of locations. However, If the costs of moving from any location to any other location is 1, we give an optimal competitive ratio of . If the demand sequence has the property that at any time and location the demand does not exceed (), then we show a tight competitive ratio bound of . For more general metric spaces we show mainly negative results. Specifically, if all the distances are we show that the competitive ratio is no better than , which implies an optimal competitive ratio of for .
Another extension we consider is when the average difference between successive demand vectors is bounded by (in total variation distance). In this case we show that simply matching supply to the current demand gives a competitive ratio of and show that the competitive ratio can not be better than (in the case that all the distances are ).
1.3 Related Work
It has been observed in taxicab services that a mismatch between supply and demand, along with first-in-first-out scheduling of service calls, without restricting the “call radius”, results in reduced efficiency and even market failure [1, 26]. This happens because taxicabs are dispatched to pick up customers at great distance because no closer taxicab is currently available, more time is wasted traveling to pick up clients, and the system performance degrades. Recent papers [9, 7] study how changing surge prices over time allow one to avoid such issues. These papers do not consider the issue of having geographically varying surge prices.
Assuming a stochastic passenger arrival rate,  uses a queue theoretic approach to model driver incentives in the system. The paper considers a simplistic dynamic pricing scheme, where there are two different pricing schemes for each node depending on the amount of drivers at said node. This model is compared to a simple flat rate. Drivers are assumed to calculate their incentives over several rides. The paper concludes that the dynamic pricing scheme can only achieve the welfare of the flat rate. However, the dynamic pricing scheme allows for the manager to have more room for error in calculating what the optimal rates are.
A central problem in handling a centralized taxi system involves routing empty cars between regions . Within the centralized mechanism,  shows that, assuming stochastic arrival of passengers, an optimal static strategy (i.e.
, one that does not change it’s routing policy based on current shortages) can be calculated by solving a linear programming problem.
Recently, and independently, a similar problem was studied in . In their model, selfish taxicabs seek to maximize revenue over time. There is no explicit cost for travel, one loses opportunities by taking long drives. They derive prices in equilibria that maximize the sum of passenger valuations, but ignore travel costs. In contrast, we ignore the time dimension and focus on the passenger valuations and travel costs.
Competitive analysis of online algorithms [23, 22, 15] considers a worst case sequence of online events with respect to the ratio between the performance of an online algorithm and the optimal performance. In a centralized setting, task systems, , can be used to model a wide variety of online problems. Events are arbitrary vectors of costs associated with different states of the system, and an online algorithm may decide to switch states (at some additional cost). A strategic version of this problem, for a single agent, was considered in  where a deterministic incentive compatible mechanism was given. The competitive ratio for incentive compatible task system mechanisms is where is the number of states. We cannot use the incentive compatible task system mechanisms from  for two reasons: (1) in our setting there are a large number of strategic agents (many Uber drivers) split amongst a variety of different [task system] states (locations) rather than one such agent in a single state, and (2) the suppliers have both profits (payments) and loss (relocation).
Competitive analysis of the famous -server problem  has largely driven the field of online algorithms. A variant of the -server problem is known as the -taxicab problem [13, 25]. Although the problem we consider herein and the -taxicab problem both seek efficient online algorithms, and despite the name, the nature of the -taxicab problem is quite different from the problem considered in this paper. In the -taxicab problem a single request occurs at discrete time steps and a centralized control routes taxicabs to pick up passengers, seeking to minimize the distances traversed by taxis while empty of passengers. Taxicabs are not selfish suppliers, and all requests must be satisfied. This is quite different from our setting where both demand and supply are spread about geographically, there are many strategic suppliers, and not all demand must be served.
2 Model and Notation
2.1 The Continuous Passenger-Taxicab Setting
We model the network as a finite metric space , where is the distance between vertices . I.e., is the cost to a taxicab to switch between vertices and . Infinitesimally small taxicabs reside in the vertices .
Demand and supply are vectors in that sum to one. Given demand and current supply , we incentivize strategic taxicabs so that current supply becomes new supply which services the demand .
If the demand in vertex is , and the new supply in vertex is , then the minimum of the two is the actual demand served (in vertex ). Note that if the two are not identical then there are either unhappy passengers (without service) or unhappy taxicabs (with no passengers to service). Formally,
we define the demand served, as follows:
The demand served in vertex , , is the minimum of and , i.e., .
Given a demand vector and a supply vector , the total demand served is .
Switching supply from to is implemented via a flow . A flow from to is a function that has the following properties:
For all , .
For all , .
For all , .
We define the earthmover distance between supply vectors,
The cost of flow is . The earthmover distance from supply vector to supply vector is
In order to incentivize our strategic taxicabs to move to a new supply vector, we use surge pricing in vertices.
Surge pricing is a vector, , where is the payment to a taxicab that serves demand in vertex .
We define the utility for an infinitesimal taxicab, given surge pricing , as follows.
Given supply , new supply , surge prices , demand , and a min cost flow from to , the utility for a taxicab that switches from vertex to vertex is
To motivate the above definition of utility , of switching from to , consider the following:
The probability of serving a passenger in vertexis . This follows since:
If passengers outnumber taxicabs in vertex then any such taxicab will surely serve a passenger.
Alternately, if taxicabs outnumber passengers in vertex then the choice of which taxicabs serve passengers is a random subset of the taxicabs.
The profit from serving a passenger in vertex is equal to the surge price for that vertex, .
The cost of serving a passenger in vertex , given that the taxicab was previously in vertex , is .
Finally, we define the notion of a passenger-taxicab equilibrium, where no infinitesimal taxicab can benefit from deviations.
Given a demand vector , current supply vectors , and new supply , we say that a surge pricing is in passenger-taxicab equilibrium, if for every min cost flow from to , for every such that we have that
I.e., every infinitesimal taxicab is choosing a best response. Such a passenger-taxicab equilibrium is said to induce supply .
Our goal in the continuous setting is to set surge prices so that the new supply is a passenger-taxicab equilibrium.
In this continuous setting we take demand to be insensitive to the surge prices. In the next section we describe the discrete setting where both the demand and the supply are sensitive to the prices. One could define a continuous passenger-taxicab setting where every location has an associated density function for passenger valuations. Then, we could convert this continuous setting to an instance of the discrete passenger-taxicab setting with taxicabs/passengers. Under appropriate conditions, this will give a good approximation to a continuous passenger-taxicab setting where both demand and supply are sensitive to surge pricing.
2.2 The Discrete Passenger-Taxicab Setting
As above, we model the network as a finite metric space , and the cost to a taxicab to switch between vertices and is the distance between them, . Unlike the continuous case, there is an integral number of taxicabs and passengers at every vertex.
Let be a set of passengers and be a set of taxicabs. Every passenger has a value for service. A supply is a vector where for all , , and for all , .
A profile is a partition of the passengers , where for each the set is the set of passengers at . A demand is a function of a vertex and a surge price at the vertex. We define the function as follows:
Ergo, is the set of passengers at vertex that are interested in service given that the price is , i.e., those passengers whose value is at least . Note that .
For ease of notation, we denote a collection of entities for each vertex , by . For example, , , and .
Define a flow from supply to supply as follows. The flow has the following properties:
For all , .
For all , .
For all , .
The flow from a vertex is equal to the number of taxicabs at under supply , i.e., . The flow into a vertex is equal to the number of taxicabs at under supply , i.e., . The cost of a flow in the discrete setting is the same as the cost of a flow in the continuous setting (Definition 2.2), i.e., .
We now define the demand served at a vertex ,
For a vertex , given a supply , a surge price , and a demand , we define the demand served, , as follows:
If then .
If then is the set of the highest valued passengers from , breaking ties arbitrarily.
Given demand functions , surge prices , and new supply , the total demand served and its value is given by
The social welfare is the difference between the sum of the values of the passengers served and the cost of the min cost flow, which is the sum of the distances traveled by the taxis. Namely, for current supply , new supply , demand functions , and surge prices , the social welfare is
Remark: we did not define social welfare in the continuous passenger-taxicab setting where the passengers are price insensitive. However, one can view the social welfare in the price-insensitive demand setting as a special case of the responsive demand setting when all passenger valuations are very high.
Like the definitions for utility and passenger-taxicab equilibria in the continuous case, one can define them for the discrete case: The utility of a taxicab moving from to , given new supply , surge prices and demand functions , is
Given demand , current supply and new supply , surge prices are said to be in passenger-taxicab equilibrium if for every min cost flow from to and for any such that we have that
Taxicabs are choosing a best response: .
All passengers with are served. No passengers with are served.
2.3 Online Setting
In the online setting we inherit the continuous model setting, adding a function of time. Time progresses in discrete time steps . At time the demand vector associates each vertex with some demand , and we assume that the total demand . One should not think of a time step as being instantaneous, but rather as a period of time during which the demands remain steady.
Every time step also has an associated supply vector , where and for all . The supply at time is a “reshuffle” of the supply at time , by having infintestimally small suppliers moving about the network. In our model, the time required for suppliers to adjust supply from to is small relative to the period of time during which demand is valid.
If the demand in vertex at time is , and the supply in vertex at time is , then the minimum of the two is the actual demand served (in vertex at time ). Note that if the two are not identical then there are either unhappy customers (without service) or unhappy suppliers (with no customer to service). Formally, we define the benefit derived during each time period, the demand served, as in the continuous model.
We define the social welfare as follows:
Given a demand sequence and a supply sequence we define the social welfare
An online algorithm for social welfare follows the following structure. At time :
A new demand vector appears.
The online algorithm determines what the supply vector should be. (Indirectly, by computing and posting surge prices so that the resulting passenger-taxicab-equilibrium induces supply ).
The goal of the online algorithm is to maximize the social welfare as given in Definition 2.9: Compute a supply sequence , so as to maximize . The supply vector is a function of the demand vectors but not of any demand vector , for . Implicitly, we assume that the passenger-taxicab equilibrium is attained quickly relative to the rate at which demand changes.
The competitive ratio of such an online algorithm, Alg, is the worst case ratio between the numerator: the social welfare resulting from the demand sequence and the online supply , and the denominator: the optimal social welfare for the same demand sequence, i.e.,
3 The Continuous Passenger-Taxicab Setting
In this section we deal with the continuous passenger-taxicab setting. Given current supply , demand and new supply , we show how to set surge prices such that they are in passenger-taxicab equilibria. Moreover, for these , , and , the only possible which results in a passenger-taxicab equilibria is . (Similar techniques give surge prices that induce [almost] arbitrary supply vectors, , see below).
Proof overview: Given some min cost flow from supply to demand , we construct a unit demand market, with bidders and items. For every such that we construct a bidder and an item. We also define bidder valuations for all items. This unit demand market has Walrasian clearing prices that maximize social welfare (Lemma 3.2). We show how we can convert the Walrasian prices on items to surge pricing (Lemma 3.4).
We then show and that the resulting surge pricing has a passenger-taxicab equilibrium which induces supply equals demand (Lemma 3.5) and it is the case with all all passenger-taxicab equilibria (Lemma 3.7). Lemma 3.6 shows that the incentive requirements in Equation (1) also hold for any min cost flow , from to . This proves Theorem 3.8.
Given a minimum cost flow , we define a unit demand market setting as follows:
Items , and unit demand bidders , both of which are indexed by pairs of vertices, where
We set the value of item to bidder to be,
The utilities of bidders are unit demand and quasi-linear, i.e., the utility of bidder for item set and price is
Given a flow , bidders and items we define the following weighted bipartite graph , where between bidder and item there is an edge of weight .
Given a flow , a matching between bidders and items is a function , where bidder is matched to item or unmatched (if ), such that no two bidders are matched to the same item .
As there is an edge between every bidder and every item with weight , the maximum weight matching is a perfect matching between bidders and items and the mapping never assigns to a bidder.
The matching where , maximizes social welfare. In addition, there exist Walrasian prices for which is a competitive market equilibrium.
The proof is via contradiction. Assume there exists some matching with strictly greater social welfare than the matching . For a bidder , define , iff for some , and , iff for some . Note that so for a given and we have if and zero otherwise.
Choose to be the minimum non-zero flow in , i.e., . We now define a flow , which is a slight perturbation of flow . In flow , the flow from to is:
We first prove that is a valid flow, and later we show that it has a lower cost than , in contradiction to the minimality of .
Flow is a valid flow from supply vector to demand vector .
Consider the requirements that be a valid flow:
For all , : By definition of if then and if then .
For all , : By definition of we have . Thus,
For all , : By definition of we have . Thus,
From the fact that has a higher social welfare we get,
Using the definition of the valuations we have,
This implies that
Using this last inequality, it follows that the cost of (Definition 2.2) satisfies
which contradicts the fact that flow is a minimum cost flow.
Let the Walrasian price of be as guaranteed by the lemma above. We first show that any two prices which correspond to the same vertex must have the same price.
For any two items and we have .
For contradiction assume that . Let be the bidder assigned . Thus, for item bidder has utility which implies that is not in the demand set for bidder . A contradiction to the fact that are Walrasian prices. ∎
For any such that there exist items of the form for some , let denote the Walrasian price for such items (By Lemma 3.4 all those Walrasian prices are identical). If no items of the form exist, this implies that demand at vertex , , and we can set . Define surge prices, , for all .
Given current supply and demand , surge prices , new support , and such that then
Let be such that .Then,
Equations (3),(11) follow from
the definition of the utility in the continuous passenger-taxicab setting, definition 2.4.
Equations (4),(10) follows from considering the passenger-taxicab equilibrium where resulting in for all .
Equations (5),(9) follow from the definition of the surge prices.
Equations (6),(8) follow from the definition of the utility in the market setting.
Equation (7) follows from the market equilibrium.
So, we have that
It remains to consider for such that . In this case the surge price at is zero, so the utility . ∎
The following lemma shows that the incentive requirements of Equation (1) hold, not only for the flow , but also for any min cost flow from to .
Fix current supply and demand , surge prices , and new support . Let be an arbitrary min cost flow from to , then, for any such that we have that
As and are both min cost flows from to we have that .
For contradiction assume there exist some such that and .
Eq. (12) follows from the definition of . Eq. (13) follows from Lemma 3.5. Eq. (14) and (15) follows from the definition of a flow, since for any flow from we have that . Eq. (16) holds since we assumed, for contradiction, that there exist some such that and . Hence, we reached a contradiction to the assumption that is a min cost flow. ∎
If follows from the Lemma above that computing surge prices via flow ensures that taxicab routing using any other min cost flow is also a best response under surge prices .
Next we show that all relevant passenger-taxicab equilibria all have new supply .
Given current supply , demand , and surge prices , all passenger-taxicab equilibria induce .
Let be a min cost flow from to . For contradiction, assume that that there exists some such that are in a passenger-taxicab equilibrium. Let be some min cost flow from to .
Consider (i.e., the set of all vertices for which the flow results in strictly more supply than demand). Since and they both sum to 1, we have that . Let (i.e., the set of all vertices from which supply flows to ). As it follows that .
We claim that there exists some , , such that . For contradiction assume that all the flow in from vertices in is to vertices in . By definition of flows: . We now have,
which is a contradiction.
This implies that there exist , such that . Since there also exists some such that .
We have shown that is in passenger-taxicab equilibrium, this implies that
Since we have we have that resulting in the utility
where implies the last equality. This is in contradiction to the being a passenger-taxicab equilibrium. ∎
Given distances and an arbitrary supply vector, . Let the demand vector be . Then, there exists a surge price vector that results in a passenger-texicab equilibrium which induces a supply . Moreover, any passenger-taxicab equilibrium of induces supply , and the surge prices can be computed in polynomial time.
We can extend the result from equating supply and demand to modifying the supply vector to any supply , with the restriction that if then . The new surge prices are computed as follows. First we compute, as before, the surge prices from to . Then, we set and the resulting surge prices are . In a similar way we can establish,
Let and let be the target supply vector, subject to the restriction that if then . Then there exist surge prices for which some passenger-taxicab equilibrium induces supply .
4 The Discrete Passenger-Taxicab Setting
In this section we consider a more realistic scenario where both demand and supply are sensitive to the surge pricing. All else being equal, higher surge prices mean less demand and more supply.
We define social welfare to be the sum of valuations of passengers served minus the sum of the distances traversed by the taxicabs to serve these passengers (Definition 2.7). Given current supply and a passenger profile , we give an algorithm for computing surge prices that creates a passenger-taxicab equilibrium that maximizes social welfare.
The location of a passenger and taxi is denoted by and respectively (i.e., ). For brevity, we use the notation .
4.1 Maximizing Social Welfare
As in the continuous case, we reduce the problem of computing surge prices to computing market clearing prices in a unit demand market. Given a set of passengers