Skip to main content
. 2026 May 27;11(6):370. doi: 10.3390/biomimetics11060370
Algorithm 2 Comprehensive Learning Fungal Growth Optimizer (CLFGO)
  •   1:

    Input: Population size N, maximum function evaluations MaxFEs, dimension D, bounds SL→,SU→, stagnation threshold m, learning bounds a,b

  •   2:

    Initialize N hyphae Si→ using Equation (1); evaluate fitness; identify S∗→

  •   3:

    Initialize personal best positions pbesti→←Si→, stagnation counters sci←0, ∀i

  •   4:

    Compute learning probabilities Pci using Equation (6), ∀i

  •   5:

    FEs←N, t←1

  •   6:

    while FEs<MaxFEs do

  •   7:

        for i=1 to N do                                               ▹ CLS Module

  •   8:

            if FEs≥MaxFEs then

  •   9:

               break

  • 10:

            end if

  • 11:

            if sci≥m then                                           ▹ Individual i is stagnant

  • 12:

               for j=1 to D do                                         ▹ Build exemplar vector ei

  • 13:

                   Generate rand∼rand(0,1)

  • 14:

                   if rand<Pci then

  • 15:

                       Randomly select k1,k2≠i

  • 16:

                       ei(j)←argmink∈{k1,k2}pfit(k)                                  ▹ Tournament selection

  • 17:

                   else

  • 18:

                       ei(j)←i                                           ▹ Learn from own best

  • 19:

                   end if

  • 20:

               end for

  • 21:

               if ei(j)=i,∀j then                                            ▹ Safeguard check

  • 22:

                   Randomly select dimension j′ and individual k3≠i

  • 23:

                   ei(j′)←k3

  • 24:

               end if

  • 25:

               Construct candidate SiCL→: for each dimension j, set Si,jCL←pbestei(j),j

  • 26:

               Evaluate SiCL→ and set FEs←FEs+1

  • 27:

               if f(SiCL→)<f(Sit→) then Sit→←SiCL→; sci←0

  • 28:

            end if

  • 29:

        end for

  • 30:

                                              ▹ Standard FGO Update (Algorithm 1, Lines 6–16)

  • 31:

        Execute Hyphal Tip Growth or Branching-Germination loop on all individuals while respecting MaxFEs

  • 32:

        Perform greedy selection for each individual; update pbesti→ and sci accordingly

  • 33:

        Update global best S∗→ if a better solution is found

  • 34:

        t←t+1

  • 35:

    end while

  • 36:

    Output: Global best solution S∗→