Offloading Cost Optimization in Multiserver Mobile Edge Computing Systems with Energy Harvesting Devices

In mobile edge computing (MEC) systems with energy harvesting, edge devices are powered by unstable energy harvested from the environment. To prolong the lifetime of edge devices, some computing tasks should be o ﬄ oaded to MEC servers. However, computing services o ﬀ ered by MEC servers may be very costly. In this work, we aim to minimize total costs caused by computing services and dropping tasks while avoiding the devices running out energy. With the consideration of the unpredictability of the harvestable energy, we adopt the stochastic Lyapunov optimization framework to jointly manage energy and make task execution decisions (i.e., local executing, o ﬄ oading, or dropping tasks) and develop an online algorithm which could help asymptotically obtain the optimal results for the whole system. The algorithm does not require any knowledge of the harvestable energy and the statistics of task arriving processes and can be easily implemented in a distributed manner. Numerical results corroborate that the proposed algorithm can try its best to push battery energy of edge devices to a preset parameter and e ﬀ ectively reduce the service costs and task drops.


Introduction
In mobile edge computing systems, mobile applications such as face recognition, image identification, and augmented reality are usually computational-intensive and consume a large quantity of energy of edge devices [1][2][3]. Harvesting energy from the environment provides a promising solution to address energy scarcity problem in MEC systems. However, in many circumstances, the harvestable energy is usually unpredictable and not sufficient to support edge devices executing all computing tasks locally. Some computing tasks need to be offloaded to edge servers.
Compared with edge devices, edge servers which are usually provided by service providers are more powerful and can assist edge devices to complete computing tasks nearby [4][5][6]. When edge devices offload their computing tasks to edge servers, there will be some service fee since it consumes bandwidth and computing resources of the servers [7,8]. The service fee which is charged by service providers may be concerned to the types of tasks and can be time-varying. For example, the prices per bit of image identification may be different from augmented reality tasks, and when there are too many computing tasks being executed in a server, the service provider may raise the computation price of this server. For edge devices, more offloading means less energy consumption but more service costs. Hence, how to minimize service costs while guaranteeing edge devices never running out of energy will be a realistic problem.
Many offloading techniques [9][10][11][12][13][14][15] have been proposed to minimize task execution latency and energy consumption or achieve the trade-off between them [16,17]. However, in terms of energy management, most of those works focus on saving the energy cost of edge computing systems which may cause excessive computation offloading. Since the battery energy of edge devices can be constantly replenished in energy harvesting MEC systems, making full use of harvestable energy for local computation can effectively reduce data transfer and service overhead. Moreover, they do not take the cost of computation service into account, and most of them considered the problem from the perspective of static systems and single-user and single-server model.
In this paper, we consider a more general scenario with multiple energy harvesting mobile edge devices and multiple MEC servers. The harvestable energy of each edge devices is different and unpredictable. Time is slotted, and computation tasks are delay sensitive and with the execution deadline no greater than the length of a time slot. We aim to find a task offloading strategy which jointly manage edge device energy and minimize the total costs resulted by computation offloading (i.e., service costs) and task dropping. With the consideration of the energy profile as a stochastic process, we adopt the Lyapunov optimization framework with weight perturbation to achieve long-term stability of energy queues of edge devices. Based on the theory of drift-plus-penalty, an online algorithm which can obtain the trade-off between energy performance (i.e., edge devices' residual energy) and the total costs is developed. The algorithm makes greedy decisions in every time slot; hence, the complexity of the algorithm is low, and it can adapt to resource-constrained MEC systems very well. To summarize, the key contributions of this work are listed as follows: (1) We consider both the heterogeneity and mobility of edge devices and model a MEC system with multiple energy harvesting edge devices and multiple MEC servers (2) Instead of minimizing energy and delay costs, we define the total costs resulted by task offloading and dropping as the optimization object and formulate the computation offloading problem as a joint energy management and cost minimization problem (3) We propose a low-cost computation offloading algorithm based on Lyapunov optimization framework to save the problem. This algorithm achieves nearly optimal costs meanwhile stabilizes the energy queues of edge devices and can be implemented in a distributed manner easily The rest of this article is organized as follows. In Section 2, we conduct literature review. In Section 3, we present the system model and problem formulation. In Section 4, we present our algorithm and analysis. In Sections 5 and 6, we show the numerical results and conclude the article.

Related Work
In MEC systems, edge devices are allowed to offload some or all of the computation tasks to edge servers which releases the limited resources of mobile edge devices. However, due to the time-varying nature of wireless channels [18,19], the mobility of edge devices, and the heterogeneity of computation intensive application tasks, the computation offloading and resource allocation problems remain challenging.
There have been many works [9][10][11][12][13][14][15][19][20][21] focus on developing offloading strategies to reduce the energy consumption and computation latency. Chen et al. [10] devel-oped an offloading strategy based on a self-adaptive particle swarm optimization algorithm to reduce the system energy consumption for DNN-based smart IoT systems. Zhao et al. [12] proposed a task scheduling and partial offloading method to minimize the energy consumption of edge devices under a deadline constraint. Considering that the wireless channel state and task arrival process are uncertain and dynamic, Chen et al. [13] developed an online and polynomial-time-complexity algorithm based on Lyapunov optimization techniques aiming at minimizing average transmission energy consumption while guaranteeing the average queueing latency. Yang et al. [15] considered both the heterogeneity of edge servers and the mobility of mobile devices and proposed an optimal offloading node selection strategy based on changes in available network bandwidth and location of mobile devices to minimize the offloading time. However, those strategies are mainly presented to MEC systems without energy harvesting and need to be farther improved to take full use of the energy harvested from the environment.
Energy harvesting technologies are supposed to be an efficient solution for MEC systems due to its selfsustainable nature [22,23]. However, new challenges arise in jointly designing the energy management and offloading strategies since the harvestable energy is usually unpredictable in real world. Sun et al. [24] formulated the offloading problem in energy harvesting MEC systems as a joint minimization problem of energy consumption and delay in the long term and proposed a novel algorithm based on the reinforcement learning approach with noisy neural networks to solve the problem. Zhang et al. [25] proposed a continuous control-based deep reinforcement learning approach to minimize the execution time and energy consumption. Zhou et al. [26] proposed a Lyapunov optimization-based algorithm to minimize the time average of a weighted sum of energy consumption and execution delay meanwhile stabilize the battery energy queue. Most of those works simply use the minimization of energy consumption as one of the optimization objective and do not consider the costs of edge servers, which may lead those strategies offloading too much tasks to servers. At this point, the harvestable energy cannot be fully utilized, and the running mode of MEC systems is not fully characterized.

System Model and Problem Formulation
In this section, we introduce the system models for a mobile energy harvesting MEC system. The system contains M edge devices and N edge servers. We use M ≜ f1, 2, ⋯, Mg and N ≜ f1, 2, ⋯, Ng to denote edge devices (i.e., users) and edge servers, respectively. Time is slotted in this paper, and τ is the length of each time slot. The time slot index is t and t ∈ T , where T ≜ f 1, 2, ⋯g. Edge devices keep traveling while edge servers are stationary. The distance between edge device m and edge server n is denoted by d m,n ðtÞ.
3.1. Task Model. Computation tasks in this paper are delaysensitive, and the execution deadline of those tasks is no greater than the length of each time slot. All the tasks generated by edge device m are with fixed length L m bits. Each edge devices may have a different L m . Whether tasks are generated in time slot t is denoted by the binary variable ξ m ðtÞ. When ξ m ðtÞ = 1, it means that there are tasks arriving on edge device m in time slot t and device m needs to make offloading decisions among local computing, task offloading, and dropping. ξ m ðtÞ is with an independently identical distribution (i.i.d.) Bernoulli process with Eðξ m ð t Þ Þ = λ m , where 0 ≤ λ m ≤ 1. Let ξðtÞ = ðξ m ðtÞ, m ∈ MÞ, t = 0, 1, 2, ⋯ be the task generation vector in time slot t.
Denote x ml ðtÞ, x m,n ðtÞ, and x md ðtÞ be the decision variables of computation offloading. x ml ðtÞ = 1 and x md ðtÞ = 1 indicated that the tasks are executed locally and dropped, respectively. x m,n ðtÞ = 1 indicated that edge device m chooses edge server n to offload tasks in time slot t. The computation offloading decision vector in time slot t can be defined as x ðtÞ = ðx ml ðtÞ, x md ðtÞ, x m,n ðtÞ, m ∈ M&n ∈ N Þ. In time slot t, device m offloads tasks to one server at most, which means ∑ N n=1 x m,n ðtÞ ≤ 1. In every time slots, tasks must be executed locally, remotely, or dropped. Hence, when ξ m ðtÞ = 1, we have 3.2. Local Computation Model. Assume that it takes c m CPU cycles for edge device m to process 1 bit of computing task; then, the local computation delay is where f m ðtÞ is the CPU frequency in time slot t. Considering that tasks must be executed before the next time slot, the local computation delay should satisfy Assume that the dynamic voltage and frequency scaling technologies (DVFS) [27] are adopted in the edge devices, and the CPU frequencies scheduled for tasks remain the same in a single time slot. The computation power of local execution is where κ is a parameter that depends on the chip architecture. According to (2) and (4), if there are tasks to execute locally, the computation energy is Due to the limited computing power of CPU, the CPU frequency should satisfy 3.3. Offloading Computation Model. The data associated with the tasks to be offloaded to servers are transmitted over wireless links. Since MEC servers are usually equipped with high performance CPUS, we assume that the task execution time of MEC server can be ignored for convenience. We also assume that the output results of those tasks are of small sizes and the delay for returning the results back is negligible [26,28,29]. Let d m,n ðtÞ be the distance between edge device m and edge server n in time slot t; then, the channel power gain can be calculated by where γ m,n ðtÞ is the small-scale fading channel power gain, g 0 is the channel loss coefficient, and d 0 and ψ are reference distance and the channel loss exponent, respectively. According to Shannon theorem, the maximum uplink transmission rate between m and n can be expressed by where σ 2 is the noisy power and p m,n ðtÞ is the transmission power of m in time slot t. The transmission delay of the offloading tasks between device m and n in time slot t can be computed by Considering that the tasks must be finished before the end of the time slot and the transmission power of edge devices is limited, hence we have where p max m and p min m are the maximum and minimum transmission power of edge device m. The energy consumption for m offloading those tasks to server n in time slot t is 3.4. Energy Model. Since time is slotted in this paper, the process of energy harvesting is noncontinuous. Let e m ðtÞ be the harvestable energy in time slot t. We assume that e m ðtÞ is i.i.d and satisfies where E max mh is the maximum value of harvestable energy at each time slot. Let eðtÞ = ððe m ðtÞ, m ∈ MÞÞ be the energy arriving vector at time slot t. We where B max m is the battery capacity of device m. To avoid running out of energy, the residual energy of edge devices should be stabilized. In a queueing network (e.g., a network with back-pressure routing), data queue is stable means that lim where Q m ðtÞ is the data queue of node m. However, we say that the energy queue of device m is stable if the following is met: where θ m is the perturbation parameter of device m and ε is the gap between θ m and the long-term average value of B m ðtÞ. θ m can be set in the 0th time slot and should no less than V · α add the maximal energy which can be consumed by m in one slot [11]. V is the parameter trading off performance between energy and costs. Constraint (15) can effectively reduce the probability of running out of energy.
For simplicity, we assume that energy consumption happens only in local computation and task offloading. Then, the residual energy of m at time slot t is where ½x + = max ½x, 0. When ξ m ðtÞ = 1 and there is not enough energy to offload or execute the tasks locally, the tasks will be dropped. Considering that e m ðtÞ is unpredictable, in order to guarantee the computation offloading decision can be executed, the residual energy should satisfy 3.5. Problem Formulation. In our work, the primary goal is to minimize the total costs resulted by task offloading and dropping while guaranteeing the energy of the mobile device not be exhausted. Let cos t n,m ðtÞ be the price of server n computing one bit data for device m in time slot t and α > 0 be the penalty of dropping tasks. Then, the total cost of the MEC system can be expressed as Define the transmission power vector in time slot t as p ðtÞ ≜ ðp m,n ðtÞ, m ∈ M&n ∈ N Þ and the local computing frequency vector as f ðtÞ = ð f m ðtÞ, m ∈ MÞ. The operation vector of the MEC system in time slot t can be defined as OpðtÞ = ðxðtÞ, pðtÞ, f ðtÞÞ. Therefore, the computation off-loading problem can be formulated as follows: Since tasks have clear deadlines in this paper, we do not use delay or latency as the optimization goal. Most of previous works [9][10][11][12][13][14][15][30][31][32][33][34][35] only focus on reducing energy consumption and the computation latency and do not consider the overheads of the servers. However, task offloading consumes bandwidth resource and computing tasks on the server which leads to the costs of memory and energy of the servers. Besides, service providers usually have their own pricing strategy. The price may be related to task type, computational complexity, and the usage of bandwidth and computation resources in every time slot which can be time varying. Note that as long as cos t n,m ðtÞ is i.i.d, then our algorithm proposed in the following section can achieve nearoptimality system performance based on drift-plus-penalty frameworks.

Dynamic Offloading Algorithm Design
In this section, we will propose an online algorithm based on the framework of Lyapunov optimization to solve the computation offloading problem formulated above. By dynamically making greedy offloading decisions, the algorithm can obtain near minimum costs while pushing the residual energy of edge devices towards the configurable parameter θ m . Considering the residual energy of battery is not i.i.d, we advocate the weighted perturbation method [36] to solve this issue.
To stabilize the energy queue (i.e., the residual energy of battery), we define a virtual energy queueB m ðtÞ ≜ B m ðtÞ − θ m . It is worth to note that when the virtual queue is stable, the energy queue is also stable. Let LðtÞ denote the Lyapunov function, which is Then, the conditional Lyapunov drift can be defined as follows: where ZðtÞ = e m ðtÞ − ξðtÞ m · ðx ml ðtÞ · E ml ðtÞ − ∑ N n=1 x m,n ðtÞ · E m,n ðtÞÞ. Considering that e m ðtÞ, E ml ðtÞ, ξ m ðtÞ, and E m,n ðtÞ are all equal or greater than 0 and x ml ðtÞ and x m,n ðtÞ can not both be 1, Z 2 ðtÞ ≤ max ðe 2 m ðtÞ, E 2 ml ðtÞ, E 2 m,n ðtÞÞ.

Wireless Communications and Mobile Computing
Offloading tasks to server leads additional costs; hence, ∑ N n=1 x m,n ðtÞ · E m,n ðtÞ = 0 holds when device m needs more energy to offload tasks than execute those tasks locally. Therefore, the inequation Z 2 ðtÞ ≤ max ðe 2 m ðtÞ, E 2 ml ðtÞ, E 2 m,n ðt ÞÞ holds. Then, the following inequality also holds: where C = ðM/2Þ max ððE max mh Þ 2 , κ · c m · L m · ðf max m Þ 2 Þ. Define the virtual energy queue vector of time slotBðtÞ ≜ ðB m ðtÞ, m ∈ MÞ, and then, the drift-plus-penalty function can be express as where E½x | y is the expectation of x under the condition of y . Combine (22) and (23), we have Then, P1 can be converted to P2 which approximately minimize the right-hand side of (24) subject to every constraints of P1.

Calculations of Decision Parameters.
In each time slots, all the edge devices m with ξ m = 1 should firstly compute decision-related parameters and then make greedy decisions from offloading, locally computing, and dropping tasks based on those parameters. For locally executing, the device m should determine the CPU frequency of locally computing and the minimum energy cost of finishing the tasks. For offloading, the device m needs to calculate the minimum energy cost of communication associated with task offloading for every server n and correspondent transmission power.

Calculations for Locally
Executing. According to equation (5), E ml ðtÞ is monotone increasing with f m ðtÞ when f m ðtÞ ≥ 0. Combine (2) and (3), we have f m ðtÞ ≥ ðc m · L m /τ Þ. Therefore, E ml ðtÞ ≥ κ · ðc 3 m · L 3 m /τ 2 Þ holds according to (5). Denote the minimum energy cost for locally executing and the correspondent frequency as E ml ′ ðtÞ and f m ′ ðtÞ; then, we have E ml ′ ðtÞ = κ · ðc 3 m · L 3 m /τ 2 Þ and f m ′ ðtÞ = ðc m · L m /τÞ.  10) and (11). Note that the function E m,n ðtÞ = f ðp m,n ðtÞ Þ has no obvious monotonicity; the minimum energy cost of offloading from m to n can be obtained by following traversal method. For p m,n ðtÞ from p min m to p max m , use Δ p as the step length, calculate all E m,n ðtÞ which satisfies the condition (10) according to (9) and (12), and obtain the minimum energy cost E m,n ′ ðtÞ and the correspondent transmission power p m,n ′ ðtÞ.

