Skip to main content
. 2022 Jun 16;22(12):4539. doi: 10.3390/s22124539
Algorithm 1 Fuzzy C-means clustering.
  • 1:

    parameters: p,n,N,fm,pl,pm,Dfm,d

  • 2:

    initialize: p,n,N,fm,pl,pm,Dfm,d

  • 3:
    randomly initialize the membership matrix:
                     Distance=0Distance(1,2)Distance(1,n)0Distance(n,1)Distance(n,2)0
  • 4:
    calculate the centroid:
                            Centroid((plql),(pmqm))=pl+qm2,ql+qm2
  • 5:
    calculate the Euclidean distance:
                            EU(pq)=(pmpl)2+(qmql)2
  • 6:
    update the new membership matrix:
                            obj(f)=k=1Nj=1nD(kj)fm·d(kj)2
  • 7:

    repeat

  • 8:

        step 4

  • 9:

    until centroids no longer change

  • 10:

    while the topology has changed do

  • 11:

        steps 1 to 6

  • 12:

    end while