Skip to main content

An adaptive MLP-based joint optimization of resource allocation and relay selection in device-to-device communication using hybrid meta-heuristic algorithm

Abstract

Enhancement in both energy efficiency and spectral efficiency in cellular networks is made possible by means of an advanced technique called device-to device (D2D) communication. The enhancement of these efficiencies is done by utilizing the cellular user (CU) resources once again to make communication with nearby cellular devices in an effective manner by spectral means. As the D2D communication technology is capable of providing a direct communication link with nearby devices effectively with enhanced spectral efficacy, this approach is considered as an ideal solution for the futuristic cellular communication network. A flexible and reliable relay-assisted communication by means of D2D technology is required that acts as an intermediate relay when the attenuation between the channels across the D2D devices becomes high. The throughput of the system is increased by utilizing D2D communication technology as it uses direct data transmission within cellular devices. When the cellular user is far apart from one another, the data loss in the D2D communication system is minimized with the utilization of the relay. When the channels are good, then the relay nodes (RNs) serve the cellular user. However, it is noted that the D2D systems are affected by issues such as higher consumption of energy and spectral sharing. Also, the sum rate gets degraded as a result of mutual interference between resource-sharing cellular devices in the relay-assisted D2D communication system. The transmission of the data in a traditional relay-assisted D2D communication system is carried out between the D2D receiver (DR) and D2D transmitter (DT) only with the utilization of its own energy by the RN. The issues in relay selection and resource allocation in the conventional joint resource allocation schemes are tackled by executing a scheme for performing the task of optimal relay selection and joint resource allocation. The enhancement of the overall sum rate in the D2D communication is the main motive behind the implemented scheme. This goal is attained along with the minimization of the link rates in the cellular and D2D networks. The ideal selection of the relay and the execution of the joint resource allocation are done with the utilization of a new optimization scheme called the hybrid flow direction with the chameleon swarm algorithm (HFDCSA), in which the flow direction algorithm (FDA) is fused along with chameleon swarm algorithm. This optimal selection of the relays is assisted by considering constraints like the network’s sum rate and energy efficiency in the network to achieve high performance. The data obtained from distinct sources are given to the adaptive multi-layer perceptron (AMLP) in which optimal resource allocation and the relay selection are performed with the help of the suggested HFDCSA. The parameters in the MLP are tuned by the same HFDCSA. Finally, the performance validation is conducted in the stage to verify the working of the suggested approach.

1 Introduction

As a result of the rising cellular communication network, it is required for wireless communication systems to show constant evolution to cope with the increasing need for high data transfer rates [1]. When a pair of users is close to one another in the D2D communication system, they can either have the chance to directly communicate with each other or communicate indirectly using the same resources as cellular users. Evolved node B (eNB) regulates the users in the D2D communication system [2]. eNB is also used for determining whether a resource is utilized by cellular links or by D2D links. Utilizing resource blocks (RB) in both cellular and D2D communication helps in generating higher throughput along with minimal latency with the utilization of a direct link with the enclosed user equipment (UE) with the least energy consumption rate to enhance the functioning by employing D2D communications [3]. Among various approaches, the most potential one is the D2D communication. Its superior capacity in enhancing the cellular networks’ energy and spectrum efficiency makes it an advanced communication technology [4]. This D2D communication made it possible to enable direct communication between two adjacent users without the need for a base station (BS) for sharing the same resources that are used by the traditional cellular user (CU) [5]. D2D is the future generation of cellular networks developed for satisfying the constantly rising demand for local area services [6].

D2D communication facilitates the elimination of mobile traffic, while the users can exchange for sharing and downloading content, which is advantageous to non-D2D (cellular) users as well [7]. As a result, it is anticipated that D2D communication will be a crucial part of futuristic cellular networks. Among the various interesting new technologies, D2D communication has granted significant interest from both the research community as well as the business community [8]. The reason for this is a result of its proven potential to raise cellular networks’ energy and spectrum efficiency. This improvement is made possible by the elimination of the BS along with sharing the same resources of the CU [9]. Nonetheless, several factors should be considered while establishing a new D2D communication system. While D2D communication improves performance in numerous manners, it also introduces significant interference that can lower the data transfer rates between D2D and cellular users [10]. In the case of users with similar spectral resources, there is a possibility of higher mutual interference [11]. Thus, power allocation (PA) and resource allocation (RA) approaches are introduced in the D2D communication system [12].

Relay-assisted wireless networks have emerged as a result of the requirement to improve wireless communication’s flexibility and dependability while also expanding its range of communication [13]. As a result, whether there is a significant distance or an extremely attenuated channel that is present between the DR and DT, the direct D2D communication is altered into a relay-assisted communication system [14]. User association is not taken into account by the earlier work on relay-aided D2D communication systems' resource allocation schemes utilizing distributed methods. Certain studies employ centralized approaches with significant complications in computation to accomplish the task of controlling the power in the network, cooperation between the user, and resource block allocation [15]. As a result, in order to obtain the maximum benefit from the lower complex stable matching technique, a semi-distributed method for controlling the power in the network, cooperation between the user, and resource block allocation is developed. RN typically used in relay-assisted D2D communication makes use of their energy to transmit the data from a DT to the DR without obtaining any additional benefits [16]. In addition, the best processing model is chosen among the local computing systems to offload the mediating and completion of the relay device and directly load them by utilizing a relay to the MEC server to carry out the computational functions [17]. Furthermore, the partial estimation of loading to obtain a more sensible RA in the MEC system is not taken into account in the conventional schemes. Recently, machine learning techniques have been applied to select relays with better performance rates. On the basis of the RN, source, and destination's secrecy rates, the machine learning method ANN is widely used. However, machine learning methods that use evaluation metrics like ergodic capacity, outage probability, and bit-error probability to calculate the performance are not considered here. Thus, a method is created using a machine learning technique by considering the constraints like “signal-to-noise ratio (SNR) and peak signal-to-noise ratio (PSNR)” on the power of the wireless networks. Outage probability minimization is considered the main goal behind the relay selection approach.

The further sections in this paper besides the introduction part given in Section I are listed below. In Section II, the literature review is provided. In Section III, the joint optimization of resource allocation and relay selection in the D2D communication system model along with its proposed description is provided. The development of the hybrid optimization technique for joint optimization of RA and relay selection is given in Section IV. The implementation of an automatic prediction on RA and relay selection using an adaptive deep learning model using the optimal solution is provided in Section V. Section VI gives the results and analysis carried out on the executed model. In the final section, the conclusion is provided.

2 Literature survey

2.1 Related works

In 2022, Cao et al. [18] have implemented an RA scheme for maintaining high energy efficiency (EE) in D2D based on a social-aware relay selection approach. The conventional cellular relay was replaced by a D2D user to enhance the model’s flexibility. This user acted as the optimal D2D relay. This user was selected based on trust value, social connection, and link stability. The social as well as the physical constraints were used to solve the “mixed-integer nonlinear fractional programming (MINLFP)”. The optimal selection of the relay to enhance the EE was carried out using a technique in which the “Lagrange dual decomposition and Dinkelbach theory” were combined. The EE offered by this scheme was much better than the conventional social-aware and social-blind approaches of the D2D system.

In 2017, Kishk et al. [19] have executed a time-sharing approach to perform the functions of power control, cooperation between the user, and allocation of resource blocks. This model has considered a mixed multi-level system and has optimally selected energy harvesting relays with the aid of stable matching theory to provide a distributed complication-less solution. The simulation was performed to prove the efficacy of the suggested scheme.

In 2019, Salim et al. [20] have enhanced the link’s sum rate without affecting the user’s quality of service (QoS) demands. A new approach called the “resource and power allocation with relay selection EH (RPRS-EH)” was suggested to tackle the MINLP. This algorithm was capable of solving the relay selection issues with low complication by incorporating factors such as the PS factor for power allocation in the links and the reuse partners. Enhanced results were provided by the implemented technique.

In 2021, Feng et al. [21] have implemented an approach called the “energy harvesting-aided D2D network under cognitive radio (EHA-CRD)” to communicate with the relays and the destination node in the D2D system and for harvesting energy from the base station to carry out efficient communication. As per the number of cellular user counts and the SNR, the optimal relay selection and the joint time allocation issues were tackled. Random allocation of the time for communication and energy collection took place. The optimal relay was selected using the “weighted sum maximum algorithm”. Then by utilizing the “fractional programming approach” the problems related to EE were solved by converting them into a convex issue so that it was solved using iterative algorithms. Enhanced results were obtained by means of conducting extensive simulations.

In 2020, Li et al. [22] have implemented a mobile edge computing (MEC) system with D2D communication. The processes of data offloading by various smart devices (SD) were done with the aid of a wireless access point (WAP). Here, the WAP acted as the relay between the MEC. The optimal selection of the relay and the RA issues were solved to minimize the energy consumed by the users. The optimal selection of the relay was done by solving the convex optimization issue. Once the optimal relays were selected, then the Lagrange scheme was used to solve the RA issue. The implemented scheme was a root-determining technique, thus has reduced computational complexity. Simulation findings showed that the executed scheme was efficient, and energy-saving with reduced time costs.

In 2017, Wang et al. [23] have suggested a UE as a possible relay for D2D communication in a multi-relay network for other D2D links in addition to acting as an energy source. The association among various UEs was also assessed. A method for the optimal selection of the relay was executed. A bargaining approach was utilized to provide a solution for effective resource-sharing between the UEs that were associated with one another. A proper allocation outcome for sharing the resource was obtained by altering a random function into the introduced iterative scheme. Enormous simulations were performed to prove the efficacy of the introduced scheme.

In 2015, Zhao et al. [24] have solved the optimal relay selection issues and the joint RA issues that arise between a variety of D2D and an inactive cellular user pair with an arbitrary linear network coding. The clustering scheme in the D2D network was introduced to get the optimal solution for the binary integer nonlinear programming (BINLP) issue. With an average sum rate enhanced by 50%, the implemented scheme was capable of minimizing the necessary D2D pair rate, which was proved by experimental simulations.

In 2017, Gao et al. [25] have implemented an inter-session system coding for enhancing the D2D network’s communication capacity to assist the transmission of data in the D2D network. The transmission of data in the network was enhanced along with solving a joint optimization issue of relay selection and RA. The authors have also attained an enhanced network performance even on interference. A double-tire decentralized scheme called the NC-D2D was developed to get a consistent solution for the network while solving the RA and relay selection issues. The pairing of the cellular resources with the relays and the D2D systems in the NC-D2D was carried out using the greedy algorithm-based game allocation scheme. The coded transmission of the network was done by using a coalition formation game-based relay with D2D pairs. The superiority of the implemented scheme was proven by conducting extensive simulations.

In 2023, Gao et al. [26] have suggested a method for maximizing the combined channel capacity along with satisfying the “signal-to-interference plus noise ratio (SINR)” specifications of DUs and CUs by studying the power allocation and mode switching problems. Specifically, there were two parts in the suggested mode change technique. During the initial stage, the cooperative and relay-assisted modes' optimal power allocation problems were formulated and tackled. In the second phase, a mode selection algorithm was implemented to choose between the D2D relay, cooperative D2D, and direct D2D as well as an optimal relay selection method to identify the relay UE for maximizing the channel capacity was also executed. When compared to other benchmark approaches in terms of energy efficiency, success probability, and joint channel capacity, the simulation results of the executed scheme showed the benefits of the suggested approach in every D2D deployment condition were better.

