Joint optimization of computing ratio and access points’ density for mixed mobile edge/cloud computing

Cooperation between the mobile edge computing (MEC) and the mobile cloud computing (MCC) in offloading computing could improve quality of service (QoS) of user equipments (UEs) with computation-intensive tasks. In this paper, in order to minimize the expect charge, we focus on the problem of how to offload the computation-intensive task from the resource-scarce UE to access point’s (AP) and the cloud, and the density allocation of APs’ at mobile edge. We consider three offloading computing modes and focus on the coverage probability of each mode and corresponding ergodic rates. The resulting optimization problem is a mixed-integer and non-convex problem in the objective function and constraints. We propose a low-complexity suboptimal algorithm called Iteration of Convex Optimization and Nonlinear Programming (ICONP) to solve it. Numerical results verify the better performance of our proposed algorithm. Optimal computing ratios and APs’ density allocation contribute to the charge saving.

to run directly at the edge of the network. It extends the traditional cloud computing paradigm to the network edge [5] by putting a substantial amount of storage, communication, control, configuration, measurement, and management at the edge servers [8,9]. With the help of MEC, low latency, location awareness, and high quality of service (QoS) for streaming media and real-time applications at resource-scarce UEs can be realized. To incorporate MEC in edge devices, some of the traditional access points (APs) are evolved to the edge computing-based access points by equipping with a certain caching, computing capabilities [10], which are more to be called as fog computing-based access points (F-APs).
Some outstanding works have been dedicated to computation offloading. [11] introduced many equivalence definitions of mobile edge computing, mobile edge computing platforms and architecture design. [12] and [13] discussed security threats of mobile edge computing, such as hacking. [14] illustrated the application of mobile edge computing in combination with the Internet of Things. In [15], the UEs, APs, and the cloud made up a three layer structure. They process a task collaboratively by offloading in the mixed MEC/MCC system. [16] and [17] thoroughly described the envisioned network architecture, proposed resource management scheme and analyzed its performance for edge/mobile edge computing.
There are also many previous works improve the system performance through the optimization of offloading decisions and resource allocation, such as the allocation of transmit power, bandwidth, and computation resource. Improvement of the system performance contains reduction in delay or energy consumption [18][19][20], minimization of the system cost [21,22], improvement of QoS [23], maximization of the revenue of the server [24], adaptation user access mode selection mechanism [25]. However, most of those previous works put their emphasis on offloading decision making, resource allocation, or access mode selection, without a joint consideration of them. Different from the above approaches, in this paper, we study the joint optimization of offloading decision making and access mode selection for a mixed MEC/MCC system to minimize the expect charge. It is embodied in optimization of computing ratios at each layers and the distribution density of APs. It is meaningful to study the distribution density of APs in MEC due to the edge severs have mobility and controllability. To the best of our knowledge, the joint design of offloading decision making and access mode selection in a mixed MEC/MCC system has not been addressed in previous works. The main contributions of this work are summarized as follows.
• We analyze the selection probability and corresponding ergodic rate of each mode. • We formulate an optimization problem to minimize the expect charge of computing a task in the mixed MCC/MEC system. Due to the multi-access mode, the expect charge is in the form of the product of connecting probability of each mode and its corresponding charge. • We devise a low complexity algorithm called Iteration of Convex Optimization and Nonlinear Programming (ICONP) to solve the formulated NP-hard optimization problem. It first fixes the specific variable and transform the original problem into a convex problem by geometric mean inequality method. Solve the convex problem by CVX tool and get the optimal values of other variables. Then fix those variables which are got from last step and solve the problem with the specific variable by constrained nonlinear programming. Do iteration until meet convergence. • We prove the convergence of the proposed algorithm. Simulation results show the effectiveness of the proposed scheme with different system parameters.
The rest of this paper is organized as follows. The system model is described in Section 2.
The mode selection and its corresponding ergodic rates are represented in Section 3. Section 4 formulates original problem. Section 5 represents the design of optimization algorithm. Simulation results are discussed in Section 6. Finally, we conclude this study in Section 7. "Appendix" can be seen in Sect. 8.

