QoS-Oriented Optimal Relay Selection in Cognitive Radio Networks

A cognitive radio network can be employed in any wireless communication systems, including military communications, public safety, emergency networks, aeronautical communications, and wireless-based Internet of Things, to enhance spectral efficiency. The performance of a cognitive radio network (CRN) can be enhanced through the use of cooperative relays with buffers; however, this incurs additional delays which can be reduced by using virtual duplex relaying that requires selection of a suitable relay pair. In a virtual duplex mode, we mimic full-duplex links by using simultaneous two half-duplex links, one transmitting and the other one receiving, in such a way that the overall effect of duplex mode is achieved. The relays are generally selected based on signal-to-interference-plus-noise ratio (SINR). However, other factors such as power consumption and buffer capacity can also have a significant impact on relay selection. In this work, a multiobjective relay selection scheme is proposed that simultaneously takes into account throughput, delay performance, battery power, and buffer status (i.e., both occupied and available) at the relay nodes while maintaining the required SINR. The proposed scheme involves the formulation of four objective functions to, respectively, maximize throughput and buffer space availability while minimizing the delay and battery power consumption. The weighted sum approach is then used to combine these objective functions to form the multiobjective optimization problem and an optimal solution is obtained. The assignments of weights to objectives have been done using the rank sum (RS) method, and several quality-of-service (QoS) profiles have been considered by varying the assignment of weights. The results gathered through simulations demonstrate that the proposed scheme efficiently determines the optimal solution for each application scenario and selects the best relay for the respective QoS profile. The results are further verified by using the genetic algorithm (GA) and particle swarm optimization (PSO) techniques. Both techniques gave identical solutions, thus validating our claim.

studies have indicated that the use of licensed bands is highly inefficient [6,7]. It has been observed that the large portion of the licensed bands remains underutilized in various geographical locations and the spectrum utilization varies; some bands are utilized as low as 15% while even those highly utilized are up to 85% busy in time [8]. This inefficient use of spectrum by the users leaves spectrum holes, also called the white spaces [9]. In this backdrop, cognitive radio (CR) concept has emerged to exploit these spectrum holes or white spaces by allowing another set/group of users to opportunistically discover transmission opportunities and utilize them for communication [10]. In a cognitive radio network (CRN), a set of users called the secondary users (SUs) opportunistically use spectrum resources allocated to licensed network users, also called the primary users (PUs). The SUs sense the licensed band to discover holes and then utilize these opportunities for their data transmission with the condition that the communication of the primary user of the spectrum will not be affected. The key functionalities of a cognitive radio network include spectrum sensing, analysis, assignment, and management [11]. The spectrum access in a CRN can be grouped into two main categories that are overlay and underlay [12]. In the overlay, the channel is opportunistically used by the secondary user when not in use by the primary network, whereas, in the underlay, the channel is simultaneously utilized by both, but the power of the secondary user remains below the threshold level of the primary. Thus, simultaneous transmissions by both primary and secondary networks are possible. By using relays in an underlay CRN, the distance between the nodes of the secondary network can be reduced and spatial diversity for the communication can also be provided [13]. Further, the use of relay buffers improves throughput performance [14]. The introduction of cooperative relaying with buffers can enhance performance in terms of reduced outage probability and power while increasing throughput but the cost of increased packet delays [15,16]. However, this delay can be mitigated through a virtual duplex relaying scheme which involves the use of two relays or relay pairs to form two links, one from source-to-relay and the other from relay-todestination [17]. In virtual duplex mode, we mimic the fullduplex link by using simultaneously two half-duplex links. The main concept is to select a pair of relays, each operating in a half-duplex mode, one transmitting and the other one receiving, in such a way that the overall effect of duplex mode is achieved.
A critical factor in a CRN with buffer-aided cooperative relaying is the selection of a suitable relay pair that can enhance its performance in terms of outage, throughput, and delay but improves spectral efficiency as well. The selection of relays is based on meeting quality-of-service metrics such as an outage, throughput, delay, and fairness as well as the efficient use of resources, for example, bandwidth, available power, and relay node buffer capacity. Most of the existing work on relay selection relies on meeting an SINR threshold while optimizing one of the performance measures, i.e., throughput, delay, or outage [18][19][20]. This approach is limited in the context of varying applicationspecific quality-of-service requirements where, for example, one application may need delay performance optimization, whereas another application may require maximizing throughput or minimizing power consumption. The work in this paper is aimed at developing an optimal relay selection scheme that caters to the needs of the diverse application QoS requirements. The proposed scheme is based on a weighted sum multiobjective optimization approach and considers several scenarios with different combinations of application QoS needs in terms of throughput, delay, battery power, and the relay node buffer space. Thus, solution obtained provides the most suitable relay for each of these scenarios and thus allows the CRN performance to be optimized dynamically for a diverse set of user applications. To the best of our knowledge, the multiobjective problem formulated in this work is unique in the sense that it simultaneously considers four objectives, i.e., throughput, delay, battery power, and relay buffer state to optimally select the relay pair for a virtual duplex mode of communication.
The rest of the paper is organized as follows: Related work on relay selection and multiobjective optimization in wireless communications are covered in Section 2. The system model, the description of objective functions, and the formulation of the optimization problem are presented in Section 3. The proposed scheme for relay selection is introduced in Section 4. The results and analysis are presented in Section 5, and the conclusions are drawn in Section 6.

