## 3 The Proposed Solution Method Using the PA-Jaya Algorithm
### PA-Jaya for the Fundamental Issue in the Cognitive OFDM Radio Network  
With the analysis mentioned in Section 2, the basic spectrum resource allocation problem discussed in this article can be modeled as a constrained optimization problem. Hence, the problem can be transformed into finding a user's corresponding power allocation scheme for \(p_{k,n}\) under the premise of satisfying the constraints in order to maximize the total transmission rate of all secondary users. In the process of using evolutionary algorithms to solve problems, the coding representation of the individual population and the setting of the fitness function are crucial components. Therefore, here, we first specify these two parts. According to the requirements mentioned above, the power allocation scheme can be expressed as a matrix of \(K\times N\) dimensions. It can be expressed as  
\[P= \begin{bmatrix}p_{1,1}&p_{1,2}&\cdots&p_{1,N-1}&p_{1,N}\\ p_{2,1}&p_{2,2}&\cdots&p_{2,N-1}&p_{2,N}\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ p_{K,1}&p_{K,2}&\cdots&p_{K,N-1}&p_{K,N}\end{bmatrix} , \tag{13}\]  
where the row of the matrix represents the user \(k\) (\(k=1,2,\cdots,K\)), the column represents the subcarrier \(n\) (\(n=1,2,\cdots,N\)), and each element of the matrix \(p_{k,n}\) represents the power obtained by the user \(k\) on the subcarrier \(n\). According to the constraint described by Equation (4), one subcarrier can be occupied by only one user; that is to say, there can be only one nonzero element per column of this matrix. Hence, we only considered those nonzero elements in the model. Here, for convenience, we represent each solution individual in the population with a matrix of size \(1\times 2N\), in which the first \(N\) elements are in the range of \([1,K]\), indicating how the \(N\) subcarriers are assigned to the \(K\) users. The next \(N\) elements represent the specific power values allocated to each subcarrier. According to Equations (5) and (6), these variables should be in the range of \([0,p_{\text{total}}]\) and \([0,\frac{I_{\text{th}}}{P_{\text{th}}}]\). Then, the structure of the population can be depicted as in Figure 1.  
Since the basic spectrum resource allocation problem discussed in this article can be clearly expressed as a constrained maximization problem, we chose Equation (3) as the fitness evaluation function of the proposed PA-Jaya algorithm. Considering the specificity of the individual coding methods in this article, it is necessary to perform special processing when using the PA-Jaya algorithm for a population update. That is, the first \(N\) elements need to be rounded after each update, and they are bounded within \([1,K]\). The next \(N\) elements are only bounded within \([0,p_{\text{total}}]\). The remaining constraints are judged after the whole population is generated, and the fitness value is set to 0 for the individual solutions that do not meet the requirements. All individual solutions need to be compared with the corresponding individual solutions before the population update, and those with larger fitness values enter the next iteration. Meanwhile, the best individuals and the worst individuals in the population are also updated. The proposed PA-Jaya algorithm, as an improvement to the traditional Jaya algorithm, aims to speed up the convergence of the algorithm by updating the values asynchronously with a parallelized structure and by reducing infeasible solutions through an inner loop iteration strategy. Motivated by the successful work of improving the convergence speed using asynchronous iteration in PSO [44; 45], in the proposed PA-Jaya algorithm, the update of the best individual solutions is not performed only after the whole population update is completed, but is performed after each individual solution updates. Immediately after each individual solution update is completed, it is compared with all individual solutions of the previous generation, and the best individual is selected to update the subsequent individual solutions.