# Research on Optimal Route Planning for Self-Driving Tour Based on Road Network Structure

Authors: Ping Zong; Yao Han; Chenbo Xu
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Today’s social and economic development continues to improve people’s quality of life, and private cars are widely popularized, and self-driving tours have developed. The rapid development of self-driving travel has played an important role in the development of the national economy, and self-driving travel has become popular. Because the development of self-driving tours has caused some problems, the road network structure has become more and more complex, and the roads have become very congested. Especially during the holidays, there are more private cars in tourist attractions and the roads are more congested. How to use the information of roads and attractions and then choose the optimal travel route becomes particularly important. In response to this problem, we first analyze the topology of the road network, then analyze the accessibility of scenic spots and related factors that affect self-driving travel, and use the A∗ algorithm, Dijkstra algorithm, and other calculation methods to calculate the optimal path. The experiment found that there are many influencing factors of self-driving travel, and the road network structure has the greatest influence on it. The A∗ algorithm has obvious advantages over the Dijkstra algorithm.


---

## Body

## 1. Introduction

With the continuous development of the global economy, people’s demand for tourism is increasing [1], and the tourism destination focuses on the scenic spots in surrounding cities, expanding to neighboring provinces, cities, countries, and even the world. However, there is no more complete and systematic tourism route planning scheme. Therefore, this study hopes to give relevant recommendations according to the needs of tourists and plan the optimal route according to the departure and destination given by tourists [2].Up to now, a large number of scholars have studied the related issues of tourism routes. Some scholars use the correlation function of travel time and travel cost to represent the tourist utility, because they find that the degree of crowding has an important impact on the tourist experience [3]; some scholars use A∗ algorithm [4], Dijkstra algorithm and other calculation methods [5], Floyd algorithm [6], “breadcrumb” fitting [7], and other research methods to plan travel routes [8].


## 2. Materials and Methods

We first analyze the road network structure and then calculate whether it is reachable or not. Combined with the relevant factors that affect the self-driving tour, a variety of algorithms are used to find the shortest path.


### 2.1. Results and Discussion

The experiment found that there are many influencing factors of self-driving travel. The road network structure has the greatest influence on it. The A∗ algorithm has obvious advantages over Dijkstra’s algorithm.


### 2.2. Topological Structure Quantitative Index

This study aims to help the self-driving tourists to find a suitable travel route and to avoid spending a lot of time on the road. It also aims to effectively reduce traffic problems and reduce traffic congestion caused by holidays. Every holiday, the travel experience of tourists is often affected by traffic congestion, and it is not convenient for local residents to travel.There are several common road network structures. A-side format: there are vertical or horizontal near-parallel roads at regular intervals. B circular radial: it consists of several circular roads connected to each other. C freestyle: the terrain is complex and has no fixed geometry. D mixed type: it is a combination of the above forms.There are two methods for road network topology: path structure analysis and space syntax. Considering various spatial factors, this research mainly analyzes road network topology from the perspective of space syntax. In order to be applicable to various road networks, this study selects two indicators: comprehensibility and integration.Comprehensibility: it refers to the coordination degree of the local and the whole of the road network [9].Integration degree: the degree of scattered or dense distribution between road sections is an indicator of whether the road is congested or not. The greater the degree of integration, the more concentrated the roads, which means the more the center can be deviated and the more traffic can be attracted. The integration degree can be divided into global and local integration degrees: the global integration degree represents all road relationships of a complete road segment, and the local integration degree represents the road segment relationship of a partial area of a complete road segment, which are calculated as follows:(1)RAx=DMx−1n/2−1,AR=nlog2n/3−1+1n−1n−2/2,Intergrationx=ARRAx.In the formula,n is the number of axes; DM is the average depth; RA is the relative asymmetry; AR is the relative asymmetry value of the diamond-shaped topology; Intergration is the degree of integration.Modern transportation is becoming more and more developed, and the road network structure is very complex. People who travel to other places are not familiar with the road network structure, and it is easy to make mistakes. Some tourists drive to Chongqing to travel, but they are not familiar with the road. They choose to follow the navigation and cannot find the place they want to go. In order to effectively avoid such situations, we analyze the road network structure and then avoid areas with complex road network structures, so that self-driving tourists can find suitable roads and scenic roads.


### 2.3. Accessibility Calculation

The different scenic spots to be visited by the self-driving tourist will have corresponding impacts on different groups of people and different vehicles. For example, if the road you are going to is uneven, there is deep water, and there are many mountain roads, it will be difficult for ordinary vehicles to travel, and off-road vehicles are required to pass normally. People who do not have an off-road vehicle will have a lot of problems driving to it, and even the car will break down halfway down the road. Computational reachability is designed to avoid such problems.By calculating the distance traveled on the GIS grid to deduce the accessibility [10] and fully considering various factors such as mountains and waters that hinder the movement, the accessibility to a certain location in the region can be better simulated. The weighted distance from one place on the GIS grid to another on the grid is calculated. This algorithm is a cumulative cost distance algorithm. The calculation formula is as follows:(2)Ki=12∑i=1nCi+Ci+1,22∑i=1nCi+Ci+1.In the formula, the time cost of thei-th pixel is Ci; the time cost of the i + 1-th element along the movement direction is denoted by Ci+1; n represents the total number of pixels; the scenic spot accessibility of the i-th grid is denoted by Ki. The above formula is used to calculate the time cost in the horizontal or vertical direction of the grid surface, and the following formula is used to calculate the time cost in the diagonal direction of the grid surface.


