Abstract

In this paper, the resource allocation problem for device-to-device (D2D) communications underlaying cellular networks is formulated and analyzed. In our scenario, we consider that the number of D2D user equipment (DUE) pairs is far larger than that of cellular user equipments (CUEs). Meanwhile, the resource blocks are divided into two types: resource blocks for CUEs and the ones for CUEs and DUEs. Firstly, the system model is presented, and the resource allocation problem is formulated. Then, a resource allocation scheme based on the genetic algorithm is proposed. To overcome the problem that the dedicated resource is not fully shared in the genetic algorithm, an improved harmony search algorithm is proposed for resource allocation. Finally, the analysis and simulation results show that the performances of the proposed genetic algorithm and the improved harmony search algorithm outperform than that of the random algorithm and are very close to that of the exhaustive algorithm. This result can provide an effective optimization for resource allocation of D2D communications.

1. Introduction

As the demand for mobile network data continues to grow, the scarcity of radio spectrum resources impels us to develop new technology so as to improve the spectral efficiency. D2D communication is proposed as the key technology of 5G to overcome this issue. D2D communication can implement the direct communication of device to device under the control of base station, which provides high-quality experience for users [1].

In the D2D communication system, when D2D pairs simultaneously share the same spectrum resource with the CUE, adjacent D2D pairs and the CUE will interfere with each other inevitably. Therefore, interference and resource allocation are the crucial issues which attract many researchers all around the world. In [2], the CUEs can share the spectrum resources with socially close D2D users. Based on the resource allocation framework, the authors proposed a two-step joint game. First, users with close relationships formed the same community. Then, the optimal resource allocation issue was solved for D2D pairs. In [3], in order to maximize the weighted D2D sum rate under cellular rate constraints, the authors proposed a two-step approach by introducing energy-splitting variable such that mixed-mode allocation and resource allocation can be decoupled and optimized independently. The two-step method had little signalling overhead and low computational complexity. In [4], in order to minimize the transmission power, a distributed strategy based on Q-learning and softmax decision-making was proposed. Considering the interference of users under the same frequency, the candidate D2D user set was firstly reduced according to the outage probability constraint. Then, a graph was constructed based on this. Next, the Hungarian algorithm was used to search for the optimal spectral matching scheme to maximize the sum rate [5]. In [6], a stable matching approach was adopted to handle the energy efficiency optimization issue. Firstly, game theory was used to analyze the interactions and correlations among user equipments (UEs), and an iterative power allocation algorithm was applied to establish mutual preferences. Then the Gale–Shapley algorithm was applied to match D2D users with cellular users. In [7], the analytical and exact symbol error rate (SER) expression of the D2D system by using multicarrier band limited quadrature amplitude modulation (QAM) signalling was derived. In this model, the system resources were centrally configured, and a new resource allocation algorithm for multicarrier D2D video transmission was proposed, which improved the performance of the communication system effectively. In [8], the authors analyzed the D2D communication under the full-duplex cellular network. D2D users can reuse the uplink or downlink resources of the cellular network to improve the spectral efficiency of the system. A joint resource allocation and power control scheme based on a new graph coloring was proposed, which improved the performance of the system effectively. In [9], in order to improve the utility of all D2D pairs, a learning framework based on the Markov chain with specific problems was firstly proposed. Based on the design of the local equilibrium equation of the Markov chain, the transition probability of distributed implementation was derived. Then, a novel two-stage algorithm was proposed to perform mode selection and resource allocation at each stage. In order to reduce the computational complexity of the learning framework, two kinds of resource allocation algorithms based on matching theory were proposed for different scenarios. In [10], a low-complexity heuristic algorithm had also been proposed to realize the high logarithmic sum of the average user data rates. In [11], a new adaptive subcarrier allocation scheme was designed and a novel power allocation scheme was proposed, which can provide an optimal solution with low computation complexity. In [12], a greedy heuristic algorithm and two approximate algorithms were proposed to solve maximizing the revenue of telecom operators and efficient use of frequency resource. Besides, the greedy heuristic algorithm was proposed to maximize the number of satisfied users. In [13], the authors analyzed the deployment of an unmanned aerial vehicle (UAV) as a base station to provide the wireless communications. The coverage and rate are mainly analyzed in two scenarios: a static UAV and a mobile UAV. Simulation results showed that the optimal values for the UAV altitude can lead to maximum sum rate and coverage probability. In [14], an approach and a self-organizing algorithm were proposed to solve the problem of the wireless resource allocation for wireless small cell networks. Simulation results showed that gathering socially connected users can lead to the reduction of amount of traffic. In [15], the authors presented a framework for optimizing the caching of popular content in D2D communications. The problem of the collaborative effect of a set of UEs on content offloading was formulated as a cooperative game. The simulation results showed that the proposed framework can efficiently improve system performance.