Related Work
Relay selection has received considerable attention in the literature as the adoption of relays in wireless networks has improved the overall system performance through improved diversity, reduced interference, and shadow mitigation [21]. The introduction of cooperative relaying, wherein the nodes between the transmitter and receiver coordinate to ascertain a suitable relay node, has resulted in gains in throughput, coverage, and energy efficiency [22,23]. Recently, the incorporation of buffers at relay nodes has allowed further improvements in the performance of cooperative relaying [24]. A cognitive radio network (CRN) is aimed at improving the spectral efficiency of the network, and by adding bufferaided relaying to the network, the performance of the network can be further enhanced [25]. The selection of suitable relays is fundamental to the performance of relaying, and the incorporation of relay buffer results in enhancement of important parameters like an outage, power consumption, and throughput, but the downside is additional packet delays [26]. The authors in [27] incorporated buffer size in their relay selection scheme; their objective was to reduce the packet delay and improve diversity as well. But if the size of the buffer is decreased, then the probability of packet drop increases. In [28], the authors discuss max-max relaying scheme, which works in simplex mode. It first selects the best source-to-relay link and stores this packet in its buffer. Then, in the next time slot, the best relay-to-destination link is selected to transmit this packet from relay-to-destination. Another relaying scheme known as the max-link scheme [29] gives priority to the best link quality. That is whichever link source-to-relay or relay-to-destination has the best 2 Wireless Communications and Mobile Computing quality is selected first for reception or transmission, respectively. Both of these schemes have the downside that delay increases with the increase of several relays or an increase in buffer size. In another work [30], the authors have proposed a bufferaided relay selection scheme, which they claim results in better delay performance. In this scheme, a higher priority is given to the selection of the relay-to-destination links: In this scheme, S ⟶ R was selected only once, and no R ⟶ D link can be selected. This results minimum queue length at the relay nodes; thus, the average packet delay reduces as well. In all these schemes, relay operates in simplex mode. In [31], the authors argue that by given priority to the only relay-to-destination links, the end-to-end delay may still be high due to packets jumbling up at the source and may even result in packet drop. To overcome the problem of added delay, a virtual model of operation was proposed. Furthermore, the main criteria of a relay or relay pair selection have been the signal-to-noise ratio. Other factors may be as important for an efficient communication network, such as efficiency, battery life, and buffer size, and thus should be part of selection criteria.
Multiobjective optimization (MOO) has been extensively used in wireless networks to determine optimal solutions in cases where there is more than one desired goal. In [32], the authors conduct a comprehensive survey of the latest techniques involved in the modeling of multiobjective optimization concerning relaying with conflicting objectives. They also highlighted the advantages and disadvantages of each technique. The authors also classified each of the existing approaches based on the types of objectives and investigated main problem domains, critical trade-offs, and key techniques used in each class. A survey of the use of MOO in wireless sensor network (WSN) is presented in [33], which includes in-depth discussions on the fundamental approaches, metrics, and relevant algorithms. In [34], the authors analyzed various objectives to classify them as conflicting, supporting, or design dependent. They then presented a MOO problem relating to wireless sensor networks (WSNs) which consist of parameters like the required inputs, the desired outputs, and the constraints. They also put forward various constraints that must be considered while formulating MOO problems in WSN.
The use of MOO in cognitive radio networks (CRNs) is presented in [35]. In this work, the authors conducted a comparison of various types of optimization techniques. It was also studied how to combine different objectives to obtain an optimal solution in CRN. In [36], the performance of an underlay cognitive sensor network (CSN) with the simultaneous wireless information and power transfer-(SWIPT-) enabled relay node is investigated. This work focuses on maximizing achieving rates in CSN, with the condition of minimizing interference to the PUs. This objective tried to achieve by optimizing the transmit power. The sensing time and desired SNR are key to energy-efficient CRN. Thus, optimizing these parameters would result in energy-efficient communication in CRN. With this aim, the authors in [37] studied joint optimization of these important performance parameters. The authors argued that by optimizing the sens-ing time with the desired SNR, while remaining within the required detection probability, energy efficiency can be achieved in a network. The throughput-delay trade-off problem for cooperative spectrum sensing (CSS) is investigated in [38]. They claimed that in their proposed algorithm while constraining the delay to a certain value, the throughput is maximized since simultaneously it is not possible to maximize throughput and minimize delays.
In [39], it has been argued that network efficiency can be maximized only when the greenhouse gas emission (GHGE) is kept to a minimum in green cooperative cognitive radio networks (GCCRNs). Since dealing with multiple conflicting objectives, so MOO was employed to maximize the rate while keeping GHGE to a minimum, in their relay selection process. Applying different optimization techniques, nonconvex problems were transformed into a convex one and throughput maximization with GHGE minimization was achieved. Finally, by employing the zero-norm principle, an optimal relay node was selected. In another work [40], authors applied cross-entropy optimization (CEO), while optimizing two conflicting objectives which are maximizing the total rate and minimizing the greenhouse gas emissions in GCCRN.
In [41], the authors considered the problem of maintaining the desired level of QoS for the PUs and optimizing the performance of a cooperative cognitive radio user. The scheme was based on an overlay CRN in which the admission of PUs packets was probabilistically controlled in the secondary user (SU) relaying queue. Two queues with policies of work-conserving and non-work-conserving are made, with aims of optimization SU throughput or delay, respectively. In [42], a dual-hop, full-duplex underlay CRN is considered. Here, the aim was to minimize the outage probability of the SU, by an adaptive power allocation scheme.
When the SU nodes are to be used for relaying PU data, then some sort of incentive or payoff is to be offered. Usually, such schemes are used in overlay CRN. And if these are harvesting energy out of PUs network, then such SU nodes should also be charged. The work in [43] investigated such payoff mechanisms intending to maximize gains to both networks. They proposed a greedy-based algorithm to solve this problem. It was claimed that their scheme is quite effective and very close to the optimal solution. With the understanding that cognitive radio networks are used to enhance spectral efficiency, the authors in [44] worked on improving the performance matrices such as throughput and delay. They proposed a distributed algorithm, which they implemented in MATLAB. They compared their scheme with uniform allocation and max-min bandwidth allocations schemes and claimed 12 percent and 20 percent improvement with respect to compared the schemes, respectively. A delay constraint multihop network was considered in [45]. In this work, the rates and the power are adaptively adjusted in such a way to ensure average power constraint at each node. It was claimed that this adaptive power scheme outperforms in comparison with the constant power scheme. In [46], the authors investigated the performance of cache-assisted SWIPT cooperative systems. Multiple relays capable of caching and energy harvesting are to facilitate communication between a source and destination. Here, the aim is to maximize the throughput and energy storage, subject to a QoS requirement. Now, the bases of a relay selection could be a relay with maximum throughput or maximum stored energy. In [47], two things were addressed that is when the relay node should cooperate and cooperation should be on what bases. They proposed a Nash bargaining-based strategy to resolve these issues. Multiobjective optimization is increasingly being used in optimizing performance in several emerging domains such as the Internet of Things (IoT), mmwave communications, and D2D. For example, in [48], the authors discussed network optimization techniques for IoT and reviewed recent work done in this area. The review is concluded with open issues and challenges for network optimization in IoT. In [49], a TDMA-based MWN is studied with the aim of minimizing the end-to-end delays. A crosslayer optimization technique, while using multipath routing, was used to allocate time slots such that the average end-toend delay is minimized.
Authors in [50] argued that besides the link SRN, it is equally important to take into account the status of buffers at the relay node. They advocated a relay node with maximum available space for reception and a node with maximum occupied space for transmission. Another scheme known as combined relay selection (CRS) [29] is based on the concept of shortest-in longest-out (SILO). The scheme relaxes the requirement of the best link quality; it is only required to be qualified. More emphasis is given to available buffer space (ABS) or occupied buffer space (OBS) while assigning weights. Relay nodes are then selected based on weight assignment. The problem of rate and routing is addressed [51] in multihop self-backhaul millimeter-wave (mm-wave) networks. This paper proposes the use of multiple antennas for diversity and traffic splitting techniques for throughput enhancement. The authors in [52] studied the problem of cochannel interference in an underlay cooperative relaying scheme, in a D2D communication system. As energy efficiency is of significant importance, so the aim here was to maximize energy efficiency. The survey in [34] established that Pareto optimal (PO) and weighted sum (WSUM) are the leading optimization techniques. Few relay selection schemes use the iterative method of relay selection and consider buffer status while selecting a relay. Authors in [29,50,53,54] also considered buffer state in their relay selection schemes; all of these schemes are half-duplex and the link quality needs to be only qualified. In wireless sensor network, there is an astringent constraint on power consumption, so in [55], the authors studied trade-off to be made between delay and energy consumption while determining the route towards the BS. They proposed a MOO routing protocol based on ant colony optimization technique, with energy consumption and cost and end-to-end delay as objectives. Improvements in terms of energy efficiency and delay reduction were claimed. Energy efficiency (EE) and the spectral efficiency (SE) performance of multihop full-duplex cognitive relay networks was investigated in [56]. First multiobjective optimization problems were transformed into a single function, and then, the nonconvex problem was successfully transformed into convex form. The authors claimed that the proposed algorithm efficiently solved the considered problem and the best trade-off among EE and SE can be achieved by proper selection of priority factor.