### 2.4. Relevant Factors Affecting the Destination of Self-Driving Tours

The cost factors affecting the self-driving tour are as follows: ① gasoline cost: for ordinary private cars, highways are more than 1 yuan/km, and ordinary kilometers are 0.6 yuan/km (excluding ordinary toll roads). ② accommodation fee: the level is suitable for each person, and the standard room is 100–150 yuan per day. ③ meal fee: the amount varies from one person to another, generally speaking, about 60 yuan per person. ④ tickets: the price varies, so it is not easy to calculate; in many places, the elderly are free or half price, but tickets are still required for sightseeing cars and ropeways.


#### 2.4.1. Tourist Factor

The scoring indicators of each scenic spot are mainly the data on major tourism websites and the data of travel notes learned by tourists [11]. The formula is as follows:(3)ti=∑j=1snijxijni.where the evaluation of thej-th tourist of the tourist attraction i is represented by xij, the number of useful comments of the j-th tourist of the i-th tourist attraction is represented by nij, the sum of the useful numbers of the i-th tourist attraction is represented by ni, and the weighted score of the tourists of the i-th tourist attraction is expressed by ti.


#### 2.4.2. Environmental Factor

It is the score data of tourists on the scenic spot environment, which is divided into very poor, poor, average, good, and very good. It is set to 1, 2, 3, 4, and 5 points [12]. The formula is as follows:(4)yi=14∑j=14Xj,i=1,2,…,n,where the three factors of scenic spot environment, traffic, and infrastructure are denoted by Xj, the comprehensive score of the i scenic spot environment is denoted by yi, and n is the number of n scenic spots.


#### 2.4.3. Road Factor

Relevant studies have shown that tourists prefer to travel to areas where the spatial distribution of attractions is more concentrated, which is convenient for travel. The accessibility of measuring the spatial distance is expressed by the spatial distance formula, and the formula [13] is as follows:(5)Ai=∑j=1nlij.Among them, the minimum distance between two scenic spots (i, j) is respresented by lij, and the sum of the distances from the i scenic spot to the rest of the scenic spots is represented by Ai, and the number of scenic spots is n.


### 2.5. Reverse Order Recursion Model

The travel process is divided into six stages, each stage is represented byk, and S is used to represent the k-stage bit; that is, s is a dynamic variable [14], and the k-stage route is selected as Xk. The state transition equation is as follows:(6)Sk+1=Sk−Xk.fx indicates Sk the cost of the k-stage to the end point, and vk represents the k-stage distance. The recursion formula is as follows:(7)fx=minvk+fk+1,k=6,5,4,3,2,1,where xk∗ represents the optimal decision; when the boundary condition k = 7, f7 = 0. The reverse order recursion equation is as follows:(8)fkSk=mindSk,uk+fk+1=Sk+1,k=6,5,4,3,2,1;f7S7=0.Matlab is used to find the shortest path from the first to the sixth stage, and the following is obtained:(9)f1A=mindA,C+f2C,dA,D+f2D.


### 2.6. Dijkstra Algorithm to Solve the Optimal Path

Dijkstra’s algorithm is an efficient algorithm for solving the shortest path [15], and this study expresses its algorithm in the form of a flow chart. Dijkstra’s algorithm will create two node sets during the search process, open, and closed sets. The closed set represents the shortest node set to the target point, and the open represents other nodes. The starting value of the source node is 0, and the weight of other nodes is ∞. When the target point reaches the closed set, the search is completed. The flow chart is shown in Figure 1.Figure 1
Flow chart of Dijkstra algorithm.


### 2.7. DV Algorithm to Find the Optimal Path

DV algorithm, also known as Bellman-Fords routing algorithm [16], can also be used for shortest path solution. The Bellman-Ford equation is as follows:(10)dxy=minvcx,v+dvy.In the above formula, the weight from nodex to node v is denoted by cx,v, the weight of the shortest path from node x to node y is denoted by dxy, and the weight of the shortest path from node v to node y is denoted by dvy.A, B, C, D, and E represent nodes, andc and d represent paths. Figure 2 is a schematic diagram of the Bellman-Ford algorithm.Figure 2
Schematic diagram of Bellman-Ford algorithm.The pseudocode of the Bellman-Ford algorithm is an intuitive embodiment of the algorithm, from which the optimal path can be directly obtained. The code calculates the optimal solution step by step [17]. The code is shown in Algorithm 1:Algorithm 1: Pseudo code of Bellman-Ford algorithm
Bellman-Ford AlgorithmInputk: information of network topologyOutput: shortest path between nodes (x for start node, y for end node)Initialization(1)
for ally in network(2)
dx(y) = c(x, y)/∗if y is not a neighbor, then c(x, y) = ∞(3)
for each neighborw:(4)
dw(y) = ∞ for dw(y) = ∞(5)
for each neighborw:(6)
Send distance vector dx = [dx(y): y in N]towLoop:(7)
wait until a link cost change or receive a distance vector from neighbor(8)
for eachy in network:(9)
dx(y) = min v{c(x, y) + dv(y)}(10)
if dx(y) changed for any y:(11)
Send distance vector dx = [dx(y): y in N] to all neighborsForever


