Abstract
We study the classic $k$-median and $k$-means clustering objectives in the beyond-worst-case scenario. We consider three well-studied notions of structured data that aim at characterizing real-world inputs: Distribution Stability, Spectral Separability, and Perturbation Resilience. We prove structural results showing that inputs satisfying at least one of the conditions are inherently "local". Namely, for any such input, any local optimum is close both in term of structure and in term of objective value to the global optima. As a corollary we obtain that the widely-used Local Search algorithm has strong performance guarantees for both the tasks of recovering the underlying optimal clustering and obtaining a clustering of small cost. This is a significant step toward understanding the success of local search heuristics in clustering applications.
Introduction
In computer science theory, $k$-means and $k$-median clustering are notoriously difficult problems, classified as NP-hard and APX-hard. This suggests that no efficient algorithm can find the perfect solution for every possible input. However, practitioners have successfully used heuristics like Local Search and Lloyd’s algorithm for decades. This creates a "theory-practice gap": while theoreticians focus on "worst-case" inputs designed to trip up algorithms, practitioners deal with "structured" real-world data where clusters are usually distinct and meaningful. This paper bridges this gap by investigating whether the inherent structure of real-world data is what makes simple heuristics so effective.
The Local Search Algorithm
The paper focuses on Local Search, an intuitive algorithm that starts with an arbitrary set of cluster centers and iteratively swaps them out for better ones as long as the total cost decreases significantly.
The algorithm, detailed in Algorithm 1, continues to swap centers in the set $S$ as long as a new set $S'$ exists within a defined neighborhood size ($2/\epsilon$) that reduces the cost by a factor of at least $(1 - \epsilon/n)$.
Structural Analysis and "Locality"
The core contribution is a unified structural analysis under three popular mathematical definitions of "structured" data:
- Distribution Stability: Points are significantly closer to their own cluster center than to any other.
- Spectral Separability: Clusters are well-separated when projected onto a lower-dimensional "spectral" subspace.
- Perturbation Resilience: The optimal clustering remains the same even if distances between points are slightly modified.
The authors prove that for any input satisfying these conditions, the problem landscape is well-behaved. Specifically, they demonstrate that these stability conditions make clustering problems inherently "local."
As illustrated in the geometric analysis above, in a stable instance, improving a solution locally (e.g., swapping a few centers) is sufficient to guide the algorithm toward the global optimum. A local optimum $\mathcal{L}(i)$ is guaranteed to be close to the ground-truth optimal center $c_i^*$, effectively recovering the underlying cluster structure.
Key Results and Empirical Validation
Theoretical Guarantees
The authors prove that Local Search is a Polynomial-Time Approximation Scheme (PTAS) for both distribution-stable and spectrally-separable instances. This means the algorithm can achieve a cost arbitrarily close to the optimal cost in polynomial time. Furthermore, for $\gamma$-perturbation resilient instances where $\gamma > 3$, Local Search is proven to find the exact optimal solution.
Empirical Success
The theoretical findings were validated using synthetic Gaussian mixtures and classic real-world datasets from the UCI Repository, including iris, digits, abalone, and movement_libras.
- On the
irisanddigitsdatasets, Local Search correctly classified 90% and 76.2% of points, respectively. - Real-world datasets were found to naturally satisfy the $\beta$-stability condition for $\beta > 0.06$, confirming that the theoretical models align with practical reality.
- The paper also connects these findings to the "elbow method," showing that the sharp drop in cost at the correct $k$ corresponds to the stability properties that ensure Local Search's success.
Conclusion and Future Work
This work provides a rigorous theoretical foundation for why local search heuristics perform so well in practice. By moving beyond worst-case analysis, the authors show that structured data simplifies the optimization landscape. Future research directions include investigating the relationship between these stability conditions and Linear Programming (LP) relaxations, as well as further exploring the dependency of stability parameters on data dimensionality.
Summary updated