Modiﬁed Heuristic Computational Techniques for the Resource Optimization in Cognitive Radio Networks (CRNs)

: With the advancement of internet technologies and multimedia applications, the spectrum scarcity problem is becoming more acute. Thus, spectral-efﬁcient schemes with minimal interference for IoT networks are required. Device-to-device communication (D2D) technology has the potential to solve the issue of spectrum scarcity in future wireless networks. Additionally, throughput is considered a non-convex and NP-hard problem, and heuristic approaches are effective in these scenarios. This paper presents two novel heuristic approaches for throughput optimization for D2D users with quality of service (QoS)-aware wireless communication for mobile users ( MU ): the modiﬁed whale colony optimization algorithm (MWOA) and modiﬁed non-domination sorted genetic algorithm (MNSGA). The performance of the proposed algorithms is analyzed to show that the proposed mode selection technique efﬁciently fulﬁlls the QoS requirements. Simulation results show the performance of the proposed heuristic algorithms compared to other understudied approaches.


Introduction
With the advent of advanced wireless technology, spectrum requirements have increased, and as a result, spectrum scarcity occurs. A CR is a device that scans the wireless spectrum and finds free spectrum spaces for both time and frequency. The CR devices combine to make cognitive radio networks (CRNs). A CR is an intelligent device focusing on channel utilization [1][2][3][4].
Spectrum sharing (SS) is the process of recognizing the spectrum used for data transmission by granting permission from MUs to device users (DU) to use the desired spectrum [5]. MUs are not utilizing the available spectrum completely because there are white spaces called "spectrum holes" that can be utilized by the DUs. The current usage of the current radio spectrum can be handled by a CRN, which is a wireless system that is intelligently used for allocating resources. Resource allocation and spectrum availability are issues due to the increase in wireless and mobile devices. CRNs have emerged as an excellent solution to this problem [6].
Non-orthogonal multiple-access (NOMA) device-to-device communication is a promising technology for providing high data rates and secure transmission in short-range communication and improving the performance of fifth-generation (5G) wireless networks [7,8]. D2D communication enables direct connectivity among devices without support from the core network, offloading the cellular network and increasing the network's capacity [9]. Moreover, low latency, energy efficiency, and high data rate requirements can be achieved by combining D2D with cellular networks [10].

1.
A resource allocation scheme for a cognitive radio-based non-orthogonal multipleaccess device-to-device network is proposed. Two heuristic algorithms, i.e., the modified non-dominated sorting genetic algorithm (MNSGA) and the modified whale optimization algorithm (MWOA) for throughput maximization. Previously, resources were not utilized correctly because only MUs had licenses to use them, and DUs caused interference due to a shortage of resources. In our case, the issue of resource availability is solved by allocating free resources to DUs when they are not being utilized by MUs by using cognitive radio for non-orthogonal multiple-access deviceto-device communication.

2.
To find near-optimal solutions, evolutionary computing techniques called MNSGA and MWOA are used in this paper. To contrast them, MNSGA has fast and efficient convergence and searches for solutions across a wide range of dimensions. Furthermore, MNSGA is proficient at solving high-dimensional multi-objective problems, whereas MWOA can avoid local optima and find optimal solutions. 3.
The performances of the developed techniques are analyzed and compared with that of state-of-the-art techniques. The proposed techniques in this paper perform better in terms of maximizing system performance. Experimental results demonstrate the effectiveness of the proposed techniques.

Organization of the Article
The rest of this paper is organized as follows: The related work is in Section 2. The system model and problem formulation are discussed in Section 3. In Section 4, the modified non-dominated sorting genetic algorithm and the modified whale optimization algorithm are comprehensively explained. Experiments and results are provided in Section 5, and the paper is concluded in Section 6.

