Pathfinding is a critical problem in robotics, artificial intelligence, and network optimization. This paper presents a comparative evaluation of three popular algorithms: Ant Colony Optimization (ACO), Particle Swarm Optimization (PSO), and A* search. Implemented in MATLAB, the study analyzes their performance in terms of path length, execution time, convergence behavior, and adaptability under both static and dynamic grid environments. Results indicate that A* consistently provides the shortest paths with minimal computation time, ACO demonstrates robustness in dynamic environments, and PSO offers a balance between accuracy and efficiency. The findings contribute to the selection of suitable algorithms for real-world applications in robotics, multi-agent systems, and intelligent navigation.
Introduction
Pathfinding is a core challenge in AI, robotics, and computer science. It involves finding the most efficient route from a source to a destination in environments that may contain obstacles.
Method: Models flocking behavior; particles move based on personal and global best.
Strengths: Good balance between speed and solution quality.
Weaknesses: May yield near-optimal (not always best) paths.
III. Simulation Setup (in MATLAB)
Environment: 20×30 grid with 20% random obstacles.
Start Node: (1,1); Goal Node: (20,30).
Each algorithm tested under identical conditions to ensure fair comparison.
IV. Results & Comparison
Criteria
A*
PSO
ACO
Path Length
37 steps (Shortest)
48 steps
64 steps (Longest)
Execution Time
0.0037 sec (Fastest)
0.0068 sec
0.418 sec (Slowest)
Adaptability
Poor in dynamic environments
Moderate
Excellent (Best)
Convergence
Deterministic
Fast convergence
Slower, adaptive convergence
Figure Highlights:
Fig. 3(a): A* is fastest, followed by PSO; ACO is slowest.
Fig. 3(b): A* produces the most optimal path; ACO the least.
Fig. 3(c): Shows how each algorithm converges differently (pheromones, particle alignment, node expansion).
Conclusion
This work presented a MATLAB-based comparative evaluation of three widely used pathfinding algorithms: Ant Colony Optimization (ACO), Particle Swarm Optimization (PSO), and A*. Each algorithm was analyzed in terms of path length, execution time, convergence behavior, and adaptability within a grid-based simulation environment.
The results demonstrate that the A algorithm* consistently provides the shortest path with the least computation time, making it the most efficient method for static and well-structured environments. The ACO algorithm, though slower, exhibits strong adaptability in dynamic scenarios, where obstacles change over time, thereby ensuring reliable path discovery in uncertain conditions. The PSO algorithm offers a balanced compromise, achieving near-optimal results with moderate computational effort and stable convergence performance. From this comparative study, it is clear that the selection of an appropriate pathfinding algorithm depends on the nature of the application environment. For applications requiring guaranteed shortest paths in static grids, A* is preferable. For systems operating in dynamic and unpredictable environments, ACO is more suitable, while PSO can be applied where a trade-off between speed and optimality is acceptable.
Future work can extend this research by implementing hybrid pathfinding approaches, combining the deterministic efficiency of A* with the adaptive intelligence of ACO and PSO. Additionally, deploying these algorithms on real-time robotic platforms and multi-agent navigation systems will further validate their performance in practical scenarios.
References
[1] Ziyao Li, “Improved Ant Colony Algorithm for Emergency Rescue Vehicle Routing,” Proceedings of International Conference on Computer and Communication Technologies, 2010.
[2] Rohan Shakiba, Mehrdad Saadatzi, Benyamin Ghojogh, “Path Planning for Humanoid Soccer Robots using Particle Swarm Optimization,” International Conference on Advanced Robotics, 2013.
[3] Risma Septiana, Yuslena Sari, Eko Didik Widianto, “Optimization of A Algorithm for Routing in Wireless Sensor Networks,”* International Journal of Computer Applications, Vol. 141, No. 12, 2016.
[4] Peng-Fei Li, Shu-Qin Li, Qian-Sheng Fang, “Improved Ant Colony Algorithm for Ship Weather Routing,” International Journal of Naval Architecture and Ocean Engineering, Vol. 10, No. 2, 2018.
[5] Jinyu Tang, Xiaodong Liu, Wenlong Fu, “An Improved Ant Colony Algorithm with Weighted Penalty Strategy,” Journal of Intelligent & Fuzzy Systems, Vol. 38, 2020.
[6] Dorigo, M., Maniezzo, V., and Colorni, A., “Ant System: Optimization by a Colony of Cooperating Agents,” IEEE Transactions on Systems, Man, and Cybernetics, Vol. 26, No. 1, pp. 29–41, 1996.
[7] Kennedy, J., and Eberhart, R., “Particle Swarm Optimization,” Proceedings of the IEEE International Conference on Neural Networks, 1995.
[8] Hart, P. E., Nilsson, N. J., Raphael, B., “A Formal Basis for the Heuristic Determination of Minimum Cost Paths,” IEEE Transactions on Systems Science and Cybernetics, Vol. 4, No. 2, pp. 100–107, 1968.