Proposed Scheme
In CRN, the secondary users (SUs) collectively discover the vacant resources through cognition and share the resources for their communication. In the underlay mode of communication, the SUs are particularly restricted in transmission power, which limits the range of communication. In our model, by allowing relaying the range is extended. To increase the communication speed, i.e., data rate, fullduplex mode is used, which theoretically doubles throughput as compared to half-duplex mode since in a one-time slot, both transmission and reception take place. However, in our system, if full duplexing is deployed, i.e., if the same relay is used for transmission and reception, then the system suffers from loop interference. To overcome this loop interference yet keeping the system throughput, double the virtual duplexing, which allows transmission as well as the reception in the same slot but using two distinct relays. The use of two distinct relays significantly reduces the interference. Now, these relays can be fixed or mobile. In our work, we have not restricted it to one type, so it can work in either case. In this section, the system model of a multihop CRN with buffer-aided relaying is described followed by the formulation of the relay selection optimization problem based on particular QoS requirements.

System Model.
We consider a secondary network consisting of one source "S," one destination "D," and a group of "N " buffer-aided relay nodes in between, operating in an underlay mode alongside a primary network. Direct communication between the source and the destination is not possible. Also, there is a power constraint on the secondary transmitters and the relays to ensure that communication of the primary network is not affected. The limited battery life of the relay nodes is considered, so it becomes pertinent with the efficiency in transmission. Each relay is equipped with a buffer of finite size. Moreover, we need to be cognizant of buffer space availability as well as the assignment of priority to different packets to meet the QoS requirement of nondelay tolerant communications. Similarly, the battery power or residual energy of the node will ensure the requisite SINR at the receiving end. The energy required to receive, decode, and retransmit to the destination needs to be ascertained and should be included in the relay selection process. Thus, buffer size and battery life are important determining factors for relay selection. In our scheme, the requirements are determined based on the type of application: voice, video, data, real-time or non-real-time, etc. The system model of our scheme is shown in Figure 1. It is assumed that the relays will first share their channel state, buffer state, and battery status information as depicted in Figure 2 [24,57].

