Performance evaluation of pair selection algorithms in device‑to‑device communication using relay‑assisted techniques

Communication services that are dependable are crucial, particularly during emergencies when the regular infrastructure for communication may be disrupted or non-existent. In such situations, device-to-device (D2D) communication can be a helpful choice since it allows user equipment (UE) that is close to one another to connect directly, bypassing the cellular network infrastructure. The primary focus of this thesis is the application of D2D communication in a decentralized emergency scenario with a damaged eNodeB. The main objective is to find an appropriate strategy for finding and selecting D2D couples by simulating several methods in MATLAB. This study compares three D2D pair selection algorithms: distance-based, Signal-to-Interference and Noise Ratio (SINR)-based, and data rate-based distance-based. The simulation results show that the data rate-based strategy is the most effective method for selecting D2D couples in emergency scenarios. In contrast to algorithms that rely on distance and SINR, this one reduces the chance of an outage by 20%. Bit error rate (BER), capacity, spectral efficiency, and energy efficiency are the three types of links that are assessed: direct links, relay links, and UE relay links. The results show that, with the lowest BER and maximum data throughput, the direct link is the most reliable and efficient communication option. However, the relay connection and the UE relay link show better overall spectral efficiency in comparison to the direct link, indicating their ability to transport more data per unit of bandwidth. The option that consumes the least energy among the three is the direct link. The study demonstrates the great potential of D2D communication in emergency scenarios where conventional communication infrastructure may not be available. The direct link is the most dependable and effective alternative for communication, according to the data, although the UE link can still function effectively in the event that the direct link is compromised. The data rate-based method is a useful strategy for finding and choosing D2D partners. The results of this study can direct the development of D2D emergency communication solutions in 5G networks.


