{'fraction_non_alphanumeric': 0.04471758852794849, 'fraction_numerical': 0.015832601697395376, 'mean_word_length': 3.8175666149725083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Delay-Energy Joint Optimization for Task Offloading in Mobile Edge Computing

Mobile-edge computing (MEC) has been envisioned as a promising paradigm to meet ever-increasing resource demands of mobile users, prolong battery lives of mobile devices, and shorten request response delays experienced by users. An MEC environment consists of many MEC servers and ubiquitous access points interconnected into an edge cloud network. Mobile users can offload their computing-intensive tasks to one or multiple MEC servers for execution to save their batteries. Due to large numbers of MEC servers deployed in MEC, selecting a subset of servers to serve user tasks while satisfying delay requirements of their users is challenging. In this paper, we formulate a novel delay-energy joint optimization problem through jointly considering the CPU-cycle frequency scheduling at mobile devices, server selection to serve user offloading tasks, and task allocations to the selected servers. To this end, we first formulate the problem as a mixed-integer nonlinear programming, due to the hardness to solve this nonlinear programming, we instead then relax the problem into a nonlinear programming problem that can be solved in polynomial time. We also show how to derive a feasible solution to the original problem from the solution of this relaxed solution. We finally conduct experiments to evaluate the performance of the proposed algorithm. Experimental results demonstrate that the proposed algorithm is promising.


I. INTRODUCTION
With the ever-growing popularity of portable mobile devices, including smartphones, tablets, and so on, more and more new mobile applications, such as face recognition and augmented reality, are emerging and have attracted lots of attentions from not only cloud operators but also cellular carriers of the Telecom companies [3], [21]. These emerging applications typically demand intensive computation and high energy consumption. However, mobile devices have limited computation resources and battery life, which become the bottleneck of meeting the quality of experience (QoE) of mobile users.
A traditional approach to overcome the limitation on computation resource and battery life of mobile devices is to leverage cloud computing [1], [9], where computation-intensive tasks from mobile devices are offloaded to remote clouds for processing. However, the long latency between mobile devices and remote clouds sometimes is unacceptable for delaysensitive real-time applications. Mobile-edge computing (MEC) has been introduced in recent years that provides abundant computing resource to mobile users in their close proximity, and mobile users can offload their tasks to one or multiple nearby MEC servers for processing. MEC thus has great potentials to reduce the overall processing delay of computation-intensive tasks and to prolong the battery lifetime of mobile devices. It has attracted lots of attentions from both industries [2], [9] and academia [1], [6], [13].
A fundamental problem in MEC is the scheduling of offloading tasks, which poses great challenges. For example, due to the limited battery capacity and computation resource, mobile users usually offload their computing-intensive tasks to MEC servers to prolong the battery life of their mobile devices. To meet stringent delay requirement of an offloaded task for delay-sensitive applications such as interactive gaming and augmented reality, each offloaded task needs to be partitioned into multiple chunks and be offloaded to different servers for processing. It becomes critical to optimally allocate tasks from mobile devices to MEC servers in order to minimize the energy consumption of mobile devices while meeting delay requirements of mobile users. Furthermore, when a task is executed on a mobile device, the amount of energy consumed at the mobile device can be minimized by optimally scheduling the CPU-cycle frequency of the mobile device via Dynamic Voltage and Frequency Scaling (DVFS) [18]. It is worth noting that task allocation needs to be considered with the CPUcycle frequency scheduling. When performing a task allocation, which size of part of the task should be processed locally, i.e., the number of chunks of the task to be executed on its local mobile device, needs to be determined too. In this paper we will address the mentioned challenges.
The novelty of this paper lies in the formulation of a delayenergy joint optimization problem in MEC and a novel solution to the problem is provided through a series of reductions.
The main contributions of this paper are summarized as follows.
• We study task offloading from mobile devices to MEC.
We formulate a novel delay -energy joint optimization problem for task offloading in MEC that jointly takes into account both response delays and energy consumptions on mobile devices. • We first formulate a mixed-integer nonlinear program for the problem, we then relax the problem into a nonlinear program problem that can be solved in polynomial time.
We later show how to derive a feasible solution to the problem from the solution of the relaxed problem. • We finally evaluate the performance of the proposed algorithm for the joint optimization problem through experimental simulation. Experimental results demonstrated the proposed algorithm is very promising, and outperforms its analytical solution as the theoretical estimation is conservative.
The rest of this paper is organized as follows. Section II intro-arXiv:1804.10416v1 [cs.NI] 27 Apr 2018 duces the network model and problem formulation. Section III provides a solution to the relaxed version of the problem, and Section IV shows how to derive a feasible solution to the original problem for the solution to the relaxed one. Section V evaluates the performance of the proposed algorithm through experimental simulations. Section VI surveys related works, and Section VII concludes the paper.

II. PRELIMINARIES
In this section, we first introduce the network model. We then introduce the local computing model at each mobile device, including the local execution delay and the energy consumption. We finally introduce the mobile-edge computing model that includes the energy consumption of offloading tasks to MEC through wireless transmission and the processing delay of offloaded tasks in MEC.

A. Network model
We consider a mobile-edge computing network (MEC) that consists of numbers of Access Points (AP) and servers. Denote by S = {s 1 , s 2 , · · · , s N } the set of the servers in the network and N is the number of servers in the MEC, as shown in Fig. 1. For the sake convenience, we here consider a single mobile device (MD) who accesses a nearby AP to offload his tasks for processing, and we further assume that there is neither wireless channel interferences at the AP nor overloading issues on the servers. We adopt the similar assumptions imposed on each offloading task [14], that is, each task can be arbitrarily divided into different-sized chunks and processed at different servers and/or local mobile devices. We assume that the global information of servers in MEC is given at the AP. For a given task, whether it is offloaded to MEC entirely or how much proportion of the task will be processed by its mobile device locally, it will determined by a central system scheduler through the AP, which is responsible for the decision and distribution of task chunks to different servers in MEC.

B. Local computing at the mobile device
Let A(L, τ d ) denote a task, where L (in bits) is the input size of the task and τ d is the execution deadline, i.e., if the task is to be executed, it should be finished within τ d time units. For convenience, denote by s 0 the mobile device of the task. Let z i be a binary variable, where z i = 1 if the task is partially offloaded to server s i and z i = 0 otherwise for all i with 1 ≤ i ≤ N , and z 0 = 1 if there is part of the task to be processed at the mobile device. Denote by η i the percentage of task A(L, τ d ) offloaded to server s i with 0 ≤ η i ≤ 1. Then, we have A mobile device can execute its task locally. This incurs the local execution delay and energy consumption at the mobile device, while they are jointly determined by the number of CPU cycles of the mobile device. Denote by γ A the number of CPU cycles required for processing one bit of task A(L, τ d ), which usually is given and can be obtained through off-line measurements [17]. Hence, the number of CPU cycles needed for processing local chunk of task Since the CPU-cycle frequencies of the mobile device are adjustable through DVFS techniques to reduce the energy consumption, denote by f w the CPU frequency of the mobile device at the wth CPU cycle with w = 1, · · · , W , which is constrained by f max as follows.
As a result, the local execution delay D l of A(L, τ d ) is defined as and the energy consumption E l of the local execution of where the constant κ is the effective switched capacitance that depends on the chip architecture [14].

C. Server computing in MEC
The mobile device offloads its tasks to MEC via the AP. Such task offloading involves two important metrics: the end-to-end delay between the time point that a mobile device offloads its task to the MEC and the time point that the execution result of the offloaded task received by the the mobile device; and the energy consumption of the mobile device on its transmission of the task chunks from the mobile device to the AP. Specifically, the end-to-end delay consists of the transmission delay from the mobile device to the AP, the transmission delay of task chunks of A(L, τ d ) from the AP to the servers, and the processing delay of task chunks in servers. In the following we give the detailed definition of these two metrics.
Let r h,p denote the maximum achievable uplink transmission rate between the mobile device and the AP which is given in advance. Then, the transmission delay D lp of task chunks of A(L, τ d ) from the mobile device to the AP is where z 0 η 0 is the percentage of A(L, τ d ) processed locally. The task chunks then are distributed to different servers in MEC once the mobile device finishes its task transmission. We assume that the number of servers in MEC to which a task can be offloaded is limited by a given integer m (m ≤ N ), i.e., the number of servers in MEC to serve a task cannot exceed m, because it is inefficient and impractical to offload a task to all servers in a large-scale MEC. Since there is no contention for the computational capacity of the servers, the execution of the subtasks can start once the subtasks are offloaded to the servers.
Let r i denote the transmission rate between the AP and server s i which is given as well. Then, the transmission delay D i ps of the corresponding subtask from the AP to server s i is Let c i be the computational capability of server s i ∈ S (i.e., CPU cycles per second). The processing delay D i sc for executing the subtask on server s i is where γ A is the number of CUP cycles required for onebit data processing. An offloaded task is finished when all of its subtasks are finished. The end-to-end delay R max of the offloaded task thus is defined as the maximum end-to-end delay among all subtasks processed in servers, while the end-to-end delay of a subtask in server s i is defined as the sum of the transmission delays from the mobile device to the AP and from the AP to each chosen server s i and the task processing delay in s i . Then, R max is defined as Notice that R max does not consider the downlink transmission delay, since the downlink data size of A(L, τ d ) is negligible compared with L [5]. However, the analysis techniques and the proposed algorithms in this paper are still applicable if the downlink transmission delay must be considered.
Denote by P tx the transmission power of the mobile device. We then define the amount of energy consumed E lp by transmitting the task chunks of A(L, τ d ) from the mobile device to the AP as follows.
where 1{x} is an indicator function with 1{x} if x is true and 1{x} = 0 otherwise. E t is the tail energy due to that the mobile device will continue to hold the channel for a while even after the data transmission [8].

D. Problem formulation
We define a delay-energy joint optimization problem P 0 for a task offloading of A(L, τ d ) in MEC with the optimization objective to minimize the weighted sum of the energy consumption at the mobile device and the overall delay of the task execution.
(1) − (9), where α is a coefficient that strives for the tradeoff between the total energy consumption and the overall delay incurred by the task execution [11], [13], [16], z i , η i and f w are variables appeared in Eq. (1) -Eq. (9), E l + E lp is the total amount of energy consumed by the mobile device for task A(L, τ d ), and max{D l , R max } is the overall delay of the task execution which is the maximum of the local execution time at the mobile device and the end-to-end delay in MEC. Constraint (10) indicates that the task can be divided into multiple subtasks and offloaded to different servers. Constraint (11) requires that the number of selected servers is no greater than a given value m, while Constraint (12) is the deadline requirement of task A(L, τ d ).

III. A RELAXATION OF THE DELAY-ENERGY JOINT OPTIMIZATION PROBLEM
In this section we deal with a relaxation of the problem P 0 by providing an optimal solution to the relaxed one as follows.
A. Overview of the proposed algorithm P 0 is a mixed integer nonlinear program problem due to the binary variable (1) and (11) and nonlinear constraints (3) and (4).
We eliminate z i by assuming that the subset of servers S s for task execution while meeting its over delay requirement is given. Then, problem P 0 is relaxed to a nonlinear program P 1 (Section III.B).
Notice that the optimal solution to P 1 later will be used to find an optimal subset of servers for the execution of task A(L, τ d ) (Section IV.A), and an algorithm is then devised for problem P 0 in Section IV.B.

B. Problem relaxation
P 0 includes integer variables z i and real number variables η i and f w † . We substitute z i η i with x i to eliminate integer variables and drop the tail energy E t in P 0 .
Denote by S s = {s j1 , · · · , s jn } ⊂ S the set of n selected servers for task A(L, τ d ) while the execution of the offloaded subtasks in MEC meets the overall delay of the task, where 0 < n ≤ m, z ji = 1, and i = 1, · · · , n. Hence, Having determined the chosen servers to allocate the subtasks of Task A(L, τ d ), problem P 0 now can be relaxed into a nonlinear program P 1 as follows.
where x i and f w are variables. Constraints (13) and (14) in P 1 are equivalent to Constraints (1), (10) and (11) in P 0 . The difference between the objectives of P 0 and P 1 is φ + E t .
Recall that z ji , c ji , γ A , and r h,p are constants. We assume κ B0x0 w=1 f w 2 > P tx x 0 L/r h,p in this paper, i.e., the amount of energy consumed for executing a task with size x 0 L at the mobile device is greater than that for transmitting the task chunks from the mobile device to the AP without considering the tail energy. Hence, the value of Problem P 1 is greater than 0.
C. Solution to the relaxed problem P 1 To solve problem P 1 , we distinguish it into two cases: Case 1. D l ≥ R max ; and Case 2. D l ≤ R max . We adopt a strategy of solving P 1 through the transformation of problem P 1 into another nonlinear program without the variable f w , i.e., the CPU-cycle frequency. We then solve the nonlinear program as follows.
Case 1. The local execution delay D l is no less than the end-to-end delay R max , and thus determines the overall delay. Problem P 1 then can be rewritten as the following problem P 2 . (13) and (14) B0x0 In the following we solve problem P 2 by first solving its simplified version that focuses on CPU frequencies, and then extending this simplified solution to solve P 2 .
Let B = B 0 x 0 , and let F (f 1 , · · · , f B ) be the sum of the first and third terms in the optimization objective of P 2 that includes CPU-frequency variable f w only, i.e., The partial derivative of where w = 1, · · · , B.
In summary, to achieve the minimum value of F (f 1 , · · · , f B ), each f w with 1 ≤ w ≤ B must be set as follows.
Having the solution to F (f 1 , · · · , f B ), we now solve problem P 2 whose objective is the sum of term −φx 0 and is a function of variables x 0 and f w , while item −φx 0 is the function of variable x 0 only. Thus, the objective function of P 2 is the sum of functions F (f 1 , · · · , f B ) and −φx 0 . Before we solve P 2 , we present the following lemma. Lemma 1. Given three functions g 1 (x, y), g 2 (x) and , where x and y are both sets, then we have that Proof. The proof can be obtained by contradiction. Let {x * , y * } be the optimal solution for min g 3 (x, y). Assume that y * is not the optimal solution for min y g 1 (x * , y). Then there must exist a y satisfying which contradicts that g 3 (x * , y * ) is the minimum. Therefore, the assumption is not true and y * is the optimal solution for min y g 1 (x * , y), i.e., the optimal solution for min g 3 (x, y) should be in Lemma 1 then follows.
Following Lemma 1, we rewrite the optimization objective of P 2 by replacing its terms κ . We term this transformed optimization problem as problem P 3 , which is defined as follows. (13), (14), (18), and(19, It can be seen that P 3 is a linear program, which can be solved in polynomial time. Case 2. If the local executing delay D l is no greater than the end-to-end delay R max , problem P 1 can be rewritten as problem P 4 as follows. (13), (14) and (24), We adopt the similar strategy for solving P 4 as we did for P 2 . It can be seen the objective function of P 2 consists of two functions: function κ B0x0 w=1 f w 2 has variables f w and x 0 ; and function −φx 0 + αR max has variables x i as R max is a function of x i with 0 ≤ i ≤ n. By Lemma 1, we first determine the value of each f w to minimize the value of function κ B0x0 w=1 f w 2 as follows.
Proof. It can be seen that problem P 3 is a special case of problem P 5 when R max = (B 0 x 0 )/f m . Under Case 1, P 1 is equivalent to P 3 ; while under Case 2, P 1 is equivalent to P 5 . Hence, P 1 is equivalent to P 5 .
The rest is to solve the nonlinear program problem -P 5 . Before we proceed, we have the following lemma.
Lemma 3. If f (·) is a real-valued function of two variables of x and y, which is defined whenever x ∈ X and y ∈ Y and X and Y are two domains. Then Assuming that {x * , y * } is the optimal solution of min x∈X,y∈Y f (x, y). That is, Suppose the claim (34) does not hold, and we assume that This leads to a contradiction. The lemma thus follows.
It can be seen that the objective function of P 5 contains variables x 0 and R max . Denote by H(x 0 , R max ) the objective function of P 5 which is defined as follows.
To minimize H(x 0 , R max ), we first determine the range of R max with respect to x 0 in order to meet Eq. (24). We then transform problem P 5 into a problem with respect to x 0 only, by adopting Lemma 3. The range of R max is determined by the following lemma.
R max reaches the minimumQ(1 − x 0 ) when Proof. Recall that R max = max 1≤i≤n {R i } by Eq. (24). Determining the range of R max is equivalent to determining the upper and lower bounds of max 1≤i≤n We then derive the lower bound of R max , i.e., min max 1≤i≤n {q i x i + q 0 (1 − x 0 )}. As term q 0 (1 − x 0 ) is independent of R max , we will focus on term q i x i . In the following we show that min max 1≤i≤n Q·qi by contradiction. Without loss of generality, we suppose that the optimal solution of min max 1≤i≤n {q i x i } satisfies that q 1 x 1 ≤ q 2 x 2 ≤ · · · ≤ q n x n . Then, q n x n − q 1 x 1 = ≥ 0. We now show that q n x n − q 1 x 1 = 0 by contradiction. Assume that q n x n − q 1 x 1 = > 0, we then can have another feasible solution for min max 1≤i≤n {q i x i } X = {x 1 , x 2 , · · · , x n−1 , x n }, where Since q n x n < q n x n , the value of min max 1≤i≤n {q i x i } under X is min{q n−1 x n−1 , q n x n } < q n x n . X is better than X . This leads to a contradiction that X is the optimal solution to the problem. Therefore, That is, min max 1≤i≤n {q i x i } reaches the minimum (1 − x 0 )/Q when Eq. (41) holds. We thus have Inequalities 37 thus hold.
Since R max is a function of x 0 , min Rmax H(x 0 , R max ) is also a function of x 0 too. where Proof. The partial derivative of H(x 0 , R max ) with respect to R max is ∂H(x0,Rmax) ∂Rmax = −2K is a monotonically decreasing function. Hence, we have min Rmax H(x 0 , R max ) = H(x 0 , (1 − x 0 )Q u ), which can be rewritten as h 2 (x). Similarly, we can obtain the results for R * Problem P 5 can be solved by finding the minimum value of h(x), while the minimum value of h(x) is the minimum one among h 1 (x), h 2 (x) and h 3 (x) that are defined as follows. For convenience, denote min h i (x) with 1 ≤ i ≤ 3 the minimum value of h i (x) in its domain.
Therefore, h 4 (y) = 0 has the only solution y * satisfying Eq. (51). Since y is a monotonically increasing function with respect to x, ∂h1(x) ∂x = 0 also has the only solution x * 0 . Therefore, h 1 (x) reaches its minimum h 1 (x * 0 ) when Eq. (50) and Eq. (51) hold. Similarly, h 2 (x) is a monotonically increasing function of x too, and reaches its minimum when x = Qu R * +Qu . Theorem 1. The optimal solution to problem P 1 is OP T (P Ss 1 ) when OP T (P Ss 1 ) = 3K where and the CPU-cycle frequency scheduling at the mobile device is and the corresponding overall delay is (1 − x * 0 )Q. Proof. According to Lemmas 5 and 6, we have is a monotonically increasing function, we have min h 3 (x) = h 3 ( R * Q R * +Q ). Notice that h 1 (x) and h 3 (x) represent the same point when Thus, the optimal solution to problem P 5 is h 1 (x * 0 ), which is also the optimal solution to P 1 as P 1 to P 5 is equivalent by Lemma 2. By Lemma 4, R max = (1 − x * 0 )Q when x i satisfies Eq. (54). Meanwhile, R max = R i with 1 ≤ i ≤ n. By the analysis of Case 2. in Section III.C, R max = D l and f w = B 0 x * 0 /R max . The overall delay max{D l , R max } = (1 − x * 0 )Q. We now rewrite OP T (P Ss 1 ) as a function ofQ. Eq. (50) can be rewritten as Hence, OP T (P Ss 1 ) can be simplified as where term αQ 3 in Eq. (57) is replaced by 2Ky * 3 + 3Ky * 2 − φQ 2 , following Eq. (51).

IV. ALGORITHM FOR THE DELAY-ENERGY JOINT OPTIMIZATION PROBLEM
In this section we solve the original problem P 0 , by making use of the result of problem P 1 . The relationship between P 0 and P 1 is given as follows. Let OP T (P 0 ) and OP T (P Ss 1 ) be the optimal solutions of P 0 and P 1 with the given server set S s , respectively. Notice that the set of servers S s allocated to for the subtask executions of task A(L, τ d ) in problem P 1 is given, under which an optimal solution for problem P 1 is achieved. In other words, given a different server set S s for P 1 , there is a different optimal solution OP T (P S s 1 ) for it. The general strategy for problem P 0 is to reduce it to P 1 by fixing the server set for each offloading task A(L, τ d ). Since there are multiple subsets of servers satisfying the overall delay τ d of task A(L, τ d ), the rest of this section will focus on identifying such a subset of servers that the optimal solution of P 1 is the minimum one, which corresponds an optimal solution to problem P 0 . Denote by OP T (P Let OP T local be the minimum value of the overall cost if task A(L, τ d ) is entirely executed at the mobile device. Then, OP T (P 0 ) is the minimum between OP T local and OP T (P Ss 0 1 ) + φ + E t , which is the minimum overall cost if the task is offloaded to MEC. The rest of this section thus focus on identifying the server set s 0 .

A. Server selection
We first derive the relationships between OP T (P Ss 1 ) and Q defined in (39) and between R max andQ. We then find the server subset s 0 in the MEC to serve task A(L, τ d ) based on these relationships. Lemma 7. OP T (P Ss 1 ) is a monotonically increasing function with respect toQ.
We now show that decreasing the value ofQ reduces the overall delay of the execution of task A(L, τ d ) by the following lemma.
Lemma 8. The overall delay of task A(L, τ d ) is a monotonically increasing function with respect toQ.
Proof. By replacing x 0 in Eq. (56) with x 0 = 1 − R max /Q by Theorem 1, y * can be expressed as follows.
By Theorem 1, the overall delay of the execution of task A(L, τ d ) is equal to R max , the overall delay thus is a monotonically increasing function ofQ.
Lemma 7 and Lemma 8 indicate that a smallerQ will result in a less overall delay and cost on the execution of task A(L, τ d ). In the following we aim to determine the range of Q.
We first determine an upper bound onQ to meet the overall delay requirement of task A(L, τ d ). We have (61) with τ d , and letQ * be the value ofQ to ensure the equality holds. By Lemma 8 and the property of the inverse function,Q is a monotonically increasing function of R max . Since R max ≤ τ d , we haveQ ≤Q * .
We then determine another upper bound onQ to meet the CPU-cycle frequency constraint. By Theorem 1, we have By Eq. (50) and ξ = y * /Q in Lemma 7, Inequality (66) can be rewritten as B 0 ξ ≤ f max . Thus, ξ ≤ fmax B0 . Eq. (59) can be rewritten by replacing ξ with f max /B 0 as follows.Q SinceQ is a monotonically increasing function of ξ by Lemma 7,Q should be no greater than . Therefore, the range ofQ is Q ≤ min{Q * ,Q max }.
Following its definition, the derivative ofQ with respect to Eq. (68) shows thatQ is an increasing function of q i , which implies that a smaller q i will correspond a smallerQ for each i with 1 ≤ i ≤ n. Thus, to minimizeQ, we should choose the first smallest n servers from the N servers in terms of the value of their q i .
Let j 1 , j 2 , · · · , j N be the index sequence of servers by sorting their q)i in increasing order, i.e., q jt ≤ q jt+1 with 1 ≤ t ≤ N − 1. Denote by Q(n) for any n with 1 ≤ n ≤ m ≤ N , which is defined as follows.
Recall that the number of servers selected to serve task A(L, τ d ) cannot exceed m, i.e., n ≤ m. Since Function Q(n) in Inequality (70) reaches the minimum when n = m. Therefore, the number of servers selected to serve task A(L, τ d ) should be m to achieve the minimum overall cost OP T (P 1 ) of its execution by Lemma 7. Therefore, we have the following lemma.
Lemma 9. Let s 0 = {s j1 , · · · , s jm } be the set of servers allocated to task A(L, τ d ) in problem P 1 to achieve the minimum cost OP T (P where y * m is the value of variable y m in the following equation. Proof. The subset of servers {s j1 , · · · , s jm } can be identified by Ineq. (70). By Theorem 1, Lemma 9 then follows.

B. Algorithm
Following the discussion in the very beginning in this section, the optimal solution OP T (P 0 ) to problem P 0 is the minimum one between OP T local and OP T (P Ss 0 1 ) + E t + φ, while OP T local can be expressed as  Proof. By Theorem 1 and Lemma 9, Algorithm 1 can find an optimal solution to the delay-energy joint optimization problem if Q(m) ≤ min{Q * , Q max }. Its time complexity analysis is quite obvious, which is O(N log N ) due to sorting.

V. PERFORMANCE EVALUATION
In this section, we evaluate the performance of the proposed algorithm for the delay-energy joint optimization problem through simulations. We also investigate the impacts on Algorithm 1 Task Offloading Scheduling (TOS) Input: N , m and q i with 1 ≤ i ≤ N . Output: x i and fw.
1: x i ← 0, where i = 0, 1, · · · , N ; 2: A sequence of servers j 1 , j 2 , · · · , j N is obtained by sorting their q i in increasing order; 3: Calculate Q(m) and y * m by Eq. (69) and (72), respectively; 4: Calculate OP T (P Q ← m i=1 1/q j i ; 12: Calculate x j k for all k with 1 ≤ k ≤ m by Eq. (54); 13: Calculate fw by Eq. (55); 14: return x j k for all k with 1 ≤ k ≤ m, and fw. 15: end if important parameters on the performance of the proposed algorithm.

A. Experimental settings
We set the number of servers in an MEC at N = 100, the data transmission rate between the AP and a server r i is uniformly distributed between 100 M bps and 1 Gbps. The computing capacity of a server c i is uniformly distributed between 1 GHz and 4 GHz. The transmission rate between the mobile device and the AP is set at r h,p = 2.5 Mbps and the transmission power of the mobile device P tx = 0.5 W. Besides, E t = 0.15 J, κ = 10 −26 , f max = 2 GHz, and the size of task A(L, τ d ) is L = 50 KB [15]. Assume that the computation intensity of the task is 700 cycles per bit [17]. Under these experimental settings, Q(m) ≤ min{Q * , Q max } holds.
To evaluate the proposed algorithm, Algorithm 1, three benchmark algorithms are introduced as follows.
• Local Execution: The entire task is executed at the mobile device and the CPU-cycle frequencies at the mobile device are scheduled to minimize the overall cost. The optimal value of this policy is OP T local . • MEC Execution: The entire task is offloaded to MEC.
Then the subset of servers to serve the task and the task allocation among the selected servers are both optimal. The difference between MEC Execution and TOS is that x 0 = 0 in MEC Execution policy. • Mixed Execution: The task is executed in both the mobile device and MEC. The difference between algorithms Mixed_Execution and TOS is in the setting of x 0 = 1/(1 + m) in algorithm Mixed_Execution.

B. Performance evaluation
We first evaluate the performance of algorithm TOS against benchmark algorithms Local_Execution, MEC_Execution, and Mixed_Execution, by varying both numbers of servers m and α. The overall costs delivered by different algorithms are normalized based on the overall cost delivered by TOS. Fig. 2 shows the overall costs of task execution delivered by the mentioned algorithms. We can see from Fig. 2 (a) that the overall cost by algorithm TOS is around 80% of those by algorithms MEC_Execution and Mixed_Execution, and 34% of that by algorithm Local_Execution when α = 20. In Fig. 2 (b), m = 5. Similarly, we can see from Fig. 2 (b) that algorithm TOS outperforms the other algorithms.

C. Impact of different parameters
We then study the impacts of important parameters: m and α on the overall delay and energy consumption of the proposed algorithm TOS.
We investigate the impact of the number of chosen servers m on the performance of algorithms TOS, Local_Execution, MEC_Execution, and Mixed_Execution in terms of the overall delay and the energy consumption on the mobile device. We vary m from 1 to 200 while fixing α at 20. It can be seen from Fig. 3 (a) that algorithm TOS has the minimum overall delay because of its optimal task allocation among the mobile device and the selected servers. Particularly, when m ≤ 8, it greatly impacts the overall delay by the mentioned algorithms; otherwise, its impact is negligible. Fig. 3 (b) shows that algorithm TOS is not energy-efficient as it requires local processing at the mobile device to minimize the overall delay when m ≤ 8; otherwise, its energy consumption impact is negligible.
We also evaluate the impact of parameter α on the performance of the mentioned algorithms in terms of the overall delay and energy consumption. It can be seen from Fig. 4 (a) that the increase on the value of α will shorten the overall delay of the task execution when α ≤ 70; otherwise, its impact on overall delay is negligible. However, as shown in Fig. 4 (b), algorithms TOS and Local_Execution will incur more energy consumption at the mobile device.

VI. RELATED WORK
MEC has attracted lots of attention from both industries and academia, see [14] for a comprehensive survey.
Many previous studies on MEC focused on designing a system to support task offloading and allocation [7], [10], [12], [15], [19], [20], [22], [23]. Several offloading frameworks including MAUI [7] and ThinkAir [10], were proposed to prolong the battery lifetime of mobile devices and reduce processing delays of computation tasks. Particularly, Liu et al. [12] introduced a delay-optimal task scheduling policy with random task arrivals for a single-user MEC system. For multiuser MEC systems, Chen et al. [5] proposed a distributed offloading algorithm which can achieve the Nash equilibrium to reduce wireless interferences. You et al. [22] designed a centralized task offloading system for MEC based on timedivision multiple access and orthogonal frequency-division multiple access. All of these mentioned work assumed nonadjustable processing capabilities of CPUs at mobile devices. However, it is energy inefficient as the energy consumption of a CPU increases super-linearly with its CPU-cycle frequency [4].
Several recent research has applied the dynamic voltage and frequency scaling (DVFS) technique into task offloading in an MEC environment. For example, Zhang et al. [23] proposed an      energy-optimal binary offloading policy, i.e., either executing a task on a mobile device or offloading the entire task to MEC, under stochastic wireless channels for a single-user MEC system with the DVFS technique. In addition, Sardellitti et al. [20] proposed an algorithm for both communication and computational resource allocations in multi-cell MIMO cloud computing systems. Mao et al. [15] studied an MEC system with energy harvesting devices and focused on reducing the energy consumption of mobile devices by scheduling CPUcycle frequencies.

VII. CONCLUSION
In this paper, we studied task offloading from mobile devices to MEC. We formulated a novel delay-energy joint optimization problem. We first formulated the problem as a mixed-integer nonlinear program problem. We then performed a relaxation to relax the original problem to a nonlinear programming problem whose solution can be found in polynomial time, and showed how to make use of the solution to the relaxed problem to find a feasible solution to the problem of concern in this paper. We finally evaluate the performance of the proposed algorithm thorough experimental simulations. Experimental results demonstrated that the proposed algorithm outperforms the three baselines.