Energy-aware edge server placement using the improved butterfly optimization algorithm

To improve the quality of services provided to their customers, cloud service providers move some of their resources closer to the users. Proper server placement, considering the volume of service demands in different parts of the network, plays an important role in providing better services to users, more effective use of resources, and reducing the server's energy consumption. However, designing a model that can meet the requirements of both the users and the service providers has received less attention. Most researchers use discrete models to select candidate locations for resource deployment and servers can only be placed in these predefined locations. The proposed method explores the entire search area to find optimal locations for server placement with a continuous approach. To reduce the complexity of the problem and faster convergence in reaching the optimal solution, the resource deployment area is divided into smaller subregions. In the first step of the proposed method, the Butterfly optimization algorithm is used to find the best local locations for resource deployment. To avoid falling into the local optimum and to converge the subregions, the coral reefs optimization algorithm is used. The experiments show that the proposed method can effectively save energy and reduces network latency.


Introduction
Cloud computing is considered a popular model for providing various services offered to users. In this model, users can easily access cloud services anywhere and anytime [1]. The emergence of the 5G cellular communication technology and the widespread use of smart communication equipment led to the formation of new demands in this field. New applications include the internet of things, online games, social networks, and electronic banking, which must consider users' mobility [2]. Because of the hardware constraints of mobile smart equipment (processing power, battery, and memory), most of the services required by users should be offloaded into network servers [3]. Traditional cloud service providers quickly adapted to these new conditions and transferred some of their resources to the edge of the network near users to provide high-quality services [4]. Because of the large number of processes and the volume of data exchanged, effective use of resources plays an important role in providing suitable services to users.
Proper server placement has an important role in improving service quality, and users will access the most suitable resources they need, otherwise, server overloading and underloading may occur in different parts of the network [5]. Cloud service providers, besides increasing the efficiency of their services, prefer to reduce the energy consumption of servers, which consequently reduces costs [6]. Users' services must be delivered with low latency. For this reason, the proposed method considers the interests of both service providers and users. In most research, some predefined candidate locations have been provided for server placement [7]. This approach is due to the assumption of the discrete nature of the problem. The proposed method ignores this limitation and explores the entire search space to find the optimal resource placement locations.
For N number of servers and M candidate locations, the number of placement scenarios is equal to N M , where M ≥ N. For M = 10 and N = 7, for instance, there will be 120 distinct solutions. Clearly, due to a large number of mobile edge computing (MEC) servers, calculating all possible mappings between servers and locations and determining the optimal solution is impossible or would require a significant amount of time. Dividing the placement area into smaller regions can be considered a solution. In this situation, there would be much fewer potential solutions in a smaller space. On the other hand, most server placement methods, deploy discrete approaches, and the resource locations must be selected among the candidate locations, while there may be better solutions outside of these locations. Regions' Convergence in finding the global optimal locations and avoiding falling into the local optimum is considered another important challenge. The proposed method has been designed to overcome these issues. In the first step, after dividing the area into smaller regions, the BOA algorithm [8] is used for optimal local server placement in each region. The reason for choosing this algorithm is because of its continuous nature, computational simplicity, local and global search capability, and good convergence speed in finding the optimal solution. The subregions must collaborate to reach a global solution and avoid falling into the local optimum. In the local search process, the approximate location of a server is determined, which 1 3 should be updated in the global search. For this purpose, the coral reefs optimization algorithm (CRO) [9] is used for the convergence of sub-areas. A global solution vector is formed between all regions, in which the optimal location of resources is updated in the global phase of the proposed method. Optimal server placement can lead to optimizing the server's energy consumption and resource access delay reduction. Also, the dynamic voltage and frequency scaling (DVFS) technique [10] has been used to reduce resource energy consumption. Based on this technique, a server has different power states, and a task can be executed with the minimum possible power mode. The contributions of the proposed method are as follows: • Dividing the area into some subregions to reduce the complexity of the problem • Using the butterfly optimization algorithm to find the best local location of the servers in each area • Utilization of the coral reefs optimization algorithm to find the global solution in the entire area • Using the DVFS technique to save energy consumption of resources • Considering the benefits of both service providers and users Other sections of the paper are as follows: In Sect. 2, a review of related research is conducted. In Sect. 3, the basics used in the proposed method are described. In Sect. 4, the proposed method is introduced. Evaluations are conducted in Sect. 5. Finally, the paper concludes in Sect. 6.

