# Spatiotemporal Characteristics and Self-Organization of Urban Taxi Dispatch

Authors: Wei Zhang; Ying Fan
Journal: Complexity
 (2020)

---

## Abstract

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.


---

## Body

## 1. 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–4]. The number of ownership is an indicator defined from the quantitative point of view. The 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. These indicators can only reflect the urban taxis operations in a macroscope.More works addressing data distribution characteristics of taxi trips have been done. The 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.Thanks 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. There 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]. The 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].The indicators and researches mentioned above are all static. They cannot reflect the dynamic characteristics of taxis supply and demand, especially after the intelligent dynamically dispatching systems by these taxis platforms. Thus, 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.Therefore, 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–18], we established the best match between taxis supply and demand under the conditions of meeting the minimum cost. That 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]. The 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–30] based Fermi learning model [21, 31].The remainder of this paper is organized as follows. In Section2, we first review the basic knowledge of our bipartite networks based dynamic allocation model, such as the bipartite networks and Hungarian method. Then, 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.


## 2. Establish the Matching Degree

Table1 shows the commonly used taxi operation indicators: the possession quantity of taxis per ten thousand persons γ 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. They are lying in the north, east, south, and central part of China, respectively. Thus, we choose these four cities as representative examples in our paper.Table 1
Traditional indicators for measuring taxi operations.
CityN†P†L‡Lp‡γϕBeijing6828421.705898.153783.8231.470.64Shanghai4958624.156084.883926.8820.530.65Xi’an144598.7——16.620.73∗Guangzhou2202213.5——16.310.7∗N denotes the number of taxis. P denotes resident population (106 persons). L denotes operating mileage (106 kilometres). Lp denotes passenger mileage (106 kilometres). γ=N/P denotes the number of ownership (per 104 persons). ϕ=Lp/L denotes mileage utilization rate. Source: †China City Statistical Yearbook, 2016. ‡Ministry of Transport of the People’s Republic of China. ∗Data from news.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. These 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. Thus, in this section, we will utilize the classical binary matching method—Hungarian algorithm to build the matching model. The 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. The 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.


### 2.1. 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–34], optimization problem [14, 15], and recommender systems [35–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. The 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 ci,j. We want to find a perfect matching with a minimum total cost. A simple bipartite matching is shown in Figure 1.Figure 1
A simple example of the Hungarian method. (a) This is a simple bipartite network where the value on each edge is matching cost. Red circles indicate the matched nodes and blue circles indicate the unmatched nodes. (b) Firstly, let node 1 match node 4. Now, the matching degree is 1. (c) Node 2 can only link with node 4. Although node 4 has already matched node 1, it can be replaced by node 6 at the same cost. Therefore, 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.
(a)(b)(c)(d)


### 2.2. Hungarian Method

The 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 matrixM. 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. The process is done if we cannot find a new augmenting path. The detailed algorithm of the Hungarian method is shown in Figure 2.Figure 2
The process of bipartite networks based optimal match.


### 2.3. 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.The bipartite networks based dynamic allocation process consists of four steps:Step 1: establish the adjacency matrixM: the element mij 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. The matching process is just like the simple example in Figure1. The 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,Mi,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 pointRj can be obtained. Thus, the matching degree of each taxi supply point can be calculated by Tj−Rj/Tj, where Tj is the initial number of taxis.


## 2.1. 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–34], optimization problem [14, 15], and recommender systems [35–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. The 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 ci,j. We want to find a perfect matching with a minimum total cost. A simple bipartite matching is shown in Figure 1.Figure 1
A simple example of the Hungarian method. (a) This is a simple bipartite network where the value on each edge is matching cost. Red circles indicate the matched nodes and blue circles indicate the unmatched nodes. (b) Firstly, let node 1 match node 4. Now, the matching degree is 1. (c) Node 2 can only link with node 4. Although node 4 has already matched node 1, it can be replaced by node 6 at the same cost. Therefore, 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.
(a)(b)(c)(d)


## 2.2. Hungarian Method

The 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 matrixM. 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. The process is done if we cannot find a new augmenting path. The detailed algorithm of the Hungarian method is shown in Figure 2.Figure 2
The process of bipartite networks based optimal match.


## 2.3. 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.The bipartite networks based dynamic allocation process consists of four steps:Step 1: establish the adjacency matrixM: the element mij 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. The matching process is just like the simple example in Figure1. The 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,Mi,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 pointRj can be obtained. Thus, the matching degree of each taxi supply point can be calculated by Tj−Rj/Tj, where Tj is the initial number of taxis.


