Skip to main content
. 2023 Mar 10;23(6):3014. doi: 10.3390/s23063014
Algorithm 2 2D UFBS placement process through the k-medoids algorithm
  • 1:

    input: The set of coordinates of all GMTs U={u1,u2,,uN}, and the number of UFBSs Y

  • 2:

    ϵ=106

  • 3:

    t = 0

  • 4:

    Initialize Y medoid points Ct=p1m,p2m,...,pYmU, randomly

  • 5:

    Sk = ,k=1,2,,Y.

  • 6:

    fori1 to N do

  • 7:

        k=argmink=1YuiCkt

  • 8:

        Sk=Skui

  • 9:

    end for

  • 10:

    At=k=1YulSkuiCkt2

  • 11:

    repeat

  • 12:

        for k1 to Y do

  • 13:

            for i1 to N do

  • 14:

               if uiCt then

  • 15:

                   Swap the role of Ckt with ui

  • 16:

                   Repeat steps 6 to 9

  • 17:

                   B=k=1YulSkuiCkt2

  • 18:

                   if B<At then

  • 19:

                       t = t +1

  • 20:

                       Ckt = ui

  • 21:

                       At=B

  • 22:

                   end if

  • 23:

               end if

  • 24:

            end for

  • 25:

        end for

  • 26:

    until CtCt1ϵ

  • 27:

    output: A set of centroid points that the Y UFBSs will be deployed Ct.