Benefit-oriented task offloading in UAV-aided mobile edge computing: An approximate solution

Recently, adopting UAVs equipped with the edge computing platform to provide computing service has been considered as a promising approach for resource-limited devices in mobile edge computing (MEC). Unfortunately, the limited resources (e.g., energy, computing and communication) of the UAV may significantly restrict its service capability, which means it has to selectively provide task offloading service to achieve the maximal benefit. In this article, aiming at optimizing the overall benefit of the UAV in a single dispatch, we propose an approximate Benefit Maximizing Task Offloading (BMTO) algorithm, which jointly considers the trajectory scheduling of the UAV and the offloading strategy of tasks. Specially, the flight path of the UAV is decomposed into several hover sites, which are selected by a benefit-cost approach. And the offloading sequence of tasks is arranged to maximize the benefit of the UAV through a surrogate function, which is proved to be a nonnegative monotone submodular function. Thus we transform the original problem into a submodular maximization problem and theoretically prove that BMTO owns an approximation ratio of 12(1-1e)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\frac{1}{2}(1-\frac{1}{e})$$\end{document}. Simulation results show that our proposed algorithm outperforms the benchmark algorithms in terms of total benefit as well as energy efficiency ratio.


Introduction
The explosive growth of devices and the widespread use of new technologies have significantly improved the complexity of tasks in Internet of Things (IoTs) [1].Constrained by battery capacity and computation ability, IoT devices are difficult to address these compute-intensive and latencysensitive tasks to support some popular applications such as target detection [2], Virtual Reality (VR) [3] and Augmented Reality (AR) [4].Due to those inherent limitations, task offloading schemes which transfer the compute-intensive tasks from IoT devices to the high-performance server platform come into being [5].Cloud Computing utilizes remote cloud servers to process the offloaded computing tasks [6].However, the long distance of data transmission may result in high computational latency and the connections of massive IoT devices may make the cloud servers overloaded.
Different from cloud computing, mobile edge computing (MEC) brings the cloud capabilities to the edge of the network [7,8].In traditional MEC schemes, servers are commonly deployment at the edge nodes such as the base stations (BSs), and they cannot usually accommodate the massive computation demands from the scattered IoT devices.Thus , the reasonable movement of servers is crucial to improve the utilization of computing resources.
Recently, more research efforts have been devoted to explore Unmanned Aerial Vehicles (UAVs) in MEC due to their flexible mobility [9].The UAV equipped with the computing platform can provide timely computing services by approaching IoT devices [10,11] ,greatly reducing the energy consumption for communication.Additionally, in some remote areas or disaster-recovery scenarios, traditional MEC schemes are not suitable due to the lack of terrestrial infrastructures.
Unfortunately , the UAV-aided MEC brings new challenges.On the one hand, the UAV has to elaborately design its flight trajectory with the limit of energy capacity [12].Generally, the UAV departs from the charging station and flies along a predetermined path to provide services.Before exhausting its energy, the UAV must return to the charging station.If the flight path can be reasonably scheduled, the energy spent on moving will be reserved for the UAV to serve more devices.On the other hand, it is critical for the IoT devices to offload their tasks appropriately.The bandwidth of the communication channel of the UAV is scarce and simultaneous data offloading may lead to channel collisions, which significantly decreases the efficiency of data transmission [13].Thus, the offloading sequence of tasks should be well arranged to avoid channel collisions.Moreover, the trajectory scheduling of the UAV and the offloading strategy of tasks may interact with each other, which makes the scheduling of the UAV much harder.
In this article, the benefit-oriented UAV-aided task offloading is explored to provide efficient computing services for ground devices in IoT scenarios.We jointly consider the optimization of the flight trajectory of the UAV as well as the offloading strategy of tasks.Thus, a detailed solution containing when and where the tasks should be offloaded is proposed.
The main contributions of our work are threefold.
• We construct a comprehensive system model, which contains the communication pattern between air-to-ground devices as well as the energy consumption of the UAV, to describe the process of task offloading.• We formulate the benefit maximization problem in task offloading and analyze its hardness.Then an approximation algorithm is proposed based on the benefit-cost method to solve it.• We theoretically analyze the performance of the proposed algorithm and prove that it can achieve an approximation ratio of 1 2 (1 − 1 e ).
The remainder of this article is organized as follows.Some classic works of UAV-aided task offloading are summarized in Section 2. Section 3 introduces some necessary definitions and notations.Section 4 describes the constructed system model and formulates the original problem.In Section 5, an approximate algorithm is proposed to solve the problem.The theoretical analysis of the proposed algorithm is given in Section 6. Section 7 shows the simulation results.Finally, the article is concluded in Section 8.

