Algorithm
Initialize k prototypes wjā=xpā,Ā jā{1,ā¦,k},Ā pā{1,ā¦,P}where we pick random points in the dataset (i.e.Ā kā¤P) to initialize each weight. Each cluster Cjā is associated with prototype wjā while for each xpā in input set: put xpā in cluster with nearest prototype wjā for j in range(k): wjā=ā£cJāā£1āxlāācjāāāxlā where cjā is the cluster size E=j=1ākāxlāācjāāāā£xlāāwjāā£2 if(E not increasing): break