## 6 Graphical Representation of Implemented Pathfinding Algorithms
In addition, it can be seen that as the grid size increases, the difference in the execution times of Greedy BFS and others increases significantly. Figure 16 shows a graph that compares the performances of the four implemented Algorithms by taking the obstacles into consideration. The 4 \(\times\) 4 grid system with obstacles shows that the execution time for [PERSON]'s is 15.17 ms, for A-star is 12.92 ms, for BFS is 13.9 ms, and Greedy BFS is 14.25 ms. From this, we can see that in the 4 \(\times\) 4 system alone with obstacles, the A-star Algorithm performed the best among all Algorithms. The worst performing was [PERSON]'s. BFS was the second best and Greedy BFS was third best in performance. Only for the 4 \(\times\) 4 system, the performances of all Algorithms were very similar since execution time differences were small. Figure 15: Graphical representation of pathfinding Algorithms without obstacles. The 8 \(\times\) 8 grid system with obstacles shows that the execution time for [PERSON]'s is 102.6 ms, for A-star is 91.35 ms, for BFS is 120.54 ms, and Greedy BFS is 40.19 ms. From this, we can see that in the 8 \(\times\) 8 system alone with obstacles, the BFS Algorithm was the worst in terms of performance. The Greedy BFS Algorithm performed the best among all Algorithms. A-star was the second best and [PERSON]'s was third best in performance. In addition, the performance of A-star and [PERSON]'s was almost similar for 8 \(\times\) 8 system as there was very little difference in execution times. The 16 \(\times\) 16 grid system with obstacles shows that the execution time for [PERSON]'s is 743.47 ms, for A-star is 512.45 ms, for BFS is 663.76 ms, and Greedy BFS is 298.61 ms. From this, we can see that for the 16 \(\times\) 16 system, the Greedy BFS Algorithm again performed the best among all Algorithms. [PERSON]'s Algorithm performed the worst. A-star was the second best and BFS was third best in performance. The 32 \(\times\) 32 grid system with obstacles shows that the execution time for [PERSON]'s is 5678.25 ms, for A-star is 3975.34 ms, for BFS is 5316.65 ms, and Greedy BFS is 1396.73 ms. From this, we can see that in the 32 \(\times\) 32 system, the Greedy BFS Algorithm again performed the best among all Algorithms. Once again, [PERSON]'s Algorithm performed the worst. A-star was the second best and BFS was third best in performance again. It can be seen that as the grid size increases, the difference in the execution times of Greedy BFS and others increases significantly. Furthermore, the performance of BFS and [PERSON]'s was again almost similar for the 32 \(\times\) 32 system as there was very little difference in execution times. In this system, the A-star Algorithm's performance was also close to [PERSON]'s and BFS again. From Figure 16, we can conclude that on average, the overall fastest pathfinding Algorithm for with obstacles, which required the least average memory and least average execution time, was Greedy Best First Search. However, the Greedy Best First is not optimal. Figure 16: Graphical representation of pathfinding Algorithms with obstacles. The worst Algorithm on average for without obstacles requiring most memory usage was [PERSON]'s Algorithm. The second-best Algorithm was found to be A-star, followed by Breadth First Search. Moreover, it can be seen that as the grid size increases, the difference in the execution times of Greedy BFS and others increases significantly. Pre-processing is one of the main problems in pathfinding, thereby making complex pathfinding in real-time difficult [85]. Most of the pathfinding engines are unable to handle worlds in dynamic environments and have difficulty in producing movements which look realistic [86]. The main reason this happens is because of the pre-processing stages where the nodes for the pathfinder are produced to travel based on the representation of maps in a static environment. However, if a node is covered along the predetermined path by a dynamic obstacle, the agent will think it can walk where the object is located [87,88].