## 5 Analysis of Algorithms for Finding Maze Solutions  
Choosing an optimal algorithm to solve the generated maze was necessary to optimize the application's performance. The solving time of one hundred mazes generated with varying dimensions, ranging from 5 to 30 cells per axis, was analyzed. This process was performed for each algorithm and each instance of the maze, with the total duration calculated by summing up the individual times. The device utilized for the simulation remained unchanged from the preceding section. An examination of the solution time utilizing the Recursive call algorithm reveals that the time is comparable for the majority of algorithms, except for instances when the labyrinth is created by the Sidewinder algorithm, in which case, the time is even quicker when the Binary Tree algorithm generates the maze. For solving the maze with the dead-end filling algorithm, the solution size is similar regardless of which algorithm has been used to generate the maze. These are depicted in Figure 20.  
Figure 19: Comparison of algorithm ratios by movement type. Figure 20: Comparison of solution times: Recursive call algorithm (**left**) vs. dead-end filling algorithm (**right**). Using the Dijkstra algorithm to compute distances consistently yields comparable results across all techniques (Figure 21). The exceptions are the generated Recursive backtracker mazes that require more time to solve. The times of solving the maze differ for a solving algorithm depending on the algorithm used to generate it. Therefore, an additional analysis is conducted. The Recursive call algorithm demonstrates the most optimal performance for mazes generated by the Binary Tree algorithm (Figure 22), whereas the dead-end filling algorithm exhibits the least favorable performance. Expanding the size of the maze amplifies this disparity. The Sidewinder algorithm mazes deliver comparable outcomes to the Binary Tree algorithm mazes, however, with a slightly inferior performance by the Recursive call algorithm that is closer to the Dijkstra algorithm. Both algorithms are appropriate for solving these mazes. The Binary Tree and Sidewinder algorithms show bias in their structure by producing elongated corridors extending along the edges. This bias also results in a significant number of dead ends, leading to suboptimal performance for the dead-end filling algorithm. All methods demonstrate comparable efficiency when navigating through the mazes generated by the Aldous-Broder algorithm and the Wilson algorithm (Figure 23). Both algorithms utilize a predominantly random selection strategy to construct mazes, ensuring the avoidance of bias. The obtained results support this fact. Increasing the number of mazes enhances the diversity, preventing the solving algorithms from taking advantage of predictable patterns. If a particular algorithm demonstrates greater efficiency with one maze, the subsequent maze may present a higher difficulty level. When there are many mazes, the performance tends to level. Figure 21: Comparison of solution times for Dijkstra algorithm. Comparable outcomes are demonstrated when the mazes are generated using the Hunt and Kill algorithm, which resembles the Aldous-Broder algorithm and utilizes random direction selection. The distinction lies in the necessity of choosing among unvisited cells. The distinction between the solving algorithms becomes evident when solving the recursive backtracker mazes (Figure 24). The dead-end filling algorithm re  
Figure 23: Maze solving comparison of Aldous–Broder mazes (**a**) and Wilson mazes (**b**). Figure 22: Comparison of solution times: Binary Tree mazes (**a**) and Sidewinder mazes (**b**). peatedly shows superior performance regardless of maze sizes. This is because these types of mazes contain limited pathways that lead to a dead end. By comparison, the mazes produced by the Binary Tree algorithm and the Sidewinder algorithm have numerous dead ends, whilst the Dead-end filling technique exhibits the poorest performance.