Objective
Functions. The focus of this work is to devise a method to select the best relay, with due consideration to four important performance parameters, i.e., throughput, delay, relay buffer space, and battery power at the relay nodes, while taking into account the maximum allowable interference constraints imposed by the primary network. The emphasis is on choosing the suitable relays that satisfy a set of certain QoS profiles corresponding to application requirements. A QoS profile would generally include multiple objectives in terms of the performance parameters such as maximizing throughput and buffer space availability while minimizing the delay and battery power consumption. In this section, we first derive expressions for the aforementioned objectives in light of the constraints imposed by the system.
3.2.1. Throughput. The objective function that maximizes the throughput of a network is represented by f 1 . Since system capacity is given by the Shannon capacity theorem and is closely related to throughput, in general, average throughput is given as follows: where R represents the capacity of a link, which is dependent on SINR and is governed by Shannon's theorem, and P out is  Figure 1: System model.   Wireless Communications and Mobile Computing the probability that none of the relay's incoming and outgoing links is available. In a multihop system, the end-to-end capacity is limited by the weakest link; however, by enabling virtual duplexing, the capacity becomes the average of the capacities of the two links, i.e., the selected incoming link and the selected outgoing link in a time slot. Thus, the instantaneous capacities of the incoming link ðR S⟶R Þ and outgoing link ðR R⟶D Þ are as follows: respectively, where γ S⟶R and γ R⟶D are obtained as follows: where i and j represent the i th source-to-relay and j th relayto-destination links, respectively, selected and simultaneously active in a time slot, enabling the virtual duplexing. jg S⟶R i j 2 and jg R j ⟶D j 2 are the channel gains from sourceto-relay and relay-to-destination, jI P⟶D j j 2 and jI TR j ⟶SR j 2 are the interference, and P PT , P TRj , and P SS are the transmitter powers of the primary source, the transmitting relay, and secondary source, respectively. The average throughput of the incoming link, i.e., S ⟶ R, is R S⟶R × ð1 − P out,S⟶R Þ, and the outgoing link, i.e., R ⟶ D, is R R⟶D × ð1 − P out,R⟶D Þ. So, the end-to-end throughput is the average of the two and the long-term average gives the following: To calculate throughput from Equation (1), we need to find the outage probability of the system. The secondary network will be in outage if (i) all links, i.e., S ⟶ R and R ⟶ D, are in outage, or (ii) buffers of all cooperating relays are full and all R ⟶ D links are in outage, or (iii) buffers of all cooperating relay are empty and all S ⟶ R links are in outage. P out,S l = P out,S⟶R × P out,R⟶D , ð5Þ where δ = 2 r t − 1 and r t is the target data rate in bps/Hz and K is the number of links which is ≤N and S l is the buffer state. We denote Q th as the interference threshold at the primary receiver. To incorporate this constraint in our selection scheme, it is ensured that the transmission from the secondary source and relay network must satisfy the following condition: The acceptable level of interference at the receiving relay of interest is as follows: Start Have data in system to transmit Initiate process All nodes exchange CSI and resource info.