Introduction
Among the most significant events that harm infrastructure globally are disasters like earthquakes, landslides, and tornadoes [1,2].Between individuals and disaster management agencies, communication is essential for the post-disaster period [3][4][5].Rapid and precise information gathering from the disaster area can help governments accomplish effective disaster management [6,7].Communication can break down during or after a disaster because of damage to the infrastructure supporting it or because users are overburdened trying to stay in touch with friends and family.As a result, rescue workers cannot observe disaster victims, and they are unable to contact people outside of the damaged area [8,9].By lowering call volume in the cellular communication network, D2D communication technology offers communication services in catastrophe scenarios without the aid of network infrastructure [10][11][12].D2D communication technology is anticipated to be essential in next-generation 5G communication networks since everyone will be using smart mobile devices (UEs) [13,14].In terms of post-disaster search, rescue, and communication, the D2D system is unique.According to the base station's (BS) signal coverage, recent D2D research can be classified into coverage areas and out of coverage areas [15,16].The UEs can communicate with other UEs within the coverage region as well as with central BSs.
Device discovery and communication are the two fundamental components of D2D communication.Finding neighboring devices to create a direct communication link (direct mode) is the process of D2D discovery.Direct discovery and evolved packet core-level discovery are the two categories of device discovery [17].In the event of direct discovery, the UE independently looks for adjacent UE devices; in order for this process to function well, UE devices must take part in the device discovery.People who study the Public Security Network (PSN) mostly use D2D discovery to look into schema design [18], routing (multihop) [19][20][21][22], clustering [23,24], energy-spectrum efficiency [25][26][27], performance evaluation [28,29], and UE discovery [30,31].
A key factor in peer-to-peer (P2P) discovery is the SINR measure.Some D2D discovery algorithms are suggested in Osman's paper [31], based on SINR measurements and UE distances.The short-distance algorithm, Maximum SINR with no limit on the distance of discovery, and Maximum SINR with a limit on the distance of discovery are these.The short-distance-based algorithm only chooses the two closest couples after finding the D2D pairs based on the shortest distance.The second discovery algorithm locates D2D couples based on the greatest SINR between UEs without a distance cap.The third discovery method looks for D2D couples with high SINR values within a set distance.These methods do have some flaws and weak spots, though.UEs are more likely to communicate if there are more matching D2D pairings.
Conventional modes of communication, which include email, cell phone, and telephone, ought to be considered a disaster in the event that they are accessible.Whereas both natural and man-made events may restrict at least one of these interchange mediums, as a rule, no less than one stays feasible.Depending on the extent of the catastrophe, setting up correspondence might be more troublesome and require inventiveness.In these cases, non-conventional specialized techniques, for example, satellite telephones and hand-held radios, ought to be used.Away from these resources, singular innovativeness must be gotten to endure requests to set up correspondence, yet endeavors in such a manner must not stop until correspondence is built up.An emergency communication system (ECS) is any system that is organized for the primary purpose of supporting one-way and two-way communication of emergency information between both individuals and groups of individuals.These systems are commonly designed to convey information over multiple types of devices, from signal lights to text messaging to live, streaming video, forming a unified communication system intended to optimize communications during emergencies.Contrary to emergency notification systems, which generally deliver emergency information in one direction, emergency communication systems are typically capable of both initiating and receiving information from multiple parties.These systems are often made up of both input devices, sensors, and output/communication devices.Therefore, the origination of information can occur from a variety of sources and locations, from which the system will disseminate that information to one or more target audiences.
A throughput-based discovery algorithm is suggested in this article [32] to locate D2D peers among devices on the PSN in the aftermath of a disaster.A test case was made to see how well the suggested algorithm worked.It was compared to other discovery algorithms, such as a short distance-based algorithm, a maximum SINR algorithm with no limit on the distance, and a maximum SINR algorithm with a limit on the distance.For D2D discovery in the disaster region, the suggested throughput discovery algorithm outperformed the existing discovery algorithms.
D2D communication enhances network performance and cost-effectiveness for both 3GPP (Third Generation Partnership Project) and LTE (Long Term Evolution) cellular networks.D2D communication specifically enhances network effectiveness, end-to-end latency, resource usage, and energy efficiency.D2D enables a wide range of applications concurrently, including social networks, data exchange, and games.As a result, enabling D2D communication over LTE dramatically enhances network performance.In 3GPP, LTE version 12 [7,33,34], ProSe (Proximity Service) is used for D2D communication.D2D communication and discovery are essential components of the ProSe D2D service.The 3GPP looked at the architecture of the D2D system that supports the ProSe service, which consists of D2D communication and discovery.In LTE version 13, the use of D2D/ProSe and important communications like 3GPP, small cells, resource efficiency, spectrum bands, and heterogeneous networks got better.In particular, version 13 also kept up with version 12's public safety features, such as D2D discovery based on LTE and D2D communications, which are necessary for public security.The partial coverage and extension coverage for out-of-coverage aspects of D2D communication have also been improved [7,16].
In Doppler and colleagues' study, D2D communication, which is the basis of the 3GPP LTE-Advanced (LTE-A) cell phone network, was seen as a way to improve regional services while causing little to no interference on the main cell phone network [35].Innovative management methods for D2D communication processes and their session setup in the LTE network were put forth.Another work by Doppler and his associates proposed a revolutionary beaconing technique for a service and device discovery radio.The orthogonal frequency-division multiple access concept and the LTE beacon structure serve as the foundation for this system.Energy consumption analysis has shown that devices like smartphones can construct a background network using the suggested marking method without significantly reducing standby operating time [36].
To enable D2D communication in conventional LTE cellular networks, Tang and her colleagues' study tackled the issue of neighbor discovery.When LTE was deployed, the effectiveness of the neighbor detection methods that were suggested was assessed [37] in terms of several system metrics.In order to compare the performances of three discovery resource selection algorithms, such as the greedy, random, and coordinated algorithms, Simsek and her friends suggest a system-level simulator based on 3GPP [38].The findings indicate that the random technique is inferior to the other algorithms.The approach was suggested and examined for the finding of neighboring nodes in wireless networks in the paper by Vasudevan and his colleagues.An ALOHA-like neighbor discovery approach was given with a single-hop wireless node network in the same article [39].Sun and his friends present a friend-neighbor discovery protocol scheme.This plan was put forth by placing handshaking subgroups in front of regular slots [40].
Yang and his coworkers presented an LTE-A network distributed mapping protocol.To lower the amount of resources used during discovery, this study suggested a method similar to the adaptive FlashLinqQ structure that is based on the number of D2D UEs that were asked.Comparing P2P and UE finding times was done in the same study [41].Zou and her colleagues studied a signal and came up with the idea that it could be the discovery signal that starts P2P communication at the physical layer level of an orthogonal frequency-division multiple access cellular system.The suggested signal has low overhead, good noise tolerance, and high power efficiency [42].Another piece of research by Zou and her colleagues offered a signature-based discovery technique as a hypothetical example for cellular networks [43].In their paper [44], Yang and his colleagues talked about how to design an LTE cellular network that uses a marker along with the usual packet-based method to find devices.This method is similar to the Flash-LinqQ structure.To secure D2D communication, Hayat and his friends presented the sphere decoder-like discovery technique inside a lattice area with a radius of R [45].The study by Fodor and his colleagues came up with the idea of procedure-based clustering, which is a way to design a system that combines cellular and particular modes of operation.The dependability of this system has been enhanced to rely on LTE network substructure nodes, specifically D2D communication.The Mobile and Wireless Communications Enablers for the 2020 Information Society, which is the European 5G research project, acknowledges the suggested method as a technological component of 5G [24].
For virtual and distributed LTE mobile networks, Gomez and her colleagues came up with the hybrid base station method to make UE, eNBs, and the evolved packet core less dependent on each other [18].In a fully utilized cellular network for D2D communication, Yuan and his coworkers jointly provided dynamically chosen multi-path routes.Communication infrastructure is harmed in their study's "modeling scenario" of a terrorist attack in Ottawa.It has been demonstrated that interference-aware routing performs superiorly to shortest-path routing and broadcast routing [46].An overview of 3GPP ProSE was provided in Lin and colleagues' work.In the absence of cellular networks, LTE devices with D2D capability were said to work better on PSN than on commercial networks [17].
In their study, Babun and his colleagues looked at D2D communication as a way to expand the coverage of active BSs in the event that the PSN had insufficient coverage.In order to take into account PSN scenarios that are 3GPP standard-compliant, a system-level simulator for HetNet and D2D technologies was presented.The simulator was employed to demonstrate D2D multi-hop communication performance in cellular networks with partial coverage [22].
The performance of transmission architectures backed by relays, which can boost PSN capacity and power savings, was the main emphasis of Kamran and his colleagues' study.In order to reduce power transfer and computational complexity, a distance-based technique was also developed [47].In a different project, Kamran and his buddies were given the idea to use a clustering process to create a system structure that combined D2D and cellular working modes.To facilitate PSN, and particularly D2D communication, this technique relies on the availability of substructure nodes [10].Another study that Kamran and his friends presented concentrated on the reuse mode in terms of spectrum efficiency.In order to increase the lifespan of the energy-constrained network, simultaneous wireless information, power transmission, and energy harvesting were implemented in the relay (R).When the cellular infrastructure is partially broken, the cluster construction technique, along with D2D communication, can be integrated into cellular networks to maintain communication services [23].Wang and his coworkers concentrated on restoring the post-disaster network's capacity using the acclaimed Steiner Tree.Using a multi-hop approach, it was intended to restore the network from the still-running BS to the out-of-service evacuation locations.Utilizing BS data, the actual evacuation site in the city of Tokyo, and big data analysis based on the post-disaster service model, the proposed plan was reviewed in order to more precisely convey the assessment results [48].Osman's study looked at D2D communication and discovery techniques in 5G communication systems.This study found the output D2D percentages from D2D devices that were placed at random.It also compared the short distance-based, maximum SINR with no distance-based limit, and maximum SINR with a distance-based limit algorithms for single and multiple cells [33].The capacity, bandwidth, spectrum, and energy efficiency estimates in the LTE network standard were looked into for an example scenario in the study by Marttin and his colleagues.As the communication distance between the D2D increases, it was demonstrated in this study that the energy efficiency of the UE with a large bandwidth decreases quickly in comparison to the UE with a small bandwidth [26].In the study by Hossain and his associates, a unique technique called SmartDR was suggested that uses smartphones to aid in post-disaster recovery.This approach incorporates D2D neighbor finding and multihop routing [49].Under the name SSA, Hayat and his coworkers introduced the device discovery-based scanning technique for the cell sector.According to the received signal strength in a particular area, this technique uses random walk and velocity scenarios [30].
The harmonic Sierpinski gasket can be used as a geometric configuration of small antennas, and its performance can be characterized by the associated entropy.The theory of harmonic functions can be generalized to the Sierpinski gasket through the concept of energy, which enables the study of probability theory and harmonic analysis [50].Fractal geometry is used in modeling natural phenomena, image compression, and data analysis [51].The key factors that affect fusion performance in multi-resolution decomposition algorithms include the number of decomposition levels, the choice of filter, and the shift-invariant property.The appropriate setting for the number of decomposition levels is four, which is a trade-off between the capability of catching spatial details and the sensitivity to noise and transform artifacts.Short filters usually provide better fusion results than long filters, and the shift-invariant property is important for image fusion, not only for misregistered images but also for strictly registered source images.The latest image decomposition methods, such as curvelet and contourlet, have been introduced to pursue a "true" two-dimensional transform that can capture the intrinsic geometrical structure of images.In comparison to traditional methods like wavelet, the experimental results show that the curvelet and contourlet methods perform better in image fusion, especially for multi-modality images.The dual-tree complex wavelet (DTCWT) and stationary wavelet transform (SWT), which produce results that are similar to those of the nonsubsampled contourlet transform (NSCT), are typically the next best performers.The curvelet transform (CVT) performs better than the discrete wavelet transform (DWT) for multi-focus images, while the DWT presents better results than CVT for infrared-visible images and medical images.The contourlet transform (CT) is the worst one [52].This work discusses a wavelet expansion theory for positive definite distributions on the real line and defines a fractional derivative operator for complex functions in the sense of distributions.The Ortigueira-Caputo fractional derivative operator is rewritten as a convolution product using the fractional calculus of real distributions.This lets us describe the complex fractional derivative using theoretical distributions.In particular, the fractional derivative of the Gabor-Morlet wavelet is computed together with its plots and main properties [53].This work delves into the analysis of Chebyshev wavelets' differentiability and explores the potential application of their derivatives in reconstructing functions.It looks closely at the unique features that make Chebyshev wavelets unique.These features are shown using connection coefficients in finite series that include the Kronecker delta.Moreover, the investigation delves into the p-order derivative of Chebyshev wavelets and computes its Fourier transform.The introduction of the Taylor expansion of the mother wavelet facilitates the introduction of the concept of local fractional derivatives for Chebyshev wavelets.Adding local fractional calculus to these wavelet bases makes it possible for local fractional derivatives to be used on functions that are not smooth and continuous [54].
This work deals with an emergency situation in which there is no proper infrastructure for the network considered.In such a situation, the main aim of this work is to send the information to the destination.In the D2D algorithm, the first step is identifying the availability of any D2D device.If a device is identified, it communicates with it.It identifies the following device and sends data in the following step to make sure the receiving device receives it.Since it is in an emergency situation and communicating without infrastructure, this work is not worried about low efficiency and waste of resources.The only concern is information delivery.

