One-dimensional clustering of k-values โโcan be solved in O (kn) time (at an already sorted input) based on theoretical results on Monge matrices, but this approach was not popular, most likely due to numerical instability, and also, possibly, for encoding tasks.
The best option is the O (knlgn) method, which is now implemented in Ckmeans.1d.dp version 3.4.6. This implementation is as fast as the heuristic k-tool, but provides guaranteed optimality, an order of magnitude better than the heuristic k-tool, especially for large k.
The general dynamic programming solution by Richard Bellman (Richard Bellman, 1973) does not affect the specifics of the k-means problem, but the implied runtime is O (kn ^ 3).
user6417312 Jun 03 '16 at 1:03 2016-06-03 01:03
source share