1 Introduction

For a considerable period, engineering application problems have been widely discussed by people. At present, improving the modern scientific level of engineering construction has become the goal of human continuous struggle, including constrained engineering design problems (Zhang et al. 2022a; Mortazavi 2019) affected by a series of external factors and feature selection problems (Kira and Rendell 1992), and so on. Constrained engineering design problems refers to the problem of achieving optimization objectives and reducing calculation costs under many external constraints, which is widely used in mechanical engineering (Abualigah et al. 2022), electrical engineering (Razmjooy et al. 2021), civil engineering (Kaveh 2017), chemical engineering (Talatahari et al. 2021) and other engineering fields, such as workshop scheduling (Meloni et al. 2004), wind power generation (Lu et al. 2021), and UAV path planning (Belge et al. 2022), parameter extraction of photovoltaic models(Zhang et al. 2022b; Zhao et al. 2022), Optimization of seismic foundation isolation system (Kandemir and Mortazavi 2022), optimal design of RC support foundation system of industrial buildings (Kamal et al. 2023), synchronous optimization of fuel type and external wall insulation performance of intelligent residential buildings (Moloodpoor and Mortazavi 2022), economic optimization of double-tube heaters (Moloodpoor et al. 2021).

Feature selection is the process of choosing specific subsets of features from a larger set based on defined criteria. In this approach, each original feature within the subset is individually evaluated using an assessment function. The aim is to select pertinent features that carry distinctive characteristics. This selection process reduces the dimensionality of the feature space, enhancing the model's generalization ability and accuracy. The ultimate goal is to create the best possible combination of features for the model. By employing feature selection, the influence of irrelevant factors is minimized. This reduction in irrelevant features not only streamlines the computational complexity but also reduces the time costs associated with processing the data. Through this method, redundant and irrelevant features are systematically removed from the model. This refinement improves the model’s accuracy and results in a higher degree of fit, ensuring that the model aligns more closely with the underlying data patterns.

In practical applications of feature selections, models are primarily refined using two main methods: the filter (Cherrington et al. 2019) and wrapper (Jović et al. 2015) techniques. The filter method employs a scoring mechanism to assess and rank the model's features. It selects the subset of features with the highest scores, considering it as the optimal feature combination. On the other hand, the wrapper method integrates the selection process directly into the learning algorithm. It embeds the feature subset evaluation within the learning process, assessing the correlation between the chosen features and the model. In recent years, applications inspired by heuristic algorithms can be seen everywhere in our lives and are closely related to the rapid development of today's society. These algorithms play an indispensable role in solving a myriad of complex engineering problems and feature selection challenges. They have proven particularly effective in addressing spatial, dynamic, and random problems, showcasing significant practical impact and tangible outcomes.

With the rapid development of society and science and technology, through continuous exploitation and exploration in the field of science, more and more complex and difficult to describe multi-dimensional engineering problems also appear in our research process. Navigating these complexities demands profound contemplation and exploration. While traditional heuristic algorithms have proven effective in simpler, foundational problems, they fall short when addressing the novel and intricate multi-dimensional challenges posed by our current scientific landscape and societal needs. Thus, researchers have embarked on a journey of continuous contemplation and experimentation. By cross-combining and validating existing heuristic algorithms, they have ingeniously devised a groundbreaking solution: Metaheuristic Algorithms (MAs) (Yang 2011). This innovative approach aims to tackle the complexities of our evolving problems, ensuring alignment with the rapid pace of social and technological development. MAs is a heuristic function based algorithm. It works by evaluating the current state of the problem and possible solutions to guide the algorithm in making choices in the search space. MAs improves the efficiency and accuracy of the problem solving process by combining multiple heuristic functions and updating the search direction at each step based on their weights. The diversity of MAs makes it a universal problem solver, adapting to the unique challenges presented by different problem domains. Essentially represents a powerful paradigm shift in computational problem solving, providing a powerful approach to address the complexity of modern engineering and scientific challenges. Compared with traditional algorithms, MAs has made great progress in finding optimal solutions, jumping out of local optima, and overcoming convergence difficulties in the later stage of solution through the synergy of different algorithms. These enhancements mark a significant progress, which not only demonstrates the adaptability of the scientific method, but also emphasizes the importance of continuous research and cooperation. It also has the potential to radically solve problems in domains of complex engineering challenges, enabling researchers to navigate complex problem landscapes with greater accuracy and efficiency.

Research shows that MAs are broadly classified into four different research directions: swarm-based, natural evolution-based, human-based, and physics-based. These categories include a wide range of innovative problem-solving approaches, each drawing inspiration from a different aspect of nature, human behavior, or physical principles. Researchers exploration these different pathways to solve complex challenges and optimize the solutions efficiently. First of all, the swarm-based optimization algorithm is the optimization algorithm that uses the wisdom of population survival to solve the problem. For example, Particle Swarm Optimization Algorithm (PSO) (Wang et al. 2018a) is an optimization algorithm based on the group behavior of birds. PSO has a fast search speed and is only used for real-valued processing. However, it is not good at handling discrete optimization problems and has fallen into local optimization. Artificial Bee Colony Optimization Algorithm (ABC) (Jacob and Darney 2021) realizes the sharing and communication of information among individuals when bees collect honey according to their respective division of labor. In the Salp Swarm Algorithm (SSA) (Mirjalili et al. 2017), individual sea squirts are connected end to end and move and prey in a chain, and follow the leader with followers according to a strict “hierarchical” system. Ant Colony Optimization Algorithm (ACO) (Dorigo et al. 2006), ant foraging relies on the accumulation of pheromone on the path, and spontaneously finds the optimal path in an organized manner.

Secondly, a natural evolutionary algorithm inspired by the law of group survival of the fittest, an optimization algorithm that finds the best solution by preserving the characteristics of easy survival and strong individuals, such as: Genetic Programming Algorithm (GP) (Espejo et al. 2009), because biological survival and reproduction have certain natural laws, according to the structure of the tree to deduce certain laws of biological genetic and evolutionary process. Evolutionary Strategy Algorithm (ES) (Beyer and Schwefel 2002), the ability of a species to evolve itself to adapt to the environment, and produce similar but different offspring after mutation and recombination from the parent. Differential Evolution (DE) (Storn and Price 1997) eliminates the poor individuals and retains the good ones in the process of evolution, so that the good ones are constantly approaching the optimal solution. It has a strong global search ability in the initial iteration, but when there are fewer individuals in the population, individuals are difficult to update, and it is easy to fall into the local optimal. The Biogeography-based Optimization Algorithm (BBO) (Simon 2008), influenced by biogeography, filters out the global optimal value through the iteration of the migration and mutation of species information.

Then, Human-based optimization algorithms are optimization algorithms that take advantage of the diverse and complex human social relationships and activities in a specific environment to solve problems, such as: The teaching–learning-based Optimization (TLBO) (Rao and Rao 2016) obtained the optimal solution by simulating the Teaching relationship between students and teachers. It simplifies the information sharing mechanism within each round, and all evolved individuals can converge to the global optimal solution faster, but the algorithm often loses its advantage when solving some optimization problems far from the origin. Coronavirus Mask Protection Algorithm (CMPA) (Yuan et al. 2023), which is mainly inspired by the self-protection process of human against coronavirus, establishes a mathematical model of self-protection behavior and solves the optimization problem. Cultural Evolution Algorithm (CEA) (Kuo and Lin 2013), using the cultural model of system thinking framework for exploitation to achieve the purpose of cultural transformation, get the optimal solution. Volleyball Premier League Algorithm (VPL) (Moghdani and Salimifard 2018) simulates the process of training, competition and interaction of each team in the volleyball game to solve the global optimization problem.

Finally, Physics-based optimization algorithm is an optimization algorithm that uses the basic principles of physics to simulate the physical characteristics of particles in space to solve problems. For example, Snow Ablation Algorithm (SAO) (Deng and Liu 2023), inspired by the physical reaction of snow in nature, realizes the transformation among snow, water and steam by simulating the sublation and ablation of snow. RIME Algorithm (RIME) (Su et al. 2023) is a exploration and exploitation of mathematical model balance algorithm based on the growth process of soft rime and hard rime in nature. Central Force Optimization Algorithm (CFO) (Formato 2007), aiming at the problem of complex calculation of the initial detector, a mathematical model of uniform design is proposed to reduce the calculation time. Sine and cosine algorithm (SCA) (Mirjalili 2016) establishes mathematical models and seeks optimal solutions based on the volatility and periodicity characteristics of sine and cosine functions. Compared with the candidate solution set of a certain scale, the algorithm has a strong search ability and the ability to jump out of the local optimal, but the results of some test functions fluctuate around the optimal solution, and there is a certain precocious situation, and the convergence needs to be improved.