Literature review
Edge server placement as a new paradigm in mobile cloud computing has been recently considered by some researchers. Since the problem of server placement is an optimization problem, some meta-heuristic and evolutionary algorithms have been used in this field.
The particle swarm optimization (PSO) algorithm is a classic and important method for solving optimization problems. In [11], using the PSO algorithm, a multi-objective algorithm has been introduced for server placement with the objectives of improving energy consumption and more effective use of resources. In this algorithm, each server is considered a particle. The authors adapted PSO for server placement which is originally a continuous method. Also, in [12], using PSO and genetic algorithm (GA), a new method of edge server placement has been introduced with the objectives of energy consumption reduction and better load balancing of servers. GA and PSO have been used in service offloading and optimization of optimal server placement strategy, respectively. PSO algorithm has been used in another study [13]. In this paper, the PSO is used to assign servers to locations in the fifth-generation (5G) network. This algorithm uses local and global experience in choosing the optimal location of servers. This strategy helps to find the best locations for servers. Reducing the energy consumption of resources and server access delay are the objectives of this paper. At the beginning of the algorithm, servers are Energy-aware edge server placement using the improved butterfly… randomly placed in candidate locations, and then their optimal placement is gradually optimized by the iterations of the PSO algorithm.
GA as an evolutionary algorithm has been used in many papers. This algorithm also has been deployed in some server placement methods. In [14], using GA, hill climbing (HC), and simulated annealing (SA) algorithms, a new method of server placement has been introduced. In this article, each server is considered a Gene, and a solution that includes the number of servers is modeled as a Chromosome. SA and HC algorithms are used to further exploration of the environment to find new solutions and determine a state between a server location and server connection, respectively. Reducing latency and better load balancing of servers are the objectives of this paper. In [15] and by using the non-dominated sorting genetic algorithm (NSGA-ii) and decision tree (DT), a method of server placement has been introduced with the objectives of reducing the cost and energy of resources and also improving latency in agricultural automation. Reducing the delay in sending data from agricultural sensors to servers is the main objective of this research. Another model NSGA algorithm, namely NSGA-iii, has been used in server placement [16]. In this research, which was conducted in social media services in the industrial cognitive internet of vehicles, the CQP algorithm has been used with the objectives of reducing latency and increasing reliability.
Clustering is another technique that has been used in some related research on server placement. For example, in [17], using this technique, a method of server placement has been introduced, to reduce both communication delay and the number of servers in the 5G network. The basis of the proposed method is the reduction in clusters and resources based on a capacitated clustering problem. Also, some heuristics have been used to face the challenges in this algorithm. In another work in this category [18], using a clustering method, a method of server placement has been introduced. In the first step of this algorithm, the resource deployment area is divided into some clusters to discover locations with high demands. Then, in the second phase, the processes belonging to each cluster are distributed on the most suitable resources. Finally, in the third phase, the final location of all servers is determined. More effective use of resources is the main objective of this paper. Also, in [19], the authors presented a new clustering-based cloud resource placement model for reducing task overhead. The basis of this method is an adaptive clustering for network access points to reduce both energy consumption and response time. Then tasks are distributed on the servers based on their processing capacity.
Some recent papers have used new evolutionary and meta-heuristic algorithms in the server placement field. In [20] using the whale optimization algorithm, neural network, and game theory, a new edge server placement algorithm has been proposed. The proposed three-step model (MES-WG) tries to find the best global location for each server in the entire area. Each server has individual, local, and global movements to reduce the complexity of the problem. The experiments show that this method reduces the latency and better balances the load on servers. In [21] the authors introduced a novel fault-tolerant method by using the binary-based gray wolf genetic policy in the intelligent manufacturing environment. Deployment cost reduction, reliability, and better load balancing on the servers are the objectives of the proposed algorithm. Some papers use learning-based models to optimally place the servers in the deployment area. For example in [22] using Markov decision process (MDP), a new multi-objective reinforcement learning-based edge server placement algorithm has been used in the Internet of Vehicles (IoV) environment. The authors formulated the MDP for the server placement problem by using Deep Q-Network (DQN) learning model. Better load balancing and reducing the average delay are the main objectives of this algorithm. As another similar work in the machine learning category, a new server placement algorithm (DQN-ESPA) has been proposed in [23] using the DQN and reinforcement learning models. The training model is formulized based on MDP with state, action, and reward functions. The proposed method does not rely on the previous placement strategy. The result of experiments shows that the proposed algorithm reduces the server's access delay and better balances the workloads on servers. Finally, in [24], using graph convolution network (GCN) and PSO algorithm, a new server placement method has been proposed. The authors formulated the problem as an optimization problem. The proposed method predicts the network traffic by GCN. Then by using the PSO algorithm, the network access delay and energy consumption are optimized. The experiment results show that this algorithm also reduces servers cost.
A review of related papers shows that despite some solutions to the server placement problem, there are still some challenges. Some methods that are based on population and iteration, may have difficulties, as the problem gets bigger as converging difficulties and reaching the optimal solution. Reducing the dimensions of the problem, parallelization, and the use of complementary methods are suitable solutions in this field. In the methods based on clustering, finding the optimal number of clusters and avoiding falling into the local optima are some challenges in this field. In learning-based methods, the number of inputs cannot exceed a certain limit, and there will be a possibility of overtraining and increasing time complexity. Also, most cloud resource placement methods use the discreet approach. In this case, some predefined candidate locations must be selected for the server placement strategy. Although this approach makes the solution easier, cannot cover the entire problem space and as a result, some good locations in the area may not be considered. Scalability is another important challenge in this field. When the server placement area gets bigger, the number of potential solutions increases, and finding the optimal locations for all servers become a big challenge.
To overcome these challenges the proposed method of this paper, in the first step, divides the entire placement area into some subregions to reduce the complexity of the problem to increase the scalability. Then, the BOA algorithm which has a continuous feature explores the entire subregion to find the best local placement for all servers. To avoid falling in the local optimum and convergence of all subregions the CRO algorithm is used to find the best global locations for all servers, considering the objectives of the problem.

