## 3 Algorithm and Platform
### Distributed Algorithm
\(\textbf{P}_{i}\) and \(\textbf{P}_{g}\) are determined by Equations (9) and (10):  
\[\textbf{P}_{i}=\underset{\textbf{x}_{i}(t)}{\text{argmin}}\{f_{fit}(\textbf{x }_{i}(t))|t=1,2,\cdots,current\ iteration\ \} \tag{9}\]  
\[\textbf{P}_{g}=\underset{\textbf{x}_{i}(t)}{\text{argmin}}\{f_{fit}(\textbf{x }_{i}(t))|t=current\ iteration,i=1,2,\cdots,M\,\} \tag{10}\]  
To avoid the local convergence \(\textbf{P}_{u}\), the global optimal solution of the whole population is necessary, which is defined as Equation (11):  
\[\textbf{P}_{u}=\underset{\textbf{x}_{i}(t)}{\text{argmin}}\{f_{fit}(\textbf{x }_{i}(t))|t=1,2,\cdots,current\ iteration\,i=1,2,\cdots,M\} \tag{11}\]  
In this paper, constriction factor \(\chi\) is adopted to replace the \(\omega\) in the classic PSO; \(\chi\) is determined by Equation (12):  
\[\chi=\frac{2}{\Big{|}2-\varphi-\sqrt{\varphi^{2}-4\varphi}\Big{|}},\varphi=c_ {1}+c_{2},\varphi>4 \tag{12}\]  
Particles could update the velocity according to Equation (13):  
\[\textbf{v}_{i}(t+1)=\chi[\textbf{v}_{i}(t)+c_{1}r_{1}(\textbf{P}_{i}-\textbf{ x}_{i}(t))+c_{2}r_{2}(\textbf{P}_{g}-\textbf{x}_{i}(t))]+c_{3}r_{3}(\textbf{P}_{u} -\textbf{x}_{i}(t)) \tag{13}\]  
where \(c_{3}\geq 0\) is the acceleration coefficient of the whole particle population, \(r_{3}\) is a random number in [0, 1]. Furthermore, in order to allow the particles to search for a larger range at the beginning of the iteration and to converge quickly at a later stage, two factors are introduced into this algorithm, \(\lambda_{n}\) and \(\lambda_{p}\). Concretely, updating the equation for velocity and position, it is modified to:  
\[\left\{ \begin{array}{l}\textbf{v}_{i}(t+1)=\tanh(\frac{\lambda_{n}}{t}) \cdot\chi[\textbf{v}_{i}(t)+c_{1}r_{1}(\textbf{P}_{i}-\textbf{x}_{i}(t))+c_{2 }r_{2}(\textbf{P}_{g}-\textbf{x}_{i}(t))]+\tanh(\frac{t}{\lambda_{p}})\cdot c _{3}r_{3}(\textbf{P}_{u}-\textbf{x}_{i}(t))\\ \textbf{x}_{i}(t+1)=\textbf{x}_{i}(t)+\textbf{v}_{i}(t+1)\end{array} \right. \tag{14}\]  
Obviously, in Equation (14), when the iteration begins, \(t\) is rather small, \(\tanh(\frac{\lambda_{n}}{t})\) approaches 1 and \(\tanh(\frac{t}{\lambda_{p}})\) approaches 0, which leads to a relatively large influence of \(\textbf{P}_{g}\), and \(\textbf{P}_{u}\) is lightweight, which benefits the exploration of the whole particle population. Later, when \(t\) becomes large, the opposite situation occurs, so that the particles accelerate convergence. P-PSO can be stopped when the global optimal solution \(\mathbf{P}_{u}\) does not change (the difference between two adjacent iterations is lower than the pre-specified threshold, Equation (15)), or a maximum number of iterations is reached. \[\left\|\mathbf{P}_{u}(t)-\mathbf{P}_{u}(t-1)\right\|_{2}^{2}<\varepsilon \tag{15}\]  
Since \(f(\mathbf{x}_{i}^{k})\) in Equation (8) can be computed at every node locally, the parallelization is restricted to the computation of \(\mathbf{P}_{i}\), \(\mathbf{P}_{g}\) and \(\mathbf{P}_{u}\), which are global variables and needed to broadcast. However, they are rather easy to compute by Equations (8)-(11), and thus the overall algorithm can be achieved in a purely decentralized fashion.