Joint Relay Selection and Power Allocation through a Genetic Algorithm for Secure Cooperative Cognitive Radio Networks

In cooperative cognitive radio networks (CCRNs), there has been growing demand of transmitting secondary user (SU) source information secretly to the corresponding SU destination with the aid of cooperative SU relays. Efficient power allocation (PA) among SU relays and multi-relay selection (MRS) are a critical problem for operating such networks whereas the interference to the primary user receiver is being kept below a tolerable level and the transmission power requirements of the secondary users are being satisfied. Subsequently, in the paper, we develop the problem to solve the optimal solution for PA and MRS in a collaborative amplify-and-forward-based CCRNs, in terms of maximizing the secrecy rate (SR) of the networks. It is found that the problem is a mixed integer programming problem and difficult to be solved. To cope with this difficulty, we propose a meta-heuristic genetic algorithm-based MRS and PA scheme to maximize the SR of the networks while satisfying transmission power and the interference requirements of the networks. Our simulation results reveal that the proposed scheme achieves near-optimal SR performance, compared to the exhaustive search scheme, and provides a significant SR improvement when compared with some conventional relay selection schemes with equal power allocation.


Introduction
Cognitive radio networks (CRNs) [1] generally consists of primary users (PUs) and secondary users (SUs), which can potentially solve the spectrum scarcity problem. In CRNs, the SUs opportunistically access the spectrum and utilize the spectrum for their own data transmission. The idea of improving radio resources and the data rate has recently been attracting researchers and industries. Cognitive radio (CR) effectively uses the radio resource by adopting an interweave, overlay and underlay spectrum access (SA) techniques [2]. Among them the interweave SA technique does not allow the SUs to utilize the PUs spectrum. In the overlay SA technique, SUs opportunistically use the spectrum resources while the PUs are not using them. Whereas, in the underlay SA technique, the SUs are allowed to transmit their own data simultaneously despite the presence of the PUs until the interference induced by the SUs transmissions remain bellow an acceptable level (denoted as interference threshold) of the PU receiver. CR and cooperative communications (CC) may provide smart solutions for efficient utilization of spectrum resources. In CC, the source use a cooperative node to transmit source information to the intended destination. It can also decrease the interference by subsiding the transmission power of the source. In cooperative cognitive radio networks (CCRNs), the SU source needs to send information secretly to the SU destination with the aid of cooperative SUs relay. The objective of physical layer security in wireless communications is to enable secure causing high complexity and ES (due to high computational time) as well as undesired delays to solve the optimization problem. Therefore, a low-complexity meta-heuristic GA-based scheme is proposed in this paper to solve the optimization problem. • We develop a meta-heuristic GA to overcome the difficulty arising from the MIP problem due to the coexistence of binary integer and real valued variables in the problem.

•
To comprehensively evaluate the SR performance of the proposed scheme, we compare the proposed scheme with opportunistic RS (ORS), partial RS (PRS), and random RS schemes according to the different node locations, numbers of SU relays, maximum permissible transmission power of the SUs, interference thresholds for the PU receiver, variances of the additive white Gaussian noise (AWGN).

•
We propose a low complexity GA-based solution which can solve the optimization problem very efficiently with much lower computational complexity and shows a near optimal performance with ES scheme.

•
We verify through simulation results that, the proposed scheme achieves highest SR performance than some other conventional schemes with a much lower computational complexity than the ES scheme.

•
It is also shown that the computation time of the proposed scheme is effectively reduced until when the maximum SR of the considered CCRNs is archived.
The remainder of this paper is prepared as follows. Some related works are reviewed in Section 2. The system model and problem formulation are shown in Section 3. The proposed GA-based MRS and PA scheme is briefly described in Section 4. Simulation results and the computation complexity analysis of all compared schemes are presented in Sections 5 and 6 concludes the paper with future research directions.

Related Works
The SR maximization problem is a well-researched topic for future wireless networks but it has not been deeply investigated in CWSNs and CCRNs.

