Resource Allocation Strategy for D2D-Assisted Edge Computing System Using Weighted Genetic and Ant Colony Optimization Algorithms

Due to the constrained battery ability and computing functionality of cellular customers, the Resource allocation approach in D2D-assisted edge computing system with hybrid electricity harvesting is investigated on this document. By using magnetic induction-primarily based on wireless reverse charging technology, cellular consumer can complement more electricity from nearby users whilst the electricity gathered from the surrounding radio frequency is set to be exhausted. Due to the constrained computing resource of MEC server the MEC server reaches the limit of its computing capability the adjacent Base station’s user can act as a relay node and by setting up the D2D relay links the computing responsibilities of the users which are left under previous base station can now be transferred to new base station’s MEC server which has enough resources. The goal of the resource allocation approach is to improvise the energy efficiency under computation delay constraint and energy harvesting constraints. An optimal answer is produced by adopting the Quantum behaved Particle Swarm Optimization (QPSO) algorithm, weighted genetic algorithm (WGA/GA) and Ant-colony optimization (ACO) algorithm, Simulation outcomes display that overall performance of the approach that is proposed is superior than different benchmark strategies, and weighted genetic algorithm (WGA), Ant-colony optimization (ACO) algorithm can attain better energy efficiency than the quantum behaved particle swarm optimization and standard particle swarm optimization algorithm also Simulation studies shows that the self-learning nature of these methods(i.e WGA and ACO) gives better results even for higher complexity problems.


INTRODUCTION
To provide Smart mobile devices with energy we use Radio Frequency energy harvesting and this type of energy harvesting is rising technology. The limited computing capability [1] and battery charge capability [2,3] are shortcomings of Smart Mobile Devices. The service of SMD's are stopped when the battery charge is exhausted. For the conventional equipment which is powered by battery, this can possibly be triumphed over with the aid of charging battery regularly or large battery capacity. However, the usage of large battery is inconvenient to carry and large battery capacity usage is not a viable option because the price of hardware increases. Furthermore, charging constantly is not very good experience to the user [4]. To remedy above issues SMDs can continuously harvest power from the electromagnetic waves received. A hybrid energy harvesting method is proposed in which Radio Frequency energy harvesting [5] is done by the process that is based on Magnetic induction wireless power transfer. This method of power transfer is proposed to supply power for Smart Mobile Devices. By using Magnetic Induction-based wireless energy transfer technology, when the Smart Mobile Devices are about to depleted of the power that is harvested from surrounding Radio Frequency sources the Smart Mobile Devices can get energy from a nearby source other Smart Mobile Devices. By applying partialIoffloadingImethod, computingItasks are splitIinto 3 parts for computation: local computation, another part is off-loaded through establishing D2D communication links to nearby SMDs for auxiliary computation. The remaining part is offloaded to Mobile Edge ComputingIserverIfor EC [6]. Furthermore, if SMD under 1 st base station reaches its limit of MEC server for serving, then the remaining SMD's can offload their tasks at another base station in which that part of new base station's SMD act as a relay node. The remaining tasks of previous base station can now be transferred to new base station's MEC server which is nearby and also the new base stations MEC server has enough resources to perform EC. A RA (resource allocation) strategy is proposed to improvise the energy efficiency under the constraints of energy harvesting [7]. A Weighted Genetic algorithm (WGA) and ACO algorithm is used to find the best solution to MINLP problem which is formulated. By making use of mobile edge computing technology the power consumption is reduced exponentially and by the well-designed resource allocation strategy the harvested energy maybe used optimally. Therefore, it's of tremendous importance to study the resource allocation strategy which is blended with MEC technology. In Fig.1.1, we can see the D2D communication scenario presently under consideration. Allocating resources to the D2D lines is the responsibility of the operator's base station.
we strive to improve/maximize the efficiency and examine the problem of D2D resource allocation in 5G networks. The proposed scheme exploits the ACO theory and WGA theory as a way to assure multiple concurrent D2D transmissions with high efficiency. Genetic algorithms is the most stochastic technique for optimization that has been mentioned in [8]. GA considers a set of answers known as populace/population and finds the closest optimal answer with help of a fitness function and a highquality solution is obtained with minimum interference and secondary customers are allotted accordingly. The preceding paper is as follows. In section II we discuss Related works. In section III, we discuss the system model and problem formulation for ACO and Weighted Genetic algorithm. In section IV, we propose our Algorithm. In section V, the performance analysis and result has been discussed and in last section, we draw the attention over conclusion.

