## 3 The Proposed Solution Method Using the PA-Jaya Algorithm
### PA-Jaya for the Fundamental Issue in the Cognitive OFDM Radio Network
```
Input: population matrix \(P\), population size \(M\), the number of variables \(2N\), the number of inner loops \(T\), 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\(t:=1\) to \(T\)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 if\(P^{\prime}_{m}\) meets constraints (5) and (6) then  break; endif endfor \(f^{\prime}_{m}=J(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 2** The improved asynchronous Jaya update procedure. ```
0: population matrix \(P\), the number of subpopulations \(S\), the number of population iterations \(D\), the number of iteration intervals of subpopulation information exchange \(Q\)
```
0: updated population matrix \(P\) for\(i:=1\) to \(D\)do for\(s:=1\) to \(S\)do  Update \(P_{s}\) with the improved asynchronous Jaya algorithm; endfor if\(i\bmod Q=0\)then for\(s:=1\) to \(S\)do  Replace the worst individual solution in \(P_{s}\) with the global best individual solution; endfor endif endfor ```  
**Algorithm 3** The improved PA-Jaya update procedure. Figure 2 presents a schematic diagram for using the PA-Jaya algorithm to achieve optimization for the cognitive OFDM radio network power allocation model. The basic steps of the solution method are as follows. **Step 1: Parameter setting. ** It starts with the setting of initial parameters, including the number of secondary users \((K)\), the number of variables \((2N)\), population size \((M)\), the number of population divisions \((S)\), the number of inner loops \((T)\), the number of iteration intervals of subpopulation information exchange \((Q)\), and the algorithm termination criterion. For the current situation, the termination criterion is set as the maximum number of iterations \((D)\), which means that the algorithm is terminated when it iterates more than this value. **Step 2: PA-Jaya initialization. ** Initial values of individual solutions can be randomly generated under the constraints in Equations (5) and (6). After finishing the same operation for all the variables in the whole population, the solutions matrix is well initialized. **Step 3: Fitness evaluation. ** Once all the candidate solutions are initialized, every individual solution is evaluated with the fitness function. Considering the practical problem in this article, the fitness function's purpose is to get the maximum object value according to Equation (3). **Step 4: Solution update. ** In each parallel subpopulation, by comparing the fitness function value of each candidate solution, we can easily select the best and the worst solutions. Hence, we are able to modify the old solution with the proposed asynchronous Jaya iteration strategy. Let \(P_{i,m}=\{p_{i,m,n}\}_{n=1}^{2N}\), \(p^{\prime}_{i,m}=\{p^{\prime}_{i,m,n}\}_{n=1}^{2N}\), and let \(J(\cdot)\) be the mathematical operation in Equation (3), respectively. Then, the update of the candidate solution is checked by assessing  
\[J(P^{\prime}_{i,m})>J(P_{i,m}). \tag{14}\]  
If Equation (14) is met, \(p^{\prime}_{i,m}\) will be applied to the basic power allocation model; that is to say, the candidate solution will be updated through \(p_{i+1,m}=p^{\prime}_{i,m}\). Otherwise, it retains the original value. Generally, the traditional Java updates its best and worst individuals after the entire population has been updated. Compared with this, PA-Jaya updates the best value in every single individual calculation, and it can be seen as an asynchronous update strategy. In addition, a maximum number of loops in the inner layer is set to reduce infeasible solutions with the purpose of further accelerating the speed of convergence in PA-Jaya.