Research foundations
In this section, the basics of the proposed method, including BOA and CRO algorithms, as well as the DVFS technique, have been described.

3
Energy-aware edge server placement using the improved butterfly…

BOA
BOA [8] is a meta-heuristic algorithm based on the behavior of butterflies in sensing and processing the smell of flowers. The quality of each flower or modality is determined based on three parameters: sensory modality (C), stimulus intensity (I), and power exponent (a). Sensory modality means determining the quality of flower fragrance based on inputs. Stimulus intensity is the density or amount of the fragrance, which is considered the quantity of a solution in the BOA algorithm. And finally, the power exponent is a parameter for strengthening and nonlinearly behavior of the solution. Equation (1) shows the fitness calculation of a solution that is measured according to the value of the fragrance, which means how attractive this fragrance is to other butterflies. In most cases, a and c are random numbers between [1]. When a = 1, there is no absorption of fragrance, or the amount of fragrance emitted by a particular butterfly is sensed in the same capacity by the other butterflies. Also, a = 0 means that the emitted fragrance is not sensed by any other butterfly. Therefore, the value of this parameter controls the behavior of the algorithm. Finally, parameter C determines the speed of convergence.
BOA is an iterative-based method that has two types of global and local searches. Equation (2) shows the global search of BOA. In this search, a butterfly randomly moves to the best solution or g * to get its new position.
where x t i is equal to the solution x i for the ith butterfly in iteration number t. g * is the best current global solution among all butterflies. f i is also the amount of fragrance of butterfly i. Finally, r is a random number between [1].
Equation (3) shows the local search model of the BOA algorithm. Where x t j and x t k are the jth and kth butterflies in the local search area, respectively, and the current solution will move toward the area between them. If x t j and x t k belong to the same swarm, and r is a random number between [1], then Eq. 3 becomes a random search.

CRO
Coral reefs optimization (CRO) [9] is an evolutionary algorithm based on the life of corals on reefs. This algorithm has been used in some research related to traditional cloud computing [25,26]. In this algorithm, the two-dimensional model of the system is represented by Λ = N * M . Each member (i, j) ∈ Λ of this two-dimensional network is a coral, i.e., Ξ i,j , which is coded with the alphabet A and represents different solutions to a problem. The ratio of empty to occupied cells is called 0 , where The fitness of a solution or coral is determined by the health function, The various operators of this algorithm include the following.

Broadcast spawning (external sexual reproduction)
In each initial stage of reef formation, F b percent of corals are randomly selected for external sexual production, and the recombination process is performed on them. The remaining corals (1 − F b ) will be used later. New larvae are generated, and their fitness is determined.

Brooding (internal sexual reproduction)
1 − F b percentage of the remaining corals of the previous stage participate in a mutation-like operation. This stage is called internal sexual reproduction. The new larvae are added to the population to participate in the competition to settle on the reefs.

Larva setting
At this stage, the larvae randomly try to choose the holes in the reef. If the holes are not empty, they can replace the previous coral only when they have more merit than them. If the replacement process fails after several attempts, these corals will be terminated.

