A method for realizing engineering optimization based on Kingfisher optimization algorithm
By designing the Kingfisher optimization algorithm, the Kingfisher's evasion of predation and hunting behavior is simulated, and the combination of global search and local optimization in complex optimization problems is achieved, which solves the problem that existing algorithms cannot guarantee the global optimal solution, and significantly improves optimization Performance and efficiency.
Patent Information
- Application Number
- CN202410413718.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-08
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-04-08
AI Technical Summary
The existing metaheuristic algorithms cannot guarantee to find the global optimal solution in optimization problems, and the performance differences are large when dealing with different types of optimization problems, making it difficult to adapt to complex and high-dimensional non-linear non-convex environments.
An optimization algorithm based on kingfisher behavior in nature, called Kingfisher Optimization Algorithm (KOA), is designed to simulate the mechanism of kingfisher hiding predators and hunting, and adopt a position update strategy in the two-stage exploration and development stages to ensure that Combining global search capabilities and local optimization.
The KOA algorithm shows strong search capabilities, fast convergence accuracy and good optimization effects in benchmarking functions and engineering optimization problems, avoiding local optimal traps and being suitable for complex engineering optimization problems.
Smart Images

Figure CN118246330B_ABST
Abstract
Description
Technical field:
[0001] The invention belongs to the field of swarm intelligence optimization algorithms, and in particular relates to a method for realizing engineering optimization based on a kingfisher optimization algorithm. Background technology:
[0002] Problems that have multiple feasible solutions are called optimization problems, and the process of finding the best solution among these existing solutions is called optimization. Optimization problems are described by three main parts: decision variables, constraints, and objective function. With the advancement of science and technology, optimization problems have become more complex, new optimization problems have emerged, and suitable optimization tools must be used to solve these problems. Metaheuristic algorithms that use random operators, trial and error procedures, and random scanning of the problem solution space are able to produce effective solutions to optimization problems. Simple concepts, easy implementation, no need for derivation procedures, efficiency in high dimensional problems, efficiency in nonlinear and non-convex environments are some of the advantages that have led to the popularity and widespread use of metaheuristic algorithms.
[0003] The optimization process of a metaheuristic algorithm is to initialize a certain number of random feasible solutions in the problem space. Then, in a repetition-based process, the candidate values are updated and improved according to the algorithm instructions. After the algorithm is fully implemented, the optimal solution is introduced among the candidate solutions as the solution to the problem. An important issue about the solutions obtained by the metaheuristic algorithm is that there is no guarantee that these solutions are necessarily global optimal solutions. This is due to the nature of random search in this type of optimization method. However, since these solutions are close to the original solution, they can be accepted as quasi-optimal solutions. The main reason for the difference in performance of metaheuristic algorithms on very similar problems is the different process of searching and updating candidate solutions, which has also led to the design and development of many optimization algorithms. Summary of the invention:
[0004] The NFL theorem states that the strong performance of an algorithm in dealing with a set of optimization problems does not guarantee the same performance in dealing with other optimization problems. Therefore, it is wrong to claim that a certain algorithm works best in all optimization applications. The NFL theorem inspires the author to design newer algorithms to find better solutions to optimization problems. The novelty and innovation of the present invention lies in the introduction and design of a new optimization algorithm - Kingfisher optimization algorithm (KOA), which is used to simulate the activities of kingfishers in nature. The mechanism of kingfishers when avoiding hunters' attacks and the mechanism of kingfishers when hunting are two natural behaviors of kingfishers, which are the basic inspiration for the design of KOA.
[0005] The algorithm has application value in processing optimization problems. The present invention provides a method for realizing engineering optimization based on the Kingfisher optimization algorithm, comprising the following steps:
[0006] S1. Determine the optimization parameters for the engineering problem to be optimized, corresponding to X n,m ; Where n represents the number of kingfishers and m represents the number of decision variables;
[0007] S2, simulating the behavior of kingfishers in facing and escaping from predators and hunting, and proposing a kingfisher optimization algorithm, namely, the KOA algorithm, including the following sub-steps:
[0008] Step 1: At the beginning of the KOA algorithm implementation, the position of the individual in the search space is randomly initialized using the following formula:
[0009] X i :x i,j =lb j +r·(ub j -lb j ), i=1,2,…,n; j=1,2,…,m;
[0010] Where X i represents the position of the i-th individual in the search space, x i,j represents the value of the j-th decision variable, r is a random real number in the interval [0,1], ub j and lb j Represent the upper and lower bounds of the j-th decision variable respectively; the individual population in the KOA algorithm is mathematically represented by the following matrix X, which is called the population matrix;
[0011]
[0012] Step 2: Set the fitness function, calculate the fitness value of the individual population, obtain the optimal solution for the initial population, and start the iterative process;
[0013] Step 3: In the exploration phase, updating the individual population in the search space is divided into two parts; the position iteration formula in the first part is as follows:
[0014]
[0015] D(X(i))=aX(i)×f(X(i))
[0016] D(X(rand))=aX(rand)×f(X(rand))
[0017] a represents a random number between [0,1], X(i) * represents the optimal solution in the current iteration round, MaxIter represents the maximum number of iterations, D(X(i)) and D(X(rand)) represent the movement direction of the current individual and a random individual in the population, respectively, and f(X(i)) represents the fitness function of the current individual;
[0018] Step 4: In the exploration phase, the iterative formula for the positions of the remaining individuals in the search space is as follows:
[0019]
[0020] Where X(i) * represents the optimal solution in the current iteration round, and p represents a random number between [0,1];
[0021] Step 5: If the new position of the individual after each iteration improves the value of the objective function, then the iteration is considered to be effective and the update process is acceptable. Otherwise, the individual will remain in the previous position.
[0022] Step 6: When the population completes the exploration phase, individuals begin to execute the position update strategy of the development phase in the search space. The position update strategy is as follows:
[0023]
[0024] c, p represent random numbers between [0,1], l is the logarithmic spiral shape constant defined, and the value of l decreases linearly from 2 to 0, X(i) * Represents the optimal solution in the current iteration round;
[0025] Step 7: If the position of the individual after the new round of iteration improves the value of the objective function, then this round of iteration is considered to be effective, and the greedy strategy is executed again to replace the original position with the new position, otherwise, the individual will remain in the previous position;
[0026] Step 8: If the number of iterations is less than the maximum number of iterations, the optimal solution is brought into step 3 and continues to the next round of iterations;
[0027] Step 9: If the number of iterations is equal to the maximum number of iterations, the optimization ends and the global optimal solution is output.
[0028] Preferably, the problem to be optimized is a pressure vessel design problem based on the Kingfisher optimization algorithm. The goal of designing a pressure vessel is to minimize the manufacturing cost of the pressure vessel. Both ends of the pressure vessel are sealed by covers, and the cover at one end of the head is hemispherical. L is the cross-sectional length of the cylindrical part without considering the head, R is the inner wall radius of the cylinder, and T s and T h Respectively represent the wall thickness of the cylinder and the wall thickness of the head, L, R, T s 、T h These are the four optimization variables for the pressure vessel design problem, and the objective function of the problem is:
[0029]
[0030] Preferably, the problem to be optimized is a three-bar truss design problem based on the Kingfisher optimization algorithm, in which the variable x 1 ,x 2 , and x 3 are the cross-sectional areas of the three rods respectively, and from the symmetry we know that x 1 =x 3 The purpose of the three-bar truss design is described as follows: by adjusting the cross-sectional area (x 1 ,x 2 ) minimizes the volume of the three-bar truss; the three-bar truss is subject to stress σ constraints on each truss member, and the objective function of the problem is:
[0031]
[0032] Preferably, the problem to be optimized is a machine learning model optimization problem based on the Kingfisher optimization algorithm. The goal of designing the optimal parameters of the machine learning model is to minimize the loss function of the model. The parameters of the LSTM model include the number of neural network layers layer, the number of neurons num, and the learning rate n. The objective function is to minimize the loss function of the LSTM model. MAE is selected as the loss function of the LSTM model, and min(loss) is used as the objective function.
[0033] Preferably, the problem to be optimized is a tension and compression spring design problem based on the Kingfisher optimization algorithm. The purpose of designing the tension and compression spring is to minimize the weight of the tension and compression spring under the constraints of minimum deflection, vibration frequency and shear stress. The tension and compression spring design problem consists of three continuous decision variables, namely, the spring coil diameter x 1 , spring coil diameter x 2 , Number of winding coils x 3 , the objective function of the tension and compression spring design problem is expressed as:
[0034] minf(x)=(x 3 +2)x 2 x 1 2 .
[0035] Preferably, the process in step 5 and step 7 is simulated by the following formula:
[0036]
[0037] Preferably, in steps 3-4, during the exploration phase, the individual position update method is divided into two methods, one of which is to update the position according to the movement direction of the current individual and the random individual in the population, and the other is to update the position according to the optimal solution in the current iteration round and the relationship with the random individual position.
[0038] Preferably, in step 6, during the development phase, the individual position update method is divided into two methods, one part updates the position in a spiral motion manner, and the other part updates the position in a linear motion manner.
[0039] Beneficial effects: The present invention establishes a mathematical model of a two-stage exploration based on escape strategy simulation and a development stage based on a hunting mechanism. The algorithm is applied to benchmark test functions and engineering optimization problem examples. Experimental results show that the KOA algorithm has strong search capabilities, high convergence accuracy, fast convergence speed, and good results in actual engineering optimization problems. This is because the algorithm proposes a new position update strategy in the exploration stage, which fully considers the impact of random individual positions on the results of the next round of iterations, avoiding the algorithm from falling into local optimality. In the development stage, the algorithm fully considers the importance of the optimal solution in the current iteration round, improving the overall convergence ability of the algorithm. Description of the drawings:
[0040] Figure 1 The flowchart of the Kingfisher optimization algorithm proposed by the present invention;
[0041] Figure 2 A schematic diagram showing the comparison of the convergence of the Kingfisher optimization algorithm proposed in the present invention and other optimization algorithms on the F1 function;
[0042] Figure 3 A schematic diagram showing the comparison of the convergence of the Kingfisher optimization algorithm proposed in the present invention and other optimization algorithms on the F2 function;
[0043] Figure 4 A schematic diagram showing the comparison of the convergence of the Kingfisher optimization algorithm proposed in the present invention and other optimization algorithms on the F3 function;
[0044] Figure 5 This is a schematic diagram comparing the convergence of the Kingfisher optimization algorithm proposed in the present invention and other optimization algorithms on the F4 function. Specific implementation method:
[0045] In order to enable researchers and technicians in the field to better understand the technical solution of the present invention, the technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0046] In order to reduce the workload of ordinary technicians and increase the application scope of the Kingfisher optimization algorithm, the present invention can be applied to complex existing engineering optimization problem fields such as pressure vessel design problems, three-bar truss design problems, tension and compression spring design, etc.
[0047] The present invention designs a new bio-inspired algorithm, called Kingfisher Optimization Algorithm, to simulate the activities of kingfishers in nature. The mechanism of kingfishers when evading hunters and the mechanism of kingfishers when hunting are two natural behaviors of kingfishers, which are the basic inspiration for the design of KOA. The present invention establishes a mathematical model of two-stage exploration based on escape strategy simulation and exploitation stage based on hunting mechanism.
[0048] Reference Figure 1 The present invention proposes a method for realizing engineering optimization based on the Kingfisher optimization algorithm, comprising the following steps:
[0049] Step 1: At the beginning of the KOA algorithm implementation, the population is randomly initialized;
[0050] Step 2: Set the fitness function, calculate the fitness value of the individual population, obtain the optimal solution for the initial population, and start the iterative process;
[0051] Step 3: The first stage of updating the kingfisher population in the search space is the exploration stage. In the exploration stage, the individuals in the population are divided into two parts. The individual position updates in the first part will be far away from the current optimal solution, thereby enriching the diversity of the search space;
[0052] Step 4: The position update of the remaining individuals in the exploration phase will be based on any position in the current search space and the optimal individual of the current iteration;
[0053] Step 5: If the new position of the kingfisher after each iteration improves the value of the objective function, then the iteration is considered to be effective and the update process is acceptable, otherwise, the kingfisher will remain in its previous position;
[0054] Step 6: The second stage of the process of updating the kingfisher's position in the search space is based on the modeling of the kingfisher's natural behavior when hunting. When the kingfisher is hunting, it will not move away from its existing position, but will take the principle of proximity to hunt. One part of the kingfisher will fly into the flowers in a spiral motion in the air to drive out small insects such as butterflies and bees hiding in them, while the other half of the kingfisher will be responsible for hunting;
[0055] Step 7: If the position of the kingfisher after the new round of iteration improves the value of the objective function, then the iteration is considered to be effective, and the greedy strategy is executed again to replace the original position with the new position. Otherwise, the kingfisher will remain in its previous position.
[0056] Step 8: If the number of iterations is less than the maximum number of iterations, the optimal solution is brought into step 3 and continues to the next round of iterations;
[0057] Step 9: If the number of iterations is equal to the maximum number of iterations, the optimization ends and the global optimal solution is output;
[0058] In steps 3 and 4 of the Kingfisher Optimization Algorithm, the first phase of updating the population of kingfishers in the search space is modeled based on simulating their response strategies when attacked. In this strategy, one group of kingfishers chooses to move away from danger when attacked, while another group of kingfishers chooses to interfere with the attacker. When the attacker is interfered with, the kingfisher population will also change its position. This strategy allows KOA to move to different locations in the search space, reflecting KOA's global search ability in the problem-solving space.
[0059] In step 3, in the exploration phase, updating the individual population in the search space is divided into two parts. The individual position iteration formula in the first part is as follows:
[0060]
[0061] D(X(i))=aX(i)×f(X(i))
[0062] D(X(rand))=aX(rand)×f(X(rand))
[0063] a represents a random number between [0,1], X(i) * represents the optimal solution in the current iteration round, MaxIter represents the maximum number of iterations, D(X(i)) and D(X(rand)) represent the movement direction of the current individual and a random individual in the population, respectively, and f(X(i)) represents the fitness function of the current individual.
[0064] In step 4, during the exploration phase, the iterative formula for the remaining individual positions in the search space is as follows:
[0065]
[0066] Where X(i) * represents the optimal solution in the current iteration round, and p represents a random number between [0,1].
[0067] In step 5, if the new position calculated for each kingfisher individual improves the value of the objective function, then this round of iteration is acceptable, otherwise, the kingfisher individual will remain in its original position. This process is simulated by the following formula;
[0068]
[0069] In step 6, in the development stage, the predation behavior of the kingfisher group is also divided into two groups, one group updates the individual position in a spiral motion, and the other group updates the position in a linear motion. The individual update formula in the development stage can be expressed as follows:
[0070]
[0071] c, p represent random numbers between [0,1], l is the logarithmic spiral shape constant defined, and the value of l decreases linearly from 2 to 0, X(i) * Represents the optimal solution in the current iteration round.
[0072] In step 7, if the new position calculated for each kingfisher individual improves the value of the objective function, then this round of iteration is acceptable, otherwise, the kingfisher individual will remain at the original position. The process is simulated by the following formula;
[0073]
[0074] In order to prove the effectiveness of the Kingfisher optimization algorithm proposed in this paper, four benchmark test functions and an engineering optimization problem example are used to conduct experiments, and the experimental results are compared with other optimization algorithms;
[0075] The specific implementation steps for the experiment using four benchmark functions are as follows:
[0076] Step 1: Use four benchmark test functions to conduct optimization experiments. The parameters of the four benchmark test functions are shown in Table 1;
[0077] Step 2: Using the Kingfisher optimization algorithm proposed by the present invention to perform optimization experiments on four benchmark test functions;
[0078] Step 3: Use the butterfly optimization algorithm, whale optimization algorithm, and moth-to-flame optimization algorithm to conduct comparative experiments;
[0079] Step 4: Compare the experimental results in step 2 and step 3. The experimental results are shown in the attached Figure 2-Figure 5 As shown;
[0080] Table 1. Four benchmark functions
[0081]
[0082]
[0083] The example of engineering optimization problem is to select the pressure vessel design problem to test the Kingfisher optimization algorithm proposed in this invention. The goal of designing a pressure vessel is to minimize the production cost of the pressure vessel. Both ends of the pressure vessel are sealed by a cover, and the cover at the head end is hemispherical. L is the cross-sectional length of the cylindrical part without considering the head, R is the inner wall radius of the cylinder, and T s and T h Respectively represent the wall thickness of the cylinder and the wall thickness of the head, L, R, T s 、T hThese are the four optimization variables for the pressure vessel design problem. The objective function of this problem is:
[0084] x=[x 1 ,x 2 ,x 3 ,x 4 ]=[T s ,T h ,R,L]
[0085]
[0086] The constraints are:
[0087] g 1 (x) = -x 1 +0.0193x 3 ≤0
[0088] g 2 (x) = -x 2 +0.00954x 3 ≤0
[0089]
[0090] g 4 (x) = x 4 -240≤0
[0091] 0≤x 1 ≤100,0≤x 2 ≤100,10≤x 3 ≤100,10≤x 4 ≤100
[0092] The experimental results are shown in Table 2:
[0093] Table 2. Experimental results of pressure vessel design problems
[0094]
[0095] The experimental results show that the Kingfisher optimization algorithm proposed in this paper achieves an appropriate balance between exploration in global search and exploitation in local search, thus providing a suitable solution to the optimization problem. The comparison between KOA and other optimization algorithms shows the competitive advantage of KOA in optimization applications. In addition, the KOA method is applied to engineering design optimization problems, which proves that the KOA method has good optimization effect and optimization performance in practical optimization problems.
[0096] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for realizing engineering optimization based on Kingfisher optimization algorithm, characterized in that: The steps include: S1. Determine the optimization parameters for the engineering problem to be optimized, corresponding to X n,m ; Where n represents the number of kingfishers and m represents the number of decision variables; S2, simulating the behavior of kingfishers in facing and escaping from predators and hunting, and proposing a kingfisher optimization algorithm, namely, the KOA algorithm, including the following sub-steps: Step 1: At the beginning of the KOA algorithm implementation, the position of the individual in the search space is randomly initialized using the following formula: X i :x i,j =lb j +r·(ub j -lb j ),i=1,2,…,n;j=1,2,…,m; Where X i represents the position of the i-th individual in the search space, x i,j represents the value of the j-th decision variable, r is a random real number in the interval [0, 1], ub j and lb j Represent the upper and lower bounds of the j-th decision variable respectively; The population of individuals in the KOA algorithm is mathematically represented by the following matrix X, called the population matrix; Step 2: Set the fitness function, calculate the fitness value of the individual population, obtain the optimal solution for the initial population, and start the iterative process; Step 3: In the exploration phase, updating the individual population in the search space is divided into two parts; the position iteration formula in the first part is as follows: D(X(i))=aX(i)×f(X(i)) D(X(rand))=aX(rand)×f(X(rand)) a represents a random number between [0, 1], X(i)* represents the optimal solution in the current iteration round, MaxIter represents the maximum number of iterations, D(X(i)) and D(X(rand)) represent the movement direction of the current individual and a random individual in the population, respectively, and f(X(i)) represents the fitness function of the current individual; Step 4: In the exploration phase, the iterative formula for the positions of the remaining individuals in the search space is as follows: Where X(i)* represents the optimal solution in the current iteration round, and p represents a random number between [0, 1]; Step 5: If the new position of the individual after each iteration improves the value of the objective function, then the iteration is considered to be effective and the update process is acceptable. Otherwise, the individual will remain in the previous position. Step 6: When the population completes the exploration phase, individuals begin to execute the position update strategy of the development phase in the search space. The position update strategy is as follows: c, p represent random numbers between [0, 1], l is the defined logarithmic spiral shape constant, the value of l decreases linearly from 2 to 0, and X(i)* represents the optimal solution in the current iteration round; Step 7: If the position of the individual after the new round of iteration improves the value of the objective function, then this round of iteration is considered to be effective, and the greedy strategy is executed again to replace the original position with the new position, otherwise, the individual will remain in the previous position; Step 8: If the number of iterations is less than the maximum number of iterations, the optimal solution is brought into step 3 and continues to the next round of iterations; Step 9: If the number of iterations is equal to the maximum number of iterations, the optimization ends and the global optimal solution is output; The problems to be optimized based on the above method include pressure vessel design problem and three-bar truss design problem; When the problem to be optimized is the pressure vessel design problem, the goal of designing the pressure vessel is to minimize the manufacturing cost of the pressure vessel. Both ends of the pressure vessel are sealed by covers, and the cover at one end of the head is hemispherical; L is the cross-sectional length of the cylindrical part without considering the head, R is the inner wall radius of the cylinder, and T s and T h Respectively represent the wall thickness of the cylinder and the wall thickness of the head, L, R, T s , T h These are the four optimization variables for the pressure vessel design problem, and the objective function of the problem is: When the problem to be optimized is a three-bar truss design problem, the variables x1, x2, and x3 are the cross-sectional areas of the three bars, and from the symmetry, x1 = x3; the purpose of the three-bar truss design is described as: to minimize the volume of the three-bar truss by adjusting the cross-sectional area (x1, x2); the three-bar truss is subject to the stress σ constraint on each truss member, and the objective function of the problem is:
2. The method for realizing engineering optimization based on the Kingfisher optimization algorithm according to claim 1, characterized in that: The problem to be optimized is the tension and compression spring design problem based on the Kingfisher optimization algorithm. The purpose of designing the tension and compression spring is to minimize the weight of the tension and compression spring under the constraints of minimum deflection, vibration frequency and shear stress. The tension and compression spring design problem consists of three continuous decision variables, namely, spring coil diameter x1, spring coil diameter x2, and number of coils x3. The objective function of the tension and compression spring design problem is expressed as: minf(x)=(x3+2)x2x1 2 。 3. The method for realizing engineering optimization based on the Kingfisher optimization algorithm according to claim 1, characterized in that: The process in step 5 and step 7 is simulated by the following formula:
4. The method for realizing engineering optimization based on the Kingfisher optimization algorithm according to claim 1, characterized in that: In step 3-4, during the exploration phase, there are two ways to update the position of an individual. One is to update the position based on the movement direction of the current individual and the random individual in the population, and the other is to update the position based on the optimal solution in the current iteration round and the relationship between the position of the random individual.
5. The method for realizing engineering optimization based on the Kingfisher optimization algorithm according to claim 1, characterized in that: In step 6, during the development phase, the individual position update method is divided into two methods, one part updates the position in a spiral motion manner, and the other part updates the position in a linear motion manner.