System model
We consider a three-layer mixed mobile edge/cloud uplink system, which is consisted of a user equipment (UE), a large number of APs, and a remote cloud as illustrated in Fig. 1.
In this paper, the UE and APs are assumed to be equipped with a single antenna. APs which is capable of computing are called as F-APs as well. F-APs are deployed according to a two-dimensional PPP(Poisson Point Procession) f with density of 1 in a disc plane, whose center is the UE. Thus, the deployment of all the APs is an expanded homogeneous PPP d with density of 2 = 1 /k , where k ∈ (0, 1] denotes the probability of an AP supporting computation. Without loss of generality, only one intensive computing task Ŵ u = {N , ω} needs to be completed for the UE, where N is the size of computing task, ω denotes the number of CPU cycles required for computing one bit. In this paper, we assume that computing task is divisible, which means that the computing task can be divided into two or more parts. Three computing modes are considered in this paper including F-AP execution mode, AP relay mode, and local execution mode, denoted as mode i, i ∈ = {1, 2, 3} , respectively. Mode 1 means that the UE computes the task collaboratively with the F-AP and the cloud, while mode 2 means that the UE computes the task collaboratively with the cloud, and mode 3 is that the UE executes the task locally by adapting its computation capacity. In mode i, i ∈ , the UE first processes α i of the task, where α i ∈ [0, 1], i ∈ � , and α 3 = 1 . Let α = [α 1 , α 2 , 1] . Then, the UE transmits the rest (1 − α i )N bits to the selected AP. After that, the selected AP processes ̺ = max{β(2 − i), 0} of the received data and then trans- 1] . Finally, the cloud computes the received data.
When compute some data, the energy consumption E c and time consumption T c are given as [26,27] where κ denotes the effective capacitance coefficient. f is the computation capacity of the central processing unit(CPU). D 1 is the size of computing data(in bits).
When transmit some data, the energy consumption E t and time consumption T t are given as where p and r denote the transmit power and rate, respectively. D 2 is the size of transmitting data(in bits).
The size of computation outcome is much smaller than that of the computing task. Thus, the charge due to downlink transmission of the result is negligible compared to the uplink [28,29]. Combined with Eq. (1)-(4), the charge is the sum of the product of consumed energy and its corresponding price and the product of computing delay and its corresponding price at each layer. The charge in mode i, i ∈ , can be computed as where f loc is the local computation capacity (in CPU cycles/s) of the UE. f AP1 is the computation capacity of the selected F-AP. f APi , i ∈ ϒ = {2, 3} , is a meaningless constant which is not equal to 0 for the rigor of the formula. f C is the cloud's computation capacity. R i is the ergodic rate from the UE to the selected AP, while r i is the transmission rate from the selected AP to the cloud in mode i, i ∈ = {1, 2} , which will be discussed in the following section in details. V loc , V APi and V Ci are prices per Joule (in yuan/J) at the UE, the selected AP and the cloud, respectively. The price raises in proportion to the corresponding amount of data needed to be computed or offloaded. For simplicity, we define G ℧ , ℧ ∈ {loc,AP,C} are prices per second (in yuan/s) for computing delay at the served UE, the selected AP and the cloud, respectively. All notations in this paper and their definitions are collected in Table 1.