Methods/Experimental
By using model equations, the D2D discovery system model is explained briefly in this section.When device detection is successful, UEs can intercommunicate right away via D2D communication.As an example of a scenario, Fig. 1  Allow S to be the power of the incoming signal, I to be the power of the other signals' interference inside the network, and N to be the noise.
The D2D discovery system model's SINR metric ( γ ) can be calculated using the formula Assume that S (i,j) is the signal power between the ith and jth User Equipments; Transmitting power is denoted by T and G (i,j) R represent transmitter and receiver antenna gains, respectively; PL indicates path loss; d i,j is the distance between the ith and jth User Equipments; and the fading coefficient is denoted by h i .Using Eq. 2, one may determine the power of the incoming signal S. Equation (3) provides the formula needed to calculate interference between the ith and jth User Equipments: where I (i,j) indicates interference between the transmitter (the ith UE) and the receiver (the jth UE).The SINR metric is computed using Additive White Gaussian Noise as the noise.
Below are the path loss model, Log-Normal Shading model [55], and constant propagation loss [56]: (1) Fig. 1 Model of the D2D discovery system in a single cell [35] where the random shadowing effect is represented by X σ , the reference distance is repre- sented by d 0 , and n is the route loss exponent.
Equation ( 5) provides the route loss at the reference distance ( d 0 ), or PL(d 0 ).
"(f c ) " represents the frequency of transmission.Separate consideration is given to the distances for every D2D point.In the coordinate plane, the Euclidean distance relation is applied as follows to determine the separation between two nodes: where the locations of the UE transmitter and receiver are denoted by (x T , x R ) and (y T , y R ) , respectively.