Meanwhile, some researchers adopt intelligent optimization algorithms to solve the resource allocation issue. In [16], a joint resource allocation and user matching scheme based on the genetic algorithm was proposed to minimize the intracell interference. This algorithm was used to globally search for optimal user matching solutions to maximize system throughput. In [17], a user machine scheme based on the genetic algorithm was proposed and discussed, which had optimal power allocation to achieve the multidimensional optimization. And the genetic algorithm was applied to obtain the near-optimal user matching in the whole network. In [18], because of the energy efficiency optimization target based on the system throughput insurance, rather than the traditional system throughput, the scheme based on the improved genetic algorithm was applied to solve the problem fusion and the lower complexity of the nondeterministic polynomial time. In [19], a genetic algorithm was proposed to maximize the minimum data rate achieved by D2D communication. In [20], the authors formulated the network model with stochastic geometry. Then, they combined the spectrum resource distribution with power selection and proposed a heuristic chaotic genetic algorithm, which was associated with four-color theorem to maximize the total capacity. The system capacity was improved and the complexity of the algorithm was reduced. In [21], a fully autonomous multiagent Q-learning algorithm which showed relatively fast convergence was proposed to implement the selection of the autonomous channel and power level. In [22], a simple particle swarm optimization (SPSO) algorithm was proposed for resource allocation to enhance the system capacity.

However, these papers mainly focus on the case that one CUE and one DUE pair sharing one subchannel. To take full advantage of spectrum resources, the resource allocation problem under the condition that the number of DUE pairs is far larger than that of CUEs is analyzed in this paper. In our scenario, the resource blocks are divided into two types: resource blocks for CUEs and the ones for CUEs and DUEs.

The main contributions of our work are as follows:(1)We propose a resource allocation scheme based on the genetic algorithm for D2D communications underlaying cellular networks(2)To overcome the problem that the dedicated resource is not fully shared in the genetic algorithm, an improved harmony search algorithm is proposed for resource allocation(3)We evaluate system performances in terms of capacity, the average transmission power of CUEs, and energy efficiency.

The rest of this paper is organized as follows. In Section 2, we describe our system model. In Section 3, a resource allocation scheme based on the genetic algorithm for D2D communications is proposed and analyzed. Next, an improved harmony search algorithm is proposed for resource allocation in Section 4. In Section 5, system performances in terms of capacity, the average transmission power of CUEs, and energy efficiency are simulated and discussed. Finally, the conclusion is drawn out in Section 6.

2. System Model and Problem Formulation

There are two types of user equipment (UE) in cellular networks: cellular user equipment (CUE) in the conventional cellular network and D2D user equipment (DUE). DUEs are in pairs, and a pair of DUEs includes a D2D transmitting user equipment (DTUE) and a D2D receiving user equipment (DRUE). Let us consider a single cellular network, where N CUEs and M DUE pairs coexist. We assume that all CUEs and DUEs are uniformly distributed in a cell. Because it is advantageous to use uplink resources for the D2D link, we only focus the case that the D2D links use uplink cellular resources in this paper.

2.1. Channel Allocation Mode

To guarantee the QoS of DUEs and accommodate more DUE pairs, we allocate dedicated resource blocks for DUE pairs, as shown in Figure 1. There are two kinds of resource blocks: blue colored resource blocks for CUEs and DUEs, yellow colored resource blocks for DUEs.

For example, there are four subchannels where one subchannel is dedicated for DUE pairs and other three subchannels are shared by the CUEs and DUE pairs. Meanwhile, we consider that there are 8 DUE pairs and 3 CUEs in this example. Then, we can get an initial resource allocation matrix as follows:

In this matrix, each row denotes a resource allocation scheme of 8 D2D users, and the element of every row denotes the index of the channel which is allocated to the DUE pair. For example, the first row indicates that DUE 3, DUE 4, and DUE 8 share subchannel 1, DUE 2 and DUE 7 share subchannel 2, and DUE 1 and DUE 5 share subchannel 3. At the same time, subchannel 4 is dedicated for DUE 6.

2.2. Definition of the Fitness Functions

In D2D communications, we need to get the maximum capacity. To guaranty the QoS of UEs, the signal to interference plus noise ratio (SINR) value should be greater than SINR threshold. Therefore, during the uplink period for the CUE i, the SINR can be written aswhere is the transmitting power of CUE i, is the distance between CUE i and the BS, is the transmitting power of the DTUE k, is the distance between DTUE k and BS, α is the path loss exponent, and is the noise power.

At the same time, during the uplink period for the DRUE j, the SINR can be written aswhere is the distance between DTUE j and DRUE j, is the distance between CUE m and DRUE j, is the distance between DTUE k and DRUE j, and denotes the set of the equipments which share mth subchannel.

Obviously, the total capacity consists of two parts: CUEs and DUE pairs. For CUE i, the capacity is written aswhere is the bandwidth of one subchannel.

Similarly, for DUE pairs, we consider that DUE pairs j belong to package m, i.e., . Then, we have

Therefore, the capacity function is denoted aswhere denotes some chromosome.

What is more, the average transmission power of CUEs can be written aswhere represents the threshold of SINR.

Then, the energy efficiency can be written as

3. Resource Allocation Scheme Based on Genetic Algorithm

In this section, a resource allocation scheme based on the genetic algorithm for D2D communications underlaying cellular networks is proposed. The genetic algorithm can be divided into five main steps as follows [23].

3.1. Coding

Without loss of generality, we consider that ith subchannel is allocated to CUE i. The DUEs share the channel resource with the CUEs. In this case, the chromosome can be coded as a dimensional row vector like , . Here, j is the index of the DUE pairs. The value of is the index of the subchannel which is shared by jth DUE pair.

3.2. Population Initialization

In general, the number of the populations is set as 10. In every chromosome, element is a discrete random variable which is a number between 1 and N. The probability mass function of can be written as . usually has equivalent probability for each value. And there is

3.3. Set Fitness Function

We select the formulae of the capacity, the average transmission power of CUEs, and energy efficiency as the fitness function, respectively.

3.4. Breeding Process

The population of the genetic algorithm is similar to the operation of breeding process, and we can obtain an optimal solution after multiple iterations. The breeding process can be divided into 4 steps as follows:(a)Selection

The classical roulette wheel selection scheme is adopted in our scheme. At this point, the probability that individual Ik is selected can be written as . Then, we have(b)Crossover

Every crossover action can generate two new individuals by swapping some elements between two selected parent chromosomes. A uniform crossover scheme that every element has same crossover probability P0 is adopted in our algorithm. Therefore, it is possible that several elements are simultaneously selected to implement crossover in every crossover action. The uniform crossover can actually belong to the multipoint crossover, and its specific operation is to determine how each element of a new individual is provided by which parent, by setting a mask word. The main operation process of uniform crossing is as follows:

(1)Randomly generate a mask word with the same length as the individual code string , where M is the length of the individual code string(2)Two new progeny individuals A′ and B′ are generated from two parent individuals A and B by the following rules:(i)If , the ith element of A′ will inherit the corresponding element of A, and the ith element of B′ will inherit the corresponding element of B.(ii)If , the ith element of A′ will inherit the corresponding element of B, and the ith element of B′ will inherit the corresponding element of A(c)Mutation

The uniform mutation operation is that, with a small probability P1, to replace the original element of the chromosome with a random number from 1 to N. The main operation process of uniform mutation is as follows:(1)Each element of the chromosome is specified as a mutation point with the probability P1 in sequence(2)For each mutation point, a random number is taken from 1 to N to replace the original element(d)Amendment

In each iteration, we select only the chromosomes in the population that satisfy the constraints of the objective function for each operation. Therefore, when generating a new population, we need to remove the chromosomes that do not satisfy the constraint conditions to form the offspring. For the new offspring, we rank the fitness function value of them and parent population. Then, we select the first 10 ∗ N individuals as the new population.

