Dynamic scheduling of heterogeneous resources across mobile edge-cloud continuum using fruit fly-based simulated annealing optimization scheme

Achieving sustainable profit advantage, cost reduction and resource utilization are always a bottleneck for resource providers, especially when trying to meet the computing needs of resource hungry applications in mobile edge-cloud (MEC) continuum. Recent research uses metaheuristic techniques to allocate resources to large-scale applications in MECs. However, some challenges attributed to the metaheuristic techniques include entrapment at the local optima caused by premature convergence and imbalance between the local and global searches. These may affect resource allocation in MECs if continually implemented. To address these concerns and ensure efficient resource allocation in MECs, we propose a fruit fly-based simulated annealing optimization scheme (FSAOS) to serve as a potential solution. In the proposed scheme, the simulated annealing is incorporated to balance between the global and local search and to overcome its premature convergence. We also introduce a trade-off factor to allow application owners to select the best service quality that will minimize their execution cost. Implementation of the FSAOS is carried out on EdgeCloudSim Simulator tool. Simulation results show that the FSAOS can schedule resources effectively based on tasks requirement by returning minimum makespan and execution costs, and achieve better resource utilization compared to the conventional fruit fly optimization algorithm and particle swarm optimization. To further unveil how efficient the FSAOSs, a statistical analysis based on 95% confidential interval is carried out. Numerical results show that FSAOS outperforms the benchmark schemes by achieving higher confidence level. This is an indication that the proposed FSAOS can provide efficient resource allocation in MECs while meeting customers’ aspirations as well as that of the resource providers.


Introduction
The wireless network has with no doubt reshaped information technology (IT) as it affects positively the way we live. A rudimentary connectivity of the wireless networks is provided with the introduction of packet data services in cellular systems with a number of online users having a great impact on the quality of service produced [1,2]. On the other hand, the traditional wireless networks are incapable of addressing the exponentially growing demand in both high data rate and high computational capability [3][4][5]. Consequently, compared to the growing demand for more enhanced user experience, the distance between the mobile hardware and users demand is expected to hinder the mobile devices from providing experience-rich mobile services [6,7].
Cloud computing can complement the wireless network to provide the possibility for mobile users to access cloud resources (infrastructures, platforms, and software) on demand [8]. The paradigm can provide virtually unlimited resource and service provision to mobile devices [9]. The centralized hosts within the cloud datacenters can act as an agent between the original content providers and mobile devices, enabling resources sharing in remote datacenters [10]. Hence, the integration of cloud computing and wireless mobile environment allows running computationintensive applications over resource-constrained mobile devices to execute computational intensive tasks [11][12][13].
Extended author information available on the last page of the article This is called the mobile cloud computing (MCC). The MCC environment leverages cloud resources to enhance the performance of resource-constrained mobile devices to more powerful computing resources. However, the MCC environment attracts intolerable long latency when accessing centralized cloud resources. Hence, several applications may miss their deadline due to low bandwidth data transmission, causing delays that are unacceptable in certain cases [5,14]. It is assumed in [6,15] that a possible way to mitigate the challenge of unacceptable delay is to make sure computational resources are at the proximity of end-users.
Recently, mobile edge clouds (MECs) emerged as a promising solution to offer a service environment that is characterized by proximity, low latency, and high data rate access to mobile subscribers via a radio access network [16,17]. Although the scale of the edge cloud seems limited in capacity to execute high computational tasks, the remote cloud is used to compliment resource scarcity for mobile devices [15,18]. One of the challenges faced by MECs is limited resources. This could potentially cause hungry resource applications to miss their deadline. Hence, for MECs to realize its full potentials, the resource allocation challenge needs to be resolved. Dynamic resource allocation is a promising goal that can reduce the quality of service degradation in MEC scenarios if well carried out. Although MEC users often suffer unfair resource allocation, most especially for the resource hungry applications [19][20][21], the need to provide an ideal resource allocation scheme for MECs is necessary. This can reduce access overhead of the end users' mobile devices in both time consumption and costs of executing their application [22].
In this article, we study how resources allocation meet the computing need of resource-hungry applications in MECs. Makespan (known as the minimum time required for a task to be executed on a virtual machine) and costs minimization and resource utilization are the main constraints of optimization. The literature presents several heuristics and metaheuristic procedures used in solving the challenge of resource allocations in MECs. However, the heuristic techniques are known to be problem dependent and are usually trapped in a local optimum due to their greedy nature, thereby finding it difficult to reach the global optimum solution. This often affects resource allocation if implemented in MECs. On the other hand, the metaheuristic techniques are promising as well as problem independent. They can schedule a large number of resource and tasks while providing a decent approach to run away from local search to the global one, which mostly guarantees the achievability of the global optimality [16]. Therefore, to provide and efficient resource allocation in MECs, a suboptimal solution is then required.
The metaheuristic fruit fly is a swarm optimization algorithm put forward by When Tsao Pan in 2011 [23]. The development was based on food findings of the fruit fly. Since the fruit flies adopt a special smell and vision, they can smell food from a far distance. Two phases are associated with the fruit fly: smell and vision phases. The smell phase is also known as the local search phase where the flies fly through the food by using their smell capability. As they come closer to the source of food, the vision phase starts. This phase is also known as the global search phase, which is repeated until the fruit fly reaches the food. One of the basic challenges of the fruit fly is the convergence speed of its smell capability. When the smell value becomes smaller, entrapment at the local optimum becomes possible, which could lead to poor resource allocation if implemented. The simulated annealing (SA) is used. It is used to increase the diversity of a local search and discover the effect of the parameter settings for the possibility of getting better results [24]. In order to deal with the limitations of the conventional FOA, the SA-based approach is incorporated into the local search of the FOA to not only address the challenge of convergence speed but to also increase its diversity at the early phase of the search process, making it more efficient for resource scheduling in MECs. This led to the proposed fruit fly-based simulated annealing optimization scheme (FSAOS). Simulation results show that the FSAOS outperformed particle swarm optimization (PSO) and FOA in terms of makespan and execution costs, and resource utilization.
The contribution of this article is as follows: (a) Formulation of a resource-scheduling optimization problem. (b) Mathematical modelling of the optimization problem for the derivation of makespan and cost models. (c) Utilization of the proposed FSAOS to solve the models.
The rest of this article is organized as follows: Related work are discussed in Sect. 2. Section 3 provides discussion on the optimization algorithms. Section 4 provides the system model. Problem formulation and proposed approach are discussed in Sect. 5. Section 6 provides discussion on the experiment and the results obtained, while Sect. 7 concludes the article.

