Skip to main content
. 2019 Sep 21;19(19):4089. doi: 10.3390/s19194089
Algorithm 4 Get the next cell to visit according to pheromone matrix
Input:Plocal, Pglobal
Output:Di,j
  •  1:

    Create collection Cglobal that contains all elements of Pglobal

  •  2:

    Create collection Clocal that contains all elements of Plocal

  •  3:

    Create empty collection C

  •  4:

    forpa,b in Clocal do

  •  5:

            if pa,b=0 then

  •  6:

                    put (a,b) into C

  •  7:

            end if

  •  8:

    end for

  •  9:

    if|C|0then

  • 10:

            (i,j)random(C)

  • 11:

    end if

  • 12:

    if|C|=0then

  • 13:

            for pa,b in Cglobal do

  • 14:

                    if pa,b=min(Cglobal) then

  • 15:

                            put (a,b) into C

  • 16:

                    end if

  • 17:

            end for

  • 18:

            (i,j)random(C)

  • 19:

    end if