# Comparison Study of the PSO and SBPSO on Universal Robot Trajectory Planning
## 2 Materials and Methods
### Serendipity-Based Particle Swarm Optimization
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline
**Size of** & & & & & & & & & & & & \\
**Population** & & & & & & & & & & & & \\ \hline \multirow{3}{*}{20} & \multirow{3}{*}{1000} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{PSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{SBPSO} & \multirow{3}{*}{SBPSO} \\  & & \(1.2196\) & \(3.7821\) & \(1.4324\times 10^{-4}\) & \(0.1692\) & \(0\) & \(3.9673\) & \(0\) & \(1.2226\) & \(1.3323\) & \(1.0284\) & \(9.2371\) \\  & & \(\times 10^{-31}\) & \(\times 10^{-316}\) & \(57.7381\) & \(1.4324\times 10^{-4}\) & \(0.1692\) & \(0\) & \(3.9673\) & \(0\) & \(\times 10^{-14}\) & \(\times 10^{-18}\) & \(\times 10^{-10}\) \\  & & & & & & & & & & & \\ \hline \multirow{3}{*}{200} & \multirow{3}{*}{2000} & \multirow{3}{*}{\(\times 10^{-11}\)} & \multirow{3}{*}{\(\times 10^{-22}\)} & \multirow{3}{*}{\(150.7192\)} & \multirow{3}{*}{\(2.8091\)} & \multirow{3}{*}{\(0.0185\)} & \multirow{3}{*}{\(0\)} & \multirow{3}{*}{\(20.6732\)} & \multirow{3}{*}{\(0\)} & \multirow{3}{*}{\(2.0678\)} & \multirow{3}{*}{\(1.0736\)} & \multirow{3}{*}{\(1.0736\)} & \multirow{3}{*}{\(1.1024\)} & \multirow{3}{*}{\(8.8818\)} \\  & & \(\times 10^{-11}\) & \(10^{-312}\) & & & & & & & & \\ \hline \multirow{3}{*}{30} & \multirow{3}{*}{1000} & \multirow{3}{*}{\(\times 10^{-22}\)} & \(3.9011\) & \multirow{3}{*}{\(29.6739\)} & \multirow{3}{*}{\(10.4076\)} & \multirow{3}{*}{\(0.0287\)} & \multirow{3}{*}{\(0\)} & \multirow{3}{*}{\(4.6732\)} & \multirow{3}{*}{\(0\)} & \(3.6771\) & \(2.2204\) & \(0.4030\) & \(\times 10^{-16}\) \\  & & \(\times 10^{-22}\) & \(\times 10^{-31}\) & & & & & & & & \\ \hline \multirow{3}{*}{2000} & \multirow{3}{*}{2000} & \multirow{3}{*}{\(\times 10^{-22}\)} & \(9.7813\) & \multirow{3}{*}{\(131.6743\)} & \multirow{3}{*}{\(1.9692\)} & \multirow{3}{*}{\(0.0532\)} & \multirow{3}{*}{\(0\)} & \multirow{3}{*}{\(37.8871\)} & \multirow{3}{*}{\(0\)} & \(1.8586\) & \(4.5530\) & \multirow{3}{*}{\(1.1258\)} & \multirow{3}{*}{\(1.1258\)} & \multirow{3}{*}{\(9.7320\)} \\  & & \(\times 10^{-28}\) & \(\times 10^{-31}\) & & & & & & & & \\ \hline \multirow{3}{*}{50} & \multirow{3}{*}{1000} & \multirow{3}{*}{\(\times 10^{-28}\)} & \(2.5243\) & \multirow{3}{*}{\(23.5431\)} & \multirow{3}{*}{\(\times 10^{-4}\)} & \multirow{3}{*}{\(0.0659\)} & \multirow{3}{*}{\(0\)} & \multirow{3}{*}{\(1.9591\)} & \multirow{3}{*}{\(0\)} & \(4.2327\) & \(2.3592\) & \(\times 10^{-16}\) & \(6.1342\) & \(\times 10^{-18}\) \\ \cline{1-1} \cline{5-12} \clineFigure 11 show the contour path with avoid collision for universal manipulator robot UR5. ## 4 Conclusions

This paper developed a Serendipity-Based Particle Swarm Optimization (SBPSO) variant of the traditional PSO in order to prevent the premature convergence of optimization procedures. The algorithm based on an approach with two dimensions of the serendipity concept: intelligence and chance. The intelligence dimension implemented by inspections at the adjacencies of the gBest particle. The chance dimension implemented by using the particles to improve search space exploration. After the studies were completed, it was shown that the SBPSO outperformed the standard PSO. To make these comparisons, two criteria were analyzed: convergence and stagnation. In the convergence criterion, when the Griewank and Rastrigin were evaluated, the SBPSO algorithm found the global solutions faster than the PSO algorithm. For the Sphere, Rosenbrock, HappyCat and Ackley functions, none of them found the optimal solutions. However, the SBPSO algorithm found very satisfactory solutions when compared with PSO. The evaluation of the stagnation criterion in the Sphere function showed that when the SBPSO was compared with the traditional PSO, it was delayed at least 21%.