Fleet Size and Rebalancing Analysis of Dockless Bike-Sharing Stations Based on Markov Chain

: In order to improve the dynamic optimization of ﬂeet size and standardized management of dockless bike-sharing, this paper focuses on using the Markov stochastic process and linear programming method to solve the problem of bike-sharing ﬂeet size and rebalancing. Based on the analysis of characters of bike-sharing, which are irreducible, aperiodic and positive-recurrence, we prove that the probability limits the state (steady-state) of bike-sharing Markov chain only exists and is independent of the initial probability distribution. Then a new “Markov chain dockless bike-sharing ﬂeet size solution” algorithm is proposed. The process includes three parts. Firstly, the irreducibility of the bike-sharing transition probability matrix is analyzed. Secondly, the rank-one updating method is used to construct the transition probability random prime matrix. Finally, an iterative method for solving the steady-state probability vector is therefore given and the convergence speed of the method is analyzed. Furthermore, we discuss the dynamic solution of the bike-sharing steady-state ﬂeet size according to the time period, so as improving the practicality of the algorithm. To verify the e ﬃ ciency of this algorithm, we adopt the linear programming method for bicycle rebalancing analysis. Experiment results show that the algorithm could be used to solve the disordered deployment of dockless bike-sharing.


Background
The concept of "bike-sharing" [1][2][3][4] was proposed the first time in Amsterdam in 1965.Until 2010, Social Bicycles Inc. (SoBi) [5] in the US created a bicycle operation mode by using mobile APP and GPS to realize a quick rent and return of the bicycle, the prototype of the dockless bike-sharing was established [6].
The application of bike-sharing started lately but developed rapidly in China.Taking Hangzhou as an example, a sizeable docked public bicycle system has been built there since 2008.Statistics showed that the scale was increased from 2800 vehicles and 61 stations to 66,000 vehicles and 2411 stations, and the average usage rate of bike-sharing vehicles is about 250,000 times per day.Until 2011, it has become the world's largest public bicycle system [7][8][9].At the same time, urban public bicycles have developed rapidly in various parts of China, but the penetration was not so well.In 2015, OFO Inc. firstly deployed dockless bike-sharing on the university campus, which made the rise of dockless bike-sharing in China.Despite the fact that the development period of the dockless bike-sharing is not so long, but both the development speed and the scale have seen remarkable growth with the encouragement of capital markets and increase of social requirements.By the end of 2017, the number of bike-sharing has exceeded 11 million in China.
The bike-sharing deployed by merchants since 2016 are mainly dockless bicycles [10].Compared with traditional docked bicycles, it could allow users to pick up and drop off bikes freely instead of at the designated station [11].The dockless bike-sharing adopts the operation mode of "smart dockless", "GPS positioning", "network convenient payment" and "requesting on demand".It has become a popular way for short-distance green travel in China.
The emergence of dockless bike-sharing is an innovative model of the sharing economy in the Internet era, which facilitates the daily short-distance travel of the public [12].However, on the other hand, the disordered deployment of dockless bike-sharing has become an increasingly serious problem, because some bike-sharing companies try to keep the competition by blind expansions.The problems of fleet size and rebalancing [13][14][15] of the dockless bike-sharing stations are mainly illustrated as follows: • There are too many bicycles in some stations, but the problems of idleness are prominent, which even hinders the passage of pedestrians and cars.In contrast, the number of bicycles in some other stations is not enough to meet the needs of users.

•
The response of the bike-sharing replenishment or repositioning transport is not so efficiently, and the rationality of the rebalancing is still a concern.
Therefore, the fleet size and rebalancing of dockless bike-sharing stations are in urgent need of scientific analysis.It is necessary to propose an algorithm to determine the number of shared bicycles rationally and quickly at each station to achieve the goal of standardized management.

Literature Review
Since 2010, researchers have made tremendous efforts into the research and analysis on sharing policies, operating methods, business models, user behaviors and preferences, station location [16,17], and vehicle rebalancing [18][19][20] of docked bike-sharing.There exists obvious differences such as the spatial distribution mode [21], the riding route [21], the commute correlation [21], the lease and usage mode, and the charging mode between docked and dockless bike-sharing.More flexibility, convenience and randomness, larger user group, higher frequency of use and wider coverage, determine the different research methodologies on the fleet size and rebalancing of dockless bike-sharing.There are a few researches on dockless bike-sharing as the operation time is relatively short.
In 2017, based on Mobike's [22] case of the bike-sharing application, Xiong Shenyuhang proposed the deductive method to analyze the impact of China's Internet-based short-distance travel schemes [23], including the public daily life, government and society.In daily life, dockless bike-sharing has changed the way of life of the public and alleviated the traffic congestion problem.At the government level, dockless bike-sharing is a useful supplement to the government-funded docked bike-sharing, which can be supported by government preferential policies.At the society level, dockless bike-sharing has significantly improved the efficiency of urban travel and reduced urban environmental pollution.
Qi Luo et al. [24] designed the site selection and travel assignment algorithm based on integer programming techniques, composed a multi-mode system integrating the dockless bike-sharing and network carpooling service, and the feasibility of the system is demonstrated.The research was based on the hypothesis that the user has the willingness to ride to the nearest carpool hub to select the carpool service and the required bicycle and carpool vehicles exist.The research used the travel and site data of the taxi and dockless bike-sharing in Manhattan, New York City.
In 2018, based on Mobike's dockless bike-sharing riding data, Wencong Cui [25] selected Beijing as the research area to study the relationship between the use efficiency of dockless bike-sharing and the urban building density by using a case analysis and big data method.The density of the city is negatively correlated with the bicycle idle time and is positively related to the rebalancing.The authors used the SPSS and ArcGIS software for statistical and spatial analysis.
Ling Pan et al. [26] believe that the rebalancing problem has a significant impact on the service quality and revenue of the dockless bike-sharing company.In order to solve the rebalancing problem, constructing the model based on the Markov decision process by combining the spatial elements, and the Hierarchical Reinforcement Pricing (HRP) algorithm is developed based on the depth deterministic strategy gradient algorithm to encourage users to rebalance the dockless bike-sharing.Thus, the deep learning framework was constructed.The HRP algorithm used the divide-and-conquer method to find the dependence relationship between time and space elements, which overcame the shortcomings of other algorithms that often ignore spatial information and rely on accurate prediction.The authors believed that the HRP algorithm can improve the quality of the dockless bike-sharing service and optimize bicycle deployment.
In addition, other researchers have published some articles on the transportation value and development path [27], the profit path [28], the rules of behavior [29] and the environment design of crime prevention [30].