Related Work
In this section, a detailed overview of resource allocation techniques using CRNs and NOMA-D2D communication systems is presented. The authors of [20] describe the clustering algorithm, in which the node with the lowest ID is chosen as the leader. Clustering has been used in combination with the divergence of the spectrum. This would lead to a reduction in the size of the network and the overheads linked to the arrangement of routing. In [21], the issue of spectrum access and assignment is discussed for CRNs while focusing on interference with respect to both users.
In [22], the resource allocation problem is examined by examining spectrum sharing and describing multi-dimensional spectrum utilization. In [23], the authors discuss channel allocation in a CR by assigning a spectrum to both the PUs and the SUs. In [24], the technique of relay selection and spectrum allocation is introduced. Relay selection has been amplified and forwarded. A spectrum allocation-based technique depends on particle swarm optimization. The author proposed a system for reducing interference with a GA in order to make the most informed decision for switching and selecting spectra in CRNs for a primary user (PU) [25].
A power mixture technique for the allocation of spectra, increasing the through-put to a CRN and satisfying the interference constraints for both users is presented in [26]. The authors of [27] discuss resource assignment in terms of spectrum utilization and net-work throughput optimization. The whale optimization algorithm is used to solve resource allocation issues in wireless networks. The combined issue of DUE mode selection, base station selection, resource assignment, and power allocation is investigated in [28], which considers situations with multiple BSs in D2D heterogeneous networks.
In [29], the invasive weed optimization algorithm is proposed for an increase in the spectrum handoff efficiency, which reflects the balancing of load and reduces the handoff delay. The problem is to raise the level of spectrum efficiency by assigning the DUs to the accessible channel as proposed in [30] based on the chaotic biography-based algorithm. In [31], the authors present a problem of spectrum mobility in radio electric environments that directs the SU through the routes of maximum feeding optimization (MFO) using a bio-inspired algorithm (BIA) that has less complexity and robustness. The authors of [32] use the social spider algorithm to find the most efficient allocation.
The author of [33] created a scheme for spectrum allocation (SA) that focuses on the strength of interference. A multi-objective GA was used to solve the spectrum-sharing problem. A spectrum-sharing method that depends upon social language is proposed for the prevention of the problem of scarcity and the under-utilization of the spectrum in [34]. Resource allocation as a max-min optimization problem is presented in [35]. In [36], spectrum resources are distributed fairly to smart grid users based on the standard grid configuration (SGCN). In [37], a fuzzy-based support system is used for dealing with channel selection and switching.
In [38], researchers presented spectrum-sharing techniques for cooperative CRNs. Included in [39] is a study on spectrum allocation based on the characteristics of primary and secondary sender destinations (S-D) with the objective of increasing the throughput for secondary S-D. The authors looked upon CRNs that have multiple carriers and relay selection (RS) energized remotely through power collected from the information emitted for data transfer by the SUs [40]. In [41], the author presents 5G wireless networks for enhanced CRNs, which rely both on spectrum sharing (SS) and spectrum aggregation. In [42], a method is established to build sequences of channel hopping with the help of primitive roots of a prime number. Three channel-hopping protocols, symmetric and asymmetric, have been developed for synchronous and asynchronous CRN environments.
Wireless multiple-access channels have been used for PUs and optimization of the energy efficiency (EE) problem present in cognitive systems for mathematical structure computational purposes [43]. For the purpose of resolving the radio deficiency problem, a model has been proposed, and parameters for spectrum sharing (SS) have been discussed [44]. The resource allocation issue is analyzed by combining CR innovation and D2D transmission in mobile networks in [45]. The authors present the radio frequency energy-harvesting (RF-EH) mechanism to model in [46]. In [39], researchers introduced an algorithm based on power control and the Lambert W function to improve the energy efficiency of a single D2D set [47]. Quassia-convex algorithms and communication improve overall system data rates while increasing accessibility, as discussed in [48].

Framework of Proposed Model
This section presents the proposed framework for resource optimization in CRNs. The spectrum allocation for throughput maximization is addressed in cognitive radio-based D2D communication systems (CR-D2D). Modified non-dominated sorting GA and whale optimization algorithms have been proposed for maximizing throughput.

D2D CR Network
In the system model, a device-to-device-connected cognitive radio network (CRN) consists of a mobile radio network. The mobile network is based on an MU, and the device network is based on a DU. Figure 1 shows a representation of the system model. problem, a model has been proposed, and parameters for spectrum sharing (SS) have been discussed [44]. The resource allocation issue is analyzed by combining CR innovation and D2D transmission in mobile networks in [45]. The authors present the radio frequency energy-harvesting (RF-EH) mechanism to model in [46]. In [39], researchers introduced an algorithm based on power control and the Lambert W function to improve the energy efficiency of a single D2D set [47]. Quassia-convex algorithms and communication improve overall system data rates while increasing accessibility, as discussed in [48].