SR Maximization of CWSNs and CCRNs
In CWSNs, the secrecy sum rate maximization of a MIMO networks through a relay node in the presence of a passive eavesdropper with analog network coding (ANC) was studied in [9]. Secure transmission approaches for several levels of eavesdropped channel state information (CSI) at the transmitter were evaluated by the authors. Similarly, two-phase distributed beamforming in a two-way relay network, and PA to enhance the secrecy sum rate of the data exchange were proposed in [10]. Three different schemes (namely, optimal beamforming, null-space beamforming, and artificial noise beamforming) were evaluated to show the performance of the SR. However, two of the schemes (with the concept of ANC limits only for CWSNs) do not ensure physical layer security for CCRNs. In CWSNs, energy efficiency and security issues in two-way relying concept was studied in [11] where the eavesdropping attack is being prevented while the legitimate users are transmitting their confidential information. The main objective of the work was to efficiently allocate transmission power and energy to the source and the relay to maximize the secure energy efficiency (EE) of the networks by satisfying the power constraint and the minimum target SR requirement of the networks. Similarly, secure EE maximization for a collaborative AF-based relay networks in the presence of an eavesdropper was studied in [12], where the authors jointly solve the source and relay PA problems by satisfying the maximum permissible transmission power and minimum target SR requirement, respectively. Energy-efficient secure communications over a decode-and-forward relay channel for CWSNs was studied [13] in which secure EE is maximized by satisfying some network constraints and a sub-optimal solution was also proposed to maximize the secure EE of the the networks. Similarly, secure communications in wireless relay networks with considering an eavesdropper was studied in [14] where an optimal PA strategy was proposed to maximize SR of the networks. Power-constrained SR maximization for joint relay and jammer selection in CWSNs was studied in [15] where an intermediate node is selected for data transmission while the others are used as friendly jammers to disrupt an eavesdropper by generating artificial noise. However, the above-mentioned schemes for SR maximization address only cooperative wireless networks [13][14][15]. Therefore, several works have been investigated to improve the SR of CCRNs by selecting the SU relay to forward the signal of the source by allocating optimal power to the SU relays.
In CCRNs, bandwidth efficient relaying technique was proposed by El-Malek et al. [16] in which two PA optimization problems were formulated to minimize the symbol error rate of the PUs and the SUs, along with maximizing the sum rate of the networks. A Lagrangian method [16] was used to solve the problems while satisfying the maximum permissible power budget constraint. However, an optimal solution for PA requires exhaustive search, which involves high computation complexity. Secure cooperative half-duplex cognitive radio networks through exhaustive search was adopted [17] where the k-th best relay is selected for PRS and ORS in order to maximize the SR of the networks. Similarly, RS for security enhancement in cognitive relay networks to demonstrate the performance of the secrecy outage probability was studied [18] where the first selected relay is considered for transmitting secrecy information to the destination and the second selected relay is used as a friendly jammer. A cooperative cognitive radio model for enhancing physical layer security in two-path AF relaying networks was studied in [19] where a Lagrangian multiplier method is formulated to obtain an OPA in order to maximize the SR of the system. In CWSNs, RA algorithm to maximize the SR of the networks was studied in [21] where an OPA is being obtained under satisfying transmission power constraints. To maximize the secrecy data rate, four different networks scenarios were studied with the assumption of imperfect CSI of the eavesdropper links. Secure CC scheme for orthogonal frequency-division multiple access CRNs was studied in [22] where a primary base station secret information is relayed to the distant PUs by the aid of the selected SUs relay while a set of passive eavesdropper coexists in the networks. A frame-based transmission system was considered where the secondary network is incentivized by the primary network if the SUs attend in cooperation with PUs to help some distance PUs to satisfy their SR requirement. Lagrange approach is used for solving the formulated optimization problem to maximize the SR of the PUs and SUs. Similarly, in CCRNs, guaranteed SR for the PUs was studied by Mokari et al. [23] where secondary transmitter secret information is transmitted to the secondary receiver in the presence of a set of SUs relay and the eavesdropper. To solve the non-convex optimization problem, decomposition is used to divide the main problem into three sub-problems and solve the problem efficiently to maximize the SR of the SUs. Nevertheless, the RA, RS, and PA problems of references [21][22][23] are being solved by COTs which require high computational complexity and undesired delays in updating the solutions of the optimization problem. Secrecy throughput maximization for multi-input-single-output CRNs in slow fading channels was studied in [24] where the secrecy throughput of the PU is maximized while satisfying the secrecy outage constraint at the PU and a throughput constraint at the SU. To maximize the secrecy throughput of the PU, adaptive and non-adaptive transmission strategies are proposed when CSI of the eavesdroppers are available. Similarly, cooperative transmission for securing a decode-and-forward two-hop network with the coexistence of multiple cooperative nodes and a potential eavesdropper was studied in [25] where an opportunistic relaying with artificial jamming secrecy scheme is proposed to maximize the ergodic SR of networks. Signal design and optimization techniques of enhancing wireless secrecy via cooperation were studied in [26] where signal processing perspective of physical layer security of cooperative system is overviewed and some future research directions are discussed for CWSNs.

