Manuscript Offprint
arXiv:2610.06182Two-Point Local Optimality in -Means via Boundary-Point Screening
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Lloyd’s algorithm and the discrete local (D-local) optimization method (Li et al., 2025a) for k-means provide only weak local-optimality guarantees, and their solution quality remains sensitive to initialization. In this paper, we introduce r-point local optimality, under which no reassignment of at most r samples decreases the objective function, and focus on r = 2. The main computational obstacle is the cost of exhaustive two-point certification for n samples in d dimensions and k clusters. To address this challenge, we prove that (i) every improving two-point move of a D-local optimum must involve a cluster shared by both reassignments, and (ii) only certificate-defined boundary points can participate in an improving pair. Exploiting this structure, we propose Boundary-Point-Screened Two-Point Local Search (BPS-2PLS), which terminates at a two-point local optimum. For fixed k, d and nonvanishing cluster occupancy, the number m of retained candidates satisfies under i.i.d. sampling from a bounded-support distribution with bounded density or from a Gaussian mixture. Across twelve benchmarks, BPS-2PLS attains the lowest available mean WCSS on ten. In a subsampling study, screening retains 0.10%–2.81% of samples on average at the largest tested sizes. The code is available at https://github.com/lwl-learning/BPS-2PLS.
1 INTRODUCTION
k-means (MacQueen, 1967) is a canonical clustering method because of its simple geometric interpretation, with broad applications including image analysis (Jia et al., 2025; Li et al., 2025b; Qi et al., 2024; Achanta et al., 2012), large-scale similarity search (Jégou et al., 2011), single-cell genomics (Chari et al., 2024), climate science (Lee and Messori, 2024), and speech processing (Ambilduke et al., 2025). k-means seeks a partition that minimizes the within-cluster sum of squares (WCSS). Despite the simplicity of its objective, finding a global minimizer is NP-hard (Aloise et al., 2009). Practical methods therefore seek a suboptimal solution from a given initialization.
Lloyd’s algorithm alternates between assignment and centroid updates. At termination, the assignments and centroids are each optimal with the other fixed (Lloyd, 1982). This partial optimality does not exclude a reassignment that decreases WCSS after centroid recomputation. Hartigan-style methods (Hartigan and Wong, 1979; Telgarsky and Vattani, 2010) address this weakness, and Li et al. (2025a) formalize D-local optimality, under which no one-sample reassignment decreases WCSS after centroid recomputation.
However, two reassignments that are individually non-improving can yield an improvement when applied simultaneously, because their centroid updates interact through shared clusters. This motivates r-point local optimality, which excludes improvements from simultaneously reassigning at most r samples and ranges from D-locality at r = 1 to global optimality at r = n. We focus on r = 2, the first level beyond one-point relocation.
Exact certification of two-point local optimality appears expensive because direct enumeration over sample pairs and their destination clusters yields candidates. Nevertheless, we establish that, at a D-local optimum, every improving two-point move must involve a cluster shared by both sample reassignments, reducing all potentially improving moves to six directed configurations. To further reduce sample-pair enumeration, we construct, for each sample, an upper bound on the gains of connected two-point moves involving it, following the safe-screening principle (El Ghaoui et al., 2012; Fercoq et al., 2015). A sample with a non-positive upper bound cannot participate in any improving pair and can therefore be safely discarded. After initial Lloyd convergence, alternating Min-D-LO one-point descent with exact search over the retained samples yields Boundary-Point-Screened Two-Point Local Search (BPS-2PLS), which terminates at a two-point local optimum. With m retained candidates and lazily computed pair distances, screening and search cost after each one-point descent phase, without a full sample-pair cache.
The benefit of screening depends on how m grows with n. We localize retained samples near empirical cluster boundaries and prove for fixed k, d under bounded-support sampling with bounded density or Gaussian-mixture sampling. The bounds hold uniformly over D-local states with nonvanishing cluster occupancy. Complementing this theoretical analysis, a six-dataset subsampling experiment shows mean pruning rates above 97% at the largest tested sizes. Together, these results show that exact two-point local optimality can be attained efficiently on the evaluated problems.
Overall, our contributions are summarized as follows:
• We introduce a hierarchy from D-local to global optimality and characterize improving moves through connected cluster-transfer graphs.
• We develop BPS-2PLS, combining exact two-point search with safe sample screening to certify two-point local optimality.
• We establish uniform logarithmic candidate-size bounds for two common distribution classes and a nonvanishing cluster-occupancy condition.
Center- or cluster-based neighborhoods include J-Means centroid relocation (Hansen and Mladenović, 2001), merge-and-split repartitioning (Nielsen and Nock, 2014), and center swaps with approximation guarantees (Arya et al., 2004; Kanungo et al., 2004). These operations may change many labels, whereas our neighborhoods are defined by the number of reassigned samples.
A complementary line of work reduces computation without changing the output of a prescribed algorithm. For example, exact Lloyd accelerations use triangle inequalities and distance bounds to reduce evaluations (Elkan, 2003; Hamerly, 2010; Newling and Fleuret, 2016). Safe screening in sparse optimization uses certificates to discard inactive variables without changing the target solution (El Ghaoui et al., 2012; Fercoq et al., 2015). BPS-2PLS combines these two goals: it goes beyond single-sample moves, uses safe screening to preserve every improving two-point move, and certifies two-point local optimality at termination.
3 PROBLEM SETUP AND PRELIMINARIES
Throughout this paper, deterministic vectors and matrices are bold italic, sets are blackboard bold, and scalar entries are italic. Random draws use upright letters. All unqualified vector norms are Euclidean. Let be an indexed collection of samples in , and write and . A clustering is represented by a label vector , with cluster index sets . We restrict attention to partitions with nonempty clusters and to reassignments whose resulting partitions also satisfy this condition. For a fixed state , we suppress the dependence on in the cluster statistics and write , , . The -means objective, also known as the within-cluster sum of squares (WCSS), is
A reassignment from to is improving precisely when . For later use, define the squared sample–centroid and sample–sample distances
Lloyd’s algorithm alternates between assigning each sample to a nearest centroid and recomputing each centroid as the mean of its assigned samples (Lloyd, 1982). At convergence, the resulting clustering satisfies
This gives partial optimality: assignments and centroids are each optimal with the other fixed (Li et al., 2025a). However, partial optimality does not account for the centroid changes caused by reassigning a sample and therefore need not imply local optimality of the partition.
To account for these centroid changes, consider a one-point move , with , , and . Its exact gain after recomputing the two affected centroids is
The first term is the reduction in WCSS obtained by removing from cluster s, whereas the second term is the increase caused by inserting it into cluster a. Following Li et al. (2025a), this gives the following notion of local optimality.
Definition 3.1 (D-local optimality). A clustering is -locally optimal if for every feasible one-point move , with the affected centroids recomputed.
Every D-locally optimal clustering satisfies the Lloyd fixed-point condition, whereas the converse need not hold. However, jointly reassigning multiple samples may still improve WCSS, motivating the point-cardinality hierarchy in the next section.
4 r-POINT LOCAL OPTIMALITY
We extend D-local optimality to joint label changes and identify the cluster interactions that can produce improvements. Let be the feasible label space. For , a simultaneous q-point reassignment is an unordered collection of q sample reassignments
where are distinct. The resulting vector changes each to and leaves all other entries unchanged. Feasibility requires the final simultaneous reassignment to satisfy ; all affected centroids are then recomputed.
For , let denote the differing labels, and define the exact-q shell and radius-r point-reassignment neighborhood by
For a feasible move M, define its gain by .
Definition 4.1 (r-point local optimality). A clustering is r-point locally optimal if
Proposition 4.2 (Hierarchy). Let denote the set of all -point local optima. For ,
Moreover, 1-point local optimality coincides with D-local optimality, whereas n-point local optimality coincides with global optimality over .
The objective is a sum of cluster contributions, so reassignments can interact only through shared clusters. This motivates the following graph representation.
Definition 4.3 (Cluster-transfer graph). For a simultaneous move M, its cluster-transfer graph is the directed multigraph whose vertex set consists of the affected clusters. For each reassignment, the graph contains one edge , labeled by .
Distinct components affect disjoint cluster statistics, so their gains are additive, yielding the following characterization.
Theorem 4.4 (Connected-move characterization). A clustering z is r-point locally optimal if and only if every feasible simultaneous move M with whose transfer graph is weakly connected is non-improving. Consequently, if z is already -point locally optimal, then every improving exact-r move must have a weakly connected transfer graph.
The gain decomposition and proofs are given in Appendix A. A connected graph with q edges has at most vertices, so every connected q-point move affects at most clusters.
Connectedness alone need not reduce the worst-case order for general (Appendix B). For , every improving move at a D-local state affects at most three clusters, yielding six configurations whose destination choices admit exact optimization. Given and the required , destination search costs per pass, without requiring cluster balance.
5 EXACT TWO-POINT LOCAL SEARCH
At a D-local state , enumerating sample pairs and their destination labels yields candidates. By Theorem 4.4, every improving pair , is connected: , where .
Fixing as the anchor gives the six partner configurations in Table 1, indexed by . Write . Let and be the feasible partner-index and destination sets, and .
Proposition 5.1 (Exact WCSS changes under cluster updates). For feasible cluster updates, the exact WCSS changes after centroid recomputation can be expressed using pre-update sizes and distances as follows, with for two-sample updates:
gain from removing from cluster ,
(9)
cost of inserting into cluster ,
(10)
gain from removing and from cluster ,
(11)
cost of inserting and into cluster ,
(12)
gain from replacing with in cluster .
(13)
The cluster contributions sum to the six gains in Table 1 (proof in Appendix C). For example, a forward chain removes from cluster , replaces with in cluster , and inserts into cluster , giving .
Once the required entries of and are available, each gain takes time to evaluate, but unbalanced cluster sizes can still leave candidates (Proposition B.1). Only the same source, different destinations and forward chain configurations require optimizing a second destination .
For a fixed anchor and partner sample , both gains depend on solely through . When the destination domain is nonempty, choose any minimizer
For each sample , store an ordered Top-3 all-cluster list of the smallest scores , ranking all labels including the current source. The scores and all lists can be constructed from in time. Excluding at most two labels leaves a minimizing feasible label in , enabling constant-time destination queries and anchor–partner evaluations per pass.
Table 1: Search spaces for the partner and exact gains for fixed .
| Configuration | Partner constraint | Destination and feasibility | Exact gain |
|---|---|---|---|
| Same source, same destination | |||
| Same source, different destinations | |||
| Forward chain | |||
| Swap | |||
| Different sources, same destination | |||
| Backward chain |
ExactPairSearch() restricts both moved indices to while using the full clustering statistics and destination domains. It returns the best positive gain and its move, or . After initial Lloyd convergence, Pair-Driven Two-Point Local Search (PD-2PLS) alternates Min-D-LO one-point descent with ExactPairSearch() (Appendix C.1). Here the descent phase repeatedly accepts the feasible one-point move with the largest positive gain until D-locality is reached.
Throughout one- and two-point descent, and are maintained across moves. A one-point move changes two clusters, and a connected two-point move changes at most three. The affected cluster counts and means are updated from the moved samples, and only the corresponding columns of are refreshed, costing per accepted move. A Min-D-LO gain scan costs , so one scan and its possible update cost ; no full distance recomputation is needed.
6 SAFE BOUNDARY-POINT SCREENING
At a D-local state, anchored search still considers up to ordered sample pairs. Motivated by the boundary-point intuition, Boundary-Point Screening (BPS) constructs an upper bound on every feasible connected two-point gain involving and discards if .
Fix an anchor with . For configuration , the envelope key in Table 2 records the cluster labels needed by the partner terms and the pivot; anchors with the same key share an envelope.
To construct this bound, we first remove the dependence on the partner destination :
Here collects the anchor terms and the partner terms; their coefficients are listed in Table 6 in Appendix D. Equality holds when is prescribed or chosen as .
Next, introduce a pivot and write for each sample . The triangle and reverse triangle inequalities, accounting for the sign of , yield
Substituting this inequality into equation 14, we define the partner line and the resulting bound by
For a fixed key , each partner defines an affine function of the scalar query radius .
Finally, we maximize over the shared partner superset in Table 2 to obtain a bound depending only on the anchor and configuration:
The remaining computational issues are: (i) How can be constructed and queried efficiently? (ii) How can it be reused across anchors? (iii) How should its pivot be chosen?
Table 2: Reusable envelope families for , with .
| Configuration | Pivot | Key | Partner superset |
|---|---|---|---|
| Same source (both configurations) | |||
| Forward chain / swap | |||
| Different sources, same destination | |||
| Backward chain |
(a) Same source