Budding or fragmentation (asexual reproduction)
In this step, the fitness of all corals settled on a reef is determined by the function f Ξ i,j ∶ A → ℝ, and are sorted according to their fitness. Then, F a percent of the best ones reproduce themselves to give more chance to good solutions.

Depredation
In each stage, F d percentage of weak corals die. This will increase the number of empty holes for the establishment of the next corals and increase the exploration capability.

Energy model and DVFS technic
The energy consumption of a server's processor includes its static and dynamic energy. The static energy of a processor is related to its design and hardware structure. The dynamic energy of a processor is related to its working voltage and frequency. Equation (4) shows the energy consumption of a processor, where E is equal to total energy and E s and E d are static and dynamic energy, respectively.
The dynamic energy is shown in Eq. (5).
where v , f , P d , t p are the voltage, frequency, power, and time interval of processor activity, respectively. k is also constant and related to processor technology.
Energy-aware edge server placement using the improved butterfly… Static power is shown in Eq. (6) where v j⋅min , f j⋅min , t j⋅idle are the minimum voltage, minimum frequency, and activity time in processor j in idle mode, respectively [26][27][28].
One of the important features of modern processors is having different power modes. This technique is called DVFS. Table 1 shows the different voltage and frequency specifications of AMD Turion MT-34 and AMD Opteron 2218 processors with different power modes [29]. This technique ensures using the lowest power mode of the processor to execute a process, considering task requirements and its expiration time. This technique significantly reduces energy consumption.