While the original algorithm is proposed, many improved MAs algorithms are also proposed to further improve the optimization performance of the algorithm in practical application problems, such as: Yujun-Zhang et al. combined the arithmetic optimization algorithm (AOA) with the Aquila Optimizer(AO) algorithm to propose a new meta-heuristic algorithm (AOAAO) (Zhang et al. 2022c). CSCAHHO algorithm (Zhang et al. 2022d) is a new algorithm obtained by chaotic mixing of sine and cosine algorithm (SCA) and Harris Hqwk optimization algorithm (HHO). Based on LMRAOA algorithm proposed to solve numerical and engineering problems (Zhang et al. 2022e). Yunpeng Ma et al. proposed an improved teaching-based optimization algorithm to artificially reduce NOx emission concentration in circulating fluidized bed boilers (Ma et al. 2021). The improved algorithm SOS(MSOS) (Kumar et al. 2019), based on the natural Symbiotic search (SOS) algorithm, improves the search efficiency of the algorithm by introducing adaptive return factors and modified parasitic vectors. Modified beluga whale optimization with multi-strategies for solving engineering problems (MBWO) (Jia et al. 2023a) by gathering Beluga populations for feeding and finding new habitats during long-distance migration. Betul Sultan Yh-ld-z et al. proposed a novel hybrid optimizer named AO-NM, which aims to optimize engineering design and manufacturing problems (Yıldız et al. 2023).

The Crayfish Optimization Algorithm (COA) (Jia et al. 2023b) is a novel metaheuristic algorithm rooted in the concept of population survival wisdom, introduced by Heming Jia et al. in 2023. Drawing inspiration from crayfish behavior, including heat avoidance, competition for caves, and foraging, COA employs a dual-stage strategy. During the exploration stage, it replicates crayfish searching for caves in space for shelter, while the exploitation stage mimics their competition for caves and search for food. Crayfish, naturally averse to dry heat, thrive in freshwater habitats. To simulate their behavior and address challenges related to high temperatures and food scarcity, COA incorporates temperature variations into its simulation. By replicating crayfish habits, the algorithm dynamically adapts to environmental factors, ensuring robust problem-solving capabilities. Based on temperature fluctuations, crayfish autonomously select activities such as seeking shelter, competing for caves, and foraging. When the temperature exceeds 30°C, crayfish instinctively seek refuge in cool, damp caves to escape the heat. If another crayfish is already present in the cave, a competition ensues for occupancy. Conversely, when the temperature drops below 30°C, crayfish enter the foraging stage. During this phase, they make decisions about food consumption based on the size of the available food items. COA achieves algorithmic transformation between exploration and exploitation stages by leveraging temperature variations, aiming to balance the exploration and exploitation capabilities of the algorithm. However, COA solely emulates the impact of temperature on crayfish behavior, overlooking other significant crayfish habits, leading to inherent limitations. In the latter stages of global search, crayfish might cluster around local optimum positions, restricting movement. This hampers the crayfish's search behavior, slowing down convergence speed, and increasing the risk of falling into local optima, thereby making it challenging to find the optimal solution.

In response to the aforementioned challenges, this paper proposes a Modified Crayfish Optimization Algorithm (MCOA). MCOA introduces an environmental update mechanism inspired by crayfish's preference for living in fresh flowing water. MCOA incorporates crayfish's innate perception abilities to assess the quality of the surrounding aquatic environment, determining whether the current habitat is suitable for survival. The simulation of crayfish crawling upstream to find a more suitable aquatic environment is achieved by utilizing adaptive flow factors and leveraging the crayfish's second, third foot perceptions to determine the direction of water flow.This method partially replicates the survival and reproduction behavior of crayfish, ensuring the continual movement of the population. It heightens the randomness within the group, widens the search scope for crayfish, enhances the algorithm's exploration efficiency, and effectively strengthens the algorithm’s global optimization capabilities. Additionally, the ghost opposition-based learning strategy (Jia et al. 2023c) is implemented to introduce random population initialization when the algorithm becomes trapped in local optima. This enhancement significantly improves the algorithm's capability to escape local optima, promoting better exploration of the solution space. After the careful integration of the aforementioned two strategies, the search efficiency and predation speed of the crayfish algorithm experience a substantial improvement. Moreover, the algorithm's convergence rate and global optimization ability are significantly enhanced, leading to more effective and efficient problem-solving capabilities.

In the experimental section, we conducted a comprehensive comparison between MCOA and nine other metaheuristic algorithms. We utilized the IEEE CEC2020 benchmark function to evaluate the performance of the algorithm. The evaluation involved statistical methods such as the Wilcoxon rank sum test and Friedman test to rank the averages, validating the efficiency of the MCOA algorithm and the effectiveness of the proposed improvements. Furthermore, MCOA was applied to address four constrained engineering design problems as well as the high-dimensional feature selection problem using the wrapper method. These practical applications demonstrated the practicality and effectiveness of MCOA in solving real-world engineering problems.

The main contributions of this paper are as follows:

  • In the environmental renewal mechanism, the water quality factor and roulette wheel selection method are introduced to simulate the process of crayfish searching for a more suitable water environment for survival.

  • The introduction of the ghost opposition-based learning strategy enhances the randomness of crayfish update locations, effectively preventing the algorithm from getting trapped in local optima, and improving the overall global optimization performance of the algorithm.

  • The fixed value of food intake is adaptively adjusted based on the number of evaluations, enhancing the algorithm's capacity to escape local optima. This adaptive change ensures a more dynamic exploration of the solution space, improving the algorithm's overall optimization effectiveness.

  • The MCOA’s performance is compared with nine metaheuristics, including COA, using the IEEE CEC2020 benchmark function. The comparison employs the Wilcoxon rank sum test and Friedman test to rank the averages, providing evidence for the efficiency of MCOA and the effectiveness of the proposed improvements.

  • The application of MCOA to address four constrained engineering design problems and the high-dimensional feature selection problem using the wrapper method demonstrates the practicality and effectiveness of MCOA in real-world applications.

The main structure of this paper is as follows, the first part of the paper serves as a brief introduction to the entire document, providing an overview of the topics and themes that will be covered. In the second part, the paper provides a comprehensive summary of the Crayfish Optimization Algorithm (COA). In the third part, a modified crawfish optimization algorithm (MCOA) is proposed. By adding environment updating mechanism and ghost opposition-based learning strategy, MCOA can enhance the global search ability and convergence speed to some extent. Section four shows the experimental results and analysis of MCOA in IEEE CEC2020 benchmark functions. The fifth part applies MCOA to four kinds of constrained engineering design problems. In Section six, MCOA is applied to the high-dimensional feature selection problem of wrapper methods to demonstrate the effectiveness of MCOA in practical application problems. Finally, Section seven concludes the paper.

2 Crayfish optimization algorithm (COA)

Crayfish is a kind of crustaceans living in fresh water, its scientific name is crayfish, also called red crayfish or freshwater crayfish, because of its food, fast growth rate, rapid migration, strong adaptability and the formation of absolute advantages in the ecological environment. Changes in temperature often cause changes in crayfish behavior. When the temperature is too high, crayfish choose to enter the cave to avoid the damage of high temperature, and when the temperature is suitable, they will choose to climb out of the cave to forage. According to the living habits of crayfish, it is proposed that the three stages of summer, competition for caves and going out to forage correspond to the three living habits of crayfish, respectively.

Crayfish belong to ectotherms and are affected by temperature to produce behavioral differences, which range from 20 °C to 35 °C. The temperature is calculated as follows:

$$temp = rand \times 15 + 20$$
(1)

where temp represents the temperature of the crayfish's environment.

2.1 Initializing the population

In the d-dimensional optimization problem of COA, each crayfish is a 1 × d matrix representing the solution of the problem. In a set of variables (X1, X2, X3…… Xd), the position (X) of each crayfish is between the upper boundary (ub) and lower boundary (lb) of the search space. In each evaluation of the algorithm, an optimal solution is calculated, and the solutions calculated in each evaluation are compared, and the optimal solution is found and stored as the optimal solution of the whole problem. The position to initialize the crayfish population is calculated using the following formula.

$$X_{i,j} = lb_j + (ub_j - lb_j ) \times rand$$
(2)

where Xi,j denotes the position of the i-th crayfish in the j-th dimension, ubj denotes the upper bound of the j-th dimension, lbj denotes the lower bound of the j-th dimension, and rand is a random number from 0 to 1.

2.2 Summer escape stage (exploration stage)

In this paper, the temperature of 30 °C is assumed to be the dividing line to judge whether the current living environment is in a high temperature environment. When the temperature is greater than 30 ℃ and it is in the summer, in order to avoid the harm caused by the high temperature environment, crayfish will look for a cool and moist cave and enter the summer to avoid the influence of high temperature. The caverns are calculated as follows.

$$X_{shade} = (X_G + X_L )/2$$
(3)

where XG represents the optimal position obtained so far for this evaluation number, and XL represents the optimal position of the current population.

The behavior of crayfish competing for the cave is a random event. To simulate the random event of crayfish competing for the cave, a random number rand is defined, when rand < 0.5 means that there are no other crayfish currently competing for the cave, and the crayfish will go straight into the cave for the summer. At this point, the crayfish position update calculation formula is as follows.

