Optimization Strategy of Task Offloading with Wireless and Computing Resource Management in Mobile Edge Computing

Mobile edge computing (MEC) provides user equipment (UE) with computing capability through wireless networks to improve the quality of experience (QoE). The scenario with multiple base stations and multiple mobile users is modeled and analyzed. The optimization strategy of task offloading with wireless and computing resource management (TOWCRM) in mobile edge computing is considered. A resource allocation algorithm based on an improved graph coloring method is used to allocate wireless resource blocks (RBs). The optimal solution of computing resource is obtained by using KKT conditions. To improve the system utility, a semi-distributed TOWCRM strategy is proposed to obtain the task offloading decision. Theoretical simulations under different system parameters are executed, and the proposed semi-distributed TOWCRM strategy can be completed with finite iterations. Simulation results have verified the effectiveness of the proposed algorithm.


Introduction
With the continuous development of the Internet of things and ubiquitous computing, mobile devices are increasingly running resource-intensive applications, such as interactive games and augmented reality [1,2]. However, the limited resources of mobile devices cannot fully meet the requirements of these applications for powerful computing power and high speed. In recent years, many solutions have been proposed to solve the problem. In particular, mobile edge computing (MEC) provides a new way for UEs to complete computing tasks. MEC allows user equipment (UE) to offload computing tasks to network edge nodes through the wireless cellular network and performs the offloading tasks. This not only satisfies the expansion demand of users' computing capabilities but also compensates for the long delay of cloud computing [3]. It is a good method by using small base stations (SBSs) to meet the data rate demand of applications [4,5]. As one of the key components of 5G, SBSs can enhance the coverage of local hot spots and increase system capacity. Dense network deployment can improve spectrum utilization and reduce end-to-end delay [6,7]. However, task offloading not only generates additional overhead but also may cause intercell interference as it shares the same wireless frequencies among small cells, which will significantly influence the performance of the network [8]. Therefore, a reasonable offloading decision and interference management become the key to achieve efficient computation offloading [9]. A lot of works have been devoted to the research of computation offloading. Most of them have only focused on the process of offloading computing tasks from UE to MEC [10][11][12][13][14][15][16][17][18]. Only the optimal offloading decision is considered in [10,11]. Researchers only focused on optimizing the communication resources [12,13] or the computing resources [14,15]. In some works, the combination of optimizing offloading decisions and resource allocation is used to minimize the latency or enhance the system performance [16][17][18]. Recently, research works by combining task offloading and interference management are proposed to improve the system utility [9,[19][20][21]. However, the scene of one user per base station is studied in [19,20]. The work about wireless resource allocation does not take the minimum transmission rate requirement of each user into account [9].
The mobile devices can gather air quality data to analyze the environmental pollution or collect the image data to realize personal identity authentication from monitoring equipment. The MEC server determines whether the task is processed locally or offloaded to the server according to the computing capacity of the mobile device, the size of data, the delay, and the energy consumption requirements. The main contributions in this article are as follows: (i) The communication model and the computing model in a multibase station and multiuser MEC scenario are described. The delay and energy consumption in local or remote computing are analyzed (ii) The user utility is modeled as the weighted sum of the delay ratio and energy consumption ratio. And the system utility is defined as the sum of all user utilities. The optimization of the system utility is formulated by combining task offloading, wireless resource allocation, and computing resource allocation (iii) The optimal goal is decomposed into three subproblems including wireless resource block allocation (RBA), computing resource allocation (CRA), and task offloading decision. The RBA is solved by using a resource allocation algorithm based on an improved graph coloring method. The optimal solution of CRA is obtained by using KKT conditions. In task offloading, a semi-distributed task offloading with wireless and computing resource management (TOWCRM) strategy is proposed to optimize the system utility under the constraints of computing resources The rest of this article is organized as follows: the related works are discussed in Section 2. The system model with multiple cells and multiple users in the MEC scenario is described in Section 3. The optimization of the system utility is formulated in Section 4. In Section 5, wireless resource optimization and computing resource allocation are discussed. A semi-distributed TOWCRM algorithm is proposed to optimize offloading tasks. The simulation results are given and discussed in Section 6. The conclusion of this work is described in Section 7.

