Evaluating the Computational Efficiency and Precision of Pathfinding Algorithms
Evaluating the Computational Efficiency and Precision of Pathfinding Algorithms
Abstract: AI pathfinding is essential for autonomous transport and many other industries, for example, bot movement inside
video games, navigation, and logistics in mapping applications. This paper compares DFS (depth-first search), BFS
(breadth-first search), Dijkstra, and A* (A-star) algorithms. A* uses adaptive training to locate the direction needed to
move from the start point to the endpoint, and proceeds to move only in that direction. Dijkstra and BFS expand in all
directions, updating the least recent node in the case of BFS, or at random with Dijkstra. Lastly, DFS has a set algorithm
with a priority of directions that update on the most recent node. The objective of pathfinding is to help the algorithm
navigate from point A to point B in a manner where it does not cross obstacles, but still in the fastest time. Results are still
ongoing in this ever-changing field; however, in conclusion, A* has proved to be the most efficient at balancing speed with
results. Results from the analysis prove that A* was the fastest at completing the computing and traversing while loading
the fewest number of nodes. DFS took the longest and Dijkstra loaded the most nodes and took the longest to compute.
How to Cite: Atharv Patil. (2025). Evaluating the Computational Efficiency and Precision of Pathfinding Algorithms. International
Journal of Innovative Science and Research Technology, 10(2), 360-367.
https://doi.org/10.5281/zenodo.14915594.
In the future, RFS could be expanded on by adding a 2 has blocks that slow down the path of the user to a speed of
radius around the starting and ending points. Any path going 50% normal when they are in contact. Trial 3 has on top of
behind these coordinates would be checked and therefore may blocks that slow down the user by 55% also blocks that
not be solvable with the current model that was run. This reduce the speed of movement by 75% when in contact. All
radius could adapt depending on the length between the set the blocks are procedurally generated using noise rounded to
points. Additionally, more focus could be put on prioritizing a 0 or 1 value to around ¼ of the total pixel area each. The
nodes toward the point, in an algorithm combining more nodes modifier is trained to be punished for going
through linear search with an adaptive algorithm such as A, onto slower tiled squares.
allowing fewer nodes to be checked, which could enable RFS
used in various applications. Additionally, all trials were run on the same computer
for computing consistency. The setup of noise allows for
V. EMPIRICAL ANALYSIS random variation, allowing for fair results across all
algorithms. This allows the trials to mimic a random 2d grid
Table 1 consists of 5 runs per trial, each with different of obstacles and varying traffic. This is applicable to
conditions⁵. The conditions for the trial involve a trial area navigation within a large city, where some areas can not be
where the user begins starting at the bottom left and making traversed such as buildings, and others such as intersections,
their way to the top right. The user can move in all four have high traffic slowing down the time of crossing between
directions as well as diagonally to the top right, top left, points. The results depicted below were performed by each
bottom right, and bottom left. Trial 1 consists of only barrier algorithm on a grid.
blocks that inhibit the path of movement through them. Trial
The computing time shows algorithms that searched algorithm variations were the fastest, with A* Manhattan
more nodes that were irrelevant towards the position of the being the fastest with an average of 0.025 seconds. A* in
ending node took longer to compute. The computing time particular was able to adapt to the slower nodes that were
shows that Dijkstra took the longest along across all the added as it was able to factor them into its distancing height
algorithms, with an average of 0.129 seconds. This is because, map and was trained to avoid them, making computing faster.
on a rectangular grid, Dijkstra searches mostly towards the This also meant the breadth of the A* path was wider, due to
axes of the starting node, farthest from an end path node the interruptions discouraging certain paths of the path; it was
that is Orthodiagonal, and had to search all nodes to find therefore more branched out. This led to A* having a
the ending path. RFS took the second longest as it had to significantly varying number of nodes checked, from 536 to
compute many terms in an ordered list before checking every 1045. Furthermore, accounting for the speed of the node in
time if it had exceeded the limit past the endpoint. This was A* made its computing speed slower than DFS (due to
contrasted by BFS which searched with an arc toward the calculations having to be made using the height map) on the
end node and did not have to frequently check leading to third trial even though DFS searched more than 4500 nodes
faster computing time. DFS was faster than BFS as it was able compared to the two A* algorithms searching less than 1000
to not have to continuously check for position while scanning nodes on average.
nodes, and had to continue on a linear path. Both A*
The traversing time was largely impacted by the amount need for different pathfinding models for different regions, as
of traffic, with each consecutive trial having more traffic and this empirical analysis was mostly testing an environment
therefore taking longer to traverse. The amount of time it took similar to that of a city. Testing also showed how all
to navigate the grid was highest for DFS by a large margin algorithms met previous expectations outlined for their uses,
due to the linear pattern of its search going through every reinforcing their importance in their sectors. In the future,
possible path to the left of the shortest one. Dijkstra took an these algorithms could be advanced by searching fewer
average of 9.45 seconds per path, due to it not scanning all nodes, which would reduce computation time, and this could
the nodes around the finishing node, only allowing it to be implemented with more node network training data to have
find paths that approached in one direction to the final more experienced programs. Additionally, punishments and
node. Likewise, this was seen with RFS and BFS which rewards during training could be increased to have the
scanned a similar set of nodes approaching primarily from programs only search the proper nodes necessary for the
one expected path, leading to close results in terms of speed. optimal path. Moreover, in different scenarios, such as in 3d
A* Manhattan was fastest with an average time of 6.88 and and in cases where nodes are arranged in various angles.
trial 1 had the fastest time of 5.26 seconds. A* Euclidean had There could be more emphasis placed on the grid-like
an average of 7.58 seconds due to less punishment in the training, to have programs familiar with basic pathfinding
model for diverting routes compared to Manhattan. The which can be applied to different scenarios, possibly through
height map-like reward systems for the A* allowed them to machine learning. How will these algorithms be advanced in
have the fastest traversing speeds by searching the most the future⁶ and how might they shape our understanding of
crucial nodes to the fastest path. A* was generally able to how to best navigate from point A to B? How will the
perform the best in all categories as it was best suited for a introduction of new software such as enhanced machine
grid-like pathfinding simulation. A paper from Trilogi learning affect the needs for these algorithms to fulfill in the
University16 found similar results when comparing BFS, A*, forthcoming years?
and Dijkstra. On their second level of pathfinding on a 2d
grid, A* scanned the least nodes, less than 23 than that of BFS ACKNOWLEDGMENTS
and Dijkstra and was the fastest to compute while still finding
the optimal solution. “A* is the best algorithm in pathfinding, We would like to thank Dr. Srikanth Krishnan for his
especially in Maze game/grids. This is supported by the help on this project as well as Billy Gao.
minimal computing process needed and a relatively short
searching time” (6, Permana). REFERENCES
The results also demonstrate RFS to be a viable [1]. Morgan, Graham, et al. “Game Engineering -
contender for a linear searching algorithm. This is because it Newcastle University.” 2: Pathfinding; Game
checks the area of the nodes completely between the two Engineering;, Newcastle University,
points rather than A* which uses an adaptive path. This is research.ncl.ac.uk/game/mastersdegree/gamete
useful for applications in areas where mistakes can afford to chnologies/aitutorials/2pathfinding/. Accessed 2 Aug.
be made, such as probe surgery. RFS also had the best 2024.
traveling time with the exclusion of A* and would be closer https://research.ncl.ac.uk/game/mastersdegree/gamet
to it in speed given more training with the node network. On echnologies/aitutorials/2pathfinding/AI%2020Simple
average, it was noticed to have a slower learning curve than %20Pathfinding.pdf
the other models with the node network. This was probably [2]. Team, Lark Editorial. “Some Common Pathfinding
due to the large amounts of nodes it would repetitively scan Algorithms.” Lark, Lark Suite, 26 Dec. 2023,
each time, most of which were irrelevant to the solution. www.larksuite.com/en_us/topics/ai-glossary/some-
common-pathfinding-algorithms.
VI. CONCLUSION https://www.larksuite.com/en_us/topics/ai-glos
sary/some-common-pathfinding-algorithms AI,
Pathfinding algorithms contrast in speed of computing Pathfinding, algorithms This article talked about the
and pathfinding efficiency. They use many different models history and use of pathfinding programs. It also
and training sets to realize what they are. They also each have mentioned how they work with the pros and cons
designated uses tailored to what they are required for. The provided.
algorithms of DFS, BFS, Dijkstra, and A* have allowed many [3]. Botea, Adi, et al. “Pathfinding in Games.” DROPS,
advancements in the field of pathfinding and the applications drops.dagstuhl.de/entities/document/10.4230/D
they are suited to. The results show that A* was the fastest FU.Vol6.12191.21. Accessed 25 July 2024.
algorithm with DFS and Dijkstra having elements of the https://drops.dagstuhl.de/entities/document/10.
slowest. They also displayed how RFS could be a viable 4230/DFU.Vol6.12191.21. Pathfinding, Games, AI
algorithm to expand on for thorough linear search purposes. Talks about the use of pathfinding for bot characters
RFS could be expanded upon by making the algorithm use in commercial games. Also mentions the main
elements of A* to not search nodes that were straying too far elements of a basic approach to pathfinding which
from the endpoint, while still maintaining a row-by-row includes having a map, ways to sense surroundings,
linear search for fast computing. These results highlighted the and an algorithm to be the brain and evaluate the
navigation of traffic changing the pace of computing and action.
traversing time. This was applicable as it could highlight the
[4]. Graham, Ross, et al. “Pathfinding in Computer [10]. Wikipedia Contributors. “A* Search Algorithm.”
Games.” ARROW@TU Dublin, Wikipedia, Wikimedia Foundation, 28 June 2024,
arrow.tudublin.ie/itbj/vol4/iss2/6/. Accessed 2. Aug. en.wikipedia.org/wiki/A*_search_algorithm#:~:text=
2024. https://arrow.tudublin.ie/itbj/vol4/iss2/6/ 13%20External%20links-,Histo
Computer, Pathfinding This article is about the design ry,algorithm%20for%20Shakey’s%20path%2
of AI pathfinding technologies concerning game 0planning. Accessed 10 Aug. 2024. Algorithm,
design. Use of top-down simulations similar to my part Formula Gives the mathematical equation for A* and
of the secondary data analysis. the history of the development. Also provides more
[5]. “Pathfinding Using AI Algorithms.” Baza Wiedzy understanding of path trees and the reward and search
Politechniki Warszawskiej, 1 Jan. system of A*.
1970,repo.pw.edu.pl/info/bachelor/WUTc1a5c774c8 [11]. Aglubagerry. “A* Search Real-Life Application.”
442e78b129cbde56fc1fa/. Medium, Medium, 10 Oct. 2023,
https://www.google.com/url?sa=t&rct=j&q=&e medium.com/@aglubagerry/a-search-re al-life-
src=s&source=web&cd=&ved=2ahUKEwj47J application-2bd175624952. Algorithm, Applications
SAxNWHAxV2STABHauKEX0QFnoECBUQAQ& Provides examples of the real-life applications of A*.
url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Frepo.pw.edu.pl%2Fdocstore Also depicts how A* is used in specific cases and how
%2Fdownload%2FWUT8aeb20bbb6 it is essential to those tasks.
964b7da1cfefbf2e370139%2F1-s2.0- [12]. Schulz, Frank & Wagner, Dorothea & Weihe, Karsten.
S0952197617301227- (1999). Dijkstra’s Algorithm On-Line: An Empirical
main.pdf&usg=AOvVaw15nWVV Case Study from Public Railroad Transport.
ZFQgr6W7gB91Mc7s&opi=89978449 Neural Algorithm Engineering. 1668. 110-123. 10.1007/3-
Network, AI Talks about the detection of body parts 540-48318-7_11. Algorithm, Applications,
which is useful in being able to differentiate different Pathfinding Compare the distances with the
objects when pathfinding. It also provides a graph on pathfinding of German public railroads. Describes the
the tree of detection. application of Dijkstra's algorithm in this use case.
[6]. Stout, Bryan. “Smart Moves: Intelligent Pathfinding.” [13]. Burger, Alewyn & de Villiers, Anton & Vuuren, J.H..
Gamasutra - Smart Moves: Intelligent Pathfinding, (2013). Two algorithms for secure graph domination.
Game Developer Magazine, July 1997, JCMCC. The Journal of Combinatorial Mathematics
folk.idi.ntnu.no/agnar/it272/pekere/local/pathfi and Combinatorial Computing. 85. Algorithm,
nding.htm. Pathfinding, Algorithms Shows the Applications Uses DFS to differentiate parts of a
differences in training costs for maneuvering models search tree. Checks for specific categories using DFS
around obstacles. Demonstrates how pathfinding logic and provides the results of the tree with symbols.
of punishments and incentives work to change. [14]. Abd Algfoor, Zeyad & Sunar, Mohd Shahrizal &
[7]. Anisyah, Ani Siti, et al. “Route Optimization Kolivand, Hoshang. (2015). A Comprehensive Study
Movement of Tugboat with A∗ Tactical Pathfinding in on Pathfinding Techniques for Robotics and Video
Spin 3D Simulation | Request PDF.” Games. International Journal of Computer Games
Researchgate.Net, research gate, Dec. 2015, Technology. 2015. 1-11. 10.1155/2015/736138.
www.researchgate.net/publication/307802157_Route Pathfinding, Simulation, Reward Systems Reviews the
_optimization_movement_of_tugboat_with_A_tactic last 10 years of pathfinding algorithms and their
al_pathfinding_in_SPIN_3D_simulation. development. Gives areas for future growth and
Pathfinding, Reward Systems, Simulation current areas being explored. Delves into real-life
Demonstrates the optimization of a tugboat using A*. examples in robotics and video games.
This is shown by using fuel as a punishment to [15]. Kilic, Kemal & Mostarda, Leonardo. (2021). Heuristic
influence the tugboat to choose the shortest path. Drone Pathfinding Over Optimized Charging Station
[8]. “View of Cooperative Pathfinding.” Aaai.org, 2024, Grid. IEEE Access. 1-1.
ojs.aaai.org/index.php/AIIDE/article/view/1872 10.1109/ACCESS.2021.3134459. Pathfinding,
6/18503. Accessed 10 Aug. 2024. Pathfinding, Applications Uses a grid of nodes on a 2d field as
Collective This paper shows the difference in different pathfinding heuristics for the indoor drone. Calculates
pathfinding algorithms of A*. Demonstrates the charging times factored in for the overall speed of the
difference within variations of incentive models, indoor drone path. Additionally, this paper provides
including Manhattan and Elucid. information on having multiple heuristics monitored
[9]. Geeks for Geeks. “Breadth First Search or BFS for a at once using various metrics. algorithm results, as
Graph.” Geeks for Geeks, Geeks for Geeks, 20 Mar. well as a history of all algorithms and their
2012, www.geeksforgeeks.org/breadth-first-search- applications.
or-bfs-for-a-graph/. Accessed 10 Aug. 2024. [16]. Permana, Silvester & Bintoro, Ketut & Arifitama,
Algorithms, Pathfinding Shows the time necessity as Budi & Syahputra, Ade. (2018). Comparative
a punishment/reward for BFS. Also provides code in Analysis of Pathfinding Algorithms A *, Dijkstra, and
various languages for BFS to disclose how the reward BFS on Maze Runner Game. IJISTECH (International
system works while using a node map to simplify the Journal Of Information System & Technology). 1. 1.
algorithm. 10.30645/ijistech.v1i2.7. Algorithms, Collective
Compares A*, Dijkstra, and BFS to find what