Skip to main content
. 2025 Jun 29;10(7):421. doi: 10.3390/biomimetics10070421
Algorithm 2 Self-learning operation
  • Require: 

    CBestt+2/3Rn: initial solution

  • Ensure: 

    CBestt+1Rn: result solution

  •     1:

    CurrentSolutionCBestt+2/3

  •     2:

    CurrentFitnessFitness(CurrentSolution)

  •     3:

    while stop condition not meet do

  •     4:

        NeighborsGenerateNeighbors(CurrentSolution)

  •     5:

        BestFitnessCurrentFitness

  •     6:

        for Neighbor in Neighbors do

  •     7:

            NeighborFitnessFitness(Neighbor)

  •     8:

            if NeighborFitness > BestFitness then

  •     9:

                 BestNeighborNeighbor

  •   10:

               BestFitnessNeighborFitness

  •   11:

            end if

  •   12:

        end for

  •   13:

        if BestFitness > CurrentFitness then

  •   14:

            CurrentSolutionBestNeighbor

  •   15:

            CurrentFitnessBestFitness

  •   16:

        else

  •   17:

            break

  •   18:

        end if

  •   19:

    end while

  •   20:

    CBestt+1CurrentSolution

  •   21:

    Return  CBestt+1