RELATED WORKS
D2D communication gathered much interest because of its cellular resource's reusability. There are many researches that have been suggested for resource allocation. D2D communication helps in increasing the efficiency and throughput.
"Considering the issue of resource sharing in D2D communication, the main goal of this research work is to improve the utility function and letting the users decide the transmission power over available resource blocks" [9].
"The proposed method in reference [10] (i.e. genetic algorithm approach) is a fast and more reasonable way to converge than an exhaustive search method, this method requires up to factorial time complexity and the proposed approach quickly improves the total throughput of all the paired devices which also include Cellular user equipment's and moving vehicles" "Device-to-Device communication has been recently devised as a new model which boosts spectrum reuse inside a cell, improved user experience and improved quality in service. We introduce a D2D resource allocation scheme based on the Ant Colony Optimization theory. ACO is utilized towards D2D links in which interference is isolated so, that we can share the same resources" [11].
"Mobile edge computation and NOMA technologies are most prominent and rising technologies in the field of D2D.These technologies are introduced to resolve the issue of computation intensive applications and since the computing resources in edge server are limited so we need to alleviate the computing load" [12].
"When there are 2 devices in close proximity, the network can not only assist them in determining the proper scheduling time and transmit power and resources for frequency, but also determining whether communication should take place through a direct D2D link (D2D mode) or through a cellular base station (cellular mode)." [13] "To increase the performance of device-to-device (D2D) communications as an underlay in downlink (DL) cellular networks, a novel resource allocation methodology is presented. We offer a sequential second price auction as the allocation method to improve the system total rate over resource sharing in both D2D and cellular modes." [14] In this section, the network structure of D2D-assisted edge computing system is presented. Then, the Existing model along with Proposed System model is given.

Structure of Network:
As shown in the below Fig. 2.1, we consider several cellular users and 2 base stations with a D2Dassisted edge computing system. Mobile Edge Computing server is established near the Base Station. For improving the performance of complete communication system, local computation is excluded, mobile users for edge computation can offload their computing tasks to the MEC server, or by establishing D2D communication link they can offload to close by user for auxiliary computation. In D2D communication cellular users are still under the command of Base Station [15,16]. However, Certain amount of Energy consumption of battery is still done by offloading computing tasks. On account of constrained battery capability of cellular users, When the user is offloading a computation task and is about to run out off battery charge the user can get a extra energy by Magnetic induction based reverse charging from nearby users to avoid interruption. We call these cellular users as common users (CU) and call these nearby users as common auxiliary users (CAU). When common user perform computation the idle users who are nearby can assist common user for Auxiliary computation and idle users in above context are called CAU's and such computation is called auxiliary computation, let's say I + S users are in need to offload their computation task at Mobile Edge Computing server for EC under BS 1. As MEC server have limited number of resources, under BS 1, the Mobile Edge Computing server holds 'I' users who offload their computing activities for EC. i.e. When the computing capacity has reached maximum users under base station 1 the remaining S users are unable to perform their offloading of their computing task for EC. The number of computing resources under base station 2 that are of mobile edge computing server are sufficient, because compared to base station 1 the users are quite low at base station 2. Therefore, these extra S users under Base Station 1 can utilize Base Station 2 as a relay node, and by initiating D2D relay link these S users can perform edge computation under base station 2. We call this abutting user as relay user (RU). S users are also known as transfer users (TU). Moreover, TU's can offload their computation task to a user close by for auxiliary computation and can also perform local computation. These are what we refer to as neighboring users as transfer auxiliary users (TAU) [17].

Proposed System Model:
A suboptimal answer is obtained by adopting the QPSO algorithm, weighted genetic algorithm (WGA) and ACO algorithm, Simulation outcomes display that the overall performance of the proposed approach is better than different standard strategies.

