# Application of the Improved Cuckoo Algorithm in Differential Equations

## Abstract

**:**

## 1. Introduction

- (1)
- Parameter Adjustment

- (2)
- Strategy Improvement

- (3)
- Hybrid Algorithms

- (1)
- The proposal of an improved CS based on a sharing mechanism.
- (2)
- The introduction of a numerical solution method for differential equations using the coupling of function approximation and intelligent algorithms.
- (3)
- The application of the improved algorithm to solve differential equations.

## 2. Cuckoo Search Algorithm

#### 2.1. Introduction to the Cuckoo Search Algorithm

#### 2.2. Optimization Process of the Cuckoo Search Algorithm

**Assumption**

**1.**

**Assumption**

**2.**

**Assumption**

**3.**

- (1)
- Population Initialization Based on a Random Distribution Strategy

- (2)
- Global Search Based on Lévy Flight

- $\alpha $—the step size factor;
- ${\alpha}_{0}$—the proportionality factor;
- ${x}_{best}^{t}$—the best nest position at the t-th iteration;
- $\otimes $—denotes element-wise multiplication.

- (3)
- Local Search Based on Preference Mechanism

## 3. Improved Cuckoo Search Algorithm

#### 3.1. Algorithm Design

- (1)
- Initialization of the Population Based on the Best Point Set Method

- (2)
- Shared Mechanism-Based Global Search Strategy

- ${k}_{best}$ is calculated by Equation (13);
- ${X}_{i}$ is the position of the cuckoo ranked i-th in fitness.

- (3)
- Local Search Strategy Based on Sharing Mechanism

_{i}-th cuckoo. The current fitness values of the nests found by these two cuckoos are compared, and the nest position with the smaller fitness value is chosen for updating in set ${x}_{{q}_{i}}^{t}$. The updating process is illustrated in Figure 6.

_{a}of finding alien bird eggs with high fitness values will have their nests destroyed. To ensure that cuckoos stay away from abandoned nests, more cuckoos need to provide location information. Four cuckoos with distinct positions are randomly selected from the current population, and their positions are denoted as ${x}_{m}^{t},{x}_{n}^{t},{x}_{p}^{t},{x}_{q}^{t}$, respectively. The new nest position ${x}_{i}^{t+1},i=1,2,\dots ,D$ is reconstructed based on the shared information from multiple cuckoos. The double difference Formula (17) is used to update ${v}_{i}^{t}$ in Formula (5), resulting in a local search strategy based on the sharing mechanism:

#### 3.2. Algorithm Flow

- (1)
- Set the population size $d$ and other variables ${T}^{max}$, ${P}_{a}$, and the fitness function to be optimized as $F\left(x\right)$. Assume the position of the bird nest found by the i-th cuckoo is: ${x}_{i}(t)=\left({x}_{i1}(t),{x}_{i2}(t),\dots ,{x}_{iD}(t)\right),i=1,2,\dots ,D$. Initialize the population using the optimal points set method: ${x}_{i}(i=1,2,\dots ,d)$;
- (2)
- Calculate the fitness value $F({x}_{i})$ of the initial bird nest position. Through comparison, designate the minimum fitness value in the current individuals as ${F}_{best}$, and record the corresponding best position as ${x}_{best}$;
- (3)
- Search and update $Fea{s}_{best}$ using Equations (13) and (14);
- (4)
- Update the position of each cuckoo bird using Equations (15) and (16), denoted as ${\widehat{x}}_{i}(t)$ and calculate the fitness value of the new position as $F({\widehat{x}}_{i}(t))$.
- (5)
- If $F({\widehat{x}}_{i}(t))<F({x}_{i}(t))$, then update ${x}_{i}(t)$ to ${\widehat{x}}_{i}(t)$, and correspondingly update $F({x}_{i}(t))$ to $F({\widehat{x}}_{i}(t))$. If $F({\widehat{x}}_{i}(t))\ge F({x}_{i}(t))$, then keep them unchanged.
- (6)
- Generate a random number $\theta \in [0,1]$. If $\theta >{P}_{a}$, then eliminate solution ${\widehat{x}}_{i}(t)$. Update the eliminated solution according to Equations (5) and (17), then update its fitness.
- (7)
- Sort the fitness of all cuckoo birds, obtaining the current best position ${x}_{best}^{t+1}$ and the best value $F({x}_{best}^{t+1})$.
- (8)
- Check the termination criteria. If satisfied, output the optimal solution; otherwise, iterate back to step (3).