Wireless Communications and Mobile Computing
where P PT is the transmitter power of the primary source, P TRj and P SS are the powers of the transmitting relay and the secondary source, respectively. ∑ N l=1 jI TR j ⟶SR j 2 P TR j is the sum of interferences from all transmitting relays of secondary network, and γ th is the SINR for the required data rate.

Delay.
The objective function that minimizes the delay of a network is represented by f 2 . Delays depend on the number of time slots that a packet remains unattended in the buffer, whether in the source buffer or the buffer of the transmitting relay. We consider the end-to-end delay, so it is the sum of delays encountered in transmission of a data packet from source-to-destination and also that at the relaying where L s and L k are the average queue lengths at the source and the relay, respectively, and η s ðsource ⟶ relayÞ and η K ðrelay ⟶ destinationÞ are the average throughput. As we enable the virtual duplexing (VD), different relays are selected for transmission and reception, which eliminates the loop interference (LI). Just as in full duplexing (FD), in VD also, a new packet is forwarded to the relay in each time slot. The delay is approximated as the mean of the two delays, that is, D average = ðD S + D R Þ/2. The mean queue at any buffer is obtained by the following: where R l ðB K Þ gives the number of packets (or the buffer length) of buffer B K at state S l , and π l is the stationary probability of that state. Assuming that the probability selecting any relay is same, the average throughput at relay ðR k Þ is given by the following: where η * is the average throughput of the considered twohop network and is obtained by the following: where R is the link data rate with no outage in the system. We assume one time slot per data packet per hop. So, in our proposed virtue of virtual duplexing relaying system, we have R = 1, and thus, η * k = 1 − P out /ð1 × NÞ, and finally, the total 3.2.3. Buffer Size. In a multiobjective relay selection approach, the buffer size at the relay node is considered an important performance parameter. We formulate this function based on buffer status that is occupied buffer space (OBS) and available buffer space (ABS); if a relay node has more OBS and less ABS, then the policy of SILO (shortestin longest-out) is adopted. Besides, this link quality is also considered as through adaptive modulation, higher data rate can be achieved. Depending upon the application, buffer size requirement is calculated.
where L is the buffer size, rtt i is the average round trip time for relay i, C is the link capacity, and n is the number of flows sharing the link. Here, we consider n = 1. As capacity is linked to SNR, so a common factor between the different objective functions is SNR [58]. Another method of determining the required buffer size is given in [59] as follows: where S is the packet size; again, the above equation is indirectly dependent upon SINR. Since In our model, each relay R k is equipped with a finite buffer of size L packets. L o k is the occupied buffer space (OBS), and L a k = L − L o k is the available buffer space (ABS). When applying in relay selection, even when our scenario is    9 Wireless Communications and Mobile Computing based on buffer size, as subdivision in this will be made on weight assignment depending upon whether S ⟶ R or R ⟶ D link is to be selected. When the buffer size is not of concern, then equal weights can be assigned to these links. The constraint here will be that the relay receiving should have buffer space more than our data packet and the relay selected for transmission does not have empty buffer. Moreover, the policy of SILO will be applied; this will cater for delays as well.