$$Xnew = X_{i,j}^{\,} + C_2 \times rand \times (X_{shade} - X_{i,j}^{\,} )$$
(4)

Here, Xnew is the next generation position after location update, and C2 is a decreasing curve. C2 is calculated as follows.

$$C_2 = 2 - (FEs/MaxFEs)$$
(5)

Here, FEs represents the number of evaluations and MaxFEs represents the maximum number of evaluations.

2.3 Competition stage (exploitation stage)

When the temperature is greater than 30 °C and rand ≥ 0.5, it indicates that the crayfish have other crayfish competing with them for the cave when they search for the cave for summer. At this point, the two crayfish will struggle against the cave, and crayfish Xi adjusts its position according to the position of the other crayfish Xz. The adjustment position is calculated as follows.

$$Xnew = X_{i,j}^{\,} - X_{z,j}^{\,} + X_{shade}$$
(6)

Here, z represents the random individual of the crayfish, and the random individual calculation formula is as follows.

$$z = round(rand \times (N - 1)) + 1$$
(7)

where, N is the population size.

2.4 Foraging stage (exploitation stage)

The foraging behavior of crayfish is affected by temperature, and temperature less than or equal to 30 ℃ is an important condition for crayfish to climb out of the cave to find food. When the temperature is less than or equal to 30 °C, the crayfish will drill out of the cave and judge the location of the food according to the optimal location obtained in this evaluation, so as to find the food to complete the foraging. The position of the food is calculated as follows.

$$X_{food} = X_G$$
(8)

The amount of food crayfish eat depends on the temperature. When the temperature is between 20 °C and 30°C, crayfish have strong foraging behavior, and the most food is found and the maximum food intake is also obtained at 25 °C. Thus, the food intake pattern of crayfish resembles a normal distribution. Food intake was calculated as follows.

$$p=C_{1}\times\frac{1}{\sqrt{2\times\pi}\times\sigma}\times\exp(-\frac{(temp-\mu)^{2}}{2\sigma^{2}})$$
(9)

Here, µ is the most suitable temperature for crayfish feeding, and σ and C1 are the parameters used to control the variation of crayfish intake at different temperatures.

The food crayfish get depends not only on the amount of food they eat, but also on the size of the food. If the food is too large, the crayfish can't eat the food directly. They need to tear it up with their claws before eating the food. The size of the food is calculated as follows.

$$Q = C_3 \times rand \times (fitness_i /fitness_{food} )$$
(10)

Here, C3 is the food factor, which represents the largest food, and its value is 3, fitnessi represents the fitness value of the i-th crayfish, and fitnessfood represents the fitness value of the location of the food.

Crayfish use the value of the maximum food Q to judge the size of the food obtained and thus decide the feeding method. When Q > (C3 + 1)/2, it means that the food is too large for the crayfish to eat directly, and it needs to tear the food with its claws and eat alternately with the second and third legs. The formula for shredding food is as follows.

$$X_{food} = \exp\, \bigg( - \frac{1}{Q}\bigg) \times X_{food}$$
(11)

After the food is shredded into a size that is easy to eat, the second and third claws are used to pick up the food and put it into the mouth alternately. In order to simulate the process of bipedal eating, the mathematical models of sine function and cosine function are used to simulate the crayfish eating alternately. The formula for crayfish alternating feeding is as follows.

$$X_{new} = X_{_{i,j} }^{\,} + X_{food} \times p \times (\cos (2 \times \pi \times rand) - \sin (2 \times \pi \times rand))$$
(12)

When Q ≤ (C3 + 1)/2, it indicates that the food size is suitable for the crayfish to eat directly at this time, and the crayfish will directly move towards the food location and eat directly. The formula for direct crayfish feeding is as follows.

$$X_{new} = (X_{i,j}^{\,} - X_{food} ) \times p + p \times rand \times X_{i,j}^{\,}$$
(13)

2.5 Pseudo-code for COA

Algorithm 1
figure b

Crayfish optimization algorithm pseudo-code

3 Modified crayfish optimization algorithm (MCOA)

Based on crayfish optimization algorithm, we propose a high-dimensional feature selection problem solving algorithm (MCOA) based on improved crayfish optimization algorithm. In MCOA, we know that the quality of the aquatic environment has a great impact on the survival of crayfish, according to the living habits of crayfish, which mostly feed on plants and like fresh water. Oxygen is an indispensable energy for all plants and animals to maintain life, the higher the content of dissolved oxygen in the water body, the more vigorous the feeding of crayfish, the faster the growth, the less disease, and the faster the water flow in the place of better oxygen permeability, more aquatic plants, suitable for survival, so crayfish has a strong hydrotaxis. When crayfish perceive that the current environment is too dry and hot or lack of food, they crawl backward according to their second, third and foot perception (r) to judge the direction of water flow, and find an aquatic environment with sufficient oxygen and food to sustain life. Good aquatic environment has sufficient oxygen and abundant aquatic plants, to a certain extent, to ensure the survival and reproduction of crayfish.

In addition, we introduce ghost opposition-based learning to help MCOA escape the local optimal trap. The ghost opposition-based learning strategy combines the candidate individual, the current individual and the optimal individual to randomly generate a new candidate position to replace the previous poor candidate position, and then takes the best point or the candidate solution as the central point, and then carries out more specific and extensive exploration of other positions. Traditional opposition-based learning (Mahdavi et al. 2018) is based on the central point and carries out opposition-based learning in a fixed format. Most of the points gather near the central point and their positions will not exceed the distance between the current point and the central point, and most solutions will be close to the optimal individual. However, if the optimal individual is not near the current exploration point, the algorithm will fall into local optimal and it is difficult to find the optimal solution. Compared with traditional opposition-based learning, ghost opposition-based learning is a opposition-based learning solution that can be dynamically changed by adjusting the size of parameter k, thereby expanding the algorithm's exploration range of space, effectively solving the problem that the optimal solution is not within the search range based on the center point, and making the algorithm easy to jump out of the local optimal.

According to the life habits of crayfish, this paper proposes a Modified Crayfish Optimization Algorithm (MCOA), which uses environment update mechanism and ghost opposition-based learning strategy to improve COA, and shows the implementation steps, pseudo-code and flow chart of MCOA algorithm as follows.

3.1 Environment update mechanism

In the environmental renewal mechanism, a water quality factor V is introduced to represent the quality of the aquatic environment at the current location. In order to simplify the design and computational complexity of the system, the water quality factor V of the MCOA is represented by a hierarchical discretization, and its value range is set to 0 to 5. Crayfish perceive the quality of the current aquatic environment through the perception (r) of the second and third legs, judge whether the current living environment can continue to survive through the perception, and independently choose whether to update the current location. The location update is calculated as follows.

$$X_{new}=X_{2}+(X_{1}-X_{i,j})\times\cos(\theta)\times B\times V\times rand+X_{1}\times\sin(\theta)\times B\times rand$$
(14)

Among them, each crayfish has a certain difference in its own perception of water environment r, X2 is a random position between the candidate optimal position and the current position, which is calculated by Eq. (15), X1 is a random position in the population, and B is an adaptive water flow factor, which is calculated by Eq. (16).

$$X2 = (Xbest - X_{i,j}^{\,} ) \times r$$
(15)
$$B = c \times \cos\, \bigg(\frac{\pi }{2} \times \bigg(1 - \frac{FEs}{{MaxFEs}}\bigg)\bigg)$$
(16)

Among them, the sensing force r of the crayfish’s second and third legs is a random number [0,1]. c is a constant that represents the water flow velocity factor with a value of 2. When V ≤ 3, it indicates that the crayfish perceives the quality of the current living environment to be good and is suitable for continued survival. When V > 3, it indicates that the crayfish perceives that the current living environment quality is poor, and it needs to crawl in the opposite direction according to the direction of water flow that crayfish perceives, so as to find an aquatic environment with sufficient oxygen and abundant food Fig. 1.

Fig. 1
figure 1

Classification of MAs

In the environmental updating mechanism, in order to describe the behavior of crayfish upstream in more detail, the perception area of crayfish itself is abstractly defined as a circle in MCOA, and crayfish is in the center of the circle. In each evaluation calculation, a random Angle θ is first calculated by the roulette wheel selection algorithm to determine the moving direction of the crayfish in the circular area, and then the moving path of the crayfish is determined according to the current moving direction. In the whole circle, random angles can be chosen from 0 to 360 degrees, from which the value of θ can be determined to be of magnitude [− 1,1]. The difference of random Angle indicates that each crayfish moves its position in a random direction, which broadens the search range of crayfish, enhances the randomness of position and the ability to escape from local optimum, and avoids local convergence Fig. 2.

Fig. 2
figure 2

Schematic diagram of the environment update mechanism

3.2 Ghost opposition-based learning strategy

