Efﬁcient Computation Ofﬂoading in Multi-Tier Multi-Access Edge Computing Systems: A Particle Swarm Optimization Approach

: In recent years, multi-access edge computing (MEC) has become a promising technology used in 5G networks based on its ability to ofﬂoad computational tasks from mobile devices (MDs) to edge servers in order to address MD-speciﬁc limitations. Despite considerable research on computation ofﬂoading in 5G networks, this activity in multi-tier multi-MEC server systems continues to attract attention. Here, we investigated a two-tier computation-ofﬂoading strategy for multi-user multi-MEC servers in heterogeneous networks. For this scenario, we formulated a joint resource-allocation and computation-ofﬂoading decision strategy to minimize the total computing overhead of MDs, including completion time and energy consumption. The optimization problem was formulated as a mixed-integer nonlinear program problem of NP-hard complexity. Under complex optimization and various application constraints, we divided the original problem into two subproblems: decisions of resource allocation and computation ofﬂoading. We developed an efﬁcient, low-complexity algorithm using particle swarm optimization capable of high-quality solutions and guaranteed convergence, with a high-level heuristic (i.e., meta-heuristic) that performed well at solving a challenging optimization problem. Simulation results indicated that the proposed algorithm signiﬁcantly reduced the total computing overhead of MDs relative to several baseline methods while guaranteeing to converge to stable solutions.


Introduction
With the tremendous growth of the Internet of Things (IoTs), massive amounts of mobile devices (MDs), such as smart devices and virtual reality (VR) glasses, connect to networks and generate large amounts of data on communications networks.Moreover, many new IoT applications, such as smart healthcare, surveillance, real-time online gaming, and augmented/VR, require increased energy efficiency and higher computing capacity [1,2]; however, MDs often have limited computing power and low-capacity batteries, with these limitations representing obstacles for the network deployment and the emergence of new applications and services.
To address this, multi-access edge computing (MEC) represents a promising solution for enhancing the computing capabilities and limited battery power of MDs.Computation offloading to MEC servers allows them to process the computational tasks of MDs at the edge of mobile cellular networks through wireless links, which addresses latency problems between cloud servers and MDs, as well as MD-specific limitations in computational power and storage.MEC brings cloud resources (e.g., MEC servers) to the network edges, thereby enabling heavy computing tasks to be performed close to the end user [2][3][4][5].However, due to the resource limitation of the MEC server, computation offloading remains challenging.In particular, the rapid increase in compute-intensive tasks (such as face recognition, augmented reality, and autonomous driving) from devices will cause server resource bottlenecks of the MEC server and significantly affect task execution latency.Therefore, offloading calculation strategies and resource allocation optimization (e.g., computing resources at MEC server and transmit power) are needed to improve the performance of computation offloading.
Exponential increases in data traffic have been addressed through the use of heterogeneous networks (HetNets) comprising homogeneous cell macro-base stations (MBSs) with high transmission power overlaid onto low-power small cell base stations (SBSs) (e.g., femto-cells, pico-cells, and micro-cells) to meet data-rate requirements for next-generation networks [6][7][8].Therefore, integrating MEC into 5G networks in order to increase network performance, to reduce MD-related power consumption, and to utilize macro and small cells represents a research interest in academia and industry.Recent studies have focused on computation offloading in 5G networks [5], with other research focusing on single-tier MEC servers used in heterogeneous scenarios [9][10][11][12][13][14][15][16]; however, achieving effective offloading decisions related to computation-completion time and energy consumption in a multi-tier MEC server remains an optimization problem that attracts considerable attention [17][18][19][20].Moreover, there have been several MEC-related studies associated with its use in vehicular networks [21][22][23][24] and video processing [25,26].
In Reference [7], we proposed a two-tier computation-offloading framework for multi-user multi-server MEC in 5G HetNets.Different from our previous work that only focused on optimizing the offloading decisions to minimize energy consumption, in this paper, we considered a joint resource allocation and computation-offloading problem, aiming at minimizing the total computing overhead of MDs, including completion time and energy consumption.Using complex optimization techniques and various application constraints, we developed an efficient and low-complexity algorithm capable of high-quality solutions with guaranteed convergence.We found that a high-level heuristic (i.e., meta-heuristic) achieved satisfactory performance in solving a challenging optimization problem using particle swarm optimization (PSO) [27,28].Our main contributions include the following:

•
We investigated a two-tier computation-offloading strategy using multi-user multi-server MEC in 5G HetNets.

•
We addressed joint resource allocation and computation-offloading decisions in order to minimize the total computing overhead of MDs, including completion time and energy consumption.
The optimization problem was formulated as a mixed-integer nonlinear program (MINLP) problem of NP-hard complexity based on the inclusion of both continuous (resource allocation) and discrete (offloading decision) variables.This problem is highly complex and difficult to solve optimally in polynomial time.To address this, we divided the original problem into two subproblems: computational resource allocation and computation-offloading decisions.

•
We developed an algorithm using a meta-heuristic based on PSO to solve the optimization problem.PSO can solve large-scale NP problems with polynomial time complexity while ensuring convergence within specified limits [27][28][29].

•
Numerical simulations showed that the proposed algorithm achieved outstanding performance in terms of total computing overhead relative to several baseline schemes as well as guaranteeing the convergence of our solution.
The remainder of the manuscript is structured as follows.In Section 2, we review relevant literature.In Section 3, we describe a model two-tier computation-offloading system in a multi-user multi-server MEC in a 5G HetNet.In Section 4, we formulate the problem to minimize the total computing overhead of MDs, including completion time and energy consumption.Our proposed PSO-based algorithm is presented in Section 5, and the numerical simulations are described in Section 6.The conclusion is presented in Section 7.

Related Work
There have been numerous studies addressing offloading decisions in MEC systems, with most focusing on computation offloading from multiple users in a single-or multi-server MEC.Multi-user single-server MEC architectures involve a single MEC server integrated into an MBS or SBS.We further classify existing research as addressing either single-tier [9][10][11][12] or multi-tier [13][14][15][16] offloading of a computational task.Chen et al. [9] used a game-theoretic approach to solve the problem of computing overhead, including completion time and energy consumption, whereas another study [10] used system utility as a quality of experience measurement based on device power consumption and completion time and solved the optimization problem by jointly addressing computational resources and offloading decisions.Hao et al. [11] studied offloading and task caching to minimize the power consumption of user equipments, and another study [12] used the same scenario, given that MEC servers are only attached to one wireless access station.In Reference [12], the authors used Karush-Kuhn-Tucker (KKT) conditions to solve the problem of optimizing MD energy consumption.Moreover, there were similar studies in single MEC server such as References [30][31][32][33].For multi-tier offloading of computational tasks [13][14][15][16], there can be one or more SBSs overlaid by an MSB, with the SBSs connected to the MBS by a wireless or wired network.In this system, only MBS is integrated with the MEC servers.Zhang et al. [13] investigated energy-efficient computation offloading in 5G HetNets comprising one MBS and one SBS by deploying an optimization problem to minimize the power consumption of the system while meeting latency limitations.The computing and communication demands on SBSs are smaller than those on an MBS.A previous study [14] optimized wireless backhaul bandwidth using resource allocation and computation-offloading decisions in order to minimize system computing overhead.Moreover, other studies [15,16] considered a HetNet scenario created by multiple small cells and one macro cell, with Wang et al. [15] assuming that each SBS was only connected with one user and proposing optimization of time and energy consumption in order to complete the computational tasks by combining offloading decisions, interference management, and resource allocation.Zhang et al. [16] proposed an algorithmic trade-off between energy consumption and completion time by combining offloading decisions and computational resource allocation in MDs.In these cases, installing a MEC at the MBS could save monetary costs but could potentially increase latency.Additionally, an IoT system involves a large number of computation-intensive tasks that can lead to resource bottlenecks at the single MEC server.
In the case of multi-user multi-server MEC architectures, most studies focus on offloading onto single-tier multi-server MEC architectures [34][35][36][37][38][39][40].In SBS and MBS systems equipped with MEC servers, the SBS and MBS work independently and considered equally important (the SBS is not connected to the MBS), enabling MDs to choose either the SBS or MBS for offload.A previous study [34] investigated use of a matching game to solve the optimization problem for total computing overhead, including energy consumption and completion time, by combining resource allocation and offloading decisions, and Tuyen et al. [35] maximized the system-offloading utility by combining the computation-offloading decision and resource allocation.Chen et al. [36] proposed a creative framework for computational task offloading to a MEC server in a software-defined ultra-dense network by optimizing the completion time of the computational tasks through their execution locally and on the edge cloud.Guo et al. [37,38] investigated offloading tasks in ultra-dense networks with multiple SBSs and one MBS.In one study [37], the authors developed a game-theoretic algorithm to solve the optimization problem for overall computing overhead considering various types of computational tasks through computation-offloading decisions, whereas in the other study [38], they optimized the overall cost of the computing overhead according to power consumption and completion time by combining the optimal offloading decision and resource allocation (CPU cycles and power transmission) by MDs.Qui et al. [39] studied task offloading to a MEC server in order to extend resource capacity by hiring resources from cloud computing resources and vehicular nodes in order to minimize the total computing overhead, including latency and monetary cost, of using computer resources.Yang et al. [40] considered a two-tier small cell network comprising a set of relay base stations connected to a set of micro-base stations, where only the micro-base stations are integrated with the MEC servers in order to perform computational tasks from the user.In that study, they used an artificial fish swarm algorithm to optimize the overall energy consumption of the system according to computation-offloading decisions.Ateya et al. [41] investigated two levels of offloading decision between two micro-cloud units to achieve high energy efficiency while satisfied with latency.Wan et al. [42] studied computation offloading strategies for the applications in vehicles using edge node considering offloading cost, offloading latency, and load balancing between edge nodes.Lee et al. [17] proposed a hierarchical MEC architecture, with MEC servers arranged according to different processing performances configured by the network operator in order to increase network performance.In that scenario, MDs that request different actions are handled by different levels of MEC servers.A previous study [18] introduced a hybrid wireless network (FiWi) to provide support between cloud computing and MEC but only considered MDs connected to a wireless base station and applied a game-theoretic approach to optimize power consumption by user equipment.Liu et al. [19] optimized IoT power consumption by IoT sensors in a system model that included a MEC server and a remote cloud server by addressing inter-task dependency and the completion time of an IoT service.However, these studies only considered multi-tier architectures that included cloud computing and one MEC.Computation offloading in such multi-tier multi-server architectures is more difficult.In the present study, we considered multi-tier multi-server MEC systems for 5G HetNets and proposed an efficient, low-complexity algorithm to obtain optimal solutions.

