1 Introduction

The rapidly increasing number of mobile devices, voluminous data, and higher data rate are pushing to rethink the current generation cellular system [1]. The future generation or fifth generation (5G) cellular networks are expected to meet these requirements. One of the promising technologies in the fifth generation network is D2D communication where devices can communicate directly with each other within the proximity area without assistance of communication infrastructure viz. the base station (BS) [2,3,4]. D2D communication alleviates traffic loads from BS side and provides higher local data rate and increases spectral efficiency [4, 5]. D2D users send request to BS for allocating resource block. The BS allocates resource block based on channel state information (CSI)/signal-to-interference plus noise-ratio (SINR).

In resource allocation process, the BS allocates resource block to cellular users (CU) and D2D users. D2D pairs reuse the resource block of CU users, thus they create interference at CU users which decreases the throughput. In order to reduce the interference, an interference-aware graph-based resource sharing algorithm is proposed [6]. In this scheme, the authors defined three new attributes (link attribute, resource attribute and cluster attribute) for each communication link. This interference-aware scheme achieves near-optimum system performance. In [7], the authors proposed a decentralized multiple gateway assignment protocol based on multi-channel CSMA for machine-to-machine communication for enhancing throughput of the network. In [8], the authors proposed a channel sharing scheme based on graph theory for increasing the capacity of CU users and D2D users. This scheme is based on bipartite graph where vertices are denoted by D2D and CU users, edges are denoted by the links between D2D pairs and CU users. In [9], the authors proposed a resource allocation model based on an imperfect information Stackelberg game (CSAM-IISG) using a hidden Markov model (HMM) in a cloud computing environment. In [10], the authors proposed a distance constrained resource allocation scheme based on linear sum assignment problem (LSAP) and linear bottleneck assignment problem (LBAP).

Due to increase in the number of D2D pairs with limited spectrum, it is required to share same resource block by more than one D2D pairs with CU user. This generates huge interference which reduces the network throughput. In order to reduce the interference in multi sharing scenario, several research articles are proposed [11, 12]. In [11], the authors consider the resource allocation problem as a reverse iterative combinatorial auction game, and proposed a joint resource and power allocation scheme which results in high energy efficiency. In [12], the authors proposed a graph-based resource allocation scheme and sequential second price auction mechanism to allocate the resources for D2D communications with multiple user pairs.

When the D2D users are not in proximity, they can communicate with the help of other device (relay) [13, 14]. This is known as multi-hop D2D communication. In the multi-hop D2D communication, minimum two links will be established between D2D pairs (source-to-relay and relay-to-destination) which requires resource block for each link communication. Multi-hop D2D communication increases the proximity area, as a result, the device will communicate with minimum involvement of the BS. In addition, multi-hop D2D communication increases the network throughput and spectral efficiency by reusing same resource block. A very limited number of works related to multi-hop D2D communication are reported in the literatures which are discussed in Sect. 2 in detail.

Motivation The multi-hop D2D communication increases the network throughput with limited resources. In addition, it also increases proximity and reduces load from BS side. There are very less works reported in this area. The reported works did not consider the multi sharing scenario where multiple D2D pairs will use same resource block with CU user. This generates huge interference in multi-hop D2D communication case. Therefore, it is required to have a resource allocation scheme for multi-hop D2D communication which should improve the network throughput and should perform better in case of increased proximity.

Objectives The objectives of proposed scheme are as follow:

  • To increase the network throughput for multi-hop D2D communication for 5G cellular network.

  • To improve the network throughput when the proximity is increased.

  • To improve the network throughput guaranteeing the rate requirements of all D2D and cellular users.

In order to achieve these objectives, a hybrid resource allocation scheme for multi-hop D2D communication for 5G cellular network is proposed. The hybrid resource allocation scheme maximizes the throughput by integrating graph-based scheme with PSO. Initially, graph-based scheme is applied for creating the interference matrices; thereafter PSO is applied for maximizing the network throughput. This scheme also provides better throughput in case of increased proximity and supports minimum data rate to maintain the QoS of the network.

The following sections in this paper are organized as follow. Section 2 deals with the related work. Section 3 depicts system model and problem formulation for two-hop D2D communication. Section 4 describes the proposed scheme. In Sect. 5, simulation results are evaluated. Finally, conclusion is drawn in Sect. 6.

2 Related Works