Ant Colony Optimization
This algorithm mainly focuses on finding the optimal path just like how ants find an efficient route [18] i.e say, There are 2 ants which come to take the food to their cave and there are 2 paths one is longer than the other path and when 2 ants come to this intersection of the paths the probability of the paths is 50% first path and 50% second path and as we all know that ants leave a pheromone when they are travelling. Since the first path is shorter and the first ant will come to the food source and return back to it's cave and the ant takes the first path because the pheromone only exist in first path(100% probability) so when the second ant reaches the food source and returns back to the cave now the second ant picks the first path because there is more pheromone(in computer terminology weight) and hence the ants found the optimal or efficient path. This is how ACO works. Every ant, to move through the graph needs to construct solution to represent this edge selection in mathematical terms we can represent it in form of Eq -3.1

Equation -3.1 The mathematical representation of edge selection
In the above equation in Eq -3.1 τxy is the amount of pheromone deposited from state x to y, α is a parameter to control the influence of τxy or Pheromone exponential weight ηxy is the desirability of state transition and β is a parameter which controls the influence of ηxy.

Equation -3.2 The mathematical representation of Pheromone update
In the above equation in Eq -3.2 τxy is the amount of pheromone deposited from state x to y, ρ is evaporation rate, m is the population size and ∆τxy is the amount of pheromone deposited by kth ant

Weighted genetic algorithm
Genetic algorithms are a subgroup of evolutionary algorithms or evolutionary computing and they are used in self-learning machine learning algorithms and AI. They use the concept of natural selection to simulate the survival of the fittest and natural selection inside your computer [19]. The genetic algorithm is a impersonates biological evolution process to get the most optimal approach. At first, we select the random chromosomes based on the fitness function range and produce offspring based on the firstgeneration chromosomes by applying single point crossover. A point is selected from both parents and the genes are exchanged beyond the point and the child chromosomes are produced but in this process the cross-section is selected randomly so we may miss our best solution so to solve this issue we can go with elitism it simply means we select n-top solutions and copy them to our next generation and next we use mutation which means we discover new solutions that aren't otherwise possible before and over successive generations, the population "evolves" closer to a highest quality solution. We can rectify problems which aren't suitable for normal optimization algorithm by applying genetic algorithm. We can see single point and two-point crossover in FIG -3.3 and FIG -3.4 and the fitness function we used in the project is x^2

QPSO -Quantum behaved particle swarm optimization
QPSO is inspired by the theory of particle swarm optimization (PSO) and quantum mechanics and is a probabilistic optimization algorithm. In QPSO, the particle is rendered by Schrodinger wave equation [20] i.e. | ψ (x, t) | 2 , in lieu of position and velocity in PSO. In the above wave function 'x' represents position, 't' represents time and 'ψ' represents probability density. In this paper, WGA, ACO and QPSO algorithm is adopted to find the solution for the MINLP problem. First step is to transform original constrained optimization problem to unconstrained optimization problem by using the penalty function method. Therefore, a fitness function that is composed of one objective function and one penalty function is constructed as

Problem Formulation:
In this following section, Analyzing the particular resource allocation strategy is selected and optimization of model is given first and then optimal solution is obtained by using ACO algorithm QPSO and WGA algorithms.
The formulation of problem is as follows. As mentioned earlier, Cw is the number of CPU cycles that user 'w' requires to perform 1-bit computation data and Mobile users are classified as Cellular User and Transfer User under Base Station 1 and we currently formulate our problem which is concentrated on improving efficiency.

PROPOSED APPROACH
The approaches we proposed are Genetic algorithm, Ant colony optimization and both the algorithms are of evolutionary type and the main drawback of these both algorithms are the selecting the routes for ACO and initial population for WGA is of random and by this we can get the best solution at first generation itself or we may not be able to get best solution on the first iteration and the main advantage of these algorithms are their less time complexity.

Algorithm -1 ResourceIAllocationIStrategyIof MaximizingIthe Energy Efficiency Based on
Weighted genetic algorithm.
1. The initial chromosomal population is created.