Computation Offloading
Algorithm. According to P2, items I1, I2, I3, and I4 are related to energy harvesting, task offloading, task dropping, and locally executing, respectively, and only an item of I2, I3, and I4 can be active in one time slot. Considering all those items are irrelevant, P2 can be converted into minimizing I1, I2, I3, and I4, respectively. To find the minimum values of those items, it needs to be discussed in the three cases which areB m ðtÞ = 0,B m ðtÞ < 0, andB m ðtÞ > 0. WhenB m ðtÞ = 0, I1 and I4 equals to 0. Assume that the edge device m decides to offload tasks to one of those servers, then ∑ N n=1 x m,n ðtÞ = 1 and I2 > 0 holds. Assume that the edge device m decides to drop tasks, then x md ðtÞ = 1 and I2 > 0 holds. Hence, executing tasks locally leads I2 + I3 + I4 to be minimum (equals to 0). Note that there will be enough energy to execute the tasks locally whenB m ðtÞ = 0; therefore, the strategy under the conditionB m ðtÞ = 0 can be described as follows: use the optimal frequency f m ′ ðtÞ to execute the tasks locally, store all or part of the harvestable energy in the battery, and update the residual energy B m ðt + 1Þ according to (16).
WhenB m ðtÞ < 0, obtain E ml ′ ðtÞ, f m ′ ðtÞ, E m,n ′ ðtÞ, and p m,n ′ ð tÞ using the method mentioned above. Compute costs for every server n using cost n,m WhenB m ðtÞ > 0, I3 ≥ 0, I4 ≤ 0, and the sign of I2 is not guaranteed. Hence, the computation offloading decision only can be locally executing or offloading. Solve E m,n ′ ′ðtÞ = arg min V · L m · cos t n,m ðtÞ −B m ðtÞ · E m,n ′ ′ðtÞ and obtain E m,n ′ ′ for all the server n. E m,n ′ ′ can be obtained by using iterative calculation method mentioned above similarly. After that, solve E m,n * ′ ′ðtÞ = arg min V · L m · cos t n * ,m ðtÞ −B m ðtÞ · E m,n * ′ ′ ðtÞ and obtain p m,n * ′ ′ðtÞ, E m,n * ′ ′ðtÞ, and n * . According to (5), using f max m to execute tasks locally leads the highest energy consumption. Hence, if V · L m · cos t n * ,m ðtÞ −B m ðtÞ · E m,n * ′ ′ð tÞ < E ml ′ ′ðtÞ, choose server n * and use the transmission power p m,n * ′ ′ðtÞ to offloading tasks. Otherwise, use frequency f max m to execute tasks locally. In terms of energy harvesting, abandon all the harvestable energy.
Based on the Lyapunov optimization framework, the computation offloading strategy above can obtain nearly the minimum long time average costs and achieve the minimum costs when V ⟶ +∞. However, the strategy always tries to push the energy queue to θ m which may lead edge devices to try their best to consume energy whenB m ðtÞ > 0. For example, edge devices will choose the server with the longest distance to offload tasks when the charges of servers (cos t n,m ðtÞ, n ∈ N ) are the same and use the largest frequency to execute tasks locally. The harvestable energy also will be discarded to increase energy consumption. In fact, executing tasks locally with f m ′ ðtÞ is not only beneficial to save energy but also reduce the service fee of the servers whenB m ðtÞ ≥ 0. Besides, harvesting all the harvestable energy can efficiently increase the residual energy of edge devices and ability to cope with energy scarcity (e.g., harvesting little energy for a long time). To summarize and improve the computation offloading above, we propose Lyapunov-based computation offloading algorithm (i.e., Algorithm 1) as follows.
The complexity of Algorithm 1 is Oðm * nÞ in each time slot t. It is very lightweight and can be easily implemented in a distributed manner where each device only needs to know the distance and costs of its neighbor servers and can make offloading decisions locally. In this paper, we do not consider the interface between links. Note that Algorithm 1 will try its best to reduce offloading to achieve a lower service cost; hence, the transmission collision will also be reduced. Moreover, maximal matching-based algorithms [37,38] can be adapted to our algorithm in the cases when the links interfere with each other.