Framework of Proposed Model
This section presents the proposed framework for resource optimization in CRNs. The spectrum allocation for throughput maximization is addressed in cognitive radio-based D2D communication systems (CR-D2D). Modified non-dominated sorting GA and whale optimization algorithms have been proposed for maximizing throughput.

D2D CR Network
In the system model, a device-to-device-connected cognitive radio network (CRN) consists of a mobile radio network. The mobile network is based on an MU, and the device network is based on a DU. Figure 1 shows a representation of the system model.

Proposed Model
As shown in Figure 2, the MU and DU have been initialized. By leveraging cognitive radio, device-to-device communication (CR-D2D) channels are sensed, allocated to the desired users, and reused. The users' throughput is optimized by using the proposed MNSGA and MWOA techniques to obtain better results [49,50].

Proposed Model
As shown in Figure 2, the MU and DU have been initialized. By leveraging cognitive radio, device-to-device communication (CR-D2D) channels are sensed, allocated to the desired users, and reused. The users' throughput is optimized by using the proposed MNSGA and MWOA techniques to obtain better results [49,50].
The signal-to-noise ratio (SINR) of a D2D pair can be expressed as follows [51]: SINR s p = a m p,n P s g s,p a m q,n P q g q,p + ∑ a m k,s P k g k,p + N 0 where in Equation (1), s is the number of channels, P is the D2D pairs, a m p,n and a m q,n are channel assignment indicators, P s is the power of D2D pairs, and P k is the power of the MU. The throughput for the MU (MU) is expressed as follows [51]: where R s q is the throughput for the MU in Equation (2), B is the bandwidth, and SINR s q is the signal-to-noise ratio of the MU channels. The throughput for the DU is stated as follows [51]: where R s p is the throughput for the DU in Equation (3) and SINR s p is the signal-to-noise ratio of the DU channels. The overall system throughput for all users is R = R MUs + R DUs , where R MUs and R Dus are the throughputs for the mobile users and DUs, respectively. The optimization problem to maximize the throughput for the allocation problem is: where a l i,n is used for the licensed channel mode and a u d for the unlicensed mode, and P MU and P DU are the highest powers to transmit for pairs of mobile users and DUs, respectively. R T is the throughput threshold for the mobile users and DUs.

Modified Heuristic Algorithms
A genetic algorithm (GA) is a search heuristic based on Charles Darwin's theory of natural selection. The algorithm is based on natural selection, in which the strongest individuals (chromosomes) are selected to produce the next generation's children. Every chromosome encodes a problem solution, and its fitness value is proportional to the objective function value for that solution [52,53]. By moving beyond locally optimal solutions, the search achieves its goal. After each generation, the population's quality may improve. A genetic algorithm takes into account the initial population of chromosomes, denoted as N p .
A chromosome is built from an array of genes, and these genes can be represented as binary or integer strings. The problem of M MUs and D DUs for every ith chromosome, which is mentioned as a potential solution, is represented here as a binary string. Consider the following scenario: There are two mobile networks and three D2D user pairs (M = 2, D = 3), and each mobile network has four channels available for Dus. As there are three Dus, there are three genes on ith chromosome. As soon as the number of genes on a chromosome is determined, the next step is to encode the chromosome. Each gene represents one DU, and each DU should be assigned to a network and a channel. Because there are two primary networks and four channels in each network, we need two bits to represent the network and two bits to represent the channel. Therefore, each gene will have four bits. As a result, each chromosome will have 12 bits with three genes.

Modified Non-Dominated Sorting Genetic Algorithm (MNSGA)
MNSGA is used to optimize parameters in a variety of operations. MNSGA is a well-known multi-objective genetic algorithm that sorts quickly and efficiently. Instead of single-objective optimization, MNSGA maximizes each objective simultaneously by preventing any other solution from dominating. MNSGA performs optimization on several objectives with three distinct features: a quick non-dominated ranking methodology, a quick crowded range estimation method, and an uncomplicated crowded comparison operator.
In general, the MNSGA method can be broken down into the following steps: 1.
Initializing the population: Create a population that is based on the issues, distance, and entities.

