K-Means

K-means is an unsupervised machine learning algorithm for clustering data into kkk distinct groups. It partitions data points into k clusters by minimizing the within-cluster variance (sum of squared distances to centroids).

Steps:

  1. Initialization: Randomly select k centroids.
  2. Assignment: Assign each data point to the nearest centroid (using Euclidean distance).
  3. Update: Recalculate centroids as the mean of all points in their cluster.
  4. Repeat until convergence (centroids stabilize or max iterations reached).

In HPC environments, k-means finds applications in clustering simulation data from large-scale computational models, optimizing parallel computing workloads, and analyzing scientific datasets such as those from particle physics or climate modeling. It enables feature extraction in computational biology applications like protein folding simulations and supports the organization of vast datasets for improved storage and retrieval.

K-means is an “embarrassingly parallel” algorithm, meaning its computations can be efficiently distributed across multiple processors with minimal communication overhead. Each iteration involves independent distance calculations for point-to-centroid assignments and separate centroid updates per cluster, enabling straightforward parallelization across CPU cores or compute nodes. This inherent scalability makes k-means particularly well-suited for large-scale HPC environments.

Related program(s): K-means kernel
Related discipline(s):