The ghost opposition-based learning strategy takes a two-dimensional space as an example. It is assumed that there is a two-dimensional space, as shown in Fig. 3. On the X-axis, [ub, lb] represents the search range of the solution, and the ghost generation method is shown in Fig. 3. Assuming that the position of a new candidate solution is Xnew and the height of the solution is h1 i, the position of the best solution on the X-axis is the projected position of the candidate solution, and the position and height are XG, h2 i, respectively. In addition, on the X-axis there is a projection position Xi of the candidate solution with a height of h3 i.Thus, the position of the ghost is obtained. The projection position of the ghost on the X-axis is xi by vector calculation, and its height is hi. The ghost position is calculated using the following formula.

$$x_{i} = X_{newi} - X_{i} + XG$$
(17)
Fig. 3
figure 3

Schematic diagram of ghost opposition-based learning strategy

In Fig. 3, the Y-axis represents the convex lens. Suppose there is a ghost position Pi, where xi is its projection on the X-axis and hi is its height. P* i is the real image obtained by convex lens imaging. P* i is projected on the X-axis as x* i and has height h* i. Therefore, the opposite individual x* i of individual xi can be obtained. x* i is the corresponding point corresponding to the ghost individual xi obtained from O as the base point. According to the lens imaging principle, we can obtain Eq. (18), and the calculation formula is as follows.

$$k_i = \frac{h_i }{{h_i^\ast }} = \frac{{\left( {ub + lb} \right)/2 - x_i }}{{x_i^\ast - \left( {ub + lb} \right)/2}},$$
(18)

The strategy formula of ghost opposition-based learning is evolved from Eq. (18). The strategy formula of ghost opposition-based learning is calculated as follows.

$$X_i^* = \frac{ub + lb}{2} + \frac{ub + lb}{{2k}} - \frac{X_{i}}{k}$$
(19)
$$k = (1 + \left( {t/T} \right)^{0.5} )^{10}$$
(20)

3.3 Implementation of MCOA algorithm

3.3.1 Initialization phase

Initialize the population size N, the population dimension d, and the number of evaluations FEs. The initialized population is shown in Eq. (2).

3.3.2 Environment update mechanism

Crayfish judge the quality of the current aquatic environment according to the water quality factor V, and speculate whether the current aquatic environment can continue to survive. When V > 3 indicates that the crawfish perceives the quality of the current aquatic environment as poor and is not suitable for survival. According to the sensory information of the second and third legs and the adaptive flow factor, the crawfish judges the direction of the current flow, and then moves upstream to find a better aquatic environment to update the current position. The position update formula is shown in Eq. (14). When V < 3, it means that the crayfish has a good perception of the current living environment and is suitable for survival, and does not need to update its position.

3.3.3 Exploration phase

When the temperature is greater than 30 ℃ and V > 3, it indicates that crayfish perceive the current aquatic environment quality is poor, and the cave is dry and without moisture, which cannot achieve the effect of summer vacation. It is necessary to first update the position by crawling in the reverse direction according to the flow direction, and find a cool and moist cave in a better quality aquatic environment for summer.

3.3.4 Exploitation stage

When the temperature is less than 30 ℃ and V > 3, it indicates that crayfish perceive the current aquatic environment is poor, and there is not enough food to maintain the survival of crayfish. It is necessary to escape from the current food shortage living environment by crawling in the reverse direction according to the current direction, and find a better aquatic environment to maintain the survival and reproduction of crayfish.

3.3.5 Ghost opposition-based learning strategy

Through the combination of the candidate individual, the current individual and the optimal individual, a candidate solution is randomly generated and compared with the current solution, the better individual solution is retained, the opposite individual is obtained, and the location of the ghost is obtained. The combination of multiple positions effectively prevents the algorithm from falling into local optimum, and the specific implementation formula is shown in Eq. (19).

3.3.6 Update the location

The position of the update is determined by comparing the fitness values. If the fitness of the current individual update is better, the current individual replaces the original individual. If the fitness of the original individual is better, the original individual is retained to exist as the optimal solution.

The pseudocode for MCOA is as follows (Algorithm 2).

Algorithm 2
figure c

Modified Crayfish optimization algorithm pseudo-code

The flow chart of the MCOA algorithm is as follows.

3.4 Computational complexity analysis

The complexity analysis of algorithms is an essential step to evaluate the performance of algorithms. In the experiment of complexity analysis of the algorithm, we choose the IEEE CEC2020 Special Session and Competition as the complexity evaluation standard of the single objective optimization algorithm. The complexity of MCOA algorithm mainly depends on several important parameters, such as the population size (N = 30), the number of dimensions of the problem (d = 10), the maximum number of evaluations of the algorithm (MaxFEs = 100,000) and the solution function (C). Firstly, the running time of the test program is calculated and the running time (T0) of the test program is recorded, and the test program is shown in Algorithm 3. Secondly, under the same dimension of calculating the running time of the test program, the 10 test functions in the IEEE CEC2020 function set were evaluated 100,000 times, and their running time (T1) was recorded. Finally, the running time of 100,000 evaluations of 10 test functions performed by MCOA for 5 times under the same dimension was recorded, and the average value was taken as the running time of the algorithm (T2). Therefore, the formula for calculating the time complexity of MCOA algorithm is given in Eq. (21).

$$O(MCOA) = \frac{T2 - T1}{{T0}}$$
(21)
Algorithm 3
figure d

IEEE CEC2020 complexity analysis test program

The experimental data table of algorithm complexity analysis is shown in Table 1. In the complexity analysis of the algorithm, we use the method of comparing MCOA algorithm with other seven metaheuristic algorithms to illustrate the complexity of MCOA. In Table 1, we can see that the complexity of MCOA is much lower than other comparison algorithms such as ROA, STOA, and AOA. However, compared with COA, the complexity of MCOA is slightly higher than that of COA because it takes a certain amount of time to update the location through the environment update mechanism and ghost opposition-based learning strategy. Although the improved strategy of MCOA increases the computation time to a certain extent, the optimization performance of MOCA has been significantly improved through a variety of experiments in section four of this paper, which proves the good effect of the improved strategy.

Table 1 Complexity analysis results of the eight algorithms

4 Experimental results and discussion

The experiments are carried out on a 2.50 GHz 11th Gen Intel(R) Core(TM) i7-11,700 CPU with 16 GB memory and 64-bit Windows11 operating system using Matlab R2021a. In order to verify the performance of MCOA algorithm, MCOA is compared with nine metaheuristic algorithms in this subsection. In the experiments, we used the IEEE CEC2020 test function to evaluate the optimization performance of the MCOA algorithm Fig. 4.

Fig. 4
figure 4

Flow chart of the MCOA algorithm

4.1 Experiments with IEEE CEC2020 test functions

In this subsection, using the Crayfish Optimization Algorithm (COA), Remora Optimization Algorithm (ROA) (Jia et al. 2021), Sooty Tern Optimization Algorithm (STOA) (Dhiman and Kaur 2019), Arithmetic Optimization Algorithm (AOA) (Abualigah et al. 2021), Harris Hawk Optimization Algorithm (HHO) (Heidari et al. 2019), Prairie Dog Optimization Algorithm (PDO) (Ezugwu et al. 2022), Genetic Algorithm (GA) (Mirjalili and Mirjalili 2019),Modified Sand Cat Swarm Optimization Algorithm (MSCSO) (Wu et al. 2022) and a competition algorithm LSHADE (Piotrowski 2018) were compared to verify the optimization effect of MCOA. The parameter Settings of each algorithm are shown in Table 2.

Table 2 Parameter Settings of the algorithm

In order to test the performance of MCOA, this paper selects 10 benchmark test functions of IEEE CEC2020 for simulation experiments. Where F1 is a unimodal function, F2–F3 is a multimodal function, F4 is a non-peak function, F5–F7 is a hybrid function, and F8-F10 is a composite function. The parameters of this experiment are uniformly set as follows: the maximum number of evaluation MaxFEs is 100,000, the population size N is 30, and the dimension size d is 10. The MCOA algorithm and the other nine algorithms are run independently for 30 times, and the average fitness value, standard deviation of fitness value and Friedman ranking calculation of each algorithm are obtained. The specific function Settings of the IEEE CEC2020 benchmark functions are shown in Table 3.

Table 3 Specific function Settings of IEEE CEC2020 benchmark functions

4.1.1 Results statistics and convergence curve analysis of IEEE CEC2020 benchmark functions

In order to more clearly and intuitively compare the ability of MCOA and various algorithms to find individual optimal solutions, the average fitness value, standard deviation of fitness value and Friedman ranking obtained by running MCOA and other comparison algorithms independently for 30 times are presented in the form of tables and images. The data and images are shown in Table 4 and Fig. 5 respectively.

Table 4 Experimental results of each algorithm in IEEE CEC2020 (optimal data are marked in bold)
Fig. 5
figure 5

Convergence curve of MCOA algorithm in IEEE CEC2020

