Resource Allocation Schemes Based on Intelligent Optimization Algorithms for D 2 D Communications Underlaying Cellular Networks

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. -en, 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. -is result can provide an effective optimization for resource allocation of D2D communications.


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.erefore, 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.en, 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.
e 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 decisionmaking 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.en, 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.en 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.en, 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.e 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.e problem of the collaborative effect of a set of UEs on content offloading was formulated as a cooperative game.e 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.
is 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.en, they combined the spectrum resource distribution with power selection and proposed a heuristic chaotic genetic algorithm, which was associated with fourcolor theorem to maximize the total capacity.e 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.
e 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.
e 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.

System Model and Problem Formulation
ere are two types of user equipment (UE) in cellular networks: cellular user equipment (CUE) in the conventional cellular network and D2D user equipment (DUE).

Mobile Information Systems
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.

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.
ere 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.en, 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.

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.erefore, during the uplink period for the CUE i, the SINR can be written as where P i is the transmitting power of CUE i, r i is the distance between CUE i and the BS, P T is the transmitting power of the DTUE k, d k is the distance between DTUE k and BS, α is the path loss exponent, and N 0 is the noise power.At the same time, during the uplink period for the DRUE j, the SINR can be written as where l j is the distance between DTUE j and DRUE j, d m,j is the distance between CUE m and DRUE j, d k,j is the distance between DTUE k and DRUE j, and R m 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 as where B is the bandwidth of one subchannel.
Similarly, for DUE pairs, we consider that DUE pairs j belong to package m, i.e., j ∈ R m .en, we have erefore, the capacity function is denoted as where U x denotes some chromosome.What is more, the average transmission power of CUEs P average can be written as where τ represents the threshold of SINR.en, the energy efficiency EE can be written as

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.e 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. e 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.e value of g j is the index of the subchannel which is shared by jth DUE pair.

Population Initialization.
In general, the number of the populations is set as 10.In every chromosome, element g j is a discrete random variable which is a number between 1 and

Resource blocks
Resource blocks for CUEs Resource blocks for DUEs

Mobile Information Systems
N. e probability mass function of g j can be written as p(a) � P g j � a  .g j 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.

Breeding Process.
e population of the genetic algorithm is similar to the operation of breeding process, and we can obtain an optimal solution after multiple iterations.e breeding process can be divided into 4 steps as follows: (a) Selection e classical roulette wheel selection scheme is adopted in our scheme.At this point, the probability that individual I k is selected can be written as p(I k ).en, we have 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 P 0 is adopted in our algorithm.erefore, it is possible that several elements are simultaneously selected to implement crossover in every crossover action.e 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.e main operation process of uniform crossing is as follows: (1) Randomly generate a mask word with the same length as the individual code string ω � e uniform mutation operation is that, with a small probability P 1 , to replace the original element of the chromosome with a random number from 1 to N. e main operation process of uniform mutation is as follows: (1) Each element of the chromosome is specified as a mutation point with the probability P 1 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.
erefore, 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.en, we select the first 10 * N individuals as the new population.

Stopping Criteria.
After Num iterations, the population will eventually evolve to a convergence.en, 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.
erefore, 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.

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

Description of the Conventional Harmony Search
Algorithm.
e 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.e objective function value in the problem model is used to measure the advantages and disadvantages of the solution.e 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.en, decode the coded solution space so as to obtain an optimal resource allocation strategy.

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.e detailed steps are as follows.

Initialization.
Firstly, initialize each system parameter and a harmony memory bank whose size is HMS.HMS denotes the number of individuals.HMCR max denotes the maximum value of the probability evaluated from the harmony memory bank.HMCR min denotes the minimum value of the probability evaluated from the harmony memory bank.g n denotes the number of iterations, and MAXI denotes the maximum number of iterations.PAR denotes the slight adjusting probability.PAR min denotes the minimum value of PAR.PAR max denotes the maximum value of PAR.U max and U min are the maximum and minimum values of the tone, respectively.a denotes the adjustment factor, and d denotes the direction adjustment factor.

e 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.en in this pair of solutions, the one with higher fitness is selected as the new harmony variable.According to the slight adjusting probability PAR, the tune of the corresponding position is then adjusted slightly through the slight adjusting bandwidth which is denoted as bw.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.

e 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, PAR, and bw will be updated.
e related formulae are as follows: en, 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.

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: e 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.
is 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.erefore, 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.

Simulations and Discussions
In this section, we discuss some important conclusions obtained from the simulation and analyze the algorithmic Mobile Information Systems complexity and overhead.In our simulation, we assume that CUEs and DTUEs follow a uniform distribution in the cell.
e radius of the cell is denoted as R, and the DRUEs uniformly locate in the circle of radius L centered on the corresponding DTUEs.
e simulation parameters are summarized in Table 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 eld of D2D resource allocation, the improved harmony search algorithm (IHSA) has superior global search performance by dynamically adjusting algorithm parameters.
erefore, 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 di erent algorithms and the cumulative distribution function of the average transmission power of CUEs.We can see from the gures that the improved harmony search algorithm is better than the genetic algorithm.is improved harmony search algorithm can nd the better resource allocation scheme and reduce the transmission power of the cellular users e ectively.

Mobile Information Systems
when the CUEs use the traditional power control mode, the power consumption of CUEs will be decreased as the interference decreased.
en 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.

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 P c * 2 times.For each mutation operation of the genetic algorithm, we need to run random function 1 time and fitness function P m times.
en in each iteration, we need to run crossover operation K/2 times and mutation operation K * M 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 + K * M times and fitness function K/2 * P c * 2 + K * M * P m times in each iteration.In the end, we need to run random function MAXI * (K/2 + K * M) times and fitness function MAXI * (K/2 * P c * 2 + K * M * P m ) 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.

8
Mobile Information Systems 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.en in this case, the overhead can be calculated as M + 2 × C 2 M .Here, M represents the number of the channels between the DTUEs and the BS. 2 × C 2 M 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.e state information of the channels between any transmitters and any receivers should be obtained.So the overhead is also equal to M + 2 × C 2 M .
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.en, for the DRUEs in one package, the state information of 2 × C 2 M/N channels should be known.Meanwhile, the state information of M channels should be obtained for all CUEs.
erefore, the overhead can be written as M + 2 × N × C 2 M/N in the random algorithm.

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.en 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.is result can be applied for design and optimization of D2D communications.

Data Availability
e 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.Mobile Information Systems 9

Figure 1 :
Figure 1: Resource blocks for CUEs and DUEs.
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 ω i � 0, 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 ω i � 1, 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

Figure 7 Figure 2 :
Figure 2: e owchart of the improved harmony search algorithm.

Figure 8 :
Figure 8: e CDF of the energy efficiency.