Skip to main content
. 2021 Jun 14;21(12):4086. doi: 10.3390/s21124086
Algorithm 1 MFO based Clustering Algorithm.
Input:
  • (i)
    O = D dimension dataset with N data objects
  • (ii)
    K = Number of clusters
Output:
  • (i)
    Z = Set of K clusters {Z1,Z2ZK} of data objects

Begin

  • 1:

    Initialize

    P = population size

    MaxIter = maximum number of iterations

    p=1PSp = Each Moth with K random cluster centre

  • 2:

    itr = 1

  • 3:

    while  itr<MaxItr  do

  • 4:

        for p = 1 to P do

  • 5:

            for i = 1 to N do

  • 6:

    Calculate the Euclidean distance of each data object Oi to cluster centres of Sp

  • 7:

    Assign Oi to nearest cluster centres of Spk, k= 1 to K

  • 8:

    Calculate the fitness using (2)

  • 9:

            end for

  • 10:

        end for

  • 11:

    Populate Flames F and their fitness FF

  • 12:

    Update Moths positions using Flames and logarithmic spiral function mentioned in 8

  • 13:

    end while

  • 14:

    Assign Z = F1

  • 15:

    return Z

End