MSO: A Modified Snake Optimizer for Engineering Applications
Hongxi Wang, Likun Hu

TL;DR
This paper introduces a modified snake optimizer algorithm that improves convergence and performance for solving complex engineering optimization problems.
Contribution
The paper proposes a Modified Snake Optimizer (MSO) with enhanced initialization, exploration, and exploitation strategies.
Findings
MSO outperforms nine existing algorithms on CEC2017 benchmarks.
MSO shows faster convergence and better stability in engineering design problems.
The algorithm is effective in UAV path planning scenarios.
Abstract
Many complex engineering problems can be formulated as mathematical optimization tasks, for which bio-inspired metaheuristic algorithms have demonstrated outstanding effectiveness. Drawing inspiration from snake behavior, the Snake Optimizer (SO) algorithm provides a promising framework but suffers from random population initialization, insufficient global search capability, and slow convergence. To address these drawbacks, the study proposes a Modified Snake Optimizer (MSO) that integrates three key strategies: a dual mapping strategy based on Latin hypercube sampling and logistic mapping for population initialization; an opposition-based learning mechanism with scaling factors for exploration; and integration of the soft-rime search strategy from RIME optimization during exploitation. The performance of MSO was benchmarked against nine representative algorithms using the CEC2017 and…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
Figure 22Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMetaheuristic Optimization Algorithms Research · Advanced Multi-Objective Optimization Algorithms · Biomimetic flight and propulsion mechanisms
1. Introduction
With the rapid development of technology and society, academic research is increasingly confronted with complex optimization problems across various fields, such as engineering, mathematics, and physics—particularly in emerging domains such as UAV path planning [1]. These optimization challenges require identifying the best possible solutions under some specific conditions. As the scale and complexity of real-world optimization problems continue to increase, traditional deterministic mathematical optimization methods, such as gradient descent, reveal inherent limitations. These include the need for an explicitly defined search space, strong dependence on the continuity of the objective function, and frequent entrapment in local optima. Research on metaheuristic optimization algorithms has enriched the theoretical foundations of optimization techniques, enhanced understanding of their performance and convergence characteristics, and provided effective solutions for complex engineering applications. A crucial advantage of metaheuristic algorithms lies in their non-derivative and non-gradient nature, which allows them to be flexibly applied to complex optimization problems and search more intuitively for optimal solutions within the search space. These algorithms are particularly well-suited for solving non-convex, nonlinear, and continuous optimization problems where classic mathematical techniques are usually unable to achieve satisfactory results. Metaheuristic algorithms have demonstrated remarkable effectiveness across a wide range of domains, especially where deterministic approaches are inadequate. Their main advantages include simplicity, flexibility, and independence from problem-specific properties [2]. For instance, in UAV path planning, metaheuristic algorithms can efficiently address multiple objectives and rapidly generate feasible flight trajectories [3]; in wireless sensor network coverage problems, they achieve higher coverage with fewer nodes, thereby enhancing efficiency and reducing deployment costs [4]; and in network routing optimization, they enable more rational clustering strategies that significantly extend network lifetime [5].
Despite remarkable progress in various engineering applications, metaheuristic algorithms continue to face inherent challenges and limitations. As described by the No Free Lunch (NFL) Theorem, every optimization algorithm exhibits strong performance only on specific types of problems, while none can maintain superiority across all possible domains [6]. This limitation has motivated researchers to improve existing algorithms or design new ones better suited to specific classes of optimization problems.
In recent years, numerous metaheuristic algorithms inspired by biological behaviors have been proposed, demonstrating strong capabilities in addressing complex optimization tasks. demonstrating distinct capability in addressing complex optimization problems. For example, the Beluga Whale Optimization (BWO) algorithm mimics the swim, whale-fall, and prey behaviors of beluga whales [7]. It consists of two main phases: an exploration phase, corresponding to the swim behavior, and an exploitation phase, representing the prey behavior. This structure enables BWO to maintain an effective balance between exploration and exploitation, rendering it well-suited for solving complex optimization problems. The Dung Beetle Optimization (DBO) algorithm draws inspiration from the natural behaviors of dung beetles and models their ball-rolling, dancing, foraging, stealing, and reproductive actions [8]. It employs a multi-subpopulation structure in which each subgroup executes distinct search strategies, resulting in outstanding optimization performance. The Crown Porcupine Optimization (CPO) algorithm models four distinct defensive mechanisms—sight, sound, odor, and attack. The first two mechanisms correspond to the exploration phase, while the latter two are associated with the exploitation phase, enabling CPO to simultaneously perform global search and local optimization [9].
Inspired by the foraging and reproductive behaviors of snakes, Hashim and Hussien proposed the Snake Optimizer (SO) in 2022 as a novel swarm-based metaheuristic algorithm [10]. This SO algorithm integrates multiple strategies while requiring relatively few tuning parameters. Despite its promising performance, the SO algorithm still exhibits several limitations, including inefficient exploration, slow convergence speed, random population initialization and a tendency to stagnate in local optima.
To overcome these drawbacks, several researchers have proposed improved variants of SO. Yao et al. proposed the Enhanced Snake Optimizer (ESO) [11], which integrates an opposition-based learning mechanism and a dynamic parameter adjustment strategy to improve search performance. Experimental validation on 23 benchmark functions and four engineering design problems demonstrated that the ESO outperforms 13 other competitive algorithms. Similarly, Alawad et al. introduced the Hybrid Snake Optimizer Algorithm (HSOA) to overcome premature convergence and enhance population diversity of SO, demonstrating competitive performance on the CEC 2014 functions [12].
Hu et al. developed a Multi-strategy Boosted Snake-Inspired Optimizer for Engineering Applications (BEESO) to improve global optimization performance and enhance engineering applicability. BEESO integrates three key strategies—Bi-Directional Search, Modified Evolutionary Population Dynamics, and Elite Opposition-Based Learning [13], to simultaneously increase population diversity and accelerate convergence speed. The evaluation results reveal that BEESO performs better than the original SO algorithm and remains highly competitive compared with other metaheuristic algorithms. Despite this, BEESO still tends to fall into local optima, which limits its optimization performance.
Abdülkadir, Pektas et al. introduced the Snake Optimizer Particle Swarm Optimization (SO–PSO) algorithm [14], which incorporates the velocity vector of Particle Swarm Optimization (PSO) into the exploration phase of SO to enhance search efficiency. Nevertheless, the relatively low quality of the initial population still hinders convergence speed and reduces overall stability.
A comprehensive review of existing studies reveals that the primary limitations of the original Snake Optimizer and its variants lie in poor initial population quality, insufficient global exploration capability, slow convergence, and a tendency to get stuck in local optima—all of which constrain its overall performance and ability to solve engineering application problems. To mitigate these drawbacks, this study proposes a Modified Snake Optimizer (MSO) algorithm. The primary contributions of this work differ from previous studies in the following aspects:
- A dual-mapping strategy based on Latin hypercube sampling and logistic mapping is proposed for population initialization. This strategy improves the spatial distribution of the initial population and effectively enhances convergence speed.
- An opposition-based learning mechanism with scaling factors is incorporated during the exploration phase to expand the search range and strengthen the algorithm’s ability to locate global optima.
- Soft-rime search strategy from RIME is integrated into the exploitation phase, which enhances local search ability and effectively prevents premature convergence.
- Comprehensive comparative experiments involving nine other algorithms on the CEC 2017 functions, three classical engineering application problems, and two UAV path planning scenarios demonstrate the effectiveness, stability, and superiority of the MSO algorithm in addressing both numerical optimization and real-world engineering problems.
2. Snake Optimizer (SO)
Snake Optimizer is a novel metaheuristic algorithm [10], inspired by snakes’ mating, foraging, and competitive behaviors in natural environments. When food is scarce, snakes engage in foraging; under low temperatures with ample food, male and female snakes fight and mate. If food is abundant but temperatures are excessively hot, the snake only moves toward existing food and eats them. The steps of SO are as follows:
2.1. Initialization
Similar to other metaheuristic algorithms, the Snake Optimizer algorithm randomly generates initial individuals in the search space:
Among these, is a D-dimensional vector and represents the position of the individual; is a randomly generated number between 0 and 1; and denote the upper and lower bounds of the search space, respectively, and are also d-dimensional vectors. The equation is applied independently for each dimension.
2.2. Division into Male and Female Subpopulations
After initialization, the population is divided into male and female groups according to the equations:
where is the total number of individuals, and and represent the number of male and female individuals, respectively.
2.3. Calculation of Food Quantity and Temperature
After dividing the population into two subpopulations, calculate the fitness value for each individual. The exploration and exploitation tendencies are determined based on the parameters of Temperature ( ) and Food quantity ( ):
where represents the current iteration, refers to the maximum number of iterations, is a constant equal to 0.5.
2.4. Exploration Phase (Insufficient Food)
When < 0.25, the snake finds food by selecting random positions. The position equations for this phase are calculated as follows:
, refers to the positions of the male and female snakes, respectively; , refers to the selected positions of male and female snakes, respectively; is a random number between 0 and 1; is a constant equal to 0.05. operator is determined by a random number ∈ [0,1]; if < 0.5, the negative sign is used, and if ≥ 0.5, the positive sign is used. , represent the male ability to find the food abilities of the male and female snakes, and can be computed as follows, respectively:
and are the fitness of and ; and are the fitness of individuals in male and female groups.
2.5. Exploitation Phase (Sufficient Food)
When > 0.25 and > 0.6, the snake moves to food only, and the corresponding equation is expressed as follows:
where is constant and equals 2, refers to the position of food, operator is determined by a random number ∈ [0,1]; if < 0.5, the negative sign is used, and if ≥ 0.5, the positive sign is used.
If > 0.25 and < 0.6, the snake will be in the fight mode or mating mode.
- (1)Fight Mode
The fight behavior of snakes is mathematically demonstrated in the following equations:
where , denote the positions of male and female individuals, respectively. operator is determined by a random number ∈ [0,1]; if < 0.5, the negative sign is used, and if ≥ 0.5, the positive sign is used. and are the fighting abilities of male and female snakes, given as follows:
where is the fitness of the individual; and refer to the fitness of the best individual in female and male populations.
- (2)Mating Mode
Regarding the snake mating behavior, the snake positions are updated as follows:
and are the mating abilities of male and female snakes, computed as follows:
The worst male and female members of the population are replaced if snake eggs hatch, according to Equations (19) and (20):
refer to the worst male and female snakes, respectively.
Control parameters are summarized as follows in Table 1.
3. Modified Snake Optimizer (MSO)
Although the Snake Optimizer (SO) has demonstrated promising optimization performance across various applications, it still faces many challenges related to the quality of the initial population, convergence speed, and escaping the risk of local optima [15]. To overcome these limitations, this study proposes a Modified Snake Optimizer (MSO) that systematically enhances the original SO through the integration of multiple complementary strategies.
3.1. Dual Mapping Strategy Based on Latin Hypercube Sampling and Logistic Mapping
The quality of the initial population significantly influences the global optimal solution. In the SO algorithm, using random numbers to initialize the population frequently results in an uneven spread of solutions, which diminishes the ability to locate global optima [16].
To address this problem, a dual mapping strategy based on Latin hypercube sampling and logistic mapping is introduced to improve the distribution of the population.
Latin hypercube sampling (LHS) is a sampling method for multidimensional parameter spaces [17]. Its core principle involves uniformly partitioning the variable distribution range into multiple non-overlapping subintervals, then performing independent, equal-probability sampling within each subinterval. This ensures that sample points uniformly cover the entire distribution space. Unlike traditional random sampling methods, LHS employs a stratified strategy to better distribute sample points across the entire interval. Therefore, a mapping method based on LHS is introduced to initialize the position.
The equation for calculating the initial population position based on LHS is as follows:
where is the random sequence generated by Latin hypercube sampling, and and denote the upper and lower bounds of the search space, respectively.
To further improve the quality of the population, we also consider using chaotic mapping to generate another initial population.
Chaotic motion is characterized by randomness, ergodicity, and a high sensitivity to initial conditions [18]. Logistic mapping, a common nonlinear dynamical equation that models complex chaotic behavior, is used for population initialization because of its simplicity and strong randomness. It is expressed as follows:
where is the control parameter in the interval . The logistic map enters the chaotic regime when > 3.57, and = 4 corresponds to a fully chaotic state. This study sets to 4 for enhancing population diversity.
Using Latin hypercube sampling and the logistic mapping, individuals are generated separately. These individuals are then combined, and the top N individuals based on fitness are selected as the initial population.
Unlike existing SO variants that only use chaotic initialization or metaheuristics with LHS only, the proposed hybrid initialization strategy integrates the advantages of both methods. It ensures the initial population covers the entire search space uniformly while enhancing diversity, which directly addresses the initialization limitation of the original SO.
3.2. Opposition-Based Learning Mechanism with Scaling Factors
During the exploration phase of the Snake Optimizer, individuals update their positions by randomly selecting points within the search space. This method frequently results in a population with limited diversity and quality, which can hinder the ability to locate the global optimization.
Incorporating opposite-based learning strategy into swarm intelligence algorithms has been shown to improve their performance [19]. To overcome the limitations in exploration ability, this paper proposes an opposition-based learning mechanism with scaling factors. This mechanism broadens the search coverage and augments population diversity, thereby significantly enhancing the algorithm’s global search capability.
Firstly, the central positions of the male and female populations are determined, then two random scaling factors are introduced to generate mirror solutions. The fitness values of the mirror solutions and the original individuals are calculated, and the individual with the better (lower) fitness is chosen as a new position. The corresponding equations are as follows:
where and are the center positions of the current female and male populations, and are scaling factors, calculated as follows:
By incorporating scaling factors into the opposition-based learning mechanism, the proposed strategy effectively expands the search range and improves population diversity during the exploration phase.
3.3. Exploitation Strategy for the Integrated Soft-Rime Search Strategy from RIME
In conditions characterized by abundant food availability ( ) and excessively elevated temperatures ( ), snakes only consume existing food—mathematically represented in the algorithm as convergence toward the current optimal solution. This process relies heavily on guidance from the current optimal position, lacking sufficient random perturbations or global jump mechanisms. If the optimal solution is unstable, the algorithm risks becoming confined to local optima.
To enhance the algorithm’s exploitation performance and avoid getting stuck in local optima, the soft-rime search strategy from RIME optimization is incorporated into the exploitation phase of MSO to generate higher-quality new candidate solutions.
RIME is a nature-inspired intelligent optimization algorithm derived from the physical process of rime-ice formation [20]. By simulating the growth processes of soft-rime and hard-rime, this algorithm searches for optimal solutions within the solution space, demonstrating excellent global search capabilities. The soft-rime search strategy factor RF is expressed as:
where is a random number between 0 and 1, is the current iteration number, is the maximum iteration number, and is a constant equal to 5.
This strategy is integrated into the hot environment exploitation phase of the MSO algorithm, with the relevant formulas as follows:
Equations (28) and (29) are mathematically consistent with identical parameter meanings, corresponding to the position update formulas for male and female snakes, respectively. operator is determined by a random number ∈ [0,1]; if < 0.5, the negative sign is used, and if ≥ 0.5, the positive sign is used. Subsequently, with a probability of 50%, the algorithm determines whether to accept the new candidate solutions that integrate the soft-rime growth strategy factor RF or the solutions generated by the original SO algorithm. This approach maintains the exploitation capability of the original SO algorithm while mitigating the risk of convergence to local optima.
The adaptive nature of the soft-rime search strategy factor RF enables MSO to dynamically adjust exploitation step sizes as the search progresses. Unlike fixed local search strategies used in SO and many hybrid algorithms, this mechanism complements the original SO framework and provides greater flexibility in balancing convergence speed and solution quality.
In summary, the proposed Modified Snake Optimizer (MSO) algorithm effectively addresses the inherent drawbacks of the original Snake Optimizer (SO) and its existing variants—including insufficient initial population diversity, insufficient global search capability, and inefficient local exploitation—by introducing three tailored improvement strategies and systematically integrating them into the SO framework. Unlike the simple superposition of isolated techniques adopted in most existing hybrid metaheuristic approaches, MSO’s integration is designed to complement SO’s inherent snake-inspired search mechanism and target its core limitations synergistically.
3.4. Algorithm Flow
The implementation procedure of the MSO algorithm comprises the following steps:
Step 1: Establish a mathematical model based on the problem to be solved and define the objective function.
Step 2: Set the snake population size and maximum iteration number. Initialize snake positions using a dual mapping strategy based on Latin hypercube sampling and logistic mapping.
Step 3: Divide the population into male and female groups. Define the fitness function, calculate corresponding fitness values, and identify the current best male/female snakes and the global optimum.
Step 4: Define the food quantity and environmental temperature.
Step 5: Determine whether to enter the exploration or exploitation phase based on food quantity . If < 0.25, the snake finds food and updates the position using the opposite-based learning mechanism with scaling factors.
Step 6: When > 0.25 and > 0.6, snakes consume existing food. Generate new positions using either the original SO algorithm or new equations incorporating the soft-rime search strategy from RIME, selected with a 50% probability.
Step 7: When > 0.25 and < 0.6, use a pattern random number to choose between fight mode or mating mode.
Step 8: Evaluate the newly generated individual and refine the historical optimum accordingly.
Step 9: The algorithm evaluates the termination criterion based on the current and maximum number of iterations. If this limit is not reached, the process proceeds; otherwise, terminate the iteration and output the optimal position.
The workflow of the MSO algorithm is illustrated in Figure 1 below.
4. Algorithm Comparison and Result Analysis
To comprehensively validate the effectiveness of the MSO in solving mathematical and engineering application problems, the proposed MSO method was applied to 30 benchmark functions from CEC 2017 [21], three engineering application problems, and two three-dimensional UAV path planning scenarios. Experimental outcomes were benchmarked against SO [10] alongside eight other state-of-the-art algorithms: BWO [7], DBO [8], CPO [9], COA [22], HHO [23], MFO [24], AOA [25], and WOA [26]. The simulation test environment configuration is as follows: operating system: Windows 11, 64-bit version; processor: 13th Gen Intel Core (TM) i5-13500H, base frequency 2.60 GHz; system equipped with 32 GB RAM; simulation software used: MATLAB R2024b. For all algorithms, parameter settings followed the recommendations provided in their original publications. The detailed parameter configurations of the comparison algorithms are summarized in Table 2.
4.1. Results on CEC 2017
This section presents a comprehensive evaluation to verify the performance and efficiency of the MSO algorithm. We use 30 functions from CEC 2017 for comparative experiments. These benchmark functions impose considerable challenges on optimization algorithms, categorized into four types: unimodal, multi-peak, hybrid, and composite functions. Specific details can be found in the relevant literature [21].
To ensure a fair and statistically meaningful comparison, all algorithms were executed with a population size of 30 and a maximum of 500 iterations. Simulations were carried out in three distinct dimensions—30, 50, and 100—to assess the efficacy and scalability of the MSO algorithm in resolving optimization problems of different dimensions. Considering the stochastic characteristics of metaheuristic algorithms, each algorithm underwent 30 independent runs to provide a statistically significant performance evaluation. The average value (AVG) and standard deviation (STD) were used as the primary performance indicators, as commonly adopted for assessing algorithm performance [27].
Figure 2, Figure 3 and Figure 4 illustrate the convergence curves of 30 benchmark functions at dimensions 30, 50, and 100. Each curve represents the average convergence behavior over 30 independent runs. In most benchmark functions, the MSO algorithm converges faster than the other compared algorithms and attains superior solutions, highlighting its strong capability to identify global optima. Overall, the convergence curves demonstrate that the MSO algorithm exhibits notable superiority in solving optimization problems.
To further assess robustness and stability, box plots of the optimization results across three dimensions are presented in Figure 5, Figure 6 and Figure 7. These box plots summarize the distribution characteristics of the solutions obtained over 30 independent runs for each benchmark function. For the majority of benchmark functions, the MSO algorithm achieves superior median performance, narrower interquartile ranges, and fewer outliers. These results show that MSO attains higher solution accuracy and exhibits significantly greater robustness and stability compared with alternative algorithms, including the original SO algorithm.
Table 3 reports the detailed numerical comparison results of all algorithms across the 30 benchmark functions under three different dimensions, evaluated using the AVG and STD. These numerical experiments clearly demonstrate that the MSO outperforms the competing algorithms.
Specifically, from the perspective of the average performance, when the dimension is set to 30, the MSO algorithm attained the top performance on 24 benchmark functions and secured second place on the remaining six functions. The HHO and SO algorithms obtained the best performance on one and five benchmark functions, respectively. At a dimension of 50, the MSO algorithm ranked first on 28 functions, while in the remaining two, it ranked second, with the SO algorithm achieving the optimal mean performance. When the dimension increased to 100, the MSO algorithm secured the top mean values on 28 functions, while the MFO and SO algorithms each ranked first on one function. The results indicate that the MSO algorithm shows excellent optimization performance and strong stability across problems of varying dimensionality.
Regarding solution stability, as measured by the standard deviation, when the dimension is set to 30, the MSO algorithm ranked first in 23 benchmark functions, second in five, third in one, and fifth in one, while the standard SO algorithm ranked first in two functions. At a dimension of 50, the MSO algorithm ranked first in 17 functions, whereas the BWO and SO algorithms achieved the best performance in seven and five functions respectively. When the dimensionality increased to 100, the MSO algorithm achieved the lowest standard deviation across 19 test functions, while the SO algorithm achieved it for two functions. The BWO algorithm also demonstrated competitive performance, obtaining the lowest standard deviation for eight functions, and the CPO algorithm ranked first in one benchmark function. These results show that the MSO exhibits remarkable stability and consistency in addressing optimization problems across different dimensions. In summary, when addressing optimization problems across varying dimensions, the MSO algorithm consistently exhibits outstanding stability and reliability.
Table 4 presents the Friedman test results and the corresponding rankings of the MSO compared with nine other algorithms on the CEC2017 benchmark set. The results show that the MSO algorithm consistently achieved superior (lower) ranking values across all three dimensions (30, 50, and 100), ultimately attaining the top average rank. These outcomes highlight the effectiveness of the enhancement strategies introduced in the study. Furthermore, it is evident that the advantages of the MSO algorithm become increasingly pronounced as the problem dimensionality grows, demonstrating its superior optimization capability and scalability.
To statistically validate the performance differences between MSO and the competing algorithms, including SO, the Wilcoxon rank-sum test with a 0.05 significance level was conducted. The detailed results are presented in Table 5, Table 6 and Table 7. A p-value lower than 0.05 implies rejection of the null hypothesis, demonstrating a statistically significant difference in performance.
As indicated in Table 5, Table 6 and Table 7, the MSO algorithm exhibits statistically significant performance differences with respect to the original SO and the other eight algorithms across most test functions. Together with the Friedman test results, these results underscore the distinctive characteristics of MSO in addressing optimization problems.
To evaluate the individual contributions of the three enhancement strategies incorporated in MSO, ablation experiments were conducted. Specifically, the effectiveness and necessity of each strategy were examined by comparing MSO with the original SO and three algorithmic variants, each with one strategy removed.
MSO_A: Dual mapping strategy is removed.MSO_B: Opposition-based learning mechanism is removed.MSO_C: Soft-rime search strategy is removed.
Six representative benchmark functions from the CEC2017 suite (F1, F11, F14, F17, F20, and F22) were selected to evaluate algorithmic performance. These functions represent diverse optimization scenarios with different levels of complexity, thereby enabling a comprehensive assessment of adaptability and robustness. The statistical results are summarized in Table 8, and the corresponding convergence behaviors are depicted in Figure 8.
For these benchmark functions, each variant achieves a certain level of improvement compared with the original SO algorithm. Notably, when all three strategies are jointly incorporated, MSO consistently attains lower mean values and standard deviations than both the individual variants and SO. This observation indicates that MSO delivers superior overall optimization performance, further confirming the synergistic effectiveness of the proposed multi-strategy fusion.
Overall, the results confirm that the MSO algorithm exhibits high efficiency and robustness. It effectively improves population diversity while maintaining superior global and local search capability and more rapid convergence. Moreover, the algorithm effectively avoids premature convergence to local optima and consistently delivers high-quality solutions across a wide range of optimization problems.
In summary, the MSO algorithm demonstrates a significant improvement in optimization performance compared with the original SO. When benchmarked against nine contemporary metaheuristic algorithms on the CEC 2017 test set, MSO consistently obtained superior results across various problems. The comprehensive statistical analyses, including convergence curves, box plots, Friedman rankings, and the Wilcoxon rank-sum test, confirm that MSO achieves superior accuracy and convergence efficiency while maintaining strong stability and robustness, with performance differences that are statistically significant. Furthermore, the ablation experiment demonstrates the effectiveness and synergistic benefits of each improvement strategy. These findings validate that the proposed modifications effectively address the inherent deficiencies of the standard SO framework, making MSO a highly competitive method for addressing complex, high-dimensional optimization challenges. Moreover, the outstanding performance on these theoretical benchmarks provides a solid foundation for extending MSO to real-world engineering design problems.
4.2. Real-World Engineering Design Problems
Real-world engineering design problems present greater challenges to algorithm performance, particularly in terms of stability and robustness. In this study, the proposed MSO algorithm is applied to solve three engineering design problems: pressure vessel design, tension/compression spring design, and hydrostatic thrust bearing design [28,29,30]. All algorithms employed a population size of 30 and 500 iterations, and each algorithm was independently executed 30 times to ensure a fair performance comparison. The definitions and constraints of these engineering problems are as follows:
4.2.1. Pressure Vessel Design
Pressure vessel design can be formulated as a constrained engineering problem involving four variables: shell thickness ( ), head thickness ( ), inner radius ( ), and vessel length ( ). The objective is to minimize the total production cost of the pressure vessel.
The mathematical formulations and constraints of this problem are defined as follows:
Subject to:
As shown in Table 9, the MSO algorithm demonstrates exceptional overperformance by achieving the highest rank in the Friedman test. The worst-case result obtained by MSO was 6.37E+03, while its best-case value reached 6.04E+03. Furthermore, the MSO algorithm achieved the lowest average value of 6.28E+03 and the smallest standard deviation of 1.34E+02, indicating minimal variability, the highest stability and consistency. The DBO algorithm also exhibited competitive performance, but its relatively high standard deviation and average value prevented it from outperforming MSO. Similarly, the original Snake Optimizer produced competitive results but, with a standard deviation of 3.47E+02 (nearly three times that of MSO), ultimately ranked second, reflecting lower stability and consistency compared with the MSO algorithm.
4.2.2. Tension/Compression Spring Design
The main objective of the problem is to minimize the overall weight of a tension or compression spring. The optimization problem involves four constraints and three design variables: wire diameter ( ), average diameter of the spring coil ( ), and total count of active coils ( ). The mathematical formulation and corresponding constraints are presented as follows.
Subject to:
As shown in Table 10, the MSO algorithm once again demonstrates its superiority by achieving the best performance across most evaluation metrics—worst-case, average, median, and standard deviation—and securing the top position in the Friedman ranking. Among the compared algorithms, COA exhibited the most comparable performance, which nonetheless lags behind MSO in all the aforementioned metrics. Although the original algorithm identifies the optimal solution with a slight advantage, its standard deviation is nearly five times larger than that of MSO, indicating severely limited engineering reproducibility, a conclusion further supported by the Friedman test results. In contrast, the MSO algorithm consistently produces stable, high-quality solutions, making it more suitable for practical engineering applications.
Overall, the MSO algorithm significantly enhances stability, robustness and overall performance while maintaining a theoretical optimization ceiling comparable to the original SO algorithm. The statistical analysis confirms its superior comprehensive performance and suitability for real-world engineering applications demanding high robustness.
4.2.3. Hydrostatic Thrust Bearing Design
The primary objective of this problem is to minimize power loss by optimizing four key parameters: oil viscosity ( ), bearing radius ( ), flow rate ( ), and groove radius ( ). The objective function and associated constraints are expressed as follows:
Subject to:
where
As shown in Table 11, the MSO algorithm exhibits outstanding performance and ranks first in the Friedman test. Its maximum, average, median, and standard deviation values all rank among the best, reflecting exceptional accuracy and reliability. The MSO algorithm’s standard deviation of 2.18E+02 indicates minimal variability and excellent consistency in results. The original SO algorithm also exhibits competitive performance in identifying optimal solutions, but it shows higher variability and lower consistency, as evidenced by its second-place ranking in the Friedman test. Despite the DBO algorithm achieving the optimal solution, its standard deviation of 2.12E+08 reveals poor stability and extremely low reproducibility, which limits its applicability to practical engineering problems. The remaining algorithms lag considerably behind MSO across all metrics, displaying significantly higher standard deviations and weaker performance stability. Overall, the remarkable results achieved by MSO in both accuracy and stability confirm its efficiency and reliability in solving engineering design problems.
Overall, the results obtained from the three engineering design problems clearly demonstrate the superior optimization performance of the proposed MSO algorithm. In each case, MSO consistently produced high-quality, stable, and reproducible solutions, outperforming the compared algorithms in terms of convergence speed, solution precision, and robustness. These findings confirm that MSO not only achieves effective global exploration and local exploitation but also maintains strong stability when addressing nonlinear, constrained engineering optimization problems. Consequently, the algorithm shows significant promise for solving practical engineering applications that require both accuracy and reliability. To further validate its effectiveness in handling complex spatial optimization tasks, the MSO algorithm is next applied to two three-dimensional UAV path planning scenarios with different objective functions and constraint conditions.
4.3. Three-Dimensional UAV Path Planning
UAV path planning is a well-established problem in the engineering optimization domain, where the complexity of three-dimensional environments poses significant challenges to algorithmic efficiency and robustness. To address three-dimensional UAV path planning, the study incorporates optimality criteria and cost function constraints tailored to UAV operational requirements. To more comprehensively validate the effectiveness of the MSO algorithm in handling this complex problem, two distinct 3D scenarios are examined, each characterized by different optimization objectives and constraints [31]. In these experiments, each algorithm employs a population size of 30 and 500 iterations, and is independently executed 30 times for a fair performance comparison.
4.3.1. Three-Dimensional UAV Path Planning (Case 1)
For efficient UAV operation, the planned flight path should satisfy the optimality conditions defined by the specific mission requirements. For tasks such as surveying, surface inspection, and aerial photography, the main objective is to optimize the total path distance. The UAV’s trajectory is represented as a sequence of waypoints, and the cost associated with the path length is determined by calculating the Euclidean distance between consecutive waypoints, as defined below:
where, is the flight trajectory, represented as a sequence of waypoints, and is the coordinate of the waypoint in the trajectory.
Beyond minimizing path length, the flight trajectory must also guarantee operational safety by keeping the UAV at a sufficient distance from potential hazards, typically obstacles located within the mission environment. Let represent the collection of all potential obstacles, each represented by a cylindrical model characterized by its center coordinates and radius , as illustrated in Figure 9. For any given path segment , the magnitude of the threat cost depends on the distance between the UAV and the obstacle’s center point . By incorporating the UAV’s body diameter and an additional safety margin surrounding the collision boundary, the cost function is defined as
The UAV’s flight altitude is typically constrained between predefined lower and upper bounds. In some practical applications, such as aerial surveying or search operations, visual data collection using cameras with specific resolutions and fields of view imposes supplementary constraints on the allowable altitude. and are defined as the upper and lower permissible altitude limits, respectively. The corresponding altitude cost of is computed as follows:
where represents the flight altitude relative to the ground, as shown in Figure 10. This equation encourages the UAV to maintain an average height and imposes penalties when deviations from the allowable range. The total altitude cost is obtained by summing the altitude costs across all path points:
Flight smoothness evaluates the UAV’s turning and climbing rates, which are critical for maintaining reliable and stable flight paths. As shown in Figure 11, the turn angle between two path segments, and , is projected onto the horizontal plane (Oxy).
is defined as the unit vector oriented along the z-axis; accordingly, the projection of the vector onto the horizontal plane can be expressed as
Thus, the turn angle is computed as
The climb angle denotes the angle between a path segment and its horizontal projection, expressed as
Thus, the smoothness cost is calculated as
and denote the weights for turn and climb angles, both equal to 1. Based on the four factors, the overall cost of the UAV is formulated as
where denotes the weighting coefficient, and the decision variables, and consists of defined within the unmanned aerial vehicle airspace.
In this study, we set the weights , , and to 5, 1, 10, and 1. The simulation defines the initial position of the UAV as Start = (100, 100, 150) and the destination as End = (800, 800, 150).
Figure 12 visualizes the optimal trajectories obtained by all algorithms. The MSO-derived trajectory maintains an adequate clearance from obstacles and exhibits improved smoothness, resulting in a shorter and safer flight path compared to the alternatives.
As shown in Table 12, the MSO algorithm exhibits superior overall performance and ranks first in the Friedman test. Although its best minimum value (5.09E+03) is not the best among all comparative algorithms, MSO demonstrates the highest consistency across evaluation metrics by achieving the optimal maximum value, mean, median, and standard deviation simultaneously. These results highlight its strong stability and minimal performance variability over 30 independent runs.
Overall, the MSO algorithm clearly outperforms the compared algorithms in both stability and comprehensive optimization capability, making it a more reliable and robust choice for the UAV path planning problem.
4.3.2. Three-Dimensional UAV Path Planning (Case 2)
Using cubic spline interpolation, a smooth curve comprising points is generated. The objective function corresponding to this problem is formulated as follows:
where represents the total cost, denotes the cost corresponding to path length, indicates the cost related to the standard deviation of flight height, and signifies the smoothness cost.
Optimizing the path length is essential for minimizing flight time and operational costs. The mathematical model is expressed as follows:
where represents the three-dimensional position coordinate corresponding to the point of the UAV.
The UAV’s flight altitude plays a crucial role in determining flight stability and operational safety; therefore, it must be carefully considered in the total cost. The altitude-related cost model is defined mathematically as
Finally, the effect of UAV turning maneuvers on flight smoothness must be taken into account, and the corresponding mathematical formula is given as follows:
where denotes .
The obstacle set is defined by the following equation. During flight, the UAV must avoid these obstacles, as illustrated below:
For the total cost function , we set the weights , , and to 0.4, 0.4, and 0.2, respectively, with corresponding start pzzoint S = and end point E = .
Figure 13 illustrates the optimal paths generated by ten different algorithms, demonstrating that the proposed MSO algorithm identifies a shorter and smoother path under the given conditions.
Table 13 presents the statistical analysis results of three-dimensional UAV path planning (case 2). It is evident that the MSO algorithm achieved the best overall performance across all evaluation metrics—maximum, minimum, mean, median, and standard deviation—demonstrating exceptional stability and minimal variability. Moreover, the MSO algorithm ranks first in the Friedman test, further confirming its strong competitiveness, stability, and robustness in solving complex engineering optimization problems.
5. Conclusions
To address the limitations of the original Snake Optimizer (SO)—including insufficient population diversity, weak exploration capability, and a tendency to become trapped in local optima—a Modified Snake Optimizer (MSO) is proposed. First, a dual mapping strategy based on Latin hypercube sampling and logistic mapping is introduced to generate a more uniformly distributed initial population, thereby accelerating convergence. During the exploration phase, an opposition-based learning mechanism with scaling factors is employed to expand the search range and enhance global optimization performance. In the exploitation phase, the soft-rime search strategy from RIME is integrated to strengthen local search ability and effectively prevent premature convergence.
Comprehensive experiments were conducted using 30 benchmark functions from CEC2017 at dimensions of 30, 50, and 100, comparing MSO with nine advanced metaheuristic algorithms, including the original SO. The results consistently illustrate that MSO outperforms other comparative algorithms in terms of convergence speed, overall robustness, and optimization accuracy. To validate the capability to address engineering application problems, the MSO algorithm was applied to three engineering design problems and two UAV path planning scenarios. Across all cases, MSO produced stable, high-quality, and reproducible solutions, highlighting its engineering robustness, practical reliability, and broad applicability.
Overall, the proposed MSO algorithm effectively extends the biomimetic principles of the original SO by improving both search efficiency and solution stability. Owing to its simple structure, outstanding performance, and strong adaptability, MSO represents a practical, biomimetically inspired optimization framework suitable for both theoretical studies and engineering applications. Future research will explore hybridization with other bio-inspired mechanisms and adaptive parameter control to further enhance adaptability and performance in dynamic and multi-objective optimization environments. In addition, in-depth theoretical analysis will be pursued to complement the experimental findings presented in this study.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Fu S. Li K. Huang H. Ma C. Fan Q. Zhu Y. Red-billed blue magpie optimizer: A novel metaheuristic algorithm for 2D/3D UAV path planning and engineering design problems Artif. Intell. Rev.20245713410.1007/s 10462-024-10716-3 · doi ↗
- 2Pan J.S. Hu P. Snášel V. Chu S.C. A survey on binary metaheuristic algorithms and their engineering applications Artif. Intell. Rev.2023566101616710.1007/s 10462-022-10328-936466763 PMC 9684803 · doi ↗ · pubmed ↗
- 3Gong G. Fu S. Huang H. Huang H. Luo X. Multi-strategy improved snake optimizer based on adaptive lévy flight and dual-lens fusion Clust. Comput.20252826810.1007/s 10586-024-04881-x · doi ↗
- 4Li Y. Zhao L. Wang Y. Wen Q. Improved sand cat swarm optimization algorithm for enhancing coverage of wireless sensor networks Measurement 202423311464910.1016/j.measurement.2024.114649 · doi ↗
- 5Yang L. Zhang D. Li L. He Q. Energy efficient cluster-based routing protocol for WSN using multi-strategy fusion snake optimizer and minimum spanning tree Sci. Rep.2024141678610.1038/s 41598-024-66703-939039083 PMC 11263597 · doi ↗ · pubmed ↗
- 6Wolpert D.H. Macready W.G. No free lunch theorems for optimization IEEE Trans. Evol. Comput.19971678210.1109/4235.585893 · doi ↗
- 7Zhong C. Li G. Meng Z. Beluga whale optimization: A novel nature-inspired metaheuristic algorithm Knowl. Based Syst.202225110921510.1016/j.knosys.2022.109215 · doi ↗
- 8Xue J. Shen B. Dung beetle optimizer: A new meta-heuristic algorithm for global optimization J. Supercomput.2023797305733610.1007/s 11227-022-04959-6 · doi ↗
