Spatiotemporal Characteristics and Self-Organization of Urban Taxi Dispatch

This paper proposes a matching degree to study dynamic spatiotemporal characteristics of urban taxi and offers a novel understanding of self-organization taxi dispatch in hotspots on top of the Fermi learning model. The proposed matching degree can not only reflect the overall spatiotemporal characteristics of urban taxi supply and demand but also show that the density of distribution and the distance between the taxis supply and the city center will affect the satisfaction of demand. Besides, it is interesting to note that supply always exceeds demand and they will self-organize into an equilibrium state in hotspots. To understand the phenomenon, we develop the Fermi learning model based on the prospect theory and compared the results with the popular reinforcement learning model. The results demonstrate that both models can account for self-organization behavior under different scenarios. We believe our work is crucial to explore taxis data and our indicator can provide a significant suggestion for urban taxis development.


Introduction
Because of the flexibility and convenience, taxis become one of the most important ways to travel. In Guangzhou, taxis account for 7.7% of the transportation modes, and there are about 1,776,000 taxi trips per day [1].
In order to understand the characteristics and operation of urban taxis, three general measurements of taxis supply and demand indicators-the number of ownership, full-load ratios, and mileage utilization rate-have been widely used [2][3][4]. e number of ownership is an indicator defined from the quantitative point of view. e full-load ratios are to measure the use of taxis in a certain area by sampling. Mileage utilization refers to the ratio of passenger mileage to total mileage during operation time.
ese indicators can only reflect the urban taxis operations in a macroscope.
More works addressing data distribution characteristics of taxi trips have been done. e traveling displacements of urban taxis were found to follow an exponential distribution [5] while the traveling duration and interevent time distributions can be approximated by log-normal distributions [6]. Christoforou et al. find that user's residence area which has high population density is related to longer journey durations and off-peak and nighttime traveling last longer than others [7]. However, those distribution characteristics can only present the static feature.
anks to the development of information technology, a number of companies established taxi services on top of the mobile network, such as Didi, Uber, and Lyft. ere are three advantages using these services. (a) Realizing the information exchange between passengers and taxi drivers, reducing the mutual search cost between passengers and drivers: the drivers do not need roaming around the city vacantly, and the passengers can also enjoy instant services [8]. (b) Saving fuel costs and reducing environmental pollution: information exchange allows drivers to spend less time looking for passengers and saving fuel [9,10]. (c) Relieving the heavy traffic flow: taxi can be allocated reasonably in a limited space according to passenger needs [11,12]. e emerging taxi Global Positioning System (GPS) trip datasets of origin and destination of passengers and drivers provide the opportunity to extract spatiotemporal characteristics for a particular region [13]. e indicators and researches mentioned above are all static. ey cannot reflect the dynamic characteristics of taxis supply and demand, especially after the intelligent dynamically dispatching systems by these taxis platforms.
us, we need a dynamic indicator based on origin and destination GPS data to measure the characteristics of taxis supply and demand in the urban area. erefore, we proposed a matching degree using bipartite networks [14,15] based dynamic allocation model to measure the characteristics of taxis supply and demand in the urban area. Based on the Hungarian method [16][17][18], we established the best match between taxis supply and demand under the conditions of meeting the minimum cost. at is to say, the matching degree is constructed on the assumption of the passengers waiting for the least time because taxis move more quickly and are more flexible than passengers. We then explore the spatiotemporal characteristics of supply and demand through data.
One of the main approaches to address both characteristics and taxi dispatch problems is agent-based modelling, where passengers and drivers are modeled as autonomous agents that are able to interact in a dynamic environment. A multiple trip negotiation model is introduced in [19], where flexible activity scheduling is considered between a small group of agents. Flexible trip departure times are also studied in theory and experiment [20,21]. e multiagent model is also introduced in taxi-sharing [22], considering drivers' multiple preferences and taxi dispatch [23] with reduction in customer waiting and empty taxi cruising times. Although some different aspects of taxi multiagent dispatching are studied in these approaches, none of them consider dynamic characteristics and multiple, often-conflicting interest for passenger and driver agents.
We propose a new multiagent model that models both passengers and drivers as autonomous agents and conduct multiagents simulations on top of reinforcement learning model [21,24,25] and prospect theory [26][27][28][29][30] based Fermi learning model [21,31]. e remainder of this paper is organized as follows. In Section 2, we first review the basic knowledge of our bipartite networks based dynamic allocation model, such as the bipartite networks and Hungarian method. en, we improved the method to be better applied to our model and proposed matching degree. In Section 3, we analyze the spatiotemporal characteristics through actual data from four cities. In Section 4, by the analysis of data, we find that taxi demand and supply in hotspots will form a balanced system just like a kind of double-role-like EI Farol Bar game. To better explain the phenomenon, we propose a multiagent model which models both passengers and drivers as autonomous agents and conducts simulations based on reinforcement learning model and a novel Fermi learning model. In the last section, we present our conclusion and discussion. Table 1 shows the commonly used taxi operation indicators: the possession quantity of taxis per ten thousand persons c and mileage utilization rate ϕ. Beijing is the capital of China with a large population. Shanghai and Guangzhou are modern cities. Xi'an is an old city in central China. ey are lying in the north, east, south, and central part of China, respectively.

