# Path Optimization Using Metaheuristic Techniques for a Surveillance Robot
## 5 Simulation Results
### Results in Scenario (c): High-Complexity Room  
According to Table 4, the PS algorithm is able to find a good solution faster and with fewer iterations than the others. However, in this more complex case it is the PSO algorithm that obtains the best solution in eight hours. It gives 86.7% of covered space, while Pattern Search and the GA reach 85% and 84%, respectively.  
With a significantly greater complexity and size of the environment than in the previous two cases, the results change. It is no longer the local search (PS) algorithm that offers the best results but rather PSO gives the route with the greatest coverage. It should be noted that, given the size of the space, the lack of reference points, and the limited range of the radar, in this experiment the quality of the optimization was evaluated based on the percentage of the trajectory traveled.  
Looking at Table 4, PS was the fastest algorithm to find a solution without collisions with obstacles. This can be attributed to the good choice of the initial trajectory. Figure 13c shows the initial trajectory (blue) and a small number of collisions can be observed. On the other hand, if the initial solution had been very far from a possible optimized solution, PS would have been the worst option. It may not even converge to a feasible trajectory.  
Finally, the GA is the one that has given the worst results in all three cases. In summary, the best option for a simple case is PS and for a complex case PSO. This final conclusion makes it clear that a hybrid PSO-PS algorithm can be a very good option for this problem. It could converge to an optimal solution in a complex environment, and once the possible outcome is found, the local feature of PS will refine it.  
This room is significantly larger than the others and thus, the algorithms take much longer to converge to a good solution. The PS algorithm is the fastest.  
On the other hand, the GA is the one that takes longer to find an optimized solution. It should be recalled that this has also been the case in the two previous cases. This is shown in Figure 14.  
Figure 15a-c show the different trajectories offered by each algorithm after eight hours of computation. In the case of the complex room, the PSO gives the most optimized trajectory, but the difference between the values of the cost functions is very small. As in previous cases, those that present the greatest double rerun distance are the ones that give the most inefficient results. In cases like this, with a large space, the optimization is slower and in eight hours of computation it is not possible to reach the most optimal solution. Even so, it is interesting to get a glimpse of how the algorithms behave in this type of environment. It should be noted that, although in this case the best behavior is that of PSO, all three methods provided good trajectories.  
Figure 13: Trajectories in the medium-complexity room: Genetic Algorithm trajectory (**a**), Particle Swarm trajectory (**b**), and Pattern Search trajectory (**c**).  
After eight hours of calculation, a possible trajectory was obtained by each algorithm. None of them achieved total coverage because in such a large space, they would need more points (>32), more time, or a greater sensor range. However, given the impossibility of total coverage, the algorithms obtained high coverage. The GA achieved 84%, the PSO method covered 86.7% of the space and with PS we reached 85%. Figure 16 shows the best solutions found for each algorithm.  
As previously mentioned, the PSO algorithm has obtained the best trajectory. This can be seen in Figure 16a-c. If we compare them, we can see that in Figure 16b there are fewer dark blue areas than in Figure 16a,c, which represent uncovered space.  
Figure 14: High-complexity room. Cost function evolution.  
Figure 15: Trajectories in the high-complexity room: Genetic Algorithm trajectory (**a**), Particle Swarm trajectory (**b**), and Pattern Search trajectory (**c**).