Runs Lloyd's k-means from an explicitly supplied set of initial center indices, recording the full assignment trajectory. Because the initialization is fixed and no RNG is used, this is the loop-safe re-clustering routine used for per-step feasibility checks inside the MCMC samplers.
Examples
set.seed(1)
X <- generate_exchangeable_null_data(30, 2, rho = 0.1)$dat
km <- kmeans_with_fixed_init(X, init_centers_idx = c(1, 11, 21))
km$n_iter
#> [1] 7