(b) Forward chain / swap

(c) Same destination
(d) Backward chain

Figure 1: Schematic pivot choices for the six connected configurations: (a) both same-source configurations; (b) forward chains and swaps; (c) different sources with the same destination; and (d) backward chains. Shaded regions denote clusters.
A line upper envelope can be constructed in time and queried in time by binary search on its breakpoints (de Berg et al., 2008); construction details are in Appendix D.
For each feasible key in Table 2, the coefficients and pivot are fixed, so one envelope serves all corresponding anchors. There are at most partner lines in total, and each envelope contains at most lines, giving total construction time.
Accordingly, we aggregate the configuration bounds into the sample certificate
Given the line coefficients and query radii, constructing the envelopes and computing all certificates takes time. We therefore retain the boundary candidate set and let . At a D-local state, every improving two-point move is connected, so both of its samples have positive certificates and belong to . Therefore, ExactPairSearch(, ) preserves the maximum positive gain while restricting distance evaluation and search to retained pairs.
Figure 1 illustrates the pivot choices. For fixed radii, equation 15 is tight for opposing directions when and aligned directions when . The radii can be evaluated in constant time from and the squared centroid distance , computed in time (Appendix D).
BPS-2PLS uses the same initial Lloyd run and Min-D-LO descent, followed by screening and ExactPairSearch(z, B) (Algorithm 2); strict descent ensures finite termination at a two-point local optimum. Screening does not require evaluating any . Candidate distances are computed in blocks in time and reused across destination choices, giving pair-search time. For Lloyd iterations, one-point gain scans, and screening-and-search rounds, the total cost is
where is the maximum retained count over the rounds. The scan and round counts include unsuccessful termination checks; the term in each round covers an accepted pair's local state update. Appendix C.6 gives the bound with varying candidate counts and compares lazy evaluation with full caching.
7 CANDIDATE-SET SIZE GUARANTEES
We formalize the boundary-point intuition by locating retained samples where the squared distances to the nearest and second-nearest empirical centers are close, and then derive logarithmic candidate-size bounds under two sampling models.
For a D-local state with , write and , the minimum cluster size and the squared sample diameter. Let be the two smallest values of , counting ties. Suppressing when it is fixed, define the boundary region
Proposition 7.1 (Geometric localization of retained samples). Let be a -local state with . For the exact-arithmetic BPS certificate defined in Section 6, the candidate set satisfies
For distinct empirical centers, is a union of portions of at most slabs around pairwise equal-distance hyperplanes. The illustration on the right shows a two-dimensional Gaussian mixture, in which only 20 of the 3,000 samples lie in . The proof is given in Appendix E.1.
Localization alone does not guarantee a small candidate set: bounded, balanced two-cluster instances can have (Appendix E.2). To obtain a sublinear bound, we control the boundary-region probability mass and squared sample diameter under nonvanishing empirical cluster occupancy.

Theorem 7.2 (Logarithmic candidate-set size). Let be i.i.d. random vectors from a fixed distribution on , and let denote their realizations. Fix , and . Define the admissible state class
and write . Suppose satisfies either of the following conditions:
-
P is supported on a fixed ball of radius R centered at and has a Lebesgue density f with .
-
P is a Gaussian mixture with , , .
The mixture parameters are fixed population quantities, whereas are empirical cluster means. For the exact-arithmetic BPS certificate defined in Section 6, set if is empty. Otherwise,
Here denotes order in probability (van der Vaart, 1998). The proof combines uniform slab counting, diameter control, and empirical center separation (Appendices E.3–E.4). The bound covers data-dependent clusterings; the mixture case allows unequal weights and anisotropic covariances without requiring separated component means.
For fixed , if a sequence of D-local outputs satisfies the occupancy condition with probability tending to one, then in probability and the screening-and-search cost after one-point descent, including lazy distance evaluation, is . The theorem neither guarantees occupancy attainment nor bounds the number of Lloyd iterations, one-point scans, or two-point rounds.
8 EXPERIMENTS
We evaluate clustering quality and cost, heuristic enhancement, and candidate-set scaling. Datasets, methods, metrics, and timing protocols are detailed in Appendix F.
8.1 COMPARISON OF SAMPLE-REASSIGNMENT-BASED METHODS
We compare six sample-reassignment methods using ten shared initializations, with each method-initialization pair timed five times (Appendix F). In Table 3, BPS-2PLS attains the lowest available
Table 3: Mean WCSS and runtime (seconds) over ten shared initializations. Bold: lowest available WCSS. Dashes mark Hartigan runs omitted because of excessive runtime.
| Dataset | Metric | Lloyd | lite-KM | Hartigan | D-LO | Min-D-LO | BPS-2PLS |
|---|---|---|---|---|---|---|---|
| Yale | WCSS | 3328.242 | 3328.242 | 3197.414 | 3214.216 | 3214.216 | 3185.016 |
| Time | 0.011 | 0.009 | 0.356 | 0.219 | 0.246 | 0.327 | |
| ORL | WCSS | 2902.673 | 2902.673 | 2723.878 | 2735.73 | 2735.73 | 2691.304 |
| Time | 0.025 | 0.018 | 1.481 | 0.935 | 1.055 | 2.403 | |
| USPS-1000 | WCSS | 22400.15 | 22400.15 | 22234.94 | 22254.42 | 22254.42 | 22229.35 |
| Time | 0.057 | 0.020 | 4.910 | 1.035 | 1.193 | 1.280 | |
| COIL20 | WCSS | 32974.89 | 32974.89 | 32871.45 | 32783.05 | 32783.05 | 32772.27 |
| Time | 0.152 | 0.067 | 7.821 | 1.155 | 1.385 | 1.253 | |
| MNIST-2000 | WCSS | 76682.46 | 76682.46 | 76439.91 | 76501.68 | 76501.68 | 76499.59 |
| Time | 0.242 | 0.087 | 27.96 | 2.013 | 2.345 | 2.521 | |
| COIL100 | WCSS | 74693.18 | 74693.18 | — | 73837.04 | 73837.04 | 73642.79 |
| Time | 1.305 | 0.854 | — | 38.85 | 42.93 | 63.79 | |
| 20News | WCSS | 13421.12 | 13421.12 | 13422.92 | 13418.46 | 13418.47 | 13418.44 |
| Time | 1.640 | 0.756 | 391.89 | 35.25 | 16.82 | 21.26 | |
| Sensorless | WCSS | 1641518 | 1641518 | 1622398 | 1629887 | 1629887 | 1623231 |
| Time | 0.938 | 0.608 | 1020.68 | 10.48 | 2.802 | 4.205 | |
| CIFAR-10 | WCSS | 101000000 | 101000000 | — | 101000000 | 101000000 | 101000000 |
| Time | 8.080 | 1.886 | — | 22.59 | 24.51 | 13.94 | |
| CIFAR-100 | WCSS | 85660060 | 85660060 | — | 85610702 | 85610702 | 85610581 |
| Time | 19.67 | 6.664 | — | 550.56 | 619.29 | 624.69 | |
| MNIST | WCSS | 2751844 | 2751844 | — | 2751804 | 2751804 | 2751804 |
| Time | 21.26 | 4.130 | — | 100.81 | 113.23 | 176.45 | |
| Fashion-MNIST | WCSS | 2242899 | 2242899 | — | 2242898 | 2242898 | 2242898 |
| Time | 19.68 | 3.562 | — | 65.00 | 50.51 | 39.87 |