#### 3.3. Improved Algorithm Performance Test

#### 3.3.1. Experimental Design

- (1)
- ${f}_{1}=14.203125+{x}_{1}(3{x}_{2}-4.5{x}_{2}^{2}-5.25{x}_{2}^{3}-3)+{x}_{1}^{2}({x}_{2}+{x}_{2}^{2}+{x}_{2}^{4}+{x}_{2}^{6}+1)$

- (2)
- ${f}_{2}=0.5+\frac{{\mathrm{sin}}^{2}({x}_{1}^{2}-{x}_{2}^{2})-0.5}{1+0.002\left({x}_{1}^{2}-{x}_{2}^{2}\right)+{\left({x}_{1}^{2}-{x}_{2}^{2}\right)}^{2}}$

- (3)
- ${f}_{3}(x)={\displaystyle \sum _{i=1}^{15}\left|{x}_{i}\right|}+\underset{i=1}{\overset{15}{\Pi}}\left|{x}_{i}\right|$

- (4)
- ${f}_{4}(x)={\displaystyle \sum _{i=1}^{15}\left[{x}_{i}^{2}-10(\mathrm{cos}\left(2\pi {x}_{i}\right)+1)\right]}$

#### 3.3.2. Comparative Analysis of Algorithms

#### 3.3.3. Comparative Analysis of Algorithm Convergence

## 4. Application of the Improved Algorithm in Differential Equations

#### 4.1. Construction of Approximate Solutions

#### 4.2. Constraint Conditions

- ${h}_{1},{h}_{2},\dots ,{h}_{n}$ represent the constraints of optimization problems.

#### 4.3. Objective Function and Fitness Function

- ${h}_{j}$ is the constraint condition;
- ${m}_{1}$ is the number of boundary value conditions;
- ${m}_{2}$ is the number of initial value conditions.

#### 4.4. Algorithm Procedure for Problem Solving

- (1)
- Express the differential equation in the implicit function form on the solution interval $[{t}_{0},{t}_{n}]$, as in Equation (19): $F(t,x,{x}^{\prime},\dots ,{x}^{(n)})=0$
- (2)
- Transform the boundary conditions or initial value conditions into constraint forms (28) or (29);
- (3)
- Based on Equation (25), select an appropriate number M of terms in the Fourier series expansion;
- (4)
- Assign values to each undetermined coefficient ${a}_{0},{a}_{1},{a}_{2},\dots ,{a}_{M},{b}_{1},\dots ,{b}_{M}$ in the approximate function and introduce them into the ICSABOSM algorithm;
- (5)
- Call the ICSABOSM algorithm to search for the undetermined coefficients.
- (6)
- Calculate the values of the approximate solution $\tilde{x}(t)$ at various points with $\Delta t$:${t}_{j}={t}_{0}+j\Delta t$, $x({t}_{j})\approx \tilde{x}({t}_{j})$ as the step size
- (7)
- Calculate the approximate value of the derivative at point ${t}_{j}$ using Equation (26): ${\tilde{x}}^{\prime}({t}_{j}),{\tilde{x}}^{\u2033}({t}_{j}),\dots ,{\tilde{x}}^{(n)}({t}_{j})$
- (8)
- Construct the residual function $R(t)$;
- (9)
- Choose an appropriate fitness function based on the target function equation and calculate the fitness function value for each cuckoo’s current position;
- (10)
- Repeat steps (6) to (10) until the stopping criteria of the ICSABOSM algorithm are met.