Establish the Matching Degree
us, we choose these four cities as representative examples in our paper.
According to the data, the possession quantity of taxis in Beijing and Shanghai are higher than those in Xi'an and Guangzhou while the mileage utilization rates are the opposite. ese traditional indicators give a big picture of urban taxi operation status in the four cities in China. However, if people want to know the satisfaction of urban taxi demand spatially and temporally, a more specific indicator is needed. us, in this section, we will utilize the classical binary matching method-Hungarian algorithm to build the matching model. e obtained optimal matching degree can be seen as an indicator to measure spatiotemporal characteristics of urban taxi supply and demand.
In this section, the methods to acquire a matching degree will be elaborated. Since the time window of the data that we are going to use is hourly, it was decided that the best method to adopt for this investigation was to transform continuous matching into discretely distributed matching. e best match between the taxi distribution points and the demand points is solved under the condition that the cost of passengers allocated to taxis is minimized; that is, the waiting time of passengers is minimum. Next, we will first introduce the theoretical background of the model: bipartite matching and Hungarian method. And then, the algorithm steps of matching degree will be given.

Bipartite
Matching. When modelling relations between two different classes of objects, bipartite networks usually arise naturally. It is widely used in social network analysis [32][33][34], optimization problem [14,15], and recommender systems [35][36][37]. Let G � (V, E) be an undirected graph. If the vertex set V can be divided into two mutually disjoint subsets S, T, graph G is a bipartite graph. e bipartite graph can also be recorded as G � (S, T; E). We propose a complete bipartite graph G � (S, T; E) with passenger nodes S and taxi nodes T, and each edge has a nonnegative cost c(i, j). We want to find a perfect matching with a minimum total cost. A simple bipartite matching is shown in Figure 1.

Hungarian Method.
e Hungarian method is a combinatorial optimization algorithm based on bipartite matching to solve the assignment problem [16,17]. According to Berge's lemma [18], a matching is maximum if and only if it does not have any augmenting path.
A maximum matching is a matching that contains as many edges as possible [38]. A perfect matching (complete matching) is a matching which matches all nodes of the graph. A perfect matching can only occur when the graph has an even number of nodes [39]. Since our goal is to measure whether passengers' needs are met, the perfect matching in our paper describes a matching satisfying all passengers' requirements, that is, maximum matching.
In general, we set a matching matrix M. In each step, we find an augmenting path P to get a bigger match M ′ than M.
Augmenting path P is a path in graph G that connects two unmatched vertices V, E. If the matched and unmatched edges alternate on P, then P is an augmenting path relative to M. e process is done if we cannot find a new augmenting path. e detailed algorithm of the Hungarian method is shown in Figure 2.