GA for Resource Allocation in CWSNs and CCRNs
To the best of our knowledge, very little works have been done in CCRNs by using a GA. Okati et al. [27] studied a novel GA which can solve the resource allocation (RA) and cooperative node selection problems for maximizing the secrecy capacity of wireless communications networks. The RA and RS problems are jointly studied by Fang et al. [28] for maximizing the capacity of a cooperative wireless networks. To maximize the sum rate of orthogonal frequency division multiplexing-based CWSNs, a GA was proposed by Lai et al. [29] to solve the subcarrier pairing, PA, and RS problems of the system. A GA-based pilot allocation scheme for a massive MIMO system was studied by Zhang et al. [30] in which the sum rate is maximized under the proposed scheme. In CCRNs, a GA for MRS and PA for two-way relaying was studied by Ahmad et al. [31] in which the sum rate of the networks is maximized by satisfying the transmission power and interference requirements of the networks. In CCRNs, a GA-based scheme was jointly proposed by Yan et al. [32] in which a channel allocation and a cooperation set assignment is executed in such a way that for given time, the average transmission rate of the users achieve its maximal fairness. The physical layer security issues of CCRNs and PA method of the users were out of scope of their work. Therefore, GA-based scheme for SU relays selection and PA to the relays of CCRNs is very essential to study jointly to maximize the SR of the networks. In summary, existing works on RS and PA have generally considered COTs or ES to maximize the SR of the networks [9][10][11][12][13][14][15][16][17][18][19][21][22][23][24][25][26]. To the best of our knowledge, a low-complexity solution for MRS and PA for a collaborative AF-based CCRNs is still an open problem. Therefore, a GA-based scheme is proposed in this paper to select the SU relays and PA to the SU relays to maximize the SR of the networks.

System Model
Consider a collaborative AF-based CCRNs in which the transmission power of the SUs are limited. As shown in Figure 1, a SU source s wants to transmit confidential data to the SU destination d with the aid of the selected SU relays r j , where j = 1, 2, 3, ..., L while an eavesdropper e (which is also a SU in the networks) attempts to intercept the transmissions. The PU receiver is labeled as the q-th PU q = 1. The channel gains between the SU source s and the destination d and the eavesdropper e are denoted by h sd and h se , respectively. The SU relays corresponding channel gains between the SU destination d and the eavesdropper e are denoted as h r j d and h r j e , respectively. In an addition, the corresponding interference channel gain (ICG) between the SU source s and the PU receiver q and the ICG between the SU relays r j and the PU receiver q are also denoted as h sq and h r j q , respectively.
In the considered system model, the SU utilizes the spectrum of the PU under its tolerable interference. Due to the limitation of transmission power, efficient PA may be considered in system design to guarantee the efficient utilization of the limited power to protect the interference to the PU receiver. Each user with a single antenna is operated in a half-duplex mode. The SU destination and the eavesdropper employ a maximum ratio combining (MRC) technique to maximize their secrecy capacity. The transmission is thus completed in two phases. In the first transmission phase, the SU source broadcasts data symbol x s to the SU relays and the SU destination. Then, the SU relays amplify the received symbol of the SU source and retransmit it to the SU destination in the second transmission phase. The eavesdropper can overhear both phases of the transmissions because the eavesdropper is also a secondary user. We assume that the SU relays forward the amplified version of the received signal of the SU source in a preassigned orthogonal channel. In a similar fashion as in [11][12][13]18,26], we assume that the perfect CSI about all the channels is available at the receiver for prior transmission.

