Changsheng You, Kaibin Huang, Hyukjin Chae and Byoung-Hoon Kim C. You and K. Huang are with the Dept. of EEE at The University of Hong Kong, Hong Kong (Email: csyou@eee.hku.hk, huangkb@eee.hku.hk). H. Chae and B.-H. Kim are with LG Electronics, S. Korea (Email: hyukjin.chae@lge.com, bh.kim@lge.com). This work was supported by a grant from LG Electronics. Part of this work has been submitted to IEEE Globecom 2016.
###### Abstract

Mobile-edge computation offloading (MECO) offloads intensive mobile computation to clouds located at the edges of cellular networks. Thereby, MECO is envisioned as a promising technique for prolonging the battery lives and enhancing the computation capacities of mobiles. In this paper, we study resource allocation for a multiuser MECO system based on time-division multiple access (TDMA) and orthogonal frequency-division multiple access (OFDMA). First, for the TDMA MECO system with infinite or finite cloud computation capacity, the optimal resource allocation is formulated as a convex optimization problem for minimizing the weighted sum mobile energy consumption under the constraint on computation latency. The optimal policy is proved to have a threshold-based structure with respect to a derived offloading priority function, which yields priorities for users according to their channel gains and local computing energy consumption. As a result, users with priorities above and below a given threshold perform complete and minimum offloading, respectively. Moreover, for the cloud with finite capacity, a sub-optimal resource-allocation algorithm is proposed to reduce the computation complexity for computing the threshold. Next, we consider the OFDMA MECO system, for which the optimal resource allocation is formulated as a mixed-integer problem. To solve this challenging problem and characterize its policy structure, a low-complexity sub-optimal algorithm is proposed by transforming the OFDMA problem to its TDMA counterpart. The corresponding resource allocation is derived by defining an average offloading priority function and shown to have close-to-optimal performance in simulation.

## I Introduction

The realization of Internet of Things (IoT) [1] will connect tens of billions of resource-limited mobiles, e.g., mobile devices, sensors and wearable computing devices, to Internet via cellular networks. The finite battery lives and limited computation capacities of mobiles pose significant challenges for designing IoT. One promising solution is to leverage mobile-edge computing [2] and offload intensive mobile computation to nearby clouds at the edges of cellular networks, called edge clouds, with short latency, referred to as mobile-edge computation offloading (MECO). In this paper, we consider a MECO system with a single edge cloud serving multiple users and investigate the energy-efficient resource allocation.

### I-a Prior Work

Mobile computation offloading (MCO) [3] (or mobile cloud computing) has been extensively studied in computer science, including system architectures (e.g., MAUI [4]), virtual machine migration [5] and power management [6]. It is commonly assumed that the implementation of MCO relies on a network architecture with a central cloud (e.g., a data center). This architecture has the drawbacks of high overhead and long backhaul latency [7], and will soon encounter the performance bottleneck of finite backhaul capacity in view of exponential mobile traffic growth. These issues can be overcome by MECO based on a network architecture supporting distributed mobile-edge computing. Among others, designing energy-efficient control policies is a key challenge for the MECO system.

Resource allocation for traditional multiple-access communication systems has been widely studied, including TDMA (see e.g., [17]), OFDMA (see e.g., [18]) and code-division multiple access (CDMA) (see e.g., [19]). Moreover, it has been designed for existing networks such as cognitive radio [20] and heterogenous networks [21]. Note that all of them only focus on the radio resource allocation. In contrast, for the newly proposed MECO systems, both the computation and radio resource allocation at the edge cloud are jointly optimized for the maximum mobile energy savings, making the algorithmic design more complex.

### I-B Contribution and Organization

This paper considers resource allocation in a multiuser MECO system based on TDMA and OFDMA. Multiple mobiles are required to compute different computation loads with the same latency constraint. Assuming that computation data can be split for separate computing, each mobile can simultaneously perform local computing and offloading. Moreover, the edge cloud is assumed to have perfect knowledge of local computing energy consumption, channel gains and fairness factors at all users, which is used for designing centralized resource allocation to achieve the minimum weighted sum mobile energy consumption. In the TDMA MECO system, the optimal threshold-based policy is derived for both the cases of infinite and finite cloud capacities. For the OFDMA MECO system, a low-complexity sub-optimal algorithm is proposed to solve the mixed-integer resource allocation problem.