Related work
This section reviews the literature associated with our research work and pointed out the limitations of the existing techniques.

Review on resource allocation
Research toward resource allocation in cloud and edge computing has been studied extensively [17] with focus on several resource providers, with each provider contributing a part of the resources (e.g., infrastructure) for service continuity and profit gain. As stated in the existing literature, this is to potentially meet objectives of the consumers and service providers. Therefore, a broad review on the area of economics of MECs with focus on resource pricing and allocation/task scheduling is carried out. As a result, profit maximization and resource utilization are some of the goals of any service provider to achieve. Although lack of pricing standard often affects customer quality-of-service (QoS) expectation in such environment, to offer a promising architecture that will mitigate this concern, [25] put forward an incentive-compatible auction mechanism (ICAM) that allows resource trading among mobile endusers and service providers. A model to incentivize budget balance and truthfulness is introduced to test the efficiency of the ICAM approach. The theoretical analysis and numerical results revealed by the researchers show that ICAM can guarantee efficiency in terms of budget balance and truthfulness for both end-users and service providers. On the other hand, a revenue auction algorithm is introduced to improve locally the end-users experience. Their main objective is to ensure nearby data are processed to reduce transmission delay and ensure minimum processing cost. A reverse auction is used to distribute overloaded data to the edge server as well as balance server load. In another development, [2] exploit the Lagrange function to develop an optimal sales price and bandwidth allocation scheme for internet service providers (ISPs). Their objective is to address the challenge of end users' denial when requesting online service as well as address low connection speeds below their stipulated contract speed limit agreement. As revealed by the researchers, their method can achieve a market equilibrium price and better bandwidth resource allocation compared to the benchmarked scheme.
Homogeneous study on MEC was carried out in [26]. A dual auction framework was developed for heterogeneous MECs. The developed system enabled offload tasks from a large-scale region using both a single and double auctionbased model. Simulation results show significant improvement compared with the benchmarked schemes. Lin [1], in their part, studied dynamic resource allocation strategy for mobile edge cloud. The researchers noted that physical resource layer in network model was responsible for providing hardware resources, computing resources and storage resources. According to the researchers, the existing strategies were not efficient enough in providing solution that could potentially address existing concerns.
Hence, they considered that deployment of virtual machine monitors at the physical base stations can serve as a potential solution while considering connections between virtual machine stations. Furthermore, study on automated deployment and run-time management of microservicebased applications for cloud and edge computing environments was carried out in [6]. According to the researchers, management of applications and tasks at the cloud-to-edge continuum is far from trivial, due to the lack of robust and production-level solutions. Hence, they put forward an application-level cloud orchestration framework that utilized both edge and fog nodes. Experimental results via simulation using two realistic case studies are used by the researchers to demonstrate the effectiveness of their developed solution. On the virtues of the existing challenges affecting allocation of resource in cloud computing, the need to provide more efficient resource allocation techniques is paramount. These motivated [27], to propose a QoS-based resource allocation scheme using swarm-based ant colony optimization. The effectiveness of their proposed solution was demonstrated via simulation, and results show significant performance than the benchmarked schemes. On their part, [14] put forward both resource allocation algorithm and task scheduling strategy to reduce average completion latency of an environmental monitoring application. According to the researchers, simulation results have shown significant improvement compared with the benchmarked algorithms. Consequently, on virtue of limited performance when allocating better resources across network nodes, a joint optimization algorithm that improved resource utilization, reduced energy consumption, increase network capacity was put forward by [11]. Simulation results show the developed technique can be better compared to the benchmarked schemes. On the other hand, [18] proposed a cloud resource allocation algorithm based on a parallel and improved NSGA-II (RAA-PI-NSGAII) algorithm. The algorithm computes fitness values of individuals and improved on quality of solution set. According to the researchers, simulation results show significant performance when compared to the benchmarked scheme.
Resource allocation multi-player domain is a concern, especially when considering user mobility. These motivates [16] to develop a metaheuristic-based service allocation framework to optimize the trade-off between energy consumption and makespan as well as to deal with resources heterogeneity. In [28], the researchers introduced a market-based framework to provide efficient resource allocation in heterogeneous edge nodes. An equilibrium concept in economics was then explored to generate a market equilibrium solution that maximizes resource utilization and allocates optimal resource bundles to services given their budget constraints. An approach to guarantee fair resource allocation under constraints' mobile users' transmission rates and throughput maximization is studied in [29]. The researchers first unveiled a mathematical model based on fair Nash bargaining resource allocation game. A near-optimal bargaining resource allocation strategy for mix integer nonlinear programming optimization through time-sharing variable is later developed to solve the model. The results of the simulation as revealed by the researchers shows that their developed scheme can provide a fair allocation of resources that increase the system throughput. In a similar development, [30] stated that to realize spectrum virtualization, multi-service resource allocation needs to be addressed. As a result, a service-centric wireless virtualization model is put forward by the researchers. These then followed with a multi-service resource allocation algorithm derived by decoupling of existing scheduling algorithms to meet the expectations of the end users. According to the researchers, numerical results show that their developed scheduling algorithm can schedule specific services effectively compared to the benchmarked algorithms.
These motivated [31] to develop an auction model that facilitates resource trading between mobile service providers and mobile end-users. Simulation results according to the researchers have shown that their developed scheme can fairly allocate tasks and determine the trading price of the resources compared to the benchmarked schemes. Wang et al. [3] in their part developed a multiplier-based algorithm aiming at addressing in-network caching and computational offloading. The simulation results according to the researchers show their scheme can achieve a promising performance. On the other hand, as services are now moving towards cloud continuum, datacenters are becoming cumbersome with increased in workload, causing growth in datacenters, and therefore required more energy consumption. This motivated [32] to propose a hybrid approach that uses genetic algorithm (GA) and random forest (RF) known as GA-RF to address such concerns. In their approach, a training dataset for random forest model was generated using genetic algorithm. The effectiveness of their proposed approach was verified via simulation, and their proposed GA-RF model was able to improve resource utilization, energy consumption and execution time compared to the benchmarked models. In a similar development, [33] stated that the development of big data and artificial intelligence provide more concern to the cloud resource requests, thereby presenting more complex features like being sudden, arriving in batches and being diverse. According to the researchers, these could potentially cause resource allocation to lag far behind the resource requests and an unbalanced resource utilization that wastes resources. Hence, they proposed a proactive resource allocation method based on the adaptive prediction of the resource requests in cloud computing using nondominated sorting genetic algorithm with the Elite Strategy (NSGA-II). Simulation results show their proposed approach reduced resource allocation. In another development, improving efficiency of a resource allocation on cloud computing is the utmost priorities of several researchers. This led [34] to propose an improved particle swarm optimization (IPSO) algorithm. According to the researcher, his proposed approach compared to conventional PSO shows significant improvement in resource allocation on cloud computing. Nabi et al. [35] in their part put forward an adaptive particle swarm optimization (AdPSO) to reduce task execution time and increased throughput and average resource utilization ratio. The results of the simulation as stated by the researchers show some improvement compared to the benchmarked scheme. Moreover, a system may decide to allocate both high wireless bandwidth and too many computation resources to a task leading to faster processing, but the system can only accommodate a few tasks with little profits in return. As a concern, a new optimization scheme using the Lyapunov technique was introduced by [31] to address a stochastic resource scheduling problem. The experimental results show that the developed algorithm can reach time average profit close to the optimum while maintaining the strong system stability and low congestion. [36][37][38][39], in their part, developed an efficient online multi-resource allocation algorithm that allows deadline-sensitive tasks to be processed at the edge-cloud system. This is to maximize the profit edge-cloud gains from meeting users' service-level agreements (SLAs). The results of the simulations achieved according to the researchers show a better profit in returns with moderate resource augmentation.

