The key to emergency path planning lies in the sudden and real-time changes of the road network conditions. However, the traditional path planning method obviously can not meet the current situation changes of road network. Therefore, a novel situational grid heuristic search algorithm is proposed in this section. This method is used to plan the path of vehicles by considering the changing factors of the current road network. The spatio-temporal characteristic road network is introduced before describing the algorithm.
5.3. Situational Grid Heuristic Search to Path Planning Based on DGPR
Situational grid heuristic search is called SGHS* will be introduced in this section. In
Section 4, we mentioned the principle of the dynamic grid road network, and SGHS* algorithm will carry out emergency path planning for urban vehicles based on this principle.
Figure 7 describes the path planning results of SGHS* algorithm. It can be seen from
Figure 7 that when SGHS* initially selects the path, it will first determine the grid ID of the current vertex. The ranking result of the whole urban road network area obtained by the DGPR algorithm is based on the road network speed. The advantage of the grid is that it can carry out regional management of the urban road network.
The grid of the source vertex is . In the first search, SGHS* will access the adjacent grids. It is worth mentioning that in the original GEMPP framework, the grid search will search eight adjacent grids each time. However, in the actual grid division, although some grids are adjacent, there is no actual road network connection. We call these grids Virtual-Grid, while if there are some of the road network connected with the actual road network is called Entity-Grid. However, only Entity-Grid are accessible in EGEPP framework.
As shown in
Figure 5 and
Figure 7, the green solid line represents the road with higher road network speed, and the grids directly connected with
are
,
,
and
. When DGPR algorithm assigns values to these four grids, the order can be (from
to
congestion)
>
>
>
. When SGHS* gets the grid ID to search, it will be recommended to plan the path preferentially, that to search a path to
, because
has a higher ranking. However, in the actual positioning, it will be found that the vehicle is moving in the direction of thinking the opposite. At this time, a kind of turning back situation is formed. This is not recommended in the actual scene. If the vehicle does not change the direction in time, it is likely to appear a kind of circle phenomenon.
In order to avoid this situation, quaternion function
is designed. The result of
is a flag of TRUE or FALSE, not a numeric value, the non-congested area is TRUE, and the congested area is FALSE.
is the activation function, and only when
is TRUE, SGHS* algorithm will compare the last three function values. When
is TRUE will be discussed in
Section 7.
is the minimal step size between grids. The result is equal to the number of grids between the current search grid and the target grid. The number of steps in a grid is 1. It is noted that the search for step size is an adjacent grid and an
Entity-Grid is a valid grid, and if the
Virtual-Grid is an invalid grid.
is the line between the center coordinate of the current vertex grid and the center coordinate of the next search grid and the angle between the center coordinate of the next search grid and the center coordinate of the target vertex grid. The value of
is the result of DGPR. Equation (5) describes the step function.
where
is the number of searches,
stands for The grid ID of the target vertex,
is the count number from source grid to destination grid. Equation (6) represents the angle formula.
Equation (6) is a formula of the angle between two straight lines. Where slopes which function is the grid center coordinates of the current vertex and the grid center coordinates of the next search grid, is a slope which function the grid center coordinates of the next search grid, and the grid center coordinates of the target vertex (two vertices make a straight line).
Definition 1. Given two and , and two grid ranking values are similar, the step value of , the grid where is located will be preferred as the grid candidate set.
As shown in
Figure 8, both
and
have better traffic capacity, but the step size of
is plus 2 compared with
, i.e.,
, so in the actual path planning, it is equivalent to that vehicles have to detour a long way, which is not accepted in the actually recommended path.
Lemma 1. Given two and , When the activation functions and are all true, the priority of step size is higher than the angle value, and the angle value is higher than the DGPR value.
Proof. Assuming that
is the current starting grid, when only
and
are left as candidate grids, from
Figure 8 can see that
>
, but according to the Euclidean formula, and
>
,
is closer to
D. Next, when
is the current starting grid,
and
are the candidate grids for the next search,
=
,
=
. At this time, it is impossible to determine which grid is the best grid to search. At this time, it is necessary to judge according to the sorting results of DGPR. The higher the value of DGPR, the better the road capacity in the grid. The reason why DGPR has low priority is that when
and
are candidate grids, it is assumed that only the DGPR values of two grids are considered, and when
<
, the vehicle will travel to
grid, which leads to a return or repeated road (for example, the vehicle was previously driven from the
grid to
S grid). □
Definition 2. Given two and , the > ⋀ ≠ , then the grid of is closer to the target grid than the grid of .
From
Figure 8 shows the
>
>
>
,
is adjacent to the target grid, and
is one grid away from the target grid. Then compare
and
. Assuming that the side length of the grid rectangle is 2, the length of
is 4
and the length of
is 2
, 4
< 2
is obviously. Therefore,
is closer to
spatially. The advantage of a square grid is that it’s easy to work the geometric calculations. However, the area of the triangle is not used as a reference function in this paper.
Lemma 2. Given two and are the area values of two triangles, respectively, if is less than , the candidate grid is not necessarily closer to the target grid.
Proof. According to
Figure 8, it can be seen that the area of
,
, and
is equal to that of
when compared, since the area of the triangle can be calculated by the length and height of the bottom side, as can be seen from
Figure 8. The lengths of line segments
and
are equal, and the heights of triangle
and
are line segments
. Therefore, according to the area formula of the triangle, the area of
is equal to that of
. However, the
grid is closer to the
D grid than the
grid in terms of physical distance. Next, the areas of triangles
and
will be compared. According to
, the
grid is closer to the
D grid. However, the area of
is larger than that of
, and the area of
is equal to that of
, so
is larger than that of
. □
Definition 3. Given two candidate grids and , is closer to the target grid when the step size and angle value of function ∂ in is < , > .
According to the candidate grids shown in
Figure 8, the
<
, and the
>
. However, the opposite is not necessarily true. For example, for grids
and
, assuming that there is no
between
and
D,
=
(according to the parallelogram, the diagonal is equal), but the
<
. In the actual road network,
is closer to the target grid
D. In the same way, the
=
, but
>
. According to the diagonal and side length of the rectangle,
is closer to the target grid
. Therefore,
<
,
>
are the necessary and insufficient conditions for
to be closer to the target grid than
, i.e.,
<
⋀
>
⟶
>
(the
>
means that
is recommended higher than
).
The following path planning within the grid will be introduced. A heuristic function to calculate the estimated driving time according to the road network speed. For this purpose, the search graph needs to query the path according to different times. The characteristic of the situational road network is that the weights of the paths that change with time are different. Therefore, our method needs to query the current road network according to the given time window
and return the
s optimal path. So in order to meet the requirements that a search function
will be designed, i.e., Equation (7).
where
represents the actual time from the source vertex to the
nth vertex, i.e., Equation (8).
and
form the currently queried road and
d is destination vertex.
where
stands for the actual time when the vehicle passes through two intersections
and
, i.e., Equation (9).
is the maximum capacity of the road with value range form (0, 1) (detail in
Section 7),
is the distance from
to
, and
represents a value of the average speed of the road from
to
, the value is extracted from the trajectory dataset.
where
=
is a heuristic factor, i.e., Equation (10). Equation (11) uses the Manhattan Distance divided by the average speed
of the vehicle, which is the distance traveled divided by the total time (value of
represents the overall average speed of all candidate paths explored by
plus the paths that the vehicle has traveled). Therefore, it is noted that using this estimation method can better judge the path to be explored in the next step.
The SGHS* method selects a road based on the sum of the actual time of the road plus the estimated time. The value of guarantees that the elapsed time of the vehicle is the smallest of all candidate path usage times, which is guaranteed by the principle of BFS search, i.e., ≤ *. The heuristic function is monotonically decreasing.
Lemma 3. Given a query time window , heuristic path planning methodology is used to find the shortest path subset within time window in G, and when ≤ *, the more close to the target vertex, the fewer vertices are extended.
Proof. There must be the shortest path between any two vertices in a directed connected graph G. Therefore, a subset of the most path must be found within a given query time . Using the heuristic principle, the closer the search vertex is to the target vertex, the smaller the value of will be. When ≤ *, it satisfies the monotonic decreasing property, so in the process of searching for vertices, the repeated search of vertices is prevented. Therefore, the smaller the the fewer vertices to explore. □
where is the Manhattan Distance between two points to d, and represent latitude and longitude, respectively, i.e., Equation (11). we will use the estimated time as the heuristic because vehicles always want to reach their destination in the shortest time.
A BFS search process will perform with
function [
36]. If only one vertex is searched down at a time in this way, the method becomes A* search mode and the searching efficiency is not better. In the SGHS* search process, the only limits were a one time window
. Determine the stopping condition of
by the following Equation (12).
Where
,
is a temp source vertex and temp destination vertex within one grid. It is worth noting that when
<
in the
, the search will continue. The search will stop when
≥
. In this status, the SGHS* must return the previous vertex because the GPS may not be able to collect the vehicle’s current position accurately when the vehicle is driving between two intersections [
35], such as the vehicle entering a tunnel or driving under a bridge. Line 7–12 of Algorithm 3 describe the calculation process of Equation (12):
Algorithm 3 illustrates the path planning process of SGHS*. Line 4 and Line 29 to determine whether the source vertex and the destination vertex are in the same grid. Line 5–27 describes the heuristic search of SGHS*, which includes a pruning strategy, which will be described in detail in
Section 5.4. In
storage, each vertex needs to be searched once. Line 20–23 is calculated by Equations (7)–(10). Line 30–41 describes the search between grids. The purpose of setting the quaternion function
∂ is to select the nearest grid to the target grid as the candidate grid as far as possible when the regional road is clear.
The time complexity of Algorithm 3 is analyzed as follows. When searching from a vertex, the search is started, and unvisited vertices are accessed. In the worst case, every vertex is visited at least once, and every edge is visited at least once. The worst case happens if a vertex is searched downward in the search process, all its children have been visited, and then it will fall back. The time complexity
=
of SGHS* planning between two points is defined, where
n is the number of vertices,
is current vertex and
is search vertex. Therefore, the time complexity is asymptotic
, and the time complexity of SGHS* between source vertex and destination vertex is
.
=
is the time complexity of search grid,
is the number of grid. Finally, the time complexity of SGHS* is
+
=
.
Algorithm 3 SGHS* |
- 1:
Input: , , s, d, s, d, - 2:
Initialization Priority Queue, - 3:
F(n) = G(n) + , n ∈ E , CLOSED = ⌀ - 4:
if Source. == Destination. (Means to make a path planning within the grid) then - 5:
while search do - 6:
get edge pair - 7:
if
then - 8:
Priority Queue = - 9:
return
- 10:
else if
then - 11:
Priority Queue = - 12:
return
- 13:
end if - 14:
G() = - 15:
for Greedy BFS search form v do - 16:
if search then - 17:
Prune - 18:
break - 19:
else - 20:
F() = G() + - 21:
F() = G() + - 22:
compare F() with F() - 23:
return smaller value F() - 24:
end if - 25:
CLOSED = P() - 26:
end for - 27:
end while - 28:
end if - 29:
if Source.grid != Destination.grid then - 30:
do DGPR - 31:
for BFS search , only adjacent are searched do - 32:
if the of candidate grid is TRUE then - 33:
calculation quaternion function ∂ {, , , } - 34:
if candidate > candidate then - 35:
return = - 36:
end if - 37:
if candidate < candidate then - 38:
return = - 39:
end if - 40:
end if - 41:
end for - 42:
set s, d, - 43:
repeat Line 5-27 - 44:
end if
|
5.4. Pruning Strategy
A pruning strategy based on SGHS* will be introduced in detail. The situational road weight is constantly changing.
Figure 9 shows the pruning strategy results of the SGHS* algorithm. A vehicle in
Figure 9 drives from
S vertex to vertex
D. Assuming that vehicles start from vertex
S, the searchable edges are
,
, and
, respectively. According to the search strategy of SGHS*, priority will be given to the road with the highest speed. However, the situation of the road network is changing at the moment, and in the context of emergencies that SGHS* hopes to search more paths as alternative paths for vehicles. Therefore, according to the query time window
, the intersection vertex set that the vehicle can travel to is determined as the candidate path. In other words, the actual travel time can be obtained according to the known road length and road network speed, and the obtained time is compared with the query time window
. If
is not exceeded, the algorithm continues to search downward. If
is equal to or exceeds the time
, the search stops and returns to the candidate vertex. At this time, we delete the vertices that have not been searched from the priority queue, which is called the pruning strategy of SGHS*.
For example, the undirected graph has a high speed of edge
in
Figure 9, SGHS* will continue to search down to
vertex if it does not exceed the query time window
when searching
vertex. The speed of
and
is low, so SGHS* judges that the time of driving these paths exceeds
, so the three adjacent edges of vertex
and one edge of
will not be searched. In this way, the EGEPP framework can not only search more intersections in case of emergency but also delete the congested roads from the candidate paths. Equation (12) describes SGHS* calculates whether the time taken by the vehicle to drive the candidate path exceeds the given time window
. It is worth noting that SGHS* will assign a label to each searched vertex, indicating that the vertex was relaxed at that time, which greatly reduces the time cost of searching. For example, if the vertex
in
Figure 9 is accessed by SGHS* during searching,
will not be searched when
is relaxed.
Figure 10 describes the path planning results of the SGHS* algorithm (purple solid line), Dijkstra breadth-first traversal algorithm (blue solid line), and RTA* algorithm (green solid line). The purple solid line (
→
→
→
→
→
→
→
→
→
→
→
→
→
→
) represents the through number of vertex result of SGHS*. Although SGHS* passes through more intersections, which means that the driving time will be longer than that of the path with fewer intersections, the selectivity of the path is better than that of the other two algorithms. That is to say, the vehicle can choose to drive in other directions to bypass the congested area at the intersection. Therefore, the path planned by Dijkstra breath first and RTA* is larger than that planned by SGHS*.