D2D communication received much attention for next generation network because of reusability of cellular resources. Several research works have been proposed for resource allocation in case of direct D2D communication. D2D communication helps in increasing the proximity and also helps in improving the network throughput. However, a very limited works are reported for resource allocation in case of multi-hop D2D communication. In resource allocation process, the BS allocates same resource block to CU and D2D users. This creates interference which reduces the network throughput. To reduce the interference and improve the network throughput, several authors put efforts to minimize interference for for direct D2D and multi-hop D2D communications in resource sharing case. The techniques proposed for resource allocation can be broadly categorized as graph-based, game theoretic and optimization-based schemes.

Graph theory-based schemes are extensively used for mitigating the interference between D2D pairs and CU users. Various graph-based resource allocation schemes [6, 8, 13, 15,16,17,18,19] have been discussed for allocating the resources for CU and D2D users in uplink/downlink phase. In graph-based schemes, vertex represents the user equipments and edges represent the link connectivity. Graph colouring technique is applied in [17] for avoiding interference between D2D pairs. In this scheme, a feedback mechanism is used where D2D pairs are able to measure the interference. In [19], the authors proposed a graph colouring based resource scheme for D2D users in uplink phase where UE has capability to measure interference.

Game theoretic schemes are also extensively used for solving the resource allocation problem. A game theoretic approach for resource allocation for intercell D2D communication underlay cellular network is discussed in [20] where the D2D link is located in overlapping area of two neighbouring cells. The major drawback of this scheme is that the authors pre-assumed that all the necessary parameters are shared and exchanged between the base-stations while the bases stations are belongs by different telecom operators. However, practically it is not possible. Therefore, in [21], the authors proposed a resource allocation scheme for multi-cell D2D communication under the assumption of incomplete information. In this scheme, the BS acts as player competing for resource supply of D2D. The utility of each player is defined as revenue collected from both cellular and D2D users using spectrum resources.

Optimization techniques are also used for resource allocation for D2D communication underlay cellular network. A number of optimization techniques are discussed in [22,23,24,25,26]. In [22], the authors proposed resource allocation scheme based on particle swarm optimization (PSO) technique. This scheme improves the network throughput by joint mode selection and resource allocation. In [23], authors proposed PSO based power allocation scheme for improving overall network throughput. In [24], the authors proposed sub-carrier allocation scheme to maximize the average weighted sum-rate throughput with the interference constrained for cellular users. This scheme combines support vector machine (SVM) and PSO where the probabilistic interference constraint is computed by SVM. In [25], a joint mode selection and resource allocation based on evolutionary algorithm is proposed. This scheme improves the sum rate with sharing of same resource block by multiple users.

When direct D2D communication or during communication, the communicating devices moves out from their proximity and direct communication is not possible, the communication takes place with the help of other devices. This is known as multi-hop D2D communication. There are very limited works reported for resource allocation process in case of multi-hop D2D communication. In [27], the authors proposed radio resource management algorithm for two-hop D2D communication. A resources allocation scheme based on the clustering technique for closed subscriber in two tier heterogeneous network is proposed in [28]. In [29], the authors proposed a resource allocation scheme for multi-hop D2D communication based on interference avoidance for long term evaluation-advance (LTE-A) networks. In [30], the authors proposed a new method for dealing with security concerns for multi-hop D2D communication. Further, it is suggested that relay-assisted multi-hop D2D communications can enhance the achievable throughput and can boost up the coverage area of cellular networks [31].

Enabling multi-hop D2D communications in a cellular network poses two major challenges. Firstly, the interference caused to the cellular users by D2D devices could critically affect the performances of the cellular devices [13, 29, 32]. Secondly, the minimum quality-of-service (QoS) requirements of D2D communications need to be guaranteed. With the increasing usage of internet services by mobile users and lack of sufficient spectrum, there is a need to use this limited spectrum resource optimally by a proper resource allocation scheme. Allocation of resource based on optimization techniques has become popular for next generation cellular networks mainly because of their versatility, scalability and computational simplicity. Existing resource allocation schemes for direct D2D communication based on optimization are summarized in Table 1. However, Table 2 summarizes the reported works for multi-hop D2D communication.

Table 1 Resource allocation schemes for direct D2D communications
Table 2 Resource allocation schemes for multi-hop D2D communications

3 System Model and Problem Formulation