Related works
Recent studies have shown that the UAV-aided task offloading has many advantages compared to some traditional approaches using cloud servers and static servers at the edge [14,15].According to the provider of the scheduling information, the recent works are classified into offline and online patterns.

UAV-aided offline task offloading
In the offline pattern, the task information is collected or predicted by a terrestrial control center.Then the control center will periodically compute the scheduling information of the UAV by combining the global information.Zhan et al. [16] proposed a scheduling algorithm for the UAV based on path discretization to jointly optimize the flight trajectory and resource allocation of the UAV.A heuristic algorithm aiming at minimizing the number of UAVs and realizing the monitoring of multiple targets was proposed in [17], where the deployment of the UAV in harsh environments was considered.An optimization approach based on successive convex approximation (SCA) was proposed by Jeong et al. [18], and they jointly optimized the trajectory of the UAV and the rate of offloaded tasks.In [19], the ground sink was considered to cooperatively work with the UAV, and SCA was utilized to determine whether the task should be offloaded to the UAV.Messous et al. [20] proposed a non-cooperative game theory-based resource allocation strategy for UAV swarms in compute-intensive scenarios, and proved the existence of Nash Equilibrium.A two-layer optimization method was presented to minimize the energy consumption of the system in [21], where the deployment of the UAV and the scheduling of the tasks were jointly considered.A cooperative task offloading model for UAVs to balance the quality of communication channel and computing ability was constructed in [22], where a three-step block coordinate descending (BCD) algorithm was introduced to handle the resource allocation of UAVs.Liao et al. [23] proposed a light-weight deterministic algorithm to obtain the optimal location of UAVs, where the stochastic gradient descent (SGD) is utilized.Specifically, authors in [24,25] focused on optimizing the overall energy consumption of the IoT devices and UAVs, and simultaneously, the system delay will not exceed a threshold value.
In general, the offline task offloading strategies can perform well since they utilize the global information of tasks to optimize the scheduling of the UAV.However, those strategies are periodically made, which makes it difficult to accommodate the unexpected events.

UAV-aided online task offloading
In the online schemes, the UAV directly receives the task information and makes the real-time schedule strategy by itself, which means the UAV must own higher computing ability as well as battery capacity.Fortunately, advanced machine learning technology [26,27] has made it possible to deploy a tiny neural network in the on-board system.Wang et al. [28] proposed a deep learning-based real-time path scheduling algorithm for UAVs, considering the fairness of task allocation among UAVs.An agent-based imitation learning was proposed in [29] to adjust the location of the UAV in real-time, where a Markov decision model was established to maximize the benefits of the system.Liu et al. [30] proposed a benefit maximization algorithm for the UAV with a fixed trajectory, and they utilized a modified Q-Learning algorithm to increase the profit of the UAV.In [31], a hierarchical deep learning framework is proposed, where lower and higher layers of the pretrained convolutional neural network are separately deployed to minimize the weight-sum cost of the UAVs.Wei et al. [32] considered the dynamic of the network and proposed an energy and delay optimization algorithm based on distributed deep reinforcement learning (DRL) to adjust the real-time location of the UAV.Task offloading strategies in the online pattern can be dynamically adjusted according to the calculation requirements, whereas these strategies usually only utilize local information and cannot achieve the optimal solution.
The comparison of literatures is shown in Table 1.Most of the above efforts concentrate on optimizing the trajectory or resource allocation of the UAV, while few works jointly optimize both of them.Additionally, the offloading strategy of tasks is rarely considered in recent works.The offloading sequence of tasks should be carefully arranged to maximize the benefit of servers, especially for the UAV with limited computing resources.Thus, a detailed and comprehensive solution, which determines how the UAV traverses the service area, when and where the tasks should be offloaded, is urgently needed to be proposed.