The contributions of current work are as follows.

• TDMA MECO with infinite cloud capacity: For TDMA MECO with infinite (computation) capacity, a convex optimization problem is formulated to minimize the weighted sum mobile energy consumption under the time-sharing constraint. To solve it, an offloading priority function is derived that yields priorities for users and depends on their channel gains and local computing energy consumption. Based on this, the optimal policy is proved to have a threshold-based structure that determines complete and minimum offloading for users with priorities above and below a given threshold, respectively.

• TDMA MECO with finite cloud capacity: The above results are extended to the case of finite capacity. Specifically, the optimal resource allocation policy is derived by defining an effective offloading priority function and modifying the threshold-based policy as derived for the infinite-capacity cloud. To reduce the complexity arising from a two-dimension search for Lagrange multipliers, a simple and low-complexity algorithm is proposed based on the approximated offloading priority order. This reduces the said search to a one-dimension search, shown by simulation to have close-to-optimal performance.

• OFDMA MECO: For a infinite-capacity cloud based on OFDMA, the insight of priority-based policy structure of TDMA is used for optimizing its resource allocation. Specifically, to solve the corresponding mixed-integer optimization problem, a low-complexity sub-optimal algorithm is proposed. Using average sub-channel gains, the OFDMA resource allocation problem is transformed into its TDMA counterpart. Based on this, the initial resource allocation and offloaded data allocation can be determined by defining an average offloading priority function. Moreover, the integer sub-channel assignment is performed according to the offloading priority order, followed by adjustments of offloaded data allocation over assigned sub-channels. The proposed algorithm is shown to have close-to-optimal performance by simulation and can be extended to the finite-capacity cloud case.

The reminder of this paper is organized as follows. Section II introduces the system model. Section III presents the problem formulation for multiuser MECO based on TDMA. The corresponding resource allocation policies are characterized in Section IV and Section V for both the cases of infinite and finite cloud capacities, respectively. The above results are extended in Section VI for the OFDMA system. Simulation results and discussion are given in Section VII, followed by the conclusion in Section VIII.

## Ii System Model

Consider a multiuser MECO system shown in Fig. 1 with single-antenna mobiles, denoted by a set , and one single-antenna base station (BS) that is the gateway of an edge cloud. These mobiles are required to compute different computation loads under the same latency constraint. 111For asynchronous computation offloading among users, the maximum additional latency for each user is one time slot. Moreover, this framework can be extended to predictive computing by designing control policies for the coming data. Assume that the BS has perfect knowledge of multiuser channel gains, local computing energy per bit and sizes of input data at all users, which can be obtained by feedback. Using these information, the BS selects offloading users, determines the offloaded data sizes and allocates radio resource to offloading users with the criterion of minimum weighted sum mobile energy consumption.

### Ii-a Multiple-Access Model

Considering an arbitrary slot in TDMA/OFDMA, the BS schedules a subset of users for complete/partial offloading. The user with partial or no offloading computes a fraction of or all input data, respectively, using a local CPU.

### Ii-B Local-Computing Model

Assume that the CPU frequency is fixed at each user and may vary over users. Consider an arbitrary time slot. Following the model in [12], let denote the number of CPU cycles required for computing -bit of input data at the -th mobile, and the energy consumption per cycle for local computing at this user. Then the product gives computing energy per bit. As shown in Fig. 2, mobile is required to compute -bit input data within the time slot, out of which -bit is offloaded and -bit is computed locally. Then the total energy consumption for local computing at mobile , denoted as , is given by . Let denote the computation capacity of mobile that is measured by the number of CPU cycles per second. Under the computation latency constraint, it has As a result, the offloaded data at mobile has the minimum size of with , where

First, consider the TDMA system for an arbitrary time slot. Let denote the channel gain for mobile that is constant during offloading duration, and its transmission power. Then the achievable rate (in bits/s), denoted by , is:

 rk=Blog2(1+pkh2kN0) (1)

 Eoff,k=pktk=tkh2kf(ℓktk). (2)