Minimum distance of discovery between D2D devices algorithm
The shortest distance between UEs is the basis for the selection process in this discovery approach.The best D2D pair is identified by selecting the pair with the smallest distance and determining whether this pair also satisfies the minimal SINR threshold.Figure 2 depicts the flow chart of the algorithm for the minimum distance of discovery between D2D devices.( 4)

Maximum SINR with no limit on distance of discovery algorithm
SINR values are used as the basis for selection in this method.Since this technique does not take the distance of the discovery threshold into account, it selects D2D couples if they match the minimal signal to the interference and noise ratio threshold and selects the pair with the largest SINR in both directions.The flow chart for the maximum SINR method with no distance of discovery constraint is shown in Fig. 3. Fig. 3 Flow chart for the maximum SINR with no limit on the distance of discovery algorithm

Maximum data rate with no limit on the distance discovery algorithm
In this technique, the variables that determine the selections are the modulation index (MI) and the data rate.The flow chart for the distance finding algorithm with no limit at the maximum data rate is shown in Fig. 4.

D2D discovery algorithm with amplify and forward (AF) relay
With this approach, the D2D serves as a basic repeater.UE2 in the center picks up the signal, amplifies it, and sends it on to UE3 at the right end of Fig. 5. Notwithstanding their simplicity and extremely low delay durations, AF relays are helpful in many noise-limited system deployments because of their capacity to enhance the desired signal in addition to any interference or noise that may be present.The D2D discovery method flow chart using AF Relay is displayed in Fig. 6.