Mode selection and ergodic rate
The UE first tries to select an F-AP which is nearest to it and the received signal-to-noise ratio (SNR) is larger than a pre-set SNR threshold T 1 . If the UE cannot find an F-AP which meets the requirements, the UE will select an AP which is nearest to it meanwhile the SNR between them is larger than a pre-set SNR threshold T 2 as a relay. If neither of them can be achieved, the UE will compute data by itself. The probability of finding an AP which is nearest to the UE meanwhile the SNR between them is larger than T i is expressed as where B 1 , σ 2 and p 1 are the transmission bandwidth, the mean noise power per Hz, and the transmission power of the UE. The prove of F ( i ) can be seen in "Appendix 1". The probability of selecting mode i, i ∈ , is denoted as M i , and expressed as Next, we focus on the derivation of ergodic rate in mode i, i ∈ . Since the APs are deployed according to PPP, the ergodic rate (in bps) is defined as [25] where E(·) is the expectation with respect to the channel fading distribution as well as the locations of the random receiver nodes. SNR and T are the real-time SNR and the pre-set threshold of SNR in the wireless connection between the UE and the selected AP, respectively. The ergodic rate from the UE to the selected AP in mode i, i ∈ , can be derived as [25] The transmission rate from the selected AP to the cloud is [25] where B 2 , p 2 and D i are the transmit bandwidth, transmit power of the selected AP, and the expect distance between the selected AP and the cloud in mode i, i ∈ . ζ c is the path loss exponent between the AP and the cloud. Please see the details of r i in "Appendix 3".

Problem formulation
Since three execution modes are all likely to occur, the overall charge in our paper is defined as expected charge. Expected charge is the sum of product of select probability and corresponding charge of each mode, i.e., In this paper, the objective is to minimize the charge of offloading computing, which is formulated as follows: The constraint C1 means the size of offloading data which is offloaded from the UE to the selected F-AP should be no larger than n 1 , C2 guarantees that the data size is no larger than n 2 when it offloaded from the selected AP to the cloud, where n 1 is the maximum receive capacity to the UE offered by the selected AP, n 2 is the maximum receive capacity of the cloud which is offered to the selected AP. Constraints C3 and C4 ensure that the computing ratio should no more than 1 and no smaller than 0. Constraint C5 ensures multi-mode corporation, where F ( 1 ) is the probability of choosing mode 1, F min and F max are the lower and upper bound of probability, respectively. Due to the relationship between 1 and 2 , constraint C5 contains the constraint of F ( 2 ) . It is hard to solve this complex and non-convex problem due to the existence of product relationship between variables in the objective function and the constraint C2 . Thus, we need to reduce the complexity and get the suboptimal values of variables by transforming the problem into a convex form.

Design of optimization algorithm
Note that 1 is related to transmission rate and the probability of each mode's selection. The coupling among 1 , β , and α makes transforming the objective function into a convex form difficultly. To overcome these difficulties, we propose to address problem P 1 in an alternative manner. Specifically, we firstly solve problem P 1 with respect to α and β for fixed 1 . Then, we solve problem P 1 with respect to 1 for fixed α and β . Do iteration until convergence.
When the value of 1 is given, the value of M i , i ∈ , and transmission rate R i , r i , i ∈ , are all known. By taking various expressions which had been illustrated above into the problem, the objective function and constraints of problem P 2 are shown as bellow.
where the constraints C6 and C7 come from C1 when i=1 and 2, respectively. The constraints C8 and C9 come from C2 when i=1 and 2. The constraints C10 and C11 come from C4 when i=1 and 2.
In problem P 2 , the objective function and the constraint C8 exist product relationships between variables α 1 and β . It is obviously that the objective function and constraint C8 are not convex. The remaining constraints are linear. Before solving this problem, it is necessary to transform them into convex forms. In the arithmetic geometric mean inequality theorem, for real numbersa, b, there exists a 2 + b 2 ≥ 2ab . So a 2 +b 2 2 is the upper bound of the value of ab. Based on arithmetic geometric mean inequality theorem, problem P 2 is relaxed to problem P 3 whose objective and constraints are transformed according to variables α and β.

