Abstract
We investigate $k$-means clustering in the online no-substitution setting when the input arrives in an arbitrary order. In this setting, points arrive sequentially, and the algorithm must instantly and irrevocably decide whether to take the current point as a center before observing the next point. The goal is to minimize both the number of centers and the $k$-means cost. Previous works in this setting assume that the input's order is random or that the input's aspect ratio is bounded. It is known that if the order is arbitrary and there is no assumption on the input, any algorithm must take all points as centers. We introduce a new complexity measure, the Online Center measure ($OC_k$), that quantifies the difficulty of clustering a dataset arriving in arbitrary order. We design a randomized algorithm and prove that for data with complexity $d$, the algorithm takes $O(d \log(n) k \log(k))$ centers and achieves an $O(k^3)$-approximation. For "natural" distributions, such as a mixture of $k$ Gaussians, $OC_k = O(k^2 \log n)$, implying that our algorithm takes only $\text{poly}(k \log n)$ centers.
Introduction
In standard $k$-means clustering, the entire dataset is available for processing. However, many real-world applications require online processing where decisions are made on the fly. In the no-substitution setting, points arrive one by one, and for every point, the algorithm must immediately decide: "Is this a cluster center?" Once a point is rejected, it can never be chosen later; once accepted, it remains a center permanently.
Previous research largely relied on the assumption of random order arrival to make the problem tractable. Without this, an adversary could present points in a pathological sequence (e.g., points at $2^1, 2^2, 2^3...$) that forces an algorithm to either pick every point as a center or suffer extreme costs. This paper bridges the gap by introducing a complexity measure that identifies when a dataset is "clusterable" even under adversarial ordering.
The Online Center Measure ($OC_k$)
The authors propose the Online Center measure ($OC_k(X)$) to quantify the inherent difficulty of a dataset $X$. This measure counts the length of the longest sequence of points where each new point is significantly "far" from all previous points—specifically, farther than the diameter of the optimal $(k-1)$-clustering of the preceding points.
This measure captures how many times an adversary can "force" an algorithm to pick a new center. The paper proves that for many "natural" distributions (like Gaussian mixtures, uniform, or exponential distributions), this measure is small—specifically $O(k^2 \log n)$. This suggests that real-world data is rarely pathological enough to break online clustering, even if the arrival order is adversarial.
The Merging Strategy Algorithm
The proposed randomized algorithm uses a "merging" strategy to maintain a small set of centers while providing a good approximation of the optimal cost. The process follows these steps:
- Observation: A new point $x_t$ arrives.
- Offline Analysis: The algorithm runs a standard offline $k$-means subroutine on all points observed so far.
- Maximal Merging: To prevent over-committing to centers, the algorithm merges clusters near $x_t$ as long as the total cost increase remains within a constant factor.
- Probabilistic Selection: The point $x_t$ is selected as a center with a probability inversely proportional to the number of points in its newly merged cluster.
This approach ensures that centers are only established for significant, well-populated regions of the data space that are not already adequately covered.
Key Results
The theoretical analysis provides both upper and lower bounds that validate the $OC_k$ measure as a fundamental limit for this problem.
- Upper Bound: The algorithm achieves an $O(k^3)$-approximation relative to the optimal offline $k$-means cost while using $O(OC_k(X) \cdot k \log k \cdot \log n)$ centers.
- Lower Bound: Any algorithm providing a reasonable approximation must take at least $\Omega\left(\frac{OC_k(X)}{k \log(n\alpha)}\right)$ centers.
- Performance on Natural Data: For datasets sampled from a mixture of $k$ Gaussians, the algorithm requires only $\text{poly}(k, \log n)$ centers, a significant improvement over the $O(n)$ centers required in the worst-case scenario without the $OC_k$ framework.
Conclusion and Future Work
This work demonstrates that online clustering under adversarial order is possible for a wide class of datasets. By identifying the $OC_k$ measure, the authors provide a tool to distinguish between pathological sequences and "natural" data.
Future research directions include narrowing the gap between the current $\text{poly}(k)$ approximation and a potential constant $\Theta(1)$ approximation. Additionally, the current center complexity depends on $\log n$; investigating whether an algorithm can achieve complexity independent of the total number of points $n$ remains an open question.
Summary updated