### 2.8. DI_END_CITY_DIS_and_NATURE Method

The following formula is used to evaluate the relevant cities:(11)city_score=∑i=1nXin.In the above formula,Xi represents the popularity of the i scenic spot.The following formula is used to find the shortest path:(12)result=D2+1000H2.The following formula is used to derive the approximate number of kilometers traveled:(13)KM=3∗Days∗V.Days means the number of days tourists travel, andV means the driving speed.


## 2.1. Results and Discussion

The experiment found that there are many influencing factors of self-driving travel. The road network structure has the greatest influence on it. The A∗ algorithm has obvious advantages over Dijkstra’s algorithm.


## 2.2. Topological Structure Quantitative Index

This study aims to help the self-driving tourists to find a suitable travel route and to avoid spending a lot of time on the road. It also aims to effectively reduce traffic problems and reduce traffic congestion caused by holidays. Every holiday, the travel experience of tourists is often affected by traffic congestion, and it is not convenient for local residents to travel.There are several common road network structures. A-side format: there are vertical or horizontal near-parallel roads at regular intervals. B circular radial: it consists of several circular roads connected to each other. C freestyle: the terrain is complex and has no fixed geometry. D mixed type: it is a combination of the above forms.There are two methods for road network topology: path structure analysis and space syntax. Considering various spatial factors, this research mainly analyzes road network topology from the perspective of space syntax. In order to be applicable to various road networks, this study selects two indicators: comprehensibility and integration.Comprehensibility: it refers to the coordination degree of the local and the whole of the road network [9].Integration degree: the degree of scattered or dense distribution between road sections is an indicator of whether the road is congested or not. The greater the degree of integration, the more concentrated the roads, which means the more the center can be deviated and the more traffic can be attracted. The integration degree can be divided into global and local integration degrees: the global integration degree represents all road relationships of a complete road segment, and the local integration degree represents the road segment relationship of a partial area of a complete road segment, which are calculated as follows:(1)RAx=DMx−1n/2−1,AR=nlog2n/3−1+1n−1n−2/2,Intergrationx=ARRAx.In the formula,n is the number of axes; DM is the average depth; RA is the relative asymmetry; AR is the relative asymmetry value of the diamond-shaped topology; Intergration is the degree of integration.Modern transportation is becoming more and more developed, and the road network structure is very complex. People who travel to other places are not familiar with the road network structure, and it is easy to make mistakes. Some tourists drive to Chongqing to travel, but they are not familiar with the road. They choose to follow the navigation and cannot find the place they want to go. In order to effectively avoid such situations, we analyze the road network structure and then avoid areas with complex road network structures, so that self-driving tourists can find suitable roads and scenic roads.


## 2.3. Accessibility Calculation

The different scenic spots to be visited by the self-driving tourist will have corresponding impacts on different groups of people and different vehicles. For example, if the road you are going to is uneven, there is deep water, and there are many mountain roads, it will be difficult for ordinary vehicles to travel, and off-road vehicles are required to pass normally. People who do not have an off-road vehicle will have a lot of problems driving to it, and even the car will break down halfway down the road. Computational reachability is designed to avoid such problems.By calculating the distance traveled on the GIS grid to deduce the accessibility [10] and fully considering various factors such as mountains and waters that hinder the movement, the accessibility to a certain location in the region can be better simulated. The weighted distance from one place on the GIS grid to another on the grid is calculated. This algorithm is a cumulative cost distance algorithm. The calculation formula is as follows:(2)Ki=12∑i=1nCi+Ci+1,22∑i=1nCi+Ci+1.In the formula, the time cost of thei-th pixel is Ci; the time cost of the i + 1-th element along the movement direction is denoted by Ci+1; n represents the total number of pixels; the scenic spot accessibility of the i-th grid is denoted by Ki. The above formula is used to calculate the time cost in the horizontal or vertical direction of the grid surface, and the following formula is used to calculate the time cost in the diagonal direction of the grid surface.


## 2.4. Relevant Factors Affecting the Destination of Self-Driving Tours