(15)
The second derivative of the objective and constraints of problem P 3 with respect to the variable α and β are greater than or equal to 0. Thus, the problem P 3 is a convex problem, which can be solved by CVX tool easily and efficiently. When the values of α and β are given, the optimal solution of 1 can be obtained via solving the following problem P 4 . The expression of the objective is same as the objective in problem P 3 . However, the unknown variable is 1 in problem P 4 . Thus, the constraint is related to variable 1 in problem P 4 as constraint C5.
where (16) 1 − 1 1 + T i B 1 σ 2 /p 1 i π P 4 is a nonlinear constrained optimization problem which only contains variable 1 . We can get the range of 1 from the constraint C5 and record as min ≤ 1 ≤ max . There only exists one inequality constraint in P 4 , thus we can get the optimal value of 1 by interior point penalty function method [30]. The main idea of penalty function method is to transform nonlinear constrained optimization problem into nonlinear unconstrained optimization problem. Firstly, define barrier function where r is a very small positive number. In this way, when 1 is close to min or max , G( 1 , r) is tending to infinity. Otherwise,G( 1 , r) ≈ P( 1 ) . Thus, we can solve P 5 to get the optimal value of 1 equivalently. P 5 is a nonlinear unconstrained optimization problem and can be solved by one dimensional linear search method. The derivative of the objective can be solved by Newton's method [31]. The derivative of G( 1 , r) with respect to 1 is denoted as g( 1 , r) . For one dimensional search function g( 1 , r) , suppose that a close point to the extreme minimum point has been given as δ 0 . Near the point δ 0 , we use a quadratic function (δ, r) to approximate the original function g(δ, r) . The original function is obtained by Taylor expansion as where g ′ (δ 0 , r) = dg(δ,r) dδ | δ=δ 0 , g ′′ (δ 0 , r) = d 2 g(δ,r) d(δ) 2 | δ=δ 0 . Then the extreme minimum point of the quadratic function ( 1 , r) is used as the new close point to the extreme minimum point of G(δ, r) , and record as δ 1 . According to the necessary conditions of extreme value, δ 1 = δ 0 − g ′ (δ 0 ,r) g ′′ (δ 0 ,r) can be drawn from d (δ,r) dδ = 0 . Further we can get the update formula as δ m+1 = δ m − g ′ (δ m ,r) g ′′ (δ m ,r) . The algorithm is shown in Algorithm 1. According to the definition of G( 1 , r) , the smaller the r is, the closer the solution of P 5 to the solution of P 4 . Thus, we adopt Series Unconstrained Minimization Method (SUMT) to make the solution of P 5 more closer to the solution of P 4 [30]. Set an infinite penalty factor series { r k } which is strictly monotonic decreasing and tending to zero. Then solve G( 1 , r k ) according to each r k until meet the iterative termination requirement. The complete algorithm of solving P 4 is shown in Algorithm 2.
Finally, take the 1 which is obtained by Algorithm 2 back to the problem P 3 . 1 is a known value in P 3 and then derive optimized value of α and β by CVX tool. After that, we solve problem P 4 with fixed α and β . In conclusion, the algorithm for solving P is firstly solving problem P 3 with respect to α and β for fixed 1 . Then, we solve problem P 4 with respect to 1 for fixed α and β . When we solve problem P 3 with respect to α and β for fixed 1 , the value of P with optimized α and β is smaller than before. Similarly, when we solve problem P 4 with respect to 1 for fixed α and β , the value of P with optimized 1 is smaller than before. Thus, the algorithm of solving P 2 is convergent, and it is shown in Algorithm 3.