Scenario Description
We considered multi-access edge computing in 5G HetNet comprising a set of SBSs connected to one MBS (Figure 1).MDs with limited computational capacity are randomly situated, thereby allowing them to directly connect to the SBSs in order to offload their computational task(s), with the SBSs connected to the MBS through fiber-optic links [13,16].The SBSs and the MBS are integrated with MEC servers that can service the computational task(s) of the MDs.We defined the MEC servers co-located with the MBS and the SBSs as mMECs and sMECs, respectively.In this scenario, the MDs connect to the SBSs, which enable latency reduction and increases data rates.For this reason, we did not consider the MDs directly connected to the MBS [16].We assume that the computing capability of MEC server attached to the SBS is limited and, so, when receiving many task offloading requests, may become overloaded; therefore, the computational task of MD can first be offloaded to the sMEC, but in the event that the computation resource is exhausted, the computational task will be offloaded to the mMEC, where powerful computing resources are available [38].
We denote the set of MDs as M = {1, 2, . . ., M} and the set of SBSs as N = {1, 2, . . ., N}.Each MD has a computing-intensive task to be accomplished, and here, we assume that each MD has one task, which is subsequently executed on either the MD, sMEC, or mMEC.Each MD can offload to an sMEC via wireless links or continue offloading to the mMEC via fiber-optic links.The computational task of each MD is atomic and cannot be divided.The computational task of each MD is represented as , where D m is the data size of the computational task to be distributed to the edge cloud for computation and C m is the total number of computational requirements required to complete the computational task, as measured in CPU cycles.

