Dynamic Path Planning of Emergency Vehicles Based on Travel Time Prediction

Thedynamicpathsplanningproblemofemergencyvehiclesisusuallyconstrainedbythefactorsincludingtimeefficiency,resources requirement,andreliabilityoftheroadnetwork.Therefore,atwo-stagemodelofdynamicpathsplanningofemergencyvehicles isbuiltwiththegoaloftheshortesttraveltimeandtheminimumdegreeoftrafficcongestion.Firstly,accordingtothedynamic characteristicsofroadnetworktraffic,apolyline-shapedspeedfunctionisconstructed.Andthen,basedonthereal-timeand historicaldataoftravelspeed,anewkernelclusteringalgorithmbasedonshuffledfrogleapingalgorithmisdesignedtopredictthe traveltime.Secondly,combinedwiththeexpectedtraveltime,thetrafficcongestionindexisdefinedtomeasurethereliabilityof theroute.Thirdly,aimedattheproblemofsolvingtwo-stagetargetmodel,atwo-stageshortestpathalgorithmisproposed,which iscomposedof 𝐾 -paths algorithm and shuffled frog leaping algorithm. Finally, based on the data of floating vehicles of expressway in Beijing, a simulation case is used to verify the above methods. The results show that the optimization path algorithm meets the needs of the multiple constraints.