#### 4.5. Numerical Examples and Results Analysis

#### 4.5.1. First-Order Linear Differential Equation

#### 4.5.2. Second-Order Nonlinear Differential Equation

#### 4.5.3. No Analytic Solution to Differential Equation

## 5. Conclusions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Kumar, N.; Mahato, S.K.; Bhunia, A.K. A new QPSO based hybrid algorithm for constrained optimization problems via tournamenting process. Soft Comput.
**2020**, 24, 11365–11379. [Google Scholar] [CrossRef] - Kumar, N.; Rahman, M.S.; Duary, A.; Mahato, S.K.; Bhunla, A.K. A new QPSO based hybrid algorithm for bound-constrained optimisation problem and its application in engineering design problems. Int. J. Comput. Sci. Math.
**2021**, 12, 385–412. [Google Scholar] [CrossRef] - Storn, R.; Storn, P. Differential evolution—A simple and efficient heuristic for global optimization over continuous space. J. Glob. Optim.
**1997**, 11, 341–359. [Google Scholar] [CrossRef] - Avijit, D.; Kumar, N.; Akhtar, M.; Shalkh, A.A.; Bhunla, A.K. Real Coded Self-Organizing Migrating Genetic Algorithm for nonlinear constrained optimization problems. Int. J. Oper. Res.
**2022**, 45, 29–67. [Google Scholar] - Eberhart, R.; Kennedy, J. A new optimizer using particle swarm theory. In Proceedings of the Mhs95 Sixth International Symposium on Micro Machine & Human Science, Nagoya, Japan, 4 November 1995. [Google Scholar]
- Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey Wolf Optimizer. Adv. Eng. Softw.
**2014**, 69, 46–61. [Google Scholar] [CrossRef] - Xue, Y.; Jiang, J.M.; Zhao, B.P.; Ma, T.H. A self-adaptive artificial bee colony algorithm based on global best for global optimization. Soft Comput.
**2018**, 22, 2935–2952. [Google Scholar] [CrossRef] - Kotte, S.; Pullakura, R.K.; Injeti, S.K. Optimal Multilevel Thresholding Selection for Brain MRI Image Segmentation based on Adaptive Wind Driven Optimization. Measurement
**2018**, 130, 340–361. [Google Scholar] [CrossRef] - Yang, X.S.; Deb, S. Cuckoo Search via Lévy flights. In Proceedings of the 2009 World Congress on Nature & Biologically Inspired Computing, Coimbatore, India, 9–11 December 2009. [Google Scholar]
- Qais, M.H.; Hasanien, H.M.; Alghuwainem, S. Transient search optimization: A new meta-heuristic optimization algorithm. Appl. Intell.
**2020**, 50, 3926–3941. [Google Scholar] [CrossRef] - Yang, X.S. Flower Pollination Algorithm for Global Optimization. Unconv. Comput. Nat. Comput.
**2012**, 7445, 240–249. [Google Scholar] - Cotta, C.; Mathieson, L.; Moscato, P. Memetic Algorithms. Springer Int. Publ.
**2016**, 72, 607–638. [Google Scholar] - Biazar, J.; Ghanbary, B. A new approach for solving systems of nonlinear equations. Int. Math. Forum
**2008**, 38, 1885–1889. [Google Scholar] - Jaberipour, M.; Khorram, E.; Karimi, B. Particle swarm algorithm for solving systems of nonlinear equations. Comput. Math. Appl.
**2011**, 62, 566–576. [Google Scholar] [CrossRef] - Oliveira, H.; Petraglia, A. Solving nonlinear systems of functional equations with fuzzy adaptive simulated annealing. Appl. Soft Comput. J.
**2013**, 13, 4349–4357. [Google Scholar] [CrossRef] - Raja, M.A.Z.; Kiani, A.K.; Shehzad, A.; Zameer, A. Memetic computing through bio-inspired heuristics integration with sequential quadratic programming for nonlinear systems arising in different physical models. Springer Plus
**2016**, 5, 2063. [Google Scholar] [CrossRef] [PubMed] - Ibrahim, A.M.; Tawhid, M.A. A hybridization of cuckoo search and particle swarm optimization for solving nonlinear systems. Evol. Intell.
**2019**, 12, 541–561. [Google Scholar] [CrossRef] - Verma, P.; Parouha, R.P. Solving Systems of Nonlinear Equations Using an Innovative Hybrid Algorithm. Iran. J. Sci. Technol. Trans. Electr. Eng.
**2022**, 46, 1005–1027. [Google Scholar] [CrossRef] - Wolpert, D.H.; Macready, W.G. No free lunch theorems for optimization. IEEE Trans. Evol. Comput.
**1997**, 1, 67–82. [Google Scholar] [CrossRef] - Thirugnanasambandam, k.; Prakash, S.; Subramanian, V. Reinforced cuckoo search algorithm-based multimodal optimization. Appl. Intell.
**2019**, 49, 2059–2083. [Google Scholar] [CrossRef] - Civicioglu, P.; Besdok, E.; Gunen, M.A. Weighted differential evolution algorithm for numerical function optimization: A comparative study with cuckoo search, artificial bee colony, adaptive differential evolution, and backtracking search optimization algorithms. Neural Comput. Appl.
**2018**, 26, 3923–3937. [Google Scholar] [CrossRef] - Lu, Z.; Dong, L.; Zhou, J. Nonlinear Least Squares Estimation for Parameters of Mixed Weibull Distributions by Using Particle Swarm Optimization. IEEE Access
**2019**, 7, 60545–60554. [Google Scholar] [CrossRef] - Cheng, J.T.; Xiong, Y. Multi-strategy adaptive cuckoo search algorithm for numerical optimization. Artif. Intell. Rev.
**2022**, 56, 2031–2055. [Google Scholar] [CrossRef] - Wei, J.M.; Yu, Y.G. A novel cuckoo search algorithm under adaptive parameter control for global numerical optimization. Methodol. Appl.
**2020**, 24, 4917–4940. [Google Scholar] [CrossRef] - Pauline, O. Adaptive cuckoo search algorithm for unconstrained optimization. Sci. World J.
**2014**, 2014, 943403. [Google Scholar] - Wang, G.G.; Zhang, Z.J.; Deb, S. Chaotic cuckoo search. Soft. Comput.
**2016**, 20, 3349–3362. [Google Scholar] [CrossRef] - Cheng, J.T.; Wang, L.; Jiang, Q.Y.; Cao, Z.J.; Xiong, Y. Cuckoo search algorithm with dynamic feedback information. Future Gener. Comput. Syst.
**2018**, 89, 317–334. [Google Scholar] [CrossRef] - Tsipianitis, A.; Tsompanakis, Y. Improved Cuckoo Search algorithmic variants for constrained nonlinear optimization. Adv. Eng. Softw.
**2020**, 149, 102865. [Google Scholar] [CrossRef] - Salgotra, R.; Singh, U.; Saha, S. New cuckoo search algorithms with enhanced exploration and exploitation properties. Expert Syst. Appl.
**2018**, 95, 384–420. [Google Scholar] [CrossRef] - Meng, X.J.; Chang, J.X.; Wang, X.B. Multi-objective hydropower station operation using an improved cuckoo search algorithm. Energy
**2019**, 168, 429–439. [Google Scholar] [CrossRef] - Gao, S.Z.; Gao, Y.; Zhang, Y.M.; Xu, L. Multi-strategy Adaptive Cuckoo Search Algorithm. IEEE Access
**2019**, 7, 137642–137655. [Google Scholar] [CrossRef] - Salgotra, R.; Singh, U.; Saha, S. Improved Cuckoo Search with Better Search Capabilities for Solving CEC 2017 Benchmark Problems. In Proceedings of the 2018 IEEE Congress on Evolutionary Computation (CEC), Rio de Janeiro, Brazil, 8–13 July 2018. [Google Scholar]
- Rajabioun, R. Cuckoo Optimization Algorithm. Appl. Soft Comput.
**2011**, 11, 5508–5518. [Google Scholar] [CrossRef] - Li, H.; Xiang, S.; Yang, Y.; Liu, C. Differential evolution particle swarm optimization algorithm based on good point set for computing Nash equilibrium of finite noncooperative game. AIMS Math.
**2021**, 6, 1309–1323. [Google Scholar] [CrossRef] - Huang, Z.Y.; Gao, Z.Z.; Qi, L.; Duan, H. A Heterogeneous Evolving Cuckoo Search Algorithm for Solving Large-scale Combined Heat and Power Economic Dispatch Problems. IEEE Access
**2019**, 7, 111287–111301. [Google Scholar] [CrossRef] - Li, J.; Li, Y.X.; Tian, S.S.; Xia, J.L. An improved cuckoo search algorithm with self-adaptive knowledge learning. Neural Comput. Appl.
**2019**, 32, 11967–11997. [Google Scholar] [CrossRef] - Li, J.; Lei, H.; Wan, G.G. Solving Logistics Distribution Center Location with Improved Cuckoo Search Algorithm. Int. J. Comput. Intell. Syst.
**2020**, 14, 676–692. [Google Scholar] [CrossRef] - Cuong-Le, T.; Minh, H.L.; Khatir, S.; Wahab, M.A.; Tran, M.T.; Mirjalili, S. A novel version of Cuckoo search algorithm for solving optimization problems. Expert Syst. Appl.
**2021**, 186, 115669. [Google Scholar] [CrossRef] - Wang, J.; Zhou, B.; Zhou, S. An Improved Cuckoo Search Optimization Algorithm for the Problem of Chaotic Systems Parameter Estimation. Comput. Intell. Neurosci.
**2016**, 2016, 2959370. [Google Scholar] [CrossRef]