Communication Model
The computational task of an MD can either be performed on the local MD or offloaded to the MEC server.Therefore, we show the communication model when the computational task is offloaded to sMEC through a wireless link or continues offloading to the mMEC via fiber-optic links.In this study, we used orthogonal frequency division multiple access for communication between MDs and SBSs.To reuse the spectrum, we assumed that the spectrum is used in an overlaid manner.The transmission rate of the computational task I m from the MD m to the SBS n through the wireless channel is expressed as follows: where W is the channel bandwidth, p m is the fixed transmit power of the MD m, h mn is the channel gain between the MD m and the SBS n, n 0 is the noise power, and Q mn is the inter-cell interference.

Local Execution Model
We introduce the local execution model in terms of energy consumption and completion time.We can obtain the local completion time for MD m for accomplishing task I m as where f l m is the local computing capability of the MD m.Let α denote a coefficient associated with the chip architecture [34].Additionally, the energy consumption E l m of the MD m when the task I m is computed locally as follows: (3)

Computation-Offloading Model
This section presents the model for computational task offloading.The computational task can be offloaded to the SBS for execution at the sMEC through a wireless link or to the MBS (from SBS to MBS) for execution at the mMEC via fiber-optic links.Therefore, we classified this activity into two schemes for computational task offloading: (1) through the sMEC or (2) through the mMEC.Here, the total energy consumption for completing the computational task comprises the energy consumption for the uploading transmission, for task performance on the MEC servers, and for returning the output data.In this study, we regarded optimization from the user perspective; therefore, we ignored the energy consumption associated with execution on the MEC server and only considered that required for the upload transmission [16].This assumption is reasonable because it has been used by existing studies [16,35,36] and allows that the MEC server is usually operated using electricity supplied from the grid.Moreover, the power required to transmit the result back to the MD is small compared with that required from transmission of the original computational task [18,34,38].

sMEC Offloading
For offloading to a sMEC, the completion time T sbs mn of task I m comprises two aspects: transmission time T t mn and remote computation time T es mn .Transmission time through the wireless access link when MD m offloads its task to the sMEC n is given by Let f mn denote the computing resources of the sMEC n allocated to the MD m.The computation time required to execute the computational task on the sMEC n can be calculated as follows: According to Equations ( 4) and ( 5), the completion time T sbs mn can be obtained as follows: As noted, the energy consumption required to offload computational task I m for execution at sMEC n (denoted by E sbs mn ) is equivalent to the energy consumption required to transmit task I m from MD m to SBS n, as follows:

mMEC Offloading
Computational tasks can be executed on the mMEC following initial transmission to the SBS through the wireless access link (from MD to SBS) and then migrated to the mMEC through a fiber-optic link (from SBS to MBS).We denote the transmission data rate of the fiber-optic link between each SBS and the MBS as β.The transmission time when the computational task I m migrates from the SBS n to the mMEC via the fiber-optic link is calculated as follows: Let f 0 denote the computing resources allocated to each offloading MD by the mMEC, which is assumed to be constant and identical to all offloading MDs [10,16].The computation time for the computational task on the mMEC is given by The completion time T mbs mn when the computational task m is executed on the mMEC can be computed by the sum of (1) the transmission time between MD m and SBS n according to Equation (4) via wireless access, (2) the transmission time T tm mn from SBS n to the mMEC through the fiber-optic link, and (3) the computation time T em mn at the mMEC: Similarly, the energy consumption when task I m is offloaded to the mMEC (denoted by E mbs mn ) is equal to the transmission energy consumed E t mn according to Equation ( 7):