Problem Formulation
We denote h sd and h se as the channel gain between the SU source and the SU destination and the channel gain between the SU source and the eavesdropper, respectively. Channel gain between the SU source and the j-th SU relay is denoted as h sr j , where the set of SU relays is denoted by j = 1, 2, 3, ..., L. Let h r j d and h r j e stand for the channel gain between the j-th SU relay and the SU destination and the channel gain between the j-th SU relay and the eavesdropper e, respectively. In the first transmission phase, the received signal at the SU destination, the j-th SU relay and the eavesdropper are expressed as where P s is transmission power of the SU source, with n sd , n sr j , and n se are being the AWGN of the related channels, respectively. In this paper, it is assumed that the AWGN is independent for all channels and it follows same distributions of zero mean and variance σ 2 n . During the second transmission phase, each SU relay amplifies received signal y sr j by amplification gain g r j and broadcasts the amplified signal for the SU destination. The eavesdropper in the network can also overhear the information from the j-th SU relay due to the nature of wireless communications medium. Therefore, the received signals at the j-th SU relay and the eavesdropper can be respectively expressed as y r j d = y sr j h r j d g r j + n r j d = √ P s g r j h r j d h sr j x s + g r j h r j d n sd + n r j d (4) y r j e = y sr j h r j e g r j + n r j e = √ P s g r j h r j d h sr j x s + g r j h r j e n r j d + n r j e where n r j d and n r j e are the AWGN related to their respective channels. The amplification gain of the j-th SU relay is defined in [5] as follows where P r j denotes the transmission power of the j-th SU relay. By replacing Equation (6) into Equations (4) and (5), the signal-to-noise ratio (SNR) of the channels related to the h r j d and h r j e can be respectively, obtained by [12] as follows γ r j e = m r j u r j P s P r j n for all j = 1, 2, 3, ..., L. In this paper, we define a binary variable ε r j that indicates the system decision whether the j-th SU relay is selected for signal forwarding or not. Therefore, the binary variable is expressed as In this paper, MRC technique is used to maximize γ r j d and γ r j e , respectively. Therefore, the data rate at the SU destination, R d and the eavesdropper, R e can be expressed as The SR, R sec is defined as In transmission-power and interference-limited CCRNs, we need to transmit information as much as possible by utilizing available transmission power while satisfying the interference requirements of the PU receiver. Moreover, the SR of the networks is also needed to be maximized, and the SR maximization optimization problem of the considered system model can be formulated as max P s, P r j , ε r j R sec (13) subjected to C.1: 0 ≤ P s ≤ P Max SU C.2: 0 ≤ P r j ≤ P Max SU ∀j = 1, 2, 3, ..., L C.3: P s h sq 2 ≤ I Max C.4: C.5: ε r j ∈ {0, 1} ∀j = 1, 2, 3, ..., L where P Max SU and I Max PU are the maximum permissible transmission power of the SUs, and acceptable interference level of the PU receiver, respectively. The C.1 and C.2 are the transmission power constraints of the SU source and the SU relay, respectively, while the C.3 and C.4 represent the interference constraints of the PU receiver during first and second transmission phases of the networks, respectively.

