Algorithm Selection and Application for Robot Path Planning Problems

This article primarily delves into the investigation of robotic path planning in the presence of obstacles, aiming to ascertain optimal traversal routes. It conducts a thorough categorization and discussion of two critical aspects: the ascertainability of the overall map and the regularity of obstacles. In addressing this inquiry, two obstacle scenarios, namely regular and irregular, are posited. The article scrutinizes the path planning and obstacle circumvention techniques for both scenarios. Regarding regular obstacles, a comparative assessment of the A* algorithm, Floyd’s algorithm, and Dijkstra’s algorithm was conducted, culminating in the selection of the A* algorithm for its superior efficiency. For irregular obstacles, the article proposes a pre-processing approach involving the utilization of Matlab’s iterative pixel point traversal to assess obstacle proportions within nodes, subsequently converting irregular obstacles into a regularized format. To summarize, in scenarios with a known overall map, the article advocates employing the A* algorithm for proficient path planning. In situations where the map is undisclosed but obstacles exhibit regularity, the D* algorithm is recommended. For instances involving irregular obstacles and an undisclosed map, a dynamic method for handling newly incorporated nodes into the map is proposed. This article presents tailored solutions for robotic path planning across diverse conditions, offering concise yet effective problem-solving strategies. In conclusion, this study offers a comprehensive array of solutions for robot path planning in obstructed environments, enabling the selection of apt methodologies based on varying conditions and exigencies.


Introduction
With the widespread application of mobile robots in unstructured environments, high-performance obstacle avoidance systems have become a crucial component of mobile robot systems [1].Robot obstacle avoidance is essential as it ensures the safety and efficiency of robots in various environments.By using sensors and intelligent algorithms to detect and circumvent obstacles, robots can avoid collisions and getting stuck, thus safeguarding themselves, people, and objects in their vicinity.Examples of such robots include robotic vacuum cleaners, adaptive navigation systems[2][3], mobile robots [4][5], and more.This capability enables robots to be more widely used in everyday life, industry [6][7], healthcare, and aviation and maritime sectors [8], enhancing productivity, reducing

Research Question
The fundamental task of robot path planning can be described as follows: moving from the starting position to the destination position.This task involves a core problem: how to navigate around various obstacles that may appear in space.Therefore, this article aims to address the following issues by constructing a model: Issue One: The robot is constrained to move to grid cells adjacent to its current position, allowing diagonal movement.In Figure 1, the robot's starting point (S) and destination (D) are marked, and the black areas represent obstacles.If the obstacles occupy less than 50% of the area of a grid cell, the robot can navigate to that cell.Assuming the robot has complete knowledge of the map before starting, a mathematical model is established to determine the optimal path for movement.Issue Two: The robot is constrained to move to grid cells adjacent to its current position, allowing diagonal movement.In Figure 2, the robot's starting point (S) and destination (D) are marked, and the black areas represent obstacles.If the obstacles occupy more than 50% of the area of a grid cell, the robot cannot navigate to that cell; otherwise, it can.Assuming that the robot does not have prior knowledge of the complete map before starting (i.e., it cannot see information behind obstructions), a mathematical model is established to devise the optimal path for movement.The two problems discussed in this article can be summarized as robot path planning problems, and the main process can be divided into the following five steps: ① Determine the starting and destination points for robot motion.
② Establish a mathematical model for the map in a Cartesian coordinate system.③ Identify the positions of obstacles and perform coordinate transformations.④ Find the optimal path while ensuring obstacle avoidance.⑤ If there are multiple optimal paths, optimization of the paths can be performed.
Assuming the given map has already been gridded, for the convenience of describing the starting point, destination, and the robot's path, the planar map is placed in a Cartesian coordinate system.This simplifies the observation of obstacle positions and the robot's movement, while also providing a clearer representation of path coordinates.
For Issue One, if the full map is known and the environment has regular-shaped obstacles, avoiding obstacles is a straightforward process, as you only need to directly assess whether adjacent node positions contain obstacles.However, in an environment with irregularly shaped obstacles, preprocessing of the map is required.This involves regularizing the obstacles on the map through a traversal process.Once the obstacles have been processed, a model is constructed for route planning.
For Issue Two, if the full map is unknown, and in an environment with regular-shaped obstacles, the robot needs to continually update a local map based on the surroundings it detects after each movement.Path adjustments are made in response to these updates.The problem of finding the optimal path while avoiding obstacles in an unknown map with an ever-changing obstacle landscape can be transformed into the dynamic search for the optimal path within the map as the obstacles are continuously updated.However, in an environment with irregularly shaped obstacles, where the full map is unknown, determining the obstacle situation near the robot's current position involves traversing each node.Based on whether the obstacle occupies more than 50% of the area, nodes are categorized into walkable and non-walkable regions.Path planning is then executed on this basis.If the robot discovers the optimal path without exploring the entire map, it may encounter inconsistencies between the locally detected map and the actual global map.
For Issue One (assuming full map knowledge before the robot departs): • The robot operates in a two-dimensional plane, and therefore, there is no need to consider spatial obstacle height information.• The robot can be treated as a point for path planning.
• The robot can move within the 8-neighborhood of the current node and is assumed not to backtrack on its path.• The robot's path is represented as a polyline, without considering circular arcs or turns.
• The robot can proceed into a grid cell if the obstacle occupies less than 50% of that cell's area.
• All obstacles are processed into black and white squares based on their navigability.
• For Issue Two (assuming the robot has no knowledge of the full map before departure): • The robot operates in a two-dimensional plane, and there is no need to consider spatial obstacle height information.
• The robot can be treated as a point for path planning.
• The robot can move within the 8-neighborhood of the current node and is assumed not to backtrack on its path.• The robot's path is represented as a polyline, without considering circular arcs or turns.
• The robot can proceed into a grid cell if the obstacle occupies less than 50% of that cell's area.
• All obstacles are processed into black and white squares based on their navigability.
• The robot can see unobstructed information in all directions within the 8-neighborhood.
• The robot's map continuously updates as it moves.
To facilitate the construction of models and address these issues, the following symbols and their meanings are defined.
To address the aforementioned issues, this study will follow the steps outlined below.

