SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We now argue that the clustering cost of each good single cluster takes a certain fraction of the total clustering cost. Then, by sampling according to the squared distances, with good probability, data points close to the center of a good single cluster can be sampled. According to the definition of good single cluster, we can assume that  $\Delta(P_h^*, C) = b\Delta(P_h^*, \{c_h^*\})$  for a real number  $b \geq 9$ . By Lemma 3, we know that  $\Delta(\chi(P_h^*), C) \geq \frac{b-1}{200}\Delta(P_h^*, \{c_h^*\}) = \frac{b-1}{200b}\Delta(P_h^*, C) \geq \frac{1}{300}\Delta(P_h^*, C)$ . By the definition of good single cluster, we also have  $\Delta(P_h^*, C) \geq \frac{1}{100k}\Delta(P, C)$ , which implies that  $\Delta(\chi(P_h^*), C) \geq \frac{1}{30000k}\Delta(P, C)$ . Thus, in each round of the sampling process in steps 4-5 of Algorithm 2, with probability at least  $\Omega(\frac{1}{k})$ , we can sample a point  $q \in \chi(P_h^*)$  for a good single cluster  $P_h^*$  with a type-2 matched swap pair  $(c_h^*, c_q) \in M_3$ . The following lemma shows that, by swapping  $q$  with  $c_q$  and assigning all the data points in  $P_h^*$  to  $q$ , the clustering cost can be reduced at least by  $1 - \Theta(\frac{1}{k})$ .
Lemma 4 By swapping  $q$  with  $c_{q}$ , the clustering cost of  $\Delta(P, C)$  can be reduced at least by  $1 - \Theta\left(\frac{1}{k}\right)$ .
We have shown that if case (1) happens, we can sample a data point  $q$  close to the center of a good single cluster  $P_h^*$  to make the clustering cost reduced significantly. Next, we assume that case (1) never happens and case (2) happens. In case (2), the idea behind is to sample data points close to the optimal centers in  $H_1$  or sets of optimal centers in  $H_2$  to reduce the clustering cost. We first bound the clustering cost of optimal clusters in  $J(L)$ .
Lemma 5 If case (2) happens, then  $\Delta(X(L), C) \leq (1 + \frac{1}{t})(9\Delta(X(L), C^*) + 24\Delta(X(L'), C^*) + \frac{1}{5}\Delta(X(L'), C) + \frac{1}{100}\Delta(P, C))$ .
Now, consider a set of centers  $Q \in H_2$ . We will divide the optimal clusters in  $J(Q)$  into two groups. Let  $Q_L = \{P_h^* \in J(Q) : \Delta(P_h^*, C) \geq \frac{1}{30000k^{2t-1}} \Delta(P, C)\}$  be the set of optimal clusters in  $J(Q)$  with large clustering cost with respect to  $C$  and  $Q_S = \{P_h^* \in J(Q) : \Delta(P_h^*, C) < \frac{1}{30000k^{2t-1}} \Delta(P, C)\}$  be the set of optimal clusters in  $J(Q)$  with small clustering cost with respect to  $C$ , respectively. We define  $Q_S' = \{P_h^* \in Q_S : \Delta(P_h^*, C) < 3\Delta(P_h^*, \{c_h^*\})\}$  as the set of optimal clusters in  $Q_S$  whose clustering centers are close to one of the centers in  $C$ . Let  $Q_S'' = Q_S \setminus Q_S'$  and  $Q_T = Q_L \cup Q_S''$ , respectively. We first show that, it suffices to only consider optimal clusters in  $Q_T$ .
Lemma 6 Let  $Q \in H_2$  be a set of centers in  $H_2$ , where  $J(Q)$  is a set of good  $t$ -clusters with a type-1 matched swap set  $(Q, A') \in M_2$ . Define  $V = A' \setminus \{c_j\}$ , where  $c_j$  is the center in  $A'$  with  $|\Psi^{-1}(c_j)| > 1$ . Let  $U \subseteq P$  be the set of data points with  $|U| = |V|$  such that  $U \cap \chi(P_h^*) \neq \emptyset$  holds for each  $P_h^* \in Q_T$ . Then,  $\Delta(P, C \setminus V \cup U) \leq (1 - \frac{1}{100k})\Delta(P, C)$ .
Note that there are  $t$  sampling iterations in each step 4 of Algorithm 2. Let  $H_2^* = \{P_h^* : P_h^* \in Q_T, Q \in H_2\}$  and  $H_t = J(H_1) \cup H_2^*$ . We will define a mapping function  $m$  which maps each  $P_h^* \in H_t$  to an integer  $m(P_h^*) \in [t]$ . For each  $P_h^* \in H_t$  such that  $c_h^* \in H_1$ , we define  $m(P_h^*) = 1$ . Then, consider each  $Q \in H_2$ . For each  $P_h^* \in Q_T$ , we define  $m(P_h^*) = i$  such that  $i \in [|Q_T|]$  and  $m(P_h^*) \neq m(P_j^*)$  for any two optimal clusters  $P_h^*, P_j^* \in Q_T$ . For each  $Q \in H_2$ , let  $p_s(Q)$  be the success probability that for each  $P_h^* \in Q_T$ , a data point is sampled from  $\chi(P_h^*)$  in the  $m(P_h^*)$ -th iteration of Algorithm 2. For each  $c_h^* \in H_1$ , let  $p_s(c_h^*)$  be the success probability that a data point is sampled from  $\chi(P_h^*)$  in the first iteration (note that in this case  $m(P_h^*) = 1$ ) of step 4. Let  $H_G^1 = \{c_h^* \in H_1 : P_h^*$  is a good single cluster with the type-1 matched swap pair  $(c_h^*, c_j) \in M_1\}$  be the set of centers in  $H_1$  whose optimal clusters are good single clusters with type-1 matched swap pairs in  $M_1$ . Let  $H_G^2 = \{Q \in H_2 : J(Q)$  is a set of good  $t$ -clusters with the type-1 matched swap set  $(Q, V) \in M_2\}$  be the collection of the sets of centers in  $H_2$  whose corresponding optimal clusters are good
$t$ -clusters with type-1 matched swap sets in  $M_2$ . Define  $p_s^f = \sum_{c_h^* \in H_G^1} p_s(c_h^*) + \sum_{Q \in H_G^2} p_s(Q)$  as the summation of the success probability. Since all the optimal clusters in  $J(L)$  belong to bad single cluster, and the events defined related to  $p_s(Q)$  or  $p_s(c_h^*)$  for each  $Q \in H_2$  and  $c_h^* \in H_1$  are mutually exclusive,  $p_s^f$  gives a lower bound success probability to get a  $(1 - \frac{1}{100k})$  reduction on the clustering cost in each iteration of steps 2-7. In the following, we will show how to obtain a lower bound for  $p_s^f$ .
Consider a set  $Q \in H_2$  of optimal centers such that  $J(Q)$  is a set of good  $t$ -clusters with a type-1 matched swap set  $(Q, A')$ . There are two subcases that may happen: (1)  $\exists P_h^* \in J(Q)$  such that  $P_h^*$  is a good single cluster with a swap pair  $(c_h^*, c_j)$ , where  $c_j$  is a lonely center used for constructing type-1 matched swap set; (2)  $\forall P_h^* \in J(Q)$ ,  $P_h^*$  is a bad single cluster with any swap pair  $(c_h^*, c_j)$ , where  $c_j$  is a lonely center used to construct type-1 matched swap set. In subcase (1), since  $t$  is usually a constant and could be much smaller than  $k$ , with probability at least  $\Omega(k^{-1})$ , a data point  $q \in \chi(P_h^*)$  can be sampled in the first iteration of step 4 in Algorithm 2 for swap to make the clustering cost reduced at least by  $(1 - \frac{1}{100k})$  according to Lemma 4. Next, we assume that subcase (1) never happens and subcase (2) happens. In subcase (2), our objective is to sample a set  $V$  of data points such that  $V$  contains at least one point from  $\chi(P_h^*)$  for each  $P_h^* \in Q_T$ . For each optimal cluster  $P_h^* \in Q_L$ , with probability at least  $\Omega(k^{-1})$ , we can sample a data point  $q \in \chi(P_h^*)$  in the  $m(P_h^*)$ -th iteration of step 4 in Algorithm 2. Thus, the probability can be bounded by  $\Omega(k^{-|Q_L|})$ . Then, we only need to consider optimal clusters in  $Q_S$ . By Lemma 6, it suffices to consider optimal clusters in  $Q_S''$ . The following lemma gives an upper bound of the failure probability of not sampling a data point from  $\chi(P_h^*)$  for each  $P_h^* \in Q_S''$  in the  $m(P_h^*)$ -th iteration in step 4 of Algorithm 2.
Lemma 7 Given a set  $Q \in H_2$  of centers such that  $J(Q)$  is a set of good  $t$ -clusters, the probability that step 4 of Algorithm 2 fails to sample a data point  $q$  from  $\chi(P_h^*)$  for each  $P_h^* \in Q_S''$  in the  $m(P_h^*)$ -th iteration is at most  $(1 + \frac{1}{30000k}) e^{-\Delta(Z(Q_S'', C) / (300\Delta(P,C))}$ .
Now we can bound the success probabilities of  $p_s(Q)$  and  $p_s(c_h^*)$  for each  $Q \in H_2$  and  $c_h^* \in H_1$ . We will divide the optimal clusters in  $\mathbb{P}(C^*) \backslash J(L)$  into two different groups  $H_G$  and  $H_B$ . Firstly, we consider the centers in  $H_1$ . For a center  $c_h^* \in H_1$ , if  $P_h^*$  is a good single cluster with the type-1 matched swap pair  $(c_h^*, c_j) \in M_1$ , then add  $P_h^*$  to  $H_G$ . Otherwise add  $P_h^*$  to  $H_B$ . For a set  $Q \in H_2$  of optimal clustering centers, if  $J(Q)$  is a set of good  $t$ -clusters with the type-1 matched swap set  $(Q, V) \in M_2$ , then add each  $P_h^* \in Q_S''$  to  $H_G$  and each  $P_h^* \in J(Q) \backslash Q_S''$  to  $H_B$ . If  $J(Q)$  is a set of bad  $t$ -clusters with the type-1 matched swap set  $(Q, V) \in M_2$ , then add each  $P_h^* \in J(Q)$  to  $H_B$ . The following lemma argues that the summation clustering cost of the optimal clusters in  $H_G$  is large.
Lemma 8 For the optimal clusters in  $H_{G}$ , we have  $\Delta (Z(H_G),C)\geq \frac{1}{100}\Delta (P,C)$ .
For a good single cluster  $P_{h}^{*}$  with the type-1 matched swap pair  $(c_{h}^{*}, c_{j}) \in M_{1}$  where  $c_{h}^{*} \in H_{1}$ , define  $p_{f}(c_{h}^{*}) = 1 - p_{s}(c_{h}^{*})$  as the probability that the first iteration in step 4 of Algorithm 2 fails to sample a data point  $q \in \chi(P_{h}^{*})$ . Then, we have  $p_{f}(c_{h}^{*}) \leq e^{-p_{s}(c_{h}^{*})} \leq e^{-\Delta(P_{h}^{*}, C)/300\Delta(P, C)}$  by Lemma 3. For a set  $Q \in H_{G}^{2}$  of optimal centers, we have that  $p_{f}(Q_{S}^{\prime \prime})$  is the failure probability of not sampling a data point from  $\chi(P_{h}^{*})$  for each  $P_{h}^{*} \in Q_{S}^{\prime \prime}$  in the  $m(P_{h}^{*})$ -th iteration of step 4 in Algorithm 2. Recall that  $p_{s}^{f} = \sum_{c_{h}^{*} \in H_{G}^{1}} p_{s}(c_{h}^{*}) + \sum_{Q \in H_{G}^{2}} p_{s}(Q)$  is the summation of success probability. Then, we have  $p_{s}^{f} \geq \Omega(k^{-t})(\sum_{c_{h}^{*} \in H_{G}^{1}} p_{s}(c_{h}^{*}) + \sum_{Q \in H_{G}^{2}} p_{s}(Q_{S}^{\prime \prime}))$ . Let  $p_{s}^{f'} = \sum_{c_{h}^{*} \in H_{G}^{1}} p_{s}(c_{h}^{*}) + \sum_{Q \in H_{G}^{2}} p_{s}(Q_{S}^{\prime \prime})$ . Observe that  $p_{s}^{f'} \geq 1 - \prod_{c_{h}^{*} \in H_{G}^{1}} (1 - p_{s}(c_{h}^{*})) \prod_{Q \in H_{G}^{2}} (1 - p_{s}(Q_{S}^{\prime \prime}))$ . Since there are at most  $\frac{k}{2}$  good  $t$ -clusters, by Lemma 7, we have  $p_{s}^{f'} \geq 1 - (1 + \frac{1}{30000k})^{\frac{k}{2}} e^{-\frac{\Delta(Z(H_{G}), C)}{300\Delta(P, C)}} \geq 1 - e^{\frac{k}{2}\ln(1 + \frac{1}{30000k}) - \frac{\Delta(Z(H_{G}), C)}{300\Delta(P, C)}} \geq 1 - e^{\frac{1}{60000}} - \frac{1}{30000} \geq 1 - e^{-\frac{1}{60000}} \geq \frac{1}{60001}$ , where the third inequality follows from Lemma 8 and  $\ln(1 + x) \leq x$ . Then, it holds that  $p_{s}^{f} \geq \Omega(k^{-t}) p_{s}^{f'} = \Omega(k^{-t})$ , which indicates that with probability at least  $\Omega(k^{-t})$ , we can sample data points close to a set of good  $t$ -clusters or a good single cluster for swap to make the clustering cost reduced at least by  $(1 - \frac{1}{100k})$  according to Lemma 6. Putting all things together, Theorem 2 can be proved (Detailed proof of Theorem 2 is given in Appendix A).
Running Time Analysis. By Theorem 2, in order to obtain a  $(50(1 + \frac{1}{t}) + \epsilon)$ -approximate solution, the iteration rounds for Algorithm 2 should be  $O(k^{t + 1}\log (\epsilon^{-1}\log k))$ . In each iteration, it takes  $O(ndk)$  time to update the distances between data points to their closest centers. During the sampling process,  $t$  data points are sampled according to the  $D^2$ -Sampling distribution to serve as the candidate set of centers for swapping in, which takes time  $O(nt)$  if the distances from data points to their
centers are already known. It takes  $O(k^t)$  time to enumerate each subset with size at most  $t$  of the set of current centers opened. It takes  $O(ndk^t)$  time to recalculate the clustering cost after each swap if  $t$  nearest centers of each data point are maintained during the whole process. Thus, the total running time of Algorithm 2 is  $O(ndk^{2t + 1}\log (\epsilon^{-1}\log k))$ .
3.2 Accelerating Multi-Swap Local Search for  $k$ -means
In this subsection, we provide a more practical algorithm for the  $k$ -means problem to accelerate the proposed multi-swap local search process. The algorithm is given in Algorithm 3. The main idea behind is to use sampling-based methods to obtain fast clustering cost updating during swaps. In step 7 of Algorithm 3, a small sample set  $S$  of size  $\frac{2k}{\epsilon} \log \frac{k}{\eta}$  is randomly taken from  $P$ . For clustering cost updating, instead of calculating the clustering cost of all the data points in  $P$ , we use the clustering cost of  $S \subseteq P$  as an estimation. This reduces the time for picking the best swap pair during a single local search iteration from  $O(nd)$  to  $O(poly(k)d)$ . Then, in steps 16-18, we design a recombination method to find better initialization which prevents the local search algorithm from falling into a poor local optimum too early. In step 16 of Algorithm 3, we randomly take a set  $D \subseteq P$  of centers with size  $O(k \log k)$ . Let  $C_1 = C \cup D$  be the set of the new candidate centers. For each center  $c_h \in C_1$ , we add a score of  $\Delta(P_h, C) / \Delta(P, C)$  to it. Similarly, for each center  $c_h \in C$ , we also add a score  $\Delta(P_h, C) / \Delta(P, C)$  to it. Then, by giving each center in  $C_1$  and  $C$  a score weight of 0.75 and 0.25, respectively, we pick the top- $k$  data points with the highest scores as a new initialization of clustering centers to find potentially better clustering costs until convergence.
Algorithm 3 MLSP
Input: An instance  $(P,k)$  of the  $k$  -means problem, parameters  $T,t,R^{\prime},\epsilon$  and  $\eta$    
Output: A set  $C\subseteq \mathbb{R}^d$  of centers with size at most  $k$    
1: Initialize  $C = k$  -means++(P,k),  $r = 0$ $C_f = \emptyset$    
2: while  $r < R^{\prime}$  do   
3: for  $i = 1$  to  $T$  do   
4:  $I = \emptyset$    
5: for  $j = 1$  to  $t$  do   
6: Pick a point  $p\in P$  with probability  $\Delta (\{p\} ,C) / \Delta (P,C)$  , and add  $p$  to  $I$    
7: Randomly sample a set  $S$  from  $P$  of size  $\frac{2k}{\epsilon}\log \frac{k}{\eta}$    
8: Let  $(U,V)$  be a swap set such that  $U\subseteq I$ $V\subseteq C$ $|U| = |V|$  and  $\Delta (S,C\backslash V\cup U)$  is minimized.   
9: if  $\Delta (P,C\backslash V\cup U) <   (1 - \frac{1}{100k})\Delta (P,C)$  then   
10:  $C = C\backslash V\cup U$    
11: For each center  $c\in C$  , find the 50-nearest neighbors in  $P$  to  $C$  for improvements on clustering cost by swapping c with one neighbor until convergence.   
12: if  $\Delta (P,C) <   \Delta (P,C_f)$  then   
13:  $C_f = C$    
14: else   
15:  $r = r + 1$  , randomly sample a set  $D$  from  $P$  with size  $\frac{k}{\epsilon}\log \frac{k}{\eta}$  , and set  $C_1 = C\cup D$    
16: For each  $c_{h}\in C$  , calculate  $S^{\prime}(c_h) = \frac{\Delta(P_h,C)}{\Delta(P,C)}$  , and add a score of  $0.25S^{\prime}(c_h)$  to  $c_{h}$    
17: For each  $c_{h}\in C_{1}$  , calculate  $S^{\prime}(c_{h}) = \frac{\Delta(P_{h},C)}{\Delta(P,C)}$  , and add a score of  $0.75S^{\prime}(c_{h})$  to  $c_{h}$    
18: Reset  $C$  as data points in  $C_1$  with top  $k$  scores.   
19: return  $C_f$
In this section, we compare our proposed algorithms with the branch and bound solver and other local search methods. For hardware, all the experiments are conducted on 72 Intel Xeon Gold 6230 CPUs with 500GB memory.
Datasets We evaluate the performance of our algorithms on 8 datasets used in [15] with sizes over 50,000, two datasets SUSY  $(5,000,000 \times 17)$  and HIGGS  $(11,000,000 \times 27)$  from the UCI Machine
Learning Repository<sup>3</sup>, and one dataset SIFT  $(100,000,000 \times 128)$  with size 100,000,000 used in [14]. In Appendix B, we give experiments on small datasets with sizes smaller than 50,000 used in [15].
Experimental Setup In our experiments, we choose centers from the datasets such that the problem can be solved by branch and bound solver (denoted as BB for short), which can serve as references of optimal solutions. We compare our MLSP and MLS algorithms with the BB method and other local search algorithms. Following the settings in [15], the centers obtained by different algorithms are projected to their closest data points in  $P$ , and the number of clusters  $k$  is set to be 3, 5 and 10. Each algorithm is executed for 10 times, and the average results with deviation, the best results and the average running time are given. We test the performance of different choices of parameters in Appendix B. We also conduct the experiments with fixed running time in Appendix B.
Algorithms In our experiments, we consider six algorithms. The first is the BB method in [15], which is the state-of-the-art solver for handling large-scale datasets. For local search algorithms, we compare our MLS and MLSP algorithms with the LS++ algorithm in [11] and FLS algorithm in [9], using the Lloyd's algorithm [12] as a baseline. For MLS algorithm, we use the sampling-based method designed for MLSP to accelerate the swapping process. For MLSP and MLS algorithms, we set the sampling rounds as  $T = 400$  with a swap size  $t = 2$ . For MLSP algorithm, the failure upper bound is set to be  $R' = 5$ . For parameters  $\epsilon$  and  $\eta$ , we fix them as 0.5. For fair comparison, we also set the number of sampling rounds as 400 for LS++. Following the settings in [11], for all local search algorithms, the Lloyd's algorithm [12] is used as the final step to adjust the centers.
Method	Dataset	SampleSize	BB(Cost)	Best Cost	Average Cost	Time(s)	Dataset	SampleSize	BB(Cost)	Best Cost	Average Cost	Time(s)
LS++	132.75	138.66±4.02	6.64	2.5720E+06	2.5801E+06±7.2E+03	55.28
FLS	131.74	136.19±2.78	27.25	2.5687E+06	2.5720E+06±1.8E+03	609.22
Lloyd	132.73	138.01±3.96	0.07	SPNET_3D	434,874*3	OOM	2.5702E+06	2.5816E+06±8.0E+03	0.62
MLSP	131.74	132.03±0.45	58.61	2.5677E+06	2.5688E+06±4.7E+02	561.06
MLS	131.78	136.71±2.76	5.12	2.5696E+06	2.5778E+06±7.3E+03	25.39
LS++	6.1546E+07	6.2916E+07±1.5E+06	4.39	560502.36	561679.14±1177.73	123.86
FLS	6.1534E+07	6.5554E+07±1.1E+06	20.99	562756.29	561856.27±1034.52	1087.1
Lloyd	6.1546E+07	6.3870E+07±2.3E+06	0.21	syn	1,000,000*2	OOM	562761.91	571251.23±5796.86	0.89
MLSP	6.1534E+07	6.1546E+07±3.7E+04	59.71	560502.36	560737.88±706.23	789.83
MLS	6.1546E+07	6.3076E+07±1.9E+06	5.68	560502.36	561444.42±1153.94	60.61
LS++	24787	25209±575	10.39	2.7091E+08	2.7302E+08±2.9E+06	817.52
FLS	24786	24826±328	54.12	2.7082E+08	2.7083E+08±9.4E+03	7148.45
Lloyd	24663	25484±696	0.09	USC_1990	2,458,685*68	OOM	2.7100E+08	2.8497E+08±9.5E+06	40.32
MLSP	24659	24716±58	71.91	2.7073E+08	2.7079E+08±7.8E+03	5687.57
MLS	24659	24889±257	5.96	2.7082E+08	2.7082E+08±2.4E+03	619.16
LS++	1.3738E+14	1.3917E+14±2.2E+12	28.13	3.2738E+07	3.2875E+07±1.1E+05	827.21
FLS	1.3663E+14	1.3745E+14±8.0E+11	206.67	3.1632E+07	3.1672E+07±2.8E+05	9287.26
Lloyd	1.3671E+14	1.3799E+14±2.7E+12	0.47	SUSY	5,000,000*17	OOM	3.1639E+07	3.1668E+07±3.1E+05	31.87
MLSP	1.3663E+14	1.3685E+14±2.0E+11	201.21	3.1575E+07	3.1633E+07±3.8E+04	7462.57
MLS	1.3701E+14	1.3906E+14±1.8E+12	14.24	3.2219E+07	3.2424E+07±1.4E+05	534.11
LS++	88720	89677±1370	30.78	1.8604E+08	1.8834E+08±1.4E+06	2424.97
FLS	88329	89233±890	183.4	1.8938E+08	1.8964E+08±1.5E+05	39826.29
Lloyd	88346	92595±4131	0.41	HIGGS	11,000,000*27	OOM	1.8461E+08	1.8568E+08±1.2E+06	171.06
MLSP	88329	88935±668	175.75	1.8373E+08	1.8410E+08±1.1E+05	21928.97
MLS	88329	89557±1331	13.07	1.8623E+08	1.8686E+08±5.5E+05	2037.68
LS++	1.3994E+13	1.4014E+13±8.2E+10	121260
FLS	1.3905E+13	1.3985E+13±5.6E+10	140560
Lloyd	1.3718E+13	1.3803E+13±9.6E+10	566.99
MLSP	-	-	>48h
MLS	1.3715E+13	1.3883E+13±9.0E+10	15179
Table 2: Comparison results on clustering costs and running time with  $k = 10$  on datasets with sizes larger than 50,000, where OOM is short for out of memory
Results Table 2 shows the results on 11 datasets with sizes over 50,000 using  $k = 10$ . For clustering cost, on each dataset, the best clustering cost returned by our MLSP algorithm is smaller than BB method and other local search methods. For each dataset except for RNG_AGR, the average clustering cost returned by our MLSP algorithm outperforms the result of BB method. It can be seen that, as the sizes of datasets grow, BB method requires larger space complexity. When the size of dataset is over 360,000, it requires a memory of over 500GB, which is not practical for handling large-scale datasets. For LS++ method, it is more difficult to find high-quality solutions as the sizes of datasets grow. As for FLS, although the performance of FLS is better than that of LS++, our MLSP algorithm improves the performance of FLS on clustering cost with smaller deviation than FLS. By calculating the average values over all datasets, for MLSP algorithm, we can get that the clustering cost is reduced by  $1.9\%$ ,  $1.3\%$  and  $2.4\%$  compared with LS++, FLS and Lloyd's algorithm, respectively. For MLS algorithm, on average, the clustering cost is reduced by  $0.6\%$  and  $1.1\%$  compared with LS++ and Lloyd's algorithm, respectively. As for running time, it can be seen that our proposed algorithm scales well as the sizes of datasets grow. By calculating the average values over all datasets, our proposed MLS algorithm is at least 1.79 times faster than LS++ algorithm.
<sup>3</sup>https://archive.ics.uci.edu/ml/index.php
The experimental results on the performances with varying  $T$  and  $R'$  (Appendix B.1) show that larger  $T$  and  $R'$  will not influence the results too much. In general, larger sampling rounds and larger failure upper bound can result in potentially better solutions with higher running time. For parameters  $\epsilon$  and  $\eta$ , the results (Appendix B.1) show that the performances of our proposed algorithms are almost the same for different choices of  $\epsilon$  and  $\eta$ . Tables 3, 4 and 5 show the comparison results of different algorithms with varying iteration rounds on dataset rds, KEGG and Urban_10, respectively. The results show that, our proposed MLSP algorithm always achieves the best clustering cost compared with LS++ and MLS algorithms. Tables 6, 7, and 8 show the results of MLSP algorithm with varying number of failure upper bound  $R'$  for fixed  $\epsilon = 0.5$ ,  $\eta = 0.5$  and  $T = 400$ . It can be seen that a larger failure upper bound will lead to smaller deviation, and the running time becomes higher. Tables 9, 10, and 11 show the results of MLSP algorithm with varying parameters  $\epsilon$  and  $\eta$  for fixed  $T = 400$  and  $R' = 5$  on dataset rds, KEGG, and Urban_10, respectively. It can be seen that smaller values of  $\epsilon$  and  $\eta$  result in better performances on clustering cost with smaller deviation, and the running time becomes higher. The experimental results on small datasets (Appendix B.2) suggest that the proposed MLSP method not only outperforms other algorithms in terms of clustering quality but also runs much faster than the BB solver. The experimental results on the performances with different values of  $k$  (Appendix B.3) show that our proposed MLSP algorithm can still achieve the best clustering quality for smaller values of  $k$ . The experimental results on the performances with fixed time limit (Appendix B.4) show that our proposed MLSP algorithm achieves the best clustering quality within any given time constraints.