Findings from the literature review
From the related work, resource allocation in MECs is a non-deterministic polynomial-time hard (NP-hard) problem [16,40,41]. Inefficient resource allocation will continue affecting the performance of MECs due to its limited capacity and variation in workload. These causes delay in critical application that requires large sum of resources to be processed. Findings from the literature show that an ideal resource allocation scheme is needed for MECs to solve the challenge of resource-hungry applications. Considering QoS constraints such as execution costs, lack of standard pricing model in MECs is a concern, especially where resource providers from both the cloud and edge are self-interested or non-cooperative to agree on a unify resource price. Although few literatures addressed economic factors such as profit, cost, and revenue, majority focused on system performance metrics given system parameters and constraints. Another vital issue when considering consumers QoS expectations is to bear in mind each consumer has conflicting objectives and different constraints (e.g., budget and technology). Achieving sustainable profit advantage, cost reduction and resource utilization is always a bottleneck when trying to meet the computing needs of resource hungry applications [42][43][44][45][46][47]. Therefore, an optimal trade-off policy that will allow a resource provider to allocate its resources in such a way to ensure other allocations cannot provide strictly higher efficiency and at the same time be fairer to service consumers [48]. It is therefore imperative to develop an ideal resource allocation scheme that not only allocates resources effectively at the MECs but also meet the expectations of consumers in terms of QoS.

