Grouping or clustering is the process of classifying objects. This information is obtained from data that describes the relationship between objects by using the principle of maximizing similarities between members of one class and creating similarities between classes. One of the grouping methods is the K-Means algorithm. In general, the K-Means algorithm determines the centroid value randomly…