The Proposed GA-based MRS and PA Scheme for CCRNs
Our objective in this paper is to maximize the SR of CCRNs as defined in Equation (12) by satisfying transmission power and the interference requirements of the networks. As is known, the PA at the SU source depends mainly on two constraints: transmission power and the interference constraints as described in Equations (14) and (16). The optimal transmission power of the SU source is defined in [19] as follows In the second transmission phase, we need to select the SU relays and assign power to those selected SU relays to maximize the SR of the network without generating any harmful interference to the PU receiver. The optimization problem during second transmission phase can be further formulated as max P r j , ε r j R sec (20) subject to C.2, C.4, and C.5 The optimization problem in Equation (20) is a MIP problem, where SU RS indicator ε r j and SU relay PA P r j are a binary integer variable and a real valued parameter, respectively. In this paper, a GA-based scheme is proposed to solve the MIP problem. The proposed scheme divides each chromosome into two parts (SU relays selection and PA to the selected SU relays). The genes in the SU relays selection and the PA to those selected SU relays are consist of binary integer strings and a sequence of real numbers, respectively. In the proposed scheme, the genes with having maximum fitness value will be selected as the best SU relays and optimal assignment of transmission power to the selected SU relays to forward the SU source information to the SU destination.
To solve the optimization problem in Equation (20), in the paper we adopt a general GA which includes the initialization of the population, evaluation of fitness function, and some genetic operations, such as the selection, crossover, and mutation [27][28][29]. The GA also requires a repeated iteration process until a near-optimal solution is obtained by the algorithm [30,31]. A pseudo-code of the GA can be given as in Algorithm 1 [31]. Based on the GA, we propose the GA-based MRS and PA scheme for SR maximization. The Figure 2 shows the flowchart of the proposed scheme, which consists of 6 steps as follows: • Step 1 (Initialization): Randomly create populations for all chromosomes ∀ c = 1, 2, 3, ..., T.

•
Step 2 (Evaluation): Calculate the fitness value of each generation of the proposed scheme, and normalize the transmission power of the SU relays to adhere to the constraints in Equations (15) and (17).

•
Step 3 (Selection operation): In the proposed scheme, we use a roulette wheel selection method to breed a new generation to save the best δ chromosome.

•
Step 4 (Crossover operation): Repeat the crossover operation to generate a new population set with a crossover probability P c .

•
Step 5 (Mutation operation) : Repeat the mutation operation to generate a new population set P m .

•
Step 6 (Repeat): The steps of the proposed scheme will be repeated for the next generation until the generation is completed or converged.
In the next sub-section, we will give more detailed descriptions on the implementation of each step. The SU relays selection is comprised of T parent chromosomes, where T is the number of populations. The SU relays selection is comprised of |j| genes and each of the genes is randomly distributed {1, 2, 3, ..., |j|}. The chromosome structure in the SU relays PA is also comprised of |j| genes which are randomly assigned between zero and the maximum admissible transmission power of each SU relay. The admissible transmission power of the j-th SU relay can be calculated as

Step 2: Evaluation
In each generation of the proposed scheme, the fitness value is calculated by substituting ε r j and P r j into Equation (20). Meanwhile, we also normalize the transmission power of the SU relay in this step to satisfy the constraints of Equations (15) and (17). If the constraints are not satisfied, the chromosome will be discarded for the step 3. The normalized transmission power of the SU relay can be determined as

Step 3: Selection Operation
To achieve a better chromosome (solution) or survivor selection, roulette wheel selection is applied to breed a new generation. In roulette wheel selection, the probability that chromosome δ is chosen can be computed as where f (δ) is the fitness value of the chromosome δ. In the proposed scheme, the chromosomes with a lower fitness value (a lower SR) will be discarded, but those with a higher fitness value will survive as parents to generate new offspring.

Step 4: Crossover Operation
In the proposed scheme, a crossover generates new offspring by exchanging genes between two parent chromosomes. The crossover between good parents generates well-performing children, or even better ones. Thus, the parents selected through roulette wheel selection method are used for the crossover to produce offspring with crossover probability P c .

