Skip to main content
. 2023 Mar 10;23(6):3014. doi: 10.3390/s23063014
Algorithm 1 2D UFBS placement process through the k-means 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 centroid points Ct=p1c,p2c,...,pYcU, randomly

  • 5:

    repeat

  • 6:

        Sk = ,k=1,2,,Y

  • 7:

        for i1 to N do

  • 8:

            k=argmink=1YuiCkt

  • 9:

            Sk=Skui

  • 10:

        end for

  • 11:

        for k1 to Y do

  • 12:

            Ckt=1|Sk|ulSkul.

  • 13:

        end for

  • 14:

        t = t +1

  • 15:

    until CtCt1ϵ

  • 16:

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