Matching Degree.
Since the demand and supply of taxis in each place are changing over time, the adjacency matrix of the bipartite network is also changing correspondingly. To solve this problem, we use the idea of discretization to simplify this complex problem. In our model, we deal with this continuity problem step by step. We can consider that there is only one person at each demand point, and each taxi supply point only supplies one taxi every time. We repeat the process until there is no passenger at the demand point. e bipartite networks based dynamic allocation process consists of four steps: Step 1: establish the adjacency matrix M: the element m ij in the adjacency matrix is the spatial distance between passenger i and taxi j based on latitude and longitude, that is, the matching cost.
Step 2: discretize the continuity problem: we assume that in each time window, only one passenger in each demand point participates in the matching. In each matching process, we use the Hungarian method to establish an optimal match. e matching process is just like the simple example in Figure 1. e goal is to match all passengers with a minimal matching cost. After each round of matching, all demand points should be reduced by one passenger. If supply points meet the matching, one taxi should also be reduced.
Step 3: in a point, when all the passengers or taxis are matched, the cost of matching will be set to infinity, M(i, j) � ∞ + , which means this point is no longer involved in the next matching.
Step 4: the above steps are performed continuously. When all the passengers have been matched, the match process is ended. In this case, the remaining number of the taxis at each taxi supply point R j can be obtained.
us, the matching degree of each taxi supply point can be calculated by ((T j − R j )/T j ), where T j is the initial number of taxis.

Spatiotemporal Characteristics
According to the algorithm steps of matching degree in the previous section, we will then substitute the datasets of four cities and use matching degree to explore spatiotemporal characteristics of urban taxis. e dataset is from Cangqiong Intelligent Travel Platform, which includes the location of the supply points of taxis and the location of the passengers in need at each moment. Figure 3 shows the spatial distribution of taxi demand and supply at 8 a.m. in Beijing, Shanghai, Xi'an, and Guangzhou, respectively. An important finding is that the taxis supply is always higher than demand but taxis usually gather around hotspots. We then study the temporal characters of taxi demand and supply. Figure 4 shows the average matching degree of Shanghai, Beijing, Xi'an, and Guangzhou. On the whole, the four cities have three peak travel times, mainly around 8 a.m., 6 p.m., and 9 p.m., which is in line with reality.
When looking at the results of the four cities separately, we can find that the average matching degree of Beijing is the Although node 4 has already matched node 1, it can be replaced by node 6 at the same cost. erefore, let node 1 match node 6 instead and node 2 matching node 4 can give a minimum cost. So, the matching degree becomes 2. (d) Finally, let node 3 match the node 5. In this example, the maximum matching degree is 3 at minimum cost.
highest, followed by Shanghai. ese two cities are two of the most developed cities in China. In addition, we find that even in Beijing, during the peak hours of commuting, the average matching degree is still less than 40%. We suspect that the urban taxi matching degree is related to taxi distribution density and urban spatial structure. As shown in Figure 5, in Beijing, Shanghai, and Xi'an, when the taxi density in the unit space becomes too large, the matching degree will be reduced. However, Guangzhou is the opposite. According to the number of ownership (Table 1), we think the overall taxi supply in Guangzhou is insufficient. In Beijing and Shanghai, the number of ownership per 10 4 persons is more than 20; thus, they have relatively sufficient supply. Next, we study the relationship between taxis supply density and matching degree. We find that the spatial distribution of taxi has a great influence on the matching degree, which reflects the importance of information exchange between passengers and taxi drivers.
Specific to each city, we analyze the impact of spatial distribution on the matching of taxi supply and demand. As shown in Figure 6, for Beijing, the area with the highest taxi utilization rate is about 15-20 km and 32 km away from the city center (Tiananmen Square). is result can be easily explained by the specific situation in Beijing. e existing urban area of Beijing is built on the old city; thus most of its commercial areas are about 10-20 kilometers away from the center of the city. So there will be a large matching degree in this distance range. With the expansion of urban areas, such as the Beijing Fourth Ring Road and the Fifth Ring Road, the development is also relatively rapid, which leads to the emergence of the second matching peak in the map. For the more emerging city Shanghai, it is quite different from Beijing. e largest matching area is mostly within 18 km from the city center. erefore, the influence of the urban structure on the matching degree of supply and demand for taxis is also remarkable. Rationally dispatching taxis according to urban space layouts can make the allocation of taxi resources much reasonable.

Establish a cost adjacency matrix
Update the coefficient matrix.
Each column or row of the coefficient matrix subtracts the minimum value of the column or row, ensuring that each row and column has at least one zero.
All zeros in the matrix must be covered by marking as few rows and/or columns as possible.

No
In the row where the zero is located, find zeros that uncovered and mark as Z.
Look for zero in the column where Z is located.

