1. Introduction
With the development of the Internet of Things (IoT) in recent years, mobile user devices (UEs) such as smartphones and laptops have set off a new wave. The increased portability and computing power of mobile devices makes them an integral part of our lives. It has also led to the emergence of new applications such as augmented reality/virtual reality (AR/VR), online gaming and image processing on devices. However, the limited battery life of mobile devices and the low latency requirements of these applications have increased the need for new network models [
1].
To address this issue, mobile edge computing offloading techniques have been deployed to handle the offloading tasks generated by user terminals to edge servers. Unlike traditional cloud computing, Mobile edge computing (MEC) [
2] deploys computing and storage resources at the edge of a mobile network to provide an information technology (IT) service environment and cloud computing capabilities for mobile networks, thus providing users with ultra-low latency, low power consumption, and high broadband network service solutions [
3,
4,
5]. As one of the key technologies in MEC, computing offloading [
6,
7,
8,
9,
10] enables terminal devices to unload partial or all computational tasks to mobile edge servers for assistance, aiming to address the inherent issues of limited storage space, inadequate computing power, and energy constraints on terminal devices.
In practical applications of mobile edge computing (MEC), the process of offloading computation requires the collaborative consideration of both mobile terminals and MEC servers to address the following issues: what to offload, how to offload, how much to offload, and to whom and how much bandwidth and computational resources should be allocated [
11,
12,
13]. Currently, research in this field typically involves two steps to facilitate this process: task offloading decision and resource allocation and offloading execution. the first step involves making decisions regarding which tasks or computations should be offloaded, and which terminal should be matched with which server or multiple servers. Various factors are considered, such as task characteristics (e.g., computation-intensive or data-intensive), network conditions, energy consumption, latency requirements, and the number and capacity of severs. Decision-making techniques, such as optimization algorithms [
14,
15,
16] or machine learning models [
17,
18,
19], are employed to determine the most suitable tasks offloading decision. Once the decision to offload certain tasks is made, the next step is to allocate the necessary resources to perform the offloading and computation of the tasks. This process is known as resource allocation and offloading execution. During this process, it is necessary to determine the required amount of bandwidth and computational resources, as well as the allocation strategy for these resources. Techniques like dynamic resource allocation, load balancing, and task scheduling are utilized to ensure the efficient utilization of resources and improved performance.
Inspired by the aforementioned facts, in order to minimize the total completion latency and processor cost of subtasks with priority constraints at the client-side, the tasks are offloaded to both edge servers and cloud servers. This paper proposes a new offloading algorithm called the improved GSA-based offloading (IGSA) algorithm. The IGSA algorithm incorporates a convergence factor to accelerate the search for optimal solutions in the search space. Additionally, it introduces crossover operations from genetic algorithms to improve the optimization results. The main contributions of this paper can be summarized as follows.
- i
This paper investigates the resource allocation problem in a multi-user mobile edge network based on the collaboration between cloud servers and edge servers. Specifically, the study takes into account the presence of both MCC servers, MEC servers, and subtasks with concurrent serial and parallel relationships.
- ii
To address the formulated user latency and processor cost minimization problem, an improved gravitational search algorithm (IGSA) is proposed. In contrast to the other gravitational search algorithm, the convergence factor is introduced in the calculation of the resultant force and the crossover operation in a genetic algorithm is performed when generating the new particles during each iteration. We conducted comprehensive experiments and evaluations to validate the performance and effectiveness of the proposed improved GSA (IGSA) algorithm.
The remainder of this paper is structured as follows.
Section 2 introduces the previous work of other experts.
Section 3 presents the system model and formulates the problem.
Section 4 details the design of the proposed algorithms.
Section 5 analyzes the proposed algorithm in this paper through numerical simulations. Finally,
Section 6 concludes the paper.
2. Related Work
In recent years, with the development of intelligent terminals, there has been an emergence of more computation-intensive services and applications. Due to the limited storage and computational resources of end devices, mobile edge computing provides an alternative solution for data processing and storage. Among them, computation offloading, as a key technology, has attracted increasing attention. Through the in-depth exploration of this field, researchers have achieved fruitful results.
In [
20], the authors studied a genetic and deep deterministic policy gradient (GADDPG)-based computation offloading scheme to achieve the optimal user experience quality. In [
21], the author proposed an emerging method of deep reinforcement learning for the dynamic clustering of IoT networks to solve the communication balance of IoT networks and the computational balance of edge servers. In [
22], the authors proposed an improved multi-objective cuckoo search (IMOCS) algorithm to reduce the execution latency and energy consumption of user terminals. In [
23], the author studied a deep reinforcement learning method that combines multiple neural networks to minimize the computational cost of the weighted sum of delay and energy consumption in dynamic environments with time-varying wireless fading channels. In [
24], the authors investigated the policy gradient (PG) algorithm to achieve a low decision time and low task offloading time. In [
25], the author studied a multi-agent power control algorithm to maximize the total transmission rate of all downlink transmissions. However, it is not difficult to notice that this category of research focuses on unordered, parallelizable, independent task models. Based on this, further investigation reveals that some research outcomes [
26] have also considered the computation offloading of sequential tasks, i.e., taking into account the completion priority of tasks or subtasks. However, neither pure parallel nor pure sequential models are realistic as tasks in actual systems are a hybrid of both. Currently, only a small number of scholars have begun researching the complex task offloading problem in this hybrid model. For example, in [
27], Anubhav Choudhary et al. proposed a problem of minimizing completion time and cost by considering the scenario of cloud computing. They presented a hybrid algorithm based on the meta-heuristic GSA and the heterogeneous earliest finish time (HEFT) heuristic to determine the monetary cost ratio (MCR) and the scheduling length ratio (SLR). However, their study only focuses on the scenario of cloud computing, which is relatively limited in scope. In [
28], a heterogeneous computing system workflow scheduling based on the GSA is proposed. The design of this algorithm involves representing task dependencies using a new agent while preserving the constraints. The algorithm shows an improvement in terms of completion time, load balancing, and energy consumption. However, it does not consider the specific application of the algorithm in specific system scenarios.
The offloading decision [
29] mainly solves the problem of how the mobile terminal decides how to offload, how much to offload, and what to offload. There are mainly two-part offloading and partial offloading. In [
27], the authors proposed a hybrid algorithm based on GSA and heterogeneous earliest finish time [
30] (HEFT) to minimize the completion time and total computational cost. However, maintaining the dependency constraints based on the HEFT algorithm requires
complexity. In [
28], the authors proposed a GSA-based algorithm that uses a lower complexity algorithm to maintain the priority and proposed a new proxy method.
4. Proposed Algorithm
As our algorithm is a hybrid of genetic algorithm (GA) and GSA, we first provide a brief description about both of these algorithms as follows.
4.1. Overview of GA
The genetic algorithm mimics the mechanisms of selection, crossover, and mutation observed in biological genetics and evolutionary processes to perform an adaptive search process for solving optimization problems. It starts by initializing the algorithm with any initial population (a set of feasible solutions). Then, an fitness function is designed to calculate the fitness value of each individual (a single solution) in the population. Next, individuals with higher fitness values are selected, and genetic crossover is performed among them to form a new population. This process is repeated iteratively to evolve and obtain one or several optimal solutions.
The genetic algorithm utilizes crossover operations to generate new feasible solutions, thereby maintaining population diversity and improving population quality. The proposed IGSA in this paper integrates the crossover and mutation operations of SA into the GSA algorithm. By performing these operations, a portion of the encoded positions of feasible solutions are replaced by a portion of the best solution in the current population with a certain probability q during the stage of generating a new population in GSA. This method further improves the convergence speed and optimization range of the algorithm.
4.2. Overview of GSA
Gravitational search algorithm (GSA) is a random heuristic search algorithm. Initially, the algorithm generates a set of particles (a set of feasible solutions) through random position encoding and forms an initial population by assembling these particles. Then, based on the law of universal gravitation, the algorithm calculates the force between particles using their masses and distances. Next, each particle calculates its own force based on the magnitude of total force and uses it to update its velocity and new position. Finally, the algorithm iterates continuously to obtain the final solution.
During the process of calculating the total force, IGSA improved the GSA and designed a convergence factor that only calculates the force between the top k particles with the optimal fitness values and maximum mass, filtering out some miscellaneous particles and highlighting the influence of superior individuals. This method further accelerates the convergence of the algorithm, achieving a good balance between exploration and exploitation.
4.3. Generation of Population
The population is composed of a group of particles. Each particle corresponds to a solution of the optimization problem. Therefore, the population is a set of feasible resource allocation methods. Initially, we generate a population
, where the particle is denoted by
. Actually, a particle
means a complete solution of the problem. For the network with
I subtasks and
L severs, it can be expressed as follows.
where
represents the sever assigned to the task
in the solution
.
Next, we proceed to encode the positions of the particles. Note that
implies the sever number, so we first define
and then have
where the symbol
signifies the ceiling function.
The diagram in
Figure 3 illustrates an example of particle encoding in a system with 3 base stations and 3 users, where each user has 4 subtasks.
Each particle has a fitness value which indicates the quality of the solution. For a given particle (allocation strategy), we can always calculate its total delay and total cost using Equations (
16) and (
20), respectively, so we can compute
where
denotes the fitness value of the
nth particle, and
and
are defined in Equation (21).
The fitness value is inversely proportional to the total latency and total cost. Therefore, a particle with low latency and low cost will have a high fitness value. The higher the fitness value, the higher the likelihood of becoming the optimal solution.
The fitness can be obtained based on the particle’s position encoding. Firstly, calculate the hierarchical values of subtasks based on Equation (
1), and sort the subtasks in ascending order according to their hierarchical values. If there are subtasks with the same hierarchical value, sort them in descending order based on their corresponding position codes. This process yields the topological order vector, denoted by
a. Next, in accordance with the order of subtasks in
a, calculate the execution time
and start time
of each task using Formulas (
4) and (
15). During this process, the server number
corresponding to the subtasks are obtained from Equation (
24). Then, evaluate the total user delay, total server cost, and fitness function value by applying Formulas (
16), (
20), and (
25), respectively. A detailed procedure for computing the fitness is described in Algorithm 1.
Algorithm 1 Fitness-Calculation |
- Input:
Particle position - Output:
Fitness - 1:
Initialize the processor end delay matrix to 0 matrix, processor_time[l] = 0, - 2:
for each task in the topological order of subtasks a do - 3:
Compute the server number corresponding to the task according to Equation ( 24) - 4:
Set the forward task end time to 0, that is, = 0 - 5:
if the preceding task exists then - 6:
for traverse all tasks in the forward node set of task , do - 7:
if < then - 8:
= - 9:
end if - 10:
end for - 11:
end if - 12:
Compute processing delay using Equation ( 4) - 13:
The actual start time of task , - 14:
Update the processor end latency matrix, Processor_time[] = + - 15:
end for - 16:
Calculate the total latency of user end tasks using Equation ( 16) - 17:
Calculate the total cost of the processor using Equation ( 20) - 18:
Calculate the fitness function value using Equation ( 25)
|
Typically, the computed fitness values vary in a wide range. Hence, we employ the method of max–min normalization to normalize the fitness to a range of [0, 1] to evaluate the mass of each particle. The mass of the
nth particle is given by
where
is the fitness value of the
nth particle,
is the highest particle fitness function value in the
t-th iteration, and
is the lowest particle fitness function value in the
t-th iteration.
4.4. Force Computation
Let
and
be the mass of
n-th particle and the gravitational constant, respectively, in the
t-th iteration. We can define the force acting on the
n-th particle by
-th particle for the
t-th iteration as follows.
where
,
are the masses of particles
n and
, respectively.
is the Euclidian distance between two particles
n and
, and
and
are the encoded positions of the particle
n and particle
in the searching space with the dimension
i, respectively;
is the gravitational factor, and
is a small constant.
The gravitational constant
is initialized in the beginning and reduces as the algorithm proceeds. In order to improve the search accuracy, we define
as a function of initial value
and iteration number
t.
where
T is the maximal iteration time and
is a small constant.
To avoid trapping in a local optimum, kbest is introduced in the IGSA. The force acting on the particle is defined as follows:
where
is a random number between [0, 1] and
is the set of
k best particles with the biggest masses.
For each iteration, we compute the percent
of particles that apply force to the others in the last iteration, and apply it to compute the value
k in the current iteration.
k is defined as
where the sign
means to round ·.
From the above definition, it is obvious that the elements in set is a linear decreasing function of time. Only the particles in set Kbest attracts other particles, which filters out some idle particles and highlights the influence proportion of the better individual. Not only that, but this method also speeds up the convergence.
4.5. Position Update
The acceleration of the
n particle at iteration
t in the
i dimension space can be defined as:
The velocity and position of particles are calculated as follows:
During the position update procedure, we introduce the idea of cross mutation in the genetic algorithm. In each iteration, for the particle whose position is updated, if the generated random number
(
) is less than the predefined crossover probability
, the original position information of the agent is replaced with part of the position information in the global optimal solution. The change of the particle force before and after replacement is compared. Only when the force becomes larger, the replacement retains. The crossover procedure is shown in Algorithm 2.
Algorithm 2 IGSA algorithm |
- 1:
Initialize particle position - 2:
while () do - 3:
calculate using Algorithm 1 and Formula ( 25) - 4:
calculate using Formula ( 28) - 5:
calculate using Formula ( 26) - 6:
for do - 7:
Calculate the resultant force on particles using Formula ( 29) - 8:
Calculate particle acceleration and velocity using Formulas ( 31) and ( 32) - 9:
Calculate using Formula ( 33) - 10:
end for - 11:
Calculate the optimal solution for the current population - 12:
for do - 13:
- 14:
if then - 15:
Generate random integer , , - 16:
if then - 17:
- 18:
else - 19:
- 20:
end if - 21:
end if - 22:
end for - 23:
- 24:
end while
|
5. Simulations and Results
In this section, we evaluate the performance of the proposed IGSA. Firstly, the convergence of IGSA is simulated. Then, the proposed algorithm is compared with the HGSA [
27] and GSAL [
28] algorithms. The distinctions between the three algorithms are as follows:
- (a)
IGSA is a strategy designed to solve the joint task offloading and resource allocation problem in the context of cloud-edge collaborative dual-layer network structures. It adopts a series of optimization strategies, which enable it to outperform other algorithms in terms of performance. Firstly, the IGSA algorithm introduces the concept of a convergence factor during the computation of the resulting force. By incorporating a continuous iterative updating process, it aims to seek the optimal solution. This not only enhances the convergence speed of the algorithm but also allows for the discovery of improved solutions after multiple iterations. Secondly, the IGSA algorithm incorporates genetic algorithm crossover operations after each iteration, enhancing the algorithm’s global search capability, and enabling it to better find the optimal solution.
- (b)
In HGSA, in [
27], a meta-heuristic workflow scheduling algorithm is designed to address scheduling problems in cloud computing. The HGSA algorithm utilizes the output of the heterogeneous earliest finish time (HEFT) algorithm to seed the initial population, retains the best particle to enhance convergence speed, and optimizes the quality of the population through the threshold quality and update mechanisms. However, compared to the IGSA algorithm, the hybrid genetic/simulated annealing (HGSA) algorithm primarily adopts predefined heuristic strategies and lacks flexibility to adjust decision strategies according to real-time situations, resulting in poor adaptability.
- (c)
In the GSAL algorithm mentioned in [
28], a recursive algorithm is used to generate effective task execution sequences to enhance the priority relationships between tasks. This approach allows for effective scheduling based on task correlations and dependencies. However, compared to the IGSA algorithm, the GSAL algorithm has a simpler search strategy, which may result in it getting stuck in local optimal solutions during the search process, leading to less desirable results.
In addition, since the objective function and fitness value are inversely related, and the system performance is directly proportional to fitness, we will analyze the system performance using the fitness value in further discussions.
This article conducts a simulation analysis on the proposed IGSA algorithm. Assuming that the total number of users in the system is
R = 5 and the total number of processors is
L = 4, there are three MEC servers and one MCC server in the system. The computing power of the MCC server is
GHz, while the computing power of MEC server is 16, 15, and 14 GHz, respectively. The required CPU cycle
of the subtask is taken as a random value at [0.2, 0.3] GHz, and the corresponding task size
is taken as a random value at [500, 1500] KB. The base price of the processor cost
. Random variables
. Gravity factor
, normalization factor
. In the IGSA algorithm, let the gravitational constant
,
, maximum iteration
, number of particles
, crossover rate
, and minimum gravitational coefficient 0.1. The simulation results are taken as the average of 10 experiments. The simulation parameters are summarized in
Table 1.
Next, we first simulate the convergence of the proposed IGSA algorithm in the different task numbers using
Figure 4 to illustrate that the algorithm can achieve fast convergence with a smaller number of iterations. Secondly, in the simulation presented in
Figure 5, we compared the fitness values, delays, and costs of three algorithms under different task numbers to illustrate the advantages of the proposed algorithm in various performance metrics. Then, in
Figure 6, we further simulated the convergence of different algorithms in terms of fitness values under the different numbers of tasks. Finally, in
Figure 7 and
Figure 8, we compared the fitness values of the algorithms under different numbers of users and processors to demonstrate the performance of the proposed algorithm in this paper. These experimental results further validate the effectiveness and feasibility of the algorithm proposed in this study.
The following paragraph provides a detailed analysis of the simulation results.
According to
Figure 4, in an MEC system with three MEC servers and one MCC server, for different task loads (8, 12, and 17), we observed two characteristics of the proposed IGSA algorithm in terms of fitness value. Firstly, as the number of iterations increases, this algorithm always converges rapidly to the optimal fitness value. This is because the gravitational effect attracts particles towards the optimal solution, causing them to cluster around it. As the number of iterations increases, the distance between particles decreases, bringing them closer to the optimal solution and achieving convergence towards the best solution. Secondly, when the task quantity decreases, especially for I = 8, the algorithm converges to a higher optimal fitness value (1.2). This is because, as the task quantity decreases, the search space of the problem becomes smaller and the solution space becomes more concentrated, making it easier to find the global optimal solution. Therefore, as the number of iterations increases, the algorithm is more likely to find a higher optimal fitness value.
In
Figure 5, we analyzed the relationship between the task quantity and fitness value, the total user delay, and processor cost. We considered the task quantities of 8, 12, and 17. It was observed that, as the task quantity increased, the fitness values of all algorithms decreased, while the total delay and cost increased. In addition, in all scenarios, the algorithm proposed in this paper consistently outperforms other baseline algorithms, achieving higher fitness values and lower total delay and cost. This can be attributed to the IGSA algorithm’s stronger global search capability as the task quantity increases. The convergence factor guides particles towards the global optimal solution, leading to rapid convergence. Additionally, the crossover operation in the genetic algorithm enhances the diversity of the search space, preventing the algorithm from getting stuck in local optima. This enables the algorithm to find solutions with higher fitness values, ultimately minimizing the total delay and cost.
In
Figure 6, we compared the IGSA algorithm proposed in this paper with the HGSA algorithm from the reference [
27] and the GSAL algorithm from the reference [
28]. We simulated their overall performance under the different values of N (8, 12, and 17). Analyzing the final optimization results, we found that the IGSA algorithm proposed in this paper exhibits a better optimization performance compared to the HGSA and GSAL algorithms. The HGSA algorithm proposed in [
27] shows an average performance in terms of optimization results, despite its attempt to improve the convergence speed by replacing particles below a threshold with the current iteration’s best particle. Similarly, the GSAL algorithm proposed in [
28] demonstrates a poorer performance in convergence accuracy and optimization results, despite its use of the acceleration and force of the gravitational law to locate the next particle to be executed. In contrast, the IGSA algorithm proposed in this paper incorporates a convergence factor in the resulting force calculation and utilizes the genetic algorithm’s crossover operation in each iteration, leading to improved optimization results.
The following paragraph presents additional experimental results to demonstrate the effectiveness of the proposed IGSA algorithm when varying the number of processors and users. It also compares its performance with other leading algorithms in the field.
The comparison results in
Figure 7 demonstrate the clear advantage of our algorithm over others. As the number of users increases from 5 to 7, our algorithm only experiences a 31% decrease in fitness value, while the other two algorithms show decreases of 43% and 44%, respectively. Moreover, as the number of users increases, the fitness value gradually decreases. This is because the increase in the number of users leads to an increase in total delay and cost. As the fitness value is a weighted sum of delay and cost, it naturally decreases. However, despite the increase in the number of users from 5 to 13, our algorithm still demonstrates a significant advantage.
By observing
Figure 8, it can be noticed that, as the number of processors increases, the three algorithms show different performances in terms of fitness value. In the graph, the IGSA algorithm consistently achieves the optimal fitness value. This is because the algorithm introduces a crossover operation, facilitating effective gene pairing and selecting individuals with higher fitness as parents for the next generation or directly including them in the next generation. This mechanism leads to a superior genetic composition, resulting in an improvement in the overall fitness value of the system. Additionally, we observe that the fitness value decreases most rapidly when the number of processors increases from 3 to 6. However, when the number of processors further increases to 15, the fitness value stabilizes. This can be explained by the fact that, with fewer processors, there is more room for optimization, resulting in a significant decrease in fitness value. However, as the number of processors continues to increase, the system reaches a point of optimal utilization. Further increasing the number of processors may not lead to a significant performance improvement since the system is already operating at a relatively stable level of resource utilization.
From the above analysis, we can see that our algorithm outperforms existing HGSA and GSAL algorithms in terms of fitness value, total delay, and total cost. A key reason for this is that our proposed IGSA algorithm introduces the concept of a convergence factor in the calculation of a resulting force during the iteration process to search for the optimal solution. This allows for continuous iterative updates and a more efficient convergence towards the optimal solution. The introduction of this convergence factor not only accelerates the convergence speed of the algorithm but also helps find better solutions after multiple iterations. Furthermore, after each iteration, we also apply the crossover operation of the genetic algorithm to enhance the global search capability of the algorithm. Through this approach, we can better explore the search space and find better solutions. Therefore, our IGSA algorithm can provide both a fast convergence speed and a high global search capability, enabling it to find high-quality solutions.