Battery Power.
Usually, the relay nodes are running on stringent energy budget and the aim would be to transmit a required amount of packets to its destination, under certain channel conditions, in the most energy efficient way. Thus, it would be important to calculate the minimum energy required to reliably transmit these packets. This energy is usually denoted by MEC, that is minimum energy consumption. While selecting, we need to ascertain that at least this much energy is available at the relay node. This MEC is calculated as follows: where D L is the amount of data, B is the channel bandwidth, g is the channel gain, and P t is the transmitter power. In our scheme, the transmitter has the capability to maintain a constant power while adjusting the transmission rate depending upon channel conditions. Moreover, it can also adopt a different policy in which the power is varied to maintain a constant transmission rate. Thus, depending upon the channel condition, a constant received SNR is maintained, which is denoted by γ c , under the peak power constraint P max [60]. Depending upon QoS requirements, the power adaptation will be preferred as it can achieve better energy efficiency than rate adaptation, but at the cost of a certain probability of transmission outage.

Problem Formulation.
The relay selection problem being considered here involves the four objective functions as in Equations (1), (10), (16), and (18), which correspond to the throughput, delay, buffer space availability, and battery power consumption, respectively. The objectives in Equations (1) and (16) Figure 12: Flow diagram of GA.   Figure 14: Particle swarm optimization flow diagram. 10 Wireless Communications and Mobile Computing other two in Equations (10) and (18) need to be minimized. Further, these objective functions conflict as well; therefore, a MOO approach can be adopted. This MOO problem can be solved using the weighted sum approach (also known as the scalarization method) [61,62] and [53]. Thus, using the weighted sum approach, the multiobjective optimization problem for relay selection is formulated as follows: where ∑ 4 l=1 = 1, where I = ð1, 2, 3, ⋯, NÞ: The assignment of weights can be done in three ways: equal weights, rank order centroid (ROC) weights, and rank sum (RS) weights [63]. We have set weights using the RS method [64]; however, ranks of each weight for respective objective are application dependent.
A variety of quality-of-service (QoS) requirement profiles involving a mix of real-time (RT) traffic and non-real-time (RT) traffic along with power consumption and buffer space limitations have been considered through assignment of ranks. For this work, a set of four QoS profiles has been considered which typically corresponds to varying QoS requirements of typical application/user traffic. Each QoS profile is characterized by assigning ranks to the objectives in order of priority. For instance, in one case, throughput objective, being accorded as the highest priority, is assigned 1st rank, followed by the delay, power consumption, and buffer space objectives with 2nd, 3rd, and 4th ranks, respectively. For other cases, ranks of the objectives are varied with the highest rank assigned to a different objective, thus emphasizing a particular QoS profile.