• Lloyd convergence • Min-D-LO search • Two-point search
Figure 2: BPS-2PLS descent trajectories on five datasets. The -axis shows the iteration count after Lloyd convergence, and the -axis shows WCSS as a percentage of the WCSS at Lloyd convergence.
mean WCSS on ten of twelve datasets, including ties. Hartigan yields lower WCSS on MNIST-2000 and Sensorless; however, neighborhood inclusion does not impose an ordering on independently reached local optima.
Table 3 shows that BPS-2PLS reduces mean WCSS relative to Lloyd by on Yale and on ORL. On five of the six largest datasets, the reductions are below , including the CIFAR-10 tie; the reduction on Sensorless is . The diminishing influence of individual samples on larger clusters offers a possible explanation (Appendix G).
In terms of computational cost, BPS-2PLS takes as long as D-LO on eight datasets and less time on the other four. Hartigan takes and as long as BPS-2PLS on MNIST-2000 and Sensorless, respectively. Attributing speedups specifically to screening requires paired BPS-on/off timings.
Figure 2 shows how two-point moves extend descent beyond one-point local optima. On Yale, ORL, USPS-1000, and COIL20, successful two-point moves are followed by further one-point improvements. For example, on COIL20, the first D-local solution retains of the initial Lloyd WCSS, whereas the final solution retains ; most of this additional reduction comes from one-point moves made possible by the two-point updates. The displayed MNIST-2000 run instead terminates at its first D-local solution, where two-point search finds no improvement.
Table 4: Heuristic enhancement: mean WCSS and runtime (seconds). Bold: lowest WCSS within each method and dataset, including ties; dashes: omitted runs.
| Method | Variant | Yale | ORL | USPS-1000 | COIL20 | MNIST-2000 | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| WCSS | Time | WCSS | Time | WCSS | Time | WCSS | Time | WCSS | Time | ||
| Min-D-LO | Baseline | 3214.216 | 0.246 | 2735.73 | 1.055 | 22254.42 | 1.193 | 32783.05 | 1.385 | 76501.68 | 2.345 |
| Inner | 3185.016 | 0.327 | 2691.304 | 2.403 | 22229.35 | 1.280 | 32772.27 | 1.253 | 76499.59 | 2.521 | |
| LocalSearch | Baseline | 5204.958 | 0.074 | 4594.401 | 0.196 | 35930.89 | 0.106 | 51511.93 | 0.439 | 123605.5 | 0.352 |
| Post | 3180.593 | 0.422 | 2670.928 | 2.439 | 22235.22 | 1.003 | 31799.29 | 2.329 | 76382.11 | 3.156 | |
| MultiSwap | Baseline | 3347.979 | 0.045 | 2839.742 | 0.178 | 22363.17 | 0.090 | 33014.32 | 0.356 | 76669.54 | 0.488 |
| Post | 3197.036 | 0.365 | 2674.842 | 2.915 | 22244.28 | 1.071 | 32723.21 | 1.895 | 76571.75 | 2.466 | |
| Inner | 3196.986 | 0.374 | 2683.272 | 2.948 | 22244.28 | 1.065 | 32723.21 | 1.883 | 76571.75 | 2.426 | |
| J-Means | Baseline | 3214.364 | 16.51 | 2630.903 | 465.05 | 22354.6 | 16.30 | — | — | — | — |
| Post | 3160.917 | 16.74 | 2607.935 | 464.91 | 22237.06 | 17.27 | — | — | — | — | |
| Inner | 3169.434 | 6.208 | 2608.329 | 186.88 | 22244.28 | 15.73 | — | — | — | — | |
| MergeSplit | Baseline | 3191.945 | 0.791 | 2616.383 | 12.90 | 22242.59 | 3.220 | 31307.97 | 43.97 | 76494.29 | 96.93 |
| Post | 3167.338 | 1.023 | 2613.44 | 13.43 | 22236.35 | 3.403 | 31298.45 | 44.23 | 76493.35 | 97.25 | |
| Inner | 3166.465 | 5.435 | 2608.782 | 71.40 | 22237.87 | 9.834 | 31324.05 | 94.50 | 76487.16 | 151.67 | |