Step 5: Mutation Operation
The mutation operation of the proposed scheme is separated into two parts: integer number mutation for the SU relays selection and the real valued mutation for the SU relays PA. In the mutation step, the generated offspring from the crossover step will be considered for mutation, and the neighboring bits are randomly selected and exchanged with each other, i.e., 1 to 0 or 0 to 1 with mutation probability P m . The offspring then form new population and the fitness of its chromosome will be evaluated before the next evaluation.

Step 6: Repeat
The GA repeats from evaluation step to mutation step until it meets the maximum number generations I g . The chromosome which have maximum fitness value (SR) will be chosen. However, utmost number of genes may not satisfy the constraint in Equation (17), and thus, the SR of those corresponding genes can be zero. In high SNR region, obtaining proper combinations of the genes to fit the constraint is also a challenging task. Therefore, the best string will be selected based on an additional fitness value. The additional fitness value D (c) for each chromosome can be given as Indeed, the best chromosome in this case is the one that provides the lowest D (c) . The gene in SU relays selection and SU relays PA with the maximum fitness value of the chromosome will be selected to transmit information to the SU destination. The proposed GA-based MRS and PA scheme for maximizing the SR of CCRNs is detailed in Algorithm 2.

Algorithm 2:
The proposed GA-based MRS and PA scheme for SR maximization.
1 Input: I Max PU , P Max SU , σ 2 n , L, h sd , h se , h sr j , h r j d , h r j e , h sq , h r j q , I g , T, P c , and P m 2 Initialization: 3 Set, R (c) sec = 0; where c = {1, 2, 3, ..., T} 4 GA Initialization (Step 1) 5 Randomly select ε r j and allocate power P r j to the SU relays 6 while I gen ≤ I g or not converged do 7 Increase generation counter I gen = I gen + 1 8 for c = 1 to T 9 Calculate D (c) = L ∑ j=1 ε r j P r j h r j q 2 − I Max PU 10 Calculate γ r j d and γ r j e by using Equations (7) and (8), optimal transmission power of the SU source P * s from Equation (19), and P r j from step 1 of the proposed scheme 11 Calculate R d and R e by using Equations (10) and (11) and ε r j from step 1 of the proposed scheme 12 Evaluation (Step 2) 13 if the constraints of C.1 (in Equation (15)) and C.4 (in Equation (17)) are satisfied 14 Calculate SR by substituting ε r j and P r j in Equation (20) 15 else 16 Secrecy rate R

Simulation Results
In this section, we present the simulation results to validate the performance of the proposed scheme. In this paper, we assume that the channel between any transmitter and the receiver follows by an independent complex Gaussian random variables with zero mean and variances of σ 2 ab , respectively. The variances of the corresponding channels are defined in [33] as (25) where d ab denotes the distance between the transmitter and the receiver, the wavelength is λ = c f c , where c, f c , and α are the speed of light, the carrier frequency, and the path-loss exponent, respectively. The channel gain between any transmitter a and the receiver b thus, expressed as: The complex channel gain vector can be expressed as The randn function generates arrays of random numbers whose elements are normally distributed with mean 0 and variance 1 in the Matlab. Finally, to get each channel gain we take absolute of h ab , |h ab | which has Rayleigh distribution with the variance σ 2 ab . Therefore, in the paper we consider Rayleigh fading channel, which is considered as a statistical model for the effect of a propagation environment on a radio signal. Also, it is noteworthy that the effect of the distance between nodes, and path loss exponent on the channel gain is considered in terms of variance σ 2 ab = c 4d ab f c π α . It means that each channel between two nodes will have Rayleigh channel of which the mean will mainly depend on the distance between nodes and path loss exponent. In this paper, we have simulated a static network where locations of the users are fixed but the CSI's of the corresponding channel is slightly changed due to the complex Gaussian random variable. However, generation of more realistic network scenario with different channel distributions for mobility-aware CCRNs is left for our future work.
We compare the SR performance of the GA-based MRS and PA scheme (denoted as Proposed scheme) with following schemes: (1) Exhaustive search scheme [15] which is an advance scheme published recently to solve the RS and PA problems; (2) OpportunisticRS scheme [34,35] We compare the performance of the OpportunisticRS scheme, the PartialRS scheme, and the RandomRS scheme by considering the equal power allocation (EPA) concept as used by Lu et al. [36]. The parameters used for simulations are summarized in Table 1. We use MATLAB software as a simulation tool to collect the simulation results of our proposed scheme and other comparison schemes. The computer which is employed for collecting simulation results had an Intel(R) Core(TM) i7-6700K central processing unit with random access memory of 16 GB. In MATLAB, we firstly set the network parameters of the considered system model and the parameters of the GA and then, we implement Algorithm 2 to get the simulation results. The following simulations results are obtained by averaging Monte Carlo trials. In each trial, the channel conditions are independently determined. The cases of performance analysis over α fading channels [5], different time-varying fading channel [37], different outdated channels can be tested with additionally studying the channel estimation, the RS, and the PA problems of CCRNs but it is out of scope in this paper.