In 2024, Mahdi and Tașpinar [27] have provided a scheme to efficiently allocate the resources using a swarm optimization-based approach in D2D communication. The authors have focused on utilizing the bee's fly pattern (BFP) to maximize the number of resources accessible within the vicinity of the network. Following a collaborative effort by all bees to determine the network's ideal availability of services, a specific set of resources was then allocated to the mobile users. RNs and other available network resources were added by the system if the performance falls below the predetermined threshold value. Thus, a D2D pair communication using the bee fly pattern with relay assistance was generated. Mobile support, energy, as well as latency were all improved in the D2D mobile pair. The validity of these findings was assessed by contrasting the results with the most recent research works.

In 2023, Liu et al. [28] have suggested a coordinated approach for RA and drone relay selection with the aim of maximization of the D2D system's total sum rate while guaranteeing that DUs and CUs meet their essential QoS standards. Initially, a two-phase coalitional game was designed to address the resource allocation issue by using a greedy approach. The drone's relay selection was then addressed by a Multi-Agent RL (MARL) method known as the WoLF policy hill climbing (WoLF-PHC) approach. Additionally, a lightweight neighbor-agent-based WoLF-PHC algorithm that only makes use of nearby DUs' past data was presented to further minimize the computing complexity. The simulation outcomes showed that the suggested method has successfully raised the outage probability and the sum rate of the system effectively.

In 2020, Zhong et al. [29] have investigated a self-organized D2D network assisted by unmanned aerial vehicles (UAV). The capacity of the relay network was enhanced by jointly optimizing the tasks such as assignment of the relays, allocation of the channels, and deployment of the relays. A new fluctuating optimization method was introduced to solve these three issues. At first, the relays were deployed at a constant rate to tackle the issues regarding the optimal assignment of the relays and the optimal allocation of the channels. This was achieved by utilizing a reinforcement learning (RL) approach. Next, an online-based real-time approach was adopted to solve the issues regarding the assignment of the relays and the deployment of the relays with a constant channel that was being allocated. The actual issues were tackled by resolving the above-mentioned issues in an iterative and alternative manner. Enhanced performance as well as capacity offered by the executed model was shown by experimental verifications.

In 2019, Tian et al. [30] have examined the joint RA and relay selection problem in the D2D communication system aided by relays. The main goal behind this work was to facilitate at least the lowest QoS for both the DU as well as the CU while enhancing the rate of transmission of the data throughout the system. The essential RNs required for the D2D link were selected with lower computational complications using a social-aware relay selection approach. The data transmission rate was then maximized using power control methods while utilizing the D2D link in both D2D relay mode as well as direct made. With the aid of the executed greedy selection scheme, the channels were allocated along with the optimal selection of the communication mode for it. Simulation results proved the enhanced efficacy of the implemented algorithm than the other existing approaches.

2.2 Problem statement

Nowadays, D2D communication is becoming very famous because of its high advantages. D2D communication is considered as the innovation of direct transmission among two cellular candidate systems without sending via the base station. These supports enhancing the network capacity, spectrum efficacy, and minimize the latency. Meanwhile, the relays are employed to enlarge the convergence of the network. The issue of relay selection in D2D communication is highly significant. Moreover, with the connection of various wireless systems, the network becomes very dense resulting in the new issue of shortage in spectrum shortage. Numerous mechanisms have been deployed in the previous years that focus on these complexities. Some of the techniques’ features and difficulties are listed in Table 1. Dinkelbach's theory [18] produces higher-quality outcomes. It doesn’t present any additional factors. However, it is complex to solve and contains time complexity. Its convergence properties are not fully addressed. Stable matching theory [19] enhances the overall satisfaction of the network. It provides the best matching group. But, it takes more time to produce the solutions. It has no stability and it is complex to apply in real-world applications. RPRS-EH [20] enhances the sum rate of both D2D relay-aided and cellular links. It has fewer computational burdens. But, it has poor system performance. It takes more attributes to perform the process. Fractional programming theory [21] has high sensitivity and efficiency when solving the issue. It has less utilization in the time and money. Yet, it has limited surface knowledge. It has poor problem-solving skills. A two-phase optimization algorithm [22] finds the optimal global solutions. It is a very simple and easy approach. However, it traps into the local optima. It has poor quality outcomes. Bargaining optimization model [23] strengthens the relationship among the attributes. It improves the coverage and network throughput. But, it has slow convergence rates. It is ineffective and has poor performance. Network coding [24] has enhanced throughput and ensured robustness. It increases the network reliance and raises the security. Yet, it requires additional care during the implementation. It is a very expensive task. A greedy algorithm [25] is very easy and has less time complexity. It is a fast and efficient mechanism. However, it couldn’t produce the optimal solutions all the time. It highly depends on the problem structure. The relay selection algorithm [26] provides more energy efficiency. This method has an enhanced success probability rate. Enhanced channel capability over a long distance is provided by this scheme. However, this algorithm suffers from high latency issues. The computational complications in this approach are more when provided with smaller values. BFP algorithm [27] offers enhanced performance than the state-of-the-art models with respect to workload on the network, latency, and energy consumption. However, the fault tolerance capability of this prototype is not known. As hardware implementation of this prototype is not possible, this model is not applicable to real-time scenarios. MARL and WoLF-PHC [28] offer lower overhead on signaling over a larger-scale IoT-based network. The overall complication in this approach is also further reduced by implementing the lightweight neighboring-agent-based approach. This prototype is ideal in the case of traffic congestion conditions. A suitable number of adjacent users can be selected based on the real-time scenarios. Even though the solution provided is immediate, it is not effective in uncertain scenarios. RL [29] acts as a strong data-driven approach to allocating resources in the D2D communication system. However, this method consumes more time as it runs by trial-and-error approach. The greedy selection algorithm [30] achieves an enhanced data transmission rate between the D2D link and the CU. Simultaneous switching of the communication mode with respect to the sum rate is made possible by this approach. This scheme is highly flexible and can enhance the overall working of the heterogeneous system. Yet, the influence of the social attributes on the performance of the user in the network is not known. Therefore, in this work, a new effective resource allocation and relay selection mechanism has been presented in D2D communication.

Table 1 Features and challenges of traditional resource allocation and relay selection approaches in D2D communications

The contribution of this paper are as follows:

  • To generate an optimization-aided machine learning approach for performing the optimal process of allocating and selecting the resource and relay in D2D communication systems. This optimal process can be useful in some applications like social networking public safety, local data services, home automation and so on.

  • To implement an advanced machine learning approach called the AMLP for optimally allocating the resources and selecting the relay in an optimal manner with the aid system configuration as input to enhance the EE and manage the sum rate while performing D2D communication in 5G networks.

  • To execute an optimization algorithm called the HFDCSA for obtaining the optimized solution for selecting relays in an optimal manner in order to provide it as the targets to the implemented joint RA and relay selection model. This novel algorithm is inspired by the process of two conventional systems as FDA and CSA significantly.

  • To compare the performance of the implemented joint RA and optimal relay selection schemes with other traditional protocols in order to validate its enhanced performance.

3 Research motivation

D2D communication is proposed as the key concept of engaging the peer-to-peer communication network, where the data are transferred. In the case of D2D communication, the resource allocation can be able to assign the resource block to the respective channel, whereas the relay selection has the ability of holding the idle users of D2D pairs. In the relay-oriented model, the major critical factor is how to select the resource, and how to allocate the resource and transmit power to the channel becomes the crucial factor while developing the communication system. Based on this mechanism, the quality might get increased. In some scenarios, the reused resources are also available that is also to be managed in order to account the challenging gaps. Hence, these criteria motivate the model to first focus on the selection of resource acquiring the better communication process. Moreover, the deep learning model emerges with much beneficial things, which are also included in the D2D communication for further enhancement.

4 Joint optimization of resource allocation and relay selection in device-to-device communication: system model and proposed description

4.1 Device-to-device communication system model

The general representation of the D2D [21] system is given in Fig. 1. A double-layered mobile network having a single cellular user (CU) represented as \({C}_{u}\), a single destination represented as \({D}_{d}\), a single RN indicated as \({R}_{l};l=\text{1,2},\dots \dots . L,\) a single BS denoted as \({B}_{s}\), and a single source denoted as \({S}_{d}\) is considered for our work. The function of the BS is to transmit energy to the users in the D2D system on downlink communication and to receive data from CU \({C}_{u}\), on the uplink communication process. Only BS is capable of performing the uplink process and it can receive data only from the CU. Thus, a “frequency division duplex system” is considered. The resource that has been allocated to the CU \({C}_{u}\), by utilizing the uplink network can be reused by the suggested RA-D2D system to a maximum of one number. With the aid of the spectrum sharing underlay operation, the D2D users are allowed to simultaneously make use of the resources in the cellular uplink network. Thus, \({R}_{l}\) and \({D}_{d}\) are associated with \({C}_{u}\). In the process of data transmission, there is an effect on the \({B}_{s}\), due to \({S}_{d}\) and \({R}_{l}\). Here, it is considered that both \({C}_{u}\) and RA-D2D links are provided with the resources from the uplink communication process. However, this process may lead to interferences. This interference is solved by utilizing the SINR received at the BS along with the SINR associated with the RA-D2D communication system.

Fig. 1
figure 1

System model of D2D communication

This system is treated as a “harvest-and-then-transmit” system. The entire time required for the communication process is segmented into “wireless information transmission (WIT) and wireless energy transmission (WET)” parts. The WIT is further divided into two slots: One transmits the data from \({S}_{d}\) to the relay \({R}_{l}\) at the location \(l\) under the influence of an interference signal from \({C}_{u}\), and the other transmits the data in the relay \({R}_{l}\) to \({D}_{d}\) under the presence of interference. The energy is harvested by the BS from the radio frequency (RF) signals in the WET phase. The “amplify-and-forward (AF)” relays are used in this protocol. Here, an assumption is made such that BS will always receive signal obtained from \({C}_{u}\) on the WIT phase. The signal power \({P}_{0}\) is higher than the power of the noise in the WET stage as the D2D devices receive RF signals from the BS. Thus, no energy is harvested from the noise present in the channels. The energy harvested in the WET phase is given by Eq. (1), Eq. (2), and Eq. (3).

$${\text{EH}}_{{S}_{d}}={k}_{0}\lambda {P}_{0}{g}_{{B}_{s},{S}_{d}}$$
(1)
$${\text{EH}}_{{R}_{l}}={k}_{0}\lambda {P}_{0}{g}_{{B}_{s},{R}_{l}}$$
(2)
$${\text{EH}}_{{D}_{d}}={k}_{0}\lambda {P}_{0}{g}_{{B}_{s},{D}_{d}}$$
(3)

In Eq. (1), Eq. (2), and Eq. (3), the term \(\lambda \epsilon (\text{0,1})\) represents the efficiency of energy conversion. The term \({k}_{0}\) denotes the time taken for the WET phase. The power gain is represented by the term \(g\). The SINR \(\vartheta\) of data transfer from \({S}_{d}\) and \({R}_{l}\) in the WIT phase is given by Eq. (4).