Latency model
Latency refers to the time difference between the server response time and a user service request time. This time must be tolerable, especially in online applications. Otherwise, such services will not be usable. Latency is a function of the distance between each cellular base station (CBS) and mobile edge server (MES), as well as the Bandwidth of the communication network and the volume of data sent or received. In most of the research, this time is only considered proportional to the distance between a CBS and MES, without considering the network traffic and the Bandwidth of the communication network. In the proposed method of this paper, latency is computed using Eq. (7).
where Pd and Td are equal to propagation delay and transmission delay, respectively. The propagation delay of a signal depends on the length of the transmission line between Server S and the cellular base station C and the propagation speed, which is shown in Eq. (8). The distance between a CBS and MES is measured using Euclidean distance. The propagation speed also depends on the propagation environment, which is proportional to the speed of light.
The delay in sending a packet is also related to the size of the sent packet and the Bandwidth of the transmission medium, which is shown in Eq. (9).
where Data-size and BW are equal to the size of the sent or received data and the Bandwidth of the communication line, respectively.
The symbols used in this article and their explanations are given in Table 2 4 Proposed method Pareto-based and scalarization are two main solutions for multi-objectives problems. The scalarization method creates a single solution for a multi-objective function and determines the weight before the optimization procedure. Scalarization incorporates multi-objective functions into a scalar fitness function, as shown in Eq. (10). The weight of an objective function will determine the fitness function's solution and indicate the performance priority. A high weight assigned to an objective function shows that it has a higher priority than functions with a lower weight. The importance of each objective should be adjustable based on the type of requested services, so we use this method to have more control over problem objectives [30].
latency(s, c) is the delay between server s and base station c, |E| is The total number of network links that connect the servers to the base stations, E k is the energy consumption of the server k, and m is the total number of resources. w 1 and w 2 are the weights of the objectives which can be adjusted. Norm is the normalized value of each objective. In the proposed method, each mapping between the servers and the base station is considered a solution. Due to a large number of servers and CBSs and to avoid increasing the time complexity of finding the solution, the problem space is divided into smaller zones. In local search, the location of a server in each area is determined using the BOA algorithm, and in global search, the CRO algorithm will be used global solution. Each server is covered by one or more CBSs, and each CBS has access to only one server. The location of each server among its covered CBSs plays an important role in server access delay reduction. Figure 1 shows the network model. In this model, each MES is covered by one or more CBSs. Considering the heterogeneous nature of the service requests in different parts of the network, finding the optimal resource locations, and finding the best server, considering the objectives of the proposed method is the main objective of the proposed method. In each area, some locations are randomly selected for server placement. If Z k is the region k in the network, then v i k= f (x(t) i k is equal to the value of the current location or x(t) of ith MES in zone k and iteration t that is computed by Eq. (10). After determining the fitness of all initial solutions, the best location of the server is determined as x * k . At this stage, all current locations are updated to be closer to x * k . This update is done both globally and locally. Equation (11) shows the global search of BOA to find the server locations in each region.
where x(t + 1) i k is the new location of ith solution i in zone k, and r is the random number between [1]. Local search is used to further explore the search space, avoiding greedy search and forcing the algorithm to more random behavior. Equation (12) updates the position of a candidate location, where j and s are two random locations to which the current position randomly moves toward them.
And at the end of this step, the best solutions obtained in each iteration are transferred to the next round of the algorithm. Algorithm 1 shows the details of this step. Fig. 1 Network model 1 3 Energy-aware edge server placement using the improved butterfly… After the first step of the proposed method, i.e., finding the optimal local location of the servers, the second step of the proposed method tries to find global solutions. In the first step, the best location for servers is determined for each region, but there is no guarantee that these locations are the best suitable place in the entire area. In the second step of the proposed method, and by using the CRO algorithm, the best global location of servers is obtained. The optimal local and global server placement are shown in Table 3, where s i , l i and g i are server i, local location of server i, and global location of server i, respectively.
As mentioned earlier, the model is inspired by the CRO algorithm. In this algorithm, the parameter 0 < ρ 0 < 1is the ratio of empty to occupied cells, and the optimal value of this parameter has an important role in the performance of this method. For further explanation, an example with nine servers and 12 locations is considered, which is shown in Table 4. Three locations will not be used in every solution vector. Therefore, the ratio of unused locations to used locations Table 3 Local and global server placement vectors Global location g 1 g 2 g 3 g 4 g 5 g 6 g 7 g 8 g 9 g 10 g 11 g 12 g 13 g 14 g 15 g 16 is determined as 3-9 or ρ 0 = 0.33. Calculating the optimal value of ρ 0 plays an important role in improving the performance of the proposed method. Its increase makes the problem space more complicated, whereas its decrease causes early convergence.
In the recombination phase (Broadcast Spawning), the new solution vector will be obtained in a multi-parent sequential manner [31], as shown in Table 4. The results of the experiments performed on this recombination method have shown that it has better efficiency than the simple order recombination method. Based on this method, four solutions (sv 1 -sv 4 ) are combined in an orderly manner and create a new solution (nsv 5 ). The first parent (sv 1 ) has the best and is considered the base of the recombination process. In this regard, good solutions have more chances to participate in the recombination process.
The second operator of this step is Brooding, in which the new solution is generated by changes of only one parent. In the proposed method, swapping mutation is performed over the servers. In this case, some servers' locations are randomly exchanged together. Table 5 shows an example of this operator. In this example, the location of g 3 and g 10 of solution vector sv 1 are randomly selected and exchanged with each other to create a new solution vector nsv 2 .
To preserve the good solutions, some good solutions are duplicated. Therefore, F a percentage of the best ones is calculated by using Eq. 10 to increase the chances of finding better solutions in the current iteration, which is called budding. And finally, to increase the exploration capability of the proposed method, the p d percentage of weak solutions is replaced by random solutions. This phase is called Depradation.
In the end, all the generated solutions are sorted according to their fitness, and some of the best ones are selected for the next iteration. The population number is pop size and the number of repetitions of the algorithm is itr num . Algorithm 2 shows the global placement of resources in the proposed method.  Energy-aware edge server placement using the improved butterfly…

Evaluation and simulation results
In this section, the proposed method is evaluated, and test scenarios, compared algorithms, and simulation environment are described. Also, the performance of the proposed method is evaluated in various experiments.

Experiments setup and dataset
In this section, the proposed algorithm is evaluated under real and synthetic datasets.

Real scenarios
To evaluate the proposed method, the cellular communication network of Tehran has been used. As the capital of Iran, Tehran is the most important political and economic city, with 750 square kilometers and a population of about 9 million people. This city has flat, mountainous, and marginal areas, and service demands vary during different times and areas. Most of the administrative, educational, and commercial areas are located in the center of the city, and the population density varies in different areas. Figure 2 [32] shows a part of the cellular telecommunication map of the MCI operator [33] of the 4G mobile network in Tehran. The numbers inside the circles indicate the number of antennas covered in that area. MATLAB software version R-2016a has been used on a computer with Intel (R) Core (TM) i7 2.50 GHz processor, 64-bit operating system, and 16.0 GB Ram for simulation. Table 6 shows a part of the geographic characteristics of CBS antennas in Tehran, which include cell ID (CID), longitudinal and latitude coordinates, covered range, and the average number of users on each base station. Also, server features used in three different types and different processing power are given in Table 7, which include frequency, voltage, and static power of servers. Data packets in size of 1-4 Giga Bytes are generated and sent based on the number of users of each CBS, with Poisson distribution  Energy-aware edge server placement using the improved butterfly… with λ = 4 per minute. The Bandwidth of the communication network is considered 1 Giga Bytes per second.

Synthetic scenarios
Several scenarios can be conducted under various topologies and workloads using a synthetic approach. As a result, the effectiveness of the suggested strategy is not restricted to a single region with certain characteristics. Table 8 presents nine distinct scenarios, which are divided into three categories: average, large, and small. There are various subregions within each region. The quantity of CBSs is regarded as constant. However, the number of MES varies and may be less, the same as, or higher than the number of CBSs. These different configurations help the proposed model to be tested under various conditions. All regions are divided into subregions of the same size. Data workloads are generated with Poisson distribution with λ = 4 per minute. A coverage distance of 1000 m is also assumed in the experiments. This means that if a CBS is less than or equal to 1000 m from an MES, the MES will be within range of the CBS.

Compared algorithms
To evaluate the proposed method, three related and state-of-the-art algorithms have been used. In [11], a PSO-based multi-objective server placement algorithm with the objectives of server energy reduction and more efficient use of resources has been introduced as similar work on the Shanghai Telecom telecommunication network. Based on this algorithm, each solution is considered a particle, and for simplicity, it has been assumed that all servers are homogeneous. Due to the feature of the PSO algorithm that is suitable for continuous problems, the authors have made changes to this algorithm to design a new model with the ability of server placement that has a discrete nature. Using a real-world dataset, considering the dynamic behavior of the problem and the simplicity of the method are the advantages of this algorithm. In [5], a learning-based server placement algorithm that uses the Deep Q-Network model, and CRO algorithm (MOP-DQ) has been introduced. To reduce the time complexity of the server placement problem, the authors clustered the resource deployment area into small subregions. CRO and Deep Q-Network algorithms are used for local and global search processes, respectively. Latency reduction and better load balancing are the objectives of this algorithm. Comprehensive evaluation, using real and synthetic datasets, and scalability are the advantages of the method. In [12], a new server placement method (EPMOSO) has been introduced using genetic and PSO algorithms with the objectives of better load balancing of servers, reducing the energy consumption of resources, and reducing the resource access delay. This algorithm is based on service offloading on the Internet of Things. Genetic and PSO algorithms have been used in service offloading and optimization of optimal server placement strategy, respectively. Using the strengths of both genetic and PSO algorithms, and comprehensive evaluation are the important features of the proposed algorithm.

Parameters setting
The value of the solutions in multi-objective issues is assessed using weighted average and Pareto-based methods like NSGA-2. In our proposed method, the NSGA-2 model performs slightly better when the specified weight vector is close to one extreme, for example, (0.1, 0.9) but in other situations, the weighted sum method outperforms NSGA-2, so we used this technique for the generality and more control over the weights of the objectives [34]. One of the major issues with meta-heuristic and evolutionary algorithms is the calibration of the main parameters. The value of these parameters controls the main features of the algorithm including mutation, population size, and selection. Tuning these parameters is essential for various conditions. Some state-of-the-art models are used to calibrate the algorithm parameters. In our proposed method, the numerical calibration and relevance estimation (CRE) method is used to calibrate the algorithm parameters [35]. The CRE technique provides us with useful metrics of calibration difficulties in two separate ways: statistically, as Shannon entropy, and visually, as percentiles. Calibrating and selecting the relevant parameters of the algorithm only needs visual inspection and manual addition or removal of the algorithm parameters.
To conduct experiments and evaluate simulation results, it is necessary to specify the parameters of the proposed method. Table 9 demonstrates these values.

Evaluation results
In this section, the proposed method is evaluated and compared with similar algorithms. Optimization of servers' energy consumption, servers' average access delay reduction, and also reducing the number of used resources are the objectives of the proposed method. The experiments are conducted in two real and synthetic mode scenarios.

Energy consumption
Reducing server energy consumption not only saves costs but also avoids the production of toxic pollutants. Figure 3 shows the energy consumption of the proposed method and other algorithms for 50-175 different servers, while the number of BTSs is constant. As this figure shows, the proposed method has better efficiency in energy consumption compared to other algorithms. The following factors contribute to our method's superiority.
1. Dividing the area into some subregions and applying continuous features and accurate local and global search of BOA algorithm to find servers' local deployment locations by using its powerful operators. 2. Using the coral reef optimization algorithm, which has a suitable convergence speed in solving discrete optimization problems, to find the best global locations for all servers. 3. Using the DVFS technique to operate MESs at their minimum power mode. 4. As this figure shows, when the number of servers increases, the performance of the proposed method improves compared with other methods.
Although reducing the number of CBSs will reduce the overall energy consumption of the network, it may force the network to use servers located in traditional cloud data centers to respond to some requests. Because of the long distance between cloud data centers and mobile network users, some services may be delayed, which cannot be tolerated sometimes, especially in online applications. This metric is called the local network server access error. Increasing the number of resources reduces this error but will increase extra costs. Appropriate server placement can reduce this error, too. Figure 4 shows the local network server access error rate of the proposed method and the compared algorithms. As this figure shows, the error rate of the proposed method is lower than other algorithms. The reason is the proper performance of the proposed method in better placing network edge servers. Optimal server placement decreases the overloading and underloading of resources and consequently, access errors reduce.
In the next scenario, we keep the number of servers constant and change the number of CBSs. The energy consumption of the resources is measured simultaneously. By keeping the number of servers constant, the increase in CBS will lead to the coverage of more users in the network, and the availability of servers increases. However, the optimal placement of resources will play an important role in reducing the error rate and optimal energy consumption. Figure 5 shows this problem. In this figure, the number of servers is 100, and the number of CBS varies between 200 and 320. Reducing the number of CBSs leads to the reduction in the coverage area. As Fig. 5 shows, due to the performance of the proposed method, the energy consumption of servers significantly decreases compared to other methods. The reason is the better placement of servers and deploying the most suitable server in each region. Energy-aware edge server placement using the improved butterfly…

Latency
Latency is the time difference between the time of sending the request and the response of the server. This time is a function of the distance between the user and the server, the type of transmission medium, and the Bandwidth of the communication network. In most research, this delay is only considered proportional to the distance between a CBS and MES. The proposed method reduces this time by considering all related parameters. Finding the optimal location and placing the most suitable server helps to reduce the average network latency. The proposed method, by using the BOA algorithm, instead of choosing predefined candidate locations, searches the entire area and finds the optimal location of resources. After finding the best resource deployment locations, it is time to choose the most suitable server for each region. In this step, the CRO algorithm finds the best mapping between resources and locations. In some studies [7], and for simplicity, resources are considered to have equal processing power and are homogeneous. By removing this limitation and paying attention to the actual conditions of the network, the proposed method seeks to find the most suitable servers according to the needs of a region. Figure 6 shows the latency of the proposed method and compared algorithms. As this figure shows, the proposed method has less latency than other methods. The reason for this improvement is due to consider all parameters affecting this delay and also to search the entire area to find the optimal location of servers.
In the second scenario, we keep the number of servers constant and change the number of CBSs. It is expected that by the reduction in CBSs, the network coverage area will decrease, and some requests will face errors. In this case, the network servers cannot respond to all requests because of the low coverage, and some requests are sent to the cloud data center, which can increase the latency. However, this delay in the proposed method is less compared to other algorithms. The reason for this reduction is due to better server placement, which will cause fewer errors. As mentioned earlier, the proposed method places the cloud servers without limitation in the selection of candidate locations. It also finds the optimal locations and assigns the most suitable resource to each area. Figure 7 shows the average network latency in this scenario.

Synthetic mode scenarios
In this section, the proposed method is evaluated using different synthetic scenarios in Table 8, which include different configurations. Figure 8 shows the energy consumption of the proposed method and other algorithms in synthetic scenarios. The experiments were conducted on three different scales small, average, and large. Each category consists of two, four, and eight subregions. Based on Fig. 8 as the number of the subregions increases the rate of the server's energy consumption decreases. For example, in scenarios four and six the number of used servers is 20 and 40, respectively. It is expected that by Energy-aware edge server placement using the improved butterfly… doubling the number of servers, energy consumption will also follow this rate. But this has not happened. As Fig. 8 shows the energy saving of the proposed method is better than other algorithms. Dividing the area into subregions reduces the dimensions of the problem and the number of potential solutions decreases. Then, the BOA algorithm is used to explore the entire subregion to find the best local location for each server. And in the last step, CRO is used to avoid failing the problem in local optimum and converge all subregions to obtain optimal global locations. As a result, the user's workloads are offloaded on the most appropriate servers that are located in optimal locations and the energy consumption of the servers decreases. Figure 9 shows the average server latency of the network based on synthetic scenarios in Table 8. As this figure shows the latency of the proposed method is less than other algorithms. Finding the optimal location of the servers causes the service requests to be sent to the nearest servers that are placed in their optimal locations, considering the volume of requests in each region. Our proposed method with its approach explores the whole area to find the best locations for servers and as a result, the average latency decreases.

Performance metrics
In this section, the efficiency of the proposed method is measured by two criteria. The first metric is the average network resource utilization rate, and the second one is the minimum number of servers to be used without reducing network efficiency. In the optimized server placement, the most suitable servers are assigned to each area. Otherwise, server overloading may occur while the servers of the adjacent areas are underloaded. This increases latency, reduces reliability, and increases energy consumption. Our proposed method, in its first step, finds the best local server locations in each area, without any restrictions on the location of resources. The global step of the proposed method converges the regions to find the global locations of the servers, considering the entire area. Table 10 shows the average server utilization rate of the servers. As expected, the proposed method, in most cases, has a better utilization rate except in the first column, where the number of servers is 50. Average resource utilization reduction is directly related to reducing the number of servers. Because, in this case, the network local server access error increases.
The second metric for the efficiency of the proposed method is the minimum number of servers that still maintain the performance of the network. Reducing the number of servers will reduce both energy consumption and cost. Table 8 shows the efficiency of algorithms proportional to reducing the number of servers. The performance of each method has been measured independently and relative to the objective function of that method. According to Table 11, by using 175 servers, each method performed its best. By reducing the number of servers to 170, the proposed method still maintains its efficiency, but the efficiency of other methods is reduced. When the number of servers is reduced to 165, the performance of all methods, including the proposed method, decreases, but this decrease for the proposed method is at a lower rate. As a result, the proposed method continues to work without performance reduction with 170 servers, while the efficiency of the other methods decreases gradually. This saving in the number of servers will play an important role in reducing the cost and energy of resources.

3
Energy-aware edge server placement using the improved butterfly…

Discussion
The results of the experiments and comparison with similar algorithms show that the proposed method has a significant advantage over them in its objectives. The reasons for this improvement can be stated as follows.

5.4.5.1
Partitioning the area An edge server network includes a large number of servers that must be optimally placed in a large area. As the network area and the number of servers increases, there will be scalability problems. In this case, finding the optimal location of the server will be a serious challenge and the accuracy of the placement process will be reduced. Since the optimal location of resources reduces the severs access delay and better load balancing of workloads on them, the importance of this issue is clear. Dividing an area into smaller subregion reduces the number of potential solutions and reduces the complexity of the problem.

Local placement strategy
Most cloud resource placement methods are discrete, in which some candidate locations are given and the servers search for their best location among these points. This limits the algorithm choices. In other words, there may be a possibility of better locations that are not in the candidate locations.
To overcome this problem, our proposed two-step method explores the entire area to find the best location for servers. In the first level, the best approximate location of each server is determined in every region, using the BOA, which has low computational complexity, strong operators, and two types of local and global search behavior. These locations will be updated in the global phase of the proposed method.

Global placement strategy
In the first step of the proposed method, the servers of each region are locally placed without considering the status of other regions. Although this process causes the local locations of servers to be optimally determined, still there is a possibility of falling into the local optimum. For this reason and to reach a global solution, the CRO algorithm is used. In this step, a global solution vector, including all servers whose approximate locations were determined in the previous phase, is formed and the final locations are determined in some iterations. Due to the mentioned reasons, the proposed method has better performance than the compared algorithms, and its local and global features cause higher scalability and the optimal placement of servers.

Conclusion
Mobile edge computing is a new processing paradigm that enables mobile and IoT devices to access computational and storage resources. Mobile devices have limited processing power and low-capacity batteries, therefore users offload their processing workloads to edge servers. Proper server placement has an important role in the quality of services provided to users. The proposed multi-objective method initially reduced the search space by dividing the area into some subregions. Then, using the BOA algorithm, which has continuous behavior, the local placement of servers was done. To avoid falling into the local optimum and convergence of the regions, the CRO algorithm was used for the global placement of resources. The results of the evaluations on MCI cellular base stations showed that the proposed method reduces the server's energy consumption, improves servers' access delay, and reduces the number of servers compared to some new and state-of-the-art methods. For future work suggestions, first, we intend to use the proposed method in other fields, such as offloading and workload balancing on resources. Also, as a second suggestion, we plan to use parallelization techniques to increase its efficiency and speed.
Author contributions Asghari and Sayadi wrote the main manuscript. Azgomi wrote the program code. Sayadi reviewed the manuscript. Asghari translated the manuscript into English.

Funding No funding.
Availability of data and materials The datasets generated during the current study are available from the corresponding author upon request.

Conflict of interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Ethical approval Not applicable.