A Batched Hartigan's k-Means Clustering
Edward Raff, Michael Slawinski
NeurIPS page · OpenReview · Open on the map
Category: Time Series, PDEs & Probabilistic ML › Clustering and Matching under Uncertainty · Type: new method · Keywords: k-means clustering, Hartigan's algorithm, parallel computation, vectorization, triangle inequality
Areas: Optimization & Algorithms › Optimal Transport and Sampling › Clustering and Diversity Algorithms
Summary
Batched Hartigan's method introduces vectorized, parallelizable updates to Hartigan's k-means, making it competitive with Lloyd's in speed while preserving its theoretical advantages.
Explained to a 5-year-old
People sometimes want to group lots of things together, like sorting toys into boxes. One way to do this is called Hartigan's method, which tries to make the groups as good as possible. However, this clever method is slow because it has to check many things one after another. The new idea is to group many of those checks together so they can be done at the same time. Now the good method is fast enough to be used, just like the faster method people already use.
Explained to a 5-year-old, longer
Imagine you have a bunch of objects, like balls, and you want to put them into groups where each group has similar things. One clever way to do this is called Hartigan's method, which tries to make the groups as good as possible. However, this clever method is slow because it has to check many things one after another. The paper comes up with a new idea: they group many of those checks together so they can be done at the same time. By doing many checks together, the method becomes much faster, like using a big brush to paint many walls at once. This new way keeps the good qualities of the original method, so the groups are still very good. Now the good method is fast enough to be used on big sets of objects, just like the faster method many people already use. This means you can get better results without waiting a long time. It helps when you have a lot of data, like sorting many photos or many emails. The idea is simple: do the slow steps together to make everything quicker. This makes the original clever method practical for everyday use. As a result, you can enjoy better grouping with less waiting.
For a technical reader
The paper addresses the practical slowness of Hartigan's k-means, a clustering algorithm known for its strong theoretical guarantees. By leveraging the triangle inequality, the authors identify which distance updates can be performed in parallel and batch them for vectorized computation. Only a small subset of updates remains sequential, preserving the algorithm's convergence properties while dramatically reducing its runtime. The resulting batched version matches the speed of the widely used Lloyd's k-means, making the theoretically superior algorithm viable for large-scale datasets. This improvement enables engineers to adopt Hartigan's method in production pipelines without sacrificing performance or accuracy.
Problem
Hartigan's k-means algorithm, while theoretically superior to Lloyd's k-means, is impractical for large datasets due to its sequential nature, which limits its speed. This creates a gap between theoretical benefits and practical adoption.
Method
The approach exploits the triangle inequality to identify parallel-safe updates, batching them for vectorized computation, while retaining a smaller set of sequential updates. This reduces the sequential bottleneck of Hartigan's original algorithm. The resulting batched version can be executed efficiently on modern hardware.
Results
The approach achieves execution speed comparable to Lloyd's k-means, making Hartigan's algorithm practically usable for the first time.
Contributions
It introduces a vectorized, parallelizable version of Hartigan's k-means that retains its theoretical benefits while matching the speed of Lloyd's algorithm. This bridges the gap between theory and practice for Hartigan's method.
Practical relevance
This enables practitioners to use the theoretically superior Hartigan's algorithm on large datasets without sacrificing speed, improving the quality of clustering results.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction