Skip to main content
. 2024 Jan 29;10:e1816. doi: 10.7717/peerj-cs.1816

Algorithm 2. Binary Reinforced Cuckoo Search Algorithm.

Input: Total Population of the nest ( N), dimensions (d), objective function f()
Output: Fitness_xbest and xbest
Each x consists of dimensions (1… d)
PopNest, Termination Criteria, α=0.1,Pa
1: Initialize individuals in host nest x
2: for i1toN do
3:   xirandi([0,1],d,1)
4:   Calculate Fitness_xif(xi)
5: end for
6: while (Termination Condition not met) do
7:     for i1toN
9:         Levy=randi([0,1],1,1)
10:      xt!randi([0,1],d,1)
11:       xt2randi([0,1],d,1)
12:       yi = xt!xt2
13:    end for
14:   Calculate Fitness_yif(yi) where i1N
15:   for i1toN
16:      if ( Fitness_yiFitness_xi)
17:          xiyi
18:          Fitness_xiFitness_yi
19:     end if
20:  end for
21:  Compute mean value σt=i=1Nf(xi)N
22:  Compute Fitness Difference ϑt=C×(σtf(xtbest))
23:  Compute Threshold Value Θt=f(xtbest)+ϑt
24:  Find the index of abandon solutions At,k=index(f(xi))>Θt|andk{1
25:  Find the index of qualified solutions Qt,L=At,k
26:  Calculate α=|f(xtbest)σt×ω|φ
27:  for i=1tosize(At,k), then
28:        ΔX=j=1m(xjxi)2m where mQt,K
29:       if α>0.5,then
30:          xi=Sum(xnewΔX)
31:       else
32:          xi=Carry(xnewΔX)
33:       end if
34:  end for
35:   Fitness_xbest=min(f(xi))
36:   xbest=index(Fitness_xbest)
37: end while