3.5. Stopping Criteria

After Num iterations, the population will eventually evolve to a convergence. Then, we can calculate the optimal result based on the best chromosome.

Remark 1. If the strategy that D2D users share dedicated channel resources do not exist in the initialized solution space, D2D users fail to fully share the dedicated channel resources. For example, element “4” does not exist in the last line of the matrix of Equation (1). If the optimization strategy based on the genetic algorithm is adopted, the crossover step in the evolution process is realized through the crossover between the row vector and the other row vector; that is, the individuals in the population crossover each other. If D2D users want to share the dedicated channel resources, the genetic algorithm relies mainly on the process of mutation. But the probability of variation is small, and the dedicated channel resource is not fully shared.

To overcome this problem, the harmony search algorithm uses the probability evaluated from the memory bank, and the feasible solution in the memory bank can get out of the constraint of the initialized solution space by the probabilistic optimization strategy so as to find more feasible solutions. Therefore, we propose an improved harmony search algorithm based on the conventional harmony search algorithm to enhance the system performance in terms of capacity, the average transmission power of CUEs, and energy efficiency.

4. Harmony Search Algorithm

In 2001, Geem Z. W was inspired by musical performance [24]. A novel intelligent optimization algorithm was proposed. The harmony search algorithm shows better performance in global search. The harmony search algorithm can realize beautiful harmony by constantly modifying the tone of each instrument.

4.1. Description of the Conventional Harmony Search Algorithm

The steps of the conventional harmony search algorithm are as follows: firstly, randomly generate the harmony memory (HM) space that meets the constraint condition and discriminate whether a new variable is generated from the initialized solution space according to the probability evaluated from the harmony memory bank HMCR. If the HMCR value condition is satisfied, adjust the new value slightly according to the probability of pitch tuning PAR; if the HMCR value condition is not satisfied, a new solution is generated from the solution space outside the harmony memory bank. The objective function value in the problem model is used to measure the advantages and disadvantages of the solution. The new solution with a better objective function value is used to replace the worst solution in the initialized solution space. When the continuous iteration fails to significantly optimize the objective function value, the iteration is stopped. Then, decode the coded solution space so as to obtain an optimal resource allocation strategy.

4.2. Improved Harmony Search Algorithm

Due to the organic combination of the interior and exterior of the initialized solution space of the harmony search algorithm, the diversity of feasible solutions is effectively increased, but the convergence speed is affected. In order to improve the convergence speed of the algorithm, we propose an improved harmony search algorithm for resources allocation of D2D communications. The detailed steps are as follows.

4.2.1. Initialization

Firstly, initialize each system parameter and a harmony memory bank whose size is HMS. HMS denotes the number of individuals. denotes the maximum value of the probability evaluated from the harmony memory bank. denotes the minimum value of the probability evaluated from the harmony memory bank. denotes the number of iterations, and denotes the maximum number of iterations. denotes the slight adjusting probability. denotes the minimum value of . denotes the maximum value of . and are the maximum and minimum values of the tone, respectively. a denotes the adjustment factor, and d denotes the direction adjustment factor. The initial value of these parameters are as follows: , , , , , , , , , and .

4.2.2. The Generation of New Solutions

Compare a value which is randomly generated from 0 to 1 with HMCR. If it is less than HMCR, we use the selection mechanism which is similar to the roulette, according to the ratio of the fitness of the current solution to the total fitness of the memory bank, to select a pair of solutions. Then in this pair of solutions, the one with higher fitness is selected as the new harmony variable. According to the slight adjusting probability , the tune of the corresponding position is then adjusted slightly through the slight adjusting bandwidth which is denoted as . If the adjusted tune is out of the range, the initial value is retained. If it is larger than HMCR, a random variable is generated from the solution space that is outside of the harmony memory bank.

4.2.3. The Update of Harmony Memory Bank

Repeat Step 2 to generate K new solutions so as to make full use of the accumulated information in the harmony memory bank, where K is equal to the number of rows of matrix 1. In every iteration, the values of HMCR, , and will be updated. The related formulae are as follows:

Then, we rank these new solutions and the initial solutions in the harmony memory bank according to their fitness functions and select the optimal HMS solutions as the ones in the new harmony memory bank.

4.2.4. Stopping Criteria

Usually, by iterating for MAXI generations, the harmony memory bank will eventually evolve to a convergence. Finally, we get the best solution and calculate the optimal result.

In conclusion, the proposed detailed improved harmony search algorithm (Algorithm 1) is as follows:

Input: , , , HMS, , MAXI, d, Umin, Umax, L, α
Output: we use , or as the results
(1)Step 1: initialization and coding
(2)Step 2: generate new solutions and update the harmony memory bank
(3)While <= MAXI
(4)For j = 1 : K
(5)  For i = 1 : M
(6)   If rand < HMCR then
(7)    index1 = roultte(fitness function)
(8)    index2 = roultte(fitness function)
(9)     If index1 < index2
(10)      index = index2
(11)     Else
(12)      index = index1
(13)     End
(14)     If rand < PAR
(15)      If rand < d
(16)       Newharmony(i) = HM(index, i) + bw
(17)      Else
(18)       Newharmony (i) = HM(index, i) − bw
(19)      End
(20)     Else
(21)      Newharmony (i) = HM(index, i);
(22)     End
(23)    Else
(24)     Newharmony (i) = rand(Umin, Umax)
(25)    End
(26)   End
(27)  End
(28)  rank these new solutions that satisfied the QoS of UEs
(29)  update the harmony memory bank
(30)End
(31)Step3: return the best fitness value
(32)
(33)Function index = roultte (fitness function)
(34)len = length(fitness function)
(35)Total = sum(fitness function)
(36)P = fitness function/Total
(37)randnumber = rand
(38)While randnumber == 0
(39)  randnumber = rand
(40)End
(41)For j = 1: len
(42)  randnumber = randnumber-P(j)
(43)  If randnumber < 0
(44)   index = j
(45)   return index
(46)  Break
(47)  End
(48)End
(49)End function

The flowchart of the improved harmony search algorithm is shown as Figure 2.

Remark 2. In our problem, we need to traverse all possible combination. Actually, this is a NP-hard problem which is similar to the travelling salesman problem. So it is very hard to get the global optimal solution using the traditional mathematic method. This problem can be solved using the intelligent optimization algorithms such as the genetic algorithm and the improved harmony search algorithm. But in fact, the intelligent algorithms can commonly get the suboptimal solution of the original problem. Although the global optimal solution may not be obtained, the convergence speed of the intelligent algorithms is very fast. Therefore, the intelligent optimization algorithms are very suitable to our scenario where massive UEs exist and the speed of change of channel state information is fast. Compared with the genetic algorithm, the improved harmony search algorithm can effectively balance the global searching and local searching, which can enhance the robustness and improve the performance. Based on the analysis above, the improved harmony search algorithm is adopted to solve our problem in this paper. In the genetic algorithm and the improved harmony search algorithm, the reason of ranking the solutions is to select and keep the good solutions for the next iteration. Although the global optimal solution may not be obtained by the method of ranking solutions in the intelligent algorithms, the obtained suboptimal solution is usually very close to the global optimal solution whilst keeping fast convergence speed.

5. Simulations and Discussions

In this section, we discuss some important conclusions obtained from the simulation and analyze the algorithmic complexity and overhead. In our simulation, we assume that CUEs and DTUEs follow a uniform distribution in the cell. The radius of the cell is denoted as R, and the DRUEs uniformly locate in the circle of radius L centered on the corresponding DTUEs. The simulation parameters are summarized in Table 1.

5.1. Numerical Results

We evaluate the capacity of the communication system under different resource allocation algorithms. From Figure 3, it can be seen that the performance of the random algorithm (RA) is the worst, and the performance of the exhaustive algorithm (EA) is the best. From Figures 3 and 4, compared with the genetic algorithm (GA) which has good performance in the field of D2D resource allocation, the improved harmony search algorithm (IHSA) has superior global search performance by dynamically adjusting algorithm parameters. Therefore, the improved harmony search algorithm proposed in this paper is closer to the result of the exhaustive algorithm.

