A bad 2-dimensional instance for k-means++

Ragesh Jaiswal, Prachi Jain, Saumya YadavarXiv 2013

Abstract

The k-means++ algorithm is widely regarded as the industry standard for initializing cluster centers, offering a provable $O(\log k)$ approximation ratio in expectation. Historically, "worst-case" scenarios for this algorithm were confined to high-dimensional spaces, leading to a conjecture that k-means++ might perform significantly better in low-dimensional settings. This paper refutes that notion by constructing a specific 2-dimensional dataset where k-means++ fails to achieve a good approximation with a probability that is exponentially small in the number of clusters $k$.

Introduction

The k-means problem—minimizing the sum of squared distances between data points and their nearest cluster centers—is a fundamental task in data science. Because the problem is NP-hard, practitioners rely on heuristic approaches like Lloyd’s algorithm. However, Lloyd’s algorithm is highly sensitive to its initial "seeding" points. To address this, Arthur and Vassilvitskii introduced k-means++, which uses $D^2$ sampling to pick centers sequentially with a probability proportional to their squared distance from existing centers.

While k-means++ provides an $O(\log k)$ approximation guarantee, the known lower-bound examples were all high-dimensional. This paper investigates whether the geometric constraints of two dimensions are sufficient to prevent such poor performance.

The Synthetic 2D Construction

The authors' primary contribution is the design of a synthetic 2D dataset that acts as a "trap" for the $D^2$ sampling mechanism. The instance consists of $k$ clusters arranged as vertical bars along the x-axis.

Schematic of the synthetic 2D dataset designed to trap k-means++.

As shown in the figure, the construction relies on two key features:

  1. Exponential Density Decay: The number of points in each cluster decreases exponentially from left to right. Specifically, the $i$-th cluster contains $m / 4^{i-1}$ points (or $m / 2^{2(i-1)}$).
  2. Geometric Spacing: The bars are placed at increasing intervals ($0, 2r, 4r, \dots$) and have increasing heights ($r, 2r, 4r, \dots$).

This configuration ensures that the "gravitational pull" of high-density clusters (those with more points) outweighs the distance-based sampling of the more distant, lower-density clusters.

Theoretical Analysis

To analyze the algorithm's failure, the authors introduce the Biased Sampling Problem (BiasedSampBall). This mathematical framework allows them to calculate the likelihood that the algorithm "covers" a sufficient number of optimal clusters.

The core insight is that density can trump distance. In k-means++, the probability of selecting a point as a center is the product of its squared distance to the nearest center and the local density of points. By making the initial clusters exponentially "heavier," the authors ensure that the algorithm is overwhelmingly likely to repeatedly sample from the same few dense clusters, even after they have already been "covered" by a center. Consequently, the algorithm fails to spread its $k$ centers across the $k$ optimal clusters.

Key Results

The paper provides a rigorous proof that for $k \ge 10^3$, the probability of k-means++ achieving an approximation factor better than approximately $1.125$ is at most $(2\sqrt{k}) \cdot 2^{-k/300}$. This result demonstrates that as the number of clusters $k$ increases, the probability of the algorithm succeeding on this 2D instance vanishes exponentially.

Furthermore, the authors extend this logic to the k-median++ algorithm. By adjusting the point counts to account for linear distance ($D$ sampling) rather than squared distance, they show that k-median++ is similarly vulnerable to density-based traps in 2D.

Conclusion

This work proves that dimensionality is not a shield against the worst-case behavior of k-means++. While the constructed dataset is highly engineered and unlikely to appear in typical real-world applications, it establishes a theoretical limit on the algorithm's performance in low dimensions.

Future research remains to bridge the gap between this constant-factor failure and the $O(\log k)$ theoretical lower bound. Whether an even "worse" 2D instance exists—one that forces a logarithmic approximation ratio—remains an open and intriguing question for the community.

Summary updated

BibTeX
@misc{jaiswal2013bad,
  author = {Ragesh Jaiswal and Prachi Jain and Saumya Yadav},
  title = {{A bad 2-dimensional instance for k-means++}},
  year = {2013},
  eprint = {1306.4207},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1306.4207},
}
Figure