Comparison of Breadth-First Search (BFS) and Depth-First Search (DFS) Algorithms for Shortest Search in Campus Labyrinth
Ardhan Aghsal Dwi Putra, Andhika Nur Maulana, Shasha Billa Febrianti, Nabila Camelia, Sabastian Kaka Hutagalung, Ahsanun Naseh Khudori · Journal of Enhanced Studies in Informatics and Computer Applications · 2025
Finding the shortest path in a complex campus environment is a challenge, especially for new students who are not familiar with the layout of buildings and available paths. Efficient path finding can help improve mobility on campus, especially in areas with many branching paths and possible dead ends. In this study, an analysis of the shortest path search was conducted by comparing the Breadth-First Search (BFS) and Depth-First Search (DFS) algorithms in a campus environment represented as a maze-shaped graph. The research methods include literature study, simulation design, data collection, algorithm implementation, and performance evaluation based on execution speed, memory usage, and processor efficiency. Data were obtained from field surveys and secondary studies on campus layout. Simulations were conducted by implementing BFS and DFS in a graph model to measure the effectiveness of both algorithms. The results show that DFS has advantages in execution speed and lower memory usage, while BFS is more consistent in finding optimal solutions. DFS is more suitable for scenarios with fast search time requirements, while BFS is more effective in ensuring the shortest path in an environment with a complex graph structure. The conclusion of this study emphasizes that the selection of algorithms must be adjusted to the specific needs of navigation applications.