Related Works
Edge computing could be affected by external environment (such as wireless channel, interferences among mobile users, communication link quality, and the status of the communication channel) during offloading [22]. Therefore, it is very important to establish a suitable environment of offloading policy for computation offloading. In [10,11], these studies only paid attention to task offloading without optimizing communication and computing resources. It was assumed that the capacity of cloud computing is unlimited, and some studies only focused on the optimization of communication resources in [12,13]. For instance, to maximize the network management profit, an optimal solution algorithm based on the idea of branch-and-price was put forward to address joint resource management for device-to-device (D2D) communication [12]. Based on combining resource allocation and task assignment, a low-complexity iteration algorithm was proposed to minimize the task execution latency of all users subject to task and resource constraints in [13]. In contrast, only computing resource was optimized during task offloading [14,15]. A new market-based framework was proposed to efficiently allocate computing resources of heterogeneous capacity-limited edge nodes (EN) for multiple competing services at the network edge in [14]. In [15], a smart contract that exploited the state-of-the-art machine learning algorithm was used in a private blockchain network to allocate the edge computing resources. In [16][17][18], joint communication and computing resource optimization were considered during the task offloading. To minimize the average latency of users to complete tasks, a strongly nonconvex problem with coupled variables was described as jointly considering the offloading decision, computation, and broadband resource allocation [16]. In [17], the problem of joint service caching, computation offloading, transmission, and computing resource allocation in a scenario of multiple users with multiple tasks was formulated to minimize the overall computation and delay costs. Moreover, the scenario where each user had a computation cost constraint was studied. A semi-distributed heuristic offloading decision algorithm (HODA) was proposed to maximize the system utility, which jointly optimized the offloading decision, communication, and computing resources [18].
In addition, there have been also some works that consider the joint optimization of task offloading and interference management at the same time [19][20][21]. Task offloading was studied in a MEC scenario with a single user per cell in [19,20]. For example, offloading decision was made by considering the effect of intercell interference on system performance, where physical resource block (PRB) and computing resource allocation were treated as a joint optimization problem. The MEC server made the offloading decision to maximize the overhead, and the PRB was allocated by using a graph coloring algorithm [19]. In [21], the problem of joint task offloading and resource allocation was studied to maximize the offloading utility, which was modeled by the weighted sum of task completion time and device energy consumption. The resource allocation (RA) problem using convex and quasiconvex optimization was addressed, and a novel heuristic algorithm was proposed to solve the task offloading. It could achieve a suboptimal solution in polynomial time. However, there was no consideration to minimize interferences among mobile users.

System Model
This section describes the system model used in our work. Firstly, the network model is introduced in detail. Then, the corresponding communication model and calculation model are derived based on the proposed network model. For simplicity, the key notations used in the article are summarized in Table 1.   2 Wireless Communications and Mobile Computing 3.1. Network Model. As shown in Figure 1, a two-layer cellular heterogeneous network composed of a macro cell base station (MBS) and S small cell base stations is considered [19,20]. The MEC server is deployed on the side of the MBS and can perform multiple computing tasks at the same time. S SBSs are connected to the MEC server through optical fiber links like the MBS. Let S = f1, 2, ⋯, s, ⋯, Sg be the set of SBSs, and there are M UEs associated with each SBS in its coverage. We denote the set of UEs in the coverage area of s as U s = fu 1 s , u 2 s , ⋯, u m s , ⋯, u M s g, where u m s represents a UE belonging to s. In addition, for simplicity, the mobility of users or the handover among cells was not considered as it was assumed in [23][24][25]. Similar to many previous works in cloud computing and mobile networks [26][27][28], it is a semistatic scenario, which means that the position and transmission channel conditions remain unchanged during offloading a task.

