Information Sciences 255 (2014) 135–154
Contents lists available at ScienceDirect
Information Sciences journal homepage: www.elsevier.com/locate/ins
Processing time-dependent shortest path queries without pre-computed speed information on road networks q Jinha Kim, Wook-Shin Han, Jinoh Oh, Sungchul Kim, Hwanjo Yu ⇑ Pohang University of Science and Technology (POSTECH), Pohang, South Korea
a r t i c l e
i n f o
Article history: Received 11 March 2013 Accepted 22 July 2013 Available online 27 July 2013 Keywords: Shortest path Road network Routing
a b s t r a c t Shortest path (or least travel time path) identification has been actively studied for direct application to road networks. In addition, the processing of time-dependent shortest-path queries, which use past traffic data to compute the speed variations of road segments, has been investigated in order to incorporate speed variations over time. However, speed information pre-computed from static past traffic data is often invalid because road traffic is inherently dynamic. This paper addresses a new problem in processing a Dynamic Time-Dependent Shortest Path (DTDSP) query, which considers the current road status without assuming pre-determined speed patterns on roads. By dynamically adjusting the speed patterns of roads instead of fixing them based on past traffic data, the recommended paths, which reflect the current road status, are more effective in distributing the road traffic and thus reducing the travel time. To process DTDSP queries, we first propose a Continuous Piece-wise Linear Speed Pattern (CPLSP) model to compute the vehicle speed patterns, which is more flexible and realistic than previously adopted piece-wise constant speed pattern models. Using dynamically computed CPLSPs, we process a DTDSP query in two phases: (1) the least travel time path is found for the query and (2) the speed patterns of the following vehicles, which are affected by the participation of the new vehicle on the road network, are updated. We propose efficient algorithms for finding the least travel time path of a new query (vehicle) and for updating the speed patterns of the existing vehicles. Experiments on real data sets show that our query processing algorithms effectively distribute road traffic, and thus, significantly reduce both global and individual travel times. Ó 2013 Elsevier Inc. All rights reserved.
1. Introduction Identifying the shortest path is important for its direct application to road networks. When commuting or traveling, we want to minimize the time spent on roads. The shortest path query abstracts this natural demand and has been actively studied. The most basic approach is to find the path with the shortest length based on a map. This corresponds to the
q This research was partially supported by Next-Generation Information Computing Development Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (MEST) (No. 2012M3C4A7033344). This work was also supported by Mid-career Researcher Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (MEST) (No.KRF-2011-0016029). ⇑ Corresponding author. Tel.: +82 542792388. E-mail addresses:
[email protected] (J. Kim),
[email protected] (W.-S. Han),
[email protected] (J. Oh),
[email protected] (S. Kim),
[email protected] (H. Yu).
0020-0255/$ - see front matter Ó 2013 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/j.ins.2013.07.009
136
J. Kim et al. / Information Sciences 255 (2014) 135–154
Fig. 1. Algorithms for DTDSP.
classical shortest path query [8,11,3,10,25,1,2,26,12,15,14,20,21,13,19,22]. However, this approach does not recommend good paths, particularly during rush hour or holiday seasons, since it assumes that every road segment has a constant driving speed. To reflect real road network conditions, variants of the shortest path query have been proposed. If travelers utilize the future speed pattern of each road segment over time along with a map, they can find a better path, i.e., the least travel time path. This setting corresponds to the time-dependent shortest path query [7,18,17,23]. Moreover, when the starting time can be chosen flexibly within a certain range, travelers may also want to know the best starting time that results in the least travel time. This is a time-dependent shortest path with starting time range query [18,5,6,16,9]. However, these queries assume that future speed patterns are pre-determined from the past traffic data. Such speed patterns are easily invalidated as more vehicles request the shortest paths. During the pre-computation phase, a high speed is likely assigned to uncrowded road segments. These road segments tend to be frequently included in the shortest path selection. The chosen road segments then become crowded, and their speeds will decrease. This paper addresses a new problem (or new query) of finding the least travel time path dynamically by considering the current road status without assuming pre-determined speed patterns on the roads. We call this a Dynamic Time-Dependent Shortest Path (DTDSP) query. Its main difference from existing time-dependent shortest path queries is that, instead of fixing the speed patterns of roads based on past traffic data, the speed patterns are adjusted dynamically as new vehicles set up their paths. Thus, the recommended routes, reflecting the current road status, are better in distributing the road traffic and thus reducing the travel time. A DTDSP query is applicable to a server–client path recommendation system. When a client such as an autonomous car requests the best path from the source to destination starting at a specific time, the server system monitors the traffic condition from a holistic view and recommends the best path. This kind of scenario is frequently illustrated in many sciencefiction movies. To process a DTDSP query, we first propose a Continuous Piece-wise Linear Speed Pattern (CPLSP) model to compute the vehicle speed patterns. The CPLSP model is more flexible and realistic than previously adopted piece-wise constant speed pattern models [23]. We dynamically compute a CPLSP based on the maximum speed limit and the safe distance between two successive vehicles. These assumptions are reasonable owing to the advances of a vehicle-to-vehicle (V2V) communication system [24] and an autonomous cruise control system.1 Based on dynamically computed CPLSPs, we process a DTDSP query in two phases. The first phase is finding the least travel time path for the query. We propose an efficient path finding algorithm that exploits a novel admissible heuristic estimator based on landmarks. The second phase is updating the speed patterns of the following vehicles that are affected by the participation of a new vehicle on the road network. After computing the least travel time path of the current query in the first phase, the speed patterns that constitute the path are registered in the road network. Newly registered speed patterns of the current query may cut into the existing speed patterns of the past queries. As illustrated in Example 1, these affected speed patterns of past queries should be updated, and their paths may also be re-calculated.
1
http://en.wikipedia.org/wiki/Autonomous_cruise_control_system.
J. Kim et al. / Information Sciences 255 (2014) 135–154
137
Example 1. Consider two vehicles, c1 and c2, running on a road segment. Their DTDSP queries have been processed, and they are running according to their recommended paths (Fig. 1a). Assume that a new query is submitted by vehicle c3, the path of which cuts into that of c1 (Fig. 1b). The query submitted by c1 may then be re-processed to find a better path (Fig. 1c). However, the path update for c1 may result in cascading updates of the following vehicles. Thus, to reduce the query processing cost, we can only update (or slow down) the speed pattern of c1 without re-calculating its path (Fig. 1d).
Accordingly, we propose three algorithms for processing a DTDSP query: the Arrival Time Priority, Query Time Priority, and Periodic Refresh algorithms. The Arrival Time Priority algorithm re-computes the least travel time paths of the past queries if they are affected by the path of the current query (Fig. 1c). Thus, the least travel time paths for all submitted queries are always maintained. However, the processing cost of this algorithm is high since the path updates may need to be propagated to all the following vehicles. As an alternative, the Query Time Priority algorithm only updates the speed patterns of the existing paths of the affected queries without re-calculating their routes (Fig. 1d). This substantially reduces the query processing time by avoiding propagating the path update. To further boost the processing time, the Periodic Refresh algorithm updates the speed patterns of the vehicles only when the pre-defined refresh interval expires. This is a kind of heuristic estimation of the Query Time Priority algorithm. We conducted extensive experiments on real data sets. The results show that our algorithms effectively distribute the road traffic and thus significantly reduce the global and individual travel times of the vehicles especially under highly congested scenarios. Example 2 illustrates a simple example of such a scenario. Example 2. Suppose that we do not have any pre-computed speed patterns and that all vehicles want to run from north to south at constant intervals. While classical shortest path solutions suggest the use of only one path (Fig. 2a), our DTDSP solution recommends using different paths depending on the traffic conditions (Fig. 2b). Consequently, the sum of the travel times of the vehicles is substantially reduced. Although the time-dependent shortest path query solution may also provide different paths, such a solution cannot be obtained without pre-computed speed information, which can easily be invalidated.
The contributions of this paper can be summarized as follows. We propose a novel Dynamic Time-Dependent Shortest Path (DTDSP) query and dynamic speed pattern model (CPLSP), which reflect the current road status without assuming pre-determined speed patterns on the roads. We propose algorithms to find the least travel time path of the current query and to update the speed patterns and paths of the past affected queries, such that the new paths benefit from both the current and past queries. Using real data sets, we demonstrate that our algorithms effectively distribute the road traffic and find paths that reduce both individual and global travel times. The rest of this paper is organized as follows. Section 2 reviews the evolution of shortest path algorithms. Section 3 formulates the problem definition. Section 4 elucidates how to generate speed patterns. Section 5 illustrates the DTDSP query processing algorithms. Section 6 reports the experimental results. Finally, Section 7 provides some concluding remarks regarding the proposed algorithms.
Fig. 2. The least travel time paths of Oldenburg, Germany.
138
J. Kim et al. / Information Sciences 255 (2014) 135–154
2. Related work In this section, we review the various types of shortest path queries to see how they are improved in terms of both query setting and query processing perspectives. 2.1. Classical shortest path query When a static graph is given, the classical shortest path query aims at finding the shortest path between two nodes. Dijkstra’s algorithm [8] and the Bellman–Ford algorithm [11,3] are both classical algorithms. Many algorithms have since been devised to reduce the time complexity. Williams [26], and Fredman and Tarjan [12], used binary and Fibonacci heaps, respectively, to boost Dijkstra’s algorithm. The A⁄ algorithm [15] exploits consistent lower-bound heuristics such as the Euclidean distance. The ATL algorithm in [14,13] boosts the A⁄ algorithm again using landmarks. Pohl [19], and Sint and de Champeaux [22], suggested a bi-directional search in which forward and backward searches are executed simultaneously. Sanders and Schultes [20], and Schultes [21], drastically sped up the processing time by orders of magnitude by transforming a graph in a hierarchical manner. Although these algorithms efficiently process the classical shortest path query, they are not applicable to real-world road network problems. Physical representations of road networks are inherently dynamic (e.g., the travel time on a road segment varies over time). Thus, the shortest path query needs to be dealt with in dynamic road networks where the weights of the edges vary over time. 2.2. Time-dependent shortest path query The time-dependent shortest path query aims at finding a path that guarantees the least travel time between two nodes at a certain time. A variation in the travel time on a road segment is embedded as a function over time for each edge. Cooke and Halsey [7] proposed an extension of the Bellman–Ford algorithm. Orda and Rom [18] investigated a time-dependent shortest path query considering the waiting conditions. The authors proposed an efficient extended version of Dijkstra’s algorithm for when a wait period is allowed at every node. On the other hand, when no waiting is allowed, arbitrary edge weight functions make the problem NP-hard. Kaufman and Smith [17] proved that when a dynamic graph allows for no waiting or overtaking, the optimal path is found in polynomial time. Sung et al. [23] showed that travel time functions based on speed functions do not allow overtaking, while arbitrary travel-time functions do not. However, existing studies on time-dependent shortest path queries assume that the travel time functions for each edge are obtained from the past traffic data over time. Such information is easily invalidated, as discussed in Section 1. 2.3. Time-dependent shortest path with starting time range query When a flexible range of starting times is provided, the time-dependent shortest path with a starting time range query aims at finding the least travel time path and the corresponding starting time. Cai et al. [5] and Chabini [6] duplicated a dynamic graph for each discrete time interval to resolve the temporal search space problem, and approximated the timedependent shortest path with the starting time range query solution. However, their solution is offset from the optimal solution and the approximated solution itself may fluctuate based on the pre-defined time interval. Orda and Rom [18], Kanoulas et al. [16], and Ding et al. [9] used continuous approaches. Orda and Rom [18] generalized the Bellman–Ford algorithm, Kanoulas et al. [16] extended the A⁄ algorithms, and Ding et al. [9] extended Dijkstra’s algorithm. The time-dependent shortest path with a starting time range query also suffers from the same problem as the timedependent shortest path query. 3. Dynamic Time-Dependent Shortest Path query definition To formulate a (DTDSP) query, we begin by defining a road network graph. Definition 1. A road network graph is defined as GðV; E; WÞ, where V is a set of nodes indicating the intersections, E ¼ fðv i ; v j Þjv i ; v j 2 Vg is a set of edges representing the road segments, and we ðtÞ 2 W is a travel-time function for a vehicle that enters edge e 2 E at time t, which indicates the time required for the vehicle to escape from e. The method to compute we ðtÞ is explained in Section 4. Briefly, we ðtÞ is determined based on the speed limit and safe distance between two successive vehicles on e. Definition 2. A path p is a sequence of tuples hðv 1 ; t1 Þ; . . . ; ðv n ; tn Þi, where v i is a node in the path, and ti is the arrival time at v i . A route is a sequence of nodes hv 1 ; . . . ; v n i. An element of a path (Definition 2) is a tuple of a node and corresponding arrival time, which allows no waiting at the node. A route ignores the time part of the path. Finally, the DTDSP query is defined as follows.
J. Kim et al. / Information Sciences 255 (2014) 135–154
139
Definition 3. Given a road network graph, GðV; E; WÞ, DTDSPðG; c; s; d; tÞ (1) finds the least travel time path of vehicle c, which starts from s to d at t and (2) updates W to adopt the change of the road network induced by the participation of c in G, without having any pre-calculated speed patterns of G.
4. Speed pattern model This section presents our speed pattern model and explains how to generate the speed pattern spce ðtÞ of vehicle c on road segment e at time t, from which the travel time, we ðtÞ, can be computed. While previous work modeled a vehicle speed pattern as a piece-wise constant function [23,9,16], we adopt a more flexible and realistic Continuous Piece-wise Linear Speed Pattern (CPLSP). When only one vehicle is on a road, it runs at the speed limit. When more than one vehicle is present, the speed pattern of the vehicle depends on that of the vehicle ahead, and is generated by keeping a safe distance between the vehicles. We first discuss the criterion used for generating a CPLSP (Section 4.1) and and discuss how to generate the CPLSP of a vehicle based on this criterion (Section 4.2). 4.1. Safe distance criterion The criterion used for generating a CPLSP is that every vehicle constantly maintains a safe distance from the vehicle ahead. When this criterion is maintained, no chain collisions will occur and a road network with no collisions can be considered stable. To compute the safe distance of vehicle c, several factors are considered. In this paper, we make the following assumptions. The braking deceleration b for every vehicle is the same and kept constant. The vehicle ahead of c may stop immediately. When observing an accident, c immediately starts braking. To avoid a collision even under the worst case, i.e., when the preceding vehicle immediately stops owing to an accident, the safe distance, lsafe (Fig. 3), depends only on the speed and braking deceleration of c as follows.
lsafe ¼
1 vc v2 vc ¼ c ; 2 b 2b
ð1Þ
where v c is the speed of c, and b is the common braking deceleration and the slope of the line in Fig. 3. One important property of the safe distance criterion is that it makes the road network satisfy the FIFO property (Definition 4), i.e. vehicles arriving earlier at a road segment will also leave the road segment earlier. Definition 4. The FIFO property holds in a road network graph, GðV; E; WÞ, if t 1 þ we ðt1 Þ 6 t 2 þ we ðt2 Þ is satisfied for e 2 E, we ðtÞ 2 W, and t1 6 t2 .
4.2. Generating speed patterns and we ðtÞ Based on the safe distance criterion, we model the CPLSP of a vehicle on a road segment. The CPLSP of a vehicle on an edge is determined by the CPLSP of the preceding vehicle on the edge. Thus, the CPLSP of an edge is generated for each vehicle passing the edge. Suppose that road segment e has length l and speed limit u. Our goal is then to find the speed pattern function spce ðtÞ and travel-time function we ðtÞ of vehicle c on e at time t.
Fig. 3. Safe distance lsafe (shaded area).
140
J. Kim et al. / Information Sciences 255 (2014) 135–154
Definition 5. A speed pattern spce ðtÞ is a continuous piece-wise linear function over the time domain from t a to td . t a is the arrival time of c at edge e and td is the departure time. When spce ðtÞ has m linear segments, it is represented as a sequence of tuples hðt 0 ð¼ t a Þ; v 1 Þ; . . . ; ðt m ð¼ td Þ; v m Þi. For any i < j; ti < t j should be satisfied. Definition 5 defines spce ðtÞ as a continuous piece-wise linear speed function over time. Each sub-sequence hðti1 ; v i1 Þ; ðt i ; v i Þi ð1 6 i 6 mÞ represents a linear speed segment of spce ðtÞ. After generating spce ðtÞ; c’s travel time, we ðtÞ, is obtained as follows. Definition 6. For a vehicle c which enters e at t a , when spce ðtÞ ¼ hðta ; v a Þ; . . . ; ðt d ; v d Þi is generated, and the travel time of c in e is
we ðta Þ ¼ td t a :
ð2Þ
Let us see how to obtain spce ðtÞ. For convenience, we omit e in spce ðtÞ. Case 1: no other vehicles exist in e If c is the only vehicle on e when c enters at t 0 , only speed limit u controls the speed of c. Thus, c runs at speed u until c leaves e and spc ðtÞ is
spc ðtÞ ¼ u ðt 0 6 t 6 t0 þ l=uÞ:
ð3Þ
c
In addition, sp ðtÞ ¼ hðt0 ; uÞ; ðt0 þ l=u; uÞi (Definition 5), and the travel time wðt 0 Þ ¼ l=u. Case 2: a preceding vehicle exists in e 0 If certain vehicles are on e when c enters e at t0 , the safe distance criterion applies, and spc ðtÞ is generated from spc ðtÞ 0 c0 which is the speed pattern of vehicle c ahead of c. For example, consider sp ðtÞ, which consists of only two linear speed segments, hðt00 ; v 00 Þ; ðt 01 ; v 01 Þ; ðt02 ; v 02 Þi (Fig. 4a). Case 2-1: the first linear speed segment of c. When c enters e at t0 , to compute v 0 which is the speed of c at t 0 , the distance d0 between c and c0 at t 0 , which is a brick pattern area (Fig. 4b), is necessary. To calculate d0 , the speed v of c0 at t0 is obtained from the linear speed segment hðt00 ; v 00 Þ; ðt 01 ; v 01 Þi. Using t 00 ; t 0 ; v 00 , and v ,
d0 ¼
v 00 þ v 2
ðt0 t 00 Þ:
ð4Þ
Once d0 is calculated, d0 should be the safe distance of c at t 0 . Then,
v0
pffiffiffiffiffiffiffiffiffiffiffi 2bd0 ; u : ¼ min
v0
is determined as follows:
ð5Þ
pffiffiffiffiffiffiffiffiffiffiffi Eq. (5)ffi states that (1) v 0 is computed using the arithmetic expression 2bd0 which comes from Eq. (1) and that (2) when pffiffiffiffiffiffiffiffiffiffi 2bd0 > u; u governs v 0 . The black dot at t 0 represents ðt 0 ; v 0 Þ (Fig. 4b).
Fig. 4. Generation of the speed pattern of c.
141
J. Kim et al. / Information Sciences 255 (2014) 135–154
The first linear speed segment c ends at t1 , which is the end time t 01 of a linear speed segment of c0 (i.e., t 1 ¼ t01 ). To compute v 1 , we need the distance between c and c0 at t1 which amounts to the sum of the two patterned regions (Fig. 4b). The following quadratic equation of v 1 then enforces the distance between c and c0 to be the safe distance of c at t1 .
d0
distance at t 0 1 þ ðt 1 t0 Þðv 01 þ v Þ þ c0 ’s driving distance during ½t 0 ; t1 2 1 ðt 1 t0 Þðv 1 þ v 0 Þ c’s driving distance during ½t 0 ; t 1 2 1 2 v ¼ the safety distance at t 1 : ¼ 2b 1
Among the two real-valued solutions supported by Lemma 1, denote the larger one as
ð6Þ
v 1 .
Lemma 1. Eq. (6) always has two real-valued roots. Proof. See Appendix A.1. h Still, e has u as its speed limit. The final value of
v 1 ¼ minðv
v 1 is calculated as
1 ; uÞ:
ð7Þ
ðt1 ; v 1 Þ is represented as a black dot at t 1 (Fig. 4b). The process yields the first linear speed segment of c; hðt0 ; v 0 Þ; ðt1 ; v 1 Þi. Algorithm 1. gen_speed_pattern(c; e; t) Require: c: vehicle id, e: edge, t: arrival time Ensure: sp: CPLSP of c in e 1: u speed limit of e; 2: l length of e; 3: dist 0; 4: sp0 the speed pattern of c’s preceding vehicle in e; last tuple of sp0 ; 5: ðt 0 ; v 0 Þ 6: if sp0 is not found or t > t0 then 7: append ðt; uÞ to sp; 8: append ðt þ u=l; uÞ to sp; 9: else 10: for each linear speed segment hðt01 ; v 01 Þ; ðt 02 ; v 02 Þi in sp0 do 11: if t > t 02 then 12: dist dist þ ðv 02 þ v 01 Þ ðt 02 t 01 Þ=2 13: else 14: if sp is empty then 15: v ðv 02 v 01 Þ=ðt02 t01 Þ ðt t01 Þ þ v 01 ; 16: dist dist þ ðt t 01 Þ ðv þ v 01 Þ=2; 17: hðt 1 ; v 1 Þ; ðt 2 ; v 2 Þi 18: gen_linear_segment(ðt; v Þ; ðt02 ; v 02 Þ; dist; u); 19: append ðt 1 ; v 1 Þ to sp; 20: append ðt2 ; v 2 Þ to sp; 21: else 22: ðt1 ; v 1 Þ last element of sp; 23: ðt2 ; v 2 Þ 24: gen_speed_tuple(ðt01 ; v 01 Þ; ðt 02 ; v 02 Þ; v 1 ; dist; u); 25: append ðt 2 ; v 2 Þ to sp; 26: end if 27: end if 28: end for 29: remainder ðl cumulative distance of spÞ; last element of sp; 30: ðt0 ; v 0 Þ 31: append ðt0 þ remainder=ðv 0 þ uÞ; uÞ to sp; 32: end if 33: return sp
142
J. Kim et al. / Information Sciences 255 (2014) 135–154
Case 2-2: linear speed segments of c until c0 escapes from e. For two consecutive linear speed segments h. . . ; ðt i1 ; v i1 Þ; ðt i ; v i Þ; ðt iþ1 ; v iþ1 Þ; . . .i in a CPLSP, ðt i ; v i Þ is shared by two linear speed segments. Thus, once the first linear speed segment of c is determined, its following linear speed segments are determined based only on their ending times and speeds. Accordingly, to compute the second linear speed segment of c hðt1 ; v 1 Þ; ðt2 ; v 2 Þi (Fig. 4c), we need to compute v 2 and t 2 is equal to t02 . v 2 is calculated by keeping the safe distance between c and c0 (the shaded area in Fig. 4c). Using the quadratic equation of Eq. (6) in terms of v 2 and speed limit u, we obtain ðt 2 ; v 2 Þ (the black dot in Fig. 4c). Case 2-3,: after c0 leaves e. After c0 leaves e; c can drive the remaining distance r (the shaded area of Fig. 4d) at speed limit u since c has no vehicles ahead of it. Thus, u is assigned to the speed of the last tuple of spc ðtÞ. The last tuple ðt3 ; v 3 Þ is illustrated as a black dot (Fig. 4d). The leaving time t 3 of c is calculated based on the remaining distance r and u.
r¼
1 ðt 3 t 2 Þðu þ v 2 Þ: 2
ð8Þ
Solving Eq. (8) in terms of t3 gives the exit time of c. The gen_speed_pattern(c; e; t) (Algorithm 1) generates the CPLSP of vehicle c which arrives at e at time t. First, gen_speed_pattern() searches the speed pattern sp0 of the vehicle ahead of c from the registered speed patterns in e (line 4). If such a speed pattern is not found or escapes from e before t, c runs at speed limit u (lines 6–8). Otherwise, the speed pattern of c is generated based on sp0 . Before c enters e, the driving distance of the vehicle ahead of c is computed (lines 11–12). When c arrives at e, the first linear speed segment of c is calculated using gen_linear_segment() as demonstrated in case 2–1 (lines 14–20). For the following linear segments until sp0 ends, the ending tuple of each following linear speed segment is calculated using the gen_speed_tuple() as described in case 2–2 (lines 21–26). After the vehicle ahead of c escapes from e, the last linear segment of c is generated based on the remaining distance as described in case 2–3 (lines 29–31). When the number of speed patterns registered in edge e is n and the number of tuples in speed patterns is m, the complexity of gen_speed_patterns() is Oðlog n þ mÞ. To find the last speed pattern starting before t on e (line 4), a binary search of the list of registered speed patterns is necessary. A binary search takes Oðlog nÞ. To make a new speed pattern, (m + 1) tuples are generated. Generating a tuple takes O(1) time since it needs only basic arithmetic operations. Thus, generating the new speed pattern requires OðmÞ time. Algorithm 2. gen_linear_segment(ðt 01 ; v 01 Þ; ðt 02 ; v 02 Þ; d; u) Require: ðt01 ; v 01 Þ; ðt02 ; v 02 Þ : linear speed segment of the preceding vehicle, d: distance, u: speed limit Ensure: linear speed segment of the following vehicle b;/ pre-defined braking deceleration / pffiffiffiffiffiffiffiffiffi v 1 minð 2bd; uÞ gen_speed_tuple(ðt01 ; v 01 Þ; ðt 02 ; v 02 Þ; v 1 ; d; u); ðt2 ; v 2 Þ return hðt 01 ; v 1 Þ; ðt2 ; v 2 Þi; The gen_linear_segment() (Algorithm 2) generates the first linear speed segment when a vehicle enters an edge. It makes the starting time-speed tuple based on Eq. (1) and delegates the ending tuple to the gen_speed_tuple() (Algorithm 3). Algorithm 3. gen_speed_tuple(ðt 01 ; v 01 Þ; ðt 02 ; v 02 Þ; v 1 ; d; u) Require: ðt 01 ; v 01 Þ; ðt02 ; v 02 Þ : linear speed segment of the preceding vehicle, v 1 : the speed of the following vehicle at t 01 , d: distance, u: speed limit Ensure: (1) ending tuple of linear speed segment (2) d is updated at time of t02 ; v max(u, roots of Eq. (6); d d þ ðt 02 t01 Þ ðv 02 þ v 01 v 2 v 1 Þ=2; return ðt 02 ; v Þ The gen_speed_tuple() (Algorithm 3) generates an ending time-speed tuple for a linear speed segment by solving Eq. (6).
5. Query processing algorithm This section presents algorithms to process a DTDSP query (Definition 3). The first phase of the DTDSP query processing is to find the least travel time path for a new query (Section 5.1). The second phase is to insert the speed patterns of the least
J. Kim et al. / Information Sciences 255 (2014) 135–154
143
travel time path into the road network and to update the existing speed patterns registered in the road network (Sections 5.2 and 5.3). 5.1. Finding the least travel time path Using the CPLSP model (Section 4), we can generate the speed patterns and travel times whenever required. A road network that embeds the CPLSP model satisfies the FIFO property (Definition 4) because the CPLSP model does not allow overtaking to occur. Consequently, in our road network (Definition 1) and CPLSP model, the least travel time path of a DTDSP query can be found (Theorem 1). Theorem 1. If a road network graph satisfies the FIFO property, the least travel time path can be optimally found by generalizing the classical shortest path query processing algorithms in a time-dependent manner. Proof. see Theorem 4 and 5 in [17]. h However, not all classical shortest path query processing algorithms are extendable for a DTDSP query. In a time-dependent scenario, the bi-directional search [19,22] is not applicable since a backward search cannot be executed without knowing the arrival time at the destination. A hierarchical search [20,21] also cannot be applied because contracting edges destroys the embedded CPLSP speed patterns when a hierarchical road network structure is constructed. A simple modification of Dijkstra’s algorithm – considering the travel time generated by our CPLSP model instead of the length – gives the least travel time path. However, Dijkstra’s algorithm is slow because it expands almost all edges when the distance from the source to the destination is long. To process a DTDSP query with CPLSP in real time, we must develop an efficient algorithm that does not modify the internal structure of the road network graph. As one good approach, when expanding the edges to find the path, we choose the next extended node based on both the actual cost from source s to node v, as well as a heuristic estimator from node v to destination d. Using a heuristic estimator helps to avoid expanding unnecessary nodes. In the classical shortest path query, the A⁄ algorithm [15] uses the Euclidean distance from a node to the destination as a heuristic estimator, and the ATL algorithm [13] chooses an heuristic estimator based on the Euclidean distance between nodes and landmarks. However, the Euclidean distance cannot be exploited as an element of a heuristic estimator for the DTDSP query because of the different speed limits of edges. In general, to make a heuristic estimator useful for finding the optimal solution, several conditions must be satisfied. For a heuristic estimator, hðv ; dÞ, which approximates the cost from node v to destination d, the conditions used for characterizing h(v, d) are as follows: 1. hðv ; dÞ P 0. 2. hðv ; dÞ never overestimates costðv ; dÞ, which is the actual cost from 3. hðv ; dÞ satisfies hðv ; dÞ 6 costðv ; wÞ þ hðw; dÞ for an edge ðv ; wÞ.
v to destination d, such as the travel time.
If the first two conditions are satisfied, h(v, d) is deemed admissible. An admissible heuristic estimator guarantees the optimal path in the shortest path query regardless of whether it is static or time-dependent. When h(v, d) is closer to costðv ; dÞ, the number of node expansions decreases. Moreover, if all three conditions hold, h(v, d) is consistent. When a consistent heuristic estimator is plugged into the shortest path query processing algorithm, a node needs to be extended only once. Accordingly, we devise three new admissible or consistent heuristic estimators for the DTDSP query – hp ðv ; dÞ (Theorem 2), hl ðv ; d; lÞ (Lemma 2), and hL ðv ; d; LÞ (Theorem 3). Theorem 2. hp ðv ; dÞ, the least travel time from node v to destination d when no other vehicles exist in a road network, is a consistent heuristic estimator for a DTDSP query. Proof. For hp ðv ; dÞ, the conditions for a consistent heuristic estimator hold as follows. (1) The non-negativity condition holds because the travel time cannot be negative.
Fig. 5. How the third condition holds for hd ðv Þ.
144
J. Kim et al. / Information Sciences 255 (2014) 135–154
(2) When no other vehicles exists, a vehicle can drive at the speed limit of the edges, and hp ðv ; dÞ is the fastest travel time from v to d among all traffic conditions. Thus, hp ðv ; dÞ never overestimates the least travel time from v to d for arbitrary traffic conditions. (3) When pud and pwd are the corresponding paths of hp ðu; dÞ and hp ðw; dÞ, the third condition holds by the following rationale. When w is included in pud ; pud ¼ hu; p0wd i where p0wd is an arbitrary path from w to d. Then, the sequence hu; pwd i is the least travel time path because pwd ¼ max p0wd (Fig. 5a). Thus, pud must be hu; pwd i and hp ðu; dÞ ¼ costðu; wÞ þ hp ðw; dÞ. When w is not included in pud , by the definition of pud , a path sequence hu; pwd i cannot be a faster route than pud (Fig. 5b). Thus, hp ðu; dÞ < costðu; wÞ þ hp ðw; dÞ. From both cases, we have hp ðu; dÞ 6 costðu; wÞ þ hp ðw; dÞ.
h
The first heuristic estimator is hp ðv ; dÞ (Theorem 2). hp ðv ; dÞ approximates the actual cost from v to d by assuming that the traffic conditions are optimal. However, it requires OðjVj2 Þ path calculations and memory space to store all-pair least travel times. Even though heuristic estimators can be calculated offline, the OðjVj2 Þ memory space requirement is too heavy in that heuristic estimators should reside in main memory for fast processing. To overcome the space complexity of hp ðv ; dÞ, we devise a better admissible heuristic estimator hL ðv ; d; LÞ (Theorem 3), which requires only OðkjVjÞ path calculations and memory space to store the estimated value between the nodes and kð¼ jLjÞ landmarks. To prove that hL ðv ; d; LÞ is admissible, we first show that another heuristic estimator hl ðv ; d; lqÞ is admissible (Lemma 2). Lemma 2. Given a landmark node l; hl ðv ; d; lÞ ¼ maxðhp ðl; dÞ hp ðl; v Þ; 0Þ is an admissible heuristic estimator for the DTDSP query.
Proof. For hl ðv ; d; lÞ, the conditions for an admissible heuristic estimator hold as follows. (1) The non-negativity holds because hl ðv ; d; lÞ takes the maximum between hp ðl; dÞ hp ðl; v Þ and 0. (2) Using the same rationale as the proof for the third condition of hp ðv ; dÞ, the following inequalities hold.
hp ðv ; dÞ P hp ðl; dÞ hp ðl; v Þ:
ð9Þ
Based on the non-negativity of hp ðv ; dÞ,
hp ðv ; dÞ P 0:
ð10Þ
Combining Eqs. (9) and (10) gives
hp ðv ; dÞ P maxðhp ðl; dÞ hp ðl; v Þ; 0Þ ¼ hl ðv ; d; lÞ:
ð11Þ
From Theorem 2, hp ðv ; dÞ never overestimates the least travel time from v to d among all traffic conditions, and consequently, neither does hl ðv ; d; lÞ. h One problem of hl ðv ; d; lÞ is that the tightness of the estimated value fluctuates based on the combination of v and d. (Theorem 3). A good heuristic estimator should underestimate the actual cost to make it admissible, and it should be also close to the actual cost to reduce search space. Although hp ðv ; d; lÞ is admissible, for some nodes, the estimated value is far less than the actual cost. For example, v,d and l are located at the far west, center, and far east sections of a road network, respectively. Then, hp ðl; dÞ hp ðl; v Þ becomes negative. Because a negative value as a heuristic estimator does not provide any benefit, hl ðv ; d; lÞ gives 0 and does not help reduce the search space. To overcome an unstable tightness of hl ðv ; d; lÞ, we introduce another heuristic estimator, hL ðv ; d; lÞ, (Theorem 3), in which a stable tightness is expected. Theorem 3. hL ðv ; d; LÞ ¼ maxl2L hl ðv ; d; lÞ, where L is a set of landmark nodes, is an admissible heuristic estimator for the DTDSP query.
Proof. From Theorem 2, for each l 2 L, hl ðv ; d; lÞ is an admissible heuristic estimator. Based on the Lemma 2.1 of [14], the maximum admissible heuristic estimator is also admissible. h hL ðv ; d; LÞ improves the tightness by choosing the maximum nested heuristic estimator hl ðv ; d; lÞ; l 2 L. To get sufficient tightness, the landmarks should be evenly spread along the contour of the road network.
J. Kim et al. / Information Sciences 255 (2014) 135–154
145
Algorithm 4. time_dependent_pathfind(G,s,d,t)
Require: G: road network graph, s: source node, d: destination node, t: starting time Ensure: sps: sequence of speed patterns of the least travel time path 1: for each node v in G 1; f ½v 1; 2: time½v 1; prev sp½v null 3: prev ½v 4: end for 5: time½s t; 6: f ½s time½s þ hL ðs; d; LÞ; 7: enqueue a tuple ðf ½s; sÞ into pq; {/ pq keeps the least value of f ½v on top /} 8: while pq is not empty do dequeue from pq; 9: ðt 0 ; v Þ 10: if v = d then 11: break; 12: end if 13: for each out-neighbor u of v do 14: sp gen_speed_pattern(ðv ; uÞ; t0 ); 15: delay traveltimeofsp 16: if time½u > time½v þ delay then 17: time½u time½v þ delay; 18: prev ½u v ; prev sp½u sp; 19: f ½u time½u þ hL ðu; d; LÞ; 20: enqueue ðf ½u; uÞ into pq; 21: end if 22: end for 23: end while 24: sps construct a sequence of speed patterns from prev and prev sp; 25: return sps
The time_dependent_pathfind() (Algorithm 4) outlines our least travel time path finding algorithm. The big picture of the algorithm is similar to that of Dijkstra’s algorithm. However, using the admissible heuristic estimator, hL ðv ; d; LÞ, substantially differentiates the behavior of the algorithm. To process the DTDSP query in a time-dependent manner, instead of the edge length of e, the actual travel-time of a vehicle arriving at t0 on edge e is calculated using the CPLSP model (lines 14–15). To find the next node to expand, the time_dependent_pathfind() uses both the heuristic estimator hL ðv ; d; LÞ and the actual travel time time½v from source node s to node v (lines 6 and 19). The time complexity of the time_dependent_pathfind() is analyzed as follows. The time complexity of the algorithm without generating the speed patterns is OðjVj log jVj þ jEjÞ. In a planar graph such as a road network, jEj kjVj for a constant k. The time complexity is then approximated as OðjVj log jVjÞ. Because the time_ dependent_pathfind() generates a CPLSP whenever expanding an edge, its time complexity is Oððlog n0 þ m0 ÞjVj log jVjÞ, where n0 is the number of registered speed patterns for each edge and m0 is the number of linear segments for each speed pattern. 5.2. Arrival Time Priority algorithm When a new DTDSP query of vehicle c is submitted, the least travel time path of c is calculated and its corresponding speed patterns are registered in the road network. When registering new speed patterns of c, to make all speed patterns in the road network satisfy the safe distance criterion, some of the existing speed patterns should be updated because c becomes their new preceding vehicle. The ideal adjustment is to keep the least travel time paths for all vehicles. To do so, (1) the existing vehicles in G that are cut into by the new vehicle c should be collected, (2) their registered speed patterns after the starting time of c are cleared, and (3) the speed patterns of their least travel time path are reconstructed (remind Fig. 4c). If newly reconstructed speed patterns cut into another speed patterns in G, collection and reconstruction phases should be conducted recursively. In this procedure, the routes of the vehicles queried earlier may be modified by the vehicles queried later but arriving earlier on an edge. Thus, we call this the Arrival Time Priority algorithm. The collect_affected_vehicles(G,c,t) (Algorithm 5) collects the existing vehicles that are affected by the participation of the new vehicle. When new vehicle c starts at t, and its speed patterns are registered in G, it finds the existing affected vehicles after t along with their first affected time.
146
J. Kim et al. / Information Sciences 255 (2014) 135–154
Algorithm 5. collect_affected_vehicles(G,c,t) Require: G: road network graph, c: vehicle id, t: time c’s speed pattern should be registered in G Ensure: M: map (key: vehicle affected by c, value: the first affected time) 1: e the edge where c arrives at t; 2: push (t,c,e) into pq; {/ pq keeps the least value of t on top /} 3: while pq is not empty do pop pq; 4: ðt0 ; c0 ; e0 Þ 5: if e0 is already visited then 6: continue; 7: end if 8: for each c00 which arrives after c0 do the arrival time of c00 in e0 ; 9: t00 10: put ðc00 ; t 00 Þ into M; 11: next e0 next edge of e0 in c00 ’s path; the leaving time of c00 in e0 12: next t0 13: if next e0 is not found then 14: continue; 15: else 16: push ðnext t0 ; c00 ; next e0 Þ 17: end if 18: end for 19: end while 20: return M From the first edge of c’s path, the collection begins. The starting time, vehicle id, and first edge are pushed into priority queue (lines 1–2). For each popped element ðt0 ; c0 ; e0 Þ from the priority queue, if e0 is already visited, it is skipped. Otherwise, for each vehicle c00 that arrives in e0 after t0 ; c00 and its arrival time in e0 is put into the map, M. If c00 has the next edge next e0 to proceed, the arrival time of c00 in the next e0 ; c00 , and next e0 is pushed into the priority queue. (lines 3–19). When the priority queue is empty, returning M finishes the algorithm. Algorithm 6. arrival_time_priority(G,c,s,d,t) Require: G: graph, c: vehicle id, s: source, d: destination, t: starting time Ensure: (1) insert c’s speed pattern in G (2) keep the least travel time paths for all vehicles in G 1: sps time_dependent_pathfind(G,s,t,d); 2: register sps into G; 3: push (t,c) into pq; {/ pq maintains the least t on top /} 4: while pq is not empty do 5: ðt 0 ; c0 Þ pop pq; 6: M collect_affected_vehicles(G; c0 ; t0 ) 7: for each key c00 of M do the earliest speed pattern’s start time of c00 after t0 ; 8: t 00 9: clear c00 ’s speed patterns which starts after t00 ; 10: push ðt 00 ; c00 Þ into pq 11: end for 12: if pq is not empty then pq’s top element; 13: ðc000 ; t000 Þ 14: s0 the last node of remaining path of c000 ; 15: sps0 time_dependent_pathfind(G; s0 ; d; t000 ); 16: register sps’ into G; 17: end if 18: end while 19: p construct the path of c from G. 20: return p
J. Kim et al. / Information Sciences 255 (2014) 135–154
147
The arrival_time_priority() (Algorithm 6) is a pseudo code of the Arrival Time Priority algorithm. First, the speed patterns of new vehicle c are generated by time_dependent_pathfind() and registered in G. The tuple (starting time of c, c) is pushed into the priority queue pq (lines 1–3). For the popped element ðt 0 ; c0 Þ, previous vehicles affected by c0 are collected (line 6). The speed patterns for each affected vehicle c00 whose starting time is after t0 are cleared. A tuple ðstarttimeoftheclearedpart; c00 Þ is pushed into pq (lines 5–11). The least travel time path and its speed patterns are re-constructed for the vehicle at the top of pq (lines 15–17). Finally, construct c’s path from G and return it. Although the Arrival Time Priority algorithm keeps the least travel time path for all vehicles, it needs an exhaustive amount of time to process. In the worst case, when the nth query is submitted, all previous least travel time paths should be re-calculated. This means n time_dependent_pathfind() executions are necessary. The time complexity of the nth query then becomes Oðnðlog n0 þ m0 Þ jVj log jVjÞ. 5.3. Query Time Priority algorithm Although the Arrival Time Priority algorithm keeps the least travel time path for all vehicles, it has a high computational overhead. One approach to alleviate this problem is updating the speed patterns of the earlier-queried or (earlier-starting) vehicles without changing their routes. This approach amounts to a situation in which when a new vehicle cuts into the earlier-queried vehicles, they slow down but do not change their routes (remind Fig. 1d). In this approach, the earlier-queried vehicles have the privilege of sticking to their first decision. Thus, we call this approach the Query Time Priority algorithm Algorithm 7. query_time_priority(G,c,s,d,t) Require: G: graph, c: vehicle id, s: source, d: destination, t: starting time Ensure: (1) insert c’s speed pattern in G (2) keep the safe distance criterion in G 1: sps time_dependent_pathfind(G,s,t,d); 2: register sps into G; 3: M collect_affected_vehicles(G,c,t) 4: for each ðc0 ; t0 Þ of M do 5: E0 sequence of edges of c0 ’s path after t0 ; 6: clear c0 ’s speed patterns after t00 ; 7: push ðt 0 ; E0 Þ into pq {/ pq maintains the least t0 on top /} 8: end for 9: while pq is not empty do 10: ðt0 ; E0 Þ pop pq; 11: if U is empty then 12: continue; 13: else 14: e0 remove the first element of E0 ; 15: sp gen_speed_pattern(e0 ; t0 ); push sp into G; 00 ending time domain of sp; 16: t 17: push ðt00 ; E0 Þ into pq; 18: end if 19: end while 20: p construct the path of c from G. 21: return p
The query_time_priority() (Algorithm 7) details the Query Time Priority algorithm. It is similar to Algorithm 6 until it collects the existing vehicles affected by c (lines 1–3). After that, the speed patterns of the existing vehicles affected by c are updated. Using a priority queue, the update is done by slowing down the speed patterns of the affected vehicles under the new road network condition caused by the registration of the speed patterns of c (lines 3–19). Finally, c’s path is constructed from G (lines 20–21). The time complexity of the query_time_priority() is analyzed as follows. To find the least travel time path of the new vehicle, Oððlog n0 þ m0 ÞjVj log jVjÞ time is required where n0 is the number of speed patterns in an edge and m0 is the number of linear segments of the speed pattern. In addition, all speed patterns of the earlier-querying vehicles should be updated in the worst case. This requires Oððlog n0 þ m0 ÞnjVjÞ time for the nth new vehicle and its earlier-queried vehicles because jVj is the largest possible number of edges of a path. Finally, the time complexity of Query Time Priority algorithm is Oððlog n0 þ m0 ÞðjVj log jVj þ njVjÞÞ.
148
J. Kim et al. / Information Sciences 255 (2014) 135–154
5.4. Periodic Refresh algorithm To boost the processing time of a DTDSP query, we propose the Periodic Refresh algorithm. The two algorithms described above require updating the traffic conditions whenever a new DTDSP query is submitted. Although these fine-grained updating schemes aim at providing more effective paths with less travel times, such traffic condition updates sacrifice efficiency, i.e., query processing time. To deal with the trade-off between effectiveness and efficiency, the Periodic Refresh algorithm refreshes the traffic condition of road networks at every pre-defined query interval. The Periodic Refresh algorithm is a relaxed version of Query Time Priority algorithm. When a refresh interval ends, the Periodic Refresh algorithm only updates speed patterns without changing the vehicle routes. Algorithm 8. periodic_refresh(G,c,s,d,t,k) Require: G: graph, c: vehicle id, s: source, d: destination, t: starting time, k: refresh interval Ensure: (1) insert c’s speed pattern in G (2) keep the safe distance criterion in G at every kth vehicles 1: sps time_dependent_pathfind(G,s,t,d); 2: register sps into G; 3: if cmodk ¼¼ 0 then 4: P collect (route,starting time) of all vehicles; 5: refresh(G,P) 6: end if 7: p construct the path of c from G. 8: return p
Algorithm 8 outlines the Periodic Refresh algorithm. Unlike the Query Time Priority algorithm, which only updates vehicles cut into by a new querying vehicle, the Periodic Refresh algorithm updates the speed patterns of all vehicles in a road network (lines 3–6). The Periodic Refresh algorithm seems to provide considerably longer travel time paths using coarsegrained update. However, we observed a trade-off between effectiveness and efficiency with the change in the refresh interval. Also, we found a good interval with which the Periodic Refresh algorithm requires a short processing time and does not lose its effectiveness (Section 6).
6. Experiment In this section, we describe our numerous extensive experiments using real road networks, which were conducted to evaluate the effectiveness of the DTDSP query processing algorithms. 6.1. Experiment setup Datasets and their statistics: To evaluate our algorithms, we chose two real road networks, Oldenburg (OL) in Germany, and Singapore (SG) ( Table 1). For both networks, 9 landmarks are set for landmark-based algorithms as suggested in [13]. Setting constants: The speed limit for each edge and the common brake deceleration should be determined to generate a CPLSP. Based on the distribution of the edge lengths, we set the speed limit for each edge. If l < 500 m;u ¼ 10 m=s; if 500 < l 6 1000 m;u ¼ 15 m=s; and if l > 1000 m;u ¼ 20 m=s. In all cases, b ¼ 2 m=s2 . Running scenarios: (Random scenario) Randomly selected source and destination. (Commuting scenario) 50% of queries to destination in one cluster from the source in the other clusters + 50% random queries.
Table 1 Statistics related to real road networks.
# Of nodes # Of edges Width/height (km) Min/max edge length (m) Average edge length (m)
OL
SG
6105 7035 23.5/26.9 2.0/4298.4 185.0
11,414 15,641 51.4/29.9 5.38/7546.8 209.1
J. Kim et al. / Information Sciences 255 (2014) 135–154
149
To find the clusters, we use the k-means algorithm [4]. The number of clusters of OL and SG is 5 and 9 for 1200 nodes for each cluster, respectively. Also, the 50% of random queries in the commuting scenario reflects non-commuting vehicles. Algorithms: The algorithms used in the experiments are as follows. Landmark: the landmark algorithm [13] as a baseline. It ignores the time information. ArrivalPriority: the Arrival Time Priority algorithm (Algorithm 6). QueryPriority: the Query Time Priority algorithm (Algorithm 7). PeriodicRefresh: the Periodic Refresh algorithm (Algorithm 5.4). NoRefresh: NoRefresh only generates the least travel path using Algorithm 4, and pushes the corresponding speed patterns into a road network, but does not update the traffic condition. It is equivalent to Algorithm 5.4 with a 1 refresh interval. TPEG: Vehicles equipped with modern navigation systems can find their routes based on the speed of each edge at query time using protocols such as the Transport Protocols Experts Group (TPEG). To simulate a TPEG enabled navigation system, when finding the least travel time path, the speed patterns and travel times of all expanded edges are generated based not on the anticipated arrival time, but on the starting time of it. This is done by changing the second parameter from t0 to t in line 14 of Algorithm 4. All other procedures are the same as in QueryPriority.
A DTDSP query has a different setting from the existing time-dependent shortest path query because a DTDSP query does not assume pre-computed speed patterns on the edges, but dynamically adjusts them based on the vehicle positions. Moreover, a DTDSP query recommends the least travel time paths in a holistic view, but the existing time-dependent shortest path query and its processing algorithm only focus on an individual vehicle given a pre-defined traffic condition. Thus, the existing time-dependent shortest query processing algorithms cannot be compared. Measuring travel time: Once the resultant paths of all vehicles are obtained, the travel times of all vehicles are computed by simulating those paths in the road network. Implementation and running environment: All algorithms were implemented in C++ and compiled by gcc 4.4.5. All experiments were conducted on a 4-core CPU running at 2.33 Ghz with 8 GB of memory. 6.2. Query processing time To see the empirical query processing time, 50,000 vehicles request their best routes from the algorithms listed in Section 6.1. The running conditions are (1) the OL road network, (2) a frequency of 20 cars/s, and (3) a random scenario. Fig. 6 shows the cumulative query processing time at every 5000th query of Landmark, NoRefresh, QueryPriority and ArrivalPriority. The processing time of TPEG is excluded because TPEG is intended to compare the effectiveness with our algorithms, not the efficiency. NoRefresh is as fast as Landmark because it does not get through the adjustment phase to maintain the criterion of a safe distance. QueryPriority exhibits a moderate processing time in that it takes 0.64 s for each query on average. ArrivalPriority shows the worst processing time because it requires exhaustive least travel path finding (calling time_dependent_pathfind()). Although ArrivalPriority consistently suggests the least travel time path, it is hard to solve in tractable time. Thus, in the travel time analysis of the following subsections, we will exclude ArrivalPriority. 6.3. Selecting refresh interval Even though QueryPriority shows a moderate processing time (Section 6.2, it also suffers from a scalability challenge as the number of vehicles or the frequency of query requests increases in a road network. PeriodicRefresh trades effectiveness(travel
Fig. 6. Cumulative query processing time at every 5000th vehicle (X axis: # of vehicles, Y axis: query processing time in seconds).
150
J. Kim et al. / Information Sciences 255 (2014) 135–154
Fig. 7. Trade-off between processing time and global travel time (X-axis: processing time (s), Y-axis: global travel time (s)).
Table 2 The global travel time of Landmark in OL (R: random scenario; C: commuting scenario; unit: 106 s). # Of cars
10,000 20,000 30,000 40,000 50,000
Scenario, frequency (cars/s) R, 20
R, 100
C, 20
C, 100
12.60 28.42 46.08 65.02 84.65
12.84 30.70 51.99 76.48 103.25
18.04 43.64 74.11 107.37 143.38
18.00 45.75 80.23 120.51 165.44
time) for efficiency(processing time) by updating the speed patterns periodically. To find a good interval, we record the processing and global travel times (Section 6.4) by varying the refresh interval as k = 50, 100, 250, 500, 1000, 2500, 5000, 10,000 and 25,000 for the same scenario described in Section 6.2. When k = 1(1), PeriodicRefresh is equivalent to QueryPriority (NoRefresh). Fig. 7 shows the change in processing time and global travel time as refresh interval k decreases from 1 to 1. NoRefresh(k = 1) sacrifices the global travel time for the processing time, while QueryPriority(k = 1) does the opposite. By varying k, PeriodicRefresh adjusts the efficiency and effectiveness between two extremes and finds an elbow point where both efficiency and effectiveness are not compromised. When k = 500, PeriodicRefresh shows only 0.1% more global travel time than QueryPriority and takes only 1195 s to process 50,000 DTDSP queries (NoRefresh takes 538 s). 6.4. Global travel time cost Here, we compare the global travel time, which is the sum of all vehicle travel times described in Section 6.1. We measure the global travel time at every 5000 vehicles for 8 situations: (1) road network type, OL (Oldenburg) and SG (Singapore); (2) random and commuting scenarios; and (3) a vehicle frequency of 20 and 100 cars/s. As a baseline, the global travel time using Landmark is measured for the eight scenarios (Tables 2 and 3). In both road networks, the commuting scenarios take a longer amount of time than the random scenarios for the same frequency. This means that a flooding of vehicles to a specific area easily damages all road network conditions when the vehicles are guided by a classical shortest path algorithm such as Landmark and Dijkstra’s algorithm. We compare the relative global travel time of NoRefresh, PeriodicRefresh, QueryPriority and TPEG to that of Landmark (Fig. 8). In all figures, Landmark’s global travel time is shown to be 1 (Fig. 8). We merge the trend lines of PeriodicRefresh and QueryPriority because they show little difference when an appropriate refresh interval is set. Thus, at the right of the QueryPriority legend, the largest refresh interval of PeriodicRefresh is specified, which shows less than 0.1% of the global travel time overhead (Fig. 8a–h ). Table 3 The global travel time of Landmark in SG (R: random scenario; C: commuting scenario; unit: 106 s). # Of cars
10,000 20,000 30,000 40,000 50,000
Scenario, frequency (cars/s) R, 20
R, 100
C, 20
C, 100
13.99 30.69 49.02 68.39 88.37
14.11 32.49 54.27 78.68 105.20
14.38 32.71 53.41 75.53 98.63
14.75 34.98 59.06 86.57 116.73
J. Kim et al. / Information Sciences 255 (2014) 135–154
Fig. 8. Relative global travel time compared to Landmark (X-axis: # of vehicles; Y-axis: relative global travel time).
151
152
J. Kim et al. / Information Sciences 255 (2014) 135–154
Fig. 9. The average relative individual travel time compared to Landmark (X-axis: group in order of ascending travel time of Landmark; Y-axis: relative average individual travel time).
Overall, our main algorithms, QueryPriority and PeriodicRefresh, show the best global travel time. All algorithms show a greater reduction ratio in the commuting scenarios than in random scenarios. This means that the time-dependent algorithm works well under more congested(commuting) situations. QueryPriority (PeriodicRefresh) outperforms TPEG as the query frequency increases. In scenarios with less frequency, the global travel time of TPEG is about 3% worse than that of QueryPriority and PeriodicRefresh. However, when traffic conditions
J. Kim et al. / Information Sciences 255 (2014) 135–154
Fig. 10. Illustration of finding
153
v2.
get worse such as with increasing frequency, the global travel time of QueryPriority and PeriodicRefresh show over 10% more reduction ratio than that of TPEG. In particular, QueryPriority and PeriodicRefresh reduce by over 30% the global travel time (Fig. 8h). Moreover, in more frequent situations, even NoRefresh shows lower global travel time than TPEG until 30,000th queries. This result tells that anticipating future speed information, even if they are approximated, provides better route than relying on precise current speed information until a certain point. 6.5. Individual travel time cost Even though an algorithm reduces the cost globally, it is not desirable if the cost reduction is concentrated on some members while the others suffer. Most queries, regardless of their travel size, should benefit from our algorithm compared to the baseline method. In this subsection, we evaluate the cost of an individual vehicle. The same scenarios described in Section 6.4 are used. We pick the travel time of each vehicle for all algorithms. Then, the vehicles are sorted in ascending order of Landmark algorithm’s travel time. The sorted vehicles are equally binned into 10 groups, and the vehicles’ travel times of the algorithms were averaged for each binned group. We measure the relative averaged travel time of each binned group provided by NoRefresh, PeriodicRefresh, QueryPriority and TPEG to those of Landmark (Fig. 9). The trend lines of PeriodicRefresh are merged into those of QueryPriority for the same reason of the global travel time comparison. In all scenarios, vehicles with a longer travel time benefit from all four time-dependent algorithms, which is definitely a desirable feature. QueryPriority and PeriodicRefresh show the best reduction ratio compared with their competitors in all cases. In particular, they reduce around 50% of the travel time for the longest travel group. Moreover, for scenarios with high frequency, QueryPriority and PeriodicRefresh enlarge the gap in the reduction ratio as the travel time of Landmark increases. NoRefresh show unstable increase of travel time reduction in certain scenarios (Figs. 9e, 9f, and 9g) owing to an accumulation of erroneous speed information induced by no updates.
7. Conclusion This paper proposed a new problem of (1) a Dynamic Time-Dependent Shortest Path (DTDSP) query; (2) a dynamic speed pattern model, i.e., CPLSP; and (3) the processing algorithms of a DTDSP query. Different from the existing time-dependent shortest path query, a DTDSP query considers the current traffic conditions without assuming pre-determined speed patterns. To models he peed patterns of roads in real time, a CPLSP is dynamically generated based on the criterion in which two successive vehicles always keep a safety distance. Three DTDSP query processing algorithms, Arrival Time Priority, Query Time Priority, and Periodic Refresh, are devised using the CPLSP and a novel admissible heuristic estimator hL ðv ; d; LÞ. Although the Arrival Time Priority algorithm keeps the least travel time path for all vehicles in a road network, it does not solve a DTDSP in tractable time. Thus, we propose the Query Time Priority algorithm, which only slows down the speed patterns of existing vehicles without changing their routes. To further boost the processing time, the Periodic Refresh algorithm updates speed patterns only when a refresh interval expires and it catches both the efficiency and effectiveness with an appropriate choice of refresh interval. Experimental results on real datasets show that the Query Time Priority and Periodic Refresh algorithms substantially reduced the vehicle travel times from both global and individual perspectives.
Appendix A A.1. Proof of Lemma 1 First, to achieve a succinct derivation, let us change the variables (Fig. 10). For a vehicle c, a linear segment of c’s preceding vehicle is hðt1 ; v 01 Þ; ðt 2 ; v 02 Þi, and the first tuple of c’s linear segment is ðt1 ; v 1 Þ. To complete c’s linear segment, we need to obtain v 2 .
154
J. Kim et al. / Information Sciences 255 (2014) 135–154
Because the safe distance between c and c’s preceding vehicle is kept at t1 , the distance between them is ingly, Eq. (6) becomes the following by setting v 21 =2b as d.
1 1 1 2 d þ Dtðv 01 þ v 02 Þ Dtðv 1 þ v 2 Þ ¼ v: 2 2 2b 2 0
Replacing d þ 12 Dtðv 01 þ v 02 Þ with d and reorganizing Eq. (12) in terms of
v 21 =2b. Accordð12Þ
v 2 . We obtain
1 2 v þ Dtv 2 þ ðDtv 1 2d0 Þ ¼ 0: b 2
ð13Þ
To obtain a real solution, the discriminant of the above quadratic equation should be non-negative, i.e.,
1 0 ðDtÞ2 4 ðDtv 1 2d Þ P 0: b
ð14Þ
This above requirement is satisfied as follows:
1 0 ðDtÞ2 4 ðDt v 1 2d Þ ¼ b 0 2v 1 2 4v 21 8d Þ 2 þ ¼ ð Dt b b b ðDt
2v 1 2 8d 8d þ 4Dtðv 01 þ v 02 Þ Þ þ ¼ b b b 2v 1 2 4Dtðv 01 þ v 02 Þ Þ þ > 0: ðDt b b
ð15Þ ð16Þ ð17Þ ð18Þ
References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26]
R.K. Ahuja, T.L. Magnanti, J.B. Orlin, Network Flows: Theory, Algorithms, and Applications, Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1993. M.S. Bazaraa, J.J. Jarvis, H.D. Sherali, Linear Programming and Network OWS, second ed., John Wiley & Sons, Inc., New York, NY, USA, 1990. R. Bellman, On a routing problem, Quarterly of Applied Mathematics 16 (1958) 87–90. C.M. Bishop, Pattern Recognition and Machine Learning (Information Science and Statistics), Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. X. Cai, T. Kloks, C.K. Wong, Time-varying shortest path problems with constraints, Networks 29 (1997) 141–150. I. Chabini, Discrete dynamic shortest path problems in transportation applications: complexity and algorithms with optimal run time, Transportation Research Record (1998). K.L. Cooke, E. Halsey, The shortest route through a network with time-dependent internodal transit times, Journal of Mathematical Analysis and Applications 14 (1966) 493–498. E.W. Dijkstra, A note on two problems in connexion with graphs, Numerische Mathematik 1 (1959) 269–271. B. Ding, J.X. Yu, L. Qin, Finding time-dependent shortest paths over large graphs, in: EDBT ’08: Proceedings of the 11th International Conference on Extending Database Technology, ACM, New York, NY, USA, 2008, pp. 205–216. R.W. Floyd, Algorithm 97: Shortest path, Communications of the ACM 5 (1962) 345. L.R. Ford, D.R. Fulkerson, Flows in Networks, Princeton University Press, 1962. M.L. Fredman, R.E. Tarjan, Fibonacci heaps and their uses in improved network optimization algorithms, Journal of the ACM 34 (1987) 596–615. A.V. Goldberg, C. Harrelson, Computing the shortest path: a search meets graph theory, in: SODA ’05: Proceedings of the Sixteenth Annual ACM–SIAM Symposium on Discrete Algorithms, Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2005, pp. 156–165. A.V. Goldberg, R.F. Werneck, Computing point-to-point shortest paths from external memory, in: Workshop on Algorithm Engineering and Experiments(ALENEX), 2005, pp. 26–40. P. Hart, N. Nilsson, B. Raphael, A formal basis for the heuristic determination of minimum cost paths, IEEE Transactions on Systems Science and Cybernetics 4 (1968) 100–107. E. Kanoulas, Y. Du, T. Xia, D. Zhang, Finding fastest paths on a road network with speed patterns, in: ICDE ’06: Proceedings of the 22nd International Conference on Data Engineering, IEEE Computer Society, Washington, DC, USA, 2006, p. 10. D.E. Kaufman, R.L. Smith, Fastest paths in time-dependent networks for intelligent vehicle-highway systems application, Journal of Intelligent Transportation System 1 (1993) 1–11. A. Orda, R. Rom, Shortest-path and minimum-delay algorithms in networks with time-dependent edge-length, Journal of the ACM 37 (1990) 607–625. I. Pohl, Bi-directional search, Machine Intelligence 6 (1971) 127–140. P. Sanders, D. Schultes, Engineering highway hierarchies, in: Algorithms – ESA 2006, Lecture Notes in Computer Science, vol. 4168, Springer, Berlin/ Heidelberg, 2006, pp. 804–816. D. Schultes, Route Planning in Road Networks, Ph.D. Thesis, Karlsruher Institut für Technologie, 2008. L. Sint, D. de Champeaux, An improved bidirectional heuristic search algorithm, Journal of the ACM 24 (1977) 177–191. K. Sung, M.G.H. Bell, M. Seong, S. Park, Shortest paths in a network with time-dependent flow speeds, European Journal of Operational Research 121 (2000) 32–39. U.D. of Transportation, Ieee 1609 – Family of Standards for Wireless Access in Vehicular Environments (wave), 2009. S. Warshall, A theorem on boolean matrices, Journal of the ACM 9 (1962) 11–12. J.W.J. Williams, Algorithm 232 heapsort, Communications of the ACM 7 (1964) 347–348.