Simulation results and analysis
In this section, the impact of N, n 1 , and n 2 on latency, computing ratios, expect charge are evaluated by using MATLAB with CVX tool. The simulation parameters are listed as follows in Table 2. Figure 2a, b show the delay and charge of the offloading system with an increasing data size N when n 1 = 1200, n 2 = 800 . The delay and the charge of the system increase with the increasing of the data size. Compared with local computing, the proposed offloading strategy can improve the QoS by saving about 4 seconds and 1.5 yuan when facing the same data size of the computing task under simulation parameters we set. This is because the objective function is a balance of energy consumption and delay at each layer. Thus, it will not only charge less, but also spend less time than local computing.
Next the computing ratios of each layers in mode 1, mode 2, and allocation of F-APs' distribution density versus the value of data size are shown in Fig. 3a, b, and Fig. 4, where n 1 = 1200, n 2 = 800 . In Fig. 3a, with the increasing of data size, the UE firstly computes none, and then the computing ratio of the UE keeps increasing. The computing ratio of the F-AP is firstly unchanged, then increasing, and finally decreasing. The computing ratio of the cloud is firstly unchanged, then decreasing, and finally decreasing. Staying unchanged when the data size is smaller than 1000 bits is because that, the optimal data size which computed at each layer to minimize the charge is smaller than its receive capacity. When the data size becomes larger than 1000 bits and smaller than 1200 bits, the data which is optimized to offload to the cloud is larger than its receive capacity. Thus, the computing ratio of the cloud decreases. Meanwhile, the data which is optimized to offload to the F-AP is smaller than its receive capacity. That is why the computing ratio of the F-AP increases with the increase of data size of the task. When data size is larger than the F-AP's receive capacity, the UE needs to compute the part which is larger than n 1 . Thus, when the data size of the task is larger than n 1 , the larger the data  size is, the more ratio of the task the UE needs to compute. Meanwhile, both computing ratio of the F-AP and cloud decrease. In Fig. 3b, the cloud computes all the task while the UE computes none when the data size is smaller than n 2 . When the data size is larger than n 2 , the computing ratio of the UE keeps increasing while cloud's keeps decreasing. This is because when the optimized data size which is allocated to the cloud is smaller than its receive capacity, the computing ratios of the cloud and the UE stay unchanged. When the optimized offloaded data size is larger than n 2 , the amount of offloaded data is fixed at n 2 and the computing ratio of the cloud is decreasing while the computing ratio of the UE is increasing. The change of data size do not affect the optimal value of 1 as shown in Fig.4. This is due to the increase of data size has no relationship with the allocation of distribution density of F-APs. Figure 5a, b shows the expect charge and distribution density of F-APs versus the values of n 1 and n 2 , where N = 2000 . In Fig. 5a, the expect charge decreases with the increase of n 1 and n 2 . This is because the computing power of upper layers is larger than the UE, it could save charge by offloading. The optimized computing ratios at each layer are limited by the receive capacity of upper layers. Larger n 1 and n 2 mean the UE is permitted to offload more data to upper layers when do optimized allocation of the task. When receive capacity are larger than the optimized computing data size which allocated to corresponding layer, the computing ratios and charge stay unchanged with the increasing of n 1 and n 2 . In Fig. 5b, the distribution density of F-AP is hardly influenced by n 1 and n 2 unless n 1 and n 2 are small. This is because when the receive capacity of the F-AP is too small to receive offloaded data, the whole task is computed locally. In that case, the value of distribution density of the F-APs do not need optimization. When the receive capacities become larger, the UE can offload data to upper layers. The distribution density of the F-APs has to be optimized to minimize the charge of the offloading system. From the simulation we found that, there is no direct connection between the distribution density of F-AP and receive capacity when the UE can do offloading. Figure 6a-c shows the computing ratios at each layer in mode 1 versus the values of n 1 and n 2 , where N = 2000 . In Fig.6a, the UE's computing ratio decreases with the increase of n 1 and n 2 . This is because the UE will offload part of task to upper layers to save charge after optimization. The offloading size of data is limited by receive capacities. When the optimized allocated data size at upper layers is larger than their receive capacity, the UE  will offload as much as possible in the limit of receive capacity. In Fig. 6b, the F-AP's computing ratio will first increase then decrease to a stable value when n 2 keeps increasing. The increase is due to the UE is permitted to offload more data to the cloud through the F-AP with the increasing of n 2 . It leads to more data can be computed at the F-AP. However, when the receive capacity of the cloud keeps increasing, more data will be offloaded to the cloud to save charge and the computing ratio of the F-AP decreases. The F-AP's computing ratio will increase to a stable value when n 1 keeps increasing. This is because when the optimized offloaded data size is larger than the receive capacity of the F-AP, in order to save charge, the UE will offload as much as possible under the limit of the receive capacity of the F-AP. That is why it increases with the increasing of n 1 . When the receive capacity of upper layer is increasing to larger than the optimized allocated data size at corresponding layer, the computing ratios at each layer will stay unchanged with the increasing of receive capacities. In Fig. 6c, the computing ratio of the cloud is complemented with the sum of the UE's and the F-AP's. Figure 7a, b shows the computing ratios at each layer in mode 2 versus the values of n 1 and n 2 , where N = 2000 . In Fig. 7a, the computing ratio of the UE decreases when the receive capacities becomes larger. The computing ratio of the cloud is complemented with UE's with the increase of n 1 and n 2 as shown in Fig. 7b. The reason is similar to mode 1. This is because when the optimized offloaded data size is larger than the receive capacity of the cloud, in order to save charge, the UE will offload as much as possible under the limit of the receive capacity. When the receive capacity of upper layer further increases to the value which is larger than the optimized allocated data size at the cloud, the computing ratios will stay unchanged with the increasing of receive capacities. Compared with mode 1, the computing burden on the cloud is larger when there is no edge severs.