Discovering the Optimal Path Under the Obstacle Rules with Prior Knowledge of the Map Overview
In conventional scenarios, Dijkstra's algorithm and Floyd's algorithm are often used for exploring the shortest path on a map.Dijkstra's algorithm is used to calculate the shortest path from one node to all other nodes, but in this case, we already know the starting and ending points.Therefore, using Dijkstra's algorithm may result in path redundancy and significantly reduce algorithm efficiency.Floyd's algorithm calculates the shortest distance between any two points on the map, but in this case, there is interference from obstacles and restrictions on the robot's range of movement, so using Floyd's algorithm may introduce substantial errors.After a comprehensive comparison, in this problem, we employ the A* algorithm.The A* algorithm is a heuristic graph search function that combines the advantages of breadth-first search and depth-first search strategies.Compared to Dijkstra's and Floyd's algorithms, A* algorithm incorporates a heuristic function that significantly reduces the search space and enhances computational efficiency.A* algorithm is the most effective method for finding the optimal path in a static map.It works by estimating the cost of the current location node and selecting the path with the smallest cost as the next step.This process is repeated until an optimal path is found.
The formula for the A* algorithm can be described as: f(n) = g(n) + h(n), where g(n) represents the actual cost incurred from the starting node to the current node, h(n) is an estimated cost from the current node to the destination node, and f(n) represents the minimum total cost from the starting node to the destination node in the current state.
Therefore, the key to finding the optimal path in the A* algorithm lies in how to calculate and choose an appropriate heuristic function h(n).The value of the heuristic function h(n) determines the overall efficiency of the A* algorithm: if the value of h(n) is less than or equal to the actual distance from the current node to the target node's optimal path, in this case, although using the A* algorithm may result in a larger number of searched nodes and lower search efficiency, it can provide a global optimal solution.Conversely, if the estimated value h(n) is greater than the optimal path distance from the current node to the target node, then using A* algorithm may lead to fewer searched nodes and higher search efficiency, but it can easily lead to a local optimal solution, causing the robot to get stuck, and the final result may not meet practical requirements.
In summary, it can be considered that when the selected heuristic function is closer to the actual values, the search efficiency is highest, and the selected heuristic function can be considered as better.
To clearly identify the locations of obstacles and facilitate the description of the heuristic function, the map can be placed in a Cartesian coordinate system, as shown in Figure 3 below: The basic steps of the A* algorithm can be described as follows: ① Create Openlist and Closelist tables.The Openlist table contains nodes to be expanded, and each time nodes are sorted in ascending order based on the heuristic function, creating a priority queue to ensure that the nodes extracted are those along the optimal path.The Closelist >>If a child node is already in the Openlist table, check if reaching the target position through the current child node is a better solution (based on g(n) or h(n)).If it is a better solution, set the current node as its parent and promptly update h(n) and g(n).If it's not a better solution, take no further action.
④ Save the path.According to the algorithm described above, running it through Matlab produces the resulting path, as shown in Figure 4.