Communication Model.
It is assumed that each UE has a time-sensitive task that requires a lot of computing resources to complete. Each UE can perform by offloading the computing task to the MEC server through its associated SBS or execute the computing task locally. Therefore, we denote the offloading variable as x u m s ∈ f0, 1g. x u m s = 0 means that u m s performs its task locally. x u m s = 1 means that the user of u m s chooses to offload the task to the MEC server via a wireless link. The task offloading decision can be expressed as Uplink spectrum multiplexing is used in this model. The spectrum resources of the entire system are divided into N orthogonal RBs, and the RB set is defined as N = f1, 2, ⋯, n, ⋯, Ng The RB associated table is defined as Y s = fy n u m s g, which is a M × N matrix, where M is the total number of UEs in the s-th cell and N is the total number of RBs. y n u m s = 1 means that the n-th RB is assigned to u m s ; otherwise, y n u m s = 0. And the RB allocation strategy is defined as Y = fY s g, s ∈ S.
During uplink transmission, each UE and each SBS have a single antenna for sending and receiving messages. When u m s offloads its task to the MEC server for calculation, interference will occur if there are UEs in other SBSs sharing the same RB(s) with the current u m s . As RBs are assigned orthogonally to users in each cell, there is no interference  denotes the channel gain between u m t and s. Given the decision matrix X and the RB associated strategy Y, the uploading rate achieved by u m s connected to s can be obtained by Shannon's formula as [19] R r where σ 2 is the variance of background noise, B is the bandwidth of each RB, P u m s represents the transmission power of u m s , K u m s stands for the number of RB allocated to u m s , and H u m s ,s denotes the channel gain between u m s and s.
represents the size of transmission data and C u m s (in megacycles) specifies the workload, i.e., the number of CPU cycles required to complete the computing task. The values of D u m s and C u m s can be obtained by carefully analyzing the offloading task [29,30]. The delay and power consumption of local and remote computation will be discussed, respectively.
where kð f loc u m s Þ 2 is the energy consumption per calculation cycle and k depends on the energy coefficient on the chip architecture. According to the actual measurement, k = 10 −27 is usually adopted [21].
(2) Remote computing: u m s is connected to the corresponding s through a wireless network, and its task is offloaded to the MEC server for calculation. The computing resources provided by the MEC server are quantified by the computing capacity f (CPU cycles/s), which can be shared among the related UEs. The uplink transmission delay of u m s can be expressed as follows: When a computing task CT u m s is offloaded to the MEC server, the MEC server allocates specific computing resources to process the task, which is represented by f r u m s (CPU cycles/s). And the computing resource allocation profile is defined as F = f f r u m s g. During the execution of the task, it is assumed that the calculation speed assigned by the MEC server to each UE is fixed. The time of the MEC server executing the task is described as In addition, a feasible computing allocation strategy must satisfy the constraints of computing resources, which can be expressed as The total delay of u m s for finishing the task is given by the following equation: Through the above analysis, the energy consumption of u m s during the transmission data can be calculated as where P u m s represents the transmitting power of u m s . We mainly consider the energy consumption and delay of UEs, and the computing energy consumption of the MEC server is omitted. As the amount of data returned to the mobile users is small, the power consumption and latency of UE receiving the returned data are omitted.

Problem Formulation
In this section, the problem of task offloading, wireless RBs, and computing resource allocation is formulated under the definition of user and system utility.
In a mobile cloud computing system, UEs' preference is mainly manifested in . When the task of u m s is executed on the MEC server ðx u m s = 1Þ, its user utility W u m s is larger than 0. Given the offloading policy of X, the RB allocation strategy of Y, and the calculating resource allocation policy of F, the system utility can be defined as the sum of all user utilities and is expressed as follows: To maximize the system utility by jointly optimizing task offloading, wireless RBs, and computing resource allocation in mobile edge computing, the optimal goal can be formulated as The constraints in the above formula can be interpreted as follows: constraint C1 in (12) implies that the task can be executed locally or offloaded to the MEC server for execution. Constraint C2 in (12) indicates whether the n-th RB is assigned to u m s . Constraint C3 in (12) ensures that the sum of computing resources allocated to all offloading UEs does not exceed the computing capacity of the MEC server.
Due to the existence of integer variables, the above equation is a mixed integer nonlinear program (MINLP) problem [31]. The equation of (12) can be rewritten as follows: From (13), it can be seen that offloading decision, RB allocation, and computing resource allocation are decoupled from each other [32].
The original problem can be translated into offloading decision and resource allocations. In the next section, we will present solutions to both the resource allocations and task offloading decision.