Note that if either or , is equal to zero.

Next, consider an OFDMA system with sub-channels, denoted by a set . Let and denote the transmission power and channel gain of mobile on the -th sub-channel. Define as the sub-channel assignment indicator variable where indicates that sub-channel is assigned to mobile , and verse vice. Then the achievable rate (in bits/s) follows:

 rk,n=ρk,n¯Blog2(1+pk,nh2k,n¯N0) (3)

where and are the bandwidth and noise power for each sub-channel, respectively. Let denote the offloaded data size over the offloading duration time that can be set as the OFDMA symbol duration. The corresponding offloading energy consumption can be expressed as below, which is similar to that in [18], namely,

 Eoff,k,n=ρk,npk,nT=ρk,n¯h2k,n¯f(ℓk,nρk,n) (4)

where and .

### Ii-D Cloud-Computing Model

Considering an edge cloud with finite (computation) capacity, for simplicity, the finite capacity is reflected in one of the following two constraints. 222For simplicity, we consider either a computation-load or a computation-time constraint at one time but not both simultaneously. However, note that the two constraints can be considered equivalent. Specifically, limiting the cloud computation load allows the computation to be completed within the required time and vice versa. The current resource-allocation policies can be extended to account for more elaborate constraints, which are outside the scope of the paper. The first one upper-bounds CPU cycles of sum offloaded data that can be handled by the cloud in each time slot. Let represent the cloud computation capacity measured by CPU cycles per time slot. Then it follows: . This constraint ensures negligible cloud computing latency. The other one considers non-negligible computing time at the cloud that performs load balancing as in [23], given as where is the cloud computation capacity measure by CPU cycles per second. Note that is factored into the latency constraint in the sequel.

## Iii Multiuser MECO for TDMA: Problem Formulation

In this section, resource allocation for multiuser MECO based on TDMA is formulated as an optimization problem. The objective is to minimize the weighted sum mobile energy consumption: , where the positive weight factors account for fairness among mobiles. Under the constraints on time-sharing, cloud computation capacity and computation latency, the resource allocation problem is formulated as follows:

 min{ℓk,tk} K∑k=1βk[tkh2kf(ℓktk)+(Rk−ℓk)CkPk] (P1) s.t. K∑k=1tk≤T,K∑k=1Ckℓk≤F, tk≥0,m+k≤ℓk≤Rk, k∈K.

First, it is easy to observe that the feasibility condition for Problem P1 is: . It shows that whether the cloud capacity constraint is satisfied determines the feasibility of this optimization problem, while the time-sharing constraint can always be satisfied and only affects the mobile energy consumption. Next, one basic characteristic of Problem P1 is given in the following lemma, proved in Appendix -A.

###### Lemma 1.

Problem P1 is a convex optimization problem.

Assume that Problem P1 is feasible. The direct solution for Problem P1 using the dual-decomposition approach (the Lagrange method) requires iterative computation and yields little insight into the structure of the optimal policy. To address these issues, we adopt a two-stage solution approach that requires first solving Problem P2 below, which follows from Problem P1 by relaxing the constraint on cloud capacity:

 min{ℓk,tk} K∑k=1βk[tkh2kf(ℓktk)+(Rk−ℓk)CkPk] (P2) s.t. K∑k=1tk≤T, tk≥0,m+k≤ℓk≤Rk, k∈K.

If the solution for Problem P2 violates the constraint on cloud capacity, Problem P1 is then incrementally solved building on the solution for Problem P2. This approach allows the optimal policy to be shown to have the said threshold-based structure and also facilitates the design of low-complexity close-to-optimal algorithm. It is interesting to note that Problem P2 corresponds to the case where the edge cloud has infinite capacity. The detailed procedures for solving Problems P1 and P2 are presented in the two subsequent sections.

## Iv Multiuser MECO for TDMA: Infinite Cloud Capacity

In this section, by solving Problem P2 using the Lagrange method, we derive a threshold-based policy for the optimal resource allocation.