Research Objectives
The fleet size and rebalancing analysis of dockless bike-sharing stations in urban areas is not yet mature.On the one hand, there is a few published articles on this topic, especially the analysis of the theoretical value of the fleet size of bicycle stations is still unrevealed.On the other hand, some articles owe potential theoretical defects, such as the assumption of user incentive.During times of heavy usage, the actual research found that the effect of user incentive mechanism (actually the incentive amount is often small) is not obvious because it is time-consuming.The incentive and punishment mechanism should be used simultaneously as supplementary methods for bike-sharing rebalancing.
The use of dockless bike-sharing is actually a stochastic process.Under the given fleet size of urban dockless bike-sharing, it is necessary to find the principles of the bicycle riding transfer between stations and study the optimal fleet size of bike-sharing stations.Following the lowest rebalancing cost principle, the rebalancing algorithm is studied by using the linear programming method.This is the original motivation of this paper.
In this paper, the public area that deployed dockless bike-sharing is defined as a rental station.In order to facilitate the computing process, a city could be divided into equal squares, which are called grid cells showed in Figure 1 (excluding residential areas, government agencies, parks, water systems, roads, etc.).Each of them can be regarded as a station for dockless bike-sharing pick up and drop off.The fleet size of the deployed dockless bike-sharing stations refers to the number of bicycles in the bike-sharing stations.The total fleet size of bike-sharing refers to the total number of shared bicycles in a city.At the same time, to avoid the interference of major economic activities, bad weather, and users' personal preferences for a different dockless bike-sharing brand, the fleet size and rebalancing of dockless bike-sharing stations from the same company are discussed.
ISPRS Int.J. Geo-Inf.2019, 8, 334 3 of 24 deterministic strategy gradient algorithm to encourage users to rebalance the dockless bike-sharing.Thus, the deep learning framework was constructed.The HRP algorithm used the divide-andconquer method to find the dependence relationship between time and space elements, which overcame the shortcomings of other algorithms that often ignore spatial information and rely on accurate prediction.The authors believed that the HRP algorithm can improve the quality of the dockless bike-sharing service and optimize bicycle deployment.In addition, other researchers have published some articles on the transportation value and development path [27], the profit path [28], the rules of behavior [29] and the environment design of crime prevention [30].

Research Objectives
The fleet size and rebalancing analysis of dockless bike-sharing stations in urban areas is not yet mature.On the one hand, there is a few published articles on this topic, especially the analysis of the theoretical value of the fleet size of bicycle stations is still unrevealed.On the other hand, some articles owe potential theoretical defects, such as the assumption of user incentive.During times of heavy usage, the actual research found that the effect of user incentive mechanism (actually the incentive amount is often small) is not obvious because it is time-consuming.The incentive and punishment mechanism should be used simultaneously as supplementary methods for bike-sharing rebalancing.
The use of dockless bike-sharing is actually a stochastic process.Under the given fleet size of urban dockless bike-sharing, it is necessary to find the principles of the bicycle riding transfer between stations and study the optimal fleet size of bike-sharing stations.Following the lowest rebalancing cost principle, the rebalancing algorithm is studied by using the linear programming method.This is the original motivation of this paper.
In this paper, the public area that deployed dockless bike-sharing is defined as a rental station.In order to facilitate the computing process, a city could be divided into equal squares, which are called grid cells showed in Figure 1 (excluding residential areas, government agencies, parks, water systems, roads, etc.).Each of them can be regarded as a station for dockless bike-sharing pick up and drop off.The fleet size of the deployed dockless bike-sharing stations refers to the number of bicycles in the bike-sharing stations.The total fleet size of bike-sharing refers to the total number of shared bicycles in a city.At the same time, to avoid the interference of major economic activities, bad weather, and users' personal preferences for a different dockless bike-sharing brand, the fleet size and rebalancing of dockless bike-sharing stations from the same company are discussed.This paper is an extension of the work originally presented in 2018 ISPRS TC IV Mid-term Symposium "3D Spatial Information Science -The Engine of Change" [31].Aiming at dynamical optimization and standardized management for the fleet size of dockless bike-sharing, this paper proposes the "Markov chain dockless bike-sharing fleet size solution" algorithm.The structure of this paper could be organized as follows.Firstly, we introduce the background, literature review and research object in Section 1.Secondly, the applicability of Markov chain to dockless bike-sharing is analyzed in Section 2. Thirdly, the methods of solving the fleet size and rebalancing analysis of dockless bike-sharing is discussed in Section 3. Based on the above, the experiment and verification of the proposed algorithm is introduced in Section 4. Finally, the preliminary progress and prospective achievement are discussed in Section 5.

Breif Concept of the Markov Chain
A discrete-state, discrete-time Markov stochastic process is called a Markov chain, named after the Russian mathematician Andrey Markov.Markov chains are widely used in economics, traffic management, game theory, queuing theory, genetics and finance.
A Markov chain is a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.We have a set of states, X = {X 1 , X 2 , . . . . . ., X r }.The process starts in one of these states and moves successively from one state to another.Each move is called a step.If the chain is currently in state X i , then it moves to state X j at the next step with a probability denoted by P ij , and this probability does not depend upon the states the chain was in before the current state.The probabilities P ij are called transition probabilities.The process can remain in the state it is in, and this occurs with probability P ii .Then, P X n+1 = j X 0 , . . . . . ., X n = P X n+1 = j X n A matrix consisting of one-step transition probabilities of multiple states is called a transition probability matrix, in which the value showed in each of these rows is the probability that the state represented by the diagonal element is transferred to another state, respectively, and the probability that each column is transferred to the state represented by the diagonal element, respectively.
Let P be a matrix of one-step transition probabilities, state space P is called a one-step transition probability matrix of Markov chains, and