Preliminaries
In this section, main definitions and notations are summarized.
Definition 1 (Discrete derivative) For a set function f ∶ 2 Ω → ℝ , define Δ(e|X) = f (X ∪ e) − f (X) as the dis- crete derivative of f at X with respect to e, where X ⊆ Ω and e ∈ Ω⧵X.Definition 2 (Nonnegativity, Monotonicity, Submodularity) A set function f ∶ 2 Ω → ℝ is nonnegative, monotone and submodular if and only if it satisfies the following constraints, respectively.
• Δ(e|X) ≥ Δ(e|Y) for every X ⊆ Y ⊆ Ω and e ⊆ Ω ⧵ Y.  [17] offline no no multiple heuristic algorithm minimize the number of UAVs [18] offline no yes single SCA minimize the energy consumption of the UAV [19] offline yes no single SCA minimize the weighted-sum delay of tasks [20] offline yes no multiple game theory optimize the energy consumption, computation delay and cost [21] offline no no multiple evolution algorithm minimize the energy consumption [22] offline yes no single BCD maximize the weight-sum bits of tasks [23] offline yes no multiple SGD minimize the delay of tasks [24] offline no no single BCD minimize the energy consumption of IoT devices [25] offline no no single machine learning minimize the energy consumption of the UAV [28] online no no multiple machine learning optimize the geographical fairness among users [29] online yes no multiple imitation learning minimize the computation delay [30] online no no single machine learning maximize the amount of offloaded tasks [31] online yes no multiple machine learning minimize the weight-sum cost of UAVs [32] online no no multiple machine learning optimize the energy consumption and delay As illustrated in Definition 1 , it defines the discrete derivative of the set function, which is also known as the marginal benefit.The diminishing marginal benefit is a natural and common phenomenon in the real world, which means that the additional cost will lead to less benefit.A set function will present the characteristic of diminishing marginal benefit if it is nonnegative, monotone and submodular, as defined in Definition 2. For ease of reference, some key notations used in our further work are listed in Table 2.

System model and problem formulation
In this section, the system model of UAV-aided task offloading is introduced, followed by the problem formulation.

Network model
As shown in Fig. 1, a UAV equipped with the edge computing platform is introduced to periodically provide task offloading service for IoT devices.In order to stably communicate with IoT devices, the UAV will hover over the target area for a constant period t hov to receive tasks from nearby devices.There is a set S = {s 1 , s 2 , ..., s m } of m candidate hover sites within the service scope of the UAV, which are commonly located in task-intensive areas, simultaneously considering the environmental restrictions, e.g., the obstacles like tall buildings or the air exclusive zones [33,34].Additionally, a set T = {t 1 , t 2 , ..., t n } of n CPU-bounded tasks will be generated by IoT devices with communication range r 0 .Each task t j can be represented by a two-tuples t j = (l j , v j ) , where l j denotes the size of task t j (in bit) and v j denotes the benefit of processing one-bit task t j .Intuitively, the weight of the task is closely related to its significance and urgency, which means processing more important and urgent tasks can bring more benefit to the UAV.A scheduling strategy, which utilizes the global information, is developed by the terrestrial control center to guide the path scheduling of the UAV and arrange the offloading sequence of tasks, as shown in Fig. 2. It is assumed that these tasks are delay-tolerant.For example, in the maintenance of the electrical system, the sensors deployed in the pylons can upload their collected data to the UAV for potential threats analyzing.Thus , the UAV can periodically fly to those ares for task offloading and return the computing results to IoT devices after a period of time.Meanwhile, the buffer capacity of the UAV is sufficient to store the task sequence.