Problem Formulation and Analysis
The offloading decision determined the execution location for the computational tasks (e.g., sMEC offloading or mMEC offloading).Therefore, we divided the computation-offloading decision into two phases.The first involves task offload to the MEC server via the SBS, and the second involves task execution at the sMEC or the mMEC (migration from SBS to the mMEC through the fiber-optic link).Let Y = {y mn |m ∈ M, n ∈ N } denote the offloading-decision matrix, where each element y mn is given as follows: 1, if the MD m offloads its computational task to the sMEC n, 0, otherwise.
Because a task is offloaded to at most one MEC server, the following constraint must be satisfied: The following constraint ensures that each task can be executed by at most one MEC server: ∑ N n=1 z mn ≤ 1, ∀m ∈ M. Additionally, we denote M off = {m ∈ M, n ∈ N |y mn = 1, z mn = 1} as the set of MDs that offload their tasks to sMECs and M n = {m ∈ M|y mn = 1, z mn = 1} as the set of MDs that offload their tasks to the sMEC m.Finally, we denote the computational-resource matrix for the sMEC as F = { f mn |m ∈ M, n ∈ N }, where f mn > 0 is the resource allocation of sMEC n to computational task I m offloaded from MD m ∈ M n .Typically, the amount of computing resources at the sMEC is limited; therefore, the following constraint must be satisfied: ∑ m∈M n f mn ≤ f max n , ∀n ∈ N , where f max n denotes the maximum computing capability of sMEC n.Moreover, f mn = 0 if m / ∈ M n , indicating that sMEC n does not allocate any computing resources to MD m.
Here, we describe joint optimization of resource allocation and computation-offloading decision strategies in order to minimize the total computing overhead of MDs, including completion time and energy consumption.In particular, the total time necessary to accomplish computational task I m is computed as follows: The total energy consumption required to complete computational task I m is computed as follows: Therefore, the optimization problem can be expressed as follows: minimize subject to C1: y mn , z mn ∈ {0, 1}, ∀m ∈ M, ∀n ∈ N , C2: where λ e m , λ t m ∈ [0, 1]. and λ e m + λ t m = 1 depict the weights associated with energy consumption and completion time for MD m and H is the number of subcarriers (denoting the number of MDs allowed to offload their computational tasks simultaneously).Equation (16) shows that constraint C1 represents the binary offloading decision, and constraints C2 and C3 ensure that each MD m can select at most one SBS.Constraint C4 implies that the number of tasks to be offloaded to the MEC server must be less than the total number of subcarriers, and constraints C5 and C6 indicate that the total computing resources assigned to the offloading MDs by each sMEC cannot exceed its maximum computing capability (note that f mn = 0 if m / ∈ M n ).Equation ( 16) is an MINLP problem of NP-hard complexity and difficult to solve optimally in polynomial time [10,34].Although global optimization can be used to obtain an optimal solution to this problem, the worst-case exponential computational complexity limits its application to 5G wireless networks due to the massive level of connectivity, heterogeneous quality of service requirements, and highly dynamic wireless channels.In this study, we developed an efficient and low-complexity algorithm capable of obtaining a high-quality solution with guaranteed convergence using PSO.

Joint Optimization of Resource Allocation and Computation-Offloading Decisions
Here, we describe the algorithm used for joint optimization of resource allocation and computation-offloading decisions using PSO to address the problem in Equation (16).In particular, Equation ( 16) is an MINLP problem of NP-hard complexity [10,34] based on the presence of both continuous (resource allocation profile F) and discrete (offloading decision profiles Y and Z) variables.To address this problem, we divided it into two subproblems: (1) computational resource allocation, which is a convex problem for a given offloading decision and solved by KKT optimality conditions, and (2) computation-offloading decision, which is solved by binary PSO.PSO has the advantages of easy implementation and fast convergence, as well as the ability to escape from local optima and to converge to an approximate global optimum [27,28].Therefore, to solve Equation ( 16), we developed a PSO-based algorithm to jointly optimize resource allocation and computation-offloading decisions (JROPSO) in order to minimize total computing overhead of MDs.