Introduction
With the construction of urbanization and the increasing traffic vehicles, the frequency and impact of traffic accidents are intensifying.The research on emergency rescue is getting more and more attention.When traffic accident occurs, rescue timeliness is the key to emergency rescue.Reasonable arrangement of emergency vehicle path can avoid congestion and shorten the travel time, so that the accident loss can be reduced.Thus, the problem of path planning of emergency vehicle belongs to dynamic path planning problem (VRP) essentially.
Regarding the minimum route distance as the target, Khouadjia et al. [1] proposed a method based on particle swarm optimization and variable neighborhood search paradigms to solve the dynamic vehicle routing problem; Secomandi [2] compared the performance of two neurodynamic programming algorithms to solve the vehicle routing problem with random demand.With the objective to minimize total travel time, Dapia et al. [3] proposed a branch-andprice algorithm to solve the time-dependent vehicle routing problem with time window; Cheung et al. [4] proposed a method based on genetic algorithm to solve the problem of dynamic fleet management; Montemanni et al. [5] examined the dynamic vehicle routing problem and proposed a solving strategy based on the Ant Colony System paradigm.With the objective to minimize total route cost, Li et al. [6] developed Lagrangian relaxation based-insertion heuristics to solve the vehicle rescheduling problem (VRSP).Hong [7] proposed an improved large neighborhood search algorithm to solve the dynamic vehicle routing problem with hard time window.With the objective to maximize the expected profit, Azi et al. [8] proposed a solving strategy based on the adaptive large neighborhood search heuristic algorithm to solve the dynamic vehicle routing problem with multiple delivery routes; Moretti et al. [9] made use of a new constructive heuristic that scatters vehicles in the service area and an adaptive granular local search procedure to solve the dynamic vehicle routing problem with a time window; Campbell and Savelsbergh [10] proposed an algorithm based on insertion heuristics to solve the dynamic vehicle route problem.In terms of multiple objectives, Kergosien et al. [11] studied the dial-a-ride problem by using tabu search algorithm with the objective of minimizing the total cost in the network could be obtained.Bellman [16] and Ford and Fulkerson [17] proposed Bellman-Ford algorithm, which was used to solve the shortest path problem with negative edge weights.Hart et al. [18] proposed a heuristic search algorithm,  * algorithm, for solving the static shortest path problem.
Secondly, the emergency vehicle path planning must consider the dynamic time-varying characteristics of traffic flow, and then the shortest path problem is transformed into the dynamic shortest path problem.Cooke and Halsey [19] improved the Bellman-Ford algorithm to solve the shortest path problem of time-dependent network based on the discrete weight assumption by iterative method.Kaufman and Smith [20] proved that the classic shortest path algorithm could be used to solve the dynamic shortest path problem only when network meted the FIFO criteria.Nannicini et al. [21] proposed a bidirectional searching  * algorithm to solve the dynamic shortest path problem of FIFO network, which applied the lower bounds of link weights to constrain the path series obtained by forward searching originating from the destination node.The solving performance had been significantly improved in this way.Delling and Nannicini [22] extended the heuristic algorithm of solving the pointto-point shortest path to the dynamic network and obtained the efficient algorithm by selecting the subnetwork.Lin et al. [23,24] proved that the shortest path problem of timedependent network was a NP-Hard problem and put forward the concept of shortest path stability from three aspects including length stability of shortest path, optimal solution stability, and stable subbranch.And then he designed an efficient algorithm to reduce the repetitive computation by using stable information.Zhao et al. [25] aimed at the time-dependent characteristic of the highway network and proposed a novel particle swarm optimization algorithm to solve the time-dependent (dynamic) shortest path problem.The algorithm uses a way of adjacency matrix search to generate particle swarm satisfying constrains of the problem during the whole calculation.These algorithms mentioned above used road section travel time obtained by historical data or forecasting method for dynamic path planning and path choice.And then the real-time travel time forecasting becomes the key technology of path selection in dynamic traffic assignment.
Thirdly, as the vehicle routing has to make a decision in advance, it will be affected by uncertainty factors whether real-time data or forecasting data is used.If the effect caused by uncertainty factors (weather, traffic congestion, traffic events, etc.) was ignored, the shortest path find by the algorithm will be not reliable.Therefore, emergency vehicle scheduling must take into account the uncertainties affecting on the dynamic characteristics of traffic flow.Sun [27] used the reliability level to characterize the dynamic characteristics of vehicle path planning.The real-time speed was transformed into reliability based on the vehicle velocity distribution.This method solved provided suggestions for residents to travel.Mendoza et al. [28] solved the multicompartment vehicle routing problem with stochastic demand by memetic algorithm.Lu et al. [26] developed bicriterion dynamic user equilibrium model, which aims to capture users' path choices in response to time-varying toll charges.In summary, the dynamic vehicle routing planning based on real-time information always adopted the periodic updating mechanism.It is difficult to obtain the global optimal solution of the whole decision cycle without fully considering the change of the travel time while the emergency vehicle went to the accident location.However, the emergency rescue vehicle routing planning is different from the ordinary dynamic path planning and choice problem.It is necessary to consider the dynamic time-varying characteristics of road network traffic, the constraints of emergency resource requirements, the restraint of rescue time, and the reliability of the path.
Therefore, the research content and framework of this paper are shown in Figure 1.Firstly, a polyline-shaped travel speed function is constructed.A SFLA-KC fusion algorithm is proposed to predict the travel time based on the real-time and historical speed sample sequences.Considering the constraints of time and resource requirements, the shortest travel time is taken as the objective.Then, combining the expected travel time and forecast travel time, the degree of traffic congestion is defined, and the minimum degree of traffic congestion is established as the second objective.Then, a two-stage emergency vehicle path planning model is established.The model is solved by SFLA-KSP    algorithm, and the optimal path is obtained based on the  shortest paths.

Model Establishment in Dynamic Paths Planning of Emergency Vehicles
Dynamic paths planning of vehicles should consider the factors including travel time of vehicles, resources demand of emergent events, and the reliability of chosen route.3, which is defined as a polyline-shaped travel speed function.

Dynamic Travel
It is assumed that the emergency vehicle path planning cycle is TS.Taking Δ as the minimum time interval, TS is divided into Φ discrete time intervals TS = {[( 0 + ( − 1)Δ), ( 0 + Δ)]}, where  = 1, 2, . . ., Φ and  0 is the initial time.Assume that TS Φ =  0 + ΦΔ is the last moment which is supposed to be large enough for emergency vehicles to arrive at the accident node in [ 0 , TS Φ ].Since, at the initial decision moment  0 , only the real-time speed can be obtained.
It is necessary to fuse and predict real-time speed and a large number of historical vehicle speed data at the corresponding time in history to predict and obtain the speed in other time of the cycle TS.Assume that the length of the link (  ,  +1 ) is  ,+1 , real-time link speed is V  ,+1 ( 0 ) at the moment  0 , and the predicted travel speed of the moment The travel speed function is expressed as follows: (1)

