Skip to main content
. 2026 May 22;11(6):361. doi: 10.3390/biomimetics11060361
Algorithm 1 Improved Kingfisher Optimization (IPKO) Algorithm
  •   1:

    Step 1: Sine chaotic opposition-based initialization (Equations (5)–(10))

  •   2:

    Initialize population X, evaluate fitness, find Gbest, fbest

  •   3:

    Set stuck=0

  •   4:

    Step 2: Main loop

  •   5:

    for t=1 to MaxIter do

  •   6:

       for i=1 to N do

  •   7:

         Step 3: Adaptive directional search

  •   8:

         Compute PE

  •   9:

         if rand() ≤(1−PE)(Equation(11)) then

  • 10:

            r1=randi([1,N]), r=rand()

  • 11:

            X2=(Gbest−Xi(t−1))×r

  • 12:

            B=2×cos(π2×(1−tMaxIter))

  • 13:

            θ=⌈360×rand()⌉

  • 14:

            V=randi([2,5])

  • 15:

            Xnew=X2+(Xr1(t−1)−Xi(t−1))×cosθ×B×V×rand()

  • 16:

            +Xr1(t−1)×sinθ×B×rand()

  • 17:

            Xi(t)=CentroidBoundary(Xnew) (Equations (20)–(23))

  • 18:

         else

  • 19:

            Xi(t)=OriginalPKODiving(Xi(t−1))

  • 20:

            Xi(t)=CentroidBoundary(Xi(t))

  • 21:

         end if

  • 22:

         Step 4: Stochastic binary perturbation fusion

  • 23:

         if f(Xi(t))<fbest then

  • 24:

            stuck=0, Gbest=Xi(t), fbest=f(Xi(t))

  • 25:

         else

  • 26:

            stuck=stuck+1

  • 27:

         end if

  • 28:

         if stuck≥5 then

  • 29:

            Choose r1,r2,r3 distinct and ≠i

  • 30:

            y=(Xi(t)+Xr3(t))/2

  • 31:

            U1=(rand(1,Dim)>0.5)

  • 32:

            Xnew=U1·Xi(t)+(1−U1)·(y+rand()·(Xr1(t)−Xr2(t))) (Equation (19))

  • 33:

            Xi(t)=CentroidBoundary(Xnew)

  • 34:

            stuck=0

  • 35:

         end if

  • 36:

       end for

  • 37:

    end for

  • 38:

    return Gbest, fbest