## 3 The Proposed Solution Method Using the PA-Jaya Algorithm
### The General Idea of Java Algorithm  
The Jaya algorithm was developed based on the thought that, during each iteration, the solution for a given problem should move toward the best solution and avoid the worst solution. Considering a general optimization problem, it is assumed that at any iteration \(i\), the number of design variables is \(N\) and the population size is \(M\). If \(p_{m,n}^{(i)}\triangleq p_{i,m,n}\) is the value of the \(n\)-th \((n=1,2,\cdots,2N)\) variable for the \(m\)-th \((m=1,2,\cdots,M)\) candidate during the \(i\)-th iteration, then this value is updated according to the following formula.  
\[p_{i,m,n}^{\prime}=p_{i,m,n}+r_{1}(p_{i,\text{best},n}-|p_{i,m,n}|)-r_{2}(p_{i,\text{worst},n}-|p_{i,m,n}|), \tag{11}\]  
where \(p_{i,\text{best},n}\) is the value of the \(n\)-th parameter for the best solution and \(p_{i,\text{worst},n}\) is the value of the \(n\)-th parameter for the worst solution in the population. Moreover, \(p_{i,m,n}^{\prime}\) is the new value of \(p_{i,m,n}\), and \(r_{1}\) and \(r_{2}\) are two random numbers whose values are in the range of \([0,1]\), respectively. The term \"\(r_{1}(p_{i,\text{best},n}-|p_{i,m,n}|)\)\" indicates that the solution tries to move towards the best solution, and the term \"\(-r_{2}(p_{i,\text{worst},n}-|p_{i,m,n}|)\)\" shows that the solution tries to avoid the worst solution. The two random numbers \(r_{1}\) and \(r_{2}\) provide the Jaya algorithm with the ability to perform a random search within the search space, theoretically ensuring that the algorithm can converge to the global optimal solution. In addition, the exploration capability of the Jaya algorithm is further improved by utilizing the absolute value of the candidate solution. \(p_{i,m,n}^{\prime}\) is accepted if the function value it produces is better. Let \(P_{i,m}=\{p_{i,m,n}\}_{n=1}^{2N}\), \(P_{i,m}^{\prime}=\{p_{i,m,n}^{\prime}\}_{n=1}^{2N}\), and \(J(\cdot)\) be the fitness evaluation function; then, it can be expressed as  
\[P_{i+1,m}=\begin{cases}P_{i,m}^{\prime},&\text{if }J(P_{i,m}^{\prime})>J(P_{i,m})\\ P_{i,m},&\text{if }J(P_{i,m}^{\prime})\leqslant J(P_{i,m})\end{cases} \tag{12}\]  
The Jaya algorithm updates the candidate solution by comparing the modified solution and its corresponding old solution. A given candidate solution is updated only when the fitness of its modified solution is better than that of the old one, in which case it is updated to the value of the modified solution. Otherwise, it keeps the value of the old one [33].  
Afterward, the same procedure is followed for all the candidates in the population. Obviously, this means that only the best solutions are forwarded as input to the next iteration. In other words, the Jaya algorithm always tries to get closer to success (i.e., reaching the best solution) and tries to avoid failure (i.e., moving away from the worst solution). The algorithm struggles to become victorious by reaching the best solution: it is from this aspect that Jaya draws its name. The update procedure of the Jaya algorithm is shown in Algorithm 1. Compared with some traditional evolutionary algorithms, e.g., GA and PSO, there is no requirement for algorithm-specific parameters in Jaya, which is the biggest advantage of this algorithm [33; 40; 41; 42; 43].  
```
Input: population matrix \(P\), population size \(M\), the number of variables \(2N\), fitness vector \(f\), the best and worst solution vectors: \(p_{\text{best}}\) and \(p_{\text{worst}}\) Output: updated population matrix \(P\), updated fitness vector \(f\) for\(m:=1\) to \(M\)do for\(n:=1\) to \(2N\)do  Choose a random number \(r_{m,n,1}\) from [0,1];  Choose a random number \(r_{m,n,2}\) from [0,1]; \(p^{\prime}_{m,n}=p_{m,n}+r_{m,n,1}(p_{\text{best},n}-|p_{m,n}|)-r_{m,n,2}(p_{ \text{worst},n}-|p_{m,n}|)\); endfor \(f^{\prime}_{m}=f(P^{\prime}_{m})\); if\(f^{\prime}_{m}>f_{m}\)then for\(n:=1\) to \(2N\)do \(p_{m,n}=p^{\prime}_{m,n}\); endfor \(f_{m}=f^{\prime}_{m}\); endif endfor
```  
**Algorithm 1** Jaya update procedure.