# An Overview of Variants and Advancements of PSO Algorithm
## 2 Concept of Particle Swarm Optimization (PSO) Technique
### Working Example of PSO
\) and \(\mathrm{f}_{\mathrm{best}}\;=\;35\) Iteration 2 (Second Solution):To Calculate v\({}_{2}^{(2)}\), \(\chi_{2}^{(2)}\)  
\[ \begin{array}{ll}\text{v}_{2}^{(2)}&=\text{wv}_{2}^{(1)}\,+\,\text{c}_{1}\text {r}_{1}\,(\text{p}_{\text{best, }2}^{(1)}\,-\,\text{X}_{2}^{(1)})\,+\,\text{c}_{2}\text{r}_{2}\,(\text{g}_{ \text{best}}\,-\,\text{X}_{2}^{(1)})\\ &=\,\left[-0.1\,\,\,\,\,1.3\,\,\,\,\,-6.3\,\,\,\,\,-1.2\right]\\ \text{X}_{2}^{(2)}&=\,\text{X}_{2}^{(1)}\,+\,\text{v}_{2}^{(2)}\\ &=\,\left[3\,\,\,\,1\,\,\,9\,\,\,\,7\right]\,+\,\left[-0.1\,\,\,1.3\,\,\,-6.3 \,\,\,-1.2\right]\\ &=\,\left[2.9\,\,\,2.3\,\,\,2.7\,\,\,5.8\right]\in[0,10]\\ \text{f}(\text{X}_{2}^{(2)})&=\,\text{8.41}\,+\,5.29\,+\,7.29\,+\,\,33.64\,=\, 54.63\\ \end{array} \]  
Update p\({}_{\text{best}}\) as f\({}_{\text{p}_{\text{best}}\,^{2}}^{(2)}\,\,=\,\,\text{54.63}\,<\,\text{f}_{ \text{p}_{\text{best}}\,^{2}}^{(1)}\,=\,\text{140}\)  
No updation in g\({}_{\text{best}}\) as f\({}_{\text{best}}\,\,=\,\,35\,\,<\,\text{f}_{\text{p}_{\text{best}}\,^{2}}^{(2)}\, =\,\,\text{54.63}\)  
\[\therefore\,\,\text{g}_{\text{best}}\,\,=\,\left[0\,\,\,\,\,3\,\,\,\,\,\,1\,\, \,\,5\right]\text{ and f}_{\text{g}_{\text{best}}}\,\,=\,\,35\]  
Iteration 2 (Third Solution):  
\[ \begin{array}{ll}\text{v}_{3}^{(2)}\,\,=\,\text{wv}_{3}^{(1)}\,+\,\text{c}_ {1}\text{r}_{1}\,(\text{p}_{\text{best, }3}^{(1)}\,-\,\text{X}_{3}^{(1)})\,+\,\text{c}_{2}\text{r}_{2}\,(\text{g}_{ \text{best}}\,-\,\text{X}_{3}^{(1)})\\ \,\,=\,\left[4.9\,\,\,2.8\,\,\,0.7\,\,\,2.8\right]\\ \,\,=\,\left[4.9\,\,\,5.8\,\,\,1.7\,\,\,7.8\right]\in[0,10]\\ \text{f}(\text{X}_{3}^{(2)})\,\,=121.38\\ \end{array} \]  
No updation in p\({}_{\text{best}}\) as f\({}_{\text{p}_{\text{best}}\,}^{(2)}\,\,=\,\,121.38\,>\,\text{f}_{\text{p}_{\text{ best}}\,^{(1)}\,\,=\,\,35}^{(1)}\)  
No updation in g\({}_{\text{best}}\)\(\therefore\,\text{g}_{\text{best}}\,\,=\,\,\left[0\,\,\,\,\,3\,\,\,\,\,1\,\,\,\, 5\right]\text{ and f}_{\text{g}_{\text{best}}}\,\,=\,\,35\)  
Iteration 2 (fourth Solution):  
\[ \begin{array}{ll}\text{v}_{4}^{(2)}&=\,\text{wv}_{4}^{(1)}\,+\,\text{c}_{1} \text{r}_{1}\,(\text{p}_{\text{best, }4}^{(1)}\,-\,\text{X}_{4}^{(1)})\,+\,\text{c}_{2}\text{r}_{2}\,(\text{g}_{ \text{best}}\,-\,\text{X}_{4}^{(1)})\\ &=\,\left[-0.3\,\,\,0.6\,\,\,-1.75\,\,\,-1.7\right]\\ \,\,=\,\left[1.7\,\,\,1.6\,\,\,2.25\,\,\,7.3\right]\in[0,10]\\ \text{f}(\text{X}_{4}^{(2)})&=\,\,2.89\,+\,\,2.56\,+\,\,5.0625\,+\,\,53.29\,=\, 63.8025\\ \end{array} \]  
Update p\({}_{\text{best}}\) as f\({}_{\text{p}_{\text{best}}\,^{2}}^{(2)}\,\,4\,\,=\,\,63.8025\,\,<\,\text{f}_{ \text{p}_{\text{best}}\,^{(1)}\,\,4}^{(1)}\,=\,\,102\\ \text{No updation in g\({}_{\text{best}}\)\(\therefore\,\text{g}_{\text{best}}\)\(=\,\left[0\,\,\,\,\,3\,\,\,\,\,\,1\,\,\,\,\,5\right]\text{ and f}_{\text{g}_{\text{best}}}\,=\,\,35}^{(2)}\)  
Iteration 2 (fifth Solution):  
\[\begin{array}{ll}\text{v}_{5}^{(2)}&=\,\text{wv}_{5}^{(1)}\,+\,\text{c}_{1} \text{r}_{1}\,(\text{p}_{\text{best, }5}^{(1)}\,-\,\text{X}_{5}^{(1)})\,+\,\text{c}_{2}\text{r}_{2}\,(\text{g}_{ \text{best}}\,-\,\text{X}_{5}^{(1)})\\ &=\,\left[-6.5\,\,\,4.5\,\,\,-1.7  
\[\mathrm{X}= \begin{bmatrix}0&5.745&0&10\\ 0&3.42&0&4.48\\ 0&5.786&0&5.668\\ 0&2.566&0&4.418\\ 0&6.4448&0.825&5.9858\\ \end{bmatrix} \mathrm{X}_{3}^{(3)}\quad\mathrm{f(X)}= \begin{bmatrix}133.005\\ 31.7668\\ 65.604024\\ 26.10308\\ 78.046\\ \end{bmatrix} \]  
\[\mathrm{P}_{\mathrm{best}}^{(2)}= \begin{bmatrix}4&0&0&8\\ 0&3.42&0&4.48\\ 0&3&1&5\\ 0&2.566&0&4.418\\ 0&6.4448&0.825&5.9858\\ \end{bmatrix} \mathrm{P}_{\mathrm{best},\,2}^{(3)}\quad\mathrm{f}_{\mathrm{best} }= \begin{bmatrix}80\\ 31.7668\\ 35\\ 26.103088\\ \end{bmatrix} \]  
Similarly, other iterations can be performed. This example is solved completely up to the third iteration only. This is the just the explanation of the working of particle swarm optimization (PSO) algorithm through an example. It is not possible to obtain an optimal solution by manual calculations. Further iterations can be performed through proper software for the PSO algorithm.