**Figure 4.**Comparison of the distribution in two-dimensional space between 200 best points and 200 random points: (

**a**) two-dimensional best point set; (

**b**) two-dimensional random point set.

**Figure 8.**Partial schematic diagrams of standard test functions in three dimensions: (

**a**) three-dimensional schematic diagram of function f

_{1}; (

**b**) three-dimensional schematic diagram of function f

_{2}.

**Figure 9.**Convergence curve graph: (

**a**) the convergence curves of function f

_{1}; (

**b**) the convergence curves of function f

_{2}; (

**c**) the convergence curves of function f

_{3}; (

**d**) the convergence curves of function f

_{4}.

**Figure 10.**Comparison of numerical solution and analytical solution for first-order linear differential equation.

**Figure 12.**Comparison between numerical and analytical solutions of second-order nonlinear differential equations.

Function | Algorithm | Best Value | Worst Value | Average Value |
---|---|---|---|---|

${f}_{1}$ | ICSABOSM | 7.5378 × 10^{−39} | 3.4674 × 10^{−32} | 4.5386 × 10^{−36} |

CS | 4.5726 × 10^{−31} | 2.6935 × 10^{−25} | 6.5320 × 10^{−29} | |

${f}_{2}$ | ICSABOSM | 0 | 7.0054 × 10^{−35} | 5.3022 × 10^{−40} |