Markov Chain Characters of Bike-Sharing
Bike-sharing provides people with a convenient way for commuting, and solves the "first/last mile" travel problem (DeMaio, 2009).Based on the bike-sharing usage model, the users mainly rent and return the bicycles between adjacent stations.Of course, the concept of "being adjacent" is relative.There is a situation where users rent and return bicycles between stations that are far away from each other.This section theoretically assumes that there is connectivity or bicycle state transition relationships between any two stations to facilitate analysis.
Assuming that a user rents the shared bicycle from the station j and returns the rented bicycle at the station k within the time period t 0 − t 1 , regardless of the state of other stations in the same interval, the state of the station k during the transfer is only related to the station j, and independent of the states of other stations before the time t 0 .According to the Markov Chain property, "the past is conditionally independent of the future given the present state of the process" or "given the present state, the past contains no additional information on the future evolution of the system."So, the state relationship of shared bicycle stations is in accordance with the basic conditions of the Markov stochastic process application.
Suppose a city has a total of n dockless bike-sharing stations, the states of station j during the time period t 0 − t 1 include:

•
The user at the station j rents a bicycle ride to any other stations that exists n − 1 kind of possible (mutually exclusive), each of which has two states, (e.g., the bicycle at station j and station k).
Set the bicycle move from station j to station k, and the two states are denoted as X j and X k , respectively.The transition probability of this bicycle process is denoted as P jk , P jk = P X k X j , k j.

•
The bicycle at station j is not rented or still returned to the station j after being rented, the state is denoted as X 0 , and the transition probability is denoted as P jj .
The bicycle transfer state of station j in the time period t 0 − t 1 is showed in Figure 2.
ISPRS Int.J. Geo-Inf.2019, 8, 334 5 of 24 Suppose a city has a total of  dockless bike-sharing stations, the states of station j during the time period  −  include: • The user at the station  rents a bicycle ride to any other stations that exists  − 1 kind of possible (mutually exclusive), each of which has two states, (e.g., the bicycle at station  and station ).Set the bicycle move from station  to station , and the two states are denoted as  and  , respectively.The transition probability of this bicycle process is denoted as  ,  =    ,  ≠ .
• The bicycle at station  is not rented or still returned to the station  after being rented, the state is denoted as  , and the transition probability is denoted as  .
The bicycle transfer state of station  in the time period  −  is showed in Figure 2.For the probability of dockless bike-sharing discussed in the paper,  can be regarded as the ratio of the average number of bicycles that the user rides from station  to station  in the multiple time periods to the average number of bicycles in station  at  . can be regarded as the ratio of the average number of bicycles that are not rented or still returned to station  in the multiple time periods to the average number of bicycles in station  at  .In summary, the probability  and  are accumulated to 1.
By analogy, the transition state of all n stations is showed in Figure 3.For the probability of dockless bike-sharing discussed in the paper, P jk can be regarded as the ratio of the average number of bicycles that the user rides from station j to station k in the multiple time periods to the average number of bicycles in station j at t 0 .P jj can be regarded as the ratio of the average number of bicycles that are not rented or still returned to station j in the multiple time periods to the average number of bicycles in station j at t 0 .
In summary, the probability P jk and P jj are accumulated to 1.
n−1 k=0 P jk > 0 To ensure connectivity between stations, By analogy, the transition state of all n stations is showed in Figure 3.The transition probability matrix of all n stations is constructed as Since all the elements in the transition probability matrix  are nonnegative and the sums of elements in any row are all 1,  is a random matrix.
At a certain time, the ratio of the number of bicycles at each station to the total number of bicycles deployed in the city is called the probability of the station, and the probability values of all stations constitute the probability vector at this time.It is assumed that the initial probability vector of the dockless bike-sharing stations at time  is  ( ) , and the probability vector at time  is ( ) .The bike-sharing transition probability matrix in the time period  −  is P, by the Markov chain property, it can be obtained: The  moment can be regarded as the 0th transfer of the bike-sharing Markov chain, and the  moment can be regarded as the 1th transfer.With the passage of time, the probability vectors after the  − 1 steps and  steps transfer are  ( ) and  ( ) , respectively.The relationship between the two is Iterate over equation (1) and one can get

Proof of Steady-State Exsiting in Bike-Sharing Markov Chain
The state of the dockless bike-sharing Markov chain based on a city is limited and has the following properties: The transition probability matrix of all n stations is constructed as Since all the elements in the transition probability matrix P are nonnegative and the sums of elements in any row are all 1, P is a random matrix.
At a certain time, the ratio of the number of bicycles at each station to the total number of bicycles deployed in the city is called the probability of the station, and the probability values of all stations constitute the probability vector at this time.It is assumed that the initial probability vector of the dockless bike-sharing stations at time t 0 is π (0) , and the probability vector at time t 1 is π (1) .The bike-sharing transition probability matrix in the time period t 0 − t 1 is P, by the Markov chain property, it can be obtained: The t 0 moment can be regarded as the 0th transfer of the bike-sharing Markov chain, and the t 1 moment can be regarded as the 1th transfer.With the passage of time, the probability vectors after the k − 1 steps and k steps transfer are π (k−1) and π (k) , respectively.The relationship between the two is Iterate over Equation ( 1) and one can get

Proof of Steady-State Exsiting in Bike-Sharing Markov Chain
The state of the dockless bike-sharing Markov chain based on a city is limited and has the following properties:

•
Irreducible.Let C be a non-empty subset of the state space.If i ∈ C and k C, the connectivity probability P ik = 0, C is called a closed set.If all the states in C are interconnected, C is called an irreducible closed set [32].If Markov chain's state space is an irreducible closed set, it is called irreducible.The total number of bike-sharing stations in a city is limited, all belong to the same category and theoretically there is a bidirectional connectivity relationship between any two stations (except for prohibited areas such as residential areas, government agencies, parks, water systems, and roads, etc.).The bike-sharing Markov chain theoretically has irreducible properties [33].