Communication model
A 3-D Cartesian coordinate system is constructed to describe the communication link between the UAV and IoT devices.The location of the hover site s i and the IoT device w j can be represented by s i = [x i , y i , H] and w j = [x j , y j , 0] , respectively, where H is the flight altitude of the UAV.Then the communication channel between the UAV and IoT devices can be considered as a Line of Sight(LoS) channel, where the channel state can be regarded as stable and the path loss exponent is 2. We denote d ij = � ‖s i − w j ‖ 2 as the Euclidean distance between the hover site s i and the IoT device w j .Thus the average channel power gain can be given by g ij = 0 d −2 ij , where 0 represents the average channel power gain at the reference distance of 1 meter.For simplicity, it is assumed that IoT devices utilize a constant power P t to transmit data.Finally, the transmission rate between the UAV at the hover site s i and the IoT device w j can be given by where B 0 indicates the bandwidth of the communication channel and 2 represents the additive white Gaussian noise power at the receivers.Due to the limited channel bandwidth of the UAV, the offloading strategy of tasks should be elaborately designed to maximize the benefit of the UAV.It is assumed that the computation tasks are divisible, i.e., there is no correlations between data and any bits of data can be processed independently [19,35].Thus, one task can be divided into several parts for offloading because of the limited hover time of the UAV.We use p ij to describe the data size of task t j to be offloaded to the UAV when it hov- ers at the site s j .Considering the size of tasks, p ij can be denoted by Note that the offloaded data cannot exceed the size of the task.

Energy model
Without loss of generality, it is assumed that the UAV's energy consumption consists of three parts, including computing, data transmission and flying.The matrix variable P = {p ij |i = 1, ..., m;j = 1, ..., n} is introduced to describe the offloading strategy of tasks.If p ij = 0 , the task t j will not be offloaded to the UAV when it hovers over the site s i .Assuming that the UAV flies at a constant speed to traverse all the selected hover sites, the travelling cost E t of the UAV can be expressed as where is the energy coefficient of the UAV to travel per unit distance and |L(X)| is length of the flight path of the UAV.The energy consumption of the UAV when it hovers over a location can be calculated as where denotes the energy coefficient of the UAV to hover per unit time and P r is the receiving power of the UAV.Note that the UAV needs to keep listening to the communication channel when hovering.According to the extensively used energy consumption model in [24], the energy used to compute tasks can be given by where denotes the energy coefficient for computing and c denotes the number of CPU cycles required for computing one bit of tasks.Finally, the total energy cost of the UAV within a complete dispatch can be given by

Problem formulation
Obviously, the on-board battery cannot support the uninterrupted flight of the UAV, which means the UAV must return to the charging station before exhausting its energy.Intuitively, it is expected that the scheduling strategy can make the UAV achieve the maximum benefit with the limited energy budget B. For the task t j , the UAV can obtain u j i = v j p ij benefit when it hovers over the site s i .Then the cumulative benefit of the task t j can be derived when the UAV traverses a set of selected hover sites X by Note that the maximum offloaded data of the task t j can not exceed its size l j .Therefore, the cumulative benefit of the task t j cannot exceed a threshold, and considering all the tasks, the overall benefit of the UAV can be given by Our goal is to maximize the benefit of tasks processed by the UAV while the total energy cost will not violate its energy budget.This can be achieved by optimizing the set X of selected hover sites and the offloading strategy P of tasks.We introduce a binary variable b i to indicate whether the hover site s i will be selected by the UAV.If b i = 1 , s i is selected; Otherwise, s i is not selected.Formally, the Benefit Maximizing Task Offloading (BMTO) problem can be formulated as follows: There are four constraints in the above formulation.The first constraint indicates that the offloaded task cannot exceed its size l j .The second constraint guarantees that the task can only be offloaded at the selected hover site.The third constraint ensures that the task can only be offloaded within the hover time of the UAV.The last constraint ensures that the total energy consumption of the UAV cannot exceed its energy budget.
According to the above formulation, the difficulties of the BMTO problem are twofold.On the one hand, it is hard to simultaneously choose the optimal hover sites and develop the offloading strategy of tasks.The selection of hover sites for the energy constrained UAV can be reduced to a knapsack problem which is a NP-hard problem [36].Then the offloading strategy of tasks can also be transformed into a classic assignment problem which is also proved to be NP-hard [37].Meanwhile, the selection of hover sites and the offloading strategy of tasks are coupled with each other which makes the BMTO problem more difficult to be solved.
On the other hand, the travelling cost of the UAV depends on the traverse sequence of the selected hover sites.A reasonable visiting order of the selected hover sites can significantly reduce the moving cost.While, optimizing the travelling cost is similar to solve a variant of Traveling Salesman Problem (TSP), which is also a NP-hard [38] problem.