CS | 0 | 6.2378 × 10^{−26} | 4.2057 × 10^{−32} | |

${f}_{3}$ | ICSABOSM | 4.2648 × 10^{−31} | 7.2538 × 10^{−23} | 8.5478 × 10^{−28} |

CS | 7.4875 × 10^{−22} | 4.5902 × 10^{−15} | 4.7326 × 10^{−20} | |

${f}_{4}$ | ICSABOSM | 2.0018 × 10^{−15} | 1.4608 × 10^{−8} | 9.4010 × 10^{−11} |

CS | 1.2450 × 10^{−12} | 3.1634 × 10^{−3} | 3.7025 × 10^{−6} |

Function | Algorithm | Best Value | Worst Value | Average Value |
---|---|---|---|---|

${f}_{1}$ | ICSABOSM | 1.4473 × 10^{−33} | 5.5632 × 10^{−28} | 1.9824 × 10^{−31} |

CS | 6.3557 × 10^{−27} | 8.4367 × 10^{−23} | 5.2564 × 10^{−25} | |

${f}_{2}$ | ICSABOSM | 0 | 6.5837 × 10^{−17} | 5.3704 × 10^{−30} |

CS | 8.3642 × 10^{−17} | 2.4579 × 10^{−11} | 5.3578 × 10^{−15} | |