In this section, a schematic representation of system model for two-hop D2D communication for 5G networks is described. It is considered that D2D communication utilizes uplink spectrum of cellular network. As shown in Fig. 1, the evolved node B (eNodeB)/BS is located at center of the cell with \( M \) cellular users (CU) and \( N \) D2D pairs which are randomly distributed over the cell area. The CU users, D2D pairs and relay devices are mobile in random nature. The set of cellular users and D2D pairs are defined as \( C_{m} \) where \( m = 1,2,3 \ldots M \) and \( D2D_{n} \) where \( n = 1,2,3 \ldots N \) respectively. There are \( K \) number of resource block available where \( k = 1,2,3 \ldots K \). In direct D2D communication, the devices move out of their proximity then it is necessary for them to employ a relay in between defined as \( R_{re} \) where \( re = 1,2,3, \ldots RE \).

Fig. 1
figure 1

System model

The multi-hop D2D communication takes place between source and destination by routing the message through a relay. This not only maximizes the proximity of the communication between D2D pairs but also improves the resource block throughput. Figure 2 represents the multi-hop D2D communication setup. The introduction of relay in between D2D communication proximity range is necessary to solve the various resource block problem. The relay request is accepted at the BS side only when the relay receives an access request message (ARM) from the D2D transmitter. If D2D transmitter meets the minimum transmission rate Rmin i.e. RD2D > Rmin, then relay assists the existing D2D pairs in their communication. This relay device also reuses the cellular resource block as direct D2D communication and handles the communication from source to destination and as result of which interference occurs.

Fig. 2
figure 2

Multi-hop D2D communication setup

It is assumed that utilized resources are orthogonal in nature, and D2D pairs reuse the cellular resource block. This causes inter-channel interference when different links share same resource block. Also, the number of cellular user equals the resource block such that one resource block is reused by at least one D2D pair. Considering \( I_{m,k} \) be the interference at cellular user m, which is given by,

$$ I_{m,k} = \sum\limits_{n = 1}^{N} {P_{DTn} \times g_{{DTn,CU_{m} }} } $$
(1)

where \( P_{DT} \) is transmission power of \( n{\text{th}} \) D2D user and \( g_{{DTn,CU_{m} }} \) represents the gain of \( n{\text{th}} \) D2D pair to \( m{\text{th}} \) cellular user. Let \( I_{BS,k} \) be the interference at the BS in the \( k{\text{th}} \) resource block,

$$ I_{BS,k} \; = \;\sum\limits_{n = 1}^{N} {P_{DTn} \times g_{DTn,BS} } $$
(2)

where \( g_{DTn,BS} \) denotes the gain from D2D pair transmitter to the eNodeB. The interference experienced at the \( n{\text{th}} \) D2D receiver from other D2D pair transmitter is \( I_{n,k} \) which is represented as,

$$ I_{n,k} \; = \;\sum\limits_{n = 1,n \ne i}^{N} {P_{DTn} \times g_{DTn,DRi} } $$
(3)

where \( g_{DTn,DRi} \) denotes the gain from other D2D transmitter to the D2D receiver. Similarly, the effect of interference in multi-hop D2D communication from the respective relay is considered on the BS side, cellular user and to the D2D receivers respectively.

In multi-hop D2D communication, same resource block is allocated to more than one D2D link pairs due to limited number of resource blocks which generates huge interference. Thus, to reduce the total interference, the minimum interference level of the system as an objective is taken. The \( I^{DT} \) and \( I^{RE} \) represent the interference occurred from other D2D transmitter and relay device respectively. Thus, the total interference in the system is described as,

$$ I_{T} = \sum\limits_{m = 1}^{M} {\sum\limits_{k = 1}^{K} {\sum\limits_{n = 1}^{N} {\left\{ {I_{m,k}^{DT} + I_{BS,k}^{DT} + I_{n,k}^{DT} + I_{m,k}^{RE} + I_{BS,k}^{RE} + I_{n,k}^{RE} } \right\}} } } $$
(4)

The SINR for each resource block is calculated to determine the strength of a particular resource block. The SINR at the relay end is represented as,

$$ SINR_{\text{Relay}} = \frac{{P_{DT} \times g_{{DT,{\text{Relay}}}} }}{{\sigma + \sum\nolimits_{m = 1}^{M} {\sum\nolimits_{n = 1}^{N} {\sum\nolimits_{K = 1}^{K} {\left\{ {I_{m,k}^{DT} + I_{BS,k}^{DT} + I_{n,k}^{DT} } \right\}} } } }} $$
(5)