Yes
Cover the row and uncover the column where the zero is located

e Demand and Supply of Taxis in Hotspots.
rough Figure 3, we find that passenger demand is scattered, while the supply of taxis is denser in certain areas, hereinafter as hotspots. Taking Beijing as an example, we calculate the demand and supply around Beijing Railway Station (116.433547, 39.909462) and Beijing South Railway Station (116.385488, 39.87128). As shown in Figure 7, the blue line indicates the demand for taxis, and the orange line indicates the number of taxis that can be provided around the areas. We find that in hotspots, supply always exceeds demand.
is phenomenon is easy to understand. In hotspots, such as office buildings, tourist attractions, and stations, there will be a relatively stable demand. Taxi drivers do not need to search passengers if they wait around hotspots. In this way, the driver can reduce the fuel and time cost of empty cruising. However, if too many taxis crowed into popular areas, drivers may not receive orders due to oversupply.
is problem is similar to the El Farol Bar Problem proposed by Arthur in 1994 [40,41]. e game is that, every weekend, a group of people, such as n � 100 persons, have to decide whether to go to a bar or stay at home. e bar's capacity is limited, assuming 60 persons. If someone predicts that more than 60 persons will go to the bar, would   Complexity time, the number of people who went to the bar tends to be 60. e participants will self-organize into a balanced system.
However, unlike the El Farol Bar game, there are two roles in our problem. We need to consider not only the number of drivers but also the number of passengers. In a hotspot, passengers can choose to take a taxi, which is more comfortable and faster than other public transportation. However, if too many people take taxies at the same time, there will be a supply shortage and it will take more time for passengers to wait for vehicle dispatch. For this double-rolelike bar game scenario, will it also form a stable equilibrium system? Based on the data shown in Figure 7, we think that demand and supply of taxis in hotspots will also form such an equilibrium state. Below, we construct a dynamic game model and verify this conjecture through a multiagent simulation.

Demand and Supply Dynamics Model.
We assume that the system consists of two types of agents: passengers, who can choose transportation method, taxi, or other public transportations and taxi drivers, who can decide to wait around the hotspot or cruise for searching potential passengers. e expected returns for these two types of agents are affected by the number of demand and supply of the same system.
If there are N p passengers choosing to take taxis and N d taxis are waiting around the hotspot, their payoffs are given by where p denotes the average income per kilometre, l denotes the average operating mileage, ρ denotes the starting price, c d denotes the cost of searching time for drivers, c p denotes the cost of waiting time for passengers, and U denotes the degree of comfort by taxis, compared with other transportation. When the demand is greater than supply, the passengers have to wait for taxis, the waiting time cost is c p (N p /N d ), and the drivers can save the searching time To make it easier, we assume c p � c d � c in the following simulation. However, the passengers who worry that there are lots of people waiting for taxis and choose to take the bus or subway will have fixed income P 0 . Also, the taxi drivers who choose to supply the service out of hotspots have fixed income D 0 .
In order to get a deeper insight, we have conducted multiagents simulations based on two popular models: the reinforcement learning model and the Fermi learning model.

4.2.1.
e Reinforcement Learning Model. Reinforcement learning has been widely used to develop decision behavior models [21,24,25]. In reinforcement learning, the benefits of a strategy selected in the previous round will be used to reinforce the tendency to choose that strategy, and the tendency to choose a different strategy will be converted into the probability of that strategy.
We firstly examined the ability of the reinforcement learning model to simulate the multiagents system. Simulation processes of the model are shown as follows.
(1) Initial propensity: we assume that all agents have the same initial propensity, which is set equal to the fixed income 50. (2) Update propensity: suppose an individual (passenger or driver) has chosen action a ∈ i, −i { } in round t, the propensities in round t + 1 are updated by where q a s (t + 1) is the propensity to choose action a in the next round t + 1; π s (t) is the payoff corresponding to the action in round t; and θ is the learning rate.
(3) Update probability: the probability of choosing action i in round t + 1 is determined by where c > 0 is a parameter that determines reinforcement sensitivity. In our simulations with the reinforcement learning model, we set c � 0.5, θ � 0.1, 0.2. e results are shown in Figure 8.