Resource Optimization and Task Offloading Strategy
In this section, considering the time delay and energy consumption demand of UEs, a resource allocation algorithm based on improved graph coloring is used to allocate RBs. The solution of computing resources is obtained by using KKT conditions, and a semi-distributed TOWCRM algorithm is adopted to optimize the offloading decision. The set of offloading UEs for the s-th SBS is defined as O s .
If a feasible task offloading decision is given, the objective function of (12) can be translated as follows: where From (14), it is easy to see that ∑ s∈S ∑ u m s ∈U s ðβ t u m s + β e u m s Þ is an exact value for a specific offloading decision of X. The VðX, Y, FÞ can be regarded as the total offloading cost of all UEs who need to be offloaded. Therefore, the equation of (14) can be equivalent to minimize the total offloading overheads. It can be seen from (16) that RB allocation and computing resource allocation are decoupled from each other in the target and constraint. We can decouple problem (16) into two independent problems, namely, resource block allocation (RBA) and computing resource allocation (CRA), and their respective solutions are presented in the following sections.

Resource Block Allocation (RBA).
Taking the first term in (16) as the objective function, the RB assignment problem of ΓðX, YÞ can be written as Note that in the RB allocation phase, it is assumed that all UEs are transmitted with a fixed transmission power of P u m s . The transmitted power of each UE is equally distributed over each RB assigned to it. From (17), the minimal value of ΓðX, YÞ is obtained if the transmission rate of each offloading UE is maximized.
In order to better illustrate the transmission quality, the minimum transmission rate (when all UEs of the system are offloaded, computing resources are equally distributed to all UEs) is expressed as For the above RBA problem, it can be equivalent to the matching problem of the number of offloading UEs and the number of RBs. Therefore, a resource allocation algorithm based on an improved graph coloring method [19] is proposed to solve the above problem. The algorithm flow is simply described as follows: (1) Initialization (step 1): in this step, the MEC server sets the RB allocation strategy Y to zeros and constructs S user benefit matrices as R 1×ϑ s = fr u m s g, where every user rate is r u m s = B log 2 ð1 + ð P u m s H u m s ,s / σ 2 ÞÞ, u m s ∈ ϑ s , s ∈ S: At the same time, each UE also constructs its own channel benefit matrix R R 1×N  The optimal objective function of (17) can be calculated as (16), computing resource allocation (CRA) is to optimize the second term of formula (16) and is expressed as follows:

Computing Resource Allocation (CRA). From
where From the above equation, it is a convex optimization problem. And constraint C2 in (20) is slack based on Karush-Kuhn-Tucker conditions, and it can be solved by using the KKT conditions.
The equivalent Lagrange function of this problem can be expressed as By setting the above equation equal to 0, the solution of optimal computing resource allocation for problem (20) can be obtained. does not belong to ϑ s , s ∈ S, the solution of β can be obtained as Substituting (26) into (24), the optimal solution can be obtained as follows: The optimal objective function of (20) can be expressed as 5.3. Task Offloading Decision. In the previous section, for a given task offloading decision X, the solutions of RBA and CRA are obtained. According to (13), (16), (19), and (28), the system utility can be expressed as follows: Given the RB allocation strategy of Y * and computing allocation strategy of F * , the objective function of (13) can be written as From the above equation, it is not a convex function due to the fact that X is a binary variable. For the purpose of solving this nonconvex problem, a semi-distributed TOWCRM algorithm consisting of two stages that can find a local optimum to problem (30) is adopted, as shown in Algorithm 1. In the first stage, each mobile user independently optimizes its user utility after optimizing wireless and computing resource allocation and determines whether to send an offloading request, including the information on mobile user parameters and the features of computation task. In the second stage, the MEC server determines whether the offloading user joins the offloading set by comparing the system utility, which includes the offloading user or not. Finally, the selected mobile users offload their computation tasks.
In stage 1, each UE calculates its own user utility W u m s , according to β t Moreover, each UE checks whether its user utility is larger than zero. If it satisfies, an offloading request is sent. Otherwise, an empty message is sent, which indicates that local computation is adopted.
In stage 2, the MEC server waits until it has collected all the requests and accepts the top N UEs of user utility in the offloading request. The initial offloading policy X can be got. The corresponding RB allocation strategy of Y * and the corresponding computing resource allocation of F * are obtained, respectively. According to (29), the system utility of WðX, Y * , F * Þ can be obtained. And let K be the set of UEs that the server accepts requests but does not accept offloading. The MEC server selects the UE with maximum user utility in K to add offloading policy X, and the RB allocation strategy Y and the computing resource allocation F will be updated. According to (19), the system utility WðX, Y, FÞ can be obtained. If WðX, Y, FÞ > WðX, Y * , F * Þ, the MEC server removes this UE from the offloading policy. Otherwise, the system utility, RB allocation strategy, and computing resource allocation are updated. Finally, this UE is removed from the set K, and steps 21 to 33 will be repeated until the set K is equal to ∅. The MEC server forms the RB allocation strategy and computing resource allocation strategy and starts to send offloading decision to UEs. Receiving this message, UEs start to offload their tasks accordingly.