Conclusion
In this paper, a mixed MEC/MCC system based on offloading computing was investigated, which joint optimized the computing ratios at each layer and distribution density of F-APs to minimize the expect charge. To address the non-convex problem, we had proposed ICONP algorithm to solve it. The suboptimal computing ratios of the computing task at each layers were obtained by fixing the value of the density of F-APs and using geometric mean inequality to transform the problem into a convex form. The density of APs was obtained via nonlinear unconstrained programming. The computing ratios and the density of F-APs were solved iteratively. Our simulation results verified that the proposed system can achieve better performance than computing the whole task locally in respects of the charge and the delay. Actually, the research in our paper does not consider the interference between multi-cell and multi-user which indeed exists in real life. Meanwhile, the cost of calculation of optimization problem is not taken into account. Thus, there are several future directions of interest to pursue based on our work. It is interesting to study the multi-user and multi-M-AP coordinated communication under mobile edge computing to overcome the limitation of our work in this paper. In this case, inter-user interference and multiuser game on resources will be taken into consideration. It is also meaningful to consider the cost when deal with the optimization problem. Meanwhile, machine learning is a hot research topic at present. The way to combine machine learning with mobile edge computing effectively is also worth studying in the future.
The probability of choosing mode i, i ∈ , can be derived by where B 1 and p 1 are transmission bandwidth and power of the UE. σ 2 is the mean noise power per Hz. |h 1 | 2 ∼ exp(1) characterize the exponentially distributed fading power over the flat Rayleigh fading channel between the UE and the selected AP. �L i � −ζ f denotes the path loss of mode i and ζ f is the path loss exponent, where L i is the distance between the UE and the selected AP. f (l i ) = 2 i πl i e − i π l i 2 is the probability density function(PDF) of the distance between UE and the nearest AP [25]. A closed form expression can be expressed as F ( i ) = 1 1+T i B 1 σ 2 /(p 1 i π) when ζ f = 1 . In this paper, we analyze the problem base on ζ f = 1.

Appendix B
For a positive continuous random variable A, E[A|A ≥ W ] = W Pr(A ≥ W ) + ∞ W Pr(A ≥ a)da [25]. Thus, the transmission rate between the UE and the selected AP in mode i, i ∈ is derived as bellow.

Appendix C
The expect distance between the selected AP and the cloud can be expressed as X i = ∞ 0 l i f (l i )dl i , i ∈ �. Suppose the distance between the UE and the cloud is H uc and the schematic plan of three points is in Fig. 8: where point R is the location of the selected AP, X i , i ∈ ,is the expect distance between the selected AP and the UE. The expect distance between the AP and the cloud is calculated as the average distance between the point R and the point (H uc , 0). where |h 2 | 2 ∼ exp(1) characterize the exponentially distributed fading power over the flat Rayleigh fading channel between the AP and the cloud, E[|h 2 | 2 ] = 1 . �D i � −ζ c denotes the path loss, B 2 σ 2 2 represents the noise power received by the Cloud. Thus,

Thus the transmission rate from AP to the cloud is
Received: 15 May 2018 Accepted: 6 January 2021