A cutting plane algorithm for globally solving low-dimensional k-means problems

Martin Ryner, Jan Kronqvist, Johan KarlssonOptim. Lett 2025

The k-means clustering problem is a fundamental tool in data science, yet finding its global optimum remains a significant challenge. While the standard Lloyd’s algorithm is widely used, it is a local search heuristic prone to getting stuck in suboptimal local minima. Global optimization methods, such as Semidefinite Programming (SDP) relaxations, often fail to scale as the number of data points ($n$) grows. This research introduces a novel cutting plane algorithm designed to find the globally optimal solution efficiently, particularly for large-scale, low-dimensional datasets.

The Global Optimization Challenge

The difficulty of k-means arises from its NP-hard nature. Most existing global solvers struggle with scalability; as $n$ increases, the computational cost becomes prohibitive. This paper addresses this gap by focusing on scenarios where the number of observations is massive (millions of points), but the dimensionality ($d$) and the number of clusters ($k$) are relatively small.

Methodology: Concave Reformulation and Cutting Planes

The core of the proposed approach is the transformation of the k-means problem into a structured concave assignment problem. This reformulation allows the researchers to leverage the property that the minimum of a concave function over a convex set occurs at an extreme point.

The algorithm employs an iterative cutting plane strategy to refine the search space:

  1. Outer Approximation: The process begins with a simple convex polytope (a simplex) that contains the feasible region.
  2. Lower and Upper Bounds: A small concave sub-problem is solved to find a candidate solution, providing a lower bound. This candidate is then used to solve a linear assignment problem, yielding a valid clustering and an upper bound.
  3. Refinement via Cuts: If a gap exists between the bounds, a "cutting plane"—a linear constraint—is added to the polytope to exclude the current suboptimal candidate without removing any globally optimal solutions.
The iterative cutting plane process: (A) identifying a candidate solution $Z_N$ on the current approximation, (B) calculating the gradient to generate a cut, and (C) refining the search space to find $Z_{N+1}$.

To ensure practical performance, the authors integrated several acceleration techniques, including symmetry breaking to avoid redundant clusterings and spatial branching to manage the complexity of the approximating polytope.

Key Insights: Decoupling Complexity

A pivotal insight of this work is that the complexity of the global k-means problem can be decoupled from the number of data points. By shifting the dependence on $n$ into a linear sub-problem that can be solved in $O(nkd)$ time, the algorithm handles millions of points with ease. The primary drivers of computational difficulty are instead the dimensionality $d$ and the number of clusters $k$.

Experimental Results

The algorithm was tested on synthetic datasets and real-world benchmarks (e.g., Iris, Rice, Ecoli).

  • Scalability: On synthetic data ($k=3, d=2$), the algorithm solved a problem with 1,000,000 points in approximately 346 seconds. In comparison, state-of-the-art SDP solvers typically fail beyond 500 points.
  • Optimality: The method consistently achieved an optimality gap of $10^{-4}$, providing a mathematical guarantee of quality.
  • Real-World Efficiency: On the "Rice" dataset ($n=3810, d=7, k=2$), the algorithm found the global optimum in 1.57 seconds, whereas competing global solvers failed to converge within 10,000 seconds.

Limitations and Future Work

While highly effective for low-dimensional data, the algorithm faces the "curse of dimensionality," as complexity grows exponentially with $k \times d$. For high-dimensional tasks, dimensionality reduction remains a necessary preprocessing step. Future research aims to improve polytope management through pruning redundant constraints and developing more advanced branching heuristics to extend the algorithm's reach to higher dimensions.

Summary updated

BibTeX
@article{ryner2025cutting,
  author = {Martin Ryner and Jan Kronqvist and Johan Karlsson},
  title = {{A cutting plane algorithm for globally solving low-dimensional k-means problems}},
  journal = {Optim. Lett.},
  year = {2025},
  doi = {10.1007/s11590-025-02235-z},
}
Figure