To solve Problem P2, the partial Lagrange function is defined as

 L=K∑k=1βk[tkh2kf(ℓktk)+(Rk−ℓk)CkPk]+λ(K∑k=1tk−T)

where is the Lagrange multiplier associated with the time-sharing constraint. For ease of notation, define a function . Let denote the optimal solution for Problem P2 that always exists satisfying the feasibility condition.

Then applying KKT conditions leads to the following necessary and sufficient conditions:

 ∂L∂ℓ∗(2)k=βkf′(ℓ∗(2)kt∗(2)k)h2k−βkCkPk⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩>0,ℓ∗(2)k=m+k=0,ℓ∗(2)k∈(m+k,Rk)<0,ℓ∗(2)k=Rk, (5a) ∂L∂t∗(2)k=βkg(ℓ∗(2)kt∗(2)k)h2k+λ∗{>0,t∗(2)k=0=0,t∗(2)k>0,∀k∈K, (5b) K∑k=1t∗(2)k≤T,\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak λ∗(K∑k=1t∗(2)k−T)=0. (5c)

Note that for and , it can be derived from (5a) and (5b) that

 ℓ∗(2)kt∗(2)k=f′−1(CkPkh2k)=g−1(−h2kλ∗βk). (6)

Based on these conditions, the optimal policy for resource allocation is characterized in the following sub-sections.

Define a (mobile) offloading priority function, which is essential for the optimal resource allocation, as follows:

 φ(βk,Ck,Pk,hk)=⎧⎪⎨⎪⎩βkN0h2k(υklnυk−υk+1),υk≥10,υk<1, (7)

with the constant defined as

 υk=BCkPkh2kN0ln2. (8)

This function is derived by solving a useful equation as shown in the following lemma.

###### Lemma 2.

Given , the offloading priority function in (7) is the root of following equation with respect to :

 f′−1(CkPkh2k)=g−1(−h2kxβk).

Lemma 2 is proved in Appendix -B. The function generates an offloading priority value, , for mobile , depending on corresponding variables quantifying fairness, local computing and channel. The amount of offloaded data by a mobile grows with an increasing offloading priority as shown in the next sub-section. It is useful to understand the effects of parameters on the offloading priority that are characterized as follows.

###### Lemma 3.

Given , is a monotone increasing function for , , and .

Lemma 3 is proved in Appendix -C, by deriving the first derivatives of with respect to each parameter. This lemma is consistent with the intuition that, to reduce energy consumption by offloading, the BS should schedule those mobiles having high computing energy consumption per bit (i.e., large and ) or good channels (i.e., large ).

It can be observed from (7) and (8) that the offloading priority scales with local computing energy per bit approximately as and with the channel gain approximately as . The former scaling is much faster than the latter. This shows that the computing energy per bit is dominant over the channel on determining whether to offload.

### Iv-B Optimal Resource-Allocation Policy

Based on conditions in (5a)-(5c) and Lemma 2, the main result of this section is derived, given in the following theorem.

###### Theorem 1 (Optimal Resource-Allocation Policy).

Consider the case of infinite cloud computation capacity. The optimal policy solving Problem P2 has the following structure.

1. If and the minimum offloaded data size for all , none of these users performs offloading, i.e.,

 ℓ∗(2)k=t∗(2)k=0k∈K.
2. If there exists mobile such that or , for ,

 ℓ∗(2)k ⎧⎪⎨⎪⎩=m+k,φk<λ∗∈[m+k,Rk],φk=λ∗=Rk,φk>λ∗,

and

 t∗(2)k=ln2B[W0(λ∗h2k/βk−N0N0e)+1]×ℓ∗(2)k

where is the Lambert function and is the optimal value of the Lagrange multiplier satisfying the active time-sharing constraint: .

###### Proof.

See Appendix -D.

For a conventional TDMA communication system, continuous transmission by at least one mobile is always advantageous under the criterion of minimum sum energy consumption [17]. However, this does not always hold for a TDMA MECO system where no offloading for all users may be preferred as shown in Theorem 1. Offloading is not necessary expect for two cases. First, there exists at least one mobile whose input-data size is too large such that complete local computing fails to meet the latency constraint. Second, some mobile has a sufficient high value for the product , indicating that energy savings can be achieved by offloading because of high channel gain or large local computing energy consumption.

It can be observed from Theorem 1 that the offloading rate, defined as for mobile , is determined only by the channel gain and fairness factor while other factors, namely and , affect the offloading decision. The rate increases with a growing channel gain and vice versa since a large channel gain supports a higher transmission rate or reduces transmission power, making offloading desirable for reducing energy consumption.

###### Remark 4 (Low-Complexity Algorithm).

The traditional method for solving Problem P2 is the block-coordinate descending algorithm which performs iterative optimization of the two sets of variables, and , resulting in high computation complexity. In contrast, by exploiting the threshold-based structure of the optimal resource-allocation policy in Theorem 1, the proposed solution approach, described in Algorithm 1, needs to perform only a one-dimension search for , reducing the computation complexity significantly. To facilitate the search, next lemma gives the range of , which can be easily proved from Theorem 1.

###### Lemma 4.

Furthermore, with the assumption of infinite cloud capacity, the effects of finite radio resource (i.e., the TDMA time-slot duration) are characterized in the following two propositions in terms of the number of offloading users, which can be easily derived using Theorem 1.

It indicates that short time slot limits the number of offloading users. From another perspective, it means that if the winner user has excessive data, it will take up all the resource.

 T≥∑k∈O1 Rkln2B[W0(λminh2k/βk−N0N0e)+1] +∑k∈O2m+kln2B[W0(λminh2k/βk−N0N0e)+1]

where , and .

###### Remark 5 (Which Resource is Bottleneck?).

Proposition 1 and 2 suggest that as the radio resource continuously increases, the cloud will become the performance bottleneck and the assumption of infinite cloud capacity will not hold. For a short time-slot duration, only a few users can offload computation. This just requires a fraction of computation such that the cloud can be regarded as having infinite capacity. However, when the time-slot duration is large, it not only saves energy consumption by offloading but also allows more users for offloading, which potentially exceeds the cloud capacity. The case of finite-capacity cloud will be considered in the sequel.

### Iv-C Special Cases

The optimal resource-allocation policies for several special cases considering equal fairness factors are discussed as follows.

#### Iv-C1 Uniform Channels and Local Computing

Consider the simplest case where are identical for all . Then all mobiles have uniform offloading priorities. In this case, for the optimal resource allocation, all mobiles can offload arbitrary data sizes so long as the sum offloaded data size satisfies the following constraint:

#### Iv-C2 Uniform Channels

Consider the case of . The offloading priority for each mobile, say mobile , is only affected by the corresponding local-computing parameters and . Without loss of generality, assume that . Then the optimal resource-allocation policy is given in the following corollary of Theorem 1.

###### Corollary 1.

Assume infinite cloud capacity, and . Let denote the index such that for all and for all , neglecting the rare case where . The optimal resource-allocation policy is given as follows: for ,

 ℓ∗(2)k ={Rk,k≥ktm+k,otherwise,

and

 t∗(2)k=ln2B[W0(λ∗h2/β−N0N0e)+1]×ℓ∗(2)k.

The result shows that the optimal resource-allocation policy follows a greedy approach that selects mobiles in a descending order of energy consumption per bit for complete offloading until the time-sharing duration is fully utilized.

#### Iv-C3 Uniform Local Computing

Consider the case of . Similar to the previous case, the optimal resource-allocation policy can be shown to follow the greedy approach that selects mobiles for complete offloading in the descending order of channel gains.

## V Multiuser MECO for TDMA: Finite Cloud Capacity

In this section, we consider the case of finite cloud capacity and analyze the optimal resource-allocation policy for solving Problem P1. The policy is shown to also have a threshold-based structure as the infinite-capacity counterpart derived in the preceding section. Both the optimal and sub-optimal algorithms are presented for policy computation. The results are extended to the finite-capacity cloud with non-negligible computing time.

### V-a Optimal Resource-Allocation Policy

To solve the convex Problem P1, the corresponding partial Lagrange function is written as

 ~L=K∑k=1 βk[tkh2kf(ℓktk)+(Rk−ℓk)CkPk] +λ(K∑k=1tk−T)+μ(K∑k=1Ckℓk−F) (9)

where is the Lagrange multiplier associated with the cloud capacity constraint. Using the above Lagrange function, it is straightforward to show that the corresponding KKT conditions can be modified from their infinite-capacity counterparts in (5a)-(5c) by replacing with , called the effective computation energy per cycle. The resultant effective offloading priority function, denoted as , can be modified accordingly from that in (7) as

 ~φ(βk,Ck,Pk,hk,~μ∗)=⎧⎪⎨⎪⎩βkN0h2k(~υkln~υk−~υk+1),~vk≥10,~vk<1, (10)

where

Moreover, it can be easily derived that a cloud with smaller capacity leads to a larger Lagrange multiplier . It indicates that compared with in (7) for the case of infinite-capacity cloud, the effective offloading priority function here is also determined by the cloud capacity. Based on above discussion, the main result of this section follows.

###### Theorem 2.

Consider the finite-capacity cloud with upper-bounded offloaded computation. The optimal policy solving Problem P1 has the same structure as that in Theorem 1 and is expressed in terms of the priority function in (10) and optimized Lagrange multipliers .

Since , it has for all . Therefore, the offloading priority order may be different with that of infinite-capacity cloud, due to the varying decreasing rates of offloading priorities. The reason is that the finite-capacity cloud should make the tradeoff between energy savings and computation burden. To this end, it will select mobiles for offloading that can save significant energy and require less computation for each bit of data.

Computing the threshold for the optimal resource-allocation policy requires a two-dimension search over the Lagrange multipliers , described in Algorithm 2. For an efficient search, it is useful to limit the range of and shown as below, which can be easily proved.

###### Lemma 5.

When there is at least one offloading mobile, the optimal Lagrange multipliers satisfy:

 0≤~λ∗≤λmax,\leavevmode\nobreak and\leavevmode\nobreak 0≤~μ∗≤μmax=maxk{Pk−N0ln2BCkh2k}

where is defined in Lemma 4.

Note that corresponds to the case of infinite-capacity cloud and to the case where offloading yields no energy savings for any mobile.

### V-B Sub-Optimal Resource-Allocation Policy

To reduce the computation complexity of Algorithm 2 due to the two-dimension search, one simple sub-optimal policy is proposed as shown in Algorithm 3. The key idea is to decouple the computation and radio resource allocation. In Step , based on the approximated offloading priority in (7) for the case of infinite-capacity cloud, we allocate the computation resource to mobiles with high offloading priorities. Step optimizes the corresponding fractions of slot given offloaded data. This sub-optimal algorithm has low computation complexity. Specifically, given a solution accuracy , the iteration complexity for one-dimensional search can be given as . For each iteration, the resource-allocation complexity is . Thus, the total computation complexity for the sub-optimal algorithm is . Moreover, its performance is shown by simulation to be close-to-optimal in the sequel.

### V-C Extension: MECO with Non-Negligible Computing Time

Consider another finite-capacity cloud for which the computing time is non-negligible. Surprisingly, the resultant optimal policy is also threshold based, with respect to a different offloading priority function.

Assume that the edge cloud performs load balancing for the uploaded computation as in [23]. In other words, the CPU cycles are proportionally allocated for each user such that all users experience the same computing time: (see Section II-D). Then the latency constraint is reformulated as , accounting for both the data transmission and cloud computing time. The resultant optimization problem for minimizing weighted sum mobile energy consumption is re-written by

 min{ℓk,tk} K∑k=1βk[tkh2kf(ℓktk)+(Rk−ℓk)CkPk] (P3) s.t. ∑Kk=1CkℓkF′+K∑k=1tk≤T, tk≥0,m+k≤ℓk≤Rk,\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak k∈K.

The key challenge of Problem P3 is that the amount of offloaded data size for each user has effects on offloading energy consumption, offloading duration and cloud computing time, making the problem more complicated.

The feasibility condition for Problem P3 can be easily obtained as: Note that the case makes Problem P3 infeasible since the resultant offloading time () cannot enable computation offloading.

Similarly, to solve Problem P3, the partial Lagrange function is written as

 ˆL=K∑k=1βk +λ(∑Kk=1CkℓkF′+K∑k=1tk−T).

Define two sets of important constants: and for all . Using KKT conditions, we can obtain the following offloading priority function

 (11)

where

 ˆυk=bk−1W0((bk−1)e(ak−1)). (12)

This function is derived by solving a equation in the following lemma, proved in Appendix -E.

###### Lemma 6.

Given , the offloading priority function in (11) is the root of the following equation with respect to :

 f′−1(CkPkh2k−xCkh2kβkF′)=g−1(−h2kxβk). (13)

Recall that for a cloud that upper-bounds the offloaded computation, its offloading priority (i.e., in (10)) is function of a Lagrange multiplier which is determined by . However, for the current cloud with non-negligible computing time, the offloading priority function in (11) is directly affected by the finite cloud capacity via .

In the following, the properties of , which is the key component of , are characterized.

###### Lemma 7.

if and only if , where is defined in (8).

It is proved in Appendix -F and indicates that the condition that offloading saves energy comsumption for this kind of finite-capacity cloud is same as that of infinite-capacity cloud.

###### Lemma 8.

Given , is a monotone increasing function for , , , and , respectively.

Similar to Lemma 3, Lemma 8 can be proved by deriving the first derivatives of with respect to each parameter. It shows that enhancing the cloud capacity will increase the offloading priority for all users that is same as the result of a cloud with upper-bounded offloaded computation.

Based on above discussion, the main result of this section are presented in the following theorem.

###### Theorem 3.

Consider the finite-capacity cloud with non-negligible computing time. The optimal resource allocation policy solving Problem P3 has the same structure as that in Theorem 1 and is expressed in terms of the priority function in (11) and optimized Lagrange multipliers .

The optimal policy can be computed with a one-dimension search for , following a similar procedure in Algorithm 1.

## Vi Multiuser MECO for OFDMA

In this section, consider resource allocation for MECO OFDMA. Both OFDM sub-channels and offloaded data sizes are optimized for the energy-efficient multiuser MECO. To solve the formulated mixed-integer optimization problem, a sub-optimal algorithm is proposed by defining an average offloading priority function from its TDMA counterpart and shown to have close-to-optimal performance in simulation.

### Vi-a Multiuser MECO for OFDMA: Infinite Cloud Capacity

Consider an OFDMA system (see Section II) with mobiles and sub-channels. The cloud is assumed with infinite cloud capacity. Given time-slot duration , the latency constraint for local computing is rewritten as . Moreover, the time-sharing constraint is replaced by sub-channel constraints, expressed as for all . Then the corresponding optimization problem for the minimum weighted sum mobile energy consumption based on OFDMA is readily re-formulated as:

 min{ℓk,n,ρk,n} K∑k=1βk⎡⎣N∑n=1ρk,n¯h2k,n¯f(ℓk,nρk,n)+(Rk−N∑n=1ℓk,n)CkPk⎤⎦ (P4) s.t. K∑k=1ρk,n≤1,\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak n∈N; m+k≤N∑n=1ℓk,n≤Rk,\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak k∈K; ρk,n∈{0,1},\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak n∈N\leavevmode\nobreak and\leavevmode\nobreak k∈K.

Observe that Problem P4 is a mixed-integer programming problem that is difficult to solve. It involves the joint optimization of both continuous variables and integer variables . One common solution method is relaxation-and-rounding, which firstly relaxes the integer constraint as the real-value constraint [18], and then determines the integer solution using rounding techniques. Note that the integer-relaxation problem is a convex problem which can be solved by powerful convex optimization techniques. An alternative method is using dual decomposition as in [24], which has been proved to be optimal when the number of sub-channels goes to infinity. However, both algorithms performing extensive iterations shed little insight on the policy structure.

1. Phase 1 [Sub-Channel Reservation for Offloading-Required Users]: Consider the offloading-required users that have . The offloading priorities for these users are ordered in the descending manner. Based on this, the available sub-channels with high priorities are assigned to corresponding users sequentially and each user is allocated with one sub-channel.

2. Phase 2 [Initial Resource and Offloaded Data Allocation]: For the unassigned sub-channels, using average channel gain over these sub-channels for each user, the OFDMA MECO problem is transformed into its TDMA counterpart. Then, by defining an average offloading priority function, the optimal total sub-channel number and offloaded data size for each user are derived. Note that the resultant sub-channel numbers may not be integer.

3. Phase 3 [Integer Sub-Channel Assignment]: Given constraints on the rounded total sub-channel numbers for each user derived in Phase , specific integer sub-channel assignment is determined by the offloading priority order. Specifically, each sub-channel is assigned to the user that requires sub-channel assignment and has higher offloading priority than others.

4. Phase 4 [Adjustment of Offloaded Data Allocation]: For each user, based on the sub-channel assignment in Phase , the specific offloaded data allocation is optimized.

Before stating the algorithm, let define the offloading priority function for user at sub-channel . It can be modified from the TDMA counterpart in (7) by replacing , and with , and , respectively. Let reflect the offloading priority order, which is constituted by , arranged in the descending manner, e.g., . The set of offloading-required users is denoted by , given as . The sets of assigned and unassigned sub-channels are denoted by and , initialized as and . For each user, say user , the assigned sub-channel set is represented by , initialized as . In addition, sub-channel assignment indicators are set as at the beginning.

Using these definitions, the detailed control policies are elaborated as follows.

The purpose of this phase is to guarantee that the computation latency constraints are satisfied for all users. This can be achieved by reserving one sub-channel for each offloading-required user as presented in Algorithm 4.

Observe that Step  in the loop searches for the highest offloading priority over unassigned sub-channels for the remaining offloading-required users ; and then allocates sub-channel to user . This sequential sub-channel assignment follows the descending offloading priority order. Moreover, the condition for the loop ensures that all offloading-required users will be allocated with one sub-channel. This phase only has a complexity of since it just performs the operation for at most iterations.

#### Vi-A2 Initial Resource and Offloaded Data Allocation

This phase determines the total allocated sub-channel number and offloaded data size for each user. Note that the integer constraint on sub-channel allocation makes Problem P4 challenging, which requires an exhaustive search. To reduce the computation complexity, we first derive the non-integer total number of sub-channels for each user as below.

Using a similar method in [26], for each user, say user , let denote its average sub-channel gain, give by where gives the cardinality of unassigned sub-channel set resulted from Phase . Then, the MECO OFDMA resource allocation Problem P4 is transformed into its TDMA counterpart Problem P5 as:

 min{ℓk,nk} K∑k=1βk[nkH2k¯f(ℓknk)+(Rk−ℓk)CkPk] (P5) s.t. K∑k=1nk≤|N2|, nk≥0,m+k≤ℓk≤Rk,\leavevmode\nobreak \leavevmode\nobreak \leavevmode\nobreak k∈K

where are the allocated total sub-channel numbers and offloaded data sizes.

Define an average offloading priority function as in (7) by replacing with . The optimal control policy, denoted by , can be directly obtained following the same method as for Theorem 1. Note that this phase only invokes the bisection search. Similar to Section V-B, the computation complexity can be represented by .

#### Vi-A3 Integer Sub-Channel Assignment

Given the non-integer total sub-channel number allocation obtained in Phase , in this phase, users are assigned with specific integer sub-channels based on offloading priority order. Specifically, it includes the following two steps as in Algorithm 5.

In the first step, to guarantee that sub-channels are enough for allocation, each user is allocated with sub-channels. However, allocating specific sub-channels to users given the rounded numbers is still hard, for which the optimal solution can be obtained using the Hungarian Algorithm [27] that has the complexity of . To further reduce the complexity, a priority-based sub-channel assignment is proposed as follows. Let denote the set of users that require sub-channel assignment, which is initialized as and will be updated as in Step , by deleting the user that has been allocated with the maximum sub-channels. During the loop, for users in set and available sub-channels , we search for the highest offloading priority function, indexed as , and assign sub-channel to user .

In the second step, all users compete for remaining sub-channels since is the lower-rounding of in the first step. In particular, each unassigned sub-channel in is assigned to the user with highest offloading priority. In total, the computation complexity of this phase is .