The cost factors affecting the self-driving tour are as follows: ① gasoline cost: for ordinary private cars, highways are more than 1 yuan/km, and ordinary kilometers are 0.6 yuan/km (excluding ordinary toll roads). ② accommodation fee: the level is suitable for each person, and the standard room is 100–150 yuan per day. ③ meal fee: the amount varies from one person to another, generally speaking, about 60 yuan per person. ④ tickets: the price varies, so it is not easy to calculate; in many places, the elderly are free or half price, but tickets are still required for sightseeing cars and ropeways.


### 2.4.1. Tourist Factor

The scoring indicators of each scenic spot are mainly the data on major tourism websites and the data of travel notes learned by tourists [11]. The formula is as follows:(3)ti=∑j=1snijxijni.where the evaluation of thej-th tourist of the tourist attraction i is represented by xij, the number of useful comments of the j-th tourist of the i-th tourist attraction is represented by nij, the sum of the useful numbers of the i-th tourist attraction is represented by ni, and the weighted score of the tourists of the i-th tourist attraction is expressed by ti.


### 2.4.2. Environmental Factor

It is the score data of tourists on the scenic spot environment, which is divided into very poor, poor, average, good, and very good. It is set to 1, 2, 3, 4, and 5 points [12]. The formula is as follows:(4)yi=14∑j=14Xj,i=1,2,…,n,where the three factors of scenic spot environment, traffic, and infrastructure are denoted by Xj, the comprehensive score of the i scenic spot environment is denoted by yi, and n is the number of n scenic spots.


### 2.4.3. Road Factor

Relevant studies have shown that tourists prefer to travel to areas where the spatial distribution of attractions is more concentrated, which is convenient for travel. The accessibility of measuring the spatial distance is expressed by the spatial distance formula, and the formula [13] is as follows:(5)Ai=∑j=1nlij.Among them, the minimum distance between two scenic spots (i, j) is respresented by lij, and the sum of the distances from the i scenic spot to the rest of the scenic spots is represented by Ai, and the number of scenic spots is n.


## 2.4.1. Tourist Factor

The scoring indicators of each scenic spot are mainly the data on major tourism websites and the data of travel notes learned by tourists [11]. The formula is as follows:(3)ti=∑j=1snijxijni.where the evaluation of thej-th tourist of the tourist attraction i is represented by xij, the number of useful comments of the j-th tourist of the i-th tourist attraction is represented by nij, the sum of the useful numbers of the i-th tourist attraction is represented by ni, and the weighted score of the tourists of the i-th tourist attraction is expressed by ti.


## 2.4.2. Environmental Factor

It is the score data of tourists on the scenic spot environment, which is divided into very poor, poor, average, good, and very good. It is set to 1, 2, 3, 4, and 5 points [12]. The formula is as follows:(4)yi=14∑j=14Xj,i=1,2,…,n,where the three factors of scenic spot environment, traffic, and infrastructure are denoted by Xj, the comprehensive score of the i scenic spot environment is denoted by yi, and n is the number of n scenic spots.


## 2.4.3. Road Factor

Relevant studies have shown that tourists prefer to travel to areas where the spatial distribution of attractions is more concentrated, which is convenient for travel. The accessibility of measuring the spatial distance is expressed by the spatial distance formula, and the formula [13] is as follows:(5)Ai=∑j=1nlij.Among them, the minimum distance between two scenic spots (i, j) is respresented by lij, and the sum of the distances from the i scenic spot to the rest of the scenic spots is represented by Ai, and the number of scenic spots is n.


## 2.5. Reverse Order Recursion Model

The travel process is divided into six stages, each stage is represented byk, and S is used to represent the k-stage bit; that is, s is a dynamic variable [14], and the k-stage route is selected as Xk. The state transition equation is as follows:(6)Sk+1=Sk−Xk.fx indicates Sk the cost of the k-stage to the end point, and vk represents the k-stage distance. The recursion formula is as follows:(7)fx=minvk+fk+1,k=6,5,4,3,2,1,where xk∗ represents the optimal decision; when the boundary condition k = 7, f7 = 0. The reverse order recursion equation is as follows:(8)fkSk=mindSk,uk+fk+1=Sk+1,k=6,5,4,3,2,1;f7S7=0.Matlab is used to find the shortest path from the first to the sixth stage, and the following is obtained:(9)f1A=mindA,C+f2C,dA,D+f2D.


## 2.6. Dijkstra Algorithm to Solve the Optimal Path

Dijkstra’s algorithm is an efficient algorithm for solving the shortest path [15], and this study expresses its algorithm in the form of a flow chart. Dijkstra’s algorithm will create two node sets during the search process, open, and closed sets. The closed set represents the shortest node set to the target point, and the open represents other nodes. The starting value of the source node is 0, and the weight of other nodes is ∞. When the target point reaches the closed set, the search is completed. The flow chart is shown in Figure 1.Figure 1
Flow chart of Dijkstra algorithm.


## 2.7. DV Algorithm to Find the Optimal Path