Simulation Results and Analysis
In a centralized MEC network, it consists of one MBS with the MEC server and four SBSs are deployed in 100 * 100 m 2 . The MBS is located in the center of the area, and the four SBSs are placed in the four directions of the area. Each SBS has a coverage area of 30 m. The radio communication parameters follow the Third Generation Partnership Project specification [33]. It is assumed that the data size of D u m s is 420 kB and the workload of C u m s is 1000 megacycles. The MATLAB® package is used to carry out the simulations, and the system parameters are summarized in Table 2.
In addition, UEs are randomly distributed in the coverage of each SBS. If not particularly indicated, the number of RBs is 10. The system utility performance of the proposed 7 Wireless Communications and Mobile Computing TOWCRM strategy is compared with that of the heuristic joint task offloading scheduling and resource allocation strategy (hJTORA) [21].
In order to visually show the resource allocation algorithm based on improved graph coloring, Figure 2 shows the RB allocation of UEs. There is a total of one MBS, four SBSs, and 10 RBs in the whole system, and there are 10 UEs associated with each SBS, among which there are 23      Figures 3(a) and 3(b), the system utility calculated by the proposed TOWCRM strategy is higher than that computed by hJTORA. From   Figure 3(a), it can be seen that the system performance of two strategies decreases as the tasks' input data size increases. From Figure 3(b), the system utility becomes larger as the tasks' workload increases. This means that the task with smaller input data or higher workloads will improve the value of system utility.
From Figure 4, the proportion of offloading users decreases, as the number of user increases. This is mainly because the capacity of computing resources and the RBs assigned to each offloaded users decreases, as the number of users increases. Therefore, more tasks tend to be    Wireless Communications and Mobile Computing processed locally. In addition, the proportion of offloaded users will increase with the larger number of RBs in the network.
The number of offloading UEs under different computing power is analyzed, as shown in Figure 5. It can be seen that the number of users offloaded by the TOWCRM and hJTORA algorithms is increasing with the enhancement of computing power. Because the computing power of MEC is stronger, the computation time of the offloading tasks becomes shorter. Therefore, more UEs will tend to offload their tasks to the MEC server to be processed. Moreover, under the same computing power of the MEC server, the number of UEs offloaded by the proposed algorithm is generally higher than that by using hJTORA. Figure 6 shows the total time for finishing all offloading tasks and energy consumption obtained using TOWCRM when UEs' preferences to time of β t u m s vary from 0.1 to 0.9. It can be seen that the time is reduced, and the energy consumption is increased as β t u m s becomes larger. In addition, when the number of users in the system increases, the total time and energy consumption of users will be increased. This is because when more users participate in the competition for limited resources, a longer delay and higher energy consumption of all offloading UEs will occur.

Conclusion
In this article, the scenario of a multicell and multiuser mobile-edge computing network is modeled and analyzed. The optimization of the user utility and the system utility is formulated by combining task offloading and wireless and computing resource management. The original problem is decomposed into resource block allocation (RBA), computing resource allocation (CRA), and task offloading decision. The RBA is solved by using a resource allocation algorithm based on an improved graph coloring method. The optimal solution of CRA is obtained by using KKT con-ditions. In task offloading, a semi-distributed TOWCRM strategy is proposed to optimize the system utility under the constraints of computing resources. Simulation results show the effectiveness of the scheme under different system parameters. The transmission power of every user is considered a fixed value and is equal to each other for wireless resource allocation in this work. The power control of each user will be studied to improve the system utility in the next research work.

Data Availability
We derived the writing material from different journals as provided in the references. A MATLAB tool has been utilized to simulate our concept.