Algorithm design
In this section, an approximate solution is proposed to address the formulated BMTO problem.Our main idea is to decouple the offloading strategy of tasks from the selection of hover sites by fixing the flight trajectory of the UAV.

Overview of algorithm
The workflow of our solution is given in Fig. 3. Initially, the set X which denotes the selected hover sites of the UAV is empty.Then we iteratively add candidate hover sites into X through heuristic attempts.In each attempt, the sequence of the hover sites in X is firstly optimized by Algorithm 1 to reduce the energy consumption of traveling for the UAV.Next , a surrogate function using Algorithm 2 is constructed to maximize the benefit of offloaded tasks when the UAV traverse those hover sites in X.Then, the additive benefit is calculated via Algorithm 3 and the candidate hover site with the maximal additive benefit will be selected.Heuristic attempts will be repeated until the energy cost of the UAV exceeds its energy budget.

Flight trajectory optimization
For a given set X of selected hover sites, the traverse sequence of elements from X is optimized to reduce the flight path of the UAV.While as the above section mentions , finding the optimal travelling cost is similar to solving a variant of TSP, and it is difficult to get the optimal result in polynomial time.Therefore, we design an approximate cost function C(⋅) combined with the nearest neighbor rule to schedule the flight trajectory of the UAV.For these unvisited hover sites in X, the UAV always flies to the hover site closest to its current location.After visiting all the hover sites in X, the UAV will return to the charging station.Based on this rule, a closed loop can be constructed for the UAV.The details of the trajectory optimization is illustrated in Algorithm 1.After optimizing the flight trajectory, the energy cost of the UAV in moving and hovering can be calculated by Eqs. ( 3) and (4), respectively.Note that the energy cost of the UAV in computing can only be given after determining the offloading strategy of tasks.

Offloading strategy optimization
Suppose it is expected to maximize the overall benefit of the UAV when it flies along the path scheduled by Algorithm 1. Thus the tasks, which are in the communication range between the devices and the UAV, should be selectively offloaded.Since the variable X is determined, the original BMTO problem can be reduced to Note that the values of b i , E t and E h can be given by Algo- rithm 1.From the above formulations, it can be easily found that due to the decoupling between the hover sites selection and the offloading strategy of tasks, the BMTO-R problem is much easier than the original problem.However, it is still difficult to directly obtain the optimal offloading strategy of tasks. (10) Observing that the achieved benefit of the UAV when it hovers over the site s i depends on the transmission rate R ij and the task benefit v j .We can use benefit rate Υ ij to describe the priority of tasks in hover site s i , which can be expressed as Actually, the benefit rate Υ ij indicates the achieved ben- efit of the UAV as it hovers over s i to complete the task t j in unit time.Here a simple but effective greedy rule is utilized to select the offloaded tasks for the UAV.When the UAV hovers over the site s i , the task with greater Υ ij will first be offloaded to the UAV until the UAV leaves the current hover site.By this way, a surrogate function B(X) can be constructed to select the offloaded tasks for each hover site s i in the scheduled path L(X).Clearly, our constructed sur- rogate function is a particular case of the original objective function U(X, P).If we denote the offloading strategy developed by B(X) as Θ , we can get B(X) = U(X, Θ) .The details of the surrogate function B(X) is given in Algorithm 2. After determining the offloading strategy of tasks, the total benefit of the UAV can be easily calculated.

Benefit-cost hover sites selection
In this part, we aim to augment the set X of selected hover sites by combining the above Algorithm 1 and Algorithm 2. Initially, X is empty, and we iteratively add the optimal hover site s * into X.Meanwhile, the total energy cost of the UAV will not exceed its energy budget.The optimal hover site, which makes the UAV achieve the greatest ratio between the additive benefit and the total cost, is selected by means of making heuristic attempts.This operation can be represented by finding (11) . Through this approach, the UAV can visit more hover sites, thereby increasing the upper bound of the benefit achieved by the UAV.The details of the hover sites selection are described in Algorithm 3.