DV algorithm, also known as Bellman-Fords routing algorithm [16], can also be used for shortest path solution. The Bellman-Ford equation is as follows:(10)dxy=minvcx,v+dvy.In the above formula, the weight from nodex to node v is denoted by cx,v, the weight of the shortest path from node x to node y is denoted by dxy, and the weight of the shortest path from node v to node y is denoted by dvy.A, B, C, D, and E represent nodes, andc and d represent paths. Figure 2 is a schematic diagram of the Bellman-Ford algorithm.Figure 2
Schematic diagram of Bellman-Ford algorithm.The pseudocode of the Bellman-Ford algorithm is an intuitive embodiment of the algorithm, from which the optimal path can be directly obtained. The code calculates the optimal solution step by step [17]. The code is shown in Algorithm 1:Algorithm 1: Pseudo code of Bellman-Ford algorithm
Bellman-Ford AlgorithmInputk: information of network topologyOutput: shortest path between nodes (x for start node, y for end node)Initialization(1)
for ally in network(2)
dx(y) = c(x, y)/∗if y is not a neighbor, then c(x, y) = ∞(3)
for each neighborw:(4)
dw(y) = ∞ for dw(y) = ∞(5)
for each neighborw:(6)
Send distance vector dx = [dx(y): y in N]towLoop:(7)
wait until a link cost change or receive a distance vector from neighbor(8)
for eachy in network:(9)
dx(y) = min v{c(x, y) + dv(y)}(10)
if dx(y) changed for any y:(11)
Send distance vector dx = [dx(y): y in N] to all neighborsForever


## 2.8. DI_END_CITY_DIS_and_NATURE Method

The following formula is used to evaluate the relevant cities:(11)city_score=∑i=1nXin.In the above formula,Xi represents the popularity of the i scenic spot.The following formula is used to find the shortest path:(12)result=D2+1000H2.The following formula is used to derive the approximate number of kilometers traveled:(13)KM=3∗Days∗V.Days means the number of days tourists travel, andV means the driving speed.


## 3. Shortest Path Optimization Algorithm

The above various algorithms are not calculated in combination with the topology structure of the road network, and the optimal path algorithm combined with the analysis of the topology structure of the road network will be used below.


### 3.1. A∗ Algorithm

Dijkstra’s algorithm calculates the length of the shortest path from the source point to all other points, and A∗ focuses on the shortest path from point to point (including specific paths). The Dijkstra algorithm is based on a more abstract graph theory level, and the A∗ algorithm can be more easily used in things such as game map pathfinding. The essence of Dijkstra’s algorithm is breadth-first search, which is a divergent search, so the space complexity and time complexity are relatively high. For the current point on the path, the A∗ algorithm not only records the cost to the source point, but also calculates the expected cost from the current point to the target point. It is a heuristic algorithm and can also be considered as a depth-first algorithm.Dijkstra’s algorithm is the most traditional routing algorithm [18], and there is a problem that the retrieval is blind and does not consider the target point, but only the source point. This problem can cause the search space to be too large, which is not conducive to computation.A∗ algorithm is one of the optimal algorithms in static network, and A∗ algorithm is an improved algorithm based on Dijkstra algorithm. The A∗ algorithm introduces a weight function:(14)Fi=Gi+Hi.The node depth is represented byb, and the performance evaluation index is represented by b∗ branching factor. The relationship can be represented by the following formula:(15)N+1=1+b∗+b∗2+⋯+b∗d.There is a single node state, and the evaluation functionhx satisfies the formula:(16)hx−h∗x=0logh∗x.The A∗ algorithm is calculated as follows:(17)h=ni−ntcostNδnE.The A∗ process is divided into 4 steps. Step 1: set the source node {ns, 0, 0, null}, the node enters the closed set, and the adjacent node enters the open set. The initial value of w is the current node and the source node of ns the link length. Step 2: find a node in the open set whose w + h value is the smallest, and the node enters the closed set from the open set. Step 3: if Sn = nd, the target node has been found and the algorithm ends. Step 4: no: go back to Step 2 to perform another calculation, so that the target node appears in the closed set, the search is completed, and the shortest path is obtained [19]. The flow chart is shown in Figure 3.Figure 3
A∗ algorithm flow chart.Ifhn is always lower than the shortest distance value of n nodes to the target point, A∗ can find the shortest path. Otherwise, the optimal path cannot be found.This is proved by the backward method [20], taking the second-to-last node n as an example. Let the starting point be s, the target point be t, the next node selection of node n is j, q, the next node of node j, q is t, and the q node is in the optimal path. Among them, the optimal value of the link length of a and b from a to b is denoted by pad, and the evaluation value of a to b is denoted by hab. Node q is in the optimal path, so we have(18)gsn+pnj+pjt>gsn+pnq+pqt.Atn node selection, hqt>hjt results in(19)gsn+pnj+pjt<gsn+pnq+pqt.The current node selects the next search nodej and hqt≤pqt:(20)gsn+pnj+pjt+0>gsn+pnq+pqt≥gsn+pnq+hqt.Therefore, theq node will be found again. By analogy, it can be proved that the path that can be finally found must be the shortest path. After finding the shortest path, the distance can be calculated in three ways [21].(i)
Harmanton distance:(21)hx=absx2−x1+absy2−y1.(ii)
Chebyshev distance:(22)hx=maxabsx2−x1,absy2−y1.(iii)
Euclidean distance:(23)hx=sqrtx2−x32+y2−y12.(iv)
Cosine distance:(24)cosθ=x1x2+y1y2x12+x22y12+y22.