In Table 4, mean represents the average fitness value, std represents the standard deviation of fitness value, rank represents the Friedman ranking, Friedman average rank represents the average ranking of the algorithm among all functions, and Friedman rank represents the final ranking of this algorithm. Compared with other algorithms, MCOA achieved the best results in average fitness value, standard deviation of fitness value and Friedman ranking. In unimodal function F1, although MCOA algorithm is slightly worse than LSHADE algorithm, MCOA is superior to other algorithms in mean fitness value, standard deviation of fitness value, Friedman ranking and other aspects. In the multimodal functions F2 and F3, although the average fitness value of MCOA is slightly worse, it also achieves a good result of ranking second. The standard deviation of fitness value in F3 is better than other comparison algorithms in terms of stability. In the peakless function F4, except GA and LSHADE algorithm, other algorithms can find the optimal individual solution stably. In the mixed functions F5, F6, and F7, although the mean fitness value of LSHADE is better than that of MCOA, the standard deviation of the fitness value of MCOA is better than that of the other algorithms compared. Among the composite functions of F8, F9 and F10, the standard deviation of MCOA's fitness value at F8 is slightly worse than that of LSHADE, but the average fitness value and standard deviation of fitness value are the best in other composite functions, and it has achieved the first place in all composite functions. Finally, from the perspective of Friedman average rank, MCOA has a strong comprehensive performance and still ranks first. Through the analysis of the data in Table 4, it can be seen that MCOA ranks first overall and has good optimization effect, and its optimization performance is better than other 9 comparison algorithms.

Figure 5 shows that in the IEEE CEC2020 benchmark functions, for the unimodal function F1, although LSHADE algorithm has a better optimization effect, compared with similar meta-heuristic algorithms, MCOA has a slower convergence rate in the early stage, but can be separated from local optimal and converge quickly in the middle stage. In the multimodal functions F2 and F3, similar to F1, MCOA converges faster in the middle and late stages, effectively exiting the local optimal. Although the convergence speed is slower than that of LSHADE, the optimal value can still be found. In the peak-free function F4, the optimal value can be found faster by all algorithms except LSHADE, STOA and PDO because the function is easy to implement. In the mixed functions F5, F6 and F7, although the convergence rate of MCOA is slightly slower than that of COA algorithm in the early stage, it can still find better values than the other eight algorithms except LSHADE in the later stage. For the composite functions F8, F9 and F10, MCOA can find the optimal value faster than the other nine algorithms.

Based on the above, although LSHADE has a stronger ability to find the optimal value in a small number of functions, MCOA can still find the optimal value in most functions in the later stage, and compared with the other eight pair algorithms of the same type, MCOA has more obvious enhancement in optimization ability and avoidance of local optimization, and has better application effect.

4.1.2 Analysis of Wilcoxon rank sum test results

In the comparison experiment, the different effects of multiple algorithms solving the same problem are used to judge whether each algorithm has high efficiency and more obvious influence on solving the current problem, such as the convergence speed of the convergence curve, the fitness value of the optimal solution, the ability to jump out of the local optimum, etc. At present, only the average fitness value, the standard deviation of fitness value and the convergence curve can not be used as the basis for judging whether the performance of the algorithm is efficient. Therefore, the data and images presented by each algorithm in solving the current problem are comprehensively analyzed, and the Wilcoxon rank sum test is used to further verify the difference between MCOA and the other nine comparison algorithms. In this experiment, the significance level is defined as 5%. If its calculated value is less than 5%, it proves that there is a significant difference between the two algorithms, and if it is greater than 5%, it proves that there is no significant difference between the two algorithms. Table 5 shows the Wilcoxon rank-sum test results of the MCOA algorithm and the other nine comparison algorithms. Where the symbols “ + ”, “−” and “ = ” table the performance of MCOA better, worse and equal to the comparison algorithms, respectively.

Table 5 Wilcoxon rank-sum test results for IEEE CEC2020 test functions

In the calculation of the function F4 without peak, the value of 1 appears in the comparison of various algorithms such as MCOA, COA, ROA, STOA and other algorithms, indicating that in this function, a variety of algorithms have found the optimal value, there is no obvious difference, which can be ignored. However, in most of the remaining functions, the significance level of MCOA compared with the other nine algorithms is less than 5%, which is a significant difference.

From the overall table, the MCOA algorithm also achieves good results in the Wilcoxon rank-sum test of the IEEE CEC2020 benchmark function, and the contrast ratio with other algorithms is less than 5%, which proves that the MCOA algorithm has a significant difference from the other nine algorithms, and MCOA has better optimization performance. According to the comparison results with the original algorithm, it is proved that MCOA algorithm has a good improvement effect.

4.2 Comparison experiment of single strategy

MCOA adopts two strategies, environment update mechanism and ghost opposition-based learning strategy, to improve COA. In order to prove the effectiveness of these two strategies for algorithm performance optimization, a single strategy comparison experiment is added in this section. In the experiment in this section, EUCOA algorithm which only adds environment update mechanism and GOBLCOA algorithm which only adds ghost opposition-based learning strategy are compared with the basic COA algorithm. The experiments are independently run 30 times in IEEE CEC2020 benchmark test function, and the statistical data obtained are shown in Table 6. In order to make the table easy to view the statistical results, the poor data in the table will be bolded to make the statistical results more clear and intuitive. It can be seen from the table that among the best fitness values, average fitness values and standard deviation of fitness values of the 10 test functions, GOBLCOA and EUCOA account for less bolded data, while most data of the original algorithm COA are bolded in the table, which effectively proves that both the environment update mechanism and the ghost opposition-based learning strategy play a certain role in COA. The comprehensive performance of COA has been significantly improved.

Table 6 Comparison results of single strategies (worst data are marked in bold)

4.3 Parameter sensitivity analysis of water flow velocity factor c

In order to better prove the influence of flow velocity coefficient on MCOA, we choose different flow velocity coefficient c values for comparison experiments. Table 7 shows the statistical results of 30 independent runs of different water flow velocity coefficients in CEC2020. The bold sections represent the best results. As can be seen from the table, the result obtained by c = 2 is significantly better than the other values. Only in individual test functions are the results slightly worse. In the F1 function, c = 5 has the best std. In the F5 function, std is best at c = 6. Among F10 functions, c = 5 has the best std. Among the other test functions, both the mean fitness value and std at water flow velocity factor c = 2 are optimal. Through the above analysis, it is proved that the water flow velocity factor c = 2 has a good optimization effect.

Table 7 Comparison of different water flow velocity factor of CEC2020 (optimal data are marked in bold)

4.4 Experimental summary

In this section, we first test MCOA's optimization performance on the IEEE CEC2020 benchmark function. The improved MCOA is compared with the original algorithm COA and six other meta-heuristic algorithms in the same environment and the experimental analysis is carried out. Secondly, the rank sum test is used to verify whether there are significant differences between MCOA and the other nine comparison algorithms. Finally, three algorithms, EUCOA with environment update mechanism, GOBLCOA with ghost opposition-based learning strategy, COA and MCOA, are tested to improve performance. These three experimental results show that MCOA has a good ability to find optimal solutions and get rid of local optimal solutions.

5 Constrained engineering design problems

With the new development of the era of big data, the solution process becomes complicated and the calculation results become accurate, and more and more people pay close attention to the dynamic development of the feasibility and practicality of the algorithm, so as to ensure that the algorithm has good practical performance on constrained engineering design problems. In order to verify the optimization effect of MCOA in practical applications, four constrained engineering design problems are selected for application testing of MCOA to evaluate the performance of MCOA in solving practical application problems. Every constrained engineering design problems has a minimization objective function (Papaioannou and Koulocheris 2018) that is used to calculate the fitness value for a given problem. In addition, each problem contains a varying number of constraints that are taken into account during the calculation of the objective function. If the constraints are not met, the penalty function (Yeniay 2005) is used to adjust the fitness value. However, the processing of constraints is not the focus of our research, our focus is on the optimization of parameters in a convex region composed of constraints (Liu and Lu 2014). In order to ensure the fairness of the experiment, the parameters of all experiments in this section are set as follows: the maximum evaluation time MaxFEs is 10,000 and the overall scale N is 30. In each experiment, all the algorithms were analyzed 500 times and the optimal results were obtained.

5.1 Multi-disc clutch braking problem

In the field of vehicle engineering, there is a common constrained engineering design problems multi-disc clutch braking problem, and the purpose of our algorithm is to minimize the mass of the multi-disc clutch by optimizing eight constraints and five variables, so as to improve the performance of the multi-disc clutch. Among them, the five variables are: inner diameter ri, outer diameter ro, brake disc thickness t, driving force F, and surface friction coefficient Z. The specific structure of the multi-disc clutch is shown in Fig. 6.

Fig. 6
figure 6

Schematic diagram of the multi-disc clutch braking problem

The mathematical formulation of the multi-disc clutch braking problem is as follows.

Consider:

