**5. Performance Evaluation**

The performance of the proposed scheduling algorithms was evaluated. Through intensive MATLAB-based simulations, the following performances were verified: (1) design of the proposed algorithms; and (2) adaptation of the EH MEC environments.

## *5.1. Design of the Proposed Algorithm*

To verify the proposed greedy algorithm, small-scale topologies (*R* = 25) were generated in a random manner. In addition, the following parameters were considered. Each request size (*L<sup>t</sup> i* ) followed a uniform distribution ([5,000, 15,000] bits), and the request deadline (*d<sup>t</sup> i* ) followed a uniform distribution ([1, 2] seconds). The battery size was assumed to be 100 Wh (=360,000 J), and the SoC of the battery followed a uniform distribution ([30, 95]%). The value of *<sup>κ</sup>* was set to 7.4 × <sup>10</sup><sup>−</sup>27, and it was derived using an *Intel i7 Processor*. *X* was set to 740, i.e., the MEC server required 740 cycles to compute 1 bit. To approximately measure the greedy algorithm, the small-scale topologies were simulated

10,000 times with the above mentioned parameters. In the small-scale topologies, the optimal solution can be computed using the brute-force method since there are only a few offloading requests.

Figure 3 shows the difference in offloading bit size between the optimal solution and the greedy algorithm. As shown in the figure, the proposed algorithm guarantees more than 96% of the optimal value. Moreover, more than 99% of the difference between the greedy algorithm and the optimal solution are less than 700 bytes.

**Figure 3.** Difference vs. CDF.

This study also verified that the proposed MEC scheduling algorithm is well designed, i.e., the proposed Lyapunov drift optimization techniques can control the tradeoff between the performance and the battery stability according to *V*. For the verification of the MEC scheduling algorithms, the following simulation parameters were considered. The battery size of the MEC server was assumed to be 100 Wh (=360,000 J), and the SoC of the battery at the beginning of the simulation was assumed to be 50%.The number of IoT devices was 480, and each IoT device randomly generated the offloading request according to the Poisson distribution (the mean of the inter-arrival time was 1 s). The deadline of each request was randomly generated according to the uniform distribution using [1,2]. The number of timeslots was 86,400, and the time unit was 1 s, i.e., we simulated one day.

Figure 4 shows the changes in average battery amount and total bill according to *V*. As shown in the figure, the average battery amount increases with increasing *V*. On the other hand, the total bill decreases with increasing *V*. In the proposed optimization problem of MEC scheduling, there is a tradeoff between battery stability and the bill. Therefore, we can verify that the proposed Lyapunov-based MEC scheduling algorithm works well. In addition, the algorithm efficiently controls the priority between the battery stability and the bill.

**Figure 4.** Average battery amount and total bill vs. *V*.

#### *5.2. Adaptation of the Proposed Scheduling*

This study verified the performance of the proposed scheduling algorithm in EH MEC environments. For evaluating the energy harvesting, actual measurement parameters from renewable energy resources were used. These measurement parameters were the actual field data recorded at an industrial complex that has factories making mineral waters and relevant research facilities on Jeju Island of South Korea for spring, summer, and autumn of 2017. Through the performance evaluation, we can confirm how the proposed algorithm works according to the amount of energy harvested.

Figure 5 shows the accept ratio of offloading requests according to the timeslot. In the proposed offloading scheduling algorithm, which is presented in Section 4.1, the scheduler determines the admission of requests by considering the request deadline as well as the MEC battery stability. Therefore, the proposed scheduler increases the accept ratio if the battery is sufficiently stable. As shown in the figure, the accept ratio changes according to the amount of energy harvested. At the beginning of the simulation, the requests are constantly accepted. Then, the accept ratio rapidly increases at *t* = 40,000 where energy harvesting begins, and then it fluctuates according to the amount of energy harvested. In addition, a higher *V* indicates an increasing CPU frequency; hence, the scheduler can accept more requests. Therefore, the total bill of the MEC server increases with decreasing *V*, as shown in Figure 4.

**Figure 5.** Request accept rate vs. timeslot.