Figure 5 and 6 show the average transmission power of CUEs under different algorithms and the cumulative distribution function of the average transmission power of CUEs. We can see from the figures that the improved harmony search algorithm is better than the genetic algorithm. This improved harmony search algorithm can find the better resource allocation scheme and reduce the transmission power of the cellular users effectively.

Figure 7 and 8, respectively, shows the energy efficiency of the terminals under different algorithms and the cumulative distribution function of energy efficiency. Usually, when the CUEs use the traditional power control mode, the power consumption of CUEs will be decreased as the interference decreased. Then the channel capacity will be increased, and the energy efficiency of the terminal will be improved. We can obtain from the graph that the improved harmony search algorithm has better performance of resource allocation. It can reduce the interference among the terminals of same frequency through reasonable optimization so as to improve the energy efficiency.

5.2. Algorithmic Complexity Analysis

In these algorithms, the main computational complexities are from the fitness function calculation and random function calculation. So we mainly analyze the times of running the random function and fitness function in these algorithms. For the genetic algorithm, the number of iteration is set to MAXI. For each crossover operation of the genetic algorithm, we need to run random function 1 time and fitness function Pc ∗ 2 times. For each mutation operation of the genetic algorithm, we need to run random function 1 time and fitness function Pm times. Then in each iteration, we need to run crossover operation K/2 times and mutation operation KM times. Here, K/2 means that K individuals in one population are divided to K/2 pairs. On the whole, we need to run random function K/2 + KM times and fitness function K/2 ∗ Pc ∗ 2 + KMPm times in each iteration. In the end, we need to run random function MAXI ∗ (K/2 + KM) times and fitness function MAXI ∗ (K/2 ∗ Pc ∗ 2 + KMPm) times in each algorithm process.

At the same time, we can also get the complexities of the improved harmony search algorithm, random algorithm, and exhaustive algorithm, as shown in Table 2.

5.3. Overhead Analysis

In D2D communications, the additional signalling overhead and required message passing can be measured by the number of the required pilot signals which are used to detect the channel state information. From the received SINR formulae of the CUEs and DRUEs, it can be seen that complete channel state information should be perfectly known at the receivers. During the uplink transmission, in order to calculate the received SINR of the CUEs, the state information of the channels from the CUEs to the BS and from DTUEs to the BS should be obtained. Similarly, in order to calculate the received SINR of the DRUEs, the state information of the channels from the CUEs to DRUEs and from the DTUEs of other pairs to the DRUEs should also be obtained.

For the genetic algorithm and the improved harmony search algorithm, any possible combinations may occur in each iteration. Hence, we need to get all the possible combinations of the CUEs and DUE pairs. Then in this case, the overhead can be calculated as . Here, represents the number of the channels between the DTUEs and the BS. is the number of channels between any DRUEs and the DTUEs of other pairs.

For the exhaustive algorithm, we also need to traverse all the possible solutions. The state information of the channels between any transmitters and any receivers should be obtained. So the overhead is also equal to .

For the random algorithm, we only need one combination which corresponds to one row of Equation (1). Without loss of generality, we can consider that the M DUE pairs are equally allocated to N package which corresponds to N CUEs. Then, for the DRUEs in one package, the state information of channels should be known. Meanwhile, the state information of M channels should be obtained for all CUEs. Therefore, the overhead can be written as in the random algorithm.

6. Conclusions

In this paper, the resource allocation problem for D2D communication is formulated and discussed. In our scenario, we consider that the number of D2D user equipment (DUE) pairs is far larger than that of cellular user equipments (CUEs) and the resource blocks are divided into two types. Then a resource allocation scheme based on the genetic algorithm is proposed. To improve system performance, an improved harmony search algorithm is proposed for resource allocation. Finally, the analysis and simulation results show that the performances of the proposed genetic algorithm and the improved harmony search algorithm outperform that of the random algorithm and are very close to that of the exhaustive algorithm. This result can be applied for design and optimization of D2D communications.

Data Availability

The source data used to support the findings of this study are included within the article. Additionally, the source data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Acknowledgments

This work was supported in part by the Fundamental Research Funds for the Central Universities (No. 2017B14214), Six Talent Peaks Project in Jiangsu (DZXX-008), and National Natural Science Foundation of China (Nos. 51669014, 61601283, and 61301110).