•
Aperiodic.Each state in the Markov chain can only be accessed at periodic intervals, then it is periodic, otherwise it is aperiodic.Theoretically, if the irreducible transition probability matrix is a prime matrix, the Markov chain is aperiodic.Theoretically, if the irreducible transition probability matrix P is a prime matrix (there is only one non-negative irreducible matrix with only one eigenvalue falling on its spectral circle) [34] the Markov chain is aperiodic.According to Carl D.
Meyer's research, if a random matrix is irreducible and has at least one positive diagonal element, it is a prime matrix (sufficient condition) [35].Investigate the transition probability matrix P, which is an irreducible nonnegative square matrix with n diagonal element P jj .In the actual rental of dockless bike-sharing, if all the diagonal elements of P are 0, which are the situations where all bicycles at all stations in the time period t 0 − t 1 are rented by the users or there is no return of bicycles to the original stations, this is inconsistent with a real-life situation.Observing the use of bicycles, it can be concluded that the diagonal elements with no internal zero are more prevalent, that is the trace of the matrix P is not 0 (tr(P) 0).Therefore, the dockless bike-sharing Markov chain is aperiodic (non-periodic).

•
Positive-recurrence.If and only if starting from state j, the random process can eventually return to state j with probability 1, then state j is considered as a recurrence [32].When the average return time of state j is finite, it is called positive-recurrence. Liu Cihua's argument in the "Random Process" (Fourth Edition) has shown that irreducible finite Markov chains must be recurrence [32].
It has been discussed above that the bike-sharing Markov chain has the properties of being finite and irreducible, so it is a positive-recurrence.
It can be seen from the above that the dockless bike-sharing Markov chain has the above three properties, and the following theorem is established: Theorem 1.For any irreducible, aperiodic and positive recurrence Markov chain, the limit state probability exists only and independent of the initial probability distribution.This limit state is called steady-state and the limit state probability is called steady-state probability.
When k steps of the bike-sharing Markov chain transition are big enough, one has the following, where π (k) = the probability vector after k steps transfer π = a steady-state probability vector From formula (2), one has the following, Therefore, the main idea of the algorithm in the paper is based on multiplying the initial probability vector of the dockless bike-sharing stations by the higher power of the transition probability matrix, that is π (0) P k .The computed vector will approximate the steady-state probability vector with the increase of power.With the increase of iteration, the probability vector of the dockless bike-sharing stations will gradually stabilize.Each element of the steady-state probability vector is the steady-state probability of bicycles at each bike-sharing station, and multiplying them by the total number of shared bicycles in the city respectively, one obtains the steady-state fleet size of the bike-sharing at each station.Solving the steady-state probability vector of the bike-sharing Markov chain can optimize the configuration of the fleet size for each dockless bike-sharing station.The above iterative method is called the power method.

Methodology for Fleet Size and Rebalancing of Bike-Sharing
To solve the steady-state probability vector of dockless bike-sharing stations, we must first determine all the elements of the transition probability matrix P. We need to observe and count the state transitions of n stations in the city during the time period t 0 − t 1 .For every station, it is necessary to count the specific destination station for each user riding out of the bicycle, or for every station, it is necessary to count the specific source station that each user rides back of the bicycle.
The relationship between n stations is n 2 .In addition, it is also necessary to compute the initial value of the fleet size of each station in the same segment, so n stations have n numbers in total.And one should consider the total fleet size of bicycles deployed by the bike-sharing company in the city.The total number of statistics to be counted is not less than n 2 + n + 1.
On the basis of the usage statistics of the bike-sharing and the computation of the transition probability, the transition probability matrix of the bike-sharing (sparse matrix) is constructed first.Second, the reducibility of the transition probability matrix is analyzed.If it is irreducible, the steady-state probability is directly obtained by the power method; if it is reducible, the rank-one updating method is used to compute the steady-state probability.Combined with the practical application of bike-sharing, the algorithm is improved to solve the steady-state fleet size of bicycles at different time periods in one day.On this basis, the linear programming method is used for the bicycle rebalancing analysis.The Fleet size and rebalancing analysis of dockless bike-sharing stations framework is showed in Figure 4. can optimize the configuration of the fleet size for each dockless bike-sharing station.The above iterative method is called the power method.

Methodology for Fleet Size and Rebalancing of Bike-Sharing
To solve the steady-state probability vector of dockless bike-sharing stations, we must first determine all the elements of the transition probability matrix .We need to observe and count the state transitions of  stations in the city during the time period  −  .For every station, it is necessary to count the specific destination station for each user riding out of the bicycle, or for every station, it is necessary to count the specific source station that each user rides back of the bicycle.
The relationship between  stations is  .In addition, it is also necessary to compute the initial value of the fleet size of each station in the same segment, so  stations have  numbers in total.And one should consider the total fleet size of bicycles deployed by the bike-sharing company in the city.The total number of statistics to be counted is not less than  +  + 1.
On the basis of the usage statistics of the bike-sharing and the computation of the transition probability, the transition probability matrix of the bike-sharing (sparse matrix) is constructed first.Second, the reducibility of the transition probability matrix is analyzed.If it is irreducible, the steadystate probability is directly obtained by the power method; if it is reducible, the rank-one updating method is used to compute the steady-state probability.Combined with the practical application of bike-sharing, the algorithm is improved to solve the steady-state fleet size of bicycles at different time periods in one day.On this basis, the linear programming method is used for the bicycle rebalancing analysis.The Fleet size and rebalancing analysis of dockless bike-sharing stations framework is showed in Figure 4. Based on the observation of the usage of dockless bike-sharing, it is found that for any station , the riding of the shared bicycle is mainly performed at its adjacent stations.The number of ride-in and ride-out bicycles between the stations that are far away is very small.The user's single riding distance statistics are showed in Table 1 [36].Based on the observation of the usage of dockless bike-sharing, it is found that for any station j, the riding of the shared bicycle is mainly performed at its adjacent stations.The number of ride-in and ride-out bicycles between the stations that are far away is very small.The user's single riding distance statistics are showed in Table 1 [36].According to Table 1, the bike-sharing stations can be divided into the following three categories.