Construction of Dynamic Travel Time Predicting Function
it is surely integrable in this interval, when an emergency vehicle enters link (  ,  +1 ) at the moment of  ( ≥  0 ) and leaves at the moment of   ( ≤   ≤ TS Φ ).The function of travel distance is where where  1 ,   ,  = 2, 3, . . ., Φ − 1 is the integral constant, which can be obtained through the continuity of the original function of V ,+1 ()  0 .Let formula (2) be equal to the length of the road  ,+1 ; then the departure time   of emergency vehicles out of the link is where  is the inverse function of .

Degree of Traffic Congestion Function of Route.
As for emergency vehicle route selection, it is necessary to ensure the reliability.A concept of degree of traffic congestion is defined to measure the reliability of route.While the degree of traffic congestion is lowe,r the selected route is more reliable.When the traffic density of link (  ,  +1 ) is low and the emergency vehicle is under free-flow condition, the travel speed is close to the value of the speed limit and the expected link travel time is TD ,+1 .For the path ∏ −1 = (  ,  +1 ) originating from source node   to the destination node   , the emergency vehicle enters the link (  ,  +1 ) at the moment  and departure after  ,+1 ().
The travel time delay of the link(  ,  +1 ) is The degree of traffic congestion of route ∏  = (  ,  +1 ) is defined as )): at the initial decision moment  0 , the degree of traffic congestion of route   ( 0 )   max ( 0 ): at the initial decision moment  0 , the upper limit of rescue time of accident Ac  : a constant value which is large enough   ( 0 ): at the initial decision moment  0 , if the latest rescue time of accident Ac  is out of the time limit,   ( 0 ) = 1; otherwise   ( 0 ) = 0 The two-stage path planning model of emergency vehicles is built as follows: (  ( 0 )) = min  ( (  ,  1 ) , . . ., (  ,  +1 ) , . . ., ( −1 ,   ) ∈ , ,  1 , . . .,   , . . .,  −1 ,   ∈ , Formula ( 8) is the objective function of emergency vehicle schedule, consisting of the travel time of the emergency vehicle Ev  heading to the accident Ac  and the punishment caused by the rescue time limit surpassing.Since emergency rescue is restricted with time limit, the expected rescue time is set and the punishing time can be increased if it failed to arrive at the accident location on time.
Formula ( 9) is the constraint of accident demand, which enables the emergency vehicles to satisfy the demand of accident Ac  ∈ AC.
Formula (10) is the constraint of emergency vehicles, and the emergency vehicle Ev  is either idle or heading to the accident Ac  .
Formula (11) is the constraint of vehicles number, and the total number of emergency vehicles heading to accident and being idle is .
Formula ( 12) is the objective function of the first stage of emergency vehicle schedule, making the travel time of route minimum.
Formula ( 13) is the objective function of the second stage of emergency vehicle schedule, making the degree of traffic congestion of route minimum.

Travel Speed Prediction Based on SFLA-KC Algorithm
The obtaining of the link travel speed function depends on the statistical analysis of a large amount of historical data.In a certain time and space, the link travel speed is continuously changing with time.The adjacent multiple collecting cycles form time series and travel speed data of the time series constitute samples in order.It is possible to obtain the trend of the travel speed by judging the similarity between the samples in order, and then the speed value of next cycles can be estimated.This paper clustered the ordered samples, which have the similar trend of the link speed and introduced the shuffled frog leaping algorithm into kernel clustering method.This method uses excellent global searching ability of shuffled frog leaping algorithm to expend the searching scale to the whole sample space, thus obtaining the optimal cluster center and matching the similarity of real-time data and all types of samples.Finally, the real-time and time-varying travel speed can be fused. where 1 The th sample belongs to the first  cluster 0 The th sample does not belong to the first  cluster. ( The clustering center   is the decision variable of the optimization problem.The input space   is the decision space of the optimization problem, while the optimization target of the problem is to minimize the value of the clustering criterion function.
The flow of SFLA-KC algorithm is shown as follows.

Construction of the Kernel Mapping Matrix.
The kernel mapping matrix is obtained after the kernel function mapping between the samples.The Gauss kernel function is adopted and the form is where  is a customized parameter.The kernel function is calculated for any two input samples    ∈   , and the kernel mapping matrix is constructed: The adaptation function of frog   is Based on the coding scheme above, the clustering result is initialized.while the frog ethnic group can be guided by its fitness function and evolved continuously.Finally, the clustering results converge to the optimal one.

Composition of Travel Speed Sample Vectors.
The clustering analysis of the samples is to obtain the variation regularity of the link travel speed in a time series, so as to predict the travel speed at the following time, based on current travel speed.Therefore, several consecutive acquisition cycles [ 0 − Ψ 1 ⋅ Δ,  0 + Ψ 2 ⋅ Δ] before and after the moment  0 are chosen to obtain travel speed as the sample vector.Then the sample vector   can be expressed as follows: where V  () shows the travel speed of the link at moment  in the sample   .Mechanism.The matching between the samples to be measured (real-time travel speed) and the class sample (time-varying travel speed) is achieved by the nearest neighbor mechanism.Assume that each subclass of the sample set is clustered at the center   = (V  ( 0 − Ψ 1 ⋅ Δ), . . ., V  ( 0 + Ψ 2 ⋅ Δ)),  = 1, . . ., .For the sample  = (V( 0 −Ψ 1 ⋅Δ), . . ., V( 0 − 1 ⋅Δ), . . ., V( 0 )) to be tested, it is measured according to Euclidean distance:

Real-Time and Time-Varying Similarity Matching
In the class sample set, the nearest sample to the sample  is selected as where  is the total number of samples included in the nearest neighbor sample set.
The travel speed at the  2 th moments where 1 ≤  2 ≤ Ψ 2 after the decision moment  0 can be estimated as

Dynamic Path Planning Based on Two-Stage Shuffled Frog Leaping Algorithm
When the dynamic network satisfies the FIFO condition, the shuffled frog leaping algorithm shows good performance of parallel computing and can obtain multiple paths [34] with relatively short travel time.According to the two-stage target optimization model in Section 2, a shuffled frog leaping  shortest path algorithm was proposed, and the process is as follows.

Coding Scheme and Fitness Function.
Coding is a kind of mapping from the decision space of the optimization problem to the searching space of the shuffled frog leaping algorithm.The searching spaces are subsets of integer spaces.Therefore, it needs to be mapped to the integer space according to the characteristics of the decision variables.The decision vector of the dynamic shortest time path model is the path selection scheme (  , . . .,   ,  +1 , . . .,   ) from the emergency vehicle sourced node   to the accident node   , where the link of the adjacent nodes (  ,  +1 ) ∈ ,   ,  +1 ∈  ⊂  + . + is the positive integer set.A random integer coding scheme is proposed to ensure that the path sequences corresponding to individual frogs satisfy the connectivity.The scheme is shown as follows.
The set of adjacent nodes of the node   is defined as   ⊂  + ; the current path sequence is CP  = {  ,  1 , . . .,   }.According to formula (34), after selecting a node randomly from the set   =   ∩ CP  as a valid node  +1 and updating the current path sequence as CP +1 = {  ,  1 , . . .,   ,  +1 }, the position code of the frog   = {  , . . .,   ,  +1 , . . .,   } can be formed by searching the node one by one till the accident node   .
According to the first-stage objective function of the dynamic optimal path model, the adaptation function of the SFLA-KSP algorithm can be defined as follows: 4.2.Two-Stage Shuffled Frog Leaping Algorithm.The twostage shuffled frog leaping algorithm for solving the dynamic path planning is based on the SFLA-KSP algorithm to find the  optimal paths and obtain the optimal one by taking path degree of traffic congestion as the goal.

The Frog Ethnic Group Initialization.
According to the random coding scheme,  frog ethnic group is generated consisting of  individuals in the decision space, ensuring that each frog code   = (  , . . .,    ,   +1 , . . .,   ) is an available path from the source node   to the accident node   of emergency vehicles.

Adaptation Function Value Calculation.
According to formula (35), the adaptation values of  frogs (  ) are calculated, the location  of the optimal frogs was marked, and the  frogs were sorted according to the adaptation function values.

Grouping and Optimization of Ethnic Group.
The frog ethnic group is divided into several individual groups.For each ethnic group, the following iteration process is repeated for certain IT times.
Step 2. From the first overlapped node, compare the travel time    of the path (  , . . .,    , . . .,   ) and the travel time    of the path (  , . . .,    , . . .,   ) and update the flag bit according to the following formula: Step 3. If   = 2, then randomly generate a path from the node  −1 (flag bit   = 1) to the node   to replace the subpath in  and form a new frog code   .
Step 5.If the adaptation  is still better than   , replace  with the global optimal frog  and repeat Steps 1-4.
Step 6.If the adaptation  is still better than   , randomly generate a path connecting node   and the accident node   in the decision space to replace .

Global Information Exchange.
Remix the ethnic groups after optimization within the group and sort and remark them as .Then execute the process of next grouping and local search until IT times of global iterations are completed.

Degree of Path Traffic Congestion Calculation.
According to formula (13), the degrees of traffic congestion   of the th shortest path ∏ −1 = (   ,   +1 ),  = 1, . . .,  are calculated and the best one is selected as the optimal solution.[35].In this paper, we select expressway network of Beijing as the research object, and use GPS data obtained from more than 20,000 taxis to verify the model and algorithm.The main data include time, latitude, longitude, driving angle, and travel speed.Examples of emergency vehicles and accidents distribution are shown in Figure 5, where the number of emergency vehicles EV = 8 and the number of accidents AC = 3. Accident parameters are shown in Table 1, emergency vehicle parameters are shown in Table 2.

Prediction of Link Travel
Speed.Take the speed data (30 days) of link( 2 ,  3 ) during November 2015 as input samples  and the one of December 1, 2015-December 20, 2015, as the samples to be tested.The minimum time interval Δ = 5 min was selected, assuming that the emergency vehicle must arrive at the accident point within 40 minutes, which means that the objective time period is TS = { 0 + Δ,  0 + 2Δ, . . .,  0 + 8Δ}.The SFLA-KC algorithm was used to fit the travel speed curve of each sample in 0:00-24:00.The sample feature vector   consists of the initial time  0 and the time-varying travel speed of three cycles before  0 .The mean absolute error of predicted values and the actual values of test samples in 0:00-24:00 of December 1, 2015, were calculated and then compile statistics to obtain the relationship between the test sample error and the number of cluster, which is shown in Figure 6.
As is shown in Figure 6, the mean absolute error reaches minimum when the number of clusters is 7, and the mean absolute error increases with the number of cluster centers increasing.Therefore the optimal number of clusters is 7.
Based on the parameters above, the SFLA-KC algorithm is used to estimate the travel speed of 20 test samples of sections during 0:00-24:00 and the estimated values are compared with the actual values.One of the predicted speed curves is shown in Figure 7.The average absolute error of samples during 0:00-24:00 is shown in Table 3.
According to Figure 7, it can be concluded that SFLA-KC algorithm test results are consistent with the actual values.It can be seen from Table 3 that the mean absolute error of the 20 test samples is reduced by about 2 km/h after SFLA-KC algorithm optimization, and the reduction rate was 39%.Therefore the SFLA-KC algorithm can effectively reduce the error of the test results and show better performance than the kernel clustering algorithm when estimating travel speed.

Dynamic Path Selection of Emergency Vehicles.
Based on the predicted travel speed of links collected every 5 min during 8:00-9:00 of December 1, 2015, the travel speed function is fitted and the travel time function of the road is further calculated.Based on SFLA-KSP algorithm, the  shortest paths of each emergency vehicle corresponding to each accident is calculated with the weight of the link travel time function, and the optimal path is selected according to (13).The parameters of SFLA-KSP algorithm are shown in Table 4.The emergency vehicles optimal paths can be obtained by running the two-stage shuffled frog leaping process as shown in Table 5, where the sixth column and the seventh column are separately the shortest paths and travel time of the dynamic traffic arrangement algorithm [26] calculated by use of the DTALite software [36].Based on Table 5, the optimal paths of two methods are the same.However, due to the prediction accuracies of two algorithms, the travel time results are different.
After solving the model, it can be seen that there are two paths for the seventh vehicle heading to the third accident, and the parameters of expected travel time and predicted travel time of path  57 →  33 →  32 →  18 →  7 →  1 →  50 are shown in Table 6.
Based on the parameters in Table 6 and formula (13), the degree of traffic congestion of path  57 →  33 →  32 →  18 →  6 →  1 →  50 is 0.39, while the degree of traffic congestion of path  57 →  33 →  32 →  18 →  7 →  1 →  50 is 0.81.Therefore, the optimal path for vehicle Ev 7 (at the node  57 ) heading to accident Ac 3 (at the node  50 ) can be determined as the optimal path.In addition, dispatching the fourth vehicle for the first accident, the rescue time and the path can be optimal.Dispatching the fifth vehicle for the second accident, the rescue time and the path can be optimal.Dispatching the first vehicle and the eighth vehicle for the third accident, the rescue time and the path can be optimal.

Conclusions
Rapid dispatching of emergency vehicles is the core to rescue traffic accidents and reduce losses.This paper proposed that the emergency vehicle scheduling must be based on the dynamic change of the expressway network with reliable dynamic path selection as the guarantee and the actual shortest response time as optimization goal.
Firstly, the polyline-shaped speed function is defined to simulate the time-dependent dynamic change of the traffic conditions by using the time-dependent speed function of the expressway network.And a new SFLA-KC algorithm is proposed based on the real-time and historical data.The first-stage target of minimum travel time is determined and the travel time prediction can be realized considering the constraints of rescue time and resources demand.
Then, the path planning of emergency vehicles should take the traffic congestion into consideration.Based on the shortest path model, the index of degree of traffic congestion was defined to measure the reliability as the second-stage target, thus constructing the two-stage optimization model.
Next, a two-stage shuffled frog leaping algorithm with SFLA-KSP algorithm as the core is proposed.The random integer coding scheme is used to design the internal optimal strategy of the FIFO network to solve the model.The congestion index is used for optimization searching to obtain the th optimal paths with shortest travel time.
Finally, based on the data of floating vehicles in Beijing, the validity of SFLA-KC algorithm and two-stage shuffled leapfrog algorithm is verified by examples.The results show that the prediction error of SFLA-KSP algorithm is relatively low and two-stage shuffled frog leaping algorithm can search and obtain the optimal path effectively and rapidly.

Figure 2 :
Figure 2: Time-dependent function based on travel speed.

Figure 5 :
Figure 5: Distribution of the accidents and emergency vehicles.

Figure 6 :Figure 7 :
Figure 6: Relationship between the number of clusters and the test errors.
AC and AC is the total number of accidents   ( 0 ): at the initial decision moment  0 , the travel time of the emergency vehicle Ev  heading to the accident Ac    ( 0 ): at the initial decision moment  0 , if the emergency vehicle Ev  head to the accident Ac  ,   ( 0 ) = 1; otherwise   ( 0 ) = 0    ( 0 ): at the initial decision moment  0 , the route of emergency vehicle Ev  heading to accident Ac  (  ( 0 )2.4.Dynamic Path Planning Model of Emergency Vehicles.The parameters involved in the emergency vehicle path planning model are defined as follows:Ev  : the th emergency vehicle, where  = 1, 2, . . ., EV and EV are the total number of emergency vehicles Ac  : the th accident, where  = 1, 2, . . .,  ( 0 ): at the initial decision moment  0 , the total number of the emergency vehicles required for accident Ac    ( 0 ): at the initial decision moment  0 , if the emergency vehicle Ev  has not head to the accident Ac  and is idle,   ( 0 ) = 1; otherwise   ( 0 ) = 0

Table 3 :
Test errors of the SFLA-KC and the kernel clustering algorithm.