Relay Selection Method
The proposed relay selection scheme is application dependent. For example, there may be an application for which delay is of less concern than throughput, i.e., it requires that its data is passed on to the relays at a faster rate yet it is not concerned how much delay is incurred in relaying the data. Likewise, there can be an application for which buffer size is more important than battery life. With due consideration of all the factors, the best relay from the cluster of nodes can be selected as follows: 4.1. Relay Selection Algorithm. Figure 3 shows that the flow diagram of the algorithm and the pseudocode are given as Algorithm 1. As shown, the relay selection process starts with the announcement of requirements by the secondary source, to which all available relays respond with the exchange of CSI and resource information. In our scheme first, relay-todestination CSI, buffer, and battery state are obtained from all available relays. Depending upon application requirements, i.e., the QoS profile, weights are assigned to different objectives. The network runs a weighted sum optimization algorithm to select the best relay from the available relays 11 Wireless Communications and Mobile Computing and stores its index. First, selecting best S ⟶ D is inline with [30]; this minimizes the number of packets in the relay buffer, thus resulting in minimization of delay. Next, we look for the best available S ⟶ R link, as we have already selected relayto-destination link so it will not be in available links, and automatically, our transmitting and receiving relays will not be the same. Depending upon application requirements, i.e., the QoS profile, weights are assigned to different objectives. The network runs a weighted sum optimization algorithm to select the best relay from the available relays. Our scheme is a bit different from [65], in which if R r1 = R t1 , the proposed protocol selects the relay with the second best S ⟶ R channel R r2 and the relay with the best R ⟶ D channel R t1 for reception and transmission, respectively.

Results and Analysis
The evaluation of the proposed relay selection scheme for a variety of simulation scenarios is carried out, using MATLAB. The validation of results, through simulations in MATLAB using genetic algorithm (GA) and particle swarm optimization (PSO), was also performed. The system model depicted in Figure 1 is the basis for the simulation setup, and evaluation of the proposed relay selection scheme for a variety of simulation scenarios is carried out. The number of nodes in the relay cluster is variable, and the proposed relay selection scheme chooses the best relay from the cluster. The simulation scenarios correspond to a diverse set of application traffic QoS requirement situations that reflect the varying level of importance of the multiple objectives being considered in this work. As mentioned earlier, using the weighted sum method to find the optimal relay pair requires selecting scalar weights w i and maximizing the composite objective function. Changing the weights as per application requirements will give the optimal relay corresponding to that particular QoS profile.
Each of the four scenarios was considered in two different time slots, t 0 and t 1 . The results for the above mentioned four scenarios are reported in Figures 4-11. It can be seen that for each scenario, a different relay is chosen corresponding to the objective with the highest rank (i.e., with the largest weight).
For example, at time slot t 0 , for scenario I where throughput has precedence, the relay index 8 is selected as depicted in Figure 4. Similarly, for scenario II where delay performance is emphasized for time-critical applications, relay index 4 is the most suitable ( Figure 5). For scenario III and scenario IV, where battery power and buffer size are of prime importance, then the optimal relays are relay index 3 and relay index 1, respectively, as shown in Figures 6 and 7. The process is repeated for time t 1 . Again, it was found that by changing the weights, the optimal relay changes. The above results demonstrate the efficient working of the relay selection scheme in terms of adaptability to varying application QoS requirements, thus enabling to dynamically select the most suitable relay for communication.