$${\vartheta }_{{S}_{d}, {R}_{l}}= \frac{{P}_{{S}_{d}}{g}_{{S}_{d},{R}_{l}}}{{P}_{{C}_{u}}{g}_{{C}_{u},{R}_{l}}+ {N}_{0}}$$
(4)

The term \({N}_{0}\) denotes the noise variance. The SINR \(\vartheta\) of data transfer from \({R}_{l}\) to \({D}_{d}\) in the WIT phase is given by Eq. (5).

$${\vartheta }_{ {R}_{l},{D}_{d} }= \frac{{P}_{{R}_{l}}{g}_{{R}_{l},{D}_{d}}}{{P}_{{C}_{u}}{g}_{{C}_{u},{D}_{d}}+ {N}_{0}}$$
(5)

The jointly attained SINR at \({D}_{d}\) is given in Eq. (6).

$${\vartheta }_{{S}_{d}, {R}_{l},{D}_{d} }=\text{min}\left\{{\vartheta }_{{S}_{d}, {R}_{l}}, {\vartheta }_{ {R}_{l},{D}_{d} }\right\}$$
(6)

The RA-D2D link’s data rate is represented by Eq. (7).

$${\text{DR}}_{{S}_{d}, {R}_{l},{D}_{d} }={k}_{c}{B}_{w}{\text{log}}_{2}(1+{\vartheta }_{{S}_{d}, {R}_{l},{D}_{d} }); c=\text{1,2}$$
(7)

In Eq. (7), the term \({B}_{w}\) represents the bandwidth that is provided to the network. There are two interferences, one on transmitting the data from \({S}_{d} to {R}_{l}\) and the other on transmitting the data from \({R}_{l} to {D}_{d}\). The BS will thus receive an SINR as given by Eq. (8).

