The K Shortest Transit Paths Choosing Algorithm in Stochastic Transit Network Liyuan Zhao1 , Yiliang Xiong2 , and Hong Sun3 1
College of Traffic and Transportation Southwest Jiaotong University Chengdu, 610031, P.R. China xio
[email protected] 2 College of Traffic and Transportation Southwest Jiaotong University Chengdu, 610031, P.R. China
[email protected] 3 School of Air Transportation Management Civil Aviation Flight University of China Guanghan, 610031, P.R. China
[email protected]
Abstract. The public transit route choosing problem is the key technology of public transit passenger information system. Considering travel time variety caused by uncertainty traffic congestion condition, firstly this paper designs the least transfer times algorithm and the K shortest transit paths algorithm in the stochastic transit network. On the basis of travel psychology analysis, transfer times, travel time and cost of each transit path plan are taken into account. By changing link travel time reliability, the algorithms generate different K shortest transit path plans under different traffic conditions. Computational experiments demonstrate the efficiency of the model and algorithm in stochastic transit network. Keywords: K-shortest path, stochastic transit network, time reliability, least transfer times.
1
Introduction
Public transit system is an important part of city transportation system. As its high efficient utilization of resources, vigorously developing public transit and bus priority become an inevitable choice to ease the worsening traffic congestion status. Public transit paths choosing problem has been widely studied during the past decades [1,2,3,4]. All these studies are based on the average travel time value. However, a lot of random factors change the state of traffic network, such as traffic accidents, weather conditions, road maintenance and even traffic jams. These random factors will lead directly to the variety of travel time. The reliability of travel time has become an important factor when traveler makes transit G. Wang et al. (Eds.): RSKT 2008, LNAI 5009, pp. 747–754, 2008. c Springer-Verlag Berlin Heidelberg 2008
748
L. Zhao, Y. Xiong, and H. Sun
path choice. The low reliability of transit travel time has become a common phenomenon in many cities. This is also the main reason that makes bus less competitive. To give a more reasonable description of the transit paths choice, transit link travel time is thought to follow normal distribution according to Bell and Iida’s study [5]. The concept of travel time reliability is introduced. To predict travel time in the stochastic network, the expected reliability value is presented according to road traffic congestion status and different personal preference. During traffic peak time, the transit travel time is longer, and we set bigger reliability to predict, while in the low peak time, a smaller reliability value is set. There are always three factors impacting traveler make transit path choice: transfer times, travel time and cost. The research on passenger psychology (see [6]) shows that transfer times is the first considered factor, followed by cost and time. This paper is organized as follows. First, the impacts on transit path choice are formulated including transit travel time in stochastic network and the least transfer times matrix. The improved Dijkstra algorithm is then introduced to compute the least transfer times. The K shortest transit path algorithm (see [7,8,9]) is designed based on the stochastic travel time. A numerical stochastic network example is provided. Conclusion follows in the last section.
2
Impacts on Transit Route Choosing
A public transit network is composed by some nodes (bus stop), the links connecting two nodes and bus lines. Define a public transit network as G, G = {N, E, R}, where N = {1 ≤ i ≤ n} denotes the set of all nodes, andnis the number of nodes; the origin node and the destination node is O, D respectively. E = {1 ≤ e ≤ m} is the set of all transit links, and m is the number of links; R = {1 ≤ r ≤ u} is the set of all bus lines, and u is the number of links. In this paper, we consider three factors: transfer times, travel time and cost. Transfer times are the most important factor. If there are some nonstop paths between the origin O and destination D, we choose the path with the least travel time and cost. If there is no nonstop path existing, then consider one time transfer paths. The method of determining travel time in stochastic network and transfer times is discussed follow. 2.1
Time Determination in Stochastic Network
First let’s see the deficiency of the Previous Average Travel Time. The transit link travel time is thought to follow normal distribution. The previous method, determining optimal route according to the average travel time, does not meet our need. For example, in Figure 1, the mean time of route 1 is less than route 2, so route 1 will be chosen in previous average time method. However, route 1 with bigger standard deviation, which means the travel time will fluctuate largely for frequent traffic congestion phenomenon.
The K Shortest Transit Paths
749
Fig. 1. Transit Path Normal Distribution Comparison
On the contrary, the travel time on route 2 has less fluctuation. In the traffic peak period, it would happen that route 1 takes 60 minutes for serious congestion while route 2 just needs 50 minutes. In this condition, route 2 will be a better choice. To solve this uncertainty circumstance, we adopt reliability theory to describe. Transit travel time contains two parts: link travel time and transfer time. Transfer time generates when there is no nonstop bus route existing between origin and destination. In stochastic network, we suppose both follow normal distribution. Te : N (te ,(σe )2 ), Tc : N (tc ,(σc )2 ) where t is the mean andσis the standard deviation. Definition 1. Reliability of Link Travel Time The reliability of link travel time can be defined as (see [10]): considering the uncertainty and randomness of the travel time, the probability of the link travel time to be less than some given time t0 : ρ = P (Te ≤ t0 ), ρ ∈ [0, 1]. teρ : travel time on link e under reliability ρ, P (Te ≤ teρ ) = ρ. Set φe (x) = P (Te ≤ x) be distribution function of Te , then teρ = φ−1 e (ρ). So we can calculate teρ if know Te and ρ. trijρ : The estimated travel time from node i to j on bus line r, which is the sum of travel time teρ of passed links. tcρ : The transfer times under reliability ρ. During traffic peak time period, travel time is generally long, high reliability value will be appropriate, ρ> 0.5. In the low peak time, we set ρ < 0.5. If users belong to risk taking categories, they will tend to choose path with lower travel time, less reliability value will be set. The risk avoiding categories will tend to choose the route with higher reliability will be adopted. 2.2
The Least Transfer Times
Definition 2. The Adjacency Matrix We denote δ = {δri |r ∈ R, i ∈ N } as the adjacency matrix between bus line r and node i. If the bus line r passes node i, then δri = 1, otherwise 0.
750
L. Zhao, Y. Xiong, and H. Sun
Definition 3. Nonstop Matrix Nonstop matrix is defined as A = {aij |i, j ∈ N }, if there exist nonstop bus line passing from node i to j , then aij = 1; otherwise aij = +∞,aii = 0. We can get aij by the correlation matrix: if maxr δri · δrj = 1, then aij = 1; and aij = +∞ when maxr δri · δrj = 0. Definition 4. Least Transfer times We define the least transfer times matrix as: W = {wij |i, j ∈ N }, where wij is the least transfer times from node i to j . wiD denotes the least transfer times from node i to D . If node i can’t reach node j in the transit network, then wij = +∞.
3
K Shortest Transit Paths Algorithm
The K shortest transit paths algorithm contains two parts. The first is the least transfer times matrix algorithm, which provides a heuristic value to the second algorithm, the K shortest transit paths search algorithm. 3.1
The Least Transfer Times Algorithm
In transit shortest algorithm, the least transfer times has been widely researched (see [11,12,13]). In this paper, we put forward an improved Dijkstra algorithm according to the nonstop matrix to calculate the least transfer times from all nodes i to the destination D: wiD . The algorithm 1 is shown as follow. Step1: ∀i ∈ N , construct the correlation matrix δ and nonstop matrix A, initialize wiD = +∞, wDD = 0, put all notes in queue Q. Step2: If Q is not empty, then do {y} ← {i|wiD = min wjD , j ∈ Q}, Q ← Q − {y}; otherwise, the algorithm ends. Step3: For all nodes i ∈ N , y and wiD is finite, if wiD > wyD + aiy , then wiD = wyD + aiy , if not, go to Step2. 3.2
The K Shortest Transit Paths Search Algorithm
The past transit path search algorithms are mostly the shortest path algorithm (see [14,15]). In the shortest path problem there is a single label assigned to each node j, while in the K shortest paths problem we may have K labels for each node which can record K paths. The label of node j is formed by five K-tuple: πj , σj , ξj , ηj and θj . While πjk , σjk , ξjk , ηjk and θjk is the k th respective component. πjk and σjk , respectively denotes the travel time and transfer times of a path from original node O to node j; ξjk and θjk means the node i before j in that path and its position in ξi , respectively. ηjk is the bus line connecting node j and the previous node i. To improve the efficiency of search algorithm, we set a maximum tolerant transfer times Y from the origin O to the destination D, such that σjk +wjD ≤ Y . It means that the sum of the transfer times from original node O to node j and
The K Shortest Transit Paths
751
the least transfer times from node j to destination D must be less or equal to the maximum tolerant transfer times. If this condition isn’t satisfied, there is no need to search any further. In this way, unnecessary calculations are effectively avoided. The general form of the K shortest transit paths search algorithm is given in Alg.1. The value of wiD can generate in Algorithm 1. Q is a first-infirst-out queue. Data: trijρ ,tcρ ,wiD ; {πi1 , ..., πiK } ← {+∞, ..., +∞}, ∀i ∈ N ; 1 1 , ηO ← null; ξO 1 1 , σO ← 0, Q ← {O} πO while Q = ∅ do i ←the top node of queue Q; Q ← Q − {i}; for bus linerthat passes nodei do for nodejthat follows nodeion the bus liner do for k ∈ {1, ..., K}such that πik is unused and finite do l ←order of max{πj1 , ..., πjK } in {πj1 , ..., πjK } l while ηjl = r, σik + wiD ≤ Y ,and πik + tn ij + tc < πj do l k r πj ← πi + tijρ + tcρ ; σjl ← σik + 1; ξjl ← i; ηjl ← r; θjl ← k; while j ∈ / Q do push node j into queue Q; end end end end end end The k shortest paths can be built with label ξj , ηj and θj by recursive function. 1. The K Shortest Transit Paths Search Algorithm
4
Computational Experiments
Figure 2 is an instance of transit network, including 15 nodes , 22 links and 6 one-way bus lines, R1, R2. . . R6. The origin and the destination are node1, 15, respectively.The travel time on links in stochastic network show in Table 1, and the transfer time follows:N (5,3). As the principle of setting reliability, we give three reliability valueρ=0.5,0.2,0.9 to see the different choices in the three traffic condition, respectively: the general traffic condition, the low peak time traffic, and the serious traffic congestion condition. The results of the algorithm 1 and 2 are shown as the following to different reliability.
752
L. Zhao, Y. Xiong, and H. Sun
Fig. 2. Transit Network Example Table 1. Link Travel Time Normal Distribution Link T ime Link T ime
1, 2 N (10, 1) 8 N (7, 1)
3 N (10, 0.5) 11, 12 N (7, 0.8)
4, 10, 14, 15 N (8, 4) 13, 18, 17, 21, 22 N (8, 0.8)
5, 6, 19 N (9, 0.8) 16 N (9, 1.2)
7, 9 N (8, 1) 20 N (6, 0.8)
Table 2. The K Shortest Paths under General Traffic Condition Rank 1, 2 3,4 5
T ime 50 51 55
Cost 3 2 2
T ransf er 2 1 1
P aths 1, R4, 5, R1, 7, R6, 151, R4, 5, R3, 7, R6, 15 1,R4,7(6),R6,15; 1,R1,2,R2,15
Status 1. The general traffic condition, we set ρ=0.5. In Table 2, Rank means the ranking of paths’ travel time, and Transfer means the transfer times of paths. The path, taking [ 1,R4,7(6),R6,15 ] for example, means starting from node 1 to node 7 or 6 by bus line R4, then transfers for bus line R6 to the destination node 15. The least transfer times is 1, which means nonstop bus line doesn’t exist from node 1 to 15. If the transfer times (according to passenger’s psychology analysis) take priority over other factors, then the best route is : [ 1,R4,7(6),R6,15 ]. If we prefer shorter travel time, then [ 1,R4,5,R1,7,R6,15 ] and [1,R4,5,R3,7,R6,15] will be chosen. Status 2. Traffic low peak time period, we setρ=0.2. The best route in the low peak time is [ 1,R1,2,R2,15 ], while the best path [ 1,R4,7(6),R6,15] in Status 1, which takes more time here, ranks 11th (and 12th ). The influence of traffic condition is obvious here.
The K Shortest Transit Paths
753
Table 3. The K Shortest Paths under Traffic Low Peak Condition Rank 1 2 3,4 5 11,12
T ime 37.5 40 40.4 41 43.9
Cost 2 2 4 4 2
T ransf er 1 1 3 3 1
P aths 1,R1,2,R2,15 1,R4,5,R2,15 1,R1,2,R2,12,R5(R3),11,R6,15 1,R1,2,R2,5,R1,7,R6,1 1,R4,7(6),R6,15
Table 4. The K Shortest Paths under Serious Traffic Congestion Condition Rank 1,2 3,4 5 6 15
T ime 61.8 63.3 64.9 66.1 81.7
Cost 2 3 2 2 2
T ransf er 1 2 1 1 1
P aths 1,R4,7(6),R6,15; 1,R4,5,R1(R3 ),7,R6,15 1,R1,3,R6,15 1,R1,7,R6,15 1,R1,2,R2,15
Status 3. Traffic peak time period, with serious traffic congestion, we setρ=0.9. In traffic peak time, paths [ 1,R4,7(6),R6,15 ] are the best choices being composed of links ( 2,7,8,11,13,20 ) with small standard deviation (see Table 1). There is little fluctuation on travel time. It means that in traffic peak time, paths with less time-variety are more likely to be chosen. Nevertheless, the best path [ 1,R1,2,R2,15 ] in Status 2 contains links ( 1,4,10,14,15,21 ) with big standard deviation, the travel time is really long in the traffic congestion condition and it ranks the 15th here. The demonstration shows that in the traffic peak time, the path with low fluctuation on travel time is more likely to be chosen. But during the low peak time, people will choose the path with wide time-variety for less travel time.
5
Conclusion
The result of the demonstration shows that the K shortest transit paths search algorithm based on the stochastic transit network can effectively provide best choice under different traffic condition by setting different reliability value to link travel time. The running time and the results of the least transfer times algorithm and the K shortest transit paths choosing algorithm are satisfactory. In this paper, we propose the method of setting reliability value by the understanding of the traffic status. However, it’s so hard to hold the entire road information that there must be some errors. How to set a right reliability being closer to practical situation should be further studied. The factors of transit path choosing include travel time, cost and transfer times. In fact, there are a lot of factors working on the passengers’ decision for complicated transit network, such as the bus departure frequency, transfer walking distance, the feasible walking range and individual preference. These facts should be taken into consideration to meet the needs of different users.
754
L. Zhao, Y. Xiong, and H. Sun
Acknowledgement This paper is supported by the National Natural Science Foundation of China (60776820).
References 1. Weiner, E.: Urban Transportation Planning in The United States. Praeger Publishers (1987) 2. Ma, L., Liu, X.B.: The Shortest Path of Public Transport Net and Related Optimal Taking Bus Problem. Mathematics in Practice and Theory 34, 38–43 (2004) 3. Li, Y.Z., Fang, Y.M.: Design and Realization of Urban Public Traffic Inquiry System. Surveying and Mapping of Geology and Mineral Resources 22, 3–5 (2006) 4. Fu, D.: Algorithm of least transfer in traffic system and its implementation. Journal of Huaqiao University 22, 346–350 (2001) 5. Bell, M.G.H., Iida, Y.: Transportation Network Analysis. John Willey & Sons, Chichester (1997) 6. Yang, X.M., Wang, W.: Gis-Based public transit passenger route choice model. Journal of Southeast University 6, 59–62 (2000) 7. Fox, B.L.: Calculating Kth shortest paths. Canadian Journal of Operational Research 11, 66–70 (1973) 8. Eppstein, D.: Finding the K Shortest Paths. SIAM Journal on Computing 28, 652–673 (1999) 9. He, S.X., Fan, B.Q.: Improved optimal path searching algorithm in transit network. Journal of Shanghai for Science and Technology 28, 63–66 (2006) 10. Zhao, L.Y., Du, W.: The Fuzzy Lattice Order Decision-making Method for Travel Mode Choice Based on the Travel Time Reliability. In: Proceedings of the Second International Conference on Intelligent Systems and Knowledge Engineering, Chengdu, pp. 695–700 (2007) 11. Abkowitzm, J., Tozzi, J., Driscoll, M.K.: Operational Feasibility of Timed Transfer in Transit Systems. Journal of Transportation Engineering 113, 168–177 (1987) 12. Peter, K., Theo, M.: Optimized Transfer Opportunities in Public Transport. Transportation Science 29, 101–105 (1995) 13. Lo, H.K., Yip, C.W., Wan, K.H.: Modeling Transfer and Non-linear Fare Structure in Multi-modal Network. Transportation Research Part B 37, 149–170 (2003) 14. Su, A.H., Shi, F.Z.: Optimal Route Choice of Public Traffic Network Based on Shortest Path Searching. Journal of Engineering Graphics 4, 54–58 (2005) 15. Lozano, A., Storchi, G.: Shortest Viable Path Algorithm in Multimodal Network. Transportation Reasearch Part A 35, 225–241 (2001)