Comparison of Performances
In this following subsection, the outcomes of the results are analyzed to assess the recommended algorithms performance. In the simulation we have taken 5 different strategies to analyze the performance of our algorithms and the 5 strategies are as follows: 1) Local-Edge-Auxiliary-Transfer (LEAT) represents that the computation is carried out by local, edge and auxiliary computation and then transfers it to neighboring Mobile Edge Computation server for edge computation.  Consecutively, we can see that the efficiency increases with increase in number of particles, and the rising tendency is not great between particles 20 and 30 and the reason being is that the solution is reaching the optimal state and can get the optimal solution by searching for more particles Therefore, we determine the number of particle to 30 as well as the number of iteration to 600

FIG -5.1
Fig . 5.2 shows the graphical representation between the energy efficiency and bandwidth size under the 5 different strategies. In first four strategies the efficiency goes up as the Bandwidth increases and while Local-Only strategy is constant. The reason is that throughput increase while size of bandwidth increase. And therefore, duration of transmission of computation data is reduced slowly. So, as a result, mobile users energy consumption for edgeIcomputation and auxiliaryIcomputation is reduced.

FIG -5.2
In Fig. 5. 3 It is clear that the energy efficiency of the Local-edge-auxiliary-transfer (LEAT), Local-edgeauxiliary (LEA), Local-edge (LE) decrease with the increase in the power consumption. The reason being higher the energy required by Mobile Edge Computing server to perform offloaded bit data the greater the total energy required for edge computation. Also, Variations in energy usage have no effect on the LA and LO techniques. per offloaded bit because they don't offload computing task to Mobile Edge Computing Server for EC.

Fig. 5.4
It can be seen that energy efficiency rises as the number of transfer users rises, which is due to the fact that the total energy consumption of transfer users is lower when compared to the amount of computation data. Moreover, we can also observe the reduction of efficiency as we increase conversion coefficient(ϕ) from ϕ = 0.1 to ϕ = 0.3 and the reason is that the larger the conversion coefficient the bigger the computation result and also more energy is consumed when the transmission time is greater. shows the graphical representation of Best cost vs No of iterations and as we can see that the graph is decreasing as number of iterations increases and that is because by each iteration the probability of taking the worst path reduces and probability of taking best path increases and due to that the best cost also decreases and with minimum cost we can achieve maximum efficiency and in this scenario after iteration 4 we have achieved our best cost i.e 2985. -5.6 shows the graph between Fitness of the best gene and Generation and as we can see that our fitness is constant till generation 5 but we can see an exponential growth in fitness from generation 5 and that is because the genetic algorithm is an evolution type algorithm and probability of finding best solution increases as the no of generation increases and in some cases the best gene can be found in first generation itself and that is random because the first generation gene are always random.

CONCLUSIONS
In this paper, Targeting the constrained battery and computing capability of QPSO algorithm against an evolutionary type algorithm such as "Weighted Genetic algorithm and Ant colony optimization algorithm" If the computing resources have been saturated which are under Mobile Edge Computing server, D2D relay links can be established with RU for remaining users and to carry their computing tasks to nearby Mobile Edge Computing server for edge computation with enough resources under Base Station. The resource allocation problem is presented as an MINLP issue. The Weighted Genetic algorithm and Ant Colony Optimization algorithm are endorsed to get the optimal solution. Simulation outputs have conveyed that the proposed approach is exponentially better in comparison to other techniques, and QPSO algorithm. These algorithms can achieve a better level of energy efficiency than Stochastic Particle Swarm Optimization algorithm, QPSO algorithm. Also, our Weighted genetic algorithm gave 8.52% better results than QPSO, also ACO gave 4.25% better results than QPSO.
Declaration statement: We wish to confirm that there are no known conflicts of interest associated with this publication and there has been no significant financial support for this work that could have influenced its outcome.

Funding: Not applicable
Conflicts of interest/Competing interests: "The author(s) declare(s) that they have no competing interests"

Availability of data and material: Not applicable
Code availability: Not applicable