2.
Ranking that is not dominated: Use a sorting procedure based on the population's non-dominance criteria.

3.
Establishing a crowding distance: After the ranking is finished, a value for the crowding distance is allocated. Individuals in the population are chosen based on their rank and the crowding distance. 4.
Making selections: Entities are selected using binary tournament selection with the comparison with the crowding operator. The fifth step is to use genetic operators. Using simulated binary crossover and mutation, a real-coded MNSGA was created. Recombination and selection are the sixth and final steps. Individuals from the next generation are chosen from the offspring population and the current generation population. Each front fills a new generation until the population size exceeds the current population size. Figure 3 illustrates the flow of the MNSGA, in which the initialization of the population is carried out first. After that, the fitness of the chromosomes is calculated. Non-dominating sorting based on the crowding distance and rank parameters is applied. Then, genetic operators like crossover, mutation, and selection are used to generate a child. Then, the evaluation of chromosomes is conducted, and the effect of elitism is applied to find the Pareto solution.
ulation is carried out first. After that, the fitness of the chromosomes dominating sorting based on the crowding distance and rank par Then, genetic operators like crossover, mutation, and selection are child. Then, the evaluation of chromosomes is conducted, and the applied to find the Pareto solution.

Modified Whale Optimization Algorithm (MWOA)
MWOA has gained attention in the research field as a fast wa range of optimization techniques. MWOA is simple to use and ad objective functions, quality measures, and constraints for the op less systems. The principles of MWOA, such as encircling prey, feed and killing identification, are explained in the following subsection

Encoding of Whales
The process starts with the initialization of the whale populatio step in the process. This study ultimately seeks to find a unique so lem by looking at every whale as a potential solution. It has been fou is the most effective search agent for MWOA. The same GA example here for each ith whale to update its position based on prey.

Modified Whale Optimization Algorithm (MWOA)
MWOA has gained attention in the research field as a fast way to solve a broad range of optimization techniques. MWOA is simple to use and adapt by identifying objective functions, quality measures, and constraints for the optimization of wireless systems. The principles of MWOA, such as encircling prey, feeding in bubble nets, and killing identification, are explained in the following subsections.

Encoding of Whales
The process starts with the initialization of the whale population, which is the first step in the process. This study ultimately seeks to find a unique solution to this problem by looking at every whale as a potential solution. It has been found that target prey is the most effective search agent for MWOA. The same GA example used above is used here for each ith whale to update its position based on prey.

Encircling Prey Methodology
Humpback whales can indeed detect the presence of prey and surround them. Currently, the most effective search agent is the target prey in the MWOA method. During the iteration process, the humpback whales adjust their positioning toward the appropriate search agent. A whale, on the other hand, cannot predict the location of the prey in advance. If the current optimal position is that of the target prey, the other members of the group will all move to that position.

Bubble-Net Attacking Methodology
Humpback whales employ both shrinking encircling and spiral updating methodologies to attack bubble nets simultaneously.

Search for Prey
The prey search can be approached similarly to the shrinking encircling mechanism. Humpback whales search randomly, based on their relative positions. This behavior can also be accomplished by reducing a value. The envoy will reset the reference of the whale such that the value of A is greater than 1 or less than −1. Unlike in the exploitation phase, an envoy updates its position based on a randomly chosen search agent rather than the current most effective search agent. The MWOA algorithm is able to perform a global search using this method. The first initialization of the whale population is represented in Figure 4. If the stopping criteria are reached, the optimal solution is determined by adjusting the constraints of the search agents. If the probability is not less than 0.5, the values are adjusted according to the spiral method. This is accomplished by updating the search values according to the spiral method. However, if constraint A is greater than or equal to 1, the model is updated to use the searching prey method. Finally, if a maximum number of iterations is reached, the process is stopped, and the fitness value is saved for the most optimal solution; otherwise, the process repeats until a solution is found.

