# Path Optimization Using Metaheuristic Techniques for a Surveillance Robot
## 5 Simulation Results
### Optimization Methods Comparison  
To conclude this section of results, it was considered interesting to compare them with those collected in previous works. Specifically, the research carried out by [PERSON] et al. was selected as a benchmark [36] because these authors also used GA, PSO, and PS.  
Unlike our study that seeks to cover a specific space, these authors addressed the problem of finding the shortest path to reach a destination point, but they evaluated the same algorithms and achieved results consistent with ours. Their case study covered a 100x100 grid, similar in number of cells to our high-complexity case. As in our study, they observed that PSO effectively minimized the cost function, followed by PS, and finally GA. Furthermore, it was observed that PS was the fastest method to find a satisfactory solution, followed by GA and PSO. The difference with our study lies in the fact that GA managed to find a viable solution faster than PSO. However, this discrepancy can be attributed to differences between the two problems.  
To make a fairer comparison, the cost function used in that article was applied to our problem. Since the objective of the two studies is not the same, it was necessary to modify it slightly. The sum responsible for minimizing sudden changes in direction was replaced by the percentage of vigilance (Equation (9)). This cost function was applied to our problem to analyze which of the two is more effective.  
\[f_{c}=\left\{\begin{aligned} &\alpha\sum_{i=1}^{n-1}L_{i}+\beta(100- \%_{\text{Filled}})+\gamma f_{\text{semi}}& if\sum_{i=1}^{n}D_{i}\ \
eq 0\\ &\alpha\sum_{i=1}^{n-1}D_{i}+\beta(100-\%_{\text{Filled}})& if\sum_{i=1}^{n}D_{i}=0\end{aligned}\right. \tag{9}\]  
where \(L_{i}\) is the length of the \(i\)-segment, \(f_{\text{semi}}\) is a penalty factor (1000) in case of collision with an obstacle, and \(\alpha,\ \beta\), and \(\gamma\) are weighting coefficients that establish the minimization importance of each term. In this case, all of them take the value of \(1\). As the function considers the summatory of \(L_{i}\), the total travelling distance is minimized.  
Table 5 compares the results provided by the fitness function of Equation (9) with the one proposed in this work (7). The results have been obtained in the low-complexity room for two hours of simulation.  
Figure 16: High-complexity room coverage: Genetic Algorithm coverage (**a**), Particle Swarm coverage (**b**), and Pattern Search coverage (**c**).  
The comparison shows that our method is more efficient in terms of travel time reduction. In the case of PS, it can be seen that the total distance is greater than in the other two cases. This is because the path length has not been minimized in this study. The other two algorithms, GA and PSO, found solutions with more changes in direction, while PS proposed straighter trajectories.  
The fitness function adapted from [36], on the other hand, minimized the distance, but still only in the case of PS a longer trajectory was found. An interesting point here is that GA and PSO obtain better lengths even with a fitness function that does not minimize this parameter directly (7). The total trajectory time, a parameter that minimizes the proposed function, is lower in all cases.