e Fermi Learning Model.
We then propose a new Fermi learning model based on the prospect theory and Fermi rule.
Prospect theory: prospect theory is an economics theory developed by Tversky and Kahneman, which proposes an asymmetric form of risk aversion [26,27]. According to the prospect theory, people make decisions based on the potential gains or losses relative to the reference point rather than in absolute terms [28]. e value function of prospect theory that passes through the reference point is s-shaped and asymmetrical. Faced with a risky choice leading to gains, individuals are riskaverse; while faced with a risky choice leading to losses, individuals are risk-seeking [29,30]. Fermi rule: Fermi rule originated from condensed matter physics and is widely used in decision modelling in evolutionary games [21,31]. Compared with the general reinforcement learning model, the number of adjustable parameters using Fermi rule is reduced by one. As far as we know, the Fermi rule combined with the prospect theory has not been employed to model individual choice behaviors in self-organization systems. erefore, the Fermi learning model is based on the Fermi rule and prospect theory to offer a simpler characterization of individual choice behavior for the systems.
In our Fermi learning model, passengers and drivers use the expected return as a reference point to measure gains or losses. at is, for passengers, they will use the fixed income D 0 of other transportation as a reference point. When π d > D 0 , the passengers consider gains; when π d < D 0 , the passengers consider incurring loss. e same goes for taxi drivers. Let x d and x p denote the gains or losses of the passengers and drivers' expected decision, respectively. When the passengers choose to take taxis and drivers choose to serve in the hotspot area, x d � π d − D 0 , x p � π p − P 0 . Agents in the system will update the probability of taking a taxi (passengers) or waiting around the hotspot (drivers) based on the potential gains or losses according to their historical experience: where λ � n + m denotes the memory length and r > 0 denotes intensity of selection [31]. In our simulations with the Fermi learning model, we set r � 0.1. Here, n i�1 x − s is the sum of historical losses and m j�1 x + s is the sum of historical gains. e results are shown in Figure 9. Figures 8 and 9 show the simulation results of the reinforcement learning model and Fermi learning model at different parameter settings. We set the initial number of passengers and taxi drivers as 1000 and 3000, respectively. We hypothesize that the average income per kilometre p � 3 and the average operating mileage l � 10, starting price ρ � 13, and the fixed income P 0 � D 0 � 50. ese results demonstrate that both models can account for self-organization behavior under different scenarios. 8 Complexity

Complexity
Furthermore, we set different memory lengths λ in the Fermi learning model. Figure 9 also shows the memory length will slightly inhibit the amount of supply and demand. However, the demand and supply in hotspots tend to be stable after a period of time. ese results support that demand and supply of taxis in hotspots will self-organize into a balanced system over a period of time.

Conclusion and Discussion
e research of urban transport is a complex system involving multidomain and multidisciplinary. With the development of the Internet and technology, taxi operation data are more detailed and specific. erefore, we can better explore these data to provide useful suggestions for urban development. Traditional operation indicators of urban taxis pay more attention to the overall situation of taxi supply and operation. If urban planners want a more detailed description, especially spatiotemporal characteristics of urban taxis, the matching degree provides a novel perspective.
In this work, we study the dynamic spatiotemporal characteristics of the urban taxis. We propose the matching degree through bipartite networks based dynamic allocation model to measure supply and demand. e peak travel time shown in our results keeps in touch with reality. We find that matching degree can be influenced by taxi supply density and location. Rationally dispatching taxis according to urban space layouts can allocate the taxi resources much more reasonable. According to the analysis of data, taxi supply is always more than demand but taxis usually gather around hotspots. It is interesting to note that the demand and supply of taxis in hotspots tend to be stable after a while. en, we establish a dynamic game model, which is a kind of doublerole-like bar game, and simulate the multiagents system using two learning models, reinforcement learning and prospect theory based Fermi learning. e results of the two learning models both show that the amount of demand and supply in hotspot will self-organize into a balanced system finally.
Regardless of this, there is still some room for improvement. Firstly, our matching degree will be more optimistic than the actual situation because we ignore the fact that drivers will selectively accept orders in real life. Secondly, in our multiagents simulation, maybe we can consider diversity in individual behaviors to offer a better characterization of collective behaviors.

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

Conflicts of Interest
e authors declare no conflicts of interest.