Hiking path planning algorithm based on dynamic parameters and heuristic information for complex field comprehensive terrain

The paper focuses on the problem of hiking path planning in complex and comprehensive terrains and establishes a Fast Marching method (DH-FM2) based on heuristic information and dynamic parameters. This method inventively considers the path’s safety, smoothness, and heuristics to meet the needs of dynamic path planning. In data processing, we do a correlation analysis of the elements affecting traversing resistance of the path planning process and filters them to remove relevant features. The algorithm establishes a path evaluation function and optimizes the value of the function by Monte Carlo simulation to determine the coefficients of the TR function. Besides, we consider several types of land cover such as existing roads to fit the actual situation in the field. The result of simulation shows that the DH-FM2 algorithm can dynamically adjust parameters according to different path planning requirements to generate a path meeting the user’s requirements. The DH-FM2 algorithm spends shorter time than the FM algorithm on the premise of the same time complexity. Overall, the DH-FM2 method is reliable and efficient.


Introduction
Due to the practical needs, it is necessary to carry out path planning in areas where roads have not been built or are sparse in many situations such as hiking, riding cross-country, search, and rescue. For example, Google map, Baidu map and Amap all rely on data having the information of road network and POI information points with topological relations. Although these navigation systems based on the data relationship have very powerful functions, which can provide accurate path planning and navigation services for the city, they have nothing to do in no-roads areas. When people walk or drive through such areas, they can only rely on their prior experience or information which predecessors left.
Hence, the reality inspires us to build the algorithm of path planning for hiking outdoors, which considers existing road networks and is also suitable for field comprehensive terrains. Researches at home and abroad in this field focus on the artificial virtual reality space, underwater environment [1] and navigation planning by outdoor robots [2] , while few people consider the characteristics of physiogeographic data and apply the algorithm to real geographic areas.
In response to the above problems, for the comprehensive terrains, we propose a navigation method considering the existing road information and the land cover classification. The specific content is as follows:  Using digital elevation model (DEM), slope, aspect, and the land cover classification to establish a Digital Terrain Model (DTM) in a natural environment.
 Based on the spatial model, according to the characteristics of the natural environment, the factors affecting the resistance of outdoor hiking are proposed, then the certain factors are screened by the correlation analysis. Hence, we establish the function of TR based on these factors.  Establish a weighted path evaluation function adapting to different tasks such as finding the shortest path or the path spending minimal time.  Based on the Fast Marching Square algorithm (DH-FM 2 ) with heuristic information and dynamic parameters, we determined the parameters in the function of TR by Monte Carlo method and the path evaluation function.  Based on the parameters in the function of TR, use the DH-FM 2 algorithm to generate the optimal path between two points.

2.1.Outdoor integrated terrain modeling
In order to achieve a complete description of the field comprehensive terrain, we selected five geomorphic factors or elements such as digital elevation and slope to establish the Digital Terrain Model (DTM).  Digital elevation model (DEM) Digital Elevation Model is digital simulation of ground terrains through limited terrain elevation data [3] . In this question, DEM can well reflect the undulating state of the ground in the wild environment and is the basis for constructing a digital terrain model. Data samples of DEM is shown in Figure 1.  Slope and aspect The slope is used to describe the maximum changeable rate from the calculated pixel to each adjacent pixel on the map [4] ; the aspect can be regarded as the direction of slope, which is used to identify the downslope direction with the largest changeable rate from each pixel to its neighboring pixels. In the paper, the calculating results of the regional slope and samples through ArcGIS are shown in the Figure  2.
 Land cover classification The data of land cover classification refers to the orderly numbers of different types of land cover, which can help identify the different types of land cover and assign values to the resistance on different grids. The paper adopts Globeland30 [5] ,(30m precision global land cover classification data) as the data of land cover classification. The data is specifically divided into the following categories: water, woodland, grassland, cultivated land, artificial surface, etc.
 Existing road information The addition of existing road information can enable the algorithm of path planning to realize a new model following the principle of "Walk on a road if the condition allows, otherwise, explore roadless field areas". Road information is usually given in the form of "shape". We use ArcGIS to rasterize road information and unify it with other data formats. Surface roughness is defined as the ratio of the surface of the surface area to its projected area in a designated area. It is a macro index reflecting the degree of surface roughness. For each grid, its value of surface roughness can be calculated by the slope: Slope is a radian system, not an angle system. In order to reduce the subsequent errors of calculation, the value of roughness needs to be changed to .

2.2.2.Surface undulation
Undulation refers to the changeable degree in altitude within a region, which can be defined as the difference between the maximal and minimal evaluations in the region. We de-fine it as the variance of the elevation of a grid and its 8 neighboring points [6] . Like roughness, we convert the calculated value to . When the value of Undulation approaches 1, which indicates less undulation in the surrounding area, while 10 for more undulation.

2.2.3.Obstruction resistance
The value reflects the distance between a point and the nearest obstacle on the map, and is used to measure the safety and smoothness of the path. This value is calculated by the FM algorithm, and the calculation method will be given in the next section.