Finding the Optimal Path with Prior Knowledge of the Map Overview and Irregular Obstacles
When the full map is known but the obstacles are irregular, it is often necessary to preprocess the obstacles.This preprocessing is mainly accomplished by using a for loop in Matlab.When the obstacle occupies less than 50% of a small grid area, the robot can navigate through that grid.Therefore, during obstacle processing, based on the results of traversal, obstacles occupying less than 50% of the small grid area are directly considered obstacle-free and represented by white small squares in the map.Obstacles occupying more than 50% of the small grid area are treated as complete obstacles, represented by black small squares in the map.After traversing all the squares in the entire map using a for loop, irregular obstacles can be transformed into regular obstacles.The map in Figure 1, after obstacle transformation, is shown in Figure 5.

Finding the Optimal Path with Unknown Map Overview and Regular Obstacles
The A* algorithm is used for finding the shortest path based on a known map overview.Therefore, when dealing with unknown map overviews, the A* algorithm is no longer applicable.In such cases, we use the D* algorithm, which is built upon the A* algorithm and is designed for exploring unknown environments.
The D* algorithm is a reverse path search algorithm that is well-suited for path planning in unknown environments.Before using the D* algorithm, it is often necessary to map the coordinates and initially plan a global optimal path from the starting node to the target node based on the available environmental information.At this point, obstacles outside the known map area are not considered.
Compared to the A* algorithm, the main feature of the D* algorithm is that it searches for the path from the target position towards the starting position.As an object moves from the starting position to the target position, if it encounters new obstacles along the way, these new obstacles do not affect the path from the target position to the target's current location.New obstacles only impact the path of nodes within the range between the object's current position and the new obstacle.To minimize computational overhead, new obstacle-adjacent nodes are added to the Openlist for processing and propagation towards the object's current position.
The D* algorithm is built on the strengths of both the A* algorithm and Dijkstra's algorithm.Therefore, the D* algorithm also uses a similar heuristic function for calculation.
The formula for the D* algorithm can be represented as: f(n) = g(n) + h(n).However, unlike the A* algorithm, the D* algorithm searches for the optimal distance from the target node to the starting node.Therefore, g(n) represents the actual cost from the target node to the current node, h(n) is the estimated cost from the current node to the starting node, and f(n) represents the minimum total cost from the target node to the starting node in the current state.
Similar to the A* algorithm, the steps of the D* algorithm are as follows: Determine the positions of the target node and the starting node, and place the target node in the Openlist table.Starting from the target node, expand the eight surrounding nodes of a single node (the surrounding nodes are referred to as child nodes of the original node).
Add all child nodes to the Openlist table and choose the one with the minimum heuristic function as the next node.Repeat the above steps until the target node enters the Openlist table.
According to the algorithm described above, running it through Matlab produces the resulting path, as shown in Figure 7.The D* algorithm is well-suited for finding optimal paths while avoiding obstacles in unknown environments.Due to its adaptability to the environment, it often enables finding the optimal path without the need to explore the entire global map, significantly reducing the number of search points.However, when the unknown environment is quite large, the use of the D* algorithm for reverse path search can rapidly increase the time complexity, leading to a significant reduction in algorithm efficiency.Additionally, in real-world environments, the complexity of the environment is typically higher, and the D* algorithm currently cannot perform detailed planning for global path traversal based on locally detected environmental information.Therefore, in larger and more complex environments, the D* algorithm might require finer grid-based map representation.While this can yield better path solutions in sufficiently detailed environmental maps, it can also greatly reduce computational efficiency.