Performance analysis
In this section, it can be proved that the constructed surrogate function B(⋅) is a nonnegative, monotone, and sub- modular function.Thus, the defined BMTO problem can be transformed into a submodular maximization problem with a budget constraint.The performance bound of the proposed algorithm is also analyzed, followed by the time complexity.

Surrogate function analysis
The properties of B(⋅) are analyzed, and the following theorem can be derived.
Proof It is clear that B(�) = 0 , and according to Eq. ( 8), we have B(X) ≥ 0 for ∀X ⊆ S .Thus, by Definition 2 , the constructed surrogate function is nonnegative .According to Definition 2 , in order to prove the monotonicity of B(⋅) , we only need to prove B(Y) − B(X) ≥ 0 .Since (12) s * = arg max we just need to prove that for each task t j , min{u j Y , l j v j } − min{u j X , l j v j } ≥ 0 .According to Eqs. ( 7) and ( 8), we can have u j Y ≥ u j X and l j v j ≥ u j X , respectively.Then we discuss different cases.Case1: if Submodularity of set function can be proved by comparing their discrete derivatives ΔB(s i |X) and ΔB(s i |Y) , where X ⊆ Y ⊆ S .According to Definition 2 , proving that B(⋅) is submodular is equal to prove ΔB(s i |X) − ΔB(s i |Y) ≥ 0 .According to Eq. ( 8), we have Similar to the proof of monotonicity, we need to discuss different cases.Case1: if Here further d i s c u s s i o n i s n e e d e d . 1 i fu To summarize the above, we can get ΔB(s i |X) − ΔB(s i |Y) ≥ 0 in all cases.According to Defini- tion 2 , we can prove that B(⋅) is submodular.

Performance bound analysis
Maximizing the overall benefit is equivalent to maximize the nonnegative monotone submodular function B(⋅) .Thus, we can transform the BMTO problem into a submodular maximization problem and prove that the proposed algorithm ( 13) can achieve an approximation ratio of 1 2 (1 − 1 e ) .For better illustration, some essential notations are introduced .For i = 1, 2, ..., |X| , let s * i be ith element that selected by Eq. ( 12).We use X i to denote the set after adding s * i into X i−1 and X 0 = � .Simultaneously, the benefit obtained by the optimal solution is denoted by OPT.Referring to [39], the following theorem can be given .Proof According to [40], we can obtain that the constructed surrogate function B(⋅) satisfies the following equation: Let k = |X| and s * k+1 be the first element that Algorithm 3 selects, but the energy cost is over the energy budget of the UAV.Thus, we can get C(X k+1 ) ≥ B .Combined with the basic inequality property, e.g., 1 − x ≤ e −x , the above equa- tion can be transformed into Utilizing the submodularity of B(⋅) in Theorem 1, we have ) .Finally, we can obtain Note that s * k+1 denotes the same element with X * in Algo- rithm 3.According to the above equation, it can be indicated that at least one of B(X k ) and B(s * k+1 ) can achieve or exceed the performance of 1 2 (1 − 1 e ) ⋅ OPT.