## 3. 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. The 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.Figure3 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.Figure 3
The supply and demand distribution of taxis at 8 a.m.
(a)(b)(c)(d)(e)(f)(g)(h)Figure 4
From top to bottom, the lines represent the average matching degree of Beijing, Shanghai, Xi’an, and Guangzhou in 24 hours of one day. This diagram indicator can measure the degree of matching between passengers and taxis at the current moment.When looking at the results of the four cities separately, we can find that the average matching degree of Beijing is the highest, followed by Shanghai. These 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 Figure5, 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 104 persons is more than 20; thus, they have relatively sufficient supply.Figure 5
The matching degree varies with taxi density. (a–d) Beijing, Shanghai, Xi’an, and Guangzhou, respectively. The blue stars are original average values, and the red curves are trend fitting curves. TheX-axis represents the number of taxis per unit space, and the Y-axis represents the matching degree.
(a)(b)(c)(d)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 Figure6, 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). This result can be easily explained by the specific situation in Beijing. The 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. The largest matching area is mostly within 18 km from the city center. Therefore, 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.Figure 6
The matching degree varies with the distance from the city center. (a) Beijing. (b) Shanghai. The blue dots are the maximum matching degree and the orange stars are average matching degree. TheX-axis represents the distance of taxis supply points from the city center. The Y-axis represents the matching degree of taxi resources.
(a)(b)


## 4. The Demand and Supply of Taxis and Dynamics Model Simulation

### 4.1. The Demand and Supply of Taxis in Hotspots

Through Figure3, 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.Figure 7
The supply and demand relationship around hotspots. The blue line is the demand for taxis, and the orange line is the supply. (a) Beijing railway station. (b) Beijing south railway station.
(a)(b)This 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.This problem is similar to the El Farol Bar Problem proposed by Arthur in 1994 [40, 41]. The 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. The bar’s capacity is limited, assuming 60 persons. If someone predicts that more than 60 persons will go to the bar, would s/he go to the bar or not? Each participant or decision-maker only knows the number of people who went to the bar before. Thus, the strategy can only be summarized based on the information of the previous feedback. This is a typical dynamic game problem. Through computer simulation, we can get an interesting result. After a period of time, the number of people who went to the bar tends to be 60. The 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-role-like bar game scenario, will it also form a stable equilibrium system? Based on the data shown in Figure7, 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.


### 4.2. 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. The expected returns for these two types of agents are affected by the number of demand and supply of the same system.If there areNp passengers choosing to take taxis and Nd taxis are waiting around the hotspot, their payoffs are given by(1)πd=pl+ρ+cdNpNdNpNd,πp=U−pl−cpNpNd,where p denotes the average income per kilometre, l denotes the average operating mileage, ρ denotes the starting price, cd denotes the cost of searching time for drivers, cp 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 cpNp/Nd, and the drivers can save the searching time cdNp/Nd. To make it easier, we assume cp=cd=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 P0. Also, the taxi drivers who choose to supply the service out of hotspots have fixed income D0.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. The 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 actiona∈i,−i in round t, the propensities in round t+1 are updated by(2)qsat+1=θπst+1−θqsat,s∈p,d,whereqsat+1 is the propensity to choose action a in the next round t+1; πst is the payoff corresponding to the action in round t; and θ is the learning rate.(3)
Update probability: the probability of choosing actioni in round t+1 is determined by(3)psit+1=expγqsit+1expγqsit+1+expγqs−it+1,where γ>0 is a parameter that determines reinforcement sensitivity. In our simulations with the reinforcement learning model, we set γ=0.5,θ=0.1,0.2. The results are shown in Figure 8.Figure 8
The reinforcement learning model results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)θ=0.1; (b, d) θ=0.5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


#### 4.2.2. The 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]. The 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 risk-averse; 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. Therefore, 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. That is, for passengers, they will use the fixed incomeD0 of other transportation as a reference point. When πd>D0, the passengers consider gains; when πd<D0, the passengers consider incurring loss. The same goes for taxi drivers. Let xd and xp 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, xd=πd−D0,xp=πp−P0.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:(4)P=11+expr∑i=1nxs−−∑j=1mxs+,s∈p,d,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, ∑i=1nxs− is the sum of historical losses and ∑j=1mxs+ is the sum of historical gains. The results are shown in Figure 9.Figure 9
The Fermi learning results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)λ=1; (b, d) λ=5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


### 4.3. Results

Figures8 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 P0=D0=50. These results demonstrate that both models can account for self-organization behavior under different scenarios.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. These results support that demand and supply of taxis in hotspots will self-organize into a balanced system over a period of time.


## 4.1. The Demand and Supply of Taxis in Hotspots