Similarly, SINR at the receiver end is represented as,

$$ SINR_{{D_{R} }} = \frac{{P_{{R_{R} }} \times g_{{{\text{Relay}},D_{R} }} }}{{\sigma + \sum\nolimits_{m = 1}^{M} {\sum\nolimits_{n = 1}^{N} {\sum\nolimits_{K = 1}^{K} {\left\{ {I_{m,k}^{RE} + I_{BS,k}^{RE} + I_{n,k}^{RE} } \right\}} } } }} $$
(6)

where \( \sigma \) is the thermal noise power, \( g_{{DT,{\text{Relay}}}} \) and \( g_{{{\text{Relay}},D_{R} }} \) denote the gain from D2D transmitter to relay and relay to D2D receivers, respectively. The end-to-end SINR for two-hop D2D is obtained by considering the minimum SINR from both hops. It can be calculated as,

$$ SINR_{SR} = \hbox{min} \left\{ {SINR_{\text{Relay}} ,SINR_{{D_{R} }} } \right\} $$
(7)

Denoting the bandwidth of a particular resource block by BW, and the sum throughput or transmission capacity of the of nth two-hop D2D pair in kth resource block can be expressed as

$$ T_{n,k} \; = \;BW \times \;\;\log (\,1 + \,\;SINR_{SR} \;) $$
(8)

The resource allocation problem can be formulated as follows:

$$ {\text{maximize }}\left\{ {\sum\limits_{m = 1}^{M} {\sum\limits_{k = 1}^{K} {T_{m,k}^{CU} } } + \sum\limits_{re = 1}^{RE} {\sum\limits_{k = 1}^{K} {T_{re,k}^{RE} } } + \sum\limits_{n = 1}^{N} {\sum\limits_{k = 1}^{K} {T_{n,k}^{D} } } } \right\} $$
(9)

subjected to

$$ \sum\limits_{m = 1}^{M} {\sum\limits_{k = 1}^{K} {P_{m,k}^{CU} \le P_{\hbox{max} }^{CU} } } $$
(C1)
$$ \sum\limits_{re = 1}^{RE} {\sum\limits_{k = 1}^{K} {P_{re,k}^{R} } } \le P_{\hbox{max} }^{RE} ,\quad \forall re \in RE $$
(C2)
$$ \sum\limits_{n = 1}^{N} {\sum\limits_{k = 1}^{K} {P_{n,k}^{D} } } \le P_{\hbox{max} }^{D} ,\quad \forall N \in D $$
(C3)
$$ \sum\limits_{n = 1}^{N} {\sum\limits_{k = 1}^{K} {R_{N,K} } } \ge R_{\hbox{min} } ,\quad \forall n \in N $$
(C4)
$$ \sum\limits_{k = 1}^{K} {x_{{D_{n} }}^{k} } \ge 1,\quad 1 \le k \le K $$
(C5)

The given constraints are in accordance with the assumption defined for taken model. The first, second and third constraints mean to restrict the maximum power transmission from the BS, relay transmit power and source transmit power of D2D pairs, respectively. The fourth constraint is used to guarantee the minimum required data rate. The fifth constraint means that more than one D2D pairs use same resource block.

4 Proposed Scheme

In this section, a hybrid resource allocation scheme for multi-hop D2D communication is proposed. Initially, we introduce graph-based scheme for the computation of interference matrices. Then, particle swarm optimization (PSO) and graph-based schemes are integrated to develop a hybrid model which could solve the resource allocation problem.

4.1 Graph-Based Scheme

In graph-based scheme, a resource block with minimum interference is given the most priority. To handle the severe effect of interference in the system, an interference matrix setup based on feedback model is designed. Moreover, this also reduces the chances of one cellular resource block being used by multiple D2D users.

In order to design an interference matrix setup on feedback model, different scenarios for the multi-hop D2D communication are developed. The different scenarios consist of random resource allocation and the graph-based allocation between source-to-relay and relay-to-destination. The scenarios compare both the schemes in resource allocation scenario which are categorized into sub cases as follow

Case-I

The source-to-relay and relay-to-destination communications will follow random resource allocation scheme.

Case-II

The source-to-relay and relay-to-destination communication will follow both the random and the graph-based schemes.

Case-III

The source-to-relay and relay-to-destination communication will follow graph-based schemes.

Each possible communication between source-to-destination is described in the sub-cases as shown in Table 3.

Table 3 Two-Hop D2D communication with different schemes