2.2.4.Traversing resistance of land cover
According to different types of land cover, we assign different values of resistance between to reflect walking difficulty. The assignments are shown in the Table 1: Table 1 Traversing resistance of land cover  Land cover  Traversing resistance  Existing roads  1  Woodland  6  Grassland  3  Cultivated land  5  Artificial land  2  Water  10  Other 10 Among them, the surface type with a value of 10 is set as an obstacle.

2.3.Total traversing resistance
Due to the correlation between the elements (we defined in 2.2) related with TR, when calculating the total traversing resistance, linear combination with these factors directly result multicollinearity, so correlation analysis is necessary to filter the elements.
Pearson correlation coefficient measures the linear relationship between variables. The following is the formula of Pearson correlation coefficient measuring the matrix of two variables: (2) We selected slop, roughness, and undulation with strong correlation. Then, we recorded all their correlation coefficients in different data samples and averaged them. The results are as follows: When the Pearson correlation coefficient is greater than 0.8, it can be considered that the two variables are highly correlated. So, they are all linearly positively correlated with each other. In addition, since the degree of undulation is a macroscopic quantity, which represents the attributes of nearby areas of a grid and presents the difference between uphill and downhill. Hence, the degree of undulation changes the problem of anisotropy into isotropic and is better than other indexes which we have talked to be one of the variables to measure TR.
Finally, we choose undulation, obstacle resistance, and land cover classification as variables to measure TR, and the function of TR is as follows: The calculation method of will be given in the following subsections.

3.1.Fast Marching Method
The essence of FM is to realize the geometric feature description of the closed surface. From the perspective of mathematics, FM simulates the propagation of electromagnetic waves by solving a simplified Hamilton-Jacobi nonlinear partial differential equation (Eikonal equation).
In the formula, is the time function or the distance function of that the wave surface travels to the position of . The represents the resistance of the wave at the position of , and can be regarded as the speed of propagation of the wave at the position of . The difference method discretizes the gradient in equation (7) to solve the nonlinear partial differential equations. Specifically, on the physiogeographical space with discrete two-dimensions, upwind operators can be used to replace the gradient.
(6) (7) Therefore, we solve equation (7) by the quadratic discriminant, and obtain the solution of .Through iterative comparison, the final distance function is obtained.

Fast Marching Square Method
The path generated by the FM algorithm is closer to obstacles. In the wild, the probability of uncertain natural disasters occurring in obstacle areas such as steep slopes increases significantly, which causes that the safety and smoothness of the path are also reduced. Hence, Fast Marching Square (FM 2 ) [7] was proposed. The difference between FM 2 and FM is that FM 2 uses FM twice. The obstacle resistance potential field (the shortest path between each point and the nearest obstacle on the map) is generated through the first FM, and the potential field will be added to the resistance function of the second FM as the independent variable. After that, the resistance function shows that the closer the distance to the obstacle is, the slower the propagation speed is. In addition, it can ensure the safety and increase the smoothness of the path.
We selected a sample (Figure 3(a)) where the black area represents obstacles. We made which is the cost of traffic at the obstacle be equal to , and chose evenly dispersed points at the boundary of  Figure 3(c).
The path was Generated by making and compared with the path (Figure 3(b)) generated by FM where . The comparison is shown in the Figure 3(d). We found that the longer distance between the path and obstacle is, the better smoothness of the path is. Figure 3 Fast Marching Square Method

4.Fast Marching Square with heuristic information and dynamic parameters (DH-FM 2 )
In order to allow the algorithm to quickly search under large-scale maps and determine whether to walk when there is a road on the map, the original FM and FM 2 algorithms will no longer be used. Hence, we consider adding directional heuristic information and the heuristic information of existing road to FM 2 .

4.1.Establish the path evaluation function
For the path planned by the algorithm, in addition to distinguishing its advantages and disadvantages from a visual perspective, we also need to establish a function to quantify the evaluation of the path we find, to compare the passability of the path under different parameters of the algorithm. It can also be used for calculating TR under different needs of path planning.
The path evaluation function is set as follows: (8)  is the ratio of the Manhattan distance between the start and end of the path to the actual length of the path.  is the average resistance value of obstacle on the path. (The value is calculated by the FM algorithm and will be defined in the next section)  is the ratio of the length of the existing road in the path to the total length of the path. Due to the different dimensions of the above parameters, we make dimensionless processing before bringing them into the path evaluation function. The above three parameters reflect the energy (physical strength) consumption, safety, smoothness, and passability in the requirements of path planning. These requirements which can be changed by adjusting the coefficients of these parameters. Hence, we optimize the path evaluation function to determine the optimal values of parameters in the function of TR under different requirements, then obtain a relatively optimal path.
In conclusion, we obtain the process of parameters determination: carry out the simulation of Monte Carlo to the algorithm of path planning under different , then optimize the path evaluation function to get the corresponding in . (9)