$${\vartheta }_{{C}_{u}, {B}_{s}}=\left\{\begin{array}{c}\frac{{P}_{{C}_{u}}{g}_{{C}_{u},{B}_{s}}}{{P}_{{S}_{d}}{g}_{{C}_{u},{S}_{d}}+ {N}_{0}} at {k}_{1} \\ \frac{{P}_{{C}_{u}}{g}_{{C}_{u},{B}_{s}}}{{P}_{{R}_{l}}{g}_{{B}_{s},{R}_{l}}+ {N}_{0}} at {k}_{2}\end{array}\right.$$
(8)

The data rate from \({B}_{s} to {R}_{l}\) be represented by Eq. (9).

$${\text{DR}}_{x}={k}_{c}{B}_{w}{\text{log}}_{2}(1+{\vartheta }_{{C}_{u}, {B}_{s}}); c=\text{1,2}$$
(9)

The total energy consumed in this phase is given by Eq. (10).

$$\text{TEC}= {k}_{1}\frac{{P}_{{S}_{d}}}{\upsilon }+ {k}_{2}\frac{{P}_{{R}_{l}}}{\upsilon }$$
(10)

In Eq. (10), the term \(\upsilon \epsilon (\text{0,1})\) represents the efficiency of the power amplifier. The term \({k}_{1} \text{and} {k}_{2}\) indicates the time taken for the WIT phase.

The time slot diagram for the WIT and WET phases is provided in Fig. 2.

Fig. 2
figure 2

Time slot diagram for WIT and WET phase

4.2 Problems with device-to-device communication system

The problems that exist in conventional D2D communication systems are provided below.

  • As direct connection between the devices takes place in D2D communication, there is a higher threat to the security of the data that is being transmitted in the D2D system.

  • High interference issues are seen in the D2D users and cellular users as a result of D2D communication.

  • The devices in the D2D communication system are difficult to spot or monitor.

  • A higher rate of consumption of energy can be seen in the D2D devices.

  • The QoS in D2D communication can be affected by improper allocation of resources.

  • If the resources are not allocated properly, the EE and spectral efficiencies are affected. This necessitates the need for additional energy harvesting protocols.

  • The selection of modes in the D2D communication system is a difficult task.

  • To establish a direct linkage between the devices in the D2D system, the optimal selection of relays is needed.

4.3 Proposed joint optimization of resource allocation and relay selection model in device-to-device communication

Relay selection in the D2D system is required when there are blockages between the direct linkage of devices, when the nodal distances are higher, or the scenarios in which the communication channels get impaired severely. This helps in attaining an extension of coverage and in providing enhanced content sharing the network. It is essential to consider the following criteria before performing relay selection.

  • Verify if the device acts as a relay or not in the pre-existing system.

  • Verify the capacity of the device to handle multiple cooperative users.

Once the above-mentioned criteria are verified, the optimal selection of the relays in the D2D communication is carried out with the aid of the HFDCSA approach. The optimal selection of the relay assisted in enhancing the EE by reducing the energy consumed by the devices. This optimal selection of the relays will also result in enhancing the data transfer rate between the communicating devices. Once the optimal relays are selected, then the optimal allocation of the resources is done by the same HFDCSA. These are provided as the target for the implemented AMLP model.

The main goal behind the optimization of the relays in this work is the enhancement of EE as well as the enhancement of the sum rate. These two processes are performed with the help of the AMLP network. The performance of the network is also enhanced by tuning the parameters such as step per epoch, hidden neuron count, and count of epochs. This helps in minimizing errors such as “mean squared error (MSE), mean absolute error (MAE), and root mean square error (RMSE)” on the prediction results obtained on the relay selection and resource allocation process by the AMLP. The process of optimal relay selection helps in effective data transfer in a timely manner within the D2D network in the IoT system. The optimal RA helps in provisioning required resources for the most essential user and thus prevents the over-utilization of the resources. Hence, an advanced joint optimization of RA and relay selection in D2D communication is achieved with the aid of the HFDCSA target by utilizing the system configuration data as the input. Then, the AMLP system is used to predict the optimal relay selection and the resource allocation by utilizing the same system configuration data as the input and the optimal relay selection by using the HFDCSA as its target. The variables in the AMLP are optimized by the HFDCSA to enhance the overall prediction performance by minimizing the prediction errors. The performance of the implemented scheme is verified by carrying out extensive simulations. The architecture of the generated joint optimization of RA and relay selection model in D2D communication is shown in Fig. 3.

Fig. 3
figure 3

The architecture of the generated joint optimization of RA and relay selection model in D2D communication

5 Hybrid flow direction with chameleon swarm algorithm for joint optimization of resource allocation and relay selection

5.1 Proposed HFDCSA

Two optimization techniques, namely the CSA and the FDA, are selected for performing the task of optimal relay selection, RA, and the optimization of the parameters in the MLP network such as hidden neuron count, epoch count, and steps per epoch. For optimal joint relay selection and RA, the transmission power and the resources assigned to a particular channel are optimized by the HFDCSA. The optimal selection of the relays is done to make an efficient routing path for data transmission from the source to the destination in the D2D communication. If the relays are not selected in an optimal manner, then the time required for data transmission will be increased. This may lead to cause delays in the overall communication process. Also, when all the relays are involved in the routing process, the data transmission process will get complicated. Thus, the optimal selection of relays must be carried out in order to determine the shortest path of information transfer from the relays. Once the optimal routing is performed, then the gathered resources are allocated in an optimal manner. This optimal allocation of resources helps in preventing the over-utilization or under-utilization of the resources and assists in providing the resources to the most required and resource-scares users. Both of these tasks of optimal relay selection and the joint RA are performed in this work with the aid of the HFDCSA. Apart from this, the variables in the MLP are also optimized using the HFDCSA. The HFDCSA is generated by combining the FDA and CSA. The enhanced convergence speed and the effectiveness in escaping the local optima make the FDA an ideal choice for this optimization task. The FDA is also a good choice for solving low-dimension problems. The CSA technique is chosen for this task because of its enhanced ability of exploitation, increased exploration capability, and effectiveness in avoiding local optimal solutions. This algorithm is also proven to be an efficient solution for low-dimension issues. Since both the FDA and CSA are not able to solve high-dimensional problems, an enhanced optimization scheme is developed by fusing the FDA with the CSA to make an enhanced optimization scheme called the HFDCSA. The HFDCSA is executed by analyzing the iteration count. When the iteration count at present \(n\) is less than half of the maximum iteration count \(\frac{N}{2}\), i.e.,\(\left(n<\frac{N}{2}\right)\), such that \(N\) represents the maximum iteration count, and then the solution is updated using the FDA. Or else, the CSA is utilized to update the solution.

FDA: In the FDA [31], the direction flow of the direct runoff in the water basin is considered the inspiration. At first, the population at the beginning of the FDA is created in the drainage basin (regarded as a lookup area in the FDA). The population initialized is represented in a matrix format known as a population matrix. The population matrix in FDA is expressed as given in Eq. (11).

$$F\left(A\right)=\left[\begin{array}{cccc}{a}_{1}^{1}& {a}_{2}^{1}& \cdots & {a}_{j}^{1}\\ {a}_{1}^{2}& {a}_{2}^{2}& \cdots & {a}_{j}^{2}\\ \vdots & \vdots & \ddots & \vdots \\ {a}_{1}^{o}& {a}_{2}^{o}& \cdots & {a}_{j}^{o}\end{array}\right]$$
(11)

The term \(F\left( A \right)\) in Eq. (11) indicates the location of the flow of the Ath population in the FDA, and \({a}_{j}^{o}\) denotes the location of the Oth individual at the jth decision variable. Once the population is initialized, the flow of the water to the lowest height/hole in the basin (or toward the optimal location) is determined. Some of the hypotheses that are considered in this algorithm are as follows:

  • A height and location are provided for all the flow.

  • A position \(\alpha\) is found near every flow, and it is provided with a fitness value.

  • The slope is proportional to the velocity of the flow of the water.

  • The flow of the water to the least height has a direction and a velocity \(B\).

  • The optimal location is the outlet point in the basin.

Some of the parameters that are initialized in the FDA include the term \(o\), which denotes the total number of individuals in the population, the term \(\alpha\) the count of neighbors, and the radius of the neighbor denoted by \(\chi\). The initial flow’s location is determined with the aid of Eq. (12).

$$F\left[A\left(c\right)\right]=d+e*\left(f-d\right)$$
(12)

In Eq. (12), the term \(d\) represents the lowest boundary of the FDA, \(f\) represents the upper boundary of the FDA, and an arbitrary variable in the range \(\left[ {0,1} \right]\) which has been uniformly distributed is represented as \(e\). The position of the \(\alpha\) number of neighbors is determined using Eq. (13).

$$C\left[A\left(i\right)\right]=F\left[A\left(c\right)\right]+eg*\chi$$
(13)

In Eq. (13), the term \(C\left[ {A\left( i \right)} \right]\) denotes the neighbor at the ith location, and the normally distributed arbitrary variable is indicated by the term \(eg\). The fitness value of the position is determined using Eq. (14).

$$Fm=\left[\begin{array}{c}{m}_{1}\\ {m}_{2}\\ \vdots \\ {m}_{o}\end{array}\right]$$
(14)

A mean value of \(0\) and a standard deviation of \(1\) are considered here. The value of \(\chi\) has a direct effect on determining the feasible solution. If the value of \(\chi\) is more, then the candidate solutions are given more possibility of exploring more regions in the search area. Similarly, the value of \(\chi\) is smaller, making the candidate solution search only a smaller area. However, if the value of \(\chi\) is made higher, then the FDA is dedicated to figuring out only global optima. If the value of \(\chi\) is small, then the chances of the FDA falling for local optima are higher. Hence, a balance has to be obtained between the local and global optimal by adjusting the value of \(\chi\). In order to enhance the diversity, the value of \(\chi\) is adjusted randomly as given in Eq. (15).

$$\chi =\left(e*Ae-e*F\left[A\left(c\right)\right]\right)*\Vert DA-F\left[A\left(c\right)\right]\Vert *G$$
(15)

In Eq. (15), the term \(e\) represents the uniformly distributed arbitrary variable, \(Ae\) indicates the arbitrary position of the Ath population, and \(G\) denotes an arbitrarily generated nonlinear weight in the range \(0\) and \(\infty\). The first term of Eq. (15) represents that the flow takes place from \(F\left[ {A\left( c \right)} \right]\) to \(Ae\). The second term of Eq. (15) expresses that if the iteration increases, then the \(F\left[A\left(c\right)\right]\) will become closer to the best location \(DA\). The Euclidean distance between \(DA\) and \(F\left[ {A\left( c \right)} \right]\) also becomes \(0\). This eliminates the process of local search. The nonlinear weight \(G\) which is randomly distributed is determined using Eq. (16).

$$G = \left( {\left( {1 - \frac{h}{H}} \right)^{{\left( {2*eg} \right)}} } \right)*\left( {\overline{e}*\frac{h}{H}} \right)*\overline{e}$$
(16)

In Eq. (16), the term \(\overline{e}\) denotes a vector with random variables that are uniformly distributed,\(h\) represents the current iteration, and \(H\) indicates the maximum iteration count. The value of \(G\) is proportional to the iteration count. When the iteration reaches its maximum value, the value of \(G\) increases, and the FDA no longer falls for local optima. The flow will move toward the least fit neighbor with a velocity \(B\).

$$B=eg*{E}_{0}$$
(17)

In Eq. (17), the term \({E}_{0}\) represents the slope vector that takes the difference between the location of the present flow and the neighboring flow. The global searching ability is enhanced with the aid of \(eg\). The flow of the \(c{\text{th}}\) location toward the \(i{\text{th}}\) location is given by Eq. (18).

$${E}_{0}\left(c,i,j\right)=\frac{Fm\left(c\right)-Cm\left(i\right)}{\Vert F\left[a\left(c,j\right)\right]-F\left[a\left(i,j\right)\right]\Vert }$$
(18)

In Eq. (18), the term \(Fm\left(c\right)\) represents the fitness of the \(c{\text{th}}\) flow and the term \(Cm\left(i\right)\) indicates the fitness of the \(i{\text{th}}\) flow. The problem’s decision variable is denoted by the term \(j\). The new location of the flow is computed using Eq. (19).

$$F\left[lA\left(c\right)\right]=k\left[A\left(c\right)\right]+B*\frac{F\left[A\left(c\right)\right]-F\left[A\left(i\right)\right]}{\Vert F\left[a\left(c\right)\right]-F\left[a\left(i\right)\right]\Vert }$$
(19)

In Eq. (19), the term \(F\left[lA\left(c\right)\right]\) denotes the updated location of the \(c{\text{th}}\) flow, and \(k\) indicates the flow. To update the location, another flow in random is considered in the FDA. If the fitness of the random flow is better than the updated flow’s fitness value, then the flow’s position is not amended. Else, the position of the flow will be updated. This process is illustrated mathematically in Eq. (20).

$$\left\{\begin{array}{cc}F\left[lA\left(c\right)\right]=F\left[A\left(c\right)\right]+2eg*\left(DA-F\left[A\left(c\right)\right]\right)& \text{if} Fm\left(c\right)\le Fm\left(n\right)\\ F\left[lA\left(c\right)\right]=F\left[A\left(c\right)\right]+eg*\left(F\left[A\left(n\right)\right]-F\left[A\left(c\right)\right]\right)& \text{if} Fm\left(c\right)>Fm\left(n\right)\end{array}\right.$$
(20)

In Eq. (20), the term \(n\) denotes an arbitrary variable. The velocity vector of the flow is given by Eq. (21).

$$B=\left[\begin{array}{cccc}{b}_{1}& {b}_{2}& \cdots & {b}_{j}\end{array}\right]$$
(21)

A recently implemented heuristic strategy that imitates the prey-hunting characteristics of the reptile, chameleon, is called the CSA [32]. The four major steps that are involved in the CSA are as follows [33].

  • Initialization

  • Prey tracking

  • Pursuing the prey with eye movement

  • Attack of prey

Initialization phase As with any other heuristic approach, the CSA relies on the population. Therefore, the population of the CSA is initialized randomly at the beginning of the algorithm. In a lookup area of size \(w\), the chameleon population of size \(P\) is obtained. The entire population serves as a candidate solution for the algorithm. The place in which these population chameleons are present is given by Eq. (22). This matrix representing the place in which the chameleon is present is of size \(P\times w\) in two-dimensional spaces.

$${t}_{v}^{u}=\left[{t}_{v,1}^{u},{t}_{v,2}^{u},...,{t}_{v,w}^{u}\right]$$
(22)

The total number of repetitions that are considered in the CSA is given by \(v\) in Eq. (22), the total count of chameleons in the algorithm is represented as \(=\text{1,2},...,P\), and the place in which the \(u{\text{th}}\) chameleon is present at the dimension \(w\) is denoted as\({t}_{v,w}^{u}\). Once the population of the chameleon is initiated based on the decision variable, then the total count of chameleons that are available within the lookup area is determined using Eq. (23).

$${t}^{u}={x}_{J}+y\times \left({z}_{J}-{x}_{J}\right)$$
(23)

The primary vector of the \(u{\text{th}}\) chameleon is indicated as \({t}^{u}\) in Eq. (23), the highest boundary of the lookup area is denoted as \({z}_{J}\), the least boundary set to the lookup area is denoted by \({x}_{J}\), and an arbitrary term having a value \(\left[\text{0,1}\right]\) is indicated as \(y\).

Prey tracking phase The behavior adopted by the chameleon in search of the prey is mathematically formulated as given in Eq. (24).

$${t}_{v+1}^{u,J}=\left\{\begin{array}{cc}{t}_{v}^{u,J}+\varepsilon \left({z}^{J}-{x}^{J}\right){y}_{1}+R\left(S-\frac{3}{6}\right)& {L}_{M}>{y}_{u}\\ {t}_{v}^{u,J}+{M}_{1}\left({L}_{v}^{u,J}-{K}_{v}^{u,J}\right){y}_{2}+{M}_{2}\left({L}_{v}^{u,J}-{t}_{v}^{u,J}\right){y}_{3}& {L}_{M}\le {y}_{u}\end{array}\right.$$
(24)

The upcoming count of the current repetition is represented as \(v+1\) in Eq. (24), the upcoming place in which the chameleon is present is referred to by the term \({t}_{v+1}^{u,J}\), the variable that degrades the count of the repetitions is denoted by \(\varepsilon\), and the highest and lowest boundary of the lookup area at the \(J{\text{th}}\) dimension is indicated as \(z^{J}\) and \(x^{J}\), respectively. The arbitrary variables that lie in the limit \(\left( {0,1} \right)\) are represented by the terms \(y_{1}\), \(y_{2}\), and \(y_{3}\). The significance function is represented by the term \(R\). A random term in the limit \(\left( {0,1} \right)\) is denoted by \(S\). The likelihood in which the chameleon pursues the prey is represented by \(L_{M}\). A uniformly distributed random variable in the range \(\left( {0,1} \right)\) is mentioned by the term \(y_{u}\). The terms that have the ability to alter the exploring ability of the CSA are referred to by the terms \(M_{1}\) and \(M_{2}\). These terms \(M_{1}\) and \(M_{2}\) have a positive value. The feasible solution is represented as \(L_{v}^{u,J}\). The globally ideal solution is indicated by the term \(K_{v}^{u,J}\). The CSA operation is controlled by the term \(R\left( {S - \frac{3}{6}} \right)\), which has a value within the range \(- 1\) and \(1\). The place at which the chameleon is present currently is represented by \(t_{v}^{u,J}\). The value of \(L_{M}\) has a value \(0.1\). The value \(\varepsilon\) is determined using Eq. (25).

$$\varepsilon =\varphi {\text{exp}\left(\frac{-\phi v}{V}\right)}^{\gamma }$$
(25)

The maximum limit provided for the number of repetitions in the CSA is denoted by the term \(V\). The symbols \(\varphi\), \(\phi\), and \(\gamma\) represent three constant terms having the values equal to \(1\), \(3.5\), and \(3\), respectively. The values of \(M_{1}\) and \(M_{2}\) are taken as \(0.25\) and \(\frac{3}{6}\), respectively. The solution that is near the feasible solution is given by the term \({K}_{v}^{J}\). When \(0.1>{L}_{M}\), the hunting of the prey gets executed. If \(0.1\le {L}_{M}\), then the chameleon changes its place by observing the prey.

Pursuing prey with eye movement The chameleon will determine the position at which its prey is located using its eye movement. A chameleon’s eye has the feature of rotating up to 360 degrees. This helps them in spotting the prey within this range of 360 degrees. This process is followed by the following steps:

The center of gravity represents the place in which the chameleon is present at the beginning of the algorithm.

Then the prey’s location is identified with the aid of the rotation matrix.

While considering the center of gravity, the place in which the chameleon is present will be upgraded using a rotation matrix.

Then the chameleon will return to its initial place.

The chameleon will update its place by utilizing the eye movement as given by Eq. (26).

$$t_{v + 1}^{u,J} = ty_{v}^{u} + \overline{t}_{v}^{u}$$
(26)

The new place in which the chameleon is present at this moment is given by the term \(t_{v + 1}^{u,J}\) in Eq. (26), the chameleon’s rotating center coordinates are given by the term \(ty_{v}^{u}\), and the center point of the present location of the chameleon is given by the term \(\overline{t}_{v}^{u}\). The chameleon’s rotating center coordinates are computed using Eq. (27).

$$t{y}_{v}^{u}=T\times t{O}_{v}^{u}$$
(27)

The rotation of the chameleon is denoted by using the rotation matrix as expressed by the term \(T\), and the center coordinates of the iteration are indicated as \(tO_{v}^{u}\). These two parameters are determined using Eq. (28) and Eq. (29).

$$T=U\left(\eta ,\overrightarrow{W}{X}_{1}{\overrightarrow{X}}_{2}\right)$$
(28)
$$tO_{v}^{u} = t_{v}^{u} - \overline{t}_{v}^{u}$$
(29)

The chameleon’s rotation angle is denoted by \(\eta\) in Eq. (28), the orthonormal vectors in dimension \(P\) within the lookup area are indicated by the terms \(\vec{X}_{1}\) and \(\vec{X}_{2}\) in Eq. (28), and the rotation matrix is represented by the term \(U\) in Eq. (28). The term \(\vec{W}\) represents a vector. The value of the rotation angle \(\eta\) is determined using Eq. (30).

$$\eta =R\left(S-\frac{3}{6}\right)\times 180$$
(30)

The value of the rotational angle \(\eta\) is given in the range \(0\) and \(180\).

Attack of prey As the chameleon reaches closer proximity to the prey, it will begin to attack its prey with its tongue. The chameleon in this closer proximity range is regarded as the best solution for the CSA. As the length of the tongue is longer, it is easier to capture the prey with it. The chameleon’s tongue gets out at a velocity \({Y}_{v+1}^{u,J}\) determined as given in Eq. (31).

$${Y}_{v+1}^{u,J}=\iota {Y}_{v}^{u,J}+{O}_{1}\left({K}_{v}^{J}-{t}_{v}^{u,J}\right){y}_{1}+{O}_{2}\left({L}_{v}^{u,J}-{t}_{v}^{u,J}\right){y}_{2}$$
(31)

The velocity in which the chameleon extends its tongue is represented by the term \(Y_{v + 1}^{u,J}\) in Eq. (31), the velocity of the chameleon’s tongue at the current scenario is given by the term \(Y_{v}^{u,J}\), the terms \(O_{1}\) and \(O_{2}\) are two parameters that have a positive value which influences the feasible solution \({L}_{v}^{u,J}\) and the global ideal solution \(K_{v}^{J}\), and the inertial weight that happens as the result of the chameleon extending its tongue is denoted by \(\iota\). The inertial weight of the chameleon’s tongue \(\iota\) is computed using Eq. (32).

$$\iota ={\left(1-\frac{v}{V}\right)}^{\left(\kappa \sqrt{\left(\frac{v}{V}\right)}\right)}$$
(32)

The variable \(\kappa\) in Eq. (32) indicates a parameter having a value \(1\), that controls the exploitation phase of the CSA. The convergence of CSA is enhanced using the inertial weight \(\iota\). When the chameleon extends, its relative position will also change, which is given in Eq. (33).

$${t}_{v+1}^{u,J}={y}_{v}^{u}+\frac{\left({\left({Y}_{v}^{u,J}\right)}^{2}-{\left({Y}_{v-1}^{u,J}\right)}^{2}\right)}{2N}$$
(33)

The velocity at the prior iteration is denoted by the term \(Y_{v - 1}^{u,J}\) in Eq. (34), and the chameleon’s tongue’s acceleration is denoted by \(N\), which is computed using Eq. (34).

$$N=2590\times \left(1-\text{exp}\left(-\text{log}\left(v\right)\right)\right)$$
(34)

The pseudocode of the executed HFDCSA is provided in Algorithm 3.

Algorithm 3
figure a

Implemented HFDCSA

The flowchart of the HFDCSA is depicted in Fig. 4.

Fig. 4
figure 4

Flowchart of the executed HFDCSA

5.2 Joint optimization on resource allocation and relay selection with HFDCSA

The parameters like the transmission power and the resources assigned to a channel such as the relay capability as well as the spectrum resources are optimally tuned by means of the HFDCSA. These factors are optimized in order to select the optimal number of relays for data transmission in the D2D system. The optimization of the transmission power aids in enhancing the lifetime of the network and helps in maintaining the connectivity of the devices in the network. This also helps in reducing energy consumption, thus enhancing the EE of the network. Also, in order to enhance the spectral efficiency without compromising the QoS, the resources in the D2D system have to be selected optimally. The enhancement in the spectral efficiency will help reduce the SNR and enhance the channel’s capacity to transmit more data. The optimal selection of RNs by the implemented HFDCSA model is provided in Fig. 5.

Fig. 5
figure 5

Optimal relay selection using the implemented HFDCSA

Thus, these two parameters are optimized in order to perform optimal joint relay selection and RA with the aim of enhancing the EE and sum rate. This objective is given by Eq. (35).

$$ob1= \underset{\left\{{\text{TP}}_{\text{tp}}^{\text{FCA}},{\text{OR}}_{\text{or}}^{\text{FCA}}\right\}}{\text{arg min}}\left(\frac{1}{\text{SR}+\text{EE}}\right)$$
(35)

In Eq. (35), the term \(ob1\) denotes the objective function, SR indicates the sum rate, EE represents the EE, \({\text{TP}}_{\text{tp}}^{\text{FCA}}\) denotes the optimized transmitted power, which is selected in the range \(\left[ {2,128} \right]\), and \({\text{OR}}_{\text{or}}^{\text{FCA}}\) indicates the optimally selected resources, which are chosen between the limit \(\left[ {1,5} \right]\). The optimal selection of relays is done to enhance the EE while the optimal allocation of resources is done to maximize the sum rate. The optimal number of relays is selected by utilizing the HFDCSA to find the largest value of \({B}_{w}\) in the D2D link. The term \({B}_{w}\) indicates the bandwidth that is allocated to the network.

Sum rate The total of data that can be achieved on the stream is called the sum rate.

Energy Efficiency EE is defined as the amount of data in bits transmitted via a network within a single unit of power consumption in Joules. The EE is denoted in terms of bits/ Joules.

The solution encoding of the implemented joint optimization on RA and relay selection scheme with HFDCSA is given in Fig. 6.

Fig. 6
figure 6

Solution encoding of the implemented joint optimization on RA and relay selection scheme with HFDCSA

5.3 Description of energy efficiency maximization

The ratio between the energy consumed by the D2D system and the data rate in the RA-D2D link is given by the term EE in this work. EE is expressed as given in Eq. (36).

$$\text{EE}=\frac{{\vartheta }_{{S}_{d}, {R}_{l},{D}_{d} }}{{E}_{\text{c}}}$$
(36)

In Eq. (36), the term \({\vartheta }_{{S}_{d}, {R}_{l},{D}_{d}}\) indicates the data rate, \({E}_{\text{c}}\) indicates the consumed energy, \({D}_{d}\) represents the D2D destination, \({S}_{d}\) indicates the D2D source, and \({R}_{l}\) denotes the D2D relay. The major aim of the optimal relay selection process is to maximize EE in the D2D communication system by considering data rate, SINR received at\({R}_{l}\), power control\(P\), and time distribution \(k\). This objective is given by Eq. (37).

$$ob2=\underset{\left\{k,{P}_{{S}_{d}}, {P}_{{R}_{l}}\right\}}{\text{arg min}}\left(\frac{1}{\text{EE}}\right)= \frac{{k}_{1}{P}_{{S}_{d}}+ {k}_{2}{P}_{{R}_{l}}}{{\vartheta }_{{S}_{d},{R}_{l},{D}_{d}}}$$
(37)

S.t.\({C}_{1} :0<{k}_{1}{P}_{{S}_{d}}\le H{P}_{{S}_{d}}, and 0<{k}_{2}{P}_{{R}_{l}}\le H{P}_{{R}_{l}}\).

The term \({C}_{1}\) represents the consumed energy by the D2D system in its WIT phase. The value of \({C}_{1}\) should not become more than the energy that has been harvested in the WET phase of the D2D system.

The factors that are required to satisfy the minimum SINR are represented by \({C}_{2}\) and\({C}_{3}\). These parameters are within the range given as \({C}_{2}:\left({\vartheta }_{{S}_{d}{R}_{l}}\ge {\vartheta }_{{R}_{l}}^{\text{min}}\right)\) and\({C}_{3} :\left({\vartheta }_{{R}_{l}{D}_{d}}\ge {\vartheta }_{{D}_{d}}^{\text{min}}\right)\).

The limit given to the data rate that has to be attained by the BS in the D2D communication system is indicated by the term\({C}_{4}\). The value of \({C}_{4}\) is within the limit.\({C}_{4} :\left[{B}_{w}{\text{log}}_{2}\left(1+{\vartheta }_{{C}_{u},{B}_{s}}\right)\ge {\text{DR}}_{{C}_{u},{B}_{s}}^{\text{min}}\right]\).

The limit set for the transmission of data is denoted by \({C}_{5}\). The value of \({C}_{5}\) is within the range \({C}_{5}:{k}_{2}+{k}_{0}+{k}_{1}\le 1\).

The nonnegative limit set to the power and the allocated time is denoted by \({C}_{6}\). The value of \({C}_{6}\) is within the \({C}_{6}:\) \({k}_{2},{k}_{0},{k}_{1},{P}_{{S}_{d}},{P}_{{R}_{l}}>0\).

The object function \(ob2\) is neither concave nor convex. Thus, the fractional programming is used to convert it to standard form. This objective of attaining maximum EE is achieved by optimizing the transmission power \({\text{TP}}_{\text{tp}}^{\text{FCA}}\) in the D2D network by utilizing the HFDCSA in order to optimally select the number of relays in the D2D network.

5.4 Description of sum rate maximization

The sum rate is represented as \(\text{SR}\left(W,X\right)\), in which the term \(W\) indicates the matrix representation of \({h}_{e,f}\) and \(X\) represents the matrix representation of \({j}_{e,f}\). The computation of the sum rate is given in Eq. (38).

$$\text{SR}\left(W,X\right)={\sum }_{e\in U}{\sum }_{f\in R}{h}_{e,f}{\text{SR}}_{f}\left({h}_{e,f},{j}_{e,f}\right)$$
(38)

The D2D device pairs are represented by the term \({R}_{e}\). This D2D pair \({R}_{e}\) shares the resource same as that of the \(e\). The value of \({R}_{e}\) is thus given by \({R}_{e}=\left\{f\left|{h}_{e,f}=1,\forall f\in R\right.\right\}\). The sum rate in a D2D communication system is always aimed to keep at a maximum value. This objective is mathematically represented as provided in Eq. (39).

$$ob1= \underset{\left\{{h}_{e,f},{j}_{e,f}\right\}}{\text{arg min}}\left(\frac{1}{\text{SR}(W+X)}\right)$$
(39)

To obtain the above objective function, the following constraints are applied.

In order to make the D2D pair engage with a single CU in the resource block, the constraint applied is \({h}_{e,f},{j}_{e,f}\in \left\{\text{0,1}\right\},\forall e\in U;f\in R\).

The CU is allocated to a maximum of a single D2D pair with the utilization of the constraints \({\sum }_{e\in U}{h}_{e,f}\le 1,\forall f\in R\) and \({\sum }_{f{R}_{e}}{j}_{e,f}\le 1,\forall e\in U\) such that \({j}_{e,f}=0,\forall f\notin {R}_{e};e\in U\).

The rate required by every D2D pair is represented by means of the constraint \({\text{SR}}_{f} \left( {h_{e,f} ,j_{e,f} } \right) \ge S\overline{R}_{f}\).

Throughout this optimization problem, no concave characteristics are shown for the terms \({h}_{e,f}\) or \({j}_{e,f}\). Thus, the above problem is regarded as a nonlinear, non-convex, and binary integer problem with \(2UR\) variables. This variable is minimized to a “0–1 Knapsack issue or NP-hard problem”. This objective of attaining a maximum sum rate is achieved by optimizing the transmission power \({\text{TP}}_{\text{tp}}^{\text{FCA}}\) and resource assigned \({\text{OR}}_{\text{or}}^{\text{FCA}}\) in the D2D network by utilizing the HFDCSA in order to optimally select the number of relays along with performing joint RA in the D2D network.

6 Automatic prediction on resource allocation and relay selection using adaptive multi-layer perceptron using optimal solution

6.1 Multi-layer perceptron

A type of “artificial neural network (ANN)” with a three-layered structure is called MLP [34]. Let us consider a training dataset \({x}_{p}\) having patterns \(\left({z}_{Z},{y}_{Z}\right)\) with a count of patterns \(Z\) considered for training the MLP. The pattern’s input at the \(x\) dimension is represented as \({z}_{Z}\), and the pattern’s output at the \(w\) dimension is denoted as \({y}_{Z}\). The thresholding in the layers is taken as one for easy computation. The augmented vector component is referred to as \({z}_{Z}\left(x+1\right)\). The hidden unit at the location \(v\) is given with an input as given in Eq. (40).

$${q}_{Z}\left(v\right)={\sum }_{u=1}^{x+1}{t}_{o}\left(v,u\right)\cdot {z}_{Z}\left(u\right)$$
(40)

In Eq. (40), the input is represented as \({q}_{Z}\left(v\right)\), and the weight that links the input \(u\) with the hidden unit \(v\) is represented as\({t}_{o}\left(v,u\right)\). The output for the training pattern is given by Eq. (41).

$${s}_{Z}\left(v\right)=r\left({q}_{Z}\left(v\right)\right)$$
(41)

In Eq. (41), the term \({s}_{Z}\left(v\right)\) denotes the output. The nonlinear activation function used in the hidden layer \(r\left({q}_{Z}\left(v\right)\right)\) is given by Eq. (42).

$$r\left({q}_{Z}\left(v\right)\right)=\frac{1}{1+{e}^{-{q}_{Z}\left(v\right)}}$$
(42)

A conventional MLP architecture is provided in Fig. 7.

Fig. 7
figure 7

Basic structure of MLP

6.2 HFDCSA-based optimized solutions for joint prediction model of optimal relay selection and resource allocation

The factors such as the “network size, number of D2D relays, mobility static, D2D source coordinates, the distance between D2D users, cellular user coordinates, cellular user base station coordinates, bandwidth, D2D destination coordinates, minimum decodable SINR at the D2D relay, minimum data rate requirement of the cellular user, minimum decodable SINR at the D2D destination, power amplifier efficiency, noise spectral density, the transmission power of the BS, the power conversion efficiency, transmission power of the cellular user, and path gain for each link” are the basic system configurations that are taken as input for the optimal joint relay selection and RA process. These factors regarding the network configuration are denoted as \(SC_{sc}^{ip}\). These network parameters \(SC_{sc}^{ip}\) are provided as input to the implemented AMLP-based prediction model.

6.3 Developed AMLP for optimal prediction on resource allocation and relay selection

The prediction of an optimal number of relays and the resource allocation are done using the AMLP model. Conventional MLP models are prone to overfitting issues, and the prediction outcomes made by these models are not judgmental. In order to find the values that will lead to the best prediction outcomes, the parameters in the MLP are tuned with the aid of HFDCSA. This helps in generating accurate and near-closer prediction outcomes. Instead of running the HFDCSA multiple times to obtain the optimal relay and optimal resource for distinct scenarios, the AMLP system is adapted to predict the optimal relay and optimal resource in a faster manner by utilizing the optimal output obtained from the HFDCSA. These network parameters \({\text{SC}}_{\text{sc}}^{\text{ip}}\) are provided as input to the implemented AMLP-based prediction model. The optimal output, which includes the optimally selected relay and optimally selected resources by the HFDCSA is represented by the term \({\text{OO}}_{\text{oo}}^{\text{FCA}}\). This value is taken as the target for training the AMLP model. The AMLP will generate a prediction output \({\text{OP}}_{\text{op}}^{\text{MLP}}\) much closer to that of the \(\text{OO}_\text{oo}^\text{FCA}\). The final prediction output obtained from the AMLP is represented as \(\text{OO}_\text{oo}^\text{FCA}\) which has the optimal number of relays and optimally assigned resources. The diagrammatic representation of the executed AMLP for optimal prediction on RA and relay selection is depicted in Fig. 8.

Fig. 8
figure 8

Structural view of the executed AMLP for optimal prediction on resource allocation and relay selection

6.4 Objective model of AMLP-based optimal resource allocation and relay prediction

As mentioned earlier, to make the prediction outcome more accurate and error free, the parameters in the AMLP are tuned using the HFDCSA model. The objective of parameter tuning for minimizing the MSE, MAE, and RMSE of the predicted outcome is given by Eq.

$$ob4 = \mathop {\arg \min }\limits_{{\left\{ {{\text{HN}}_{{{\text{hn}}}}^{{{\text{MLP}}}} ,{\text{EP}}_{{{\text{ep}}}}^{{{\text{MLP}}}} {\text{SP}}_{{{\text{sp}}}}^{{{\text{MLP}}}} } \right\}}} \left( {kq + lv + fg} \right)$$
(43)

In Eq. (43), the term \(ob4\) denotes the objective function, \(kq\) represents the MAE value, \(lv\) represents the RMSE value, \(fg\) indicates the MSE value, \({\text{HN}}_{\text{hn}}^{\text{MLP}}\) indicates the optimized hidden neurons of the MLP in the range \(\left[ {5,255} \right]\), \({\text{EP}}_{\text{ep}}^{\text{MLP}}\) denotes the optimized epochs in the MLP with the range \(\left[ {5,50} \right]\), and \({\text{SP}}_{\text{sp}}^{\text{MLP}}\) denotes the tuned steps per epochs in the MLP which is in the limit \(\left[ {500,1000} \right]\). The MAE \(kq\) is computed using Eq. (44).

$$kq=\frac{{\sum }_{a=1}^{b}\left|{\text{OP}}_{\text{op}}^{\text{MLP}}-{\text{OO}}_{\text{oo}}^{\text{FCA}}\right|}{b}$$
(44)

In Eq. (44), the term \(\text{OP}_\text{op}^\text{MLP}\) denotes the predicted output from the MLP, \({\text{OO}}_{\text{oo}}^{\text{FCA}}\) indicates the optimal values obtained from the HFDCSA, \(b\) implements the fitted points, and \(a\) represents the computational values that have to be incorporated with \(b\). The RMSE \(lv\) is determined using Eq. (45).

$$lv=\sqrt{\frac{{\sum }_{a=1}^{b}{\left({\text{OO}}_{\text{oo}}^{\text{FCA}}-{\text{OP}}_{\text{op}}^{\text{MLP}}\right)}^{2}}{b}}$$
(45)

7 Results and discussion

7.1 Experimental setup

The designed joint optimal RA and relay selection scheme for the D2D communication system was executed in MATLAB 2020a with a chromosome length of 3 and \(\left[ {1 + 5} \right]\), a maximum iteration count of 250, and an iteration count of 10. The performance of the generated scheme was contrasted against several conventional joint relay selection and RA schemes such as “sand cat swarm optimization (SCO) [35], moth-flame optimization algorithm (MFOA) [36], FDA [31], and CSA [32], state-of-the-art methods like Dinkelbach theory [18], stable matching theory [19], EHA-CRD [21], and OS-RNNC [25], and with conventional prediction techniques like neural network (NN) [37], support vector machine (SVM) [38], MLP [34], and K-nearest neighbor (KNN) [39]”.

7.2 D2D pairs-based performance evaluation on the executed optimal joint relay selection and RA scheme

The performance evaluation on the executed optimal joint relay selection and RA scheme is depicted in Figs. 9 and 10. Figure 9 shows the comparison of the executed optimal joint relay selection and RA scheme with existing heuristic algorithms when relays are present and in the absence of the relay. Figure 10 shows the comparison of the executed optimal joint relay selection and RA scheme with existing state-of-the-art models with and without relays. The evaluation is carried out by varying the number of nodes. The comparison is done against several conventional algorithms like SCO, MFOA, FDA, and CSA and state-of-the-art optimal joint relay selection and RA scheme Dinkelbach theory, stable matching theory, EHA-CRD, and OS-RNNC. The numbers of D2D pairs are varied from 5 to 20 such as 5, 10, 15, and 20. The performance of the implemented HFDCSA-based optimal joint relay selection and RA scheme when analyzed with relays is provided as follows. The accuracy of the implemented HFDCSA-based optimal joint relay selection and RA scheme is 3.38%, 6.25%, 8.51%, and 18.15% higher than the MFOA, CSA, FDA, and SCO schemes, respectively when considering 11 number of D2D pairs. The average sum rate in the generated HFDCSA-based optimal joint relay selection and RA scheme is 9.29%, 14.18%, 27.5%, and 57.73% enhanced than the FDA, MFOA, CSA, and SCO schemes, respectively when 10 counts of D2D pair are considered. The CDF required by the recommended HFDCSA-based optimal joint relay selection and RA scheme is enhanced by 18.18%, 25.81%, 30%, and 52.94% than the SCO, FDA, CSA, and MFOA schemes, respectively, when D2D pair count is taken as 8. The EE of the suggested HFDCSA-based optimal joint relay selection and RA scheme is improved by 8.89%, 26.67%, 42.22%, and 68.89% than the FDA, MFOA, CSA, and SCO schemes, respectively when the number of D2D pairs is taken as 17. The success rate of the executed HFDCSA-based optimal joint relay selection and RA scheme is 1.83%, 2.45%, 6.37%, and 12.84% more than the FDA, SCO, MFOA, and CSA schemes, respectively when the number of D2D pairs is taken as 20. When no relays are utilized, the accuracy of the implemented HFDCSA-based optimal joint relay selection and RA scheme is 62, which is 35.48% lesser than the accuracy obtained by the implemented HFDCSA-based optimal joint relay selection and RA scheme with relays when 20 number of D2D pairs are considered. While observing the graph it is seen that the performance while utilizing the relays is much better than the performance offered by the implemented HFDCSA-based optimal joint relay selection and RA scheme without the utilization of the relay. Enhanced performance is offered by the executed HFDCSA-based optimal joint relay selection and RA scheme when compared with other recent optimal joint relay selection and RA schemes as well. Thus, it is verified from experimentation that the executed HFDCSA-based optimal joint relay selection and RA scheme can assist in efficient D2D communication in IoT devices.

Fig. 9
figure 9figure 9

D2D-pair-based performance evaluation on the executed optimal joint relay selection and RA scheme against conventional algorithms in terms of “a accuracy, b average sum rate, c CDF, and d EE, e success rate, f sum capacity, g sum rate, h survival probability, and ithroughput

Fig. 10
figure 10figure 10

D2D-pair-based performance evaluation on the executed optimal joint relay selection and RA scheme against existing approaches in terms of “a accuracy, b average sum rate, c CDF, and d EE, e success rate, f sum capacity, g sum rate, h survival probability, and (i) throughput

7.3 Transmission power-based examination on implemented optimal joint relay selection and RA scheme

Examining working of the implemented optimal joint relay selection and RA scheme is illustrated in Figs. 11 and 12. This test is conducted by varying the maximum amount of the transmitted power. The comparison of the executed optimal joint relay selection and RA scheme with and without relay over existing heuristic algorithms is provided in Fig. 11. The comparison of the executed optimal joint relay selection and RA scheme with and without relay over state-of-the-art methods is provided in Fig. 12. Better performance is provided by the executed optimal joint relay selection and RA scheme with relays than without relays. When relays are considered, the evaluation results obtained are as follows. The sum capacity of deployed HFDCSA-based optimal joint relay selection and RA scheme is 18.92%, 76%, 4.76%, and 18.92% enhanced than OS-RNNC, EHA-CRD, stable matching theory, and Dinkelbach theory, accordingly when the maximum transmitted power is taken to be 27 dBm. The sum rate of the employed HFDCSA-based optimal joint relay selection and RA scheme is 42%, 36.54%, 31.48%, and 61.36% better than OS-RNNC, EHA-CRD, stable matching theory, and Dinkelbach theory, accordingly when the maximum transmitted power is taken to be 25 dBm. The survival probability of the nodes in the designed HFDCSA-based optimal joint relay selection and RA scheme is improved by 10.84%, 12.2%, 41.54%, and 26.03% than the recent techniques like OS-RNNC, EHA-CRD, stable matching theory, and Dinkelbach theory, accordingly when the maximum transmitted power is taken to be 30 dBm. The suggested HFDCSA-based optimal joint relay selection and RA scheme has a higher value of throughput of 31.25%, 3.7%, 15.07%, and 5% than the OS-RNNC, EHA-CRD, stable matching theory, and Dinkelbach theory, accordingly when the maximum transmitted power is taken to be 29 dBm. When no relays are utilized, the sum rate of the executed HFDCSA-based optimal joint relay selection and RA scheme is 6.9, which is 27.54% lesser than the sum rate obtained by the executed HFDCSA-based optimal joint relay selection and RA scheme with relays at a maximum transmission power of 30dBm. While observing the graph it is seen that the performance while utilizing the relays is much better than the performance offered by the executed HFDCSA-based optimal joint relay selection and RA scheme without the utilization of the relay. Similarly, enhanced performance is provided by the executed HFDCSA-based optimal joint relay selection and RA scheme when compared with existing algorithms as well, which is shown in Fig. 10. While analyzing the entire results, it is observed that the D2D communication offered by the implemented HFDCSA-based optimal joint relay selection and RA scheme is much better than other existing models.

Fig. 11
figure 11figure 11

Transmission power-based examination on working of the implemented optimal joint relay selection and RA scheme based on the maximum power when compared against existing algorithms with respect to “a accuracy, b average sum rate, c CDF, and d EE, e success rate, f sum capacity, g sum rate, h survival probability, and (i) throughput”

Fig. 12
figure 12figure 12

Transmission power-based examination on working of the implemented optimal joint relay selection and RA scheme based on the maximum power when compared against state-of-the-art models with respect to “a accuracy, b average sum rate, c CDF, and d EE, e success rate, f sum capacity, g sum rate, h survival probability, and i throughput”

7.4 Convergence assessment of the generated optimal joint relay selection and RA scheme

The convergence assessment on the generated optimal joint relay selection and RA scheme is provided in Fig. 13. The convergence of the suggested HFDCSA is analyzed by varying the iteration count from 0 to 250. Here, the analysis is carried out with the inclusion of relays. The convergence assessment is carried out by varying the node numbers as 50, 100, 150, 200, and 250. The convergence becomes better as the iteration count increases. Except for node count 150, the convergence offered by the HFDCSA is better than other existing heuristic approaches. When the node count is taken as 200 and 250, it is observed that the CSA and the SCO algorithms show a closer convergence rate to that of the suggested HFDCSA scheme. However, the best performance on convergence is provided as the iteration reaches 250. The convergence of the generated HFDCSA-based optimal joint relay selection and RA scheme is 0.2%, 0.3%, 1%, and 2.88% better than that of the CSA, SCO, MFOA, and FDA, correspondingly when the node number is taken as 50 and the iteration count is taken as 150. This enriched convergence shows that the performance provided by the generated HFDCSA-based optimal joint relay selection and RA scheme is much better than traditional approaches.

Fig. 13
figure 13

Convergence assessment on the generated optimal joint relay selection and RA scheme with relays regarding “a Node 50, b Node 100, c Node 150, d Node 200, and e Node 250

7.5 Statistical report of the suggested optimal joint relay selection and RA scheme

The statistical report of the suggested optimal joint relay selection and RA scheme is listed in Table 2. The statistical analysis is carried out by considering the relays in the network. As per the statistical report, it is seen that the mean value of the suggested HFDCSA-based optimal joint relay selection and RA scheme is 0.39%, 0.78%, 1.94%, and 0.2% higher than the SCO, MFOA, FDA, and CSA, accordingly when the number of D2D pairs is taken as 5. This improved performance on the statistical analysis showed that the performance offered by the suggested HFDCSA-based optimal joint relay selection and RA scheme is more than conventional approaches.

Table 2 Statistical report of the suggested optimal joint relay selection and RA scheme

7.6 Performance analysis of the deployed prediction model

The performance analysis of the deployed optimal joint relay selection and RA prediction model is given in Fig. 14. Figure 14 shows the comparison of the executed optimal joint relay selection and RA prediction model with heuristic algorithms and existing State-of-the-Art models. The error measures are used to validate the performance of the deployed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model. The MAE of the deployed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is 3.49%, 37.59%, 42.36%, and 47.47% better than the SCO-AMLP, MFOA-AMLP, FDA-AMLP, and CSA-AMLP models, respectively, when the activation function is taken as tanh. The reduced error values prove that the prediction outcome obtained from the deployed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is much more accurate than conventional approaches. This confirms that the output obtained by the deployed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is much closer to the output obtained from the optimization scheme. Thus, better prediction to make efficient D2D communication is obtained by means of deployed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model than the other techniques.

Fig. 14
figure 14

Performance analysis of the deployed prediction model when compared against optimization algorithms and state-of-the-art models in terms of “a MAE, b MSE, and c RMSE

7.7 Performance analysis of the proposed D2D communication model

Figure 15 shows the performance evaluation of the communication system with respect to three major requirements. It has been evaluated by varying the number of D2D pairs. Since the resource prediction is done by adaptive deep learning, the parameter tuning is accomplished by heuristic approach. Hence for system efficacy, the conventional algorithms are taken for comparision. Similarly, various deep learning models are also considered for comparision. Based on the attainment of graphical results, the developed HFDCSA requires maximum data rate, QoS and SINR with respect to any D2D pairs of communication system.

Fig. 15
figure 15

Performance analysis of the proposed D2D communication model when compared against optimization algorithms and state-of-the-art models in terms of “a data rate, b QoS, and c SINR”

7.8 Validation of working of the designed prediction protocol

The validation of working of the designed optimal joint relay selection and RA prediction model is given in Table 3 and Table 4 when contrasted against conventional algorithm and traditional prediction models, respectively. The RMSE of the designed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is 29.52%, 5.32%, 17.75%, and 26.97% enhanced than the NN, SVM, KNN, and MLP models, respectively. For all the error metrics that have been utilized, the performance provided by the designed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is much better than the conventional algorithms as well as traditional prediction models. Hence, it is confirmed that the designed HFDCSA-AMLP-based optimal joint relay selection and RA prediction model is better than other existing prediction models.

Table 3 Validation of working of the designed prediction protocol when compared against conventional algorithms
Table 4 Validation of working of the designed prediction protocol when compared against conventional prediction models

7.9 Time complexity analysis

This section explains the time complexity analysis of the proposed model compared with other existing algorithms by varying the nodes. Based on the results given, the proposed HFDCSA achieves the less computation time rather than applying the traditional algorithms. Hence, it can be ensured that it does not cause any computation burden for affecting the performance (Table 5).

Table 5 Time complexity analysis

8 Conclusion

A new method was presented in this paper for the joint optimal RA and relay selection in D2D by addressing the issues in the traditional RA and relay selection schemes. The presented work aimed to maximize the system sum rate in the overall D2D and cellular links while ensuring the demanded minimum D2D and cellular links rates. For this purpose, HFDCSA was incorporated to optimize the resource allocation and optimal relay selection tasks. Additionally, the recommended HFDCSA was supported to optimize several constraints such as energy efficiency and sum rate in the network to achieve a higher level of performance. In this operation, the data source was generated from various scenarios that were forwarded to the AMLP network for the optimal RA and relay selection tasks. The AMLP was trained with the target obtained from the executed HFDCSA. The variables in the AMLP were selected optimally with the help of the suggested HFDCSA. The final prediction on an optimal relay and the allocation of resources was done using the AMLP model. Finally, the numerical analysis was performed to validate the recommended optimal joint RA and relay selection approach in D2D communication with other traditional mechanisms. Simulation outcomes from Table 4 proved that the MSE of the implemented HFDCSA-AMLP-based optimal joint relay selection and RA prediction model was 41.06%, 33.68%, 41.37%, and 38.52% enhanced than the NN, SVM, KNN, and MLP models, respectively. Thus, the implemented scheme has minimized the sum rate by maximizing the EE and thus facilitates an efficient D2D communication scheme. This makes it suitable for various real-time communication systems such as disaster management systems, home automation systems, proximity-based services, critical missions, and 5G communication systems. In future, various other constraints such as user capability, user data, and length of the user query data with a fast-converging algorithm will be carried out. Also, joint RA and relay selection will be done using advanced deep learning models.

Data availability

Not applicable.

Abbreviations

D2D:

Device-to-device communication

CU:

Cellular user

RN:

Relay node

DR:

D2D receiver

DT:

D2D transmitter

HFDCSA:

Hybrid flow direction with chameleon swarm algorithm

FDA:

Flow direction algorithm

CSA:

Chameleon swarm algorithm

AMLP:

Adaptive multi-layer perceptron

eNB:

Evolved node B

RB:

Resource blocks

UE:

User equipment

PA:

Power allocation

RA:

Resource allocation

MEC:

Mobile edge computing

SNR:

Signal-to-noise ratio

PSNR:

Peak signal-to-noise ratio

ANN:

Artificial neural network

EE:

Energy efficiency

MINLFP:

Mixed-integer nonlinear fractional programming

QoS:

Quality of service

RPRS-EH:

Resource and power allocation with relay selection energy harvesting

EHA-CRD:

Energy harvesting-aided D2D network under cognitive radio

SD:

Smart devices

WAP:

Wireless access point

BINLP:

Binary integer nonlinear programming

NC-D2D:

Network coding in device-to-device communication

SINR:

Signal-to-interference plus noise ratio

BFP:

Bee’s fly pattern

MARL:

Multi-agent reinforcement learning

WoLF-PHC:

WoLF policy hill climbing

UAV:

Unmanned aerial vehicles

RL:

Reinforcement learning

WIT:

Wireless information transmission

WET:

Wireless energy transmission

BS:

Base station

AF:

Amply and forward

RF:

Radio frequency

MSE:

Mean-squared error

MAE:

Mean absolute error

RMSE:

Root mean-squared error

IoT:

Internet of Things

MFOA:

Moth-flame optimization algorithm

OS-RNNC:

Optimal solution relay network coding

SVM:

Support vector machine

KNN:

K-nearest neighbor

SCO:

Sand cat swarm optimization

CDF:

Cumulative distribution function

References

  1. T.D. Hoang, L.B. Le, T. Le-Ngoc, Joint mode selection and resource allocation for relay-based D2D communications. IEEE Commun. Lett.Commun. Lett. 21(2), 398–401 (2017)

    Article  Google Scholar 

  2. T. Kim, M. Dong, An iterative hungarian method to joint relay selection and resource allocation for D2D communications. IEEE Wirel. Commun. Lett. 3(6), 625–628 (2014)

    Article  Google Scholar 

  3. M. Hasan, E. Hossain, Distributed resource allocation for relay-aided device-to-device communication under channel uncertainties: a stable matching approach. IEEE Trans. Commun.Commun. 63(10), 3882–3897 (2015)

    Article  Google Scholar 

  4. M. Hasan, E. Hossain, Distributed resource allocation for relay-aided device-to-device communication: a message passing approach. IEEE Trans. Wirel. Commun.Wirel. Commun. 13(11), 6326–6341 (2014)

    Article  Google Scholar 

  5. X. Wang, T. Jin, L. Hu, Z. Qian, Energy-efficient power allocation and Q-learning-based relay selection for relay-aided D2D communication. IEEE Trans. Veh. Technol.Veh. Technol. 69(6), 6452–6462 (2020)

    Article  Google Scholar 

  6. J. Sun, Z. Zhang, C. Xing, H. Xiao, Uplink resource allocation for relay-aided device-to-device communication. IEEE Trans. Intell. Transp. Syst.Intell. Transp. Syst. 19(12), 3883–3892 (2018)

    Article  Google Scholar 

  7. M. Hasan, E. Hossain, D.I. Kim, Resource allocation under channel uncertainties for relay-aided device-to-device communication underlaying LTE-A cellular networks. IEEE Trans. Wirel. Commun.Wirel. Commun. 13(4), 2322–2338 (2014)

    Article  Google Scholar 

  8. G. Zhang, K. Yang, P. Liu, J. Wei, Power allocation for full-duplex relaying-based D2D communication underlaying cellular networks. IEEE Trans. Veh. Technol.Veh. Technol. 64(10), 4911–4916 (2015)

    Article  Google Scholar 

  9. Z. Zhang, Y. Wu, X. Chu, J. Zhang, Energy-efficient transmission rate selection and power control for relay-assisted device-to-device communications underlaying cellular networks. IEEE Wirel. Commun. Lett. 9(8), 1133–1136 (2020)

    Article  Google Scholar 

  10. Y. Yuan, T. Yang, Y. Hu, H. Feng, B. Hu, Two-timescale resource allocation for cooperative D2D communication: a matching game approach. IEEE Trans. Veh. Technol.Veh. Technol. 70(1), 543–557 (2021)

    Article  Google Scholar 

  11. Y. Zhao, Y. Li, D. Wu, N. Ge, overlapping coalition formation game for resource allocation in network coding aided D2D communications. IEEE Trans. Mob. Comput.Comput. 16(12), 3459–3472 (2017)

    Article  Google Scholar 

  12. X. Xiao, M. Ahmed, X. Chen, Y. Zhao, Y. Li, Z. Han, Accelerating content delivery via efficient resource allocation for network coding aided D2D communications. IEEE Access 7, 115783–115796 (2019)

    Article  Google Scholar 

  13. P.K. Mishra, S. Pandey, S.K. Biswash, Efficient resource management by exploiting D2D communication for 5G networks. IEEE Access 4, 9910–9922 (2016)

    Article  Google Scholar 

  14. Z. Li, J. Gui, N. Xiong, Z. Zeng, Energy-efficient resource sharing scheme with out-band D2D relay-aided communications in C-RAN-based underlay cellular networks. IEEE Access 7, 19125–19142 (2019)

    Article  Google Scholar 

  15. J. Dai, J. Liu, Y. Shi, S. Zhang, J. Ma, Analytical modeling of resource allocation in D2D overlaying multihop multichannel uplink cellular networks. IEEE Trans. Veh. Technol.Veh. Technol. 66(8), 6633–6644 (2017)

    Article  Google Scholar 

  16. Y. Yu, X. Tang, Energy price-based resource scheduling for network lifetime extending in cooperative D2D communications overlaying cellular networks. IEEE Access 11, 109353–109366 (2023)

    Article  Google Scholar 

  17. J. Ji, K. Zhu, D. Niyato, R. Wang, Joint trajectory design and resource allocation for secure transmission in cache-enabled UAV-relaying networks with D2D communications. IEEE Internet Things J. 8(3), 1557–1571 (2021)

    Article  Google Scholar 

  18. J. Cao, X. Song, Z. Xie, S. Li, F. Si, Social-aware relay selection and energy-efficient resource allocation for relay-aided D2D communication. Phys. Commun. 52, 101665 (2022)

    Article  Google Scholar 

  19. S. Kishk, N.H. Almofari, F.W. Zaki, Distributed resource allocation in D2D communication networks with energy harvesting relays using stable matching. Ad Hoc Netw.Netw. 61, 114–123 (2017)

    Article  Google Scholar 

  20. M.M. Salim, D. Wang, Y. Liu, H. Abd El Atty Elsayed, M. Abd Elaziz, Optimal resource and power allocation with relay selection for RF/RE energy harvesting relay-aided D2D communication. IEEE Access 7, 89670–89686 (2019)

    Article  Google Scholar 

  21. G. Feng, X. Qin, Z. Jia, S. Li, Energy efficiency resource allocation for D2D communication network based on relay selection. Wirel. Netw. 27, 3689–3699 (2021)

    Article  Google Scholar 

  22. Y. Li, G. Xu, K. Yang, J. Ge, P. Liu, Z. Jin, Energy efficient relay selection and resource allocation in D2D-enabled mobile edge computing. IEEE Trans. Veh. Technol.Veh. Technol. 69(12), 15800–15814 (2020)

    Article  Google Scholar 

  23. R. Wang, D. Cheng, G. Zhang, Y. Lu, J. Yang, L. Zhao, K. Yang, Joint relay selection and resource allocation in cooperative device-to-device communications. AEU-Int. J. Electron. Commun. 73, 50–58 (2017)

    Article  Google Scholar 

  24. Y. Zhao, Y. Li, X. Chen, N. Ge, Joint optimization of resource allocation and relay selection for network coding aided device-to-device communications. IEEE Commun. Lett.Commun. Lett. 19(5), 807–810 (2015)

    Article  Google Scholar 

  25. C. Gao, Y. Li, Y. Zhao, S. Chen, A two-level game theory approach for joint relay selection and resource allocation in network coding assisted D2D communications. IEEE Trans. Mob. Comput.Comput. 16(10), 2697–2711 (2017)

    Article  Google Scholar 

  26. D. Gao, N. Xia, X. Liu, D. Wang, M. Peng, Mode switching and power allocation for relay-assisted cooperative device-to-device communications. IEEE Trans. Veh. Technol.Veh. Technol. 72(12), 16108–16122 (2023)

    Article  Google Scholar 

  27. W.H. Mahdi, N. Tașpinar, Bee system-based self configurable optimized resource allocation technique in device-to-device (D2D) communication networks. IEEE Access 12, 3039–3053 (2024)

    Article  Google Scholar 

  28. X. Liu, S. Huang, K. Zhang, S. Maimaiti, G. Chuai, W. Gao, X. Chen, Y. Hou, P. Zuo, Joint resource allocation and drones relay selection for large-scale D2D communication underlaying hybrid VLC/RF IoT systems. Drones 7(9), 589 (2023)

    Article  Google Scholar 

  29. X. Zhong, Y. Guo, N. Li, Y. Chen, Joint optimization of relay deployment, channel allocation, and relay assignment for UAVs-aided D2D networks. IEEE/ACM Trans. Netw. 28(2), 804–817 (2020)

    Article  Google Scholar 

  30. C. Tian, Z. Qian, X. Wang, L. Hu, Analysis of joint relay selection and resource allocation scheme for relay-aided D2D communication networks. IEEE Access 7, 142715–142725 (2019)

    Article  Google Scholar 

  31. H. Karami, M.V. Anaraki, S. Farzin, S. Mirjalili, Flow Direction Algorithm (FDA): a novel optimization approach for solving optimization problems. Comput. Ind. Eng. 156 (2021)

  32. M.S. Braik, Chameleon Swarm Algorithm: A bio-inspired optimizer for solving engineering design problems. Expert Syst. Appl. 174 (2021).

  33. M. Said, A.M. El-Rifaie, M.A. Tolba, E.H. Houssein, S. Deb, An efficient chameleon swarm algorithm for economic load dispatch problem. Mathematics 9(21), 2770 (2021)

    Article  Google Scholar 

  34. W.H. Delashmit, M.T. Manry, Recent developments in multilayer perceptron neural networks. In Proceedings of the Seventh Annual Memphis Area Engineering and Science Conference, MAESC (2005), pp. 1–15

  35. A. Seyyedabbasi, F. Kiani, Sand Cat swarm optimization: a nature-inspired algorithm to solve global optimization problems. Eng. Comput.Comput. 39(4), 2627–2651 (2023)

    Article  Google Scholar 

  36. U.A. Khan, R. Chai, S. Ahmad et al., Joint computation offloading and resource allocation strategy for D2D-assisted and NOMA-empowered MEC systems. J. Wirel. Commun. Netw. 2023, 9 (2023). https://doi.org/10.1186/s13638-022-02207-2

    Article  Google Scholar 

  37. A.W. Sumijan, A. Muhammad, Budiharjo, “Implementation of neural networks in predicting the understanding level of students subject,.” Int. J. Softw. Eng. Appl. 10(10), 189–204 (2016)

    Google Scholar 

  38. Y. Radhika, M. Shashi, Atmospheric temperature prediction using support vector machines. Int. J. Comput. Theory Eng. 1(1), 55 (2009)

    Article  Google Scholar 

  39. Y. Cai, L. Ran, J. Zhang et al., Latency optimization for D2D-enabled parallel mobile edge computing in cellular networks. J. Wirel. Commun. Netw. 2021, 133 (2021). https://doi.org/10.1186/s13638-021-02008-z

    Article  Google Scholar 

Download references

Funding

None.

Author information

Authors and Affiliations

Authors

Contributions

All the authors have equal contributions to the preparation of this article.

Corresponding author

Correspondence to S. Nandakumar.

Ethics declarations

Ethics approval

Not applicable.

Consent to publish

I, the undersigned, give my consent for the publication of identifiable details, which can include a photograph(s) and/or videos and/or case history and/or details within the text (“Material”) to be published in the Journal.

Competing interests

The author(s) declare(s) that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chennaboin, R.B., Nandakumar, S. An adaptive MLP-based joint optimization of resource allocation and relay selection in device-to-device communication using hybrid meta-heuristic algorithm. J Wireless Com Network 2024, 50 (2024). https://doi.org/10.1186/s13638-024-02379-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13638-024-02379-z

Keywords