•
Close stations.For any station j, another station within 10 km away has a more frequent bike-sharing relationship with it.This paper refers to this kind of station as the close station of station j.

•
Peripheral stations.For any station j, the station that is more than 10 km away is a peripheral station.According to Table 1, the average value of the peripheral stations to the total number of stations could be set to 4%.

•
Unrelated stations.This paper refers to a station with no bicycle transfer relationship between station j as an unrelated station.The transition probability between the unrelated station and the station j is set to zero.An unrelated station with a bicycle initial value of zero is called a suspended station.
Based on the above analysis, a new dockless bike-sharing transition probability matrix P is constructed, which is a sparse matrix obviously.Set each station have an average number of close and peripheral stations are m, then there are about m × n non-zero elements in P .For medium and large cities, m n, m × n n 2 .This method can be referred to as the "Markov chain dockless bike-sharing fleet size solution".Using this method, one can deduce that the mutual riding relationship between n stations is reduced to m × n.In addition, it is also necessary to count the initial fleet size of each station, as n stations have a total of n values.If the total fleet size of bicycles is deployed by the bike-sharing company in the city, the total number of statistics to be counted is not less than m × n + n + 1, which is significantly smaller than the traditional total number of statistics n 2 + n + 1.
After the transition probability matrix is sparse, the station interoperability is affected due to the unreachability of some stations.The irreducible nature of the transition probability matrix may be changed to be reducible.The steady-state condition of the matrix is destroyed and the steady-state fleet size cannot be solved.Therefore, the suspended station check is firstly performed on the sparse matrix P'.If the elements in the row and column of the P' diagonal element a jj are both zero (including a jj = 0), the rows and columns are deleted from P'.
On this basis, the matrix P' is checked for reducibility.If P' is irreducible, the power method is directly performed (see 3.1.3);otherwise, the rank-one updating method of the sparse matrix needs to be performed first to satisfy the irreducible condition, and then the power method is carried out.The following method is used to determine the reducibility of the matrix P': Construct the reachable matrix R' of the matrix P' by replacing all non-zero elements in P' with one and unchanging zero elements.The determination of matrix reducibility is equivalent to the determination of the connectivity of the reachable matrix.
Determining the connectivity between any two stations j and k cannot be argued only based on whether the element a jk in R' is equal to zero.This only indicates that the direct connection between the two stations does not exist, and it is necessary to verify the possibility of connectivity through other stations.
Arguing station j and station k are connected by w (1 ≤ w ≤ n − 2, n is the total number of stations) stations, one needs to consider the arrangement of w stations.That is, one needs to compute the possible arrangement of A w n−2 .Analyzing whether the multiplications of the corresponding elements in each case of the arrangement is equal to zero, if there is a case that is not equal to zero, stations j and k are connected.If there exists a case where it is equal to zero, stations j and k are not connected.If any two stations in the matrix R' have a connectivity relationship, the sparse matrix P' is irreducible.If there is a non-connective relationship between the two stations, P' is reducible.
One can argue that station j and station k are connected by w stations, the maximum number of connection paths is The computation complexity of the connectivity argument is computed as follows (See proof of the below equation in Appendix A): Through Taylor's formula, one obtains, The above is only the complexity of the connectivity computation between one station pairs.Considering that the maximum number of different station pairs in the matrix P is the n 2 − n, assuming that m 1 ≤ m ≤ n 2 − n station pairs are directly connected, the total connectivity computation complexity is not less than n 2 − n − m n 2 (n − 2)!e − 1 .R. Tarjan's strongly connected components algorithm [37] significantly reduces the computational complexity of the matrix reducibility argument to O(n).In practice, we can use software tools such as MATLAB to argue the reducibility of the matrix.

The Rank-One Updating of the Reducible Matrix
The rank-one updating method first appropriately reduces the probability of non-zero elements in the transition probability sparse matrix P.Then, the sum of the transitional probabilities of peripheral stations (not exceeding 4%) is evenly distributed to all stations.Under the premise that the sum of the elements of each row of the matrix is one, a new random matrix that satisfies the solving of the steady-state probability of dockless bike-sharing is constructed.
In the specific rank-one updating operation, firstly, P can be multiplied by one adjustment parameter θ (that is θP , 0 < θ < 1, and θ is close to one) to decrease the non-zero elements appropriately.Then the sum of the elements of each row in the matrix P is θ.Next, each element in P adds 1 − θ n separately, and the sum of the increments in each row is ( 1 − θ n ) × n = 1 − θ, so the sum of the elements of each row is θ + (1 − θ) = 1.Therefore, the sum of the elements of each row of the matrix remains unchanged.From the above, a new transition probability matrix C is constructed.The above operation can be expressed as e T is the transposition for the unit column vector e.The rank of the matrix formed by 1 − θ n ee T is one, so the above operation is called the rank-one updating for P. According to Table 1, about 96% of the users have a single riding distance within 10 km; thus the θ in the C can be selected as 0.96, and the computation result of the rank-one updating part is n × n square matrix.One has the following, In summary, we know that C is a random prime matrix, which satisfies the irreducible, aperiodic and positive-recurrence property of the dockless bike-sharing Markov chain.The steady-state condition of the transition probability matrix is established.

Steady-State Fleet Size Solution
When computing the steady-state probability vector of C by the power method, one has Although the matrix C is a dense matrix, it can be known from Equation ( 6) that we actually perform vector-matrix operations on the original sparse matrix P when performing the power method, and the correlation operation of the dense matrix is not performed.The change in the element after the rank-one updating was not directly involved in the computation, therefore the time complexity of this algorithm is still O(n).
Continue iterating on the π (k) , one can obtain, Substituting θ = 0.96 into the above equation yields, When n is large enough, one can obtain, After the rank-one updating, the probability value of the non-zero element P jk in the sparse matrix P is changed as follows: If the number of bike-sharing stations in the city is large (such as n ≥ 100), | P| ≈ 0.04P jk , the probability value of non-zero elements changes very little.In addition, after the rank-one updating, the probability value of each zero element is changed to: If n ≥ 100 in the city, the corrected probability value of each zero element is no more than 0.0004.
The larger the city size, the higher the number of the bike-sharing station is, and the smaller the impact of the rank-one updating on the P element.Therefore, after the rank-one updating of the sparse matrix P , the constructed new transition probability matrix C does not change the main state transition relationship between the bike-sharing stations.For the bike-sharing operation with low accuracy requirements and high response speed, the rationality of the solution results can be guaranteed.