Figure 6 shows the CPU cycles according to timeslot. As shown in the figure, the proposed scheduler efficiently controls the CPU frequency according to the amount of energy harvested. This is because the increase in energy harvesting stabilizes the battery, which results in greater battery stability. Consequently, it increases the CPU frequency to accept more requests. In addition, the figure shows the difference in number of CPU cycles with *V*, and a higher *V* relatively decreases the CPU frequency to stabilize the battery more. From *t* = 0 to *t* = 40,000, where the energy is not sufficiently harvested, the differences among different values of *V* are greater than the differences from *t* = 40,000 to *t* = 60,000, where the energy is sufficiently harvested. This is because, when the battery is not sufficiently stable, the offloading scheduler increases the number of rejected requests, and the MEC scheduler schedules the frequencies differently according to *V*. When the battery is sufficiently stable, however, the offloading scheduler increases the number of accepted requests and the MEC scheduler increases the CPU frequency to the maximum depending on the consumption of the battery, i.e., the CPU frequency is maximized depending on the boundaries that the battery can support.

**Figure 6.** CPU cycles vs. timeslot.

Figure 6 shows the battery amount according to the timeslot. Similar to the previous plots, the battery amount changes according to the amount of energy harvested as shown in Figure 7. We can see that the battery amount with *<sup>V</sup>* = 2.6 × 102 more rapidly compared to decreases in the battery amount with other values of *V*. This is because the energy consumption is quadratic with respect to the increase in CPU frequency. As shown in Figure 6, the CPU frequencies among different *V*s are similar at 40,000 < *t* < 60,000. However, their battery amounts are different since the number of accepted requests are different.

**Figure 7.** Battery amount vs. timeslot.

The evaluation measured the computation time of the proposed scheduling algorithm to verify its applicability. Figure 8 shows the computation time of the proposed algorithm against the number of IoT devices. As shown in the figure, the computation time is less than 0.4 ms when the number of IoT devices is 1000. In addition, the computation time increases linearly with the number of IoT devices. Thus, the complexity of the proposed scheduling algorithm is linear with the number of IoT devices. This is because the proposed scheduling algorithm is designed based on Lyapunov drift optimization, which can solve the problem in polynomial time. Therefore, the proposed algorithm can schedule the computation offloading sufficiently in real-time.

**Figure 8.** Computation time (ms) vs. number of IoT devices.

#### **6. Conclusions**

This paper proposes optimization formulations and their corresponding algorithms for computation offloading scheduling in an EH MEC system. For the admission control of the offloading requests, an offloading scheduling algorithm was designed to consider both the QoE of the offloading request and the system stability. The optimization problem of the offloading scheduling was formulated as a non-convex problem, and a greedy algorithm was proposed to solve the problem in polynomial time. The performance evaluation showed that the proposed greedy algorithm achieves a near-optimal performance, providing solutions that are close to the optimal solutions. To improve the survivability of the EH MEC, the proposed optimization problem of MEC scheduling considers the battery stability as well as the workload queue. Since the proposed problem of MEC scheduling is non-convex, a Lyapunov optimization-based algorithm was proposed for low-complexity scheduling. Through intensive simulations, we verified that the proposed two-stage algorithm efficiently controls the offloading requests and the CPU frequency in EH environments. However, this paper has a limitation in terms of verifying in a real-world scenario. Thus, it is essential to note that the proposed algorithm needs to be enhanced by conducting real-world testing in energy harvesting mobile edge computing. In addition, designing a scheduling algorithm by considering the offloading communication overhead is an interesting future research direction.

**Author Contributions:** Conceptualization, L.P.; methodology, L.P. and W.N.; software, L.P.; validation, L.P.; formal analysis, L.P.; investigation, L.P. and C.L.; resources, L.P. and S.C. (Sungyun Choi); data curation, C.L.; writing–original draft preparation, L.P.; writing–review and editing, S.C. (Sungyun Choi) and S.C. (Sungrae Cho); visualization, L.P.; supervision, S.C. (Sungrae Cho); project administration, W.N.; funding acquisition, S.C. (Sungrae Cho).

**Funding:** This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea government(MSIT) (No. 2019R1F1A1064164).

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


c 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