SR Performance and Convergence of the Proposed Scheme
To evaluate the SR performance and to show the proof of convergence our proposed scheme, we compare our Proposed scheme with the Exhaustive search scheme [9]. In the simulation, the location of the eavesdropper is fixed in one position when the values of P max SU and I max PU are set as 0 dBm and 5 dBm. In addition, the maximum number of generations and the number of populations are considered as I g = 100 , and T = 100. We set the gap size as 10 −4 for Exhaustive search scheme and searching for the optimal transmission power of the SU relays to maximize the SR of the networks. The simulation result is shown in Figure 3. We can observe that there is a negligible performance gap generated by the Proposed scheme and Exhaustive search scheme. However, the computational complexity of the Proposed scheme in terms of CPU time, which is shown in Table 2 is much lower than the Exhaustive search scheme. In Figure 3, we present the convergence of the fitness value (SR) of our Proposed scheme, where P max SU = 0 dBm, I max PU = 5 dBm, and L = 10. As can be observe in Figure 4, the SR performance of the Proposed scheme is increased as the number of generations or the population size is increased. It can be well noted that Proposed scheme converges when the number of generation is approximately I g ≤ 20.

SR Performance with Number of SU relays
The average SR performance of the Proposed scheme and other schemes is illustrated in Figure 5 for different number of SU relays when P max SU , I max PU , I g , and T are 0 dBm, 5 dBm, 100, and 100, respectively. As shown in Figure 5, the Proposed scheme shows better SR performance than the other schemes. With a large number of SU relays, the SR performance becomes flat because of the transmission power and interference constraints of the networks. Also, we observe that the Proposed scheme achieves a significant improvement in SR performance over other three schemes with EPA. Furthermore, Figure 5 reveals that the OpportunisticRS scheme outperforms the PartialRS scheme because of considering two-hop channel gains of the networks. The RandomRS scheme does not provide significant SR because it selects SU relays randomly in the environment.  Figure 6 shows the average SR performance of the Proposed scheme with other schemes with changing the value of permissible transmission power of the SUs when I max PU , I g , T, and L are 5 dBm, 100, 100, and 10, respectively. The SR performance of all schemes increase as P max SU increases. When the P max SU is 0 dBm, the SR of all schemes become flat because the interference threshold of the PU receiver will not allow to assign more transmission power. As expected, the SR performance achieved by the Proposed scheme is much higher than that of the other schemes. Also, we can see that the Proposed scheme achieves a noteworthy improvement in SR performance over the other schemes with EPA. Due to the randomness in selecting the best SU relays, the RandomRS scheme with EPA shows lower average SR performance than that of OpportunisticRS and PartialRS schemes with EPA.  Figure 7 shows the average SR performance with the interference threshold for primary user receiver when P max SU , I g , T, and L and are 10, 0 dBm, 100, and 100, respectively. The average SR of all schemes increase as the interference threshold is increased. In the high interference threshold region, the SR is restricted because the transmission power constraints of the SUs play a dominant role, and the interference threshold has hardly any effect on the transmission power at the SU relays. As expected, the SR performance of the Proposed scheme is much higher than the other schemes. Also, we can see that the Proposed scheme achieves noteworthy improvement in SR performance over the other schemes. Due to the randomness in selecting the best SU relays, the RandomRS scheme provides a very low SR performance compared to other three schemes.