## 3.1. A∗ Algorithm

Dijkstra’s algorithm calculates the length of the shortest path from the source point to all other points, and A∗ focuses on the shortest path from point to point (including specific paths). The Dijkstra algorithm is based on a more abstract graph theory level, and the A∗ algorithm can be more easily used in things such as game map pathfinding. The essence of Dijkstra’s algorithm is breadth-first search, which is a divergent search, so the space complexity and time complexity are relatively high. For the current point on the path, the A∗ algorithm not only records the cost to the source point, but also calculates the expected cost from the current point to the target point. It is a heuristic algorithm and can also be considered as a depth-first algorithm.Dijkstra’s algorithm is the most traditional routing algorithm [18], and there is a problem that the retrieval is blind and does not consider the target point, but only the source point. This problem can cause the search space to be too large, which is not conducive to computation.A∗ algorithm is one of the optimal algorithms in static network, and A∗ algorithm is an improved algorithm based on Dijkstra algorithm. The A∗ algorithm introduces a weight function:(14)Fi=Gi+Hi.The node depth is represented byb, and the performance evaluation index is represented by b∗ branching factor. The relationship can be represented by the following formula:(15)N+1=1+b∗+b∗2+⋯+b∗d.There is a single node state, and the evaluation functionhx satisfies the formula:(16)hx−h∗x=0logh∗x.The A∗ algorithm is calculated as follows:(17)h=ni−ntcostNδnE.The A∗ process is divided into 4 steps. Step 1: set the source node {ns, 0, 0, null}, the node enters the closed set, and the adjacent node enters the open set. The initial value of w is the current node and the source node of ns the link length. Step 2: find a node in the open set whose w + h value is the smallest, and the node enters the closed set from the open set. Step 3: if Sn = nd, the target node has been found and the algorithm ends. Step 4: no: go back to Step 2 to perform another calculation, so that the target node appears in the closed set, the search is completed, and the shortest path is obtained [19]. The flow chart is shown in Figure 3.Figure 3
A∗ algorithm flow chart.Ifhn is always lower than the shortest distance value of n nodes to the target point, A∗ can find the shortest path. Otherwise, the optimal path cannot be found.This is proved by the backward method [20], taking the second-to-last node n as an example. Let the starting point be s, the target point be t, the next node selection of node n is j, q, the next node of node j, q is t, and the q node is in the optimal path. Among them, the optimal value of the link length of a and b from a to b is denoted by pad, and the evaluation value of a to b is denoted by hab. Node q is in the optimal path, so we have(18)gsn+pnj+pjt>gsn+pnq+pqt.Atn node selection, hqt>hjt results in(19)gsn+pnj+pjt<gsn+pnq+pqt.The current node selects the next search nodej and hqt≤pqt:(20)gsn+pnj+pjt+0>gsn+pnq+pqt≥gsn+pnq+hqt.Therefore, theq node will be found again. By analogy, it can be proved that the path that can be finally found must be the shortest path. After finding the shortest path, the distance can be calculated in three ways [21].(i)
Harmanton distance:(21)hx=absx2−x1+absy2−y1.(ii)
Chebyshev distance:(22)hx=maxabsx2−x1,absy2−y1.(iii)
Euclidean distance:(23)hx=sqrtx2−x32+y2−y12.(iv)
Cosine distance:(24)cosθ=x1x2+y1y2x12+x22y12+y22.


## 4. Analysis and Experiment of Road Network Topology

To find the shortest path, we must first analyze the road network structure. Table1 takes the historical old city as an example and takes Prada [22], Gulou District, and the old city as samples to analyze the integration degree of the road network topology.Table 1
Analysis of the road network structure in the historic old city.
Road network areaRoad network sampleGlobal integrationLocal integrationIntelligibilityHistoric old townPrada (Athens)1.341.370.81Gulou District (Kaifeng)1.681.910.94Old town (Suzhou)1.782.030.95The analysis of these cities allows us to avoid cities with complicated road conditions and choose the optimal route when choosing a destination city for a self-driving tour. Prada, Gulou District, and the old city have different degrees of integration and understanding, but the difference is not big. When choosing a purpose, you can choose whatever you want.It can be seen intuitively from Figure4 that Prada, Gulou District, and the old city have different degrees of integration and understanding. The overall gap is not very big, and these cities can be used as destinations.Figure 4
Analysis of the road network structure in the historic old city.Table2 shows the analysis of the peripheral area and the expansion area. Taking Jianye District, Glasgow, Bayswater, and the Outer Qinhuai River as samples [23], these areas are integrated and analyzed.Table 2
Road network analysis of the expansion area and the peripheral area.
Road network areaRoad network sampleGlobal integrationLocal integrationIntelligibilityExpansion and outer zonesJianye District (Nanjing)2.512.550.99Glasgow (Scotland)2.282.040.96Bayswater (London)1.2991.640.87Outer Qinhuai River (Nanjing)0.731.290.64The road network analysis of the expansion area of the peripheral area is also to avoid the scenic spots with complicated road conditions and to help self-driving tourists to choose. From the above table, it can be seen that the integration degree of Jianye District, Glasgow, Bayswater, and Outer Qinhuai River is quite different. Careful analysis is required when choosing a travel destination.Figure5 is an intuitive representation of the road network analysis of the expansion area of the peripheral area. The integration degree of Jianye District and Glasgow is much more understandable than that of Bayswater and the Outer Qinhuai River. Tourists choose the destination is best to choose the first two cities. The latter two are prone to traffic jams.Figure 5
Road network analysis of the expansion area and the peripheral area.Table3 is a comparison table of the historical old city and the expansion area and the outer area.Table 3
Comparison table.
Road network areaRoad network sampleGlobal integrationLocal integrationIntelligibilityHistoric old townPrada (Athens)1.341.370.81Gulou District (Kaifeng)1.681.910.94Old Town (Suzhou)1.782.030.95Expansion and outer zonesJianye District (Nanjing)2.512.550.99Glasgow (Scotland)2.282.040.96Bayswater (London)1.291.640.87Outer Qinhuai River (Nanjing)0.731.290.64The comparison shows that the peripheral area and the expansion area are generally more integrated than the old city, which shows that the old city often has complex road conditions, while the peripheral area and the expansion area are relatively better and more suitable for self-driving tourists.It can be seen intuitively from the statistical chart in Figure6 that Jianye District has the greatest degree of integration and intelligibility, and the integration degree of several cities in the expansion area and peripheral area is higher than that of several cities in the historic old city. If the degree is larger, there will be intuitive reference data for the selection of tourist destinations for tourists.Figure 6
Comparison chart.


### 4.1. Comparing the Performance of Different Algorithms

The following table is a comparison of the running time of different algorithms.As can be seen from Table4, with the increase of traffic volume, the running time of A∗ algorithm is shorter than that of Dijkstra algorithm and Bellman-Ford algorithm [24], which indicates that the more traffic volume, the better performance of A∗ algorithm. The Dijkstra algorithm and the Bellman-Ford algorithm take more time as the traffic increases.Table 4
Running time of different algorithms.
Dijkstra’s algorithmBellman-Ford algorithmA∗ algorithmBusiness volumeRunning time (ms)Running time (ms)Running time (ms)10012982174130034226518036005454081769900103260317961200136012061864150017071532187218002013185719002100236520431934240026812465198927002964268920413000333530132103From the broken line above in Figure7, it can be intuitively shown that the running time of the A∗ algorithm has no obvious upward trend with the increase of the business volume, while the Dijkstra algorithm and the Bellman-Ford algorithm have an obvious upward trend. The shorter the search time, the better the search efficiency. The efficiency of the A∗ algorithm is better than that of the Dijkstra algorithm and the Bellman-Ford algorithm.Figure 7
Running time of different algorithms.The following table is a comparison of the search space of different algorithms.It can be seen from Table5 that the search space of Dijkstra algorithm is generally larger than that of Bellman-Ford algorithm, and the search space of Bellman-Ford algorithm is much larger than that of A∗ algorithm. The search space of Dijkstra algorithm and Bellman-Ford algorithm is too large, which will lead to inaccurate finding of the optimal path. The search space of A∗ algorithm is small, so the shortest path is more accurate.Table 5
Search spaces of different algorithms.
Dijkstra’s algorithmBellman-Ford algorithmA∗ algorithmBusiness volumeSearch spaceSearch spaceSearch space10013.8411.215.4330012.7510.325.6860013.2111.326.9690013.9510.354.83120012.6211.335.32150013.7811.475.23180013.8511.434.84210012.9611.686.32240013.5410.965.67270013.4711.546.23300013.7811.675.93Figure8 more intuitively shows the search space size of Dijkstra algorithm, Bellman-Ford algorithm, and A∗ algorithm. It can be seen at a glance that A∗ algorithm is better than Dijkstra algorithm and Bellman-Ford algorithm. Because the search space of the A∗ algorithm is small, the search results are accurate, while other search spaces are too broad, and the results are not accurate enough.Figure 8
Search space comparison of different algorithms.


### 4.2. Finding the Shortest Path

