Overview of four path planning algorithms: A*, Dijkstra's, Potential Fields, and Probabilistic Roadmap (PRM). The algorithms were tested on a grid-based environment, and their performance was compared in terms of path length and computation time.
A* is a heuristic-based search algorithm that finds the optimal path between a start and goal node. It uses a cost function that combines the actual cost from the start to the current node (g-cost) and an estimated cost from the current node to the goal (h-cost). A* expands nodes with the lowest total cost (f-cost = g-cost + h-cost) first, making it efficient and guaranteeing the optimal path if the heuristic is admissible.
Mathematically, the cost function for A* can be represented as:
Dijkstra's algorithm is a classic graph search algorithm that finds the shortest path between nodes in a weighted graph. It starts from the start node and expands nodes in order of their distance from the start. Dijkstra's algorithm is guaranteed to find the optimal path but explores all possible paths, making it less efficient than A* in large environments.
The core of Dijkstra's algorithm lies in the update of the tentative distances. For each node
The Potential Fields algorithm represents the environment as a field of attractive and repulsive forces. The goal exerts an attractive force, while obstacles exert repulsive forces. The algorithm guides the robot along the gradient of the potential field towards the goal while avoiding obstacles. Potential Fields is computationally efficient but may suffer from local minima and may not always find the optimal path.
The total potential field
The attractive potential is typically defined as a quadratic function:
The repulsive potential is usually defined as an inverse quadratic function: $$U_{rep}(q) = \begin{cases} \frac{1}{2}k_{rep}\left(\frac{1}{d(q, q_{obs})} - \frac{1}{d_0}\right)^2 & \text{if } d(q, q_{obs}) \leq d_0 \ 0 & \text{if } d(q, q_{obs}) > d_0 \end{cases}$$
where
PRM is a sampling-based algorithm that constructs a roadmap of the environment by randomly sampling points and connecting them with collision-free paths. The start and goal positions are then connected to the roadmap, and a graph search algorithm (like Dijkstra's or A*) is used to find the optimal path. PRM is suitable for complex environments and can efficiently handle high-dimensional spaces.
The PRM algorithm consists of two main phases:
-
Sampling phase: Random configurations
$q_{rand}$ are generated in the free space of the environment. The number of samples is a user-defined parameter. -
Connection phase: Each sampled configuration
$q_{rand}$ is connected to its$k$ nearest neighbors$q_{near}$ within a specified radius$r$ . The connections are made using a local planner that checks for collision-free paths between the configurations.
After the roadmap is constructed, the start and goal configurations are connected to the roadmap, and a graph search algorithm is used to find the optimal path.
The algorithms were tested on a grid-based environment, and the following results were obtained:
| Algorithm | Path Length (meters) | Computation Time (seconds) |
|---|---|---|
| A* | 11.90 | 1.9076 |
| Dijkstra's | 11.90 | 26.2737 |
| Potential Fields | 11.90 | 0.0207 |
| Probabilistic Roadmap | 11.58 | 70.1667 |
Based on the results, we can observe the following:
-
A* and Dijkstra's algorithms found the same optimal path length of 11.90 meters, but A* was significantly faster than Dijkstra's. This is because A* uses a heuristic to guide the search towards the goal, while Dijkstra's explores all possible paths.
-
The Potential Fields algorithm also found a path of 11.90 meters but had the fastest computation time of 0.0207 seconds. However, it's important to note that Potential Fields may not always find the optimal path and can get stuck in local minima.
-
The Probabilistic Roadmap (PRM) algorithm found a slightly shorter path of 11.58 meters but had the longest computation time of 70.1667 seconds. This is because PRM spends time constructing the roadmap by sampling points and connecting them before running the graph search.
In conclusion, the choice of algorithm depends on the specific requirements of the application. If finding the optimal path is crucial and computation time is not a constraint, A* or Dijkstra's algorithm can be used. If a fast solution is needed and optimality is not a strict requirement, Potential Fields can be a good choice. For complex environments or high-dimensional spaces, PRM can be effective but may require more computation time.
The mathematical foundations of each algorithm provide insights into their behavior and performance. A* uses a cost function that combines actual and estimated costs, Dijkstra's algorithm updates tentative distances, Potential Fields relies on attractive and repulsive potentials, and PRM constructs a roadmap through sampling and connection phases. Understanding these mathematical concepts can help in selecting and implementing the most suitable algorithm for a given path planning problem.