Steady-State Fleet Size Convergence Determination Method
The dockless bike-sharing transition probability matrix P is a random matrix, the max row sum matrix norm According to the relationship between the spectral radius and matrix norm, the spectral radius of the matrix in any complex field is not greater than the max row sum matrix norms, that is ρ(P) It is also defined that the spectral radius ρ(P) is the largest value of the eigenvalues of the matrix P (the absolute value of the dominant eigenvalue), so it is known that the absolute value of the dominant eigenvalue of P is |λ 1 | ≤ 1.
At the same time, since P is a random matrix, Pe = e = 1 × e, that is, 1 is a eigenvalue of P.
From the above, the dominant eigenvalue of the bike-sharing transition probability matrix P is λ 1 = 1.For a random prime matrix, the dominant eigenvalues are unique [38], therefore, without loss of generality, we can make the following n − 1 eigenvalues have the following relationship: Let eigenvalues of the random prime matrix C be µ 1 , µ 2 , • • • , µ n , where µ 1 = 1, without loss of generality, one can make the following n − 1 eigenvalues have the following relationship: 1 > µ 2 ≥ µ 3 ≥ . . .≥ µ n .According to the proof of Carl D. Meyer, µ i = θλ i , i = 2, 3, • • • , n, λ i is the eigenvalues of the dockless bike-sharing transition probability sparse prime matrix P. Then Based on the random prime matrix C, we compute the steady-state probability vector of the bike-sharing fleet size by the power method, and its convergence rate is µ 2 k → 0 [34,35].Since µ 2 ≤ θ < 1, the convergence rate does not exceed |θ| k → 0 .If the precision of the computation is one digit after the decimal point, set |θ| k = 0.1, since θ > 0, θ k = 0.1, we can take the base 10 logarithm on both sides of the equation to get k = (−1)/log 10 θ.In this paper, we set θ = 0.96, the number of iterations does not exceed (−1)/log 10 0.96 ≈ 56 times.
If the minimum time period of the bike-sharing state transition is in unit of day, the convergence value of the power method iteration can be regarded as the time when the overall stations of a city reach the steady-state.
Combining the iterative process of the power method, when computing the steady-state fleet size probability vector, the steady-state can be argued by computing the absolute value of the difference between the corresponding elements of the adjacent probability vectors.Set When every absolute value of the difference is less than a sufficiently small constant ∝, one obtains, where S = the total fleet size of dockless shared bicycles in a city.At this point, the bike-sharing transfer can be considered to have reached the steady-state.For the convenience of computation, set δ = π (k+1) − π (k) 1 = n i=1 y i − x i .When δ is small enough (may also take 1/S), it can be considered that two adjacent vectors are equal and the dockless bike-sharing Markov chain reaches the steady-state.

Improvement of Bike-Sharing Fleet Size Algorithm
Through the practical application of dockless bike-sharing, it is not difficult to find the following characteristics: On the workdays, the use of dockless bike-sharing is tightly coupled with different time periods every day, that is, it is used frequently during peak hours and afternoons, moderately used at noon, and less used at night.Therefore, the working day time is divided as shownin Table 2.The 24 h in Table 2 is a change cycle of the bike-sharing station status.For bike-sharing companies, the change of the fleet size of bike-sharing stations in different time periods can provide an important basis for the formulation of the rebalancing strategy.Therefore, it is necessary to further improve the algorithm.
According to the analysis provided in chapter 2, we can see that the changes of the bicycle state in the seven time periods all meet the basic requirements of discrete-time Markov chain applications.Therefore, the algorithm can be further refined to dynamically compute the transition probability matrix of each major time period of the day, and then compute the steady-state fleet size of each bike-sharing station in each time period.
The initial fleet size of bike-sharing of station j at different time periods in a day is S T i , i (1, 7), respectively.Set the initial fleet size of the bike-sharing of station j in each time period of the k+1th day be S (k+1) T i , i (1, 7).In the i − th time period, the number of rides out of station j is G (k+1) T i and the number of rides is Knowing the initial value S T i of bike-sharing for a certain time period in station j, and the number of shared bicycles G T i from station j to station k, then the bike-sharing transition probability of station j to station k in this time period is P T i −jk = G T i /S T i , P T i −jj = 1 − n−1 k=0 P T i − jk , k j.Set the transition probability matrix at different time period in a day as P i , i (1, 7), substituting P T i − jk and P T i − jj into the P i to construct the transition probability matrix. Since ) is a random matrix, the 7 i=1 P i is also a random matrix.Set Q = 7 i=1 P i (Q can be referred to as bike-sharing total transition probability matrix).If Q is irreducible, the power method is directly performed; if Q is reducible, the rank-one updating method is needed and then the power method is performed.The steady-state probability vector π is obtained by power method.
After reaching the steady-state, the fleet size of each bike-sharing station in each time period of the day can be computed separately.The steady-state fleet size vector of bike-sharing stations at the morning peak in a day is equal to the total size of the bicycles multiplied by the steady-state probability vector.
According to formula ( 9), the early morning peak fleet size of bike-sharing (the bicycle station fleet size vector at 7:00 in the morning) is obtained.The vector is multiplied by the state transition probability matrix of other consecutive time periods, thus the fleet size vector of other time periods of the day can be obtained.
The fleet size vector of n bike-sharing stations in other time periods T i , i (2, 7) is solved as follows:

Analysis of Rebalancing
In practical applications, the fleet size decision of each bike-sharing station can be made by referring to the computation results under steady-state conditions, and optimized by considering factors such as the land area of stations.If the steady-state fleet size of the bike-sharing station is greater than the maximum number of bicycles allowed in the actual area, set station j for this type of stations, if P jj is larger (such as P jj ≥ 5%), it means that such stations have more idle bicycles, and the bicycles removal adjustment is required.Otherwise, if P jj is within the normal range of values, indicating that the steady-state bicycle fleet size of such stations exceeds the load capacity of the station land area, the dynamic rebalancing of the number of bicycles at the station is required.The above two situations are collectively referred to as the fleet size rebalancing of dockless bike-sharing.The following is an analysis of the bike-sharing fleet size rebalancing optimization based on the linear programming method.
First, computing the actual number of bicycles that can be accommodated based on the available area of each station, and constructing the actual fleet size vector γ of the bicycle station, let the vector η = S × π − γ.Considering the elements in η, set l 1 elements equal to 0, l 2 elements equal to negative numbers, and l 3 elements equal to positive numbers, then For the positive elements in η, we construct the bicycle moving-out fleet size vector α = α 1 , α 2 , • • • , α l 3 , α j = S × π j − γ j , 1 ≤ k ≤ l 3 ; for the negative elements in η, we construct the bicycle moving-in fleet size vector Let d jk be the distance between station j and k.For the convenience of computation, let d jk be the straight line distance between the diagonal intersection points of the grids where station j and k are located.The rectangular coordinate system is established with the lower left corner of the city bike-sharing station grid as the origin, and the coordinates of station j and k are x j , y j , (x k , y k ), Let ξ jk ( j ∈ w, k ∈ ν) denote the number of bicycles that are transferred to the moving-in station k through transport trucks from the moving-out station j.In order to optimize bicycle rebalancing, bicycle service providers use transport trucks to load and unload bicycles between moving-out stations and moving-in stations.The lowest rebalancing cost is the goal pursued by the businesses.For the rebalancing stations, during a rebalancing period (such as noon time), the fewer bicycles are dispatched by the transport trucks, and the shorter the distance traveled, the lower the rebalancing cost.This paper does not directly compute the rebalancing cost, but uses the multiplication of the bicycle number moved out of the stations and the distance traveled by the transport truck to dispatch [39] these bicycles as a rebalancing optimization.Then the solution is as follows: min Equation ( 11) is a special type of transportation problem [40], which can be solved by the Lingo software to obtain the optimal solution (lowest cost).Equation ( 11) is based on the premise that the total number of moving-out bicycles is not greater than the total number of moving-in bicycles, that is When the total number of moving-out bicycles is greater than the total number of moving-in bicycles, that is k=1 β k , which means that the number of shared bicycles exceed the capacity of the urban space area, and the number of bicycles needs to be reduced.When k=1 β k , it can be considered that the ideal state is reached, and at this time Equation (11) has a feasible solution.
The computation results show that the rebalancing optimization is mainly carried out between the moving-out stations and the nearby moving-in stations.In real-life situation, the moving-out stations and the nearby moving-in stations can be unified for rebalancing management.One can use incentives to encourage the users to pick up the bicycles at the moving-out stations, and use the penalty strategy to reduce the number of users who drop off the bicycles at the moving-out stations, as an auxiliary means to further reduce the cost pressure of rebalancing optimization.

Algorithmization
Algorithm 1: Markov chain dockless bike-sharing fleet size solution Input: The initial fleet size of the bike-sharing π (0) at 7 : 00 am, the transition probability matrix of seven time periods P 1 , P 2 , P 3 , P 4 , P 5 , P 6 , P 7 in one day, the adjustment parameter θ(0.96), the total fleet size of the urban bicycles S, the actual fleet size vector of bike-sharing stations γ.Output: The steady-state fleet size of bike-sharing stations during the seven time periods in a day.

1:
Build the transition probability matrix Q = 7 i=1 P of dockless bike-sharing stations; 2: Argue the reducibility of Q.If it is irreducible, let C = Q, turn to step 5;

