Skip to main content
. 2023 Jul 4;25(7):1021. doi: 10.3390/e25071021
Algorithm 1 FCM
  • 1:

    C: number of clusters

  • 2:

    m: the degree of fuzziness (m>1)

  • 3:

    ϵ: the error

  • 4:

    Initalize randomly the centers of clusters ci(0)

  • 5:

    Begin at iteration k=1.

  • 6:

    repeat

  • 7:

         Calculate the membership uij(k) using the centers ci(k1):

  • 8:

         uij=1k=1cdijdkj2m1

  • 9:

      Calculate the membership matrix U(k)=[uij]c×n using the membership uij(k).

  • 10:

       Update the centers ci(k) using uij(k)

  • 11:

    ci=j=1nuijmxjj=1nuijm

  • 12:

    until U(k+1)U(k)<ϵ

  • 13:

    Return ci(k)