# Global Resource Scheduling for Distributed Edge Computing
## 4 Algorithm Design
### Parameter Optimization of the ACO Based on PSO  
The ACO algorithm involves several parameters, and the optimization results are directly influenced by the setting of these parameters. Manually selecting parameter values does not ensure optimal performance, making it crucial to find a reasonable parameter configuration before each iteration to enhance algorithm effectiveness. To address this challenge, this paper introduces a parameter optimization method based on PSO. This dynamic approach optimizes parameters based on the results of each iteration, providing an adaptive and efficient means of setting parameters for the ACO algorithm. The PSO is a phenomenon that simulates birds searching for food. PSO has been widely used in continuous optimization problems and discrete optimization problems [36; 37; 38]. A population of \(m\) particles has its position in the multidimensional search space. The particles fly at a certain speed to simulate the migration process of birds. When searching for the target, focus on the best solution in this history search record and update the speed  
Figure 3: Example of path selection for global optimization and local optimization. and position according to specific rules based on the best record of other particle history searches in this group. The position of the \(d\)-th (\(1\leq d\leq m\)) particle in the \(i\)-th particle group is expressed as \(x_{id}\), whose speed is expressed as \(v_{id}\), and whose best history is expressed as \(p_{id}\). The best record of all particles in the population is expressed as \(p_{gd}\). The update of particle speed and position is based on the following two formulas:  
\[v_{id} = \omega\times v_{id}+c_{1}\times\text{rand()}\times(p_{id}-x_{id}) \tag{10}\] \[+c_{2}\times\text{rand()}\times\left(p_{gd}-x_{id}\right)\]  
\[x_{id}=x_{id}+v_{id} \tag{11}\]  
where \(\omega\) is the inertia weight, whose value determines how much of the past value of the particle remains. Whether \(\omega\) is appropriate can determine whether the final solution is enough for optimization. \(c_{1}\) and \(c_{2}\) are called learning factors, equivalent to measuring the speed of particles approaching the optimal solution. The learning factor has the effect of evaluating itself and learning other particles. rand() is a pseudorandom number in the interval \([0,1]\). In this paper, the parameters \(\alpha,\beta\) of the traditional ACO are optimized by training. Moreover, a mutation strategy is set so that when the ant selects a new node, the probability of selecting the next hop node through the pheromone concentration is no longer an inevitable event but has a certain probability of modifying the probability of selection. In this algorithm, the total number of \(N_{a}\) ants is divided into several populations, and the number of ants in each population is the same \(N_{sa}\). Each population maintains its pheromone matrix, which records the path between each node and the migration cost. Then, position \(x\) and speed \(v\) are converted into parameters \(\{\alpha,\beta\}\); The PSO is used to optimize these two parameters after each iteration of the ant colony algorithm as the initial parameters of the next iteration. The value range of \(\alpha\) is set to \([1,2]\), and the value range of \(\beta\) is set to \([1,2]\). So the lower bound of \(\{\alpha,\beta\}\) is \(\{1,1\}\), and \(\sigma\) is the difference between the upper and lower bound. Set the range of particle position to \([-50,50]\) and particle speed to \([-60,60]\). Suppose \(X_{k}\) is the \(k\)-th position element of the particle; then, the particle position is converted into a parameter by the following formula. \[\{\alpha,\beta\}=R_{min}+\sigma*\frac{X_{k}-X_{min}}{X_{max}-X_{min}} \tag{12}\]  
The traditional PSO is improved, and \(\omega\) is optimized to make it dynamic.