Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

K-Means Clustering Algorithm

Machine Learning Algorithm

K-means clustering is an algorithm that partitions a set of data points into a chosen number of groups, or clusters, by assigning each point to whichever cluster's center, or centroid, is nearest to it and choosing centroids that minimize the total squared distance between points and their assigned cluster center. The standard algorithm alternates between two steps until the assignment stops changing: it assigns every point to its nearest current centroid, and it then recomputes each centroid as the average position of the points currently assigned to it. The underlying method was developed by Stuart Lloyd at Bell Labs in 1957 for a signal-processing application, though it was not published until 1982, and Edward Forgy independently proposed essentially the same procedure in 1965, so the algorithm is sometimes called the Lloyd-Forgy algorithm; the term k-means itself was introduced by James MacQueen in 1967. K-means is fast and widely used in practice, but as a heuristic it can converge to a local rather than a globally optimal grouping and requires the number of clusters to be chosen in advance.

Facts
Time Complexity
Time Complexity (category)
Polynomial Time -- O(n^k) 1
Classification
Design Technique
Heuristic or Approximation 1
Connections

Uses Design Technique

Entity-backed identity for the design-technique enum value this algorithm already carries, resolved to a computing concept by an explicit value-to-entity map (phase 3 bucket conversion, docs\design_entity_backed_browse_buckets_20260928.md). The design-technique fact itself stays on the algorithm unchanged.

Heuristics, Concepts

Entity-backed identity for the design-technique enum value this algorithm already carries, resolved to a computing concept by an explicit value-to-entity map (phase 3 bucket conversion, docs\design_entity_backed_browse_buckets_20260928.md). The design-technique fact itself stays on the algorithm unchanged.

Sources
1. K-Means Clustering Algorithm (Wikipedia)
  • Wikipedia infobox: time complexity polynomial
    polynomial
  • Wikipedia: design technique heuristic-approximation
    heuristic-approximation
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.