## 2 Methods
### SMA-DE Algorithm Design  
The SMA algorithm and DE algorithm are both common swarm intelligence algorithms, which have the advantages of global search and local search, respectively. The SMA algorithm utilizes group information to achieve a global search, but it is prone to getting stuck in the local optima [40]; the DE algorithm achieves local search through mutation and crossover operations, which can effectively jump out of local optimal solutions, but its global search ability is not as good as the SMA algorithm [41]. Combining the two can effectively balance the global and local aspects, thereby improving the performance and search efficiency of optimization algorithms. Therefore, in this study, a hybrid SMA-DE algorithm with a penalty function is proposed. The main idea of the algorithm is to use the SMA algorithm to perform a global search, and then the solution obtained by the SMA algorithm is locally optimized by the DE algorithm to improve the search accuracy. The SMA algorithm and the DE algorithm use different strategies in the search process. Combining the two can create an effective balance between global and local, thus improving the performance and search efficiency of the optimization algorithm, which has high search efficiency and global search ability, and can find the optimal solution to the problem in a shorter time. The specific steps include initialization, SMA operation, DE operation, updating the optimal position, and judging the stop condition. The steps of the SMA-DE hybrid algorithm are as follows:  
(1) Initialization:  
During the initialization phase, an initial population of slime molds is created, positions and velocities to each slime mold are assigned, and the initial fitness value is calculated. Setting the parameters of the penalty function to handle situations where constraints are violated follows.  
(2) SMA operation:  
During the SMA operation phase, the SMA algorithm is used to update the velocity and position of slime molds and generate a new slime mold population to search for the optimal solution. By continuously iterating and updating the position and speed of slime molds, the SMA-DE algorithm can gradually optimize the position of each slime mold and ultimately find the optimal solution.  
(3) DE operation:  
The DE algorithm performs evolutionary operations on a new slime mold population, resulting in a new slime mold population. Among them, each slime mold generates a new position based on the position difference vector between the current slime mold population and three randomly selected slime molds. If the new solution violates the constraint conditions, the penalty function is calculated, the penalty function value is added to the fitness function value, and the fitness value is recalculated.  
(4) Update the optimal location:  
Comparing and updating individual historical optimal solutions and global historical optimal solutions. For each slime mold, if the fitness value of the new solution is better, the individual's historical optimal solution is updated. For the optimal solution among all slime molds, if its fitness value is better, the global historical optimal solution is updated.  
(5) Determine the stopping conditions:  
If the preset stopping conditions are met (such as reaching the upper limit of iterations, meeting the fitness requirements, etc.), the SMA-DE algorithm will end and return the global historical optimal solution as the final solution. Otherwise, it will return to step 2.  
In summary, the flow of the hybrid SMA-DE algorithm is shown in Figure 1.