Fruit fly optimization algorithm (FOA)
The fruit fly optimization algorithm (FOA) is a method for finding global optimization based on the food-finding behavior of the fruit fly put forward by When Tsao Pan in 2011 [23]. Because the fruit fly uses special smell and vision to smell food from a far distance, they are superior to other species. Two phases are associated with the fruit fly: smell and vision phases. The smell phase is also known as the local search phase where the flies fly through the direction of the food using their smell capability. As they come closer to the source of food, the vision phase triggers. This phase, which is also known as the global search phase, is repeated until the fruit fly reaches the food. Figure 1 shows the food-finding process of the fruit fly, and the pseudocode for the FOA is shown in Algorithm 1 [23].
In the context of resource scheduling, each fruit fly is encoded as a task from the edge network, which also represents the network position of the fly. The resources (e.g., virtual machines) at the edge network are food search by the flies. Once the service location has been determined, the scheduling process is executed to find the optimal composition of the quality of service (makespan and costs) virtual resource. Each of the position of the fruit flies represents the initial solution of the flies.

The need to improve FOA
The conventional fruit fly has some advantages such as its fastness in solving an optimization problem, updating strategy and its simplicity in understanding. However, the smell value S i in the conventional fruit fly is extremely small due to the dispersion of distance value to a global search region. This causes the fitness value to converge early, leading to its entrapment into the local optimum. Similarly, the smell value S is always bigger than zero (0). This means the FOA fitness function value is always positive. When these values become fixed, it is difficult for the smell value S to get a value in a uniform distribution, thereby making it impossible for the FOA to generate a uniform solution. At this point, the ability of the fruit fly toward a global solution search will be lost. Therefore, solving complex optimization problems effectively will be difficult using the fruit fly technique. Another limitation of the fruit fly optimization algorithm is that multidimensional problem cannot be handle as it was suggested for solving only two-dimensional parameter optimization problems. As a result, the two-dimensional random values cause slow convergence at the beginning of the search, while at the later search, it cannot obtain optimal solution [23,49]. These concerns if not address may cause the FOA to provide inefficient resource allocation that will lead to resource underutilization, poor revenue and high processing time and hence the need to make FOA adaptable for resource allocation in MECs.

Improved fruit fly optimization algorithm (I-FOA)
In the conventional FOA,