Performance Evaluation
To validate the effectiveness of our proposed approach, we conduct simulations in this section. We consider a MEC To embody the mobility sufficiently, we assume that the distance between any edge device and any server takes a random value from ½10, 70 metres in every time slots. We assume that d 0 = 5 meters, σ 2 = 10 −13 W, cos t n,m ðtÞ = 10 −6 per bit and γ m,n ðtÞ = 1 for m ∈ M and n ∈ N , w = 1 MHz, p min m = 1 mw and p max m = 50 mw for m ∈ M, and ψ = 4. θ m is set to 2 * 10 −4 J. Figures 1 and 2 show the residual energy processes of all 5 edge devices under the condition V = 10 −8 and V = 10 −6 , respectively. α is set to 2 * 10 −3 , and simulations are run for 500 time slots. From Figure 1, we can see that the residual energy of devices 3, 4, and 5 increases at first and then stabilizes around the perturbation parameters θ m , respectively, which exactly keeps the advantages of our algorithm. The reason why the residual energy of devices 1 and 2 is with growing tendencies is that the harvestable energy is enough to sustain all the tasks being executed locally. Figure 2 shows that as V grows to 10 −6 , the residual energy of devices 3, 4, and 5 can still reach a steady state with values which are much lower than that of V = 10 −8 . Note that the average residual energy of edge devices decreases as V increases; we will show that the value of V also influences the total costs of the MEC system and can trade-off energy performances and costs later. Figure 3 demonstrates computation offloading processes of devices 2 (D2) and 4 (D4) under V = 10 −8 . At the beginning, both devices keep harvesting energy and dropping tasks to push their residual energy to θ m (the residual energy processes are shown in Figure 1). When their residual energy increases to a certain value, both devices stop dropping tasks and begin to offload tasks to servers for remote execution. As time goes on, both devices will begin to execute tasks locally when their residual energy goes to some value (e.g., near by θ m when V = 10 −8 ). Since the harvestable energy of device 2 is enough to execute all tasks locally, device 2 executes nearly all tasks some time slots later (nearly the 100th time slot). To  According to our energy queue stability definition (showed in equation (15)), the convergence time should be Oðθ m − εÞ, where ε is a positive number. Hence, the convergence time is no larger than Oðθ m Þ which is approximately equal to θ m /Eðe m ðtÞÞ. In our simulation, the harvestable energy e m ðtÞ in every slot t is λðtÞ * 4 * 10 −7 J, where λðtÞ is subject to the Poisson distribution with E½λðtÞ = 5 and θ m is set to 2 * 10 -4 J; hence, the convergence time is about 100 time slots. Although the residual energy of device 1 and device 2 seems never converging to a fixed value in Figure 1, the offloading decision processes have reached a stable state at about the 100th time slot. As can be seen from Figure 3, D2 stops dropping and offloading and executes nearly all tasks after the 100th time slot. Figure 4 shows the total costs of all the edge devices with different parameter V. We can see that the total costs decrease with the increasement of V. As shown in Figure 1, the long-time average residual energy of edge devices decreases as the parameter V increases. Therefore, parameter V does trade-off energy performances and the total costs.
To evaluate the performance of our algorithm in terms of reducing the total system costs, we compare our proposed algorithm against three other strategies: strategy where all tasks are executed locally with the optimal frequency f ml ′ (local only), strategy where all tasks are offloaded to the serve with the minimum service costs (offloading only), and the strategy where edge devices randomly make choice from locally executing and offloading and choose random server to offloading when they have decided to execute tasks remotely (random). Figure 5 demonstrates the total costs of all the edge devices vs. time under the condition V = 10 −7 . The results show that our algorithm performs significantly better in comparison to other three comparison algorithms. Figure 6 shows the residual energy dynamic of device 4 by using different strategies which are the proposed algorithm, local only, offloading only, and random strategy. The parameter V is set to 10 −7 . Since the harvestable energy of devices 1 and 2 is sufficient to execute all computing tasks locally, the residual energy will keep growing until it reaches B max m . Devices 3 and 5 have a similar energy process as that of device 4; hence, we only show the results of device 4. Figure 6 demonstrates that our algorithm can use the harvestable energy more effectively and stabilize the residual energy to a preset value.    Wireless Communications and Mobile Computing Figure 7 shows the effects of the parameter α on computation offloading decisions under the condition V = 10 −7 . Y axis is the total number of execution times of all the edge devices. As α goes larger, the number of task dropping will decrease, and the number of offloading will increase. When the tasks have high intertask dependencies, we can set α to a large value to avoid task dropping.

Conclusions
In this paper, an online and lightweight algorithm has been proposed for solving the computation offloading problems in energy harvesting MEC systems with multiuser and multiserver. Based on stochastic Lyapunov optimization framework, the proposed algorithm can minimize the total system costs and guarantee the devices' residual energy stabilized to a preset value. It needs no prior knowledge of the harvestable energy and the task arrival rates and can make trade-off between system costs and the residual energy by a parameter V. The algorithm is also light-weighted and can be easily implemented in a distributed manner since each device can make offloading decisions locally only based on the distance and service costs of its neighbor servers. Our evaluation data shows that the proposed algorithm can take fully use of the harvestable energy and effectively reduce the total system costs caused by computing services and task droppings.

Data Availability
The data used to support the findings of this study are included within the article.

Conflicts of Interest
The authors declare no conflicts of interest.