Search for Prey
The prey search can be approached similarly to the shrinking encircling mechanism. Humpback whales search randomly, based on their relative positions. This behavior can also be accomplished by reducing a value. The envoy will reset the reference of the whale such that the value of A is greater than 1 or less than −1. Unlike in the exploitation phase, an envoy updates its position based on a randomly chosen search agent rather than the current most effective search agent. The MWOA algorithm is able to perform a global search using this method. The first initialization of the whale population is represented in Figure 4. If the stopping criteria are reached, the optimal solution is determined by adjusting the constraints of the search agents. If the probability is not less than 0.5, the values are adjusted according to the spiral method. This is accomplished by updating the search values according to the spiral method. However, if constraint A is greater than or equal to 1, the model is updated to use the searching prey method. Finally, if a maximum number of iterations is reached, the process is stopped, and the fitness value is saved for the most optimal solution; otherwise, the process repeats until a solution is found.

Experimental Results and Discussion
In this section, we will analyze the results obtained by the modified nondominated sorting genetic algorithm (MNSGA) and the modified whale optimization algorithm (MWOA). In addition to the proposed experiments, different comparisons of throughputs with the number of D2D pairs, distance between D2D pairs,

Experimental Results and Discussion
In this section, we will analyze the results obtained by the modified non-dominated sorting genetic algorithm (MNSGA) and the modified whale optimization algorithm (MWOA). In addition to the proposed experiments, different comparisons of throughputs with the number of D2D pairs, distance between D2D pairs, and minimum required rate were discussed using MNSGA and MWAO. The simulation parameters are tabulated in the Table 1.

Convergence of MNSGA & MWOA
The convergence of MNSGA, MWOA, and the algorithm from [51] is compared to test which algorithm performs best. The maximum distance between D2D pairs is 20 m, and the minimum required rate for each user is 250 kbps. The system throughput of the algorithm from [51] increases for about 100 iterations before becoming stable for the remaining iterations; the system throughput of MNSGA increases for about 140 iterations; and the system throughput for MWOA increases for about 80 iterations, as shown in Figure 5. The MNSGA method converges better than the algorithm from [51] and MWOA. The modified whale optimization algorithm is listed as Algorithm 1.

Throughput Analysis for MU & DU
In Figure 6, the throughput for various D2D pairs is shown for MUs, DUs, and overall users. According to this graph, system throughput increases as the number of D2D pairs increases, but when the number of D2D pairs reaches the system's capacity, system throughput decreases. Figures 6-8 show that the proposed MNSGA scheme outperforms MWOA, while MWOA outperforms the algorithm from [51]. In Figure 6, the system throughputs of MNSGA and MWOA are compared to the number of D2D pairs for MUs. In Figure 7, the system throughputs of the MNSGA and MWOA are compared to the number of D2D pairs for DUs.

Throughput Analysis for MU & DU
In Figure 6, the throughput for various D2D pairs is shown for MUs, DUs, and overall users. According to this graph, system throughput increases as the number of D2D pairs increases, but when the number of D2D pairs reaches the system's capacity, system throughput decreases. Figures 6-8 show that the proposed MNSGA scheme outperforms MWOA, while MWOA outperforms the algorithm from [51]. In Figure 6, the system throughputs of MNSGA and MWOA are compared to the number of D2D pairs for MUs. In Figure 7, the system throughputs of the MNSGA and MWOA are compared to the number of D2D pairs for DUs.

Throughput Analysis for Various Distances
Throughput values for various distances between D2D pairs are shown in Figures  9-11 for MUs, DUs, and overall users. Once again, the proposed MNSGA scheme outperforms the MWOA method. For all techniques, it is seen that the system throughput becomes lower as the length between D2D pairs increases. This is due to the fact that as the space in the middle of D2D pairs grows, the strength of the desired signal weakens, resulting in a reduction in system throughput. In Figure 9, the system throughputs of MNSGA and MWOA are compared with respect to the distance between D2D pairs for MUs. In Figure 10, the system throughputs of MNSGA and MWOA are compared with respect to the distance between D2D pairs for DUs.

Throughput Analysis for Various Distances
Throughput values for various distances between D2D pairs are shown in Figures 9-11 for MUs, DUs, and overall users. Once again, the proposed MNSGA scheme outperforms the MWOA method. For all techniques, it is seen that the system throughput becomes lower as the length between D2D pairs increases. This is due to the fact that as the space in the middle of D2D pairs grows, the strength of the desired signal weakens, resulting in a reduction in system throughput. In Figure 9, the system throughputs of MNSGA and MWOA are compared with respect to the distance between D2D pairs for MUs. In Figure 10, the system throughputs of MNSGA and MWOA are compared with respect to the distance between D2D pairs for DUs.

