Abstract
The Boundary Weighted K-means (BWKM) algorithm is a recursive, parallelizable approach designed to scale K-means clustering to massive datasets. By partitioning data into weighted blocks and focusing refinement efforts only on "boundary" regions where cluster assignments are ambiguous, it achieves high-quality solutions while performing 2 to 6 orders of magnitude fewer distance computations than standard methods.
Introduction
The classic K-means algorithm (Lloyd’s algorithm) has a computational complexity of $O(n \cdot K \cdot d)$, where $n$ is the number of points, $K$ is the number of clusters, and $d$ is the dimensionality. For "massive data"—datasets with millions of instances or high dimensions—this becomes a significant bottleneck.
Existing solutions like Mini-batch K-means trade off accuracy for speed by using random subsamples. Conversely, previous recursive partitioning methods (grid-based) suffered from the "curse of dimensionality," where the number of blocks exploded exponentially ($2^d$) as dimensions increased. BWKM seeks a method that scales linearly with dimensionality and focuses computational resources only where they are needed most: the boundaries between clusters.
Methods
BWKM builds on the idea of "weighted" K-means. Instead of processing every individual point, the algorithm operates on a set of representatives (the centers of mass of spatial blocks) and their associated weights (the number of points in each block).
The core innovations include:
- Well-Assigned Blocks: A block is "well-assigned" if every point within it belongs to the same cluster. The authors derive a "cheap" mathematical criterion to detect this using only the block's diagonal length and its distance to the two nearest centroids.
- Boundary Refinement: Unlike grid-based methods that split every cell, BWKM only splits blocks that fail the well-assigned test (the "boundary").
- Linear Dimensionality Scaling: When a block needs to be refined, it is split along its longest side. This ensures the number of representatives grows controlledly rather than exponentially with $d$.
The algorithm starts with a smart initial partition that prioritizes high-density and boundary regions, using a probabilistic heuristic based on a weighted version of K-means++.
Datasets
The algorithm was evaluated on five diverse, well-known real-world datasets, ranging from small high-dimensional sets to massive low-dimensional ones.
These datasets include Corel Image Features (CIF), 3D Road Network (3RN), Gas Sensor (GS), SUSY, and Web Users Yahoo! (WUY), with the latter containing over 45 million instances.
Key Insights and Results
The primary insight of BWKM is that distance calculations for every point in a dense cluster center are often redundant. If a bounding box of points is sufficiently far from the nearest cluster boundary, all points in that box must belong to the same centroid. The authors prove that if all blocks in a partition are "well-assigned," the solution found by the weighted algorithm is a local optimum for the entire original dataset.
By representing millions of points with just a few thousand weighted representatives, the assignment step of K-means becomes trivial. On the largest dataset (WUY), BWKM reached a 1% error threshold while computing 4 to 5 orders of magnitude fewer distances than standard K-means++ and 2 to 4 orders fewer than Mini-batch K-means. Furthermore, in 7 out of 15 experimental configurations, BWKM found the best overall solution (lowest error) among all competitors.
Conclusion
BWKM demonstrates that data-dependent partitioning can overcome the limitations of traditional grid-based clustering. While the current implementation assumes hyperrectangular blocks, future work could explore more complex shapes for tighter bounds. Additionally, implementing BWKM on distributed frameworks like Apache Spark and integrating it with distance pruning techniques (like the triangle inequality) could lead to even further speedups for production-scale use.
Summary updated