4.2.Directional heuristic information
In order to solve which is TR in the algorithm of FM 2 , bring which is obtained in the first calculation to FM of FM 2 , determined by the equation (3), , into the equation (3). Then carry out the second calculation to FM of FM 2 based on and the equation (7). In each iteration calculation, The Manhattan distance between and the ending point and the solution of equation (7) form the estimated value of the distance function at position of , which is defined as: respectively represents the horizontal and vertical coordinates at the position in the twodimensional grid. The value of needs to be converted to the interval from 1 to 10 for the coordination of dimensions.

4.3.Existing roads heuristic information
Under the actual field comprehensive terrain, the existing road is a problem that we must consider in path planning, because the realization of the mode of path planning of "Walk on a road if the condition allows" can increase the passability and safety of the path. From the perspective of algorithm implementation, reducing the traversing resistance on the existing road makes the distance function on the road solved by the algorithm be smaller to ensure that priority will be given to the existing roads when the path is backtracked. The paper reduces the and on the grid with an existing road to reduce TR of the existing roads.

4.4.Steps of DH-FM 2 algorithm
Algorithm 1. Fast Marching Square with heuristic information and dynamic parameters Require: 1. Path planning requirements

5.1.Display of the surface
We use simulation of MATLAB to verify the reliability of the DH-FM 2 algorithm. We selected a map (800*800) of field comprehensive terrain with a resolution of 30m in Fujian Province, China, then, integrated and visualized the data of geomorphic factor in 2.1.1. The result is shown in Figure 4. We used DEM data to calculate undulation and defined the traversing resistance of land cover which is shown in Table 1.

5.2.Simulation results
We set the maximum passable slope to 35°, and consider the area with a slope more than 35° and the water body as obstacles. The potential field of the resistance of obstacles calculated by FM is as shown below (the white area in the Figure 5 is the obstacle). The figure follows the rule of that the larger value of a point means longer distance from the point to obstacles and lower traversing resistance. Figure 5 Potential field of obstacle resistance Then, we made the requirements of path planning be equal to , which means that the consumption of physical energy, safety, smoothness, and passability are equally valued.
For the heuristic information, and are equal to 0 and 1 separately in the existing roads. To keep the heuristic of the algorithm moderate, the paper made the coefficient of the heuristic information with direction be 0.2. The start point coordinated to (800,10) and the end point coordinated to (100,700), so that the parameter of was increased in steps of 0.01 from 0 to 1, which was took into the DH-FM 2 algorithm. The process of path planning was simulated by Monte Carlo, and the value of the path evaluation function and depending on as shown in Figure 6: Figure 6 Monte Carlo test results  Figure 8(a), the shortest path has advantages of moving along the direction of lower obstacles' resistance to guarantee the safety, and the better smoothness. By analyzing Figure 8(b), the planned road does not completely choose the existing roads, but has a good trade-off between the existing roads and the length of the path. Generally, the path is relatively straight, and there is no detour due to deliberately choosing an existing road. From the Figure 8(c), areas passed by the path are mainly cultivated land and artificial ground. When passing through woodland with high traversing resistance, the route will be as straight as possible to reduce traversing consumption.In conclusion, the DH-FM 2 algorithm can find a reasonable path with low energetic consumption, high safety, better smoothness and higher passability.
In addition to analyzing the reliability of the DH-FM 2 algorithm, it is also necessary to evaluate the performance of the algorithm. We compared the path generated by the FM algorithm under the same condition in the same map as shown in the By comparing the two paths visually, we found that although the FM algorithm can also find a better route, the smoothness of the route is prominently lower than that of DH-FM 2 algorithm, and the length of the path is remarkably increased due to excessive pursuit of the existing roads. In addition, because of lack of heuristic information, the searching range of has increased significantly in the FM algorithm (the red area in the figure is the search range). Based on the above reasons, the value of the path evaluation function (Table 2) in the route generated by FM is significantly lower than that of DH-FM 2 . We also compared the path planning time of the two algorithms (multiple planning times are averaged), as shown in Table 3. The result shows that the FM algorithm has a longer searching range than DH-FM 2 . All experiments used 2.20GHz Intel(R) Core (TM) i7-8750H CPU, 16G RAM, Windows 10 64-bit operating system. The main program code was written in C++ and operated by MATLAB MEX compiler. DH-FM 2 algorithm spends less time and finds a more satisfying road under the premise that the time complexity is the same ( ). Thus, the DH-FM 2 algorithm is more reliable and efficient.

6.Conclusion
The paper establishes the FM 2 method (DH-FM 2 ) based on heuristic information and dynamic parameters based on the FM algorithm, and verifies the reliability and efficiency of the algorithm through MATLAB simulation. Hence, the DH-FM 2 algorithm solves the problem of hiking path planning in complex and comprehensive terrains. The innovation of the article lies in the following points:  The paper does a correlation analysis of the resistive elements of the path planning process and filters them according to the characteristics of the field terrain to remove some relevant features, which results that the influence of each element on the path planning process is balanced.  We establish a path evaluation function whose coefficients present the mathematical expressions of the path planning demands. Then we optimize the value of the path evaluation function by Monte Carlo simulation to determine the coefficients of the TR function under a specific condition. This dynamic parameters' method ensures the flexibility of responding to different maps or path planning needs.