Time complexity analysis
The time complexity of the proposed algorithm is closely relevant to the number of candidate hover sites and tasks.There are at most m iterations in Algorithm 3 to expand the set X of hover sites.In each iteration, at most m times heuristic attempts are made to find the element s * .In each attempt, O(mn) is taken to achieve the offloading strategy of tasks by Algorithm 2. For the path planning in Algorithm 1, the nearest neighbor rule will take a time of O(m 2 ) .It takes a time of O(m) to execute the line ( 14) of the Algorithm 3. Therefore, the overall time complexity for our algorithm is O(m(m(mn

Performance evaluation
In this section, numerous simulations are conducted to compare the performance of different algorithms and the simulation results are analyzed.

Simulation setup
For the simulation environment, it is assumed that IoT devices are randomly distributed in a 500 × 500m 2 service area.By default, the number of devices is n = 40 and each of them will generate a task.The communication range and the transmit power of those devices are set to r 0 = 200m and P t = −10dBm , respectively.The UAV starts from the charging station at the coordinate of (0, 0) and flies at an altitude of H = 50m .The default energy budget of the UAV is set to B = 10KJ , and it takes P r = 0.5W to monitor the communication channel.The energy consumption coefficient of the UAV for hovering, and computing are = 4 , = 2 and = 10 −4 J , respec- tively.The number of CPU cycles for computing one bit of task is set to c = 1000 .The bandwidth of the communication chan- nel is fixed to 20MHz.The channel power gain at the reference distance d 0 = 1m is set to 0 = −50dB and the additive white Gaussian noise power is set to 2 = −110dB .Additionally, the length of tasks is l j ∈ [1000, 1500] and the benefit of process- ing one bit of the task is v j ∈ [0.01, 0.05] .The only uncertain parameter is the location of the candidate hover sites.Since the UAV can stay at any point of the hovering allowed areas, we partition the service area into small squares with the side length = 20 and the center of each square is regarded as the location of the candidate hover site.Some significant simulation parameters are shown in Table 3.
In order to exclude the effect of randomness on the simulation results, each simulation is repeated for 50 times with different samples.We will calculate the mean value of all the results and give the standard of them.

Baseline setup
For the sake of fairness, our proposed BMTO algorithm is compared with the following four schemes in terms of total benefit and energy efficiency ratio.

RC-ratio:
The first algorithm is RC-ratio which is similar to our BMTO but adopts a different strategy to schedule the flight trajectory.In RC-ratio, the candidate hover site with the maximal ratio will be selected, which can be denoted by Intuitively, the most significant difference is that the additive cost is calculated as the denominator.2. Greedy scheme: Greed scheme is a simple but effective method to solve the problem of submodular function maximization [41].It iteratively selects the hover site while the energy cost is not considered.
The performance of different algorithms is examined in terms of total benefit and energy efficiency ration.Here the energy efficiency ratio is defined as the ratio between the energy cost of calculation and the total energy cost.

Impact of task number
The impact of the number of tasks is first studied on .It is assumed that the number of tasks varies from 30 to 70.As shown in Fig. 4a , we can clearly find that with the number of tasks rising, the total benefit obtained by different schemes increases to a boundary value.This is because the UAV can only offload tasks within its energy budget.Simulation results illustrate that our proposed BMTO algorithm outperforms HOTSPOT and RC-ratio by 22.0% and 20.1%, respectively, and is almost 1.5 times as much as Greedy Scheme.Since the Random Scheme adopts a stochastic way to select the tasks , it achieves a fluctuating benefit .As shown in Fig. 4b, we can observe that with the number of tasks increasing, all schemes except Greedy has a slight improvement in terms of energy efficiency.The reason is that the UAV can hover over those sites with the higher benefit of tasks .

Impact of hover sites
Then the impact of the number of hover sites is investigated.The grid side length is adjusted from 10 to 50 to examine the performance of different algorithms.As shown in Fig. 5a, it can be observed that there is a downward trend on total benefit for different algorithms except the Random Scheme.It can be explained that with the increasing of the grid side length, the UAV can choose less candidate hover sites, thus less benefit can be obtained from the global solution.Additionally, the decrement of candidate hover sites can result in less iterations for BMTO and RC-ration, which also short their running time.Fig. 5b shows that with the grid length decreasing, there are slight declines in BMTO, HOTSPOT and RC-ratio.In general, the performance of BMTO is much better than the other four schemes.This is because BMTO adopts a benefit-cost rule to select the

Impact of energy budget
Intuitively, the energy budget of the UAV has direct influence on its operating time.To evaluate the impact of energy budget, we record the UAV's total benefit when the energy budget varies from 5KJ to 25KJ.As demonstrated in Fig. 6a, the total benefit obtained by different algorithms increases with the expansion of the energy budget of the UAV.Not surprisingly, it can be found that our proposed BMTO first reaches the maximal benefit of 1462.3 when the energy budget is 15KJ.While HOTSPOT and RC-ration can only achieve 71.9% and 84.6% benefit of BMTO when using the same energy.For the other three schemes, even if the energy budget is added to 25KJ, they could not reach the maximal benefit.Fig. 6b describes the energy efficiency of different algorithms when adopting different energy budgets of the UAV.It can be clearly seen that BMTO achieves the best energy efficiency ratio in the vast majority of cases.

Impact of hover time
Next we explore the influence of the hover time of the UAV.
The time of the UAV to stay at the hover site is set as different seconds from 1 to 10. Simulation results show that in terms of total benefit, BMTO outperforms HOTSPOT and RC-ratio by average of 30.1% and 23.3 %, respectively.Fig. 7a demonstrate that the total benefit rises to a boundary value for different algorithms.This can be explained that since the IoT device has its communication range, the UAV can only obtain the benefit from the nearby devices at the hover site.Although the hover time is extended, there are no more tasks near the hover site to be completed.As shown in Fig. 7b, the energy efficiency ratio of BMTO has a great improvement from 23.4% to 34.5%, which differs from the previous experiments.This is because at a hover site, the UAV needs enough hover time to receive the data of tasks.
If the hover time is short , the UAV needs to visit more hover sites which means much energy will be spent on travelling.However , if the hover time is too long , the UAV will be idle after receiving all the data of tasks , and thus much energy is wasted on hovering and channel listening.

Scheduled trajectory comparison between BMTO and RC-ratio
Greedy rules are crucial for BMTO and RC-ratio.Thus, we would like to have a further study on them, and find the underlying reason why BMTO performs better than RC-ratio.Simulation parameters are all set as default values, and the scheduled trajectories of the UAV by different algorithms are visualized in Fig. 8a.It can be clearly found that the flight path planned by BMTO passes through most of the tasks intensive areas while the scheduled path by RC-ratio only visits a few important sites which are closed to the charging station.Additionally, RC-ratio scheduled a more regular path which contains much adjacent candidate hover sites.This can be explained that RC-ratio prefers to choose the neighboring hover site as the next destination since the additive cost is used as the denominator of the selection rule.Although more benefit can be achieved if the UAV flies to a distant hover site, the hover site may not be chosen because of the big additive cost.Fig. 8b illustrates the total benefit after each iteration of different algorithms.It can be clearly found that BMTO only requires 18 iterations to reach the maximum benefit which means the UAV will visit less hover sites but achieve more benefit.

Conclusion
In this article, we propose an approximation algorithm to solve the BMTO problem in UAV-aided MEC.We jointly consider the trajectory scheduling of the UAV and the offloading strategy of the tasks, which are two coupled problems.By fixing the selected hover sites, the original problem is reduced to a BMTO-R problem, which can be solved by constructing a surrogate function using a simple yet effective greedy rule.Heuristic attempts based on the benefit-cost ratio are made to select the optimal hover site of the UAV.We theoretically analyze the performance bound and the time complexity of the proposed algorithm.
Extensive simulations are conducted and the results show the priority of our proposed algorithm over the compared schemes in terms of total benefit and energy efficiency ratio.

Fig. 1
Fig.1UAV-aided edge networks.In this scenario, the video stream can be divided into several parts of image frames and each part can be independently offloaded to the UAV for target identification through wireless communication

Fig. 2
Fig. 2 Schedule buffer in the UAV

3 .
Random scheme: Random scheme randomly selects a sequence of hover sites that satisfies the energy budget of the UAV.It is worth noting that both BMTO and RC-ratio algorithms have the time complexity of O(m 3 (m + n)) , while the time complexity of Greedy and Random Scheme are O(m 3 n) and O(m 2 n) , respectively.4. HOTSPOT: [23] works cooperatively with a base station to schedule the trajectory of the UAV according to the time-varying hot spot of user distribution.Here we modify its simulation environment for fairness, i.e., removing the base station, making the metric of the task quantity in HOTSPOT can be evaluated in terms of benefit.(18) s * = arg max

Fig. 3
Fig. 3 Workflow of our solution

Fig. 4 Fig. 5
Fig. 4 Impact of the number of tasks

Fig. 6 Fig. 7
Fig. 6 Impact of the energy budget of the UAV

Table 1
Comparison of different schemes

Table 2
Definition of main notationsNotations Definitions

Table 3
Parameter settings hover sites, which greatly improved the energy efficiency of the UAV.