Finding the Optimal Path in an Unknown Map Overview with Irregular Obstacles
For scenarios with an unknown map overview and irregular obstacles, the eight nodes around the current node (nodes already processed and added to the Closelist are not re-traversed) are iteratively explored.The traversal process is similar to the one described in 5.2.In Matlab, a for loop is used to traverse pixel points, converting irregular obstacles into regular ones.However, since the map overview is unknown, every move requires real-time updates and traversing newly appearing neighboring nodes, as the map and obstacle conditions need to be continuously updated.
In this research, the search for the shortest path and the transformation of irregular obstacles often occur interactively.However, each time the shortest path is sought, the model is essentially the same as the one described in 5.3.It still starts the path search from the target position towards the starting position, seeking the shortest path based on the heuristic function.The results of this process, when implemented in Matlab, are shown in Figure 8.

Research Conclusion
This study is dedicated to addressing key issues in robot path planning, especially in situations where obstacles exist, and how to find the optimal path.We approach this from two different scenarios, one where the robot already has knowledge of the entire map and another where the robot cannot acquire complete map information in advance.By exploring these two scenarios, we gain a more comprehensive understanding of the complexity of robot path planning and the various factors that must be considered in practical applications.
Firstly, for the scenario with a known map, we compared the performance of different path planning algorithms in our study, including the A* algorithm, Floyd's algorithm, and Dijkstra's algorithm.The results showed that the A* algorithm excels in efficiency and adaptability, especially when it's necessary to find the optimal path quickly.This provides an effective solution for robot path planning in scenarios with known maps.
Secondly, for the scenario where the map is unknown, we employed a method to handle irregular obstacles by transforming them into regular obstacles, allowing the robot to plan its path.This method relies on real-time obstacle detection and map updates, providing the robot with the capability to adapt to uncertain environments.
Lastly, we recognize that the complexity of path planning problems requires the consideration of multiple factors, such as terrain, sensor accuracy, obstacle distribution, and the dynamism of the moving environment.Different situations require different algorithms and strategies, so in practical

Figure 1 .
Figure 1.Map 1Issue Two: The robot is constrained to move to grid cells adjacent to its current position, allowing diagonal movement.In Figure2, the robot's starting point (S) and destination (D) are marked, and the black areas represent obstacles.If the obstacles occupy more than 50% of the area of a grid cell, the robot cannot navigate to that cell; otherwise, it can.Assuming that the robot does not have prior knowledge of the complete map before starting (i.e., it cannot see information behind obstructions), a mathematical model is established to devise the optimal path for movement.

Figure 2 .
Figure 2. Map 2The two problems discussed in this article can be summarized as robot path planning problems, and the main process can be divided into the following five steps:① Determine the starting and destination points for robot motion.②Establish a mathematical model for the map in a Cartesian coordinate system.③ Identify the positions of obstacles and perform coordinate transformations.④ Find the optimal path while ensuring obstacle avoidance.⑤ If there are multiple optimal paths, optimization of the paths can be performed.Assuming the given map has already been gridded, for the convenience of describing the starting point, destination, and the robot's path, the planar map is placed in a Cartesian coordinate system.This simplifies the observation of obstacle positions and the robot's movement, while also providing a clearer representation of path coordinates.For Issue One, if the full map is known and the environment has regular-shaped obstacles, avoiding obstacles is a straightforward process, as you only need to directly assess whether adjacent node positions contain obstacles.However, in an environment with irregularly shaped obstacles, preprocessing of the map is required.This involves regularizing the obstacles on the map through a traversal process.Once the obstacles have been processed, a model is constructed for route planning.For Issue Two, if the full map is unknown, and in an environment with regular-shaped obstacles, the robot needs to continually update a local map based on the surroundings it detects after each movement.Path adjustments are made in response to these updates.The problem of finding the optimal path while avoiding obstacles in an unknown map with an ever-changing obstacle landscape can be transformed into the dynamic search for the optimal path within the map as the obstacles are continuously updated.However, in an environment with irregularly shaped obstacles, where the full map is unknown, determining the obstacle situation near the robot's current position involves traversing each node.Based on whether the obstacle occupies more than 50% of the area, nodes are categorized into walkable and non-walkable regions.Path planning is then executed on this basis.If the robot discovers the optimal path without exploring the entire map, it may encounter inconsistencies between the locally detected map and the actual global map.For Issue One (assuming full map knowledge before the robot departs):• The robot operates in a two-dimensional plane, and therefore, there is no need to consider spatial obstacle height information.• The robot can be treated as a point for path planning.•The robot can move within the 8-neighborhood of the current node and is assumed not to backtrack on its path.• The robot's path is represented as a polyline, without considering circular arcs or turns.•The robot can proceed into a grid cell if the obstacle occupies less than 50% of that cell's area.•All obstacles are processed into black and white squares based on their navigability.•For Issue Two (assuming the robot has no knowledge of the full map before departure):• The robot operates in a two-dimensional plane, and there is no need to consider spatial obstacle height information.