SR Performance with Changing the Distance of the Eavesdropper
The performance of the Proposed scheme, OpportunisticRS scheme, PartialRS scheme and RandomRS scheme over different locations of eavesdropper is shown in Figure 8 where D sd is fixed at 500 m and the D se is varied from 550 m to 900 m. We can observe that average SR performance of the Proposed scheme shows better performance than the other schemes. With the increasing of D se , the SR performance of all schemes is also increasing because h sd and h r j d are becoming strong gradually compared with h se and h r j e due to the movement of the eavesdropper in the networks.

SR Performance with the Variance of the AWGN
We also compared the average SR against variances in AWGN, as shown in Figure 9 when P max SU , I max PU , I g , T, and L are 0 dBm, 5 dBm, 100, 100, and 10, respectively. As can be seen in Figure 9, the performance of all schemes declines as the variance of AWGN increases. With an increasing of σ 2 n , the SNR of the corresponding communication links becomes weaker gradually, which can decrease R d and R e . Also, note that average SR performance of the Proposed scheme is again better than other schemes. The RandomRS scheme shows lower performance because of the randomness in selecting the SU relays.

Computational Complexity Analysis
To assess the computational overhead, we calculate the complexity of the Proposed scheme with other schemes in terms of arithmetic operations and the CPU time required to solve the optimization problem [28]. To obtain the solution of SU relays selection and PA through the Exhaustive search scheme, it requires high computational complexity. In the Proposed scheme, the computational complexity is determined based on the number of populations. For each generation of the Proposed scheme, we needed to calculate the fitness value for T times and one for each chromosome. Therefore, the total arithmetic operations needed by the Proposed scheme is about O (GT). A comparison of the complexity for all schemes is shown in Table 3. To reveal the advantages of our Proposed scheme more appropriately, a comparison of the CPU times for all the schemes is presented in Table 2.
To demonstrate the performance of average CPU time, we utilize the same simulation parameters as used for Figure 4. We can see from Table 2 that the CPU time required by all schemes increases with an increase in the SU relays, and the CPU time of other schemes is much lower than the Exhaustive search scheme when the step size for discretizing the maximum transmission power of the SU relays for Exhaustive search scheme is considered as 10 −4 . The CPU time required by all schemes are high when the number of SU relays is large because as there are more variables involved in calculating the SR of the networks.

Conclusions
In this paper, a low-complexity GA-based scheme is proposed to enhance physical layer security of CCRNs when a single eavesdropper coexist in the networks. As we consider an MIP problem, and its complexity increases as the number of SU relays are increased; we propose a GA-based scheme to solve it. By MRS and PA through the GA, the SR of the network is maximized while maintaining the transmission power and the interference requirements of the networks. Simulation results indicate that the proposed scheme achieves the near-optimal SR performance of the Exhaustive search scheme and provides better SR performance than some conventional RS schemes. In this paper, it is shown that the proposed scheme can provide solutions for MRS and PA in the presence of single eavesdropper when the perfect CSI about all the channels are available at the receiver for prior transmission. Imperfect CSI, different time-varying channels, and outdated channels are beyond the scope of this paper. Therefore, future research will include RS and PA through learning algorithm for mobility-aware multi-tier heterogeneous networks when multiple eavesdropper, multiple legitimate sources and destinations are coexisted in the network. The study of imperfect CSI and channel estimation of different time-varying channels to maximize the SR of mobility-aware CCRNs are also remained as a future work.
Author Contributions: I.K. provided the guideline to focus on issues and the required solutions and reviewed the overall manuscript. M.A.R. and Y.L. conceived the study, drafted the article, and revised it critically for intellectual content. They reviewed the technical contribution of the work and approved the final draft. All authors have read the full manuscript and approved it for final submission.

Conflicts of Interest:
The authors declared that they have no competing interests.