Through Figure3, 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.Figure 7
The supply and demand relationship around hotspots. The blue line is the demand for taxis, and the orange line is the supply. (a) Beijing railway station. (b) Beijing south railway station.
(a)(b)This 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.This problem is similar to the El Farol Bar Problem proposed by Arthur in 1994 [40, 41]. The 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. The bar’s capacity is limited, assuming 60 persons. If someone predicts that more than 60 persons will go to the bar, would s/he go to the bar or not? Each participant or decision-maker only knows the number of people who went to the bar before. Thus, the strategy can only be summarized based on the information of the previous feedback. This is a typical dynamic game problem. Through computer simulation, we can get an interesting result. After a period of time, the number of people who went to the bar tends to be 60. The 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-role-like bar game scenario, will it also form a stable equilibrium system? Based on the data shown in Figure7, 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.


## 4.2. 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. The expected returns for these two types of agents are affected by the number of demand and supply of the same system.If there areNp passengers choosing to take taxis and Nd taxis are waiting around the hotspot, their payoffs are given by(1)πd=pl+ρ+cdNpNdNpNd,πp=U−pl−cpNpNd,where p denotes the average income per kilometre, l denotes the average operating mileage, ρ denotes the starting price, cd denotes the cost of searching time for drivers, cp 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 cpNp/Nd, and the drivers can save the searching time cdNp/Nd. To make it easier, we assume cp=cd=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 P0. Also, the taxi drivers who choose to supply the service out of hotspots have fixed income D0.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. The 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 actiona∈i,−i in round t, the propensities in round t+1 are updated by(2)qsat+1=θπst+1−θqsat,s∈p,d,whereqsat+1 is the propensity to choose action a in the next round t+1; πst is the payoff corresponding to the action in round t; and θ is the learning rate.(3)
Update probability: the probability of choosing actioni in round t+1 is determined by(3)psit+1=expγqsit+1expγqsit+1+expγqs−it+1,where γ>0 is a parameter that determines reinforcement sensitivity. In our simulations with the reinforcement learning model, we set γ=0.5,θ=0.1,0.2. The results are shown in Figure 8.Figure 8
The reinforcement learning model results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)θ=0.1; (b, d) θ=0.5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


### 4.2.2. The 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]. The 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 risk-averse; 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. Therefore, 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. That is, for passengers, they will use the fixed incomeD0 of other transportation as a reference point. When πd>D0, the passengers consider gains; when πd<D0, the passengers consider incurring loss. The same goes for taxi drivers. Let xd and xp 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, xd=πd−D0,xp=πp−P0.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:(4)P=11+expr∑i=1nxs−−∑j=1mxs+,s∈p,d,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, ∑i=1nxs− is the sum of historical losses and ∑j=1mxs+ is the sum of historical gains. The results are shown in Figure 9.Figure 9
The Fermi learning results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)λ=1; (b, d) λ=5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


## 4.2.1. The 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 actiona∈i,−i in round t, the propensities in round t+1 are updated by(2)qsat+1=θπst+1−θqsat,s∈p,d,whereqsat+1 is the propensity to choose action a in the next round t+1; πst is the payoff corresponding to the action in round t; and θ is the learning rate.(3)
Update probability: the probability of choosing actioni in round t+1 is determined by(3)psit+1=expγqsit+1expγqsit+1+expγqs−it+1,where γ>0 is a parameter that determines reinforcement sensitivity. In our simulations with the reinforcement learning model, we set γ=0.5,θ=0.1,0.2. The results are shown in Figure 8.Figure 8
The reinforcement learning model results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)θ=0.1; (b, d) θ=0.5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


## 4.2.2. The 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]. The 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 risk-averse; 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. Therefore, 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. That is, for passengers, they will use the fixed incomeD0 of other transportation as a reference point. When πd>D0, the passengers consider gains; when πd<D0, the passengers consider incurring loss. The same goes for taxi drivers. Let xd and xp 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, xd=πd−D0,xp=πp−P0.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:(4)P=11+expr∑i=1nxs−−∑j=1mxs+,s∈p,d,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, ∑i=1nxs− is the sum of historical losses and ∑j=1mxs+ is the sum of historical gains. The results are shown in Figure 9.Figure 9
The Fermi learning results. There are totally 3000 drivers and 1000 passengers in the systems. (a, c)λ=1; (b, d) λ=5. The probability of taking a taxi and waiting around hotspots for (a) and (b) at the initial state is half, and for (c) and (d), it is 1.
(a)(b)(c)(d)


## 4.3. Results

Figures8 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 P0=D0=50. These results demonstrate that both models can account for self-organization behavior under different scenarios.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. These results support that demand and supply of taxis in hotspots will self-organize into a balanced system over a period of time.


## 5. Conclusion and Discussion

The 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. Therefore, 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. The 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. Then, we establish a dynamic game model, which is a kind of double-role-like bar game, and simulate the multiagents system using two learning models, reinforcement learning and prospect theory based Fermi learning. The 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.



---

*Source: 3659315-2020-08-11.xml*