$$x = \left[ {x_1 \ \ \ x_2 \ \ \ x_3 \ \ \ x_4 \ \ x_5 } \right] = \left[ {r_i \ \ \ r_o \ \ \ \ t\ \ F\ \ Z} \right]$$
(22)

Objective function:

$$f\left( x \right) = {\text{II}}\left( {r_o^2 - r_i^2 } \right)t\left( {Z + 1} \right)\rho (\rho = 0.0000078)$$
(23)

Subject to:

$$g_1 \left( x \right) = r_o - r_i - \Delta r \ge 0$$
(24)
$$g_2 \left( x \right) = l_{max} - \left( {Z + 1} \right)\left( {t + \delta } \right) \ge 0$$
(25)
$$g_3 \left( x \right) = P_{max} - P_{rz} \ge 0$$
(26)
$$g_4 \left( x \right) = P_{max} \nu_{sr\ \ \ max} - P_{rz} \upsilon_{sr} \ge 0$$
(27)
$$g_5 \left( x \right) = \nu_{sr\ \ \ max} - \upsilon_{sr} \ge 0$$
(28)
$$g_6 \left( x \right) = T_{max} - T \ge 0$$
(29)
$$g_7 \left( x \right) = M_h - sM_s \ge 0$$
(30)
$$g_8 \left( x \right) = T \ge 0$$
(31)

Variable range:

$$\begin{gathered} 60 \le x_1 \le 80,90 \le x_2 \le 110,1 \le x_3 \le 3, \hfill \\ 600 \le x_4 \le 1000,2 \le x_5 \le 9 \hfill \\ \end{gathered}$$
(32)

Other parameters:

$$M_h = \frac{2}{3}\mu FZ\frac{r_o^3 - r_i^2 }{{r_o^2 - r_i^3 }},P_{rz} = \frac{F}{{{\text{II}}\left( {r_o^2 - r_i^2 } \right)}},$$
(33)
$$\upsilon_{rz} = \frac{{2{\text{II}}\left( {r_o^3 - r_i^3 } \right)}}{{90\left( {r_o^2 - r_i^2 } \right)}},T = \frac{{I_z {\text{II}}\ \ \ n}}{{30\left( {M_h + M_f } \right)}}$$
(34)
$$\Delta r = 20\,{\text{mm}},I_z = 55{\text{kg mm}}^2 ,P_{\max } = 1 {\text{MPa}}, F_{\max } = 1000\,{\text{N}},$$
(35)
$$T_{\max } = 15s,\mu = 0.5,s = 1.5,M_s = 40\,{\rm {Nm}},M_f = 3\,{\rm {Nm}},$$
(36)
$$n = 250\,{\rm{rpm}},\upsilon_{sr\ \ \ \max } = 10{m / {s,}}l_{\max } = 30\,{\rm{mm}}$$
(37)

After calculation and experiments, the experimental results of the multi-disc clutch braking problem are made into a table as shown in Table 8. In Table 8, MCOA concluded that the inner diameter ri = 70, the outer diameter r0 = 90, the thickness of the brake disc t = 1, the driving force F = 600, and the surface friction coefficient Z = 2. At this time, the minimum weight obtained is 0.2352424, it is 11.16% higher than the original algorithm. Compared with MCOA, the other five algorithms in the calculation of this problem show that the optimization effect is far lower than that of MCOA.

Table 8 Experimental results of the multi-disc clutch braking problem

5.2 Design problem of welding beam

The welded beam design problem is very common in the field of structural engineering and is constrained not only by four decision variables (welding width h, connecting beam length l, beam height t, and connecting beam thickness b) but also by seven other different conditions. Therefore, it is challenging to solve this problem. The purpose of the optimization algorithm is to achieve the best structural performance of the welded beam and reduce its weight by optimizing the small problems such as the shape, size and layout of the weld under many constraints. The specific structure of the welded beam is shown in Fig. 7.

Fig. 7
figure 7

Schematic diagram of the welded beam design problem

The mathematical formulation of the welded beam design problem is as follows.

Consider:

$$x = [x_1 x_2 x_3 x_4 ] = [h \, l \, t \, b]$$
(38)

Objective function:

$$f(x) = 1.10471x_1^2 x_2 + 0.04811x_3 x_4 (14.0 + x_2 )$$
(39)

Subject to:

$$g_1 \left( {\vec{x}} \right) = \tau \left( {\vec{x}} \right) - \tau_{\max } \le 0$$
(40)
$$g_2 \left( {\vec{x}} \right) = \sigma \left( {\vec{x}} \right) - \sigma_{\max } \le 0$$
(41)
$$g_3 \left( {\vec{x}} \right) = \delta \left( {\vec{x}} \right) - \delta_{\max } \le 0$$
(42)
$$g_4 \left( {\vec{x}} \right) = x_1 - x_4 \le 0$$
(43)
$$g_5 \left( {\vec{x}} \right) = P - P_c \left( {\vec{x}} \right) \le 0$$
(44)
$$g_6 \left( {\vec{x}} \right) = 0.125 - x_1 \le 0$$
(45)
$$g_7 \left( {\vec{x}} \right) = 1.10471x_1^2 + 0.04811x_3 x_4 \left( {14.0 + x_2 } \right) - 0.5 \le 0$$
(46)

where:

$$\tau \left( {\vec{x}} \right) = \sqrt {{\left( {\tau^{\prime} } \right)^2 + 2\tau^{\prime} \tau^{\prime \prime}\frac{x_2 }{{2R}} + \left( {\tau^{\prime \prime}} \right)}} ,\tau^{\prime} = \frac{P}{{\sqrt {2x_1 x_2 } }},\tau^{\prime \prime} = \frac{MR}{J},$$
(47)
$$M = P\left( {L + \frac{x_2 }{2}} \right),R = \sqrt {{\frac{x_2^2 }{4} + \left( {\frac{x_1 + x_3 }{2}} \right)^2 }} ,\sigma \left( {\vec{x}} \right) = \frac{6PL}{{x_4 x_3^2 }},$$
(48)
$$J = 2\left\{ {\sqrt {2x_1 x_2 } \left[ {\frac{x_x^2 }{4} + \left( {\frac{x_1 + x_3 }{2}} \right)^2 } \right]} \right\},\delta \left( {\vec{x}} \right) = \frac{6PL^3 }{{Ex_4 x_3^2 }},$$
(49)
$$P_c \left( {\vec{x}} \right) = \frac{{\sqrt[{4.013E}]{{\frac{x_3^2 x_4^6 }{0}}}}}{L^2 },\left( {1 - \frac{x_3 }{{2L}}\sqrt {\frac{E}{4G}} } \right),\left( {1 - \frac{x_3 }{{2L}}\sqrt {\frac{E}{4G}} } \right),$$
(50)
$$P = 6000\,lb,L = 14\;\ in,\delta_{\max } = 0.25\;{\text{in}},E = 30 \times 10^6, psi,$$
(51)
$$\tau_{\max } = 13600\ \ \ \ \ {\text{psi}},\hbox{and}\ \ \ \ \ \sigma_{\max } = 30000\ \ \ \ \ \ \ \,psi$$
(52)

Boundaries:

$$0.1 \le x_i \le 2,i = 1,4;\,0.1 \le x_i \le 10,i = 2.3$$
(53)

The experimental results of the welding beam design problem are shown in Table 9. In the table, the welding width obtained by the MCOA algorithm h = 0.203034,the length of the connecting beam is l = 3.310032, the height of the beam is t = 9.084002, and the thickness of the connecting beam is b = 0.20578751. At this time, the minimum weight is 1.707524, it is 1.46% higher than the original algorithm. In the welding beam design problem, the weight determines the application effect of the algorithm in the practical problem. The weight of MCOA algorithm is smaller than that of other algorithms. Therefore, the practical application effect of MCOA is much greater than that of other algorithms.

Table 9 Experimental results of the welded beam design problem

5.3 Design problem of reducer

A reducer is a mechanical device used to reduce the speed of rotation and increase the torque. Among them, gears and bearings are an indispensable part of the reducer design, which have a great impact on the transmission efficiency, running stability and service life of the reducer. The weight of the reducer also determines the use of the reducer. Therefore, we will adjust the number of teeth, shape, radius and other parameters of the gear in the reducer to maximize the role of the reducer, reduce the friction between the parts, and extend the service life of the reducer. In this problem, a total of seven variables are constrained, which are the gear width x1, the gear modulus x2, the gear teeth x3, the length of the first axis between bearings x4, the length of the second axis between bearings x5, the diameter of the first axis x6 and the diameter of the second axis x7. The specific structure of the reducer is shown in Fig. 8.

Fig. 8
figure 8

Schematic diagram of the reducer design problem

The mathematical model of the reducer design problem is as follows.

Consider:

$$x = [x_1 \, x_2 \, x_3 \, x_4 \, x_5 \, x_6 \, x_7 ]$$
(54)

Objective function:

$$\begin{gathered} f(\vec{x}) = 07854 \times x_1 \times x_2^2 \times (3.3333 \times x_3^2 + 14.9334 \times x_3 - \hfill \\ 43.0934) - 1.508 \times x_1 \times (x_6^2 + x_7^2 ) + 7.4777 \times x_6^3 + x_7^3 + \hfill \\ 0.7854 \times x_4 \times x_6^2 + x_5 \times x_7^2 \hfill \\ \end{gathered}$$
(55)

Subject to:

$$g_1 (\vec{x}) = \frac{27}{{x_1 \times x_2^2 \times x_3 }} - 1 \le 0$$
(56)
$$g_2 (\vec{x}) = \frac{397.5}{{x_1 \times x_2^2 \times x_3^2 }} - 1 \le 0$$
(57)
$$g_3 (\vec{x}) = \frac{1.93 \times x_4^3 }{{x_2 \times x_3 \times x_6^4 }} - 1 \le 0$$
(58)
$$g_4 (\vec{x}) = \frac{1.93 \times x_5^3 }{{x_2 \times x_3 \times x_7^4 }} - 1 \le 0$$
(59)
$$g_5 (\vec{x}) = \frac{1}{110 \times x_6^3 } \times \sqrt {{(\frac{745 \times x_4 }{{x_2 \times x_3 }})^2 + 16.9 \times 10^6 }} - 1 \le 0$$
(60)
$$g_6 (\vec{x}) = \frac{1}{85 \times x_7^3 } \times \sqrt {{(\frac{745 \times x_5 }{{x_2 \times x_3 }})^2 + 16.9 \times 10^6 }} - 1 \le 0$$
(61)
$$g_7 (\vec{x}) = \frac{x_2 \times x_3 }{{40}} - 1 \le 0$$
(62)
$$g_8 (\vec{x}) = \frac{5 \times x_2 }{{x_1 }} - 1 \le 0$$
(63)
$$g_9 (\vec{x}) = \frac{x_1 }{{12 \times x_2 }} - 1 \le 0$$
(64)
$$g_{10} (\vec{x}) = \frac{1.5 \times x_6 + 1.9}{{x_4 }} - 1 \le 0$$
(65)
$$g_{11} (\vec{x}) = \frac{1.1 \times x_7 + 1.9}{{x_5 }} - 1 \le 0$$
(66)

Boundaries:

$$\begin{gathered} 2.6 \le x_1 \le 3.6,0.7 \le x_2 \le 0.8,17 \le x_3 \le 28,7.3 \le x_4 \le 8.3, \hfill \\ 7.3 \le x_5 \le 8.3,2.9 \le x_6 \le 3.9,5 \le x_7 \le 5.5 \hfill \\ \end{gathered}$$
(68)

The experimental results of the reducer design problem are shown in Table 10. From Table 10, it is known that the gear width calculated by the MCOA algorithm is x1 = 3.47635, the gear modulus x2 = 0.7, the gear teeth x3 = 17, the length of the first axis between the bearings x4 = 7.3, the length of the second axis between the bearings × 5 = 7.8, and the length of the first axis between the bearings x5 = 7.8. The diameter of the first axis is x6 = 3.348620, the diameter of the second axis is x7 = 5.2768, and the minimum weight is 2988.27135, it is 0.08% higher than the original algorithm. In this experiment, it can be concluded that MCOA has the smallest data among the minimum weights obtained by MCOA and other comparison algorithms in this problem, which proves that MCOA has the best optimization effect in solving such problems.

Table 10 Experimental results of the reducer design problem

5.4 Design problem of three-bar truss

Three-bar truss structure is widely used in bridge, building, and mechanical equipment and other fields. However, the size, shape and connection mode of the rod need to be further explored by human beings. Therefore, A1 = x1 and A2 = x2 determined by the pairwise property of the system need to be considered in solving this problem. In addition to this, there will be constraints on the total support load, material cost, and other conditions such as cross-sectional area. The structural diagram of the three-bar truss is shown in Fig. 9.

Fig. 9
figure 9

Schematic diagram of the three-bar truss design problem

The mathematical formulation of the three-bar truss design problem is as follows.

Consider:

$$\vec{x} = [x_1 x_2 ] = [A_1 A_2 ]$$
(69)

Minimize:

$$f(\vec{x}) = (2\sqrt {2} x_1 + x_2 ) \ast l$$
(70)

Subject to:

$$g_1 (\vec{x}) = \frac{{\sqrt {2} x_1 + x_2 }}{{\sqrt {2} x_1^2 + 2x_1 x_2 }}P - \sigma \le 0$$
(71)
$$g_2 (\vec{x}) = \frac{x_2 }{{\sqrt {2} x_1^2 + 2x_1 x_2 }}P - \sigma \le 0$$
(72)
$$g_3 (\vec{x}) = \frac{1}{{\sqrt {2} x_1 + x_1 }}P - \sigma \le 0$$
(73)
$$l = 100{\text{cm}},P = 2{\text{kN/cm}}^3 ,\sigma = 2{\text{kN/cm}}^3$$
(74)

Variable range:

$$0 \le x_1 ,x_2 \le 1$$
(75)

The experimental results of the three-bar truss design problem are shown in Table 11, from which it can be concluded that x1 = 0.7887564and x2 = 0.4079948of the MCOA algorithm on the three-bar truss design problem. At this time, the minimum weight value is 263.85438633, it is 0.24% higher than the original algorithm. Compared with the minimum weight value of other algorithms, the value of MCOA is the smallest. It is concluded that the MCOA algorithm has a good optimization effect on the three-bar truss design problem.

Table 11 Experimental results of the three-bar truss design problem

The experimental results of four constrained engineering design problems show that MCOA has good optimization performance in dealing with problems similar to constrained engineering design problems. In addition, we will also introduce the high-dimensional feature selection problem of the wrapper method, and further judge whether MCOA has good optimization performance and the ability to deal with diversified problems through the classification and processing effect of data.

6 High-dimensional feature selection problem

The objective of feature selection is to eliminate redundant and irrelevant features, thereby obtaining a more accurate model. However, in high-dimensional feature spaces, feature selection encounters challenges such as high computational costs and susceptibility to over-fitting. To tackle these issues, this paper propose novel high-dimensional feature selection methods based on metaheuristic algorithms. These methods aim to enhance the efficiency and effectiveness of feature selection in complex, high-dimensional datasets.

High-dimensional feature selection, as discussed in reference (Ghaemi and Feizi-Derakhshi 2016), focuses on processing high-dimensional data to extract relevant features while eliminating redundant and irrelevant ones. This process enhances the model's generalization ability and reduces computational costs. The problem of high-dimensional feature selection is often referred to as sparse modeling, encompassing two primary methods: filter and wrapper. Filter methods, also called classifier-independent methods, can be categorized into univariate and multivariate methods. Univariate methods consider individual features independently, leveraging the correlation and dependence within the data to quickly screen and identify the optimal feature subset. On the other hand, multivariate methods assess relationships between multiple features simultaneously, aiming to comprehensively select the most informative feature combinations. Wrapper methods offer more diverse solutions. This approach treats feature selection as an optimization problem, utilizing specific performance measures of classifiers and objective functions. Wrapper methods continuously explore and evaluate various feature combinations to find the best set of features that maximizes the model’s performance. Unlike filter methods, wrapper methods provide a more customized and problem-specific approach to feature selection.

Filter methods, being relatively single and one-sided, approach the problem of feature selection in a straightforward manner by considering individual features and their relationships within the dataset. However, they might lack the flexibility needed for complex and specific problem scenarios. However, wrapper methods offer tailored and problem-specific solutions. They exhibit strong adaptability, wide applicability, and high relevance to the specific problem at hand. Wrapper methods can be seamlessly integrated into any learning algorithm, allowing for a more customized and targeted approach to feature selection. By treating feature selection as an optimization problem and continuously evaluating different feature combinations, wrapper methods can maximize the effectiveness of the algorithm and optimize its performance to a greater extent compared to filter methods. In summary, wrapper methods provide a more sophisticated and problem-specific approach to feature selection, enabling the algorithm to achieve its maximum potential by selecting the most relevant and informative features for the given task.

6.1 Fitness function

In this subsection, the wrapper method in high-dimensional feature selection is elucidated, employing the classification error rate (CEE) (Wang et al. 2005) as an illustrative example. CEE is utilized as the fitness function or objective function to assess the optimization effectiveness of the feature selection algorithm for the problem at hand. Specifically, CEE quantifies the classification error rate when employing the k-nearest-neighbors (KNN) algorithm (Datasets | Feature Selection @ ASU. 2019), with the Euclidean distance (ED) (The UCI Machine Learning Repository xxxx) serving as the metric for measuring the distance between the current model being tested and its neighboring models. By using CEE as the fitness function, the wrapper method evaluates different feature subsets based on their performance in the context of the KNN algorithm. This approach enables the algorithm to identify the most relevant features that lead to the lowest classification error rate, thereby optimizing the model's performance. By focusing on the accuracy of classification in a specific algorithmic context, the wrapper method ensures that the selected features are highly tailored to the problem and the chosen learning algorithm. This targeted feature selection process enhances the overall performance and effectiveness of the algorithm in handling high-dimensional data.

