Mazes are puzzles that require a generous amount of time to locate an optimal route that leads from the start point to the end node. Pathfinding algorithms are often employed to find the optimal solution route. This study aims to compare the performances of the A* and IDA* (Iterative Deepening A*) algorithms in solving two distinct types of mazes: straightforward and complex. Additionally, four different heuristics (1/2 Manhattan, Chebyshev, Euclidean, and Octile distances) were utilised in conjunction with these algorithms to estimate the cost of any node in the maze to the target node. The findings revealed that Octile distance provided the best approximation among the four heuristics tested, followed by Euclidean, Chebyshev, and 1/2 Manhattan. All mazes used in this study were of size \(18\times 18\) . In cases where the mazes had straightforward paths, the IDA* algorithm outperformed the A* algorithm by a margin of 31.41% to 48.43% when using the Octile distance. On the other hand, for complex mazes, A* algorithm computed the optimal path faster than the IDA* algorithm by at least 99.68% to 99.86%. Furthermore, both A* and IDA* algorithms demonstrated faster computations when the applied heuristic had a higher initial value and a greater increment rate. These results suggest that A* is generally better for complex mazes, while IDA* may be preferable for straightforward mazes under memory-constrained environments.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Benchmarking Shortest Path Solutions in Mazes: A* vs IDA* Algorithms

  • Lee Siaw Chong,
  • Jessie Heng Xue Yun

摘要

Mazes are puzzles that require a generous amount of time to locate an optimal route that leads from the start point to the end node. Pathfinding algorithms are often employed to find the optimal solution route. This study aims to compare the performances of the A* and IDA* (Iterative Deepening A*) algorithms in solving two distinct types of mazes: straightforward and complex. Additionally, four different heuristics (1/2 Manhattan, Chebyshev, Euclidean, and Octile distances) were utilised in conjunction with these algorithms to estimate the cost of any node in the maze to the target node. The findings revealed that Octile distance provided the best approximation among the four heuristics tested, followed by Euclidean, Chebyshev, and 1/2 Manhattan. All mazes used in this study were of size \(18\times 18\) . In cases where the mazes had straightforward paths, the IDA* algorithm outperformed the A* algorithm by a margin of 31.41% to 48.43% when using the Octile distance. On the other hand, for complex mazes, A* algorithm computed the optimal path faster than the IDA* algorithm by at least 99.68% to 99.86%. Furthermore, both A* and IDA* algorithms demonstrated faster computations when the applied heuristic had a higher initial value and a greater increment rate. These results suggest that A* is generally better for complex mazes, while IDA* may be preferable for straightforward mazes under memory-constrained environments.