Performance metrics
The performance of the proposed D2D discovery algorithms in this work is analyzed using the following measures:

Signal-to-noise power ratio (SNR)
The SNR formula determines, in decibels (dB), the ratio of the power of the received signal to the power of the received noise.A higher signal-to-noise ratio (SNR) indicates improved signal quality, a more dependable communication link, and easier signal separation from noise.

Channel capacity
The channel capacity (C) is measured in bits per second and is calculated by the formula where B is the transmitting signal bandwidth in Hertz.

Data rate or throughput
With a given bandwidth and signal-to-noise ratio (SNR), the data rate formula calculates the maximum number of bits that can pass over a communication channel in a second.
where packet_size is measure in bits.

Spectral efficiency
The quantity of data that may be sent through a communication channel per unit of bandwidth is known as spectral efficiency.It represents the effectiveness of the system in making use of the available bandwidth and signal-to-noise ratio (SNR) to transfer data, and is commonly stated in bits per second per Hz (bps/Hz).The spectral efficiency of the direct connection, relay link, and UE relay links are determined in this work using three distinct spectral efficiency formulas.The spectral efficiency formula for the direct link is as follows: The direct_data_rate in this work refers to the average data rate that is obtained during a number of transmission frames.The Shannon capacity formula, which provides the highest data rate possible for a given channel bandwidth and signal-to-noise ratio (SNR), is used to determine the average data rate.
The following is the spectral efficiency formula for the relay link: The average data rate obtained across a number of transmission frames is called relay_data_rate in this case.The relay amplification gain is taken into consideration in addi- tion to the direct link Shannon capacity formula when calculating the data rate.
The formula for spectral efficiency for the UE relay links is as follows: ( The array of average data rates obtained for each UE relay over several transmission frames is called ue_relay_data_rate in this case.The UE relay amplification gain is a new term that is included in the Shannon capacity formula used to compute the data rate for the direct link.

Energy efficiency (EE)
How effectively a wireless communication system uses its power resources to transmit data is determined by its energy efficiency.The link between the data rate reached and the power consumed to get there defines it.The energy efficiency formula used in this study is:

Bit error rate (BER)
The bit-error rate (BER) is a metric used to assess the effectiveness of digital communication systems.It is calculated by dividing the total number of bits broadcast by the number of bits received incorrectly.A lower BER denotes improved system performance.The direct connection, the relay link, and the UE (User Equipment) relay link are the three transmission links for which the BER (Bit Error Rate) is computed in this study.
The following formula is used to get the BER of a direct link: The variable direct_error_bits represents the total number of errors for the direct link over all frames.
The formula below is used to determine the relay link BER: where the number of errors for each relay and each frame is contained in a matrix called relay_error_bits , which has size num_relays -by-num_frames.The number of UE relays is utilized in place of the number of relays in the UE relay link BER calculation, which is computed similarly to the relay link BER calculation: The number of errors for each UE relay and frame is contained in the matrix ue_relay_error_bits , which has a dimension of num_ue_relays -by-num_frames.

Results and discussion
This section evaluates the performance of the suggested D2D discovery algorithms in detail.(

Overall environment parameters and assumptions
Table 1 summarizes the most frequently used simulation parameters in wireless cellular network simulations, which are used to assess the simulations' performance.

General structure of the proposed network
The proposed network is made up of a grid of uniformly spaced hexagonal cells across the designated region, as shown in Fig. 7. Six neighboring cells surround each hexagonal cell, which symbolizes a single cell in the proposed cellular network.
The cells are utilized to give wireless coverage to the surrounding area by connecting to a central base station or cell tower.To simulate various situations and assess the network's performance under various circumstances, the number of D2D devices in the network can be changed.The network's performance can be maximized by analyzing the resulting network topology to find possible areas for development.All things considered, the network architecture is built to minimize noise and interference while offering dependable and effective wireless coverage to the designated area.As a result, Fig. 8 displays the distribution of D2D devices within the network as well as the hexagonal cells that comprise the cellular network.The uniform and random placement of D2D devices within the network enables a realistic simulation of the device distribution inside an actual network.Since every device is assigned a unique number for identification, it is simple to monitor each device's performance inside the network.

Using minimum distance discovery algorithm between the devices
The distance method is used to choose pairs of devices based on the shortest distance between them and the minimal SINR threshold, as shown in Fig. 9.The number of device pairs chosen based on the smallest distance between them and the total number of devices used are displayed in a graph.The graph shows that the average number of pairs selected rises as the number of devices increases.In a similar vein, the average number of D2D (device-to-device) pairs increases when the distance threshold between devices rises.The distance method results, as shown in Fig. 10, yield the highest proportion of outages at a threshold of 100.Nevertheless, the percentage of outages decreases as the threshold distance increases.As the number of devices increases, there doesn't appear to be an increase in the proportion of devices having outages.

Using SINR discovery algorithm between the devices
A modified version of the discovery process using SINR with different thresholds is shown in Fig. 11.Based on a distance constraint between UEs, this algorithm determines which D2D pair among the UEs in the network has the largest SINR value.A higher SINR results in the discovery of more active pairs, whereas a lower SINR results in fewer active pairs.The number of active pairs and the number of devices are directly correlated; thus, as the number of devices rises, so does the number of pairings.Additionally, the graph shows that low SINR directly affects UE detection.As can be seen in Fig. 12, the percentage of outages is nearly 100% at the low SINR threshold but begins to decline as the SINR improves.The red color line in the graph shows that the SINR of − 16 dBm is preferable since it has the lowest percentage of outages, which increases the likelihood of finding UEs.

Using data rate discovery algorithm between the devices
The relationship between the number of active pairs and the total number of devices is shown in Fig. 13.Three data rate thresholds were selected, and while the two graphs may appear to be identical, the number of active pairs is greater in the 1500 m 2 area.Depending on the threshold, it begins to grow as the number of devices grows.
The three algorithms provide similar results, with high data rates for a 5000 m 2 area (see Fig. 14 on the right), but higher data rates lead to a larger number of active pairs.

Performance comparison of the proposed algorithms
Three methods were employed, as described in the prior graphs, to choose the D2D pair with a different threshold; however, in the figures below, the three techniques were combined under the same environmental circumstances.
Using the data rate discovery method produced a larger number of active pairings than the distance approach, according to the results presented in Fig. 15 above.The difference is approximately three times greater than the minimum distance and SINR-based discovery algorithms.In comparison to the other two algorithms, the SINR algorithm's outcomes were in the center.The graphs show that while there were few devices, all of the algorithms operated in the same way.However, after around fifty users, a noticeable difference occurred, and the number of active pairings began to rise sharply.
Outage rates for the three methods are displayed in Fig. 16.When compared to other algorithms, the distance method has the highest rate of failure.The data rate algorithm performed the best and had the lowest outage compared to the SINR method, which has an outage rate of around 50%.After categorizing the device peerfinding procedures, the D2D will be employed as a relay, and its performance in its (Amplify and Forward) mode will be measured.Table 2 shows the comparison of suggested algorithms according to the percentage of outages.

Performance evaluation of D2D discovery algorithms with AF relay
Based on the output scenario we provided, the average SNR values for each link are: Direct link: 1.922058 Relay link: 1.181670 UE relay links range from 1.033123 to 8.821325, with an overall average of 3.793029.In this simulation, the direct link provides a lower average SNR value compared to the high SNR value simulation output we provided.This indicates that in this scenario, the quality of the direct link is not as good as in the high SNR simulation.The relay link also provides a low average SNR value, indicating that the relay link is not a good option for communication in this scenario.The average SNR values for the UE relay links are closer to the average SNR value of the direct link, and some UE relay links provide significantly higher SNR values compared to the direct link.This indicates that in this scenario, the UE relay links may be a better option for communication compared to the direct link or the relay link.However, it is important to note that the UE relay links that provide the best SNR values may vary depending on the specific frame and the location of the UE relay nodes.Therefore, based on the simulation output we provided, it appears that the UE relay links may be the best option for communication in this scenario.However, the choice of the best link also depends on other factors, such as the data rate, latency, and reliability requirements of the specific application and use case.It is important to carefully evaluate and test the performance of the wireless network in a real-world scenario to ensure that it meets the requirements of the specific application and use case.
Based on the output of the console and Fig. 17, it can be seen that the average SNR values for the direct link, relay link, and UE relay link are different for each SNR value.However, we can make some general observations: For the first two SNR values (10 dB and 100 dB), the average SNR value for the direct link is low compared to the UE relay link.For the highest SNR value (200 dB), the average SNR value for the direct link is higher than the average SNR value for the relay links.It is clear from the analysis that the SNR value has a direct impact on the performance of the three links.Increasing the SNR will improve the performance of all three links, while decreasing the SNR will lead to poorer performance.Therefore, it is important to consider the SNR value when designing and analysing communication systems and to ensure that the SNR is sufficient to meet the performance requirements of the system.Table 3 displays the simulation results of the average SNR for the three suggested links.

BER of direct link and relay links
Using the output from Fig. 18 and the console results, the suggested scenario creates a wireless communication system inside, and three different links are tested to see how well they work in terms of bit error rate (BER).The direct link and the relay link have a fixed transmit power and antenna gain, which may limit their coverage and capacity.The transmit power and antenna gain are not optimized for the specific scenario and may not provide the best coverage or capacity.Additionally, the UE relay link may have lower transmit power and antenna gain due to the limitations of the UE device, which may limit its coverage and capacity compared to the direct link or the relay link.However, the UE relay link can provide additional coverage and capacity by acting as a relay node, which can improve the signal quality and extend the range of the communication system.Based on the output results and simulation provided, it appears that the UE relay link has the lowest average BER, which suggests that it provides the most reliable and errorfree communication channel in this scenario.However, the differences between the average BERs for the three links are very small, which indicates that all three links are performing well in this scenario.In summary, based on the figure provided below, the best link in our scenario appears to be the UE relay link, although the choice of the best link depends on several factors.In our scenario, the fading and distance between the UE are random, so our output can change every time, but mostly the BER of the links is close to each other.Table 4 shows the simulation results of the average BER for the suggested three links.

Comparison of capacity of relay links and direct link
Figure 19 shows that the mean capacity of the direct link is 86.32 Mbps, the mean capacity of the relay link with fixed nodes is 83.83Mbps, and the mean capacity of the relay link with UE relay nodes is 84.29 Mbps.These findings show that the direct link, the relay link with UE relay nodes, and the relay link with fixed nodes all have the highest capacity.The standard deviation of each link's capacity is also calculated for each frame of data.The standard deviation of the direct link's capacity is the highest, with a value of 3910307.08 bps.This indicates that the capacity of the direct link varies widely over time.The standard deviation of the relay link with fixed nodes is 2990834.86bps, which is also relatively high, while the standard deviation of the relay link with UE relay nodes is much lower, with a value of 247306.51bps.This suggests that the capacity of the relay link with UE relay nodes is more stable over time than the other two links.The simulation results of the average capacity for the three proposed linkages are displayed in Table 5.

Comparison of spectral efficiencies between direct link and relay links
Based on the spectral efficiencies calculated for the suggested links, Fig. 20  Comparing the spectral efficiencies of the different transmission scenarios, we can see that the fixed relay link and the UE relay links provide higher spectral efficiencies than the direct link.This is because the relay links can mitigate the effects of path loss and fading and provide additional diversity gains, resulting in higher data rates and spectral efficiencies.Among the UE relay links, we can see that the spectral efficiencies are fairly consistent across the different relay nodes, with only a small variation in the range of 17.622612 bps/Hz to 17.903864 bps/Hz.This work suggests that the UE relay nodes are able to effectively relay the data and provide reliable communication links.
Figure 21 shows the randomly generated positions of the UE relays, which are scattered across the simulation area.The advantage of using UE relays is that they can provide Fig. 20 Comparison of spectral efficiency between direct link and relay links a cost-effective solution for extending the coverage and improving the reliability of the wireless connection, particularly in areas with poor signal strength or high interference.
All three of the proposed links' overall spectrum efficiencies are shown in Table 6.

Conclusion
This study looks at how well relay-assisted strategies for pair selection algorithms work in device-to-device communication for Fifth Generation Systems.It does this by looking at two parts: how D2D devices find each other and how they send information between devices.The initial part of device peer discovery, which is centered on an emergency scenario, has three main techniques for choosing a D2D pair in place.The data rate algorithm may lower the chance of an outage by 20%, according to MATLAB simulations of the algorithms.The data rate method won out when compared to the SINR and distance algorithms.Our section shows that, out of the three links, the direct link has the lowest bit error rate (BER) of 0.004991, indicating that it offers the most dependable communication.In comparison to the relay connection (83.83 Mbps) and the UE relay link (84.29 Mbps), the direct link has the maximum capacity and gives the highest data throughput (86.32 Mbps).This implies that more data can be transmitted over the direct link in a given amount of time.However, the relay connection and the UE relay link both show greater values than the direct link when it comes to total spectral efficiency.The UE relay  link has an overall spectral efficiency of 17.756052 bps/Hz, compared to 17.599456 bps/ Hz for the relay link.This indicates that both of these links are more effective at using the available spectrum than the direct link, as they can transfer more data per unit of bandwidth.The relay links' D2D_relay_avg_energy_efficiency and ue_relay_avg_energy_ efficiency are 0.001193 bps/Hz and 0.001117 bps/Hz, respectively, whereas the direct link has the highest average energy efficiency of 0.735408 bps/Hz.This suggests that out of the three, the direct link is the most energy-efficient.Accordingly, the direct link is the most dependable and effective choice for communication, according to the simulation that was provided.In contrast, the UE relay link has a significantly lower standard deviation for the transmitted frame when compared to the other two links, which might suggest a more consistent and stable transmission performance.In this research, three various algorithms, such as minimum distance-based, SINR-based, and data rate-based, have been simulated only in certain experimental environments that were created using MATLAB.So, the proposed algorithms are also to be applied for the analysis of public safety networks.During the real-time implementation, public safety will be considered.
depicts the D2D system model for device discovery in a single cell.The orange dashed lines in this figure show the interference between D2D transmitters and receivers, whereas the blue solid lines show the direct connection between UE pairs.

Fig. 2
Fig. 2 Flow chart for minimum distance of discovery between D2D devices algorithm

Fig. 4 Fig. 5
Fig.4 Flow chart for the maximum data rate with no limit on the distance discovery algorithm

Fig. 6
Fig. 6 Flow chart for the D2D discovery algorithm with AF Relay

Fig. 10
Fig. 10 Minimum distance discovery algorithms based on the outage percentage

Fig. 12 Fig. 13
Fig. 12 Percentage of outage according to the SINR discovery algorithm

Fig. 14 Fig. 15
Fig. 14 Percentage of outage according to the data rate discovery algorithm

Fig.
Fig. SNR Frame Index at a constant SINR of 10 dB

Table 1
Overall simulation parameters

16
Comparison of algorithms according to percentage of outage

Table 2
Comparison of algorithms according to percentage of outages

Table 3
Simulation results of the average SNR for three suggested links

Table 4
Simulation results of the average BER for three suggested links Fig. 19 Comparison of relay links and direct links based on capacity depicts that the spectral efficiency of the direct link is 10.028330 bps/Hz, while the spectral efficiency of the fixed relay link is 17.599456 bps/Hz.The spectral efficiencies of the UE relay links range from 17.622612 to 17.903864 bps/Hz, with an average spectral efficiency of 17.756052 bps/Hz across all UE relay nodes.

Table 5
Average capacity for three suggested links

Table 6
Overall spectral efficiencies for three suggested links