$${\text{Fitness = CEE = }}\frac{{{\text{No}}{\text{. of wrongly classified}}}}{{\text{Total number of instances}}}$$
(76)
$${\text{ED}} (Y,X) = \sqrt {{\sum_{d = 1}^D {\left( {X^d - Y^d } \right)^2 } }}$$
(77)

where X denotes feat, Y denotes label, both X and Y are specific features in the given data model, and D is the total number of features recorded.

In the experimental setup, each dataset is partitioned into a training set and a test set, with an 80% and 20% ratio. The training set is initially utilized to select the most characteristic features and fine-tune the parameters of the KNN model. Subsequently, the test set is employed to evaluate and calculate the data model and algorithm performance. To address concerns related to fitting ability and overfitting, hierarchical cross-validation with K = 10 was employed in this experiment. In hierarchical cross-validation, the training portion is divided into ten equal-sized subsets. The KNN classifier is trained using 9 out of the 10 folds (K-1 folds) to identify the optimal KNN classifier, while the remaining fold is used for validation purposes. This process is repeated 10 times, ensuring that each subset serves both as a validation set and as part of the training data. This iterative approach is a crucial component of our evaluation methodology, providing a robust assessment of the algorithm's performance. By repeatedly employing replacement validation and folding training, we enhance the reliability and accuracy of our evaluation, enabling a comprehensive analysis of the algorithm's effectiveness across various datasets.

6.2 High-dimensional datasets

In this subsection, the optimization performance of MCOA is assessed using 12 high-dimensional datasets sourced from the Arizona State University (Too et al. 2021) and University of California Irvine (UCI) Machine Learning databases (Chandrashekar and Sahin 2014). By conducting experiments on these high-dimensional datasets, the results obtained are not only convincing but also pose significant challenges. These datasets authentically capture the intricacies of real-life spatial problems, making the experiments more meaningful and applicable to complex and varied spatial scenarios. For a detailed overview of the 12 high-dimensional datasets, please refer to Table 12.

Table 12 Details of the datasets used

6.3 Experimental results and analysis

In order to assess the effectiveness and efficiency of MCOA in feature selection, we conducted comparative tests using MCOA as well as several other algorithms including COA, SSA, PSO, ABC, WSA (Baykasoğlu et al. 2020), FPA (Yang 2012), and ABO (Qi et al. 2017) on 12 datasets. In this section of the experiment, the fitness value of each algorithm was calculated, and the convergence curve, feature selection accuracy (FS Accuracy), and selected feature size for each algorithm were analyzed. Figures 10, 11 and 12 display the feature selection (FS) convergence curve, FS Accuracy, and selected feature size for the eight algorithms across the 12 datasets. From these figures, it is evident that the optimization ability and prediction accuracy of the MCOA algorithm surpass those of the other seven comparison algorithms. Taking the dataset CLL-SUB-111 as an example in Figs. 11 and 12, MCOA selected 20 features, while the other seven algorithms selected more than 2000 features. Moreover, the prediction accuracy achieved by MCOA was higher than that of the other seven algorithms. Across all 12 datasets, the comparison figures indicate that the MCOA algorithm consistently outperforms the others. Specifically, the MCOA algorithm tends to select smaller feature subsets, leading to higher prediction accuracy and stronger optimization capabilities. This pattern highlights the superior performance of MCOA in feature selection, demonstrating its effectiveness in optimizing feature subsets for improved prediction accuracy.

Fig. 10
figure 10

Convergence curve of FS

Fig. 11
figure 11

Comparison plot of verification accuracy of eight algorithms

Fig. 12
figure 12

Comparison plots of feature sizes of the eight algorithms

To address the randomness and instability inherent in experiments, a single experiment may not fully demonstrate the effectiveness of algorithm performance. Therefore, we conducted 30 independent experiments using 12 datasets and 8 algorithms. For each algorithm and dataset combination, we calculated the average fitness value, standard deviation of the fitness value, and Friedman rank. Subsequently, the Wilcoxon rank sum test was employed to determine significant differences between the performance of different algorithms across various datasets. Throughout the experiment, a fixed population size of 10 and a maximum of 100 iterations were used. The 12 datasets were utilized to evaluate the 8 algorithms 300 times (tenfold cross-validation × 30 runs). It is essential to note that all algorithms were assessed using the same fitness function derived from the dataset, ensuring a consistent evaluation criterion across the experiments. By conducting multiple independent experiments and statistical analyses, the study aimed to provide a comprehensive and robust assessment of algorithm performance. This approach helps in drawing reliable conclusions regarding the comparative effectiveness of the algorithms under consideration across different datasets, accounting for the inherent variability and randomness in the experimental process.

Table 13 presents the average fitness calculation results from 30 independent experiments for the eight algorithms, it is 55.23% higher than the original algorithm. According to the table, in the Ionosphere dataset, MCOA exhibits the best average fitness, albeit with slightly lower stability compared to ABC. Similarly, in the WarpAR10P dataset, MCOA achieves the best average fitness, with stability slightly lower than COA. After conducting Friedman ranking on the fitness calculation results of the 30 independent experiments, it is concluded that although MCOA shows slightly lower stability in some datasets, it ranks first overall. Among the other seven algorithms, PSO ranks second, ABO ranks third, COA ranks fourth, and ABC, SSA, FPA, and WSA rank fifth to ninth, respectively. These results demonstrate that MCOA exhibits robust optimization performance and high stability in solving high-dimensional feature selection problems. Moreover, MCOA outperforms COA, showcasing its superior improvement in solving these complex problems.

Table 13 Results of FS fitness calculation (optimal data are marked in bold)

Table 14 presents the accuracy calculation results of the eight algorithms for 30 independent experiments, it is 10.85% higher than the original algorithm. According to the table, the average accuracy of MCOA is the highest across all datasets. Notably, in the Colon dataset, MCOA performs exceptionally well with a perfect average accuracy of 100%. However, in the Ionosphere dataset, MCOA exhibits slightly lower stability compared to ABC, and in the WarpAR10P dataset, it is slightly less stable than COA. Upon conducting Friedman ranking on the average accuracy calculation results of 30 independent experiments, it is evident that MCOA ranks first overall. Among the other seven algorithms, PSO ranks second, ABC ranks third, COA ranks fourth, and ABO, FPA, SSA, and WSA rank fifth to ninth, respectively. These results highlight that MCOA consistently achieves high accuracy and stability in solving high-dimensional feature selection problems. Its superior performance across various datasets underscores its effectiveness and reliability in real-world applications.

Table 14 FS accuracy calculation results (optimal data are marked in bold)

Table 15 demonstrates that the MCOA algorithm has shown significant results in the Wilcoxon rank sum test for high-dimensional feature selection fitness. The comparison values with other algorithms are less than 5%, indicating that the MCOA algorithm exhibits significant differences compared to the other seven algorithms. This result serves as evidence that MCOA outperforms the other algorithms, showcasing its superior optimization performance. Additionally, when comparing the results with the original algorithm, it becomes evident that the MCOA algorithm has a substantial and positive impact, demonstrating its effectiveness and improvement over existing methods. These findings underscore the algorithm's potential and its ability to provide substantial enhancements in the field of high-dimensional feature selection.

Table 15 Experimental results of Wilcoxon rank sum test for FS

7 Conclusions and future work

The Crayfish Optimization Algorithm (COA) is grounded in swarm intelligence, drawing inspiration from crayfish behavior to find optimal solutions within a specific range. However, COA’s limitations stem from neglecting crucial survival traits of crayfish, such as crawling against water to discover better aquatic environments. This oversight weakens COA’s search ability, making it susceptible to local optima and hindering its capacity to find optimal solutions. To address these issues, this paper introduces a Modified Crayfish Optimization Algorithm (MCOA). MCOA incorporates an environmental updating mechanism, enabling crayfish to randomly select directions toward better aquatic environments for location updates, enhancing search ability. The addition of the ghost opposition-based learning strategy expands MCOA’s search range and promotes escape from local optima. Experimental validations using IEEE CEC2020 benchmark functions confirm MCOA’s outstanding optimization performance.

Moreover, MCOA’s practical applicability is demonstrated through applications to four constrained engineering problems and high-dimensional feature selection challenges. These experiments underscore MCOA’s efficacy in real-world scenarios, but MCOA can only solve the optimization problem of a single goal. In future studies, efforts will be made to further optimize MCOA and enhance its function. We will exploitation multi-objective version of the algorithm to increase the search ability and convergence of the algorithm through non-dominated sorting, multi-objective selection, crossover and mutation, etc., to solve more complex practical problems. It is extended to wireless sensor network coverage, machine learning, image segmentation and other practical applications.