Result Validation with GA and PSO.
The results were further verified by performing optimization using two different metaheuristic algorithms that are GA and PSO. The reason for using these is that these algorithms have similarities. For the time being, we just validated the first scenario that is throughput, and the unified objective function after assigning more weight to throughput was tested with GA and PSO for time slot t 1 . It was found that the same relay which was selected with our weighted sum iterative method that is relay no. 5 was declared optimal by both GA and PSO. The main idea of GA [66] is to mimic the natural selection and the survival of the fittest.
The flow diagram of the algorithm is given in Figure 12, which further elaborates the concept.
For our simulation, a population size of 100 and 50 iterations was selected. Figure 13 shows the results of the simulations done using GA.
Particle swarm optimization (PSO) was developed by Kennedy and Eberhart in 1995 [67]. It is based on the concept of swarm intelligence. Here, individual knowledge is inferior, but collective knowledge and sharing of information makes it much superior. The mathematical model consists of large number of particles with two basic properties, which are velocity and position. In each iteration, these two are modified/improved towards the optimal solution. Figure 14 gives the flow diagram of particle swarm algorithm.
Again, we selected a swarm size of 100 and 50 iterations. When the simulations were carried out using PSO, for selecting best out of 8 nodes, based on QoS requirements (scenario I: throughput), the results of simulations are shown in Figure 15, which were similar to GA. The results also showed that PSO under these conditions performed better than others giving an optimal value in less iteration. That is, GA took little more iterations to converge. This is a very preliminary analysis and comparison with two different algorithms which are GA and PSO. More detailed analysis and comparisons are left for future work.

Conclusions
The performance of a cognitive radio network (CRN) can be significantly enhanced by integrating buffer-aided relaying in it. Relay selection is a critical component in achieving the levels of performance desired, for a relaying in the network. Generally, the main criteria for a relay selection have been SINR; however, other factors may be equally important for an efficient wireless network, such as throughput, delay, battery life, and buffer status, and thus should be given due consideration. More specifically, in today's communication scenarios with multimedia-rich applications, having diverse QoS needs, relay selection has to be optimized for the various applications and traffic profiles. In this context, the focus of this work has been to devise a relay selection scheme that enables us to choose the best relay for the specific QoS profile meeting application requirements. A multiobjective optimization problem is formulated with throughput, delay, battery power, and buffer status as the main objectives under the SINR constraint. As these objectives contradict each other, multiobjective optimization with the weighted sum approach is employed. Several QoS profiles are defined by setting the ranks for the multiple objectives based on a certain order of priorities using the rank sum (RS) method. Appropriate weights are assigned to objectives in the QoS profiles that reflect varying QoS requirements of the application traffic scenarios. The proposed relay selection scheme provides an optimal solution corresponding to each of the various application scenarios, which then consequently determines the optimal relay for the particular QoS profile corresponding to each application scenario. The results gathered through the relay selection mechanism are validated using genetic algorithm (GA) and particle swarm optimization (PSO) as well. The comprehensive analysis carried out in this work clearly indicates that the proposed relay selection scheme is well suited to ascertain the most suitable relays for the enhanced performance of emerging applications with a diverse range of QoS requirements. In this work, we assumed that there is minimal effect of a slight increase in overhead for communicating its resources. But a thorough cost/benefit analysis of overhead and effect of inaccurate or delayed CSI and resource information warrants thorough investigation. We intend to take up the effect of inaccurate or delayed CSI and also include buffer and battery state-based Markov modeling in our future research work.

Data Availability
Data is available on request from the corresponding author.

Conflicts of Interest
The authors declare no conflicts of interest.