Experiment and Verification
This section uses commercial data and simulation data to verify the feasibility of Algorithm 1.The commercial data is provided by Mobike Inc. [22], which is more than 1.14 million lines.After the commercial data verification, the technical experts of Mobike Inc. believe that the steady-state fleet size of the bike-sharing solved by Algorithm 1 can be used as the baseline reference data in practical operations.However, due to the commercial confidentiality agreement signed with Mobike Inc., this paper mainly shows the specific process and results of the simulation experiment and verification.
The simulation experiment proves that Algorithm 1 is effective and can provide decision support for bike-sharing deployment operations.The simulation data is generated randomly by R language, and the matrix computation is performed according to Algorithm 1 to illustrate the feasibility of obtaining the steady-state fleet size of the station for decision support.On this basis, by comparing the time required to reach the steady-state under the different total fleet size of bicycles and different number of stations, the rule of the steady-state realization and the effectiveness of Algorithm 1 is further verified.For ease of explanation, the simulation experiment takes 20 stations as an example, and sets the total fleet size of bike-sharing as S = 500.The experiment and verification process of the steady-state probability is as follows, 1. Build a total transition probability matrix P of dockless bike-sharing.
7. Compute the difference between the steady-state fleet size vector and the actual fleet size vector.Taking the maximum value of the distance in the matrix as the denominator, the elements in the matrix are respectively used as molecules, and after dividing, the following distance matrix is constructed, which is showed in Figure 8 (2) Moving-in stations sequence vector  = (1 4 5 7 8 12 13 15 16) 9. Compute the distance matrix of the moving-out and the moving-in stations.Taking the maximum value of the distance in the matrix as the denominator, the elements in the matrix are respectively used as molecules, and after dividing, the following distance matrix is constructed, which is showed in Figure  10.Solve the feasible solution of bicycle rebalancing.In Figure 9, the number in the arc is the number of bicycle rebalancing, and the number in parentheses is the station serial number.In Figure 9, the number in the arc is the number of bicycle rebalancing, and the number in parentheses is the station serial number.
In order to further verify the feasibility of the proposed algorithm, under the different total fleet size of shared bicycles and the number of bike-sharing stations, this paper computes and compares the steady-state fleet size of the bike-sharing station and the convergence speed, respectively.In the simulation, the number of stations is set to 300, 500, 700, 900, and 1100, respectively.The total fleet size of bike-sharing is set to 1×10 5 , 2×10 5 , 3×10 5 and 4×10 5 , respectively.The adjustment parameter is In order to further verify the feasibility of the proposed algorithm, under the different total fleet size of shared bicycles and the number of bike-sharing stations, this paper computes and compares the steady-state fleet size of the bike-sharing station and the convergence speed, respectively.In the simulation, the number of stations is set to 300, 500, 700, 900, and 1100, respectively.The total fleet size of bike-sharing is set to 1 × 10 5 , 2 × 10 5 , 3 × 10 5 and 4 × 10 5 , respectively.The adjustment parameter is taken as 0.96.The steady-state probability is computed 1000 times for a total of 20 simulation combinations for the bike-sharing station and the total fleet size.The average convergence speed is computed, see Table 3 for details.Experiments show that when the total fleet size of shared bicycles in the city is constant, the more the number of stations, the fewer the number of iterations are required to reach the steady-state, that is, the less time is needed for the fleet size to reach the steady-state.Theoretically, this conclusion can also be proved.From Equation ( 7), when n is larger, the 0.04 1 n e T 0.96 k−1 P (k−1) + 0.96 k−2 P (k−2) + • • • + 0.96P + 1 in formula ( 7) is closer to zero, Equation ( 7) gets closer to Equation (8).Then, the less the factors affecting the steady-state of dockless bike-sharing, only affected by π (0) P (k) , so the number of iterations required to reach the steady-state is relatively reduced.
On the basis of solving the steady-state fleet size vector, this paper uses the Lingo software to analyze the linear programing of bicycle rebalancing in four scenarios with 300 stations and 1 × 10 5 , 2 × 10 5 , 3 × 10 5 , 4 × 10 5 bicycle numbers.
The choice of θ value is set based on the actual travel data of the dockless bike-sharing.In a general sense, if θ = 1, it means that the shared bicycles are riding to the closest stations within 10 km, and the peripheral stations more than 10 km away are not used as the riding destination.This is an ideal situation, and the transition probability sparse matrix P is an irreducible matrix and does not need to be rank-one updating.If θ → 0 , it means that the shared bicycles are almost all riding to the peripheral stations 10 km away, and the close stations within 10 km are not used as the riding destinations, which is obviously inconsistent with the facts.
The value of θ is chosen close to one.On the one hand, when θ → 1 , the change in the probability value of the non-zero element in P is very small.It is actually consistent with the riding of the bike-sharing, and there are few users riding to the peripheral stations.On the other hand, the element updating control of the transition probability sparse matrix P is within an acceptable range.In this paper 3.1.4,after the rank-one updating, the probability value of the non-zero element P jk in the sparse matrix P changes to (1 − θ) 1  n − P jk .If the number of shared bicycle stations in the city is large (such as n ≥ 100), then the absolute value of the above formula |∆P| ≈ (1 − θ)P jk , taking θ = 0.96 selected in this paper as an example, |∆P| ≈ 0.04P jk , the probability value of non-zero elements changes very little.
If the peripheral stations are used more frequently, the difference between θ and one is larger, and the updating to P is also larger, thus the deviation between the rank-one updating method and the actual situation is more obvious.The experiment shows that the difference between θ and one is greater than 0.1, therefore this algorithm is not recommended.

Conclusions
In this paper, the traditional Markov chain steady-state probability vector solution method is improved, and the "Markov chain dockless bike-sharing fleet size solving method" is given.This method combines the actual application of bicycles to construct a transition probability sparse matrix.For the sparse matrix may be reducibility, the method of arguing irreducibility based on graph theory and the general iterative method for the steady-state fleet size are given.For the reducibility sparse matrices, the rank-one updating method is used to conduct the random prime matrix to meet the requirements of steady-state fleet size solving, the iterative method of the solution is given and the convergence speed of the method is analyzed.On this basis, the construction method of the bicycle initial value and transition probability matrix in multiple time periods in one day is further analyzed, which makes the algorithm that can solve the station probability fleet size vector in different time periods within one day.Finally, the linear programing method is used to analyze the bicycle rebalancing, and the algorithm is verified by the experiment.
With the algorithm, one takes into account the computation accuracy and speed, and has strong operability.The steady-state fleet size is used as the baseline value to enable the relevant companies to dynamically optimize the bicycle deploy fleet size, and strengthen the standardized management.

Figure 1 .
Figure 1.An example region is divided into squares with an equal area.

Figure 1 .
Figure 1.An example region is divided into squares with an equal area.

Figure 2 .
Figure 2. Transition states of station .

Figure 2 .
Figure 2. Transition states of station j.

Figure 3 .
Figure 3. Transition states of all stations.

Figure 3 .
Figure 3. Transition states of all stations.
Compute the fleet size of the dockless bike-sharing stations at different time periods in one day respectively.*/21: Solve the linear programming equation min l 3 j=1 l 2 k=1 d jk ξ jk , and obtain the optimal moving-in stations collection for each moving-out stations in different time periods.

6 .
Compute the actual fleet size vector.

7 .
Compute the difference between the steady-state fleet size vector and the actual fleet size vector.

Figure 6 .
Figure 6.Statistical diagram of actual fleet size vector for dockless bike-sharing stations.

Figure 6 .
Figure 6.Statistical diagram of actual fleet size vector for dockless bike-sharing stations.

Figure 7 .
Figure 7. Statistical diagram of difference between the steady-state fleet size vector and the actual fleet size vector.8.Construct the moving-out stations number vector and moving-in stations number vector.(1)Moving-out stations sequence vector ω = (2 3 6 9 10 11 14 17 1819 20)

Figure 8 .
Figure 8. Statistical diagram of distance for moving-out and moving-in stations.

Figure 8 .
Figure 8. Statistical diagram of distance for moving-out and moving-in stations.

24 Figure 9 .
Figure 9. Rebalancing chart of the moving-out stations and moving-in stations.

Figure 9 .
Figure 9. Rebalancing chart of the moving-out stations and moving-in stations.

Table 1 .
Bike-sharing user single ride distance statistics.

Table 2 .
Bike-sharing user single ride distance statistics.

Table 3 .
Simulation data steady-state probability solution iteration number statistics.