${f}_{3}$ | ICSABOSM | 4.8346 × 10^{−25} | 3.6849 × 10^{−13} | 7.2841 × 10^{−21} |

CS | 7.3648 × 10^{−14} | 4.3574 × 10^{−9} | 9.3572 × 10^{−13} | |

${f}_{4}$ | ICSABOSM | 4.2602 × 10^{−10} | 9.4738 × 10^{−5} | 5.6173 × 10^{−7} |

CS | 7.6469 × 10^{−5} | 4.6328 × 10^{−2} | 3.7468 × 10^{−3} |

ICSABOSM Parameter Settings | ||||||||

$n$ | $\alpha $ | — | — | — | — | ${P}_{a}$ | ${T}_{\mathrm{max}}$ | $d$ |

20 | 0.01 | — | — | — | — | 0.75 | 1000/8000 | 2/13 |

CS Parameter Settings | ||||||||

$n$ | $\alpha $ | — | — | — | — | ${P}_{a}$ | ${T}_{\mathrm{max}}$ | $d$ |

20 | 0.01 | — | — | — | — | 0.75 | 1000/8000 | 2/13 |

CS-FA Parameter Settings | ||||||||

$n$ | $\alpha $ | ${\eta}_{0}$ | $\tau $ | $\eta $ | ${\overrightarrow{\epsilon}}_{1}$ | ${P}_{a}$ | ${T}_{\mathrm{max}}$ | $d$ |

20 | 0.01 | 1.0 | 1.0 | 1.5 | 0.5 | 0.75 | 1000/8000 | 2/13 |

FA Parameter Settings | ||||||||

$n$ | $\alpha $ | ${\eta}_{0}$ | $\tau $ | — | — | — | ${T}_{\mathrm{max}}$ | $d$ |

20 | 0.5 | 0.2 | 1.0 | — | — | — | 1000/8000 | 2/13 |

PSO Parameter Settings | ||||||||

$n$ | $\omega $ | ${c}_{1}$ | ${c}_{2}$ | — | — | — | ${T}_{\mathrm{max}}$ | $d$ |

20 | 0.9 | 2.0 | 2.0 | — | — | — | 1000/8000 | 2/13 |

**Table 4.**Comparison of mean squared error and maximum absolute error between numerical solution and analytical solution for first-order linear differential equation.

Fourier Series | Least Squares Basis Functions | |
---|---|---|

Mean squared error | 8.4 × 10^{−9} | 2.1 × 10^{−7} |

Maximum absolute error | 0.0013 | 0.0122 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2024 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Sun, Y.
Application of the Improved Cuckoo Algorithm in Differential Equations. *Mathematics* **2024**, *12*, 345.
https://doi.org/10.3390/math12020345

**AMA Style**

Sun Y.
Application of the Improved Cuckoo Algorithm in Differential Equations. *Mathematics*. 2024; 12(2):345.
https://doi.org/10.3390/math12020345

**Chicago/Turabian Style**

Sun, Yan.
2024. "Application of the Improved Cuckoo Algorithm in Differential Equations" *Mathematics* 12, no. 2: 345.
https://doi.org/10.3390/math12020345