Feedback Configuration As shown in the Fig. 3, the graph-based scheme starts with the construction of interference graph. It is considered that a graph is bipartite graph which is comprised of cellular user equipment (UEx), D2D transmitters (DTx), Relays (Rx) and D2D receivers (DRx) pairs connected by weighted edges representing interference between resource blocks. UE1 and UE2, which present the pieces of cellular UE, compose the central part. The transmitter of D2D pairs DT1 and DT2 pairs compose the right part and DT3 and DT4 compose the left side.

Fig. 3
figure 3

Illustration of graph

The graph is denoted by \( G = (V^{c} ,V^{d} ,E) \) where \( V^{c} \) is the set of vertices of all cellular UE, \( V^{d} \) is the set of all vertices of all D2D pairs and relay node, and \( E \) is the edges set. Each vertex \( V_{m}^{c} \, \in V^{c} \) represents a cellular UE; each vertex \( V_{n}^{d} \in V^{d} \), \( V_{re}^{d} \in V^{d} \) represents a D2D user and relay node respectively. The edge \( e_{m,n} \; \in \;E \) implies that the D2D pair \( V_{n}^{d} \) shares the resource block with the cellular UE \( V_{m}^{c} \) and edge \( e_{m,re} \; \in \;E \) implies that the relay \( V_{re}^{d} \) also shares the resource block; the cellular UE \( V_{m}^{c} \) for two-hop D2D communication. Moreover, the weights set are denoted by \( W_{M \times N} \), which is M-by-N matrix. The element \( w_{m,n\;} \in W_{M \times N} \), representing the weight of the \( e_{m,n} \; \) equals the interference power \( I_{m,n} \). The edge \( e_{n,n'} \; \in \;E \) connects \( V_{n}^{d} \, \in V^{d} \) and \( V_{n'}^{d} \, \in V^{d} \) which implies the interference level between D2D receiver to other D2D transmitters. The edge \( e_{n,re} \; \in \;E \) connects \( V_{n}^{d} \, \in V^{d} \) and \( V_{re}^{d} \, \in V^{d} \) which implies the interference level between D2D pair to relay. The dotted edge lines are showing strong interference. When the interference can be ignored, the edge is denoted by solid lines. The interference level can be obtained according to the matrixes \( X1_{M \times N} \), \( X2_{N \times N'} \), and \( X3_{N \times RE} \)

4.2 Particle Swarm Optimization

Although, an interference matrix setup based on feedback model by graph-based scheme is designed. The resource allocation problem is a mixed integer optimization problem, which cannot be solved easily. Therefore, we can adopt swarm intelligence algorithm which plays a vital role in solving the problem. Particle swarm optimization (PSO) is a stochastic, population-based optimization algorithm, which is simple in implementation. In PSO, various individual particles in a swarm change its search directions and search for the optima in each iteration. The position of every particle represents a candidate solution for a problem, and a fitness function is characterized to assess the goodness of the solution. Every particle has its personal best position and global best position discovered from the best solutions after several iterations. The velocity and position of particles are based on Eqs. (10) and (11):

$$ V_{o}^{t + 1} = wV_{o}^{t} + r_{1} c_{1} \left( {P_{o}^{t} - X_{o}^{t} } \right) + r_{2} c_{2} \left( {G^{t} - X_{o}^{t} } \right) $$
(10)
$$ X_{o}^{t + 1} \, = \,X_{o}^{t} + V_{o}^{t + 1} $$
(11)

where \( w \) is inertia weight, \( r_{1} \) and \( r_{2} \) are two random numbers in the range [0, 1]. \( V_{o}^{t} \) and \( X_{o}^{t} \) represent the velocity and position of the \( o{\text{th}} \) particle at \( t{\text{th}} \) iteration. \( P_{o}^{t} \) and \( G_{{}}^{t} \) denote the personal best position and global best position at \( t{\text{th}} \) iteration. The standard PSO is suited for continuous solution space. As a better way of solving mixed integer non-linear optimization problem, an algorithm is proposed for handling throughput optimization problem using PSO.

4.2.1 Throughput Optimization Using PSO

To solve a throughput optimization problem using PSO for the swarm of interference obtained using graph-based method. The major issues are the particle representation for mapping the solutions and the fitness function to evaluate the quality of particles after dealing with all the constraints. And to solve this constrained problem, penalty function is utilized to make a fitness function. The main idea of this scheme is to transform a constrained problem into an unconstrained one by incorporating a penalty function in the objective function. We construct the penalty function as,

$$ Penalty = \sum\limits_{n = 1}^{N} {\hbox{max} \left\{ {0,\sum\limits_{k = 1}^{K} {T_{n,k} } } \right\}} $$
(12)

We can get the fitness function by:

$$ Fitness = T_{n,k} - \sum\limits_{n = 1}^{N} {\hbox{max} \left\{ {0,\sum\limits_{k = 1}^{K} {T_{n,k} } } \right\}} $$
(13)

The penalty function plays a major role in guiding the particles to fly out of the non-feasible region as soon as possible or to get as close as possible to the feasible region. Moreover, the fitness function ensures continuity so that we can make full use of the standard PSO’s advantage in searching for optima.

The resource allocation problem in Eq. (9) is a proximity constraint problem. Therefore, this paper demonstrates a hybrid of graph-based scheme and Swarm based optimization. In addition to graph-based scheme, PSO further optimize the throughput to achieve a minimum required rate. The swarm optimization technique utilized after the graph-based scheme reduces the interference to specified level. The PSO scheme has the significance of searching the best variable from the entire population. This best variable is selected from the list of resource blocks and it is optimized by the parameters of the PSO to provide the minimum rate requirement for multi-hop D2D communication. The pseudo code of hybrid algorithm is given in Algorithm 1.

figure e

5 Performance Evaluation and Discussion

In this section, a numerical simulation using MATLAB is presented. The simulation considers a single cell with one BS, 25 CU users and varying number of two hop D2D users (minimum 5 and maximum 25). The users are distributed randomly over the entire cell. The receivers of the D2D users and the relays are randomly distributed in the limited proximity. The maximum distance between D2D pairs gets tuned by the indicator L. Link gains include path loss and Rayleigh fading, where path loss model is L(d) = 128.1 + 37.6 log10d for the cellular communication between BS to cellular users and L(d) = 128.1 + 37.6 log10d for D2D communication, where \( d \) is distance in kilometers [38]. For plotting the graph, the simulation is carried out 100 times consecutively and the average so obtained is plotted. PSO parameters are set as follow: total population = 25, maximum iterations = 100, learning factors c1 = c2 = 2, and the inertia weight = [0.4, 0.9]. The system parameters used in the performance evaluation are summarized in Table 4.

Table 4 System parameters

Figure 4a depicts the throughput of two-hop D2D users versus number of two-hop D2D pairs. The throughputs of random allocation-based and graph-based schemes are compared with proposed scheme. In the random allocation-based, resources are allocated randomly to the requested users. When the number of two-hop D2D pairs increases, it is observed that more than one two-hop D2D pairs can share the same resource block with CU user. Thus, random scheme do not provide required throughput. However, graph-based resource allocation scheme allocates the resource based on minimum interference. Although the graph-based scheme could satisfy the minimum throughput requirement, the communication held in this scheme fails in optimum resource allocation and also the throughput of graph-based resource allocation scheme is less than that of proposed scheme. Therefore, proposed scheme gives better throughput in comparison to random allocation and graph-based allocation schemes.

Fig. 4
figure 4

a Throughput of two-hop D2D pair versus number of two-hop D2D pairs. b Interference of two-hop D2D users versus number of two-hop D2D pairs

Figure 4b represents the interference generated by two-hop D2D pairs versus number of two-hop D2D pairs. The random resource allocation scheme is severely affected by inter-channel interference and resource allocation for two-hop D2D communication by this scheme is gruesome task for the BS. Because, multiple two-hop D2D pairs share same resource with CU user which generates more interference. Although, the graph-based scheme in two-hop D2D communication has resulted in depression of interference, however, the proposed scheme outperforms the other two schemes in reducing the effect of interference between the resource blocks. The proposed scheme reduces the interference to desired level where flawless communication between source-to-relay and relay-to-destination can be achieved. Thus, the proposed scheme generates less amount of interference compared to random resource allocation and graph-based resource allocation schemes.

Figure 5a plots the throughput of the cellular users versus the number of two-hop D2D pairs for different schemes. Using the random resource allocation, the CU throughput reduces drastically due to sharing the same resource block with multiple two-hop D2D pairs which also disables the cellular communication frequently. The throughput obtained by the graph-based scheme is greater than that of random scheme and less than the throughput of the proposed scheme. The proposed scheme maintains an environment of flawless communication between the two-hop D2D pairs and also for the CU users. When the number of two-hop D2D pairs increases, the throughput of CU users is degraded. However, the proposed scheme performs better in compared to random and graph-based resource allocation schemes.

Fig. 5
figure 5

a Throughput of CU users versus number of two-hop D2D pairs. b Interference of CU users versus number of two-hop D2D pairs

Figure 5b depicts the effect of interference on the cellular users versus the number of two-hop D2D users for different schemes. It is noted that the interference affects the cellular users severely in the random resource allocation scheme and reduces the QoS. Although the affect of interference for graph-based scheme is less than the random resource allocation but it fails to achieve the QoS parameters for two-hop D2D communication. The proposed scheme maintains the interference level below the desired one so that CU users are provided with the fair quality resource blocks. In addition, two-hop D2D pairs also reuse the resource block with less interference. Thus, the proposed scheme gives better result in comparison to random resource and graph-based resource allocation scheme.

Figure 6a records the trace of the system throughput versus the number of two-hop D2D pairs obtained for various schemes. The system throughput is the total throughput which is generated for end-to-end communication in two-hop D2D communication and cellular user communication. Initially, when the numbers of two-hop D2D pairs are lesser, the throughput of random resource, graph-based and proposed scheme increases sharply. The random resource allocation and graph-based resource allocation scheme do not perform better in comparison to proposed scheme in case of increasing the number of two-hop D2D pairs. The important point to be noted is that the proposed scheme throughput improvement is up to 105 Mbps in random resource allocation scheme case and up to 50 Mbps graph-based resource allocation scheme. This increase in throughput enables the two-hop D2D communication which is in far proximity to communicate with higher data rates at constant flow.

Fig. 6
figure 6

a System throughput versus number of two-hop D2D pairs. b System interference versus number of two-hop D2D pairs

Figure 6b plots the system interference versus number of two-hop D2D pairs for different schemes. Initially, when the number of two-hop D2D pair is lesser (up to 10 two-hop D2D pairs) with fixed number of cellular user (25), the proposed scheme and graph-based schemes generated interference of same value approximately. However, the random resource allocation scheme generated much interference in comparison to proposed scheme and graph-based resource allocation schemes. When the number of two-hop D2D pairs increases, it is observed that the graph-based and random resource allocation scheme gives poor performance in comparison to proposed scheme. The proposed scheme performed better even though in larger proximity case in comparison to random resource allocation and graph-based resource allocation schemes.

After optimizing the throughput of the system, we have also compared proposed scheme with other two schemes, namely, orthogonal sharing-based resource allocation (OS-RA) [39] and cellular-oriented resource allocation (C-RA) [40]. Figure 7 plots a graph between proximity versus system throughput. The throughput of the three schemes for proximity value at 50 and 100 m is shown. Analyzing the figure, it can clearly be concluded that PSO scheme outperforms in throughput optimization as compared to C-RA and OS-RA schemes. This is possible because proposed scheme utilizes the resource block by reusing it between cellular user and the two-hop D2D pairs.

Fig. 7
figure 7

Proximity comparison

In Fig. 8, the system throughput is plotted as against the minimum required rate with the minimum proximity 50 m. The proposed scheme attains the highest throughput in comparison to OS-RA scheme [39] and C-RA scheme [40]. The proposed scheme also supports the minimum required rate. Initially, the minimum rate is not constrained, our scheme gives better throughput. When the minimum data rate is increased, the throughput is going to degraded and C-RA and OS-RA give near same throughput. However, proposed scheme still gives better throughput up to 2000 kbps minimum data rate.

Fig. 8
figure 8

System throughput versus minimum required rate

6 Conclusion

In this article, a multi-sharing resource allocation problem for two-hop D2D communication is discussed. To improve the throughput of the network, a hybrid resource allocation scheme is proposed. This hybrid scheme integrated a graph-based scheme and PSO. In this scheme, interference matrix is created by graph-based technique and preceded by throughput optimization with the help of PSO. The simulation result shows superiority of proposed scheme over graph-based and random resource allocation scheme. This scheme also provides better throughput when the proximity is increased.

The proposed scheme only considered the cellular users and two-hop D2D users for uplink communication system. Further, this work can be extended for downlink communication system with different types of communication (cellular, direct D2D and multi-hop D2D). The other extensions of the work include application of various recently proposed optimization algorithms to solve the multi-sharing resource allocation problem.