Simulated annealing
Simulated annealing (SA) is a local search probabilistic approximation algorithm [41] put forward by Kirkpatrick et al. in 1983. The SA algorithm often begins with an initial solution X according to some neighborhood function N with an updated solution X 0 created. A neighborhood-based mutation operator strategy can be incorporated into the SA algorithm for enhancing population diversity. Assuming S is the search space, each solution X [ S can be represented by its nð [ 0Þ components, i.e., . . .; n. The neighborhood N of a solution X is defined as: where X 6 2 N X ; and X 2 N X 0 iff X 0 2 N X , P ro is the probability of deciding whether to accept or reject a new solution and R is a random number generated uniformly between 0 and 1. As to how the particle tends to adopt a state, which is an improvement over current one, the algorithm generates a solution when fitness value f X 0 ð Þ becomes lower than f X ð Þ. Assume X 0 has the higher fitness, it will occasionally be accepted if the defined probability shown in Eq. 14 is satisfied [24]: where Df is the difference between the fitness values and Þ is the fitness evaluation function and f X ð Þ the current solution of the neighbor accordingly; T represents the temperature parameter. This parameter is determined according to the cooling rate used in [24].
where r i = temperature descending rate,80\r\1; i ¼ the number of stints, which neighbor solutions have been generated so far; When the initial value of the temperature is low, the algorithm becomes limited in locating global optimal solution as the computation time of the algorithm is believed to be shorter. At each iteration performed by the SA algorithm, the comparison between the currently obtained solution and a solution newly selected is carried out. A solution that shows improvement is always accepted. The non-improving solutions are still accepted since there is a possibility that they may escape being trapped at local optima while searching for a global optimum solution. Based on the defined probability in Eq. 14, the acceptance of the non-improving ones is often determined by the temperature parameter. This makes SA algorithm one of the most powerful optimization mechanism for the improvement of a local search. The basic SA procedure is represented in Algorithm 3.

System model
We assume a paradigm with a distributed cloud resource provider (DCRP) that manages resources at the centralized cloud. The edge resource is managed by an edge resource provider, but coexist with DCRP at the centralized cloud to allocate resources to the edge consumers. Figure 2 shows the system framework. Three types of entities are involved in this scenario: resource provider (RP) at the edge, a distributed cloud resource provider (DCRP), and a pool of consumers known as mobile users (MUs). The FSAOS algorithm is situated within the edge orchestrator and does the resource optimization and allocation purposes. If an MU requires high computation-intensive resources at the edge, more resources are requested by the FSAOS algorithm to argument the already existing one at the edge.
With the coexistence of the edge service providers, an MU that requests for resource having budgetary constraint need not to concern as the proposed FSAOS dynamically assign resources to customer's application using the right computing resource. In the resource and task scheduling process, each fruit fly within the swarm is initialized as a set of tasks uploaded by the mobile consumers to the edge resources. The fruit flies are encoded as a set of tasks emanating from the edge network, which also represents the network position of the flies. The resources at the edge network are food search by the flies as indicated in Fig. 1. Once the service location has been determined, the algorithm within the FSAOS executes the scheduling process to find the optimal composition of the quality of service (makespan and costs) virtual resource. The position of the fruit flies represents the initial solution of the flies. Instead of assigning tasks to resources at random, the algorithm within the FSAOS schemes selects the best resource that meets the computing need of each uploaded tasks and assign these resources according to the boundary location. This process is repeated until the QoS is achieved for all tasks scheduled on the computing resources.

Problem formulation and proposed approach
This section discusses the resource allocation problem and the proposed approach that is used in solving the model derived from the resource allocation problem.

Problem formulation
Due to workload variation and the limited capacity of resources at the MECs, the performance of an application may be affected unless an ideal resource scheduling optimization scheme is designed. We assume the costs of resource usage consist of both the virtual machine and data transfer cost. Consequently, a resource provider cannot be paid less than its resource unit cost, while the allocated providers' resources must fulfill a service consumer's demand. Therefore, the expected time of computation of each resource (e.g. virtual machines) is taken into consideration based on their capacity (ability) to execute tasks. More precisely as it relates to this problem, the resources are considered heterogeneous in nature and the tasks to utilize these resources also vary differently from mobile users based on various factors, like costs, and wireless link performance (makespan). Each mobile consumer submits its bid to the edge provider by selecting the best service that relates to its demand. Our goal is to ensure resources are distributed effectively to execute users' applications without compromising their quality of service while still ensuring better resource utilization. The scheduling model is as follows: Let T ¼ t i j1 i n f grepresents the tasks groups and n is the overall number of tasks. V ¼ v j j1 j m È É are the sets of virtual machines and m is the number of virtual machines. The goal is to assign the most needed virtual machine v j 8j ¼ 1; 2; . . .; m f gto execute users' task t i 8i ¼ 1; 2; . . .; n f gat the edge taking the following objectives: makespan and cost, and resource utilization. Hence, the makespan time of the tasks executed on a virtual machine is reduced using Eq. 16, TE ij ¼ X n;m i;j exeTime ij ; 1 i n; 1 j m ð17Þ where Makespan M ð Þ represents the maximum time of execution among all virtual machines at the edge and cloud servers; TE ij represents the total execution time; exeTime ij represents the execution time of task i on virtual machine v j ; x ij is equal to 1 if v j is assigned to execute task t i and zero (0) otherwise; n is the number of tasks t i and m is the number of virtual machine v j ; v npej represents the computing capacity of the virtual machine v j .
On the other hand, let C ¼ fc j jm ! j1g represent the unit cost of virtual machine v j per time quantum. The unit cost of executing a task t i on a virtual machine v k in this research is considered per hour (/hr), which is computed in US dollar ($). Therefore, the amount of time a task spent running on a virtual machine in seconds is converted into hours. We assume the costs of resource usage comprises both the cost of virtual machine and the cost of data transmission. Equation 20 computes the total execution cost of task i on all virtual machine v j ; where T cost represents the total execution cost of processing all tasks; C exe represents the execution cost of a resource usage when a task t i assigned on virtual machine v j ; C j is the price of a unit cost of resource per second as specified by the resource provider. Thus, the trade-off factor a for all mobile users can now be introduced to the model for optimizing the trade-off between makespan time and costs based on service preference. This factor is within 0 a 1 and does help the mobile users to make better realization of the optimization objective. Therefore, the scheduling problem, which is also the fitness function of the scheduling problem, can be presented as shown in Eq. 22.
where a is the trade-off factor, Makespan is the average execution time of the entire tasks processed as achieved by the algorithms, and T cost is the total cost of processing all the tasks. For equation of the fitness function, relevant information concerning the decision variables and a fitness value is encapsulated into the proposed algorithm, which has an indicator of its performance. The best fitness value shows the highest degree of adaptation of the proposed schemes in providing better scheduling solution. It also helps check whether loads were shared equally on the entire system while trying to minimizing the makespan and increases the processing capacity of a given task set. The resource utilization is the actual amounts of resources consumed at both the edge and the cloud datacenter. One of the main objectives of resource utilization is making sure resources are well utilized to provide better profit to the resource providers in terms of revenue and profits. Equation 23 is used to compute the resource utilization R util on both edge and the cloud environment [41].
where TE ij is the total execution time of the whole virtual machines, exeTime ij is the execution time of task t i on virtual machine v j , and m is the number of virtual machines.

Proposed approach
An ideal resource and task allocation scheme that can schedule both resource and task to meet the computing demand of mobile cloud users is needed. This led to the developed FSAOS scheduling scheme. The developed FSAOS is a combination of both the FOA and SA algorithms. The local search of the FOA is constrained by premature convergence, causing the FOA to be entrapped at local optima. This can lead to providing poor scheduling performance when implemented in MEC. The procedure of Algorithm 2 and that of Algorithm 3 combined led to the developed Algorithm 4. With the developed FSAOS, moving out of the local optima region is possible for the best resource allocation. To increase the performance parameter estimation of the proposed FSAOS, the local search is enhanced with the SA. The SA also functions in the stabilization of both the local and global search procedures of the FSAOS scheme while ensuring its diversity of solutions. Hence, more powerful optimization search procedures that search for a global optimum solution are made possible using a uniform distribution in the FSAOS scheme.
In the resource scheduling and task allocation process, each fruit fly within the swarm is initialized as a set of tasks to be sent by mobile users to the edge resources and the available resources at the edge are food searched by the flies. In this research, the fruit flies are encoded as a set of tasks emanating from at the edge network. These also represent the network position of the flies. The position of the fruit flies represents the initial solution of the past flies. Instead of assigning tasks to resources randomly, the FSAOS algorithm selects the best resources to compute the need of each task and assign such resources according to the boundary location. The smell sense is then used to update the position of the flies according to Eq. 24, where x i represent the coordinates for the resource services obtained by FSAOS, n is the searching coefficient, w o is the initial weight and a is the weight coefficient. Distance x i measure is found for each dimension of the objective space by including the effect of an individual's constraint violation into its objective function. The major steps in calculating the distance measure start with obtaining the minimum and maximum values of each objective function in the population. The objective space is modified to account for the performance and constraint violation of each individual. The objective (fitness) function of the individual fruit flies is computed using Eq. 25. The objective functions are used to facilitate the search of optimal solutions not only in the feasible space but also in the infeasible regions. The cost and the makespan value are used for the computation of the fitness value.
where a is the weight coefficient that allows mobile users to select their preferred services. The fruit fly with the best fitness among the fruit fly swarm is selected using Eq. 26.
For the minimization process, the new fitness is accepted for an update according to the probability function defined in Eq. 27. The new fitness is designed to carry out search both at the feasible and infeasible space to exploit those individuals with better objective values. The number of feasible individuals in the population is used to guide the search process either toward finding more feasible solutions. The number of feasible individuals in the population adaptively controls the emphasis given to objective values or constraint violation in the objective function formulation. If there is no feasible individual in the population, the algorithm selects the optimum from the best solutions.
where f X 0 i À Á and f X i ð Þ denote fitness functions of the fruit flies and current solutions, and T represents the temperature. The fly with the best fitness is stored at each run of the scheme and is compared with the initial best solution. The probability of accepting a neighbor solution into a new generation of fruit flies using SA is obtained according to Eq. 27. The FSAOS algorithm is described as shown in Algorithm 4.

Experiment and results discussion
This section provides detail information about the experiment conducted as well as the results obtained.

Parameter setup
The EdgeCloudSim simulator tool [41] is used for the experiments. The EdgeCloudSim supports the simulation of multi-tier scenarios where several servers are running in coordination with upper layer cloud solutions. Tasks are generated randomly. We extended the edge orchestrator module being the decision layer to implement our developed resource scheduling scheme. The edge/cloud parameter settings for the datacenter (as illustrated in Table 1) were based on [50]. The settings for the scheduling scheme are shown in Table 2.
The parameters of the algorithms are employed by predefining in the initialization stage. Constant value of the coefficients c1 and c2, together with the random vectors r1 and r2, is automatically adjusted for each numeric benchmark function based on greedy search while computing the step size based on greedy search. The parameters are investigated within given ranges and incremental steps. The complexity of a problem is then measured as a function of those parameters. As the coefficients c1 and c2 [ 0, each particle finds the best position in its neighborhood by replacing the current best position. On the other hand, the number of iterations n i is fixed in which it helps the algorithms to reach a good solution. Although too few iterations may terminate the search prematurely, a too large number of iterations has the consequence of unnecessary added computational complexity, provided that the number of iterations is the only stopping condition. As seen in the literature, this paper uses 1000 as its stopping criteria.

Performance metrics
The performance metrics used to evaluate the proposed FSAOS is makespan, costs and utilization as indicated in Table 3. These metrics are used to determine the stability improvement of the proposed scheme.

Results discussion
Ten (10) independent simulation runs were conducted, and an average of the simulation results was reported [51]. To show how efficient is the resource scheduling scheme, makespan and execution cost, and resource utilization were used in the evaluation. The FSAOS resource scheduling scheme is compared against that of the particle swarm optimization algorithm (PSO) and fruit fly optimization algorithm as well as the state-of-the-art approaches. Our scheduling model is used in the evaluation of both the PSO, FOA and the state-of-the-art schemes to show their effectiveness against our developed FSAOS resource scheduling schemes. Tables 4 and 5 show the makespan time obtained simultaneously when optimizing resources and tasks. Tables 6 and 7 show results obtained in terms of the average execution cost, while Tables 8 and 9 show the resource utilization at both the edge and cloud datacenters. Table 10 shows comparison with state-of-the-art approaches.
To demonstrate the effectiveness of the resource scheduling schemes in terms of performance at the edge and cloud computing environments, we show the results of makespan indicated in Tables 4 and 5. As the number of tasks increases, the makespan solutions of the FSAOS, FOA and PSO schemes also increase exponentially on both edge and cloud computing environments. However, with increase in ratio of number of tasks from 100 to 1000 allocated to the virtual machines, the makespan in cloud environment is significantly less than that in the edge environment. These can be attributed to the load variation, Utilization This is the overall amount of resources that is consumed in the datacenters [31] Using Eq. (23)  as several tasks are executed using the edge datacenter resources, while few tasks that require high computation resources are executed using the cloud datacenter resources. Consequently, further analysis on the makespan solution demonstrated that the FSAOS has achieved better makespan at the edge and cloud computing environment than the PSO and FOA scheduling schemes. On the other hand, the impact on the makespan solutions achieved by the resource scheduling scheme is revealed on the total execution cost as indicated in Tables 6 and 7. Fluctuation in the simulation results is an indication that all the scheduling schemes try to allocate resources to tasks to guarantee the least execution cost. However, these impact significantly on the execution cost, especially when the scheduling schemes on the other hand maps these resources with low processing time to tasks, thus incurring high execution cost. In a similar development, costs' solutions obtained by PSO and FOA also show some improvement inasmuch as the FSAOS does returned better average execution cost solutions on both edge and cloud computing environments.
In Tables 8 and 9, the performance utilization of the three resource scheduling schemes on both edge and cloud computing environments is provided. In the overall resource utilization, the FSAOS provides better utilization of resources than the benchmarked schemes. It can also be seen from Tables 6 and 7 an average execution costs solution obtained by the FSAOS is better than those of the benchmarked schemes in both the edge and cloud environments under a task scheduling interval of 100-1000. Although FSAOS resource scheduling scheme was able to optimized resources and allocate tasks to the most needed computing resources, its performance can still be improved.
To have a better understanding on the performance of the FSAOS, FOA and PSO schemes, figures are used to show the trend as illustrated in Figs. 3,4,5,6,7,8 in terms of makespan, average execution cost and resource utilization. For the convergence graphs in terms of makespan and average execution costs, the trend on the graphs indicates that the FSAOS obtains lowest makespan time and execution cost solutions at the edge and cloud datacenters, respectively, compared to the benchmarked schemes. We notice that when the tasks scheduling interval increases, the execution time and costs solutions also increase for all the scheduling schemes. The real reason is that the edge datacenter starts allocating resources where the number of tasks to execute these resources increases as well. These increases can be viewed as illustrated on the figures showing the trend of the solutions for both edge and cloud datacenter. We also notice that FSAOS resource scheduling scheme is able to optimize resources and tasks that guarantee an acceptable cost of execution and makespan compared to that of the benchmarked schemes. In a similar development, Figs. 7 and 8 show the resource utilization performances. The resource utilization achieved by FSAOS, FOA and PSO at the edge is significantly higher than at the cloud and thus maintain a relatively better performance. In the overall performance, FSAOS has proven to be more robust in ensuring better utilization of resources than PSO and FOA. The reason why the FSAOS was able to achieve such performance in terms of makespan, costs and resource utilization is believed to be attributed to the incorporation of SA, which energizes the smell vector within FSAOS that is capable of preventing premature convergence. This also ensures that inactive solutions not needed are eliminated and introducing a more active solutions thus pushing away search processes from local optima. Such incorporation gives local search of the proposed FSAOS exploitative power to traverse the best solution, which makes the FSAOS to obtain near-optimal solution than PSO and FOA.

Comparison with state-of-the-art Approaches
To compare the proposed FSAOS resource allocation algorithm based on makespan time with that of the state-ofthe-art approaches (e.g., in [32][33][34][35]), the population size, minimum and maximum iteration parameters used were similar for the benchmarked schemes. Twenty (20) independent simulation runs were conducted on the tasks instances: 200, 400, 600, 800 and 1000, and an average of the results obtained from the clod platform is reported in Table 10.
Moreover, based on the results obtained in Table 10, for every task instance used, study shows that proposed FSAOS resource allocation scheme is able to achieve the best global optimal solution at low searching time on an average of 20 simulation runs and achieve a solution better than GA-RF, IPSO, improved NSGA-II and AdPSO. It can therefore be concluded that the performance of FSAOS was attributed the increase in its convergence speed that improves its local search while maintaining its best global search procedure.

Statistical analysis on confidence interval
To further elaborate on the performance of our developed scheme, a 95% confidential interval based on execution time for the 10 independent simulation runs is computed.
The computed values are derived using Eq. 29 [52], and results are shown in Table 11. These results based on 95% confidence interval are used to examine whether the execution time obtained by FSAOS is significantly less compared to FOA and PSO for all application instances.
where X is the mean; Z 0 represents the distribution from the standard normal distribution; S represents the standard deviation of the sample data derived after running task instances on a virtual machine, and N represents the number of generated task sizes. As can be seen from confidence intervals, the more the acceptable results. The statistical analysis indicated that for 95% confidential intervals, the computed value of the FSAOS is less in both upper and lower bounds on edge and cloud environment, respectively, compared to the values obtained by FOA and PSO. These means that there is a difference between the performance of an FSAOS and the benchmarked schemes in terms of execution time. Although the smaller estimate of the CI is an indication of a significant performance in terms of execution time, this shows that FSAOS can achieve minimum execution time. Moreover, to further show the statistical significance of the proposed resource scheduling algorithm, an H-test was carried out to examine whether a significant difference in terms of makespan obtained by the three resource scheduling algorithms exists for all task instances. The Kruskal-Wallis H-test procedures were adopted as a nonparametric test for comparing these algorithms, and the H value is computed using Eq. 30 [53].
where N = number of values obtained from every grouped sample, R 2 i = summation of ranks taken from a particular sample and n i = number of values from the equivalent sum of rank. The values for each of the scheduling algorithm (PSO, FOA and FSAOS) in Table 4 were ranked using the rank average function and results shown in Table 12.
The ranks on the statistical analysis of performance of PSO, FOA and FSAOS under different data instances as shown in Table 12 indicate that the sum of rank obtained by FSAOS is significantly less compared to PSO and FOA. This shows that there is a difference between the sum of rank (121) obtained by the proposed FSAOS in terms of achieving minimum makespan time compared to the PSO and FOA, which obtained 183 and 161, respectively. To compute the H value according to Eq. 30, data in Table 13 above were used. The alternative hypothesis (H a ) was set as the statement of the test to determine whether there is no Bold values indicate the sum of the ranks in all the scheduled tasks (100-1000) instances for the resource scheduling algorithms to determine if an obtained rank is significantly less with respect to another difference between ranks of the three resource scheduling algorithms, while the null hypothesis (H 0 ) was set as the complementary statement to determine whether the difference between the ranks of the three resource scheduling algorithms in term of makespan time exists. The minimum p À value (also called the significance) was set at 0.05 for the same stopping criteria at 95% confidence level, and the H value obtained was 2.5497 and the calculated p À value is 0.27948 based on tasks instances (100-1000). This value is greater than the minimum p À value (0.05), which indicates that there is a significant difference between the performance of PSO, FOA and FSAOS for these data instances. This leads to acceptance of H a for data instances 100 through 1000. This means as the tasks instances keep increasing, makespan obtained by FSAOS is significantly less than that of PSO FOA using same 95% confidence level. It can be concluded that FSAOS outperforms PSO and FOA as well as the state-of-the art approaches (shown in Table 10) as the search space becomes larger.

Conclusion
This article focuses on resource allocation in MECs, by considering an edge resource provider that offers heterogeneous resources to the mobile consumers in close proximity based on their computing demand. To improve resource utilization of the provider while meeting mobile consumers' quality-of-service expectations, we have proposed a fruit fly-based simulated annealing optimization scheme (FSAOS) for resource scheduling in MECs. The FSAOS can overcome premature convergence (which is attributed to conventional FOA), to guarantee market-oriented characteristic of mobile edge clouds in terms of minimum makespan, costs and resource utilization. A series of simulation with FSAOS over some benchmarked schemes shows that our proposed FSAOS can ensure profits and revenue gain through the minimization of the makespan and overall execution costs, and efficient resource utilization. Further research is to look at multidomain resource allocation where resource providers coexist to share resources with individual resource provider having monopoly over his/her resource cost.
Funding Open access funding provided by Umea University.

Declarations
Conflict of interest There is no conflict of interest for this manuscript. All authors agreed to its submission.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visithttp://creativecommons. org/licenses/by/4.0/.