Figure 3: Retained candidate count versus sample size at the first D-local state. Markers show means over five random subsets, each averaged over three initializations; error bars indicate one standard deviation across subsets.
8.2 ENHANCING HEURISTIC METHODS
Table 4 evaluates terminal (Post) and internal (Inner) BPS-2PLS refinement; insertion points are detailed in Appendix G.2. Among the four heuristic methods, Post reduces mean WCSS in all eighteen available comparisons. For LocalSearch, Post reduces mean WCSS by 38.12–41.87%; this refinement includes centroid recomputation and one-point descent, which are absent from the baseline. Inner lowers mean WCSS relative to Baseline in twelve of thirteen available comparisons but does not consistently outperform Post. For J-Means, Inner uses 37.6% and 40.2% of the baseline runtime on Yale and ORL, while Post achieves lower mean WCSS. For MergeSplit, Inner takes 1.56–5.32× as long as Post and gives lower mean WCSS on Yale, ORL, and MNIST-2000; on COIL20, it has higher mean WCSS than both Baseline and Post.
8.3 CANDIDATE-SET SIZE VERSUS SAMPLE SIZE
We study random subsets drawn from six datasets, recording at the first D-local state before any two-point move. Figure 3 summarizes five subsets per size, each averaged over three initializations; subset sizes and aggregation details are in Appendix G.3.
The candidate counts show no sustained increase across the evaluated range: 20News and CIFAR-100 rise over smaller sample sizes before leveling off or decreasing, while the other datasets are flat, decreasing, or non-monotone. At the largest available size, mean retained fractions range from to , corresponding to mean pruning rates above in all six cases. These observations motivate studying sharper bounds for algorithmic outputs (Appendix G.3).
9 CONCLUSION
We introduced -point local optimality and developed BPS-2PLS to certify two-point local optima of -means. Connected moves yield six configurations, while safe screening confines distance evaluation and search to retained samples. Under the stated sampling and occupancy conditions, geometric localization gives and screening-and-search time after one-point de-scent for fixed d, k. Experiments show that BPS-2PLS enables further descent beyond one-point local optima and can improve existing heuristics when used as a refinement.
Screening can retain all samples, and the theorem bounds neither one-point descent time nor the number of rounds. Future work includes larger neighborhoods, faster screening and descent, and sharper candidate-size bounds for algorithmic outputs.
AI USE STATEMENT
In this work, we used generative AI tools solely to assist with grammar, spelling, and sentence clarity. We have reviewed all AI-assisted edits and assume full responsibility for the final manuscript. The generative AI contributed in no other way to this work. The research idea, experimental design, and all other substantive content were developed and completed by the authors.
ETHICS STATEMENT
We confirm that our work adheres to the ICLR Code of Ethics. This work uses publicly available datasets that contain no personally identifiable information. Given the strictly technical nature of this contribution, we foresee no ethical issues or potential misuse.
REPRODUCIBILITY STATEMENT
Proofs of the theoretical results are provided in Appendices A, B, and E; detailed algorithms and screening constructions are given in Appendices C and D. Appendix F specifies the dataset sources and representations, comparison methods and search budgets, initialization protocol, evaluation metrics, timing procedure, and computing environment. Appendices G.2, G.3 and G.6 describe the heuristic refinement insertion points and candidate-set scaling protocol.
REFERENCES
Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Süsstrunk. Slic superpixels compared to state-of-the-art superpixel methods. IEEE transactions on pattern analysis and machine intelligence, 34(11):2274–2282, 2012. doi: 10.1109/TPAMI.2012.120.
Daniel Aloise, Amit Deshpande, Pierre Hansen, and Preyas Popat. Np-hardness of euclidean sum-of-squares clustering. Machine learning, 75(2):245–248, 2009. doi: 10.1007/s10994-009-5103-0.
Kshitij Ambilduke, Ben Peters, Sonal Sannigrahi, Anil Keshwani, Tsz Kin Lam, Bruno Martins, André FT Martins, and Marcely Zanon Boito. From tower to spire: Adding the speech modality to a translation-specialist llm. In EMNLP (Findings), pages 19658–19673, 2025. doi: 10.18653/v1/2025.findings-emnlp.1071. URL https://aclanthology.org/2025.findings-emnlp.1071/.
Vijay Arya, Naveen Garg, Rohit Khandekar, Adam Meyerson, Kamesh Munagala, and Vinayaka Pandit. Local search heuristics for k-median and facility location problems. SIAM Journal on Computing, 33(3):544–562, 2004. doi: 10.1137/S0097539702416402.
Lorenzo Beretta, Vincent Cohen-Addad, Silvio Lattanzi, and Nikos Parotsidis. Multi-Swap k-means++. In Advances in Neural Information Processing Systems, volume 36, 2023. URL https://papers.nips.cc/paper_files/paper/2023/hash/52d63f9e4b81f866bf69fb3c834aad47-Abstract-Conference.html.
Deng Cai. Litekmeans: The fastest MATLAB implementation of kmeans, 2011. URL http://www.zjucadcg.cn/dengcai/Data/Clustering.html. Software.
Tara Chari, Gennady Gorin, and Lior Pachter. Biophysically interpretable inference of cell types from multimodal sequencing data. Nature Computational Science, 4(9):677–689, 2024. doi:10.1038/s43588-024-00689-2.
Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars. Computational Geometry: Algorithms and Applications. Springer, 3 edition, 2008. doi: 10.1007/978-3-540-77974-2.
Laurent El Ghaoui, Vivian Viallon, and Tarek Rabbani. Safe feature elimination for the lasso and sparse supervised learning problems. Pacific Journal of Optimization, 8(4):667–698, 2012.
Charles Elkan. Using the triangle inequality to accelerate k-means. In Proceedings of the Twentieth International Conference on Machine Learning, pages 147–153, 2003. URL https://cseweb.ucsd.edu/~elkan/kmeansicml03.pdf.
Olivier Fercoq, Alexandre Gramfort, and Joseph Salmon. Mind the duality gap: Safer rules for the lasso. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 333–342, 2015.
Greg Hamerly. Making k-means even faster. In Proceedings of the 2010 SIAM International Conference on Data Mining, pages 130–140. SIAM, 2010. doi: 10.1137/1.9781611972801.12.
Pierre Hansen and Nenad Mladenović. J-Means: A new local search heuristic for minimum sum of squares clustering. Pattern Recognition, 34(2):405–413, 2001. doi: 10.1016/S0031-3203(99)00216-2.
J. A. Hartigan and M. A. Wong. Algorithm AS 136: A K-means clustering algorithm. Applied Statistics, 28(1):100–108, 1979. doi: 10.2307/2346830.
Hervé Jégou, Matthijs Douze, and Cordelia Schmid. Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1):117–128, 2011. doi: 10.1109/TPAMI.2010.57.
Yuheng Jia, Jianhong Cheng, Hui Liu, and Junhui Hou. Towards calibrated deep clustering network. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=JvH4jDDcG3.
Tapas Kanungo, David M. Mount, Nathan S. Netanyahu, Christine D. Piatko, Ruth Silverman, and Angela Y. Wu. A local search approximation algorithm for k-means clustering. Computational Geometry, 28(2–3):89–112, 2004. doi: 10.1016/j.comgeo.2004.03.003.
Silvio Lattanzi and Christian Sohler. A better k-means++ algorithm via local search. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 3662–3671. PMLR, 2019. URL https://proceedings.mlr.press/v97/lattanzi19a.html.
Simon H Lee and Gabriele Messori. The dynamical footprint of year-round north american weather regimes. Geophysical Research Letters, 51(2):e2023GL107161, 2024. doi: 10.1029/2023GL107161.
Mingyi Li, Michael R. Metel, and Akiko Takeda. Modified K-means algorithm with local optimality guarantees. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 35656–35684. PMLR, 2025a. URL https://proceedings.mlr.press/v267/li25bt.html.
Zhixin Li, Yuheng Jia, Hui Liu, and Junhui Hou. Learning from sample stability for deep clustering. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 34904–34919. PMLR, 2025b. URL https://proceedings.mlr.press/v267/li25am.html.
Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2):129–137, 1982. doi: 10.1109/TIT.1982.1056489.
James B. MacQueen. Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, volume 1, pages 281–297, Berkeley, CA, 1967. University of California Press. URL https://digicoll.lib.berkeley.edu/record/113015.
James Newling and François Fleuret. Fast k-means with accurate bounds. In Proceedings of the 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 936–944. PMLR, 2016. URL https://proceedings.mlr.press/v48/newling16.html.
Frank Nielsen and Richard Nock. Further heuristics for k-means: The merge-and-split heuristic and the -means. arXiv preprint arXiv:1406.6314, 2014. URL https://arxiv.org/abs/1406.6314.
Jianhan Qi, Yuheng Jia, Hui Liu, and Junhui Hou. Superpixel graph contrastive clustering with semantic-invariant augmentations for hyperspectral images. IEEE Transactions on Circuits and Systems for Video Technology, 34(11):11360–11372, 2024. doi: 10.1109/TCSVT.2024.3418610.
Agostino Tarsitano. A computational study of several relocation methods for k-means algorithms. Pattern Recognition, 36(12):2955–2966, 2003. doi: 10.1016/S0031-3203(03)00190-0.
Matus Telgarsky and Andrea Vattani. Hartigan's method: k-means clustering without voronoi. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, pages 820–827, 2010.
A. W. van der Vaart. Asymptotic Statistics. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 1998. doi: 10.1017/CBO9780511802256.
A PROOFS FOR r-POINT LOCAL OPTIMALITY
A.1 EXACT SIMULTANEOUS-REASSIGNMENT GAIN
To analyze interactions among the reassignments in a simultaneous move M, we first define the changes in the size and sum of each cluster by
Let be the set of affected clusters. Equation 1 then yields the following exact gain.
Proposition A.1. For every feasible simultaneous reassignment M,
Proof of Proposition A.1. For each cluster , the move changes its size and sum to
Because is feasible, for every . By equation 1, the common term cancels in , as do the contributions of all untouched clusters. Substituting the updated statistics of the affected clusters yields equation 24.
A.2 COMPONENTWISE ADDITIVITY AND CONNECTED MOVES
Proposition A.2 (Componentwise additivity). Let M be feasible and let be the moves induced by the weakly connected components of . Then every is feasible when applied directly to , and .
Proof of Proposition A.2. Different weakly connected components of have disjoint vertex sets and therefore modify disjoint sets of cluster sufficient statistics. For any cluster touched by component , no transfer from another component can enter or leave , so
Since the full move is feasible, every touched cluster has positive final size under its component move as well, while all other clusters remain unchanged; hence each is feasible. Partitioning the sum in equation 24 over the disjoint component vertex sets gives
Proof of Theorem 4.4. If is -point locally optimal, every connected feasible move of size at most is non-improving by definition. Conversely, assume that every such connected move is non-improving and consider an arbitrary feasible move with . If is connected, then by assumption. Otherwise, let denote its component moves. By Proposition A.2, each is feasible and connected, with , and therefore . Hence
Thus no feasible move involving at most r samples improves the objective, proving r-point local optimality.
For the final statement, suppose is -point locally optimal and an improving exact- move is disconnected. Every component of contains at most edges and is therefore non-improving. Componentwise additivity would then imply , a contradiction.
B COUNTING CONNECTED EXACT-r MOVES
Connectedness removes structurally redundant moves, but it does not by itself make general exact-r certification inexpensive. Let
denote the connected exact-r shell.
Proposition B.1 (Size of the connected exact-r shell). Fix . In general,
This order is attainable up to -dependent constants: a cluster of size can yield connected moves. If instead the partition is -balanced, meaning for every , then
For equal-size balanced partitions with and , this order is tight:
Proof of Proposition B.1. The upper bound in equation 26 follows immediately from and . To see that connectedness alone does not improve the worst-case order, suppose cluster has size . Choose any samples from and independently send each to any of the other clusters. The source cluster remains nonempty, and all transfer edges share the source vertex , so every such move is feasible and connected. Consequently,
If and is fixed, this matches the upper bound up to -dependent constants and gives the stated order.
It remains to prove the balanced bound. For an -sample support , let be its number of distinct source clusters. Fix and a set of source clusters. Under -balance,
Hence the number of r-sample supports whose source clusters are contained in A is at most
Summing over the at most choices of A shows that the number of supports with source diversity s is
Now fix one such support. A connected graph with edges has at most vertices, so in addition to its source clusters it can contain at most destination-only clusters. If exactly destination-only clusters are used, choose them in at most ways. Once these clusters are fixed, each destination lies among at most cluster labels. Ignoring self-loop and connectivity restrictions only enlarges the count, so the number of destination assignments is at most
Multiplying by equation 29 gives connected candidates for each . Summing over at most possible values of proves equation 27.
For sharpness, suppose all clusters have the same size and . Choose distinct source clusters, one sample from each, and one common destination cluster outside those sources. Sending all selected samples to the common destination gives a feasible connected in-star. The number of such moves is
which matches the upper bound for and proves equation 28.
C DETAILS FOR EXACT TWO-POINT LOCAL SEARCH
C.1 ALGORITHMS AND SHARED SEARCH ROUTINE
Algorithms 1 and 2 give the complete PD-2PLS and BPS-2PLS procedures in exact arithmetic. Both run Lloyd initially and then alternate best-improvement one-point descent with a two-point search. In the pseudocode, Min-D-LO denotes the one-point descent phase: scan all feasible moves using equation 4, accept a move with the largest positive gain, update the affected state, and repeat until no positive gain remains. This phase reuses the supplied statistics and D without restarting Lloyd. This is the schedule used by Model.myLocal2KM; the standalone Model.MinDLO_KM baseline resumes Lloyd after an accepted one-point move, and Model.myLocal2KMv2 resumes Lloyd after an accepted pair. Both call ExactPairSearch(z, I) (Algorithm 3), with I = [n] for PD-2PLS and I = B for BPS-2PLS. The shared routine uses the counts and sample–centroid distances D of the full current clustering; only the two moved sample indices are restricted to I. Destination minima can be obtained using the Top-3 lists or the equivalent scans described in Appendix C.4. The algorithms below compute sample-pair distances lazily, after I is known, using the equivalent pair ordering in Appendix C.4. Each distance is reused across all destination choices for its pair; no full sample-pair cache is initialized. Feasibility is checked jointly using Table 1, and cases with empty destination domains are skipped.
Algorithm 1 Pair-Driven Two-Point Local Search (PD-2PLS)
Require: data X, cluster count k, initial clustering
1:
2: while true do
3:
4:
5: if then
6: return z
7: end if
8: Apply to z; update affected , and columns of D
9: end while
Algorithm 2 Boundary-Point-Screened Two-Point Local Search (BPS-2PLS)
Require: data X, cluster count k, initial clustering
1:
2: while true do
3:
4: Compute insertion scores A, Top-3 lists , and center distances
5: Build the shared envelopes specified in Table 2
6: Compute for all using equation 18
7:
8:
9: if then
10: return z
11: end if
12: Apply to z; update affected , and columns of D
13: end while
Algorithm 3 ExactPairSearch(z, I)
Require: data X, D-local clustering z, sample set I ⊆ [n], full-clustering statistics and D
1: ;
2: for all blocks covering unordered pairs with do
3: Compute for the current block
4: for all pairs in the block do
5: Find the best feasible connected move M for this pair using Table 1 and Appendix C.4
6: if such a move exists and then
7: ;
8: end if
9: end for
10: Discard the current distance block
11: end for
12: return
Local state updates. For a one- or two-point move M, we use the pre-move statistics and the changes defined in Appendix A. For each affected cluster , set
All other counts, centroids, and columns of remain valid. Updating the counts costs , and updating the centroids costs for a one-point or connected two-point move; refreshing the two or at most three affected distance columns costs . Locality refers to the affected columns, not to restricting their rows to moved samples. The same update is used inside Min-D-LO and after a pair is accepted. Insertion scores, destination lists, and screening envelopes are refreshed from the current state before the next screening round; they must not be reused unchanged after centroid or count updates.
C.2 CLUSTER-UPDATE PRIMITIVES AND FEASIBILITY
For a cluster index set , recall its size , sum , and centroid . Its within-cluster sum of squares is
Substituting the updated sufficient statistics after removing, inserting, or replacing samples gives
Combining the contributions of the affected clusters yields the six gains in Table 1.
For , both same-source configurations require . In a different-source/same-destination move, neither source is replenished, so and are required. A forward chain has and : cluster receives while losing , and only is needed. In a backward chain, and , so only is required. A swap has and and preserves both source sizes. These are exactly the size conditions in Table 1. Any case requiring an unavailable third label is omitted.
C.3 EXACT TOP-3 DESTINATION QUERIES
We use and ; the search routine clips its returned gain at zero, and ties may be broken arbitrarily. The formula for defines a ranking score for every ; its interpretation as an insertion cost requires . Computing the insertion-score matrix from costs time, and selecting each sample's three smallest scores costs , hence in total. Let contain the labels with the smallest insertion scores over all clusters, including in the ranking. A query excludes , which contains in both configurations under consideration. If , all labels are cached. If , at most two of the three cached labels are excluded, so at least one remains. Whenever the admissible domain is nonempty, every uncached score is at least as large as each cached score; hence an admissible minimizer lies in . This justifies constant-time destination queries using Top-3 lists, including ties. When the admissible domain is empty, the corresponding configuration is absent. The screening implementation obtains these lists by sorting each row of , which costs rather than linear-time selection. Since , this is covered by the screening bound.
C.4 EQUIVALENT SAMPLE-PAIR ORDERING
Algorithm 3 regroups the anchored search of Section 5 by unordered sample pairs. Fix in and abbreviate their source labels as and . If , the best distinct-destination insertion cost is
This minimum can be recovered from the constant-size product subject to . To see this, start with an optimal feasible pair . With fixed, the excluded labels for are , so the Top-3 query yields with . Fixing then yields with . The pair remains feasible and lies in the cached product without increasing the total cost. If no distinct pair exists, the minimum is .
For s = c, the two configuration optima are therefore
subject to . If , the common-destination optimum is
and the two chain orientations and swap have gains
respectively, subject to the joint feasibility conditions above. Each chain query excludes the two source labels , so the same Top-3 argument applies. Only the common-destination cases scan labels; all other destination optimizations take constant time. Given , destination optimization therefore costs per unordered pair. Computing once adds , rather than multiplying the distance cost by the number of destinations. This ordering returns the same maximum positive gain as anchored enumeration for every .
The implemented gain kernel instead scans the admissible labels for each chain and, for a same-source pair, records the two smallest insertion costs for each sample during the common-destination scan. If the two best labels coincide, it compares the two choices that use one runner-up. This computes the same distinct-destination minimum without requiring precomputed Top-3 lists in the pair-search routine, and still takes time per pair.
C.5 EXACTNESS AND TERMINATION
At a D-local state, every improving exact two-point move is connected by Theorem 4.4. Choose either of its transfers as and write the other as . If , then or . If , then or . If , connectedness requires . These alternatives are exactly the six rows of Table 1, including their joint feasibility conditions.
Algorithm 3 with visits every unordered sample pair. The destination optimizations in Appendix C.4 cover all six connected configurations, including both chain orientations, and return a feasible move with gain at least that of any other connected move for the pair. Hence the maximum positive gain returned equals the maximum gain over , clipped at zero. If it returns zero, no improving exact two-point move exists, and D-locality already excludes improving one-point moves. The clustering is therefore two-point locally optimal by Definition 4.1.
After an accepted pair, PD-2PLS (Algorithm 1) locally updates the affected cluster statistics and distance columns, then resumes Min-D-LO descent from that state. Every accepted one- or two-point move strictly decreases WCSS, and there are finitely many feasible clusterings. Hence the algorithm terminates. BPS-2PLS has the same guarantee because screening preserves every improving pair; its envelopes are rebuilt after one-point descent reaches the next D-local state.
C.6 DISTANCE EVALUATION, TIME, AND MEMORY
The sample–centroid cache D and the sample–sample distances have different roles. Lloyd initializes D and the cluster statistics, which are then maintained through local updates during Min-D-LO and after accepted pairs. Screening uses these quantities, the insertion scores, and ; it does not evaluate any . In particular, the diameter in Section 7 is only an analysis quantity and is not computed by BPS. Sample–sample distances are needed only for exact gain evaluation after screening.
Full caching. One may compute all once in time and store them in space. They remain valid across clustering updates because the samples do not change. Each later lookup costs , yielding screening-and-search time after one-point descent. The quadratic preprocessing and storage remain even when screening retains very few samples.
Lazy block evaluation. Algorithms 1–3 instead compute distances only within the current search set. For BPS-2PLS this set is , so at most distinct pair distances are required. A block with at most rows of retained samples and at most retained columns uses distance storage. Processing the blocks, reusing each distance across all destination choices and discarding a block after use, costs time. The resulting screening-and-search cost after one-point descent is
with no preprocessing. Distances may be recomputed in later rounds; the per-round bound includes this work.
Table 5: Distance-policy costs for BPS-2PLS. Screening-and-search time excludes one-point descent and accepted-move state updates; peak memory includes the input data and clustering workspace. The block row limit is .
| Full sample-pair cache | Lazy candidate-pair blocks | |
|---|---|---|
| Pair-distance preprocessing | None | |
| Screening and search per round | ||
| Peak memory |
The common storage comprises the input coordinates, the sample–centroid and insertion-score entries, and the centroid-distance entries; storing all envelopes requires at most additional space. A copied candidate-data array uses space, already covered in Table 5. With fixed , lazy evaluation avoids quadratic sample-pair storage even if . The two policies evaluate the same gains and have the same exact-arithmetic optimality guarantee.
Total runtime. Let count Lloyd iterations, count complete one-point gain scans across all Min-D-LO phases, and count screening-and-search rounds. These counts include the unsuccessful scans and the final search used to certify termination. Initialization and construction of take , absorbed into since . Each one-point scan costs and accepts at most one move, whose local update costs . Each two-point round rebuilds the screening quantities in time and, if successful, adds a local update costing . If samples survive in round , the lazy implementation therefore takes
Setting gives equation 19; an average candidate count cannot replace this maximum in that worst-case bound. The update allowance is unnecessary in unsuccessful scans or rounds but gives a uniform upper bound. These counts refer to individual scans and rounds, not to calls of a complete Min-D-LO solver; no convergence-rate bound on is asserted.
Without screening, PD-2PLS uses all samples and takes time with lazy distances. Under full caching, the bound includes the one-time preprocessing term, with replaced by in the BPS-2PLS bound. Under Theorem 7.2, the lazy-distance term is , so the screening-and-search cost after one-point descent, including an accepted pair's update, remains for fixed .
D DETAILS FOR SAFE BOUNDARY-POINT SCREENING
D.1 CONFIGURATION COEFFICIENTS
Table 6 gives the coefficients in equation 14, obtained from the gains in Table 1 after optimizing any free partner destination. The first four configurations use , different sources with the same destination use , and the backward chain uses .
D.2 ENVELOPE CONSTRUCTION AND QUERIES
We use a standard construction for line upper envelopes de Berg et al. (2008). For a fixed key , we sort the lines by increasing slope, retaining only the largest intercept among lines with equal slope. We then scan the sorted lines while maintaining a stack of active lines and their intersection
Table 6: Separable gains for , with and envelope key .
| Configuration | |||
|---|---|---|---|
| Same source same destination | |||
| Same source, different destinations | |||
| Forward chain | |||
| Swap | |||
| Different sources, same destination | |||
| Backward chain |
breakpoints, removing redundant lines until the breakpoints are strictly increasing. Each line is inserted and removed at most once, so sorting and envelope construction take time and space. An individual query at can use binary search on the breakpoints in time, with constant-time handling of envelopes with at most one line. The implementation instead sorts the query radii for each envelope and scans its breakpoints monotonically, then restores the original query order. With queries this takes time; the total number of queries and lines across families is , so the same aggregate bound holds.
D.3 CACHED PIVOT RADII
The triangle and reverse triangle inequalities give
Using the upper bound for and the lower bound for yields equation 15. With these pivot choices, the radii needed for line construction and envelope queries can be computed from the cached distances . We first compute the matrix , where , for all cluster pairs in time. For any sample index , the required squared radius is
E PROOFS FOR CANDIDATE-SET SIZE GUARANTEES
We first prove Proposition 7.1 and give the construction with . We then bound the number of samples in using a cover by slabs and prove Theorem 7.2 for the two distribution classes.
E.1 DETERMINISTIC LOCALIZATION OF RETAINED SAMPLES
Fix a D-local state with , and let . We analyze the exact-arithmetic certificate in equation 18 with the pivots and partner supersets in Table 2. The localization argument is deterministic.
Proof of Proposition 7.1. Let be the best one-point gain for sample . The condition ensures that every constituent one-point move considered below is feasible, and D-locality makes its gain nonpositive. We first bound the screening certificate by , then translate this bound into a squared-distance margin.
For a cluster , define the interactions
The cluster-update identities in Proposition 5.1 give
and . Therefore, for and with and , each exact gain has the form
where Table 7 lists . When the partner destination is free, choose the optimizing destination from Section 5; the identity still holds.
Table 7: Interactions and their upper bounds after radial relaxation, for the anchor . The last column bounds the excess over the two one-point gains.
| Configuration | Interaction | Excess upper bound |
|---|---|---|
| Same source, same destination | ||
| Same source, different destinations | ||
| Forward chain | ||
| Swap | ||
| Different sources, same destination | ||
| Backward chain |
To verify the last column, recall that . Since each empirical center is a cluster mean, convexity gives
The condition ensures and . Using these inequalities and discarding negative terms in equation 33 gives
Next, fix an envelope key and abbreviate . A center pivot gives , while a midpoint pivot gives
The radial replacement of has slack
Indeed, , so the bounds follow from Cauchy–Schwarz. Using the coefficients in Table 6 and yields the bound in every row of Table 7. Each such bound is at most .
The same bounds cover the extra partners introduced by envelope sharing. In the two same-source configurations, the self-line satisfies the same algebraic identities with . Its two one-point terms are and either or , where . For different sources with the same destination, the enlarged set also includes ; its partner term is . For a backward chain, the extra partners have and partner term . All of these one-point gains are feasible and nonpositive. Configurations requiring a third label are omitted if that label is unavailable. Thus every relaxed gain is at most . Taking maxima over partners, configurations, and anchor destinations yields
These algebraic checks are needed because a shared envelope also contains lines that do not represent feasible two-point moves.
If and , there is an with . The difference between this gain and the fixed-center squared-distance difference is
Applying equation 37 with any destination , D-locality gives
Thus the assigned center is a nearest center, and . For the selected destination , the lower gain bound and equation 37 give . Consequently,
Hence , proving Proposition 7.1. Taking the contrapositive, any sample outside this region has . The inclusion imposes a necessary condition for retention, so samples inside the region may still be discarded.
E.2 A WORST-CASE CONSTRUCTION
We construct a deterministic family of bounded, balanced D-local states with . For every even , set and form two clusters in :
The instance is bounded, has and , and both cluster sizes equal . The centroids are and . Each sample has squared distance 1 to its own centroid and to the other, so every one-point gain is
The displayed state is therefore D-local. For samples and , the swap , has gain
The same calculation applies with the second coordinates reversed. Every sample participates in an improving swap, so any sample-level screening rule preserving all improving pairs must retain all n samples. In particular, BPS has m = n on this sequence of instances. The support locations in this deterministic family vary with n. The construction rules out a distribution-free sublinear bound, while Theorem 7.2 concerns independent sampling from a fixed distribution satisfying its stated conditions.
E.3 UNIFORM SLAB COUNTING AND AUTOMATIC CENTER SEPARATION
Now let be i.i.d. random vectors from a fixed distribution , and consider the state class in equation 21. We control sample counts in by covering it with slabs. We first establish a counting bound that holds for all slabs simultaneously. This uniformity allows both the centers and the covering slabs to depend on the observations.
Let be the class of Euclidean slabs, let , and set
The following relative counting bound is uniform over slab locations, directions, and widths, including those chosen from the observations.
Proposition E.1 (Uniform slab counts). For i.i.d. random vectors from P and every , with probability at least ,
Proof. Affine halfspaces in have at most distinct traces on points. A slab is the intersection of two halfspaces, so has at most traces. Introduce an independent sample , and let count its observations in . If a slab selected from the original sample satisfies , then Markov's inequality, conditional on this sample and the selected slab, gives
Hence
Independently exchange and with probability for every , which preserves their joint distribution. Conditional on the unordered pairs, a fixed trace of on the pooled observations has fixed total . The difference is a sum of independent symmetric signs, where counts pairs with exactly one point in . The bound therefore gives
if ; a positive deviation is impossible otherwise. On the event , , we have and . The conditional probability of this event for a fixed trace is at most . A union bound over the pooled traces bounds the original failure probability by . Taking makes this at most .
Let . Suppose every unit projection has a density satisfying
A slab of total width then has probability at most , uniformly over its location and direction. We use this property to derive empirical center separation from D-locality and the occupancy condition. Write . For such that and , we show that the event in equation 39 implies
Bounded projection densities exclude point atoms, so all observations are distinct almost surely. If two centers coincided, then for each ,
D-locality would force all points in to equal that center, contradicting distinctness and .
For distinct centers, put and . By equation 37, D-locality makes each assigned center a nearest center, so for . The nonnegative distances average to , because the cluster mean is . At least samples therefore lie in the slab
Its probability is at most by equation 40. Applying equation 39 gives
which proves . All statements hold on a single event for every empirical state and every center pair.
On that event, define the auxiliary slabs
For any , its nearest and second-nearest centers identify a pair whose squared-distance difference is at most . Therefore,
Combining this cover with Proposition 7.1 gives
For ,
Thus is a slab around the equal-distance hyperplane, with geometric half-width . Its total projection width is , so its probability is at most . The squared sample diameter is common to all empirical states, and throughout . Summing equation 39 over the slabs yields
with probability at least , under the stated sample-size conditions. The bound holds even though and the empirical centers depend on the observations, because the counting event is uniform over all slabs. For fixed and , its right-hand side is a term proportional to plus .
E.4 THE TWO DISTRIBUTION CLASSES
Proof of Theorem 7.2. First suppose is supported on a ball of radius centered at and . For a unit vector , integration over gives the projection density
Every nonempty slice of the support has -dimensional volume at most , the volume of a radius- ball in . Consequently, equation 40 holds with , using when . Any two samples are at distance at most , so . For every fixed , the sample-size conditions of Appendix E.3 hold eventually, and equation 43 is . This proves the first case.
Next suppose P is the fixed k-component Gaussian mixture in the theorem. Positive definiteness and finiteness give constants
For any unit , the projection within component is a univariate Gaussian with variance . Each component density is bounded by , and so is their convex mixture. Thus equation 40 holds with this value of .
To bound the distance scale, write , where the are independent standard Gaussian vectors, independent of the component labels , with . Here upright symbols denote random draws, while denotes a fixed realization. For any fixed , let . Fix . The Gaussian identity , Markov's inequality, and a union bound imply
On the complementary event, the realized squared sample diameter satisfies
Intersect this event with the uniform counting event at confidence . Applying equation 43 with gives on an event of probability at least . Since is arbitrary, this proves equation 22 for the second case. The argument requires neither separation of component means nor recovery of the mixture-component labels by the empirical clustering.
The supremum in equation 22 makes the result uniform over all qualifying states, including states selected adaptively from the observations. For a D-local algorithmic output and any ,
If the occupancy failure probability tends to zero, this proves . The convention for an empty state class does not assume that a state in exists or is attained algorithmically.
F EXPERIMENTAL SETUP
Datasets. The clustering-quality comparison uses the twelve datasets in Table 8. The dataset names in the table link to public benchmark source pages. The five marked datasets are used for the descent-trajectory study and heuristic comparisons; Table 4 reports the available heuristic results. For each real dataset, k is set to the number of reference classes, and the clustering algorithms receive only the feature vectors and k. Pixel representations are scaled to , while CIFAR-10 and CIFAR-100 use pre-extracted DINOv2 features. 20News uses the supplied TF-IDF representation reduced to 100 dimensions by singular value decomposition, and Sensorless uses the supplied measurement features. All methods use the same representations, without additional normalization or dimensionality reduction. The candidate-set scaling study uses random subsets of six larger datasets, with its sampling and aggregation protocol specified in Appendix G.3.
DINOv2 features. For CIFAR-10 and CIFAR-100, we use the pretrained DINOv2 ViT-B/14 backbone without register tokens (dinov2_vitb14) from the official implementation, revision 7764ea0. We combine the original training and test sets and use the fine labels for CIFAR-100. Each RGB image is resized by bicubic interpolation to a shorter-side length of 256 pixels, center-cropped to , converted to a tensor with pixel values in , and normalized channelwise using ImageNet means (0.485, 0.456, 0.406) and standard deviations (0.229, 0.224, 0.225). The 768-dimensional feature is the final CLS token after LayerNorm (x_norm_clstoken), with no subsequent samplewise normalization. Feature extraction uses PyTorch 2.11.0+cu128 in float32, with autocast and TF32 disabled; the saved features are converted to double precision for clustering. Feature extraction is performed before clustering and is excluded from the reported clustering runtimes.
Comparison methods. We organize the evaluated methods into two categories according to their update mechanisms.
Sample-reassignment-based methods. These methods update sample memberships through batch assignments or one- and two-point reassignments.
• Lloyd (Lloyd, 1982): Alternates between assigning samples to their nearest centroids and recomputing cluster means until the assignments stabilize.
Table 8: Datasets used in the clustering-quality comparison. Here , , and denote the number of samples, feature dimension, and number of reference classes, respectively. Dataset names link to benchmark source pages; the listed dimensions describe the representations used here. Datasets marked with are used for the descent-trajectory study and heuristic comparisons.
| Dataset | n | d | k | Representation |
|---|---|---|---|---|
| Yale | 165 | 1,024 | 15 | Pixels |
| ORL | 400 | 1,024 | 40 | Pixels |
| USPS-1000 | 1,000 | 256 | 10 | Pixels |
| COIL20 | 1,440 | 1,024 | 20 | Pixels |
| MNIST-2000 | 2,000 | 784 | 10 | Pixels |
| COIL100 | 7,200 | 1,024 | 100 | Pixels |
| 20News | 18,282 | 100 | 20 | TF-IDF + SVD |
| Sensorless | 58,509 | 48 | 11 | Measurements |
| CIFAR-10 | 60,000 | 768 | 10 | DINOv2 |
| CIFAR-100 | 60,000 | 768 | 100 | DINOv2 |
| MNIST | 70,000 | 784 | 10 | Pixels |
| Fashion-MNIST | 70,000 | 784 | 10 | Pixels |
-
lite-KM (Cai, 2011): A vectorized MATLAB implementation of Lloyd's algorithm, included as an efficient baseline for batch reassignment.
-
Hartigan (Telgarsky and Vattani, 2010): Sequentially scans samples and moves each sample to the destination with the largest positive gain after centroid recomputation, immediately updating the affected centroids.
-
D-LO (Li et al., 2025a): Alternates Lloyd iterations with one-point local search, accepting the first improving feasible reassignment and then resuming Lloyd iterations.
-
Min-D-LO (Li et al., 2025a): Uses the same framework as D-LO but selects the one-point reassignment with the largest objective decrease in each local-search step.
-
BPS-2PLS (ours): After initial Lloyd convergence, alternates the best-improvement one-point descent of Min-D-LO with exact two-point search, maintaining cluster statistics and distance columns through local updates. Lloyd is not restarted between local moves. Safe boundary-point screening reduces the candidate set while preserving every improving two-point move (Algorithm 2).
Heuristic methods. These methods explore center replacements or cluster repartitions, which can change many sample memberships at once.
-
LocalSearch (Lattanzi and Sohler, 2019): Samples a data point with probability proportional to its squared distance to the nearest center and accepts the best improving replacement of one current center by this point.
-
MultiSwap (Beretta et al., 2023): Extends center swaps to multiple sampled points. Our implementation retains the best centers from the pool of current centers and sampled points, and applies Lloyd refinement after an improving exchange.
-
J-Means (Hansen and Mladenović, 2001): Escapes Lloyd fixed points by relocating a centroid to a data sample. Our implementation scores candidate jumps after one assignment-and-centroid update and follows the best improving jump with Lloyd refinement.
-
MergeSplit (Nielsen and Nock, 2014): Merges two clusters and repartitions their union using repeated 2-means trials. An improving split is accepted and followed by global Lloyd refinement.
We evaluate the four heuristic methods with and without BPS-2PLS; the refinement insertion points are described in Appendix G.2.
Heuristic search budgets. LocalSearch uses 20 sampled replacement attempts. MultiSwap samples two candidate points per outer step and runs for at most 10 steps. MergeSplit uses five random
2-means trials per cluster pair, while J-Means stops when no improving jump is found. Each baseline and its enhanced variants use the same method-specific budget and acceptance rule; refinement time is included in the reported runtime. Hartigan on COIL100, CIFAR-10, CIFAR-100, MNIST, and Fashion-MNIST, and all J-Means variants on COIL20 and MNIST-2000, were omitted because of excessive runtime; these runs are marked with dashes.
Initialization. For the quality and enhancement comparisons, we generate ten independent k-means++ initial center sets per dataset and share them across methods. Each randomized outer method and its enhanced variants use paired random seeds and the same outer search budgets.
Evaluation metrics. We report squared-error loss, clustering accuracy (ACC), and normalized mutual information (NMI). Loss is recomputed as from each method's returned assignments and centers . ACC uses an optimal matching between cluster labels and reference labels, and NMI is defined as , where is the reference-label vector, and and denote mutual information and entropy computed from empirical label frequencies. Across the ten initializations, we report the best value, mean, and standard deviation of each quality metric. Best means minimum loss or maximum ACC/NMI; these extrema are selected independently and need not come from the same initialization.
Timing. For the quality and enhancement comparisons, each fixed initialization is run five times, resetting any algorithm-specific random stream before each repetition. We first average the five run-times for each initialization and then report the mean and standard deviation across the ten resulting averages; the repetitions do not constitute additional independent initializations. Quality metrics are recorded once per initialization. Each method is warmed up before measurement, and method order is rotated across repetitions. Reported runtimes include all algorithmic work, including distance calculations and screening, but exclude data loading, shared initial-center generation, quality evaluation, and result serialization. Phase diagnostics and MATLAB profiling are collected in separate runs to avoid adding their overhead to the ordinary timing measurements.
Implementation. All methods are implemented in MATLAB using double-precision arithmetic. We use the lazy policy in Appendix C.6: after screening, distances are evaluated only between retained samples, in blocks of at most 256 rows, and each block is discarded after its pairs are processed. A distance is reused across destination choices; no dataset-wide sample-pair cache is precomputed or retained across rounds. Remaining pairs whose certificates cannot exceed the best gain found so far may also be skipped, which can reduce work below the worst-case bound. Reported total runtimes include all distance calculations and state updates; the Search phase in Appendix G.6 includes candidate-pair distance computation. The clustering-quality and heuristic-enhancement experiments were run in MATLAB R2026a on an Intel Xeon Gold 6248R CPU at 3.00 GHz, with memory operating at 2666 MHz. The separate runtime-phase study is described in Appendix G.6.
G SUPPLEMENTARY EXPERIMENTAL DISCUSSION
G.1 WCSS IMPROVEMENTS IN LARGER CLUSTERS
A plausible explanation is the diminishing influence of a few samples on well-populated clusters. For a sample with and destination , rewriting equation 4 gives . At a Lloyd fixed point, ; if residual distances remain on comparable scales, the two positive corrections shrink as the affected clusters grow, restricting improving relocations to samples with small assignment margins. Two-point moves similarly induce smaller centroid changes in larger clusters. Unless these moves trigger substantial subsequent descent, their gains can remain small relative to WCSS summed over all samples. This interpretation concerns the one- and two-point neighborhoods; larger coordinated rearrangements may still yield improvements.
G.2 HEURISTIC REFINEMENT INSERTION POINTS
For each baseline, the Post variant applies BPS-2PLS to its final clustering. This terminal refinement measures the residual improvement available after the original heuristic stops.
For MultiSwap, J-Means, and MergeSplit, we also consider an Inner variant that embeds BPS-2PLS within the search. In MultiSwap and J-Means, BPS-2PLS replaces the initial Lloyd refinement and the Lloyd refinement following each accepted outer move; candidate generation and scoring rules remain unchanged. In MergeSplit, BPS-2PLS is applied with to every trial split of the selected cluster pair, before choosing the best trial and deciding whether to accept it; global Lloyd refinement is retained. LocalSearch is evaluated only with terminal enhancement. The comparison separates improvements available at termination from changes produced by refining intermediate states. Terminal refinement cannot increase WCSS for a given baseline output, whereas internal refinement changes the subsequent search trajectory and need not outperform the baseline on every initialization.
G.3 CANDIDATE-SET SCALING PROTOCOL AND INTERPRETATION
We study how the retained count changes with on 20News, Sensorless, CIFAR-10, CIFAR-100, MNIST, and Fashion-MNIST. For each dataset, we sample subsets uniformly without replacement at ; 20News is evaluated only up to . At each size, we generate five independent subsets and run three -means++ initializations per subset. For each subset, we first average over the three initializations. Figure 3 then reports the mean and standard deviation of the five subset averages.
Implications for the theoretical bound. These observations raise the possibility that the upper bound in Theorem 7.2 is conservative for states reached by the algorithm. The theorem controls all D-local states satisfying the occupancy condition through global diameter bounds and uniform slab counting, which may overestimate the number of candidates at a typical computed state. It is therefore natural to investigate whether a sharper analysis can establish for algorithmic outputs under suitable distributional and occupancy assumptions. This remains a conjecture: averages from finite-dataset subsampling cannot establish an asymptotic rate or reliably distinguish constant behavior from slow logarithmic growth.
G.4 ADDITIONAL CLUSTERING QUALITY FOR SAMPLE-REASSIGNMENT METHODS
Tables 9 and 10 complement the WCSS and runtime comparison in Table 3 with ACC and NMI. Both metrics are expressed as percentages and summarized by their means and standard deviations across the same ten initializations; timing repetitions do not add independent quality measurements. The Yale results in these tables use 165 samples and 15 classes. The comparisons use the available results only, without imputing missing methods.
Table 9: ACC (%) for the sample-reassignment methods over ten shared initializations. Entries are mean ± standard deviation; higher is better. Bold marks the highest available mean on each dataset, including ties at the displayed precision. Dashes mark Hartigan runs omitted because of excessive runtime.
| Dataset | Lloyd | lite-KM | Hartigan | D-LO | Min-D-LO | BPS-2PLS |
|---|---|---|---|---|---|---|
| Yale | 38.67 ± 2.35 | 38.67 ± 2.35 | 41.39 ± 3.82 | 41.03 ± 2.46 | 41.03 ± 2.46 | 41.64 ± 2.16 |
| ORL | 48.85 ± 4.12 | 48.85 ± 4.12 | 54.73 ± 3.09 | 53.88 ± 4.36 | 53.88 ± 4.36 | 54.88 ± 3.09 |
| USPS-1000 | 45.69 ± 3.06 | 45.69 ± 3.06 | 47.67 ± 2.34 | 47.59 ± 2.74 | 47.59 ± 2.74 | 47.48 ± 2.54 |
| COIL20 | 60.76 ± 5.20 | 60.76 ± 5.20 | 61.69 ± 4.33 | 61.88 ± 5.64 | 61.88 ± 5.64 | 62.03 ± 5.46 |
| MNIST-2000 | 54.78 ± 3.31 | 54.78 ± 3.31 | 54.29 ± 3.50 | 56.12 ± 4.21 | 56.12 ± 4.21 | 56.07 ± 4.13 |
| COIL100 | 46.11 ± 1.68 | 46.11 ± 1.68 | — | 46.72 ± 1.64 | 46.72 ± 1.64 | 46.99 ± 1.80 |
| 20News | 37.39 ± 2.32 | 37.39 ± 2.32 | 37.46 ± 1.61 | 37.35 ± 2.42 | 37.36 ± 2.43 | 37.34 ± 2.43 |
| Sensorless | 21.71 ± 2.35 | 21.71 ± 2.35 | 22.40 ± 1.93 | 21.72 ± 2.35 | 21.72 ± 2.35 | 21.72 ± 2.36 |
| CIFAR-10 | 78.23 ± 5.93 | 78.23 ± 5.93 | — | 78.22 ± 5.93 | 78.22 ± 5.93 | 78.22 ± 5.93 |
| CIFAR-100 | 66.09 ± 2.16 | 66.09 ± 2.16 | — | 66.23 ± 2.23 | 66.23 ± 2.23 | 66.23 ± 2.23 |
| MNIST | 55.50 ± 2.78 | 55.50 ± 2.78 | — | 55.43 ± 2.69 | 55.43 ± 2.69 | 55.43 ± 2.69 |
| Fashion-MNIST | 51.67 ± 2.97 | 51.67 ± 2.97 | — | 51.67 ± 2.97 | 51.68 ± 2.97 | 51.68 ± 2.97 |
Improvements and their limits. BPS-2PLS improves both mean ACC and mean NMI over Lloyd on Yale, ORL, USPS-1000, COIL20, MNIST-2000, COIL100, and Sensorless. The ACC increases
Table 10: NMI (%) for the sample-reassignment methods over ten shared initializations. Entries are mean ± standard deviation; higher is better. Bold marks the highest available mean on each dataset, including ties at the displayed precision. Dashes mark Hartigan runs omitted because of excessive runtime.
| Dataset | Lloyd | lite-KM | Hartigan | D-LO | Min-D-LO | BPS-2PLS |
|---|---|---|---|---|---|---|
| Yale | 47.06 ± 2.14 | 47.06 ± 2.14 | 50.32 ± 2.52 | 49.95 ± 1.84 | 49.95 ± 1.84 | 50.56 ± 2.74 |
| ORL | 72.92 ± 2.10 | 72.92 ± 2.10 | 77.08 ± 1.23 | 76.63 ± 1.92 | 76.63 ± 1.92 | 77.29 ± 1.87 |
| USPS-1000 | 44.10 ± 1.22 | 44.10 ± 1.22 | 46.94 ± 2.76 | 46.12 ± 2.30 | 46.12 ± 2.30 | 46.06 ± 2.00 |
| COIL20 | 76.51 ± 1.65 | 76.51 ± 1.65 | 76.77 ± 1.62 | 77.28 ± 2.11 | 77.28 ± 2.11 | 77.38 ± 2.04 |
| MNIST-2000 | 48.75 ± 2.65 | 48.75 ± 2.65 | 49.01 ± 2.76 | 49.49 ± 2.80 | 49.49 ± 2.80 | 49.45 ± 2.76 |
| COIL100 | 76.26 ± 0.34 | 76.26 ± 0.34 | — | 76.74 ± 0.36 | 76.74 ± 0.36 | 76.92 ± 0.38 |
| 20News | 37.48 ± 1.50 | 37.48 ± 1.50 | 37.45 ± 1.45 | 37.56 ± 1.57 | 37.56 ± 1.57 | 37.56 ± 1.57 |
| Sensorless | 16.12 ± 1.45 | 16.12 ± 1.45 | 16.35 ± 1.44 | 16.13 ± 1.45 | 16.13 ± 1.45 | 16.13 ± 1.47 |
| CIFAR-10 | 85.61 ± 1.45 | 85.61 ± 1.45 | — | 85.60 ± 1.45 | 85.60 ± 1.45 | 85.60 ± 1.45 |
| CIFAR-100 | 79.40 ± 0.42 | 79.40 ± 0.42 | — | 79.37 ± 0.40 | 79.37 ± 0.40 | 79.37 ± 0.40 |
| MNIST | 49.93 ± 1.14 | 49.93 ± 1.14 | — | 49.99 ± 1.19 | 49.99 ± 1.19 | 49.99 ± 1.19 |
| Fashion-MNIST | 51.72 ± 1.54 | 51.72 ± 1.54 | — | 51.72 ± 1.55 | 51.72 ± 1.55 | 51.71 ± 1.55 |
are 2.97 and 6.03 percentage points on Yale and ORL, respectively, and the corresponding NMI increases are 3.50 and 4.37 percentage points. BPS-2PLS has the highest available mean of both metrics on Yale, ORL, COIL20, and COIL100. However, lower WCSS need not yield better agreement with reference labels: on USPS-1000, Hartigan attains ACC and NMI, compared with and for BPS-2PLS, despite the lower WCSS of BPS-2PLS in Table 3.
On the six larger datasets from 20News through Fashion-MNIST, the absolute changes in mean ACC and NMI between BPS-2PLS and D-LO are below 0.01 percentage points before rounding. Thus, the additional WCSS reduction on these datasets is accompanied by nearly unchanged label agreement. The local-optimality guarantee concerns WCSS and does not imply an improvement in ACC or NMI.
G.5 ADDITIONAL CLUSTERING QUALITY FOR HEURISTIC ENHANCEMENT
Tables 11 and 12 supplement Table 4 with ACC and NMI on the five datasets, using the same ten shared initializations. The Post and Inner variants are defined in Appendix G.2. The Min-D-LO reference block uses Min-D-LO as Baseline and BPS-2PLS as Inner. J-Means was omitted on COIL20 and MNIST-2000 because of excessive runtime.
Table 11: ACC (%) for heuristic enhancement: mean ± standard deviation over ten initializations. Bold marks the highest mean within each method and dataset, including ties at the displayed precision. Dashes mark J-Means runs omitted because of excessive runtime. For Min-D-LO, Inner reports BPS-2PLS.
| Method | Variant | Yale | ORL | USPS-1000 | COIL20 | MNIST-2000 |
|---|---|---|---|---|---|---|
| Min-D-LO | Baseline | 41.03 ± 2.46 | 53.88 ± 4.36 | 47.59 ± 2.74 | 61.88 ± 5.64 | 56.12 ± 4.21 |
| Inner | 41.64 ± 2.16 | 54.88 ± 3.09 | 47.48 ± 2.54 | 62.03 ± 5.46 | 56.07 ± 4.13 | |
| LocalSearch | Baseline | 38.61 ± 3.16 | 53.00 ± 2.39 | 37.59 ± 2.64 | 57.72 ± 3.64 | 45.31 ± 3.42 |
| Post | 43.15 ± 4.33 | 57.55 ± 2.79 | 47.86 ± 2.07 | 63.01 ± 4.79 | 53.05 ± 3.99 | |
| MultiSwap | Baseline | 36.97 ± 3.64 | 52.10 ± 0.78 | 46.14 ± 2.92 | 58.34 ± 4.89 | 54.65 ± 5.78 |
| Post | 40.61 ± 4.13 | 56.33 ± 1.63 | 48.12 ± 2.92 | 59.63 ± 4.25 | 54.62 ± 5.33 | |
| Inner | 40.79 ± 4.23 | 55.45 ± 1.74 | 48.12 ± 2.92 | 59.63 ± 4.25 | 54.62 ± 5.33 | |
| J-Means | Baseline | 40.24 ± 2.49 | 57.18 ± 2.22 | 46.06 ± 3.00 | — | — |
| Post | 42.73 ± 2.93 | 58.05 ± 2.17 | 48.02 ± 3.01 | — | — | |
| Inner | 42.42 ± 3.32 | 58.20 ± 2.02 | 48.12 ± 2.92 | — | — | |
| MergeSplit | Baseline | 38.67 ± 3.49 | 58.75 ± 1.93 | 48.27 ± 2.90 | 68.65 ± 4.22 | 54.72 ± 5.24 |
| Post | 39.94 ± 2.79 | 58.90 ± 1.87 | 48.31 ± 3.05 | 68.72 ± 4.21 | 54.70 ± 5.27 | |
| Inner | 42.18 ± 3.89 | 58.33 ± 1.87 | 48.46 ± 3.24 | 68.76 ± 3.76 | 54.82 ± 5.07 |
Table 12: NMI (%) for heuristic enhancement: mean ± standard deviation over ten initializations. Bold marks the highest mean within each method and dataset, including ties at the displayed precision. Dashes mark J-Means runs omitted because of excessive runtime. For Min-D-LO, Inner reports BPS-2PLS.
| Method | Variant | Yale | ORL | USPS-1000 | COIL20 | MNIST-2000 |
|---|---|---|---|---|---|---|
| Min-D-LO | Baseline | 49.95 ± 1.84 | 76.63 ± 1.92 | 46.12 ± 2.30 | 77.28 ± 2.11 | 49.49 ± 2.80 |
| Inner | 50.56 ± 2.74 | 77.29 ± 1.87 | 46.06 ± 2.00 | 77.38 ± 2.04 | 49.45 ± 2.76 | |
| LocalSearch | Baseline | 45.08 ± 1.87 | 72.18 ± 1.06 | 33.05 ± 1.68 | 70.72 ± 1.04 | 35.68 ± 3.67 |
| Post | 50.86 ± 2.88 | 77.83 ± 1.26 | 46.60 ± 1.99 | 77.46 ± 1.10 | 47.72 ± 2.19 | |
| MultiSwap | Baseline | 45.47 ± 2.79 | 74.48 ± 0.62 | 44.44 ± 2.65 | 75.72 ± 1.50 | 49.44 ± 2.84 |
| Post | 49.44 ± 2.87 | 77.68 ± 0.90 | 46.65 ± 2.67 | 76.61 ± 1.19 | 49.79 ± 2.52 | |
| Inner | 49.61 ± 2.93 | 77.53 ± 1.15 | 46.65 ± 2.67 | 76.61 ± 1.19 | 49.79 ± 2.52 | |
| J-Means | Baseline | 47.37 ± 2.12 | 78.13 ± 0.73 | 44.47 ± 2.63 | — | — |
| Post | 50.95 ± 2.00 | 78.87 ± 0.85 | 46.72 ± 2.61 | — | — | |
| Inner | 50.64 ± 2.55 | 78.60 ± 0.80 | 46.65 ± 2.67 | — | — | |
| MergeSplit | Baseline | 48.04 ± 2.57 | 78.66 ± 1.03 | 46.73 ± 2.49 | 79.46 ± 1.26 | 49.73 ± 2.59 |
| Post | 49.56 ± 2.34 | 78.83 ± 0.77 | 46.97 ± 2.63 | 79.59 ± 1.32 | 49.77 ± 2.61 | |
| Inner | 50.74 ± 2.65 | 78.65 ± 0.54 | 46.66 ± 2.79 | 79.63 ± 0.97 | 49.90 ± 2.40 |
Terminal refinement. Among the four heuristic methods, Post improves mean ACC in sixteen of eighteen available method–dataset comparisons and mean NMI in all eighteen. ACC changes range from -0.03 to 10.27 percentage points, and NMI increases range from 0.04 to 13.55 percentage points. The two ACC decreases occur for MultiSwap and MergeSplit on MNIST-2000. The largest gains occur for LocalSearch on USPS-1000, where ACC rises from 37.59% to 47.86% and NMI from 33.05% to 46.60%. These results show that the WCSS improvements reported in the main text can also improve agreement with reference labels, although label agreement is not part of the refinement objective.
Internal refinement. Among the three heuristic methods with an Inner variant, Inner improves mean ACC in eleven of thirteen comparisons with the corresponding baseline and likewise improves mean NMI in eleven of thirteen comparisons. Its relative performance against Post depends on the dataset and metric. For example, MergeSplit–Inner on Yale attains 42.18% ACC and 50.74% NMI, compared with 39.94% and 49.56% for Post. On ORL, however, MergeSplit–Inner has lower mean ACC than both the baseline and Post (58.33%, versus 58.75% and 58.90%), even though it has the lowest mean WCSS among the three variants. For MergeSplit on USPS-1000, Inner has the highest ACC but lower NMI than the other variants. On COIL20, MergeSplit–Inner has higher mean ACC and NMI than Post despite a higher mean WCSS. These differences reflect changes in the search trajectory and the distinction between optimizing WCSS and matching reference classes. The tables provide descriptive comparisons across initializations; they do not establish statistical significance.
G.6 RUNTIME BY ALGORITHMIC PHASE
We measure the runtime composition of BPS-2PLS on all twelve datasets in Table 8 with screening enabled. This separate timing study was run in MATLAB R2026b.
Measurement protocol. We use three -means++ initializations per dataset and five timed repetitions per initialization after warm-up. All four phase timers and the total wall-clock time are collected from the same instrumented run, with MATLAB's function-level Profiler disabled. We first average repetitions within each initialization, then compute means and sample standard deviations across the three initialization averages. A phase's percentage is its mean runtime divided by the mean total runtime. These measurements characterize this timing batch and are not pooled with the ten-initialization quality experiments.
Phase definitions. Descent includes Lloyd iterations and one-point local descent throughout the run. Screen constructs and evaluates the screening bounds, and Search performs the exact search over the retained sample pairs, including their distance calculations. Other includes initialization of the clustering state, updates for accepted two-point moves, and remaining overhead. The four phases partition the measured total; pair-distance computation is included in Search and is not counted again in Other.
Table 13: Runtime by phase with screening enabled. Times are in seconds, reported as mean ± standard deviation across three initializations after averaging five repetitions within each initialization. Parentheses give each phase's percentage of the mean total time; percentages below 0.1% are shown to two decimal places. Bold marks the largest mean phase time for each dataset.
| Dataset | Total | Descent | Screen | Search | Other |
|---|---|---|---|---|---|
| Yale | (55.5%) | (28.9%) | (13.5%) | (2.1%) | |
| ORL | (33.3%) | (60.7%) | (4.8%) | (1.2%) | |
| USPS-1000 | (89.4%) | (7.7%) | (2.0%) | (0.9%) | |
| COIL20 | (84.0%) | (14.0%) | (0.4%) | (1.6%) | |
| MNIST-2000 | (94.6%) | (3.5%) | (0.9%) | (1.1%) | |
| COIL100 | (52.2%) | (44.3%) | (2.6%) | (0.9%) | |
| 20News | (92.0%) | (6.9%) | (0.9%) | (0.2%) | |
| Sensorless | (63.7%) | (35.3%) | (0.04%) | (1.0%) | |
| CIFAR-10 | (92.5%) | (6.1%) | (0.03%) | (1.4%) | |
| CIFAR-100 | (65.2%) | (31.1%) | (2.9%) | (0.7%) | |
| MNIST | (96.7%) | (2.7%) | (0.02%) | (0.6%) | |
| Fashion-MNIST | (93.1%) | (5.5%) | (0.01%) | (1.4%) |
Dominant costs. Descent is the largest phase on eleven of the twelve datasets, accounting for 52.2%–96.7% of total runtime on those datasets. ORL is the exception, where screening accounts for 60.7% of runtime compared with 33.3% for descent. Screening is also substantial on COIL100, Sensorless, CIFAR-100, and Yale, where it accounts for 44.3%, 35.3%, 31.1%, and 28.9% of runtime, respectively. Exact pair search remains relatively small: it accounts for at most 13.5% on Yale and no more than 4.8% on any other dataset; on Sensorless, CIFAR-10, MNIST, and Fashion-MNIST it is below 0.05%. Other overhead remains at or below 2.1% across all datasets. These phase shares suggest that further runtime reductions on the evaluated workloads depend primarily on accelerating descent and screening rather than the remaining exact pair search. Because the timing study contains only screening-enabled runs, the breakdown characterizes runtime composition rather than the net speedup attributable to screening.