Figure 3 .
Figure3.shows the establishment of a two-dimensional Cartesian coordinate system for the map.The basic steps of the A* algorithm can be described as follows: ① Create Openlist and Closelist tables.The Openlist table contains nodes to be expanded, and each time nodes are sorted in ascending order based on the heuristic function, creating a priority queue to ensure that the nodes extracted are those along the optimal path.The Closelist table contains nodes that have already been expanded.② Initially, place the starting node into the Openlist table.③ Continuously repeat the following process: Check if the current node is either the destination node or in an unreachable state.If the destination node is in the Openlist table at this point, the optimal path has been found.If the Openlist table is empty, it indicates that there are no nodes left to expand, indicating an unreachable state.Establish a priority queue for the Openlist table, sorting it based on the heuristic function h(n), ensuring that the nodes expanded each time have the smallest heuristic function value.Expand the current node, remove it from the Openlist table, and add it to the Closelist table.Evaluate the eight neighboring nodes of the current node as follows: >>If a child node cannot be reached, ignore it.>>If a child node is already in the Closelist table, ignore it.>>If a child node is not in the Openlist table, add it to the Openlist table for further expansion and calculate its heuristic function value for sorting.>>If a child node is already in the Openlist table, check if reaching the target position through the current child node is a better solution (based on g(n) or h(n)).If it is a better solution, set the current node as its parent and promptly update h(n) and g(n).If it's not a better solution, take no further action.④Save the path.According to the algorithm described above, running it through Matlab produces the resulting path, as shown in Figure4.

Figure 4 .
Figure 4. Discovering the Optimal Path with Prior Knowledge of the Map Overview

Figure 5 .
Figure 5. Map with Regularized Obstacles after Obstacle ProcessingAfter regularizing the obstacles, the path planning is still achieved using the A* algorithm, following the same approach as in Section 5.1 for dealing with known map overviews and regular obstacles.Running the algorithm in Matlab yields the path as shown in Figure6.In the figure, the red indicates the path for navigation, and the green represents the expanded nodes.

Figure 6 .
Figure 6.Discovering the Optimal Path with Unknown Map Overview and Regular Obstacles

Figure 7 .
Figure 7. .Shortest Path in an Unknown Map Overview with Regular ObstaclesThe D* algorithm is well-suited for finding optimal paths while avoiding obstacles in unknown environments.Due to its adaptability to the environment, it often enables finding the optimal path without the need to explore the entire global map, significantly reducing the number of search points.However, when the unknown environment is quite large, the use of the D* algorithm for reverse path search can rapidly increase the time complexity, leading to a significant reduction in algorithm efficiency.Additionally, in real-world environments, the complexity of the environment is typically higher, and the D* algorithm currently cannot perform detailed planning for global path traversal

Figure 8 .
Figure 8. Shortest Path in an Unknown Map with Irregular Obstacles

Table 1 .
Model Symbol Information Table If the destination node is in the Openlist table at this point, the optimal path has been found.If the Openlist table is empty, it indicates that there are no nodes left to expand, indicating an unreachable state.Establish a priority queue for the Openlist table, sorting it based on the heuristic function h(n), ensuring that the nodes expanded each time have the smallest heuristic function value.Expand the current node, remove it from the Openlist table, and add it to the Closelist table.
table contains nodes that have already been expanded.② Initially, place the starting node into the Openlist table.③ Continuously repeat the following process: Check if the current node is either the destination node or in an unreachable state.Evaluate the eight neighboring nodes of the current node as follows: >>If a child node cannot be reached, ignore it.>>If a child node is already in the Closelist table, ignore it.>>If a child node is not in the Openlist table, add it to the Openlist table for further expansion and calculate its heuristic function value for sorting.