kmeans algo for node