I Introduction
With the evergrowing 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
[21, 3]. 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 [9, 1], where computationintensive 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 realtime applications. Mobileedge 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 computationintensive tasks and to prolong the battery lifetime of mobile devices. It has attracted lots of attentions from both industries [9, 2] 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 computingintensive tasks to MEC servers to prolong the battery life of their mobile devices. To meet stringent delay requirement of an offloaded task for delaysensitive 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 CPUcycle 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 mixedinteger 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 introduces 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 mobileedge computing model that includes the energy consumption of offloading tasks to MEC through wireless transmission and the processing delay of offloaded tasks in MEC.
Iia Network model
We consider a mobileedge computing network (MEC) that consists of numbers of Access Points (AP) and servers. Denote by the set of the servers in the network and 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 differentsized 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.
IiB Local computing at the mobile device
Let denote a task, where (in bits) is the input size of the task and is the execution deadline, i.e., if the task is to be executed, it should be finished within time units. For convenience, denote by the mobile device of the task. Let
be a binary variable, where
if the task is partially offloaded to server and otherwise for all with , and if there is part of the task to be processed at the mobile device. Denote by the percentage of task offloaded to server with . Then, we have(1) 
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 the number of CPU cycles required for processing one bit of task , which usually is given and can be obtained through offline measurements [17]. Hence, the number of CPU cycles needed for processing local chunk of task is ^{*}^{*}* is truncated to a nearest integer if it is not an integer.. Since the CPUcycle frequencies of the mobile device are adjustable through DVFS techniques to reduce the energy consumption, denote by the CPU frequency of the mobile device at the th CPU cycle with , which is constrained by as follows.
(2) 
As a result, the local execution delay of is defined as
(3) 
and the energy consumption of the local execution of is
(4) 
where the constant is the effective switched capacitance that depends on the chip architecture [14].
IiC Server computing in MEC
The mobile device offloads its tasks to MEC via the AP. Such task offloading involves two important metrics: the endtoend 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 endtoend delay consists of the transmission delay from the mobile device to the AP, the transmission delay of task chunks of 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 denote the maximum achievable uplink transmission rate between the mobile device and the AP which is given in advance. Then, the transmission delay of task chunks of from the mobile device to the AP is
(5) 
where is the percentage of 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 (), i.e., the number of servers in MEC to serve a task cannot exceed , because it is inefficient and impractical to offload a task to all servers in a largescale 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 denote the transmission rate between the AP and server which is given as well. Then, the transmission delay of the corresponding subtask from the AP to server is
(6) 
Let be the computational capability of server (i.e., CPU cycles per second). The processing delay for executing the subtask on server is
(7) 
where is the number of CUP cycles required for onebit data processing. An offloaded task is finished when all of its subtasks are finished. The endtoend delay of the offloaded task thus is defined as the maximum endtoend delay among all subtasks processed in servers, while the endtoend delay of a subtask in server is defined as the sum of the transmission delays from the mobile device to the AP and from the AP to each chosen server and the task processing delay in . Then, is defined as
(8) 
Notice that does not consider the downlink transmission delay, since the downlink data size of is negligible compared with [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 the transmission power of the mobile device. We then define the amount of energy consumed by transmitting the task chunks of from the mobile device to the AP as follows.
(9) 
where is an indicator function with if is true and otherwise. 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].
IiD Problem formulation
We define a delayenergy joint optimization problem for a task offloading of 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.
minimize  (12)  
s.t.  
where is a coefficient that strives for the tradeoff between the total energy consumption and the overall delay incurred by the task execution [11, 16, 13], , and are variables appeared in Eq. (1) – Eq. (9), is the total amount of energy consumed by the mobile device for task , and is the overall delay of the task execution which is the maximum of the local execution time at the mobile device and the endtoend delay in MEC.
Iii A relaxation of the delayenergy joint optimization problem
In this section we deal with a relaxation of the problem by providing an optimal solution to the relaxed one as follows.
Iiia Overview of the proposed algorithm
is a mixed integer nonlinear program problem due to the binary variable with in Constraints (1) and (12) and nonlinear constraints (3) and (4).
We eliminate by assuming that the subset of servers for task execution while meeting its over delay requirement is given. Then, problem is relaxed to a nonlinear program (Section III.B).
Notice that the optimal solution to later will be used to find an optimal subset of servers for the execution of task (Section IV.A), and an algorithm is then devised for problem in Section IV.B.
IiiB Problem relaxation
includes integer variables and real number variables and ^{†}^{†}†The CPUcycle frequencies are integers. While is a very large integer, often near to . Hence, we can truncate the real number value of to an integer, which hardly impacts the analysis.. We substitute with to eliminate integer variables and drop the tail energy in .
Denote by the set of selected servers for task while the execution of the offloaded subtasks in MEC meets the overall delay of the task, where , , and . Hence, Having determined the chosen servers to allocate the subtasks of Task , problem now can be relaxed into a nonlinear program as follows.
(22)  
s.t.  
where and are variables. Constraints (22) and (22) in are equivalent to Constraints (1), (12) and (12) in . The difference between the objectives of and is . Recall that , , , and are constants.
We assume in this paper, i.e., the amount of energy consumed for executing a task with size 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 is greater than 0.
IiiC Solution to the relaxed problem
To solve problem , we distinguish it into two cases: Case 1. ; and Case 2. . We adopt a strategy of solving through the transformation of problem into another nonlinear program without the variable , i.e., the CPUcycle frequency. We then solve the nonlinear program as follows.
Case 1. The local execution delay is no less than the endtoend delay , and thus determines the overall delay. Problem then can be rewritten as the following problem .
(24)  
s.t.  
In the following we solve problem by first solving its simplified version that focuses on CPU frequencies, and then extending this simplified solution to solve .
Let , and let be the sum of the first and third terms in the optimization objective of that includes CPUfrequency variable only, i.e.,
(25) 
The partial derivative of with respect to is
(26) 
where .
If , the only stationary point of is for all with , and the minimum value of is . Otherwise, we have , and reaches the minimum value of when for all with .
In summary, to achieve the minimum value of , each with must be set as follows.
(27) 
Having the solution to , we now solve problem whose objective is the sum of term and . Notice that (i) is a function of variables and , while item is the function of variable only. Thus, the objective function of is the sum of functions and . Before we solve , we present the following lemma.
Lemma 1.
Given three functions , and , where and are both sets, then we have that
Proof.
The proof can be obtained by contradiction. Let be the optimal solution for . Assume that is not the optimal solution for . Then there must exist a satisfying
which contradicts that is the minimum. Therefore, the assumption is not true and is the optimal solution for , i.e., the optimal solution for should be in
Lemma 1 then follows. ∎
Following Lemma 1, we rewrite the optimization objective of by replacing its terms with . We term this transformed optimization problem as problem , which is defined as follows.
(28)  
s.t.  
It can be seen that
is a linear program, which can be solved in polynomial time.
Case 2. If the local executing delay is no greater than the endtoend delay , problem can be rewritten as problem as follows.
(29)  
s.t.  
We adopt the similar strategy for solving as we did for . It can be seen the objective function of consists of two functions: function has variables and ; and function has variables as is a function of with .
By Lemma 1, we first determine the value of each to minimize the value of function as follows.
By Inequalities (2) and (29), we have
(30) 
By Inequality (30), we have
(31) 
Denote by .
Then, by Inequality (29).
By Jensen’s inequality (see the appendix), we then have
(32) 
Hence, reaches the minimum when for all with . Then, .
Problem is then derived as follows, by replacing in with .
(33)  
s.t.  
Lemma 2.
is equivalent to .
Proof.
It can be seen that problem is a special case of problem when . Under Case 1, is equivalent to ; while under Case 2, is equivalent to . Hence, is equivalent to . ∎
The rest is to solve the nonlinear program problem – . Before we proceed, we have the following lemma.
Lemma 3.
If is a realvalued function of two variables of and , which is defined whenever and and and are two domains. Then
(34) 
Proof.
We show the claim by contradiction. It can be seen that
Assuming that is the optimal solution of . That is,
(35) 
Suppose the claim (34) does not hold, and we assume that
It can be seen that the objective function of contains variables and . Denote by the objective function of which is defined as follows.
(36) 
To minimize , we first determine the range of with respect to in order to meet Eq. (24). We then transform problem into a problem with respect to only, by adopting Lemma 3. The range of is determined by the following lemma.
Lemma 4.
The range of with respect to is
(37) 
where
(38)  
(39)  
(40) 
reaches the minimum when
(41) 
Proof.
Recall that by Eq. (24). Determining the range of is equivalent to determining the upper and lower bounds of (), subject to that with .
We first derive the upper bound of . As and , we have . Hence, holds.
We then derive the lower bound of , i.e., . As term is independent of , we will focus on term . In the following we show that reaches the minimum when by contradiction.
Without loss of generality, we suppose that the optimal solution of satisfies that . Then, . We now show that by contradiction. Assume that , we then can have another feasible solution for , where
Since , the value of under is . is better than . This leads to a contradiction that is the optimal solution to the problem. Therefore,
That is, reaches the minimum when Eq. (41) holds. We thus have , thereby . Inequalities 37 thus hold. ∎
Since is a function of , is also a function of too.
Lemma 5.
is equivalent to function , where is defined as follows.
(42) 
where
(43)  
(44)  
(45)  
(46) 
Proof.
The partial derivative of with respect to is . Let , its solution is . If , i.e., , is a monotonically decreasing function. Hence, we have , which can be rewritten as . Similarly, we can obtain the results for and . ∎
Problem can be solved by finding the minimum value of , while the minimum value of is the minimum one among , and that are defined as follows. For convenience, denote with the minimum value of in its domain.
Lemma 6.
The minimum values of and respectively are
(47)  
(48)  
(49) 
where satisfies
(50)  
(51) 
Proof.
Since function defined in Eq. (45), we have that . Hence, .
We now find the minimum value of . The derivative of is
where .
We define as follows.
As is a strictly monotonically increasing function with respect to , we have . The rest is to show that .
Therefore, has the only solution satisfying Eq. (51). Since is a monotonically increasing function with respect to , also has the only solution . Therefore, reaches its minimum