Throughput Analysis for Various Distances
Figures 12-14 show the system throughputs for various minimum data rate requirements of users for MUs, DUs, and overall users. When the minimum rate condition of entities is maximized, ranging from almost 500 kbps up to 3000 kbps, throughput reduces for all schemes, as shown in the figures. For maintaining the minimum required rate of users, the proposed MNSGA scheme outperforms MWOA and the algorithm from [51]; MWOA outperforms the algorithm from [51]. In Figure 12, the system throughputs of the MNSGA, MWOA, and [51] algorithms are compared in terms of the minimum required rate for MUs. In Figure 13, the MNSGA, MWOA, and [51] algorithm system throughputs are compared in terms of the minimum rate of DUs.

Throughput Analysis for Various Distances
Figures 12-14 show the system throughputs for various minimum data rate requirements of users for MUs, DUs, and overall users. When the minimum rate condition of entities is maximized, ranging from almost 500 kbps up to 3000 kbps, throughput reduces for all schemes, as shown in the figures. For maintaining the minimum required rate of users, the proposed MNSGA scheme outperforms MWOA and the algorithm from [51]; MWOA outperforms the algorithm from [51]. In Figure 12, the system throughputs of the MNSGA, MWOA, and [51] algorithms are compared in terms of the minimum required rate for MUs. In Figure 13, the MNSGA, MWOA, and [51] algorithm system throughputs are compared in terms of the minimum rate of DUs.       In Figure 14, the system throughput of the MNSGA, MWOA, and [51] algorithms i compared to the overall minimum required rate. MNSGA outperforms both the MWOA and [51] algorithms and MWOA outperforms the algorithm from [51]. In the second experiment, the MNSGA, MWOA, and [51] algorithms are compared in terms of dis tance between D2D pairs vs. throughput, and MNSGA again performs better than both MWOA and the algorithm from [51]; likewise, MWOA again performs better than the algorithm from [51]. The MNSGA, MWOA, and [51] algorithms are compared again in the third experiment in terms of minimum required rate vs. throughput MNSGA outperforms both the MWOA and [51] algorithms, and MWOA leaves [51 behind. MNSGA performs well in all categories in terms of number of D2D pairs distance between D2D pairs, and minimum required rate for MUs, DUs, and overal users. MWAO, on the other hand, outperforms the algorithm from [51] in all scenarios Both proposed techniques, MNSGA and MWAO, outperformed the algorithm from [51] by producing good results. In Figure 14, the system throughput of the MNSGA, MWOA, and [51] algorithms is compared to the overall minimum required rate. MNSGA outperforms both the MWOA and [51] algorithms and MWOA outperforms the algorithm from [51]. In the second experiment, the MNSGA, MWOA, and [51] algorithms are compared in terms of distance between D2D pairs vs. throughput, and MNSGA again performs better than both MWOA and the algorithm from [51]; likewise, MWOA again performs better than the algorithm from [51]. The MNSGA, MWOA, and [51] algorithms are compared again in the third experiment in terms of minimum required rate vs. throughput; MNSGA outperforms both the MWOA and [51] algorithms, and MWOA leaves [51] behind. MNSGA performs well in all categories in terms of number of D2D pairs, distance between D2D pairs, and minimum required rate for MUs, DUs, and overall users. MWAO, on the other hand, outperforms the algorithm from [51] in all scenarios. Both proposed techniques, MNSGA and MWAO, outperformed the algorithm from [51] by producing good results.

Conclusions
R 3,1 R 2,1 R 1,1 In order to maximize 5G communication throughput, cognitive radioassisted device-to-device communication is a promising technology that accommodates the highest data rate demands in a small area. Throughput optimization is performed and maximized using evolutionary techniques. Throughput is compared with the number of D2D pairs, the distance between D2D pairs, and the minimum required rate of users for MUs, DUs, and overall users. To increase the throughput of existing algorithms, the authors propose two algorithms, namely MNSGA and MWOA, as alternatives to existing algorithms. Several experiments are conducted to evaluate which algorithm optimizes the throughput. From the simulations, it is concluded that MNSGA techniques perform well and are more effective than MWOA and existing algorithms. The experiments are performed, and the results are extracted in a Python environment.