Because the A∗ algorithm is better than the Dijkstra algorithm and the Bellman-Ford algorithm, the A∗ algorithm is used to find the shortest path between the starting point A and the target point B [25]. The statistics are shown in Table 6.Table 6
Distance and weight of different paths.
Attraction weightJourneyPath one46.5Path two35.5Path three44.3Path four35.7Path five66.2Path six64.1The weight is the analysis of the road network structure, and the distance is the intuitive expression of finding the shortest path. The weight of path 6 is larger and the distance is the smallest. The other paths are either too small in weight or too far away, which are obviously not suitable for self-driving travel.From Figure9, it can be concluded that path 6 is the optimal path, which occupies a high weight and has the shortest distance. Other paths have different problems: either the path is long or the weight is small.Figure 9
Distance and weight of different paths.


## 4.1. Comparing the Performance of Different Algorithms

The following table is a comparison of the running time of different algorithms.As can be seen from Table4, with the increase of traffic volume, the running time of A∗ algorithm is shorter than that of Dijkstra algorithm and Bellman-Ford algorithm [24], which indicates that the more traffic volume, the better performance of A∗ algorithm. The Dijkstra algorithm and the Bellman-Ford algorithm take more time as the traffic increases.Table 4
Running time of different algorithms.
Dijkstra’s algorithmBellman-Ford algorithmA∗ algorithmBusiness volumeRunning time (ms)Running time (ms)Running time (ms)10012982174130034226518036005454081769900103260317961200136012061864150017071532187218002013185719002100236520431934240026812465198927002964268920413000333530132103From the broken line above in Figure7, it can be intuitively shown that the running time of the A∗ algorithm has no obvious upward trend with the increase of the business volume, while the Dijkstra algorithm and the Bellman-Ford algorithm have an obvious upward trend. The shorter the search time, the better the search efficiency. The efficiency of the A∗ algorithm is better than that of the Dijkstra algorithm and the Bellman-Ford algorithm.Figure 7
Running time of different algorithms.The following table is a comparison of the search space of different algorithms.It can be seen from Table5 that the search space of Dijkstra algorithm is generally larger than that of Bellman-Ford algorithm, and the search space of Bellman-Ford algorithm is much larger than that of A∗ algorithm. The search space of Dijkstra algorithm and Bellman-Ford algorithm is too large, which will lead to inaccurate finding of the optimal path. The search space of A∗ algorithm is small, so the shortest path is more accurate.Table 5
Search spaces of different algorithms.
Dijkstra’s algorithmBellman-Ford algorithmA∗ algorithmBusiness volumeSearch spaceSearch spaceSearch space10013.8411.215.4330012.7510.325.6860013.2111.326.9690013.9510.354.83120012.6211.335.32150013.7811.475.23180013.8511.434.84210012.9611.686.32240013.5410.965.67270013.4711.546.23300013.7811.675.93Figure8 more intuitively shows the search space size of Dijkstra algorithm, Bellman-Ford algorithm, and A∗ algorithm. It can be seen at a glance that A∗ algorithm is better than Dijkstra algorithm and Bellman-Ford algorithm. Because the search space of the A∗ algorithm is small, the search results are accurate, while other search spaces are too broad, and the results are not accurate enough.Figure 8
Search space comparison of different algorithms.


## 4.2. Finding the Shortest Path

Because the A∗ algorithm is better than the Dijkstra algorithm and the Bellman-Ford algorithm, the A∗ algorithm is used to find the shortest path between the starting point A and the target point B [25]. The statistics are shown in Table 6.Table 6
Distance and weight of different paths.
Attraction weightJourneyPath one46.5Path two35.5Path three44.3Path four35.7Path five66.2Path six64.1The weight is the analysis of the road network structure, and the distance is the intuitive expression of finding the shortest path. The weight of path 6 is larger and the distance is the smallest. The other paths are either too small in weight or too far away, which are obviously not suitable for self-driving travel.From Figure9, it can be concluded that path 6 is the optimal path, which occupies a high weight and has the shortest distance. Other paths have different problems: either the path is long or the weight is small.Figure 9
Distance and weight of different paths.


## 5. Conclusion

Recalling the preface, this study selects two indicators, comprehensibility and integration, to analyze the structure of the road network, then analyzes the accessibility to the destination, and calculates the relevant factors that affect self-driving travel. For the calculation of the optimal path, methods such as A∗ algorithm, Dijkstra algorithm, Bellman-Ford algorithm, and reverse order recursion model are introduced. The A∗ algorithm is an optimization of Dijkstra algorithm, Bellman-Ford algorithm, and other methods. The degree of integration and intelligibility of some road network topology structures are obtained through experiments. In the comparative experiments, the A∗ algorithm shows obvious advantages in calculating the shortest path. Finally, the A∗ method is used to find the shortest path from the starting point A to the target point B. It is hoped that research can become more rational and make people’s travel life more convenient. With the in-depth research to develop good software, visitors only need to enter their destination, origin, vehicle model, budget, and travel time. You can quickly plan the best travel itinerary. If the information entered by the passenger is unreasonable, or the passenger’s destination conflicts with various problems in the route, the software will remind the passenger to change the destination and will also give the passenger relevant recommendations.



---

*Source: 6588288-2022-09-29.xml*