Computational Resource Allocation
For a given task-offloading decision, Y = Y 0 , Z = Z 0 , Equation (16) for MDs offloading to sMEC n can rewritten as follows: subject to C5 and C6. ( Theorem 1.The optimization problem in Equation ( 17) is a convex optimization problem.
Proof of Theorem 1.We define G(F) as the objective function in Equation ( 17) and obtain the Hessian matrix G(F) with respect to F, as follows: We can verify that ∂ 2 G ∂ f 2 m 0; therefore, the Hessian matrix is a positive semi-definite matrix.
According to previously described theorems [43], we conclude that the objective function G(F) is convex.Note that the solution space of Equation ( 17) is convex, which suggests that Equation ( 17) is convex.
Because Equation ( 17) is convex, it can be solved using KKT optimality conditions .The optimal resource allocation F is computed as follows:

Computation-Offloading Decision
When computational resource allocation is provided (i.e., F = F * ), Equation ( 16) can be simplified as follows: minimize subject to C1, C2, C3 and C4. (21) Here, we applied PSO to solve the subproblem in Equation ( 21) in order to obtain the solution to offloading decisions Y and Z.In particular, the binary version of PSO (BPSO) is applied to solve the offloading-decision problem in Equation ( 21).First, we introduce the standard continuous PSO algorithm and the BPSO algorithm.PSO is a natural optimization method bio-inspired by the behavior of bird flocking [44], where each particle (individual) in a swarm searches for food in a search space.An effective way to locate food is to follow the bird closest to the food.By mimicking bird-foraging behavior, a variety of optimization problems can be solved by the PSO algorithm with highly competitive performance, including joint problems of power control and channel allocation in device-to-device communications [28,29].
In the PSO algorithm, a fitness function is defined to assess solution feasibility.The algorithm is initialized with random population-candidate solutions (particles), with each candidate solution represented by the position of a particle for the optimization problem.With each iteration, the position of each particle in the swarm changes within the search space in order to obtain a good solution based on the best individual position and the best position of all particles.After numerous iterations, the best solution will be found corresponding to the optimal position of all particles.Application of the PSO algorithm requires mapping the problem solution onto the particle space, which directly effects feasibility and performance.We considered a swarm involving K particles and assumed that the particle position kth of the swarm was represented by X k = (X m1 , X k2 , . . ., X km , . . ., X kM ) with a particle velocity kth of V k = (V k1 , V k2 , . . ., V kn , . . ., V kM ), where M is the total number of MDs.According to a previous study [44], the particle updates its velocity and changes to a new position via the following two equations: where L k and G represent the best individual position of the mth particle and the global best position, respectively; w denotes a constant inertia weight; c 1 and c 2 are two acceleration coefficients; and r 1 and r 2 are two random variables in (0, 1).
Because the offloading decision and location are discrete values (i.e., either 0 or 1), the problem cannot be solved using the continuous standard PSO algorithm; therefore, we used the BPSO [45].The main differences between the PSO and BPSO involve the position-updating procedure and the transfer function [45].The position X k is based on toggling between the values 1 and 0, with the velocity of the particle used to update the position.Therefore, we converted the velocity values to probabilities within the interval [0, 1] using the sigmoid function, as follows [45]: where V km is the velocity of the kth particle at the mth element, with the position of this particle updated to a binary variable according to the following rule: where rand is a uniformly random number within [0, 1].Algorithm 1 shows the pseudo-code for the standard BPSO, which is similar to the standard continuous PSO algorithm, except that updating each particle position occurs using Equation (25).Fit(X k ) is defined as the fitness value at each particle position X k .
According to a previous study [27], a modified version of the BPSO can avoid local optima more effectively than the original version; therefore, we apply a new transfer function instead of that described by the rule in Equation ( 25), as follows [27]: Each candidate solution in the subproblem in Equation (21) (i.e., the offloading decision Y and the offloading place Z for all the MDs) is constructed according to a single position of each particle and its velocity and describes how the solutions are developed.We established a search space of D-dimension and transferred {Y, Z} to the position of the particles.We denote X = {Y, Z} as the set of computation-offloading decisions and comprising matrices containing the offloading decisions and places.Therefore, the position of the kth particle is defined by X k and the velocity of the kth particle is denoted by V k .To solve Equation (21), the fitness function for the position can be computed as follows: where P = ∑ N n=1 θ n (max(0, ∑ M m=1 y mn − H) is the penalty function, which is an integrated form of the inequality constraint function C4 in Equation ( 21) and θ n is the penalty factor.Other constraints are guaranteed during initialization and genetic activities.The penalty function plays an important role in helping particles to fly out of a given area as soon as possible or as close to the feasible area as possible.
Randomly generate velocity v k and position x k for the number of particles K repeat for each particle k in K do Calculate the fitness value Update the global best G end Update velocity variables via: . end until Maximum iterations or stopping condition is satisfied;

The Proposed Algorithm JROPSO
As noted, the proposed algorithm JROPSO uses PSO to jointly find optimal solutions to problems concerning computation-offloading decisions in Equation ( 21) and computational resource allocation in Equation (20).The JROPSO algorithm is illustrated in Algorithm 2. Compute the resource allocation according to Equation (20).
Calculate the fitness value of each particle according to Equation (27).repeat for each the number of particles K m do Update the velocity V k and position X k according to Equations ( 22) and ( 26), respectively.end Update the resource allocation according to Equation (20).Calculate the fitness of each particle solution according to Equation (27).Update the best individual value if the new fitness is better than the current value.Update the global best solution among K particles.Increase the iteration index: t = t + 1. until t > T max or Fit(t)-Fit(t-1) ≤ ζ;

Simulation Settings
Here, we present the simulation results demonstrating the performance of the JROPSO algorithm.We employed the following simulation scenario for most of the simulations unless otherwise noted.We considered the HetNets as comprising of M = 50 MDs within a coverage area (250 × 250 m 2 ) including six SBSs and one MBS connected to all SBSs.The channel-gain models were assumed to follow the path-loss model according to 140.7 + 36.7log10(d)[35], where d (km) is the distance between the MD and the SBS.For the communication model, the noise power was set to n 0 = −100 dBm [34], and the transmit power of the MD for task offloading to the SBS was set to p m = 23 dBm.The data rate of the fiber-optic link was β = 1 Gbps [18], and we set the number of subcarriers at H = 12 and the bandwidth of each sub-channel to W = 3 MHz.Additionally, there was no inter-cell interference in the wireless fronthaul.For the computational task, the input data size of the computational tasks was uniformly distributed within the range [600, 1200] KB, and the number of CPU cycles required for completing the computational task was randomly generated at between C m = [500, 1000] Megacycles.In terms of computing resources, the CPU speed of the computing resource of the mMEC allocated to each MD was f 0 = 3 GHz, the maximum CPU computing capacity for each sMEC was f max m = 6 GHz, and the local computing power of the MDs was randomly assigned from the set {0.5, 0.8, 1} GHz [34,39] and α = 5 × 10 −27 [34,35].The weighting parameters of the computational task were set to 0.5 (i.e., λ t m = λ t m = 0.5, ∀m ∈ M).For the PSO algorithm, PSO parameters were set according to a previous study [27].Briefly, we set w = 2, c 1 = 2, c 2 = 2, the size of the particle population (K) to 30, and the maximum number of iterations (T max ) to 1000.The simulation results were averaged over a number of Monte Carlo simulations, and MD and SBS locations were randomly and uniformly distributed.

Simulation Results
To evaluate the performance of the JROPSO algorithm, we compared it with baseline schemes:

•
Local Computing Only (LCO): all of the MDs execute their computational tasks locally in the absence of computation offloading.

•
Only offloading in a 2-tier system (OF): offloading only to sMECs and mMEC, with computation resource allocation optimized for sMECs.
In the first experiment, we verified the convergence of our proposed algorithm in terms of the total computing overhead by the numerical result in Figure 2. In this experiment, we performed in 3 cases of 10 MDs, 30 MDs, and 50 MDs.From Figure 2, we see that the proposed algorithm can converge into a stable solution after a finite number of iterations.In addition, the average iteration for the convergence of the proposed algorithm is approximately linear with the number of MDs.
In the second experiment, we determined the percentage of offloading MDs according to the increase in the total number of MDs (Figure 3).Initially, when the number of MDs was small, the percentage of offloading MDs was relatively high; however, as the number of MDs increased, the percentage of offloading MDs decreased.The reason for this is that each MD tends to offload its computational task to the MEC server to save energy consumption and/or completion time.However, a larger number of MDs lead to a high competition for computing resources at the MEC server.Therefore, more MDs are not beneficial from remote computing; thus, some MDs must be executed locally to minimize the total computing overhead.In the third experiment, we evaluated proposed algorithm JROPSO in terms of the total computing overhead of MDs with respect to increases in the number of MDs (Figure 4).The results indicated that total computing overhead calculated by all of the schemes increased along with the number of MDs.The results indicated that total computing overhead calculated by all of the schemes increased along with the number of MDs.The reason is that the total computing overhead of MDs is linearly related to the number of MDs.We also saw that the proposed algorithm JROPSO helped reduce the total computing overhead of MDs.More specifically, the proposed algorithm JROPSO achieved the lowest total computing overhead relative to other schemes.This is because the proposed algorithm JROPSO was optimized for the joint resource-allocation and computation-offloading decision such that computation offloading is beneficial for offloading tasks.In the fourth experiment, we evaluated algorithm performance according to different weighting parameters (Figure 5).Specifically, we increased energy consumption λ e m from 0.1 to 0.9 with a step of 0.1, which altered completion time λ t m accordingly to λ t m = 1 − λ e m .The number of MDs is fixed at 50.The results indicated that the proposed algorithm JROPSO was superior to other solutions, although the weighting parameters vary.The total computing overhead according to the LCO algorithm consistently increased along with the λ e m parameter because local execution of computational tasks by MDs results in large energy consumption as compared with the execution time.For example, MD m with f l = 1 GHz and C m = 800 Megacycles returned T l m = (800 × 10 6 )/(1 × 10 9 ) = 0.8 (seconds) and E l m = 5 × 10 −27 × 800 × 10 6 × (1 × 10 9 ) 2 = 4 (Joules).This suggests that, for local computing, the completion time was 5-fold smaller than the energy consumption.By contrast, the FO algorithm offloaded the computational task to the MEC server in order to save the energy consumption of the MDs.Therefore, increases in λ e m decreased the total computing overhead and suggested that a large enough λ e m would result in decreases in total computing overhead according to the FO, WMBS, and JROPSO algorithms.This is a consequence of the benefits of offloading to allow energy savings versus computing time.These results indicated that optimal performance requires choosing the appropriate weighting parameters.Figure 6 shows the effect of data size on the JROPSO algorithm.The results indicated that increased data size did not change the total computing overhead according to the LCO algorithm based on it having no impact on completion time or energy consumption when the tasks are executed locally.By contrast, the computing overhead calculated by the OF algorithm increased rapidly due to high completion time to offloading task on MEC server.The large data sizes resulted in computing overheads for the JROPSO algorithm close to the WMBS algorithm.The reason is that some tasks will not be executed at mMEC due to the considerable time required to transfer the task to mMEC.These findings suggest that computing offloaded tasks involving small amounts of data achieve better results.

Conclusions
In this study, we described the development of an efficient optimization method to determining computation-offloading decisions in multi-tier multi-MEC-server architectures within 5G HetNets.We addressed resource-allocation and computation-offloading decision strategies to minimize the total computing overhead, including completion time and energy consumption, and developed the JROPSO algorithm to obtain optimal solutions.Our simulations confirmed the efficiency of the algorithm and its superior performance relative to other methods.In addition, this paper showed that the PSO algorithm is used to solve the optimization problem of computation offloading with highly competitive performance.In future work, the comparison of our proposed algorithm with recent meta-heuristic algorithms like Ant Colony Optimization (ACO), Whale Optimization Algorithm (WOA), and Harris Hawks Optimization (HHO) is also promising.Moreover, we will involve investigation of PSO applications in non-orthogonal multiple-access-assisted MEC systems.
the matrix of offloading place for task I m :z mn =1, the task I m is executed on the sMEC n, 0, the task I m is executed on the mMEC.

Algorithm 2 :
PSO-based joint resource allocation and computational offloading decision algorithm (JROPSO)Input: The size (K) of the particle population (k = {1, . . ., K}), the maximum number of iterations T max , the convergence criteria ζ, and the parameter w, c 1 , and c 2 .Output:The best fitness values and global best position.Initialization: population of K particles with random positions X k and velocities V k .Set the iteration index as t = 1.

Figure 2 .Figure 3 .
Figure 2. JROPSO convergence in terms of total computing overhead according to the number of iterations.

Figure 4 .
Figure 4. Comparison of the total computing overhead according to the number of MDs.

Figure 5 .
Figure 5. Performance evaluation under different weighting parameters.

Figure 6 .
Figure 6.The effect of data size on task offloading.