SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Lemma 3.2. Let  $(D_{1},\ldots ,D_{t})$  be the clustering output by Algorithm 1. For each  $i\in [t]$ , the diameter of  $D_{i}$  is at most  $14r$ . Further, for  $x\in D_{i}$  and  $j\neq i$ , the average distance from  $x$  to points of  $D_{j}$  is at least  $\frac{r}{4}$ .
Given Lemma 3.2, we can prove the main result.
Proof of Theorem 3.1. We first argue correctness. As each  $c_{i}$  was chosen to maximize the minimal distance to points  $c_{j}$  already in  $S$ , for any  $x \in P$ , it holds that  $\min \{d(x, c_{i}) \mid i \in [k]\} \leq r_{0}$ . By Lemma 3.2, in the clustering  $\mathcal{D}$  output by BALL-CARVING  $(P, r_{0}/15)$  each cluster has diameter at most  $\frac{14}{15} r_{0} < r_{0}$ , and thus, for each  $i \in [k]$ , the cluster  $D \in \mathcal{D}$  which contains  $c_{i}$  will be included in
$C_i$  in the final clustering. Indeed, in line 11 of Algorithm 2,  $d(c_i, D) = 0$  whereas  $d(c_j, D) \geq \frac{1}{15} r_0$  for all  $j \neq i$ . Thus, each cluster in  $(C_1, \ldots, C_k)$  is non-empty. Secondly, the diameter of each cluster is at most  $4r_0$ , namely, for each two points  $x, x' \in C_i$ , they are both within distance  $r_0 + \frac{14}{15} r_0 < 2r_0$  of  $c_i$ . Finally, by Lemma 3.2, for  $x \in D_i$  and  $j \neq i$ , the average distance from  $x$  to points of  $D_j$  is at least  $\frac{r_0}{60}$ . Since,  $\mathcal{C}$  is a coarsening of  $\mathcal{D}$ , i.e., each cluster of  $\mathcal{C}$  is the disjoint union of some of the clusters in  $\mathcal{D}$ , it is straightforward to check that the same property holds for the clustering  $\mathcal{C}$ . Thus  $\mathcal{C}$  is  $O(1)$ -approximate IP stable.
We now analyze the running time. We claim that Algorithm 2 can be implemented to run in  $O(n^{2}T + n^{2}\log n)$  time, where  $T$  is the time to compute the distance between any two points in the metric space. First, we can query all pairs to form the  $n\times n$  distance matrix  $A$ . Then we sort  $A$  along every row to form the matrix  $A'$ . Given  $A$  and  $A'$ , we easily implement our algorithms as follows.
First, we argue about the greedy  $k$ -center steps of Algorithm 2, namely, the for loop on line 4. The most straightforward implementation computes the distance from every point to new chosen centers. At the end, we have computed at most  $nk$  distances from points to centers which can be looked up in  $A$  in time  $O(nk) = O(n^2)$  as  $k \leq n$ . In line 8, we only look at every entry of  $A$  at most once so the total time is also  $O(n^2)$ . The same reasoning also holds for the for loop on line 10. It remains to analyze the runtime.
Given  $r$ , Alg. 1 can be implemented as follows. First, we calculate the size of  $|B(x,r)|$  for every point  $x$  in our dataset. This can easily be done by binary searching on the value of  $r$  along each of the (sorted) rows of  $A'$ , which takes  $O(n\log n)$  time in total. We can similarly calculate the sizes of  $|B(x,2r)|$  and  $|B(x,3r)|$ , and thus the number of points in the annulus  $|B(x,3r)\setminus B(x,2r)|$  in the same time to initialize the clusters  $D_{i}$ . Similar to the  $k$ -center reasoning above, we can also pick the centers in Algorithm 1 which are  $>6r$  apart iteratively by just calculating the distances from points to the chosen centers so far. This costs at most  $O(n^{2})$  time, since there are at most  $n$  centers. After initializing the clusters  $D_{i}$ , we finally need to assign the remaining unassigned points (line 13-16). This can easily be done in time  $O(n)$  per point, namely for each unassigned point  $x$ , we calculate its distance to each  $q_{i}$  assigning it to  $D_{i}$  where  $i$  is minimal such that  $d(x,q_i)\leq 7r$ . The total time for this is then  $O(n^2)$ . The  $k$ -center guarantees follow from our choice of  $r_0$  and Lemma 3.2.
Remark 3.3. We note that the runtime can possibly be improved if we assume special structure about the metric space (e.g., Euclidean metric). See Appendix A for a discussion.
We now prove Lemma 3.2.
Proof of Lemma 3.2. The upper bound on the diameter of each cluster follows from the fact that for any cluster  $D_{i}$  in the final clustering  $\mathcal{D} = \{D_1,\dots ,D_t\}$ , and any  $x\in D_{i}$ , it holds that  $d(x,q_i)\leq 7r$ . The main challenge is to prove the lower bound on the average distance from  $x\in D_{i}$  to  $D_{j}$  where  $j\neq i$ .
Suppose for contradiction that, there exists  $i,j$  with  $i\neq j$  and  $x\in D_{i}$  such that the average distance from  $x$  to  $D_{j}$  is smaller than  $r / 4$ , i.e.,  $\frac{1}{|D_j|}\sum_{y\in D_j}d(x,y) < r / 4$ . Then, it in particular holds that  $|B(x,r / 2)\cap D_j| > |D_j| / 2$ , namely the ball of radius  $r / 2$  centered at  $x$  contains more than half the points of  $D_{j}$ . We split the analysis into two cases corresponding to the if-else statements in line 7-10 of the algorithm.
Case 1:  $|A_{j}| \geq s_{j}$ : In this case, cluster  $D_{j}$  consists of at least  $2s_{j}$  points, namely the  $s_{j}$  points in  $B(q_{j}, r)$  and the set  $S_{j}$  of  $s_{j}$  points in  $A_{j}$  assigned to  $D_{j}$  in line 8-9 of the algorithm. It follows from the preceding paragraph that,  $|B(x, r/2) \cap D_{j}| > s_{j}$ . Now, when  $q_{j}$  was added to  $Q$ , it was chosen as to maximize the number of points in  $B(q_{j}, r)$  under the constraint that  $q_{j}$  had distance greater than  $6r$  to previously chosen points of  $Q$ . Since  $|B(x, r)| > |B(x, r/2)| > |B(q_{j}, r)|$ , at the point where  $q_{j}$  was chosen,  $Q$  already contained some point  $q_{j_0}$  (with  $j_0 < j$ ) of distance at most  $6r$  to  $x$  and thus of distance at most  $7r$  to any point of  $B(x, r/2)$ . It follows that  $B(x, r/2) \cap D_{j}$  contains no point assigned during line 13-16 of the algorithm. Indeed, by the assignment rule, such a point  $y$  would have been assigned to either  $D_{j_0}$  or potentially an even earlier initialized cluster of distance at most  $7r$  to  $y$ . Thus,  $B(x, r/2) \cap D_{j}$  is contained in the set  $B(q_{j}, r) \cup S_{j}$ . However,  $|B(q_{j}, r)| = |S_{j}| = s_{j}$  and moreover, for  $(y_1, y_2) \in B(q_{j}, r) \times S_{j}$ , it holds that  $d(y_1, y_2) > r$ . In particular, no ball of radius  $r/2$  can contain more than  $s_j$  points of  $B(q_{j}, r) \cup S_{j}$ . As  $|B(x, r/2) \cap D_{j}| > s_j$ , this is a contradiction.
Case 2:  $|A_{j}| < s_{j}$ : In this case,  $D_{j}$  includes all points in  $B(q_{j},3r)$ . As  $x \notin D_{j}$ , we must have that  $x \notin B(q_{j},3r)$  and in particular, the ball  $B(x,r / 2)$  does not intersect  $B(q_{j},r)$ . Thus,
$$
\left| D _ {j} \right| \geq \left| B (x, r / 2) \cap D _ {j} \right| + \left| B \left(q _ {j}, r\right) \cap D _ {j} \right| > \left| D _ {j} \right| / 2 + s _ {j},
$$
so  $|D_j| > 2s_j$ , and finally,  $|B(x,r/2) \cap D_j| > |D_j| / 2 > s_j$ . Similarly to case 1,  $B(x,r/2) \cap D_j$  contains no points assigned during line 13-16 of the algorithm. Moreover,  $B(x,r/2) \cap B(q_j,3r) \subseteq A_j$ . In particular,  $B(x,r/2) \cap D_j \subseteq S_j$ , a contradiction as  $|S_j| = s_j$  but  $|B(x,r/2) \cap D_j| > s_j$ .
4 Min and Max-IP Stable Clustering
The Min-IP stable clustering aims to ensure that for any point  $x$ , the minimum distance to a point in the cluster of  $x$  is at most the minimum distance to a point in any other cluster. We show that a Min-IP stable  $k$ -clustering always exists for any value of  $k \in [n]$  and moreover, can be found by a simple algorithm (Algorithm 3).
Algorithm 3 MIN-IP-CLUSTERING
1: Input: Pointset  $P = \{x_{1},\ldots ,x_{n}\}$  from a metric space  $(M,d)$  and integer  $k$  with  $2\leq k\leq n$    
2: Output:  $k$  -clustering  $\mathcal{C} = (C_1,\dots ,C_k)$  of  $P$    
3:  $L\gets \{(x_i,x_j)\}_{1\leq i <   j\leq n}$  sorted according to  $d(x_{i},x_{j})$    
4:  $E\gets \emptyset$    
5: while  $G = (P,E)$  has  $>k$  connected components do   
6:  $e\gets$  an edge  $e = (x,y)$  in  $L$  with  $d(x,y)$  minimal.   
7:  $L\gets L\setminus \{e\}$    
8: if  $e$  connects different connected components of  $G$  then  $E\gets E\cup \{e\}$    
9: end while   
10: return the connected components  $(C_1,\dots ,C_k)$  of  $G$
The algorithm is identical to Kruskal's algorithm for finding a minimum spanning tree except that it stops as soon as it has constructed a forest with  $k$  connected components. First, it initializes a graph  $G = (V, E)$  with  $V = P$  and  $E = \emptyset$ . Next, it computes all distances  $d(x_i, x_j)$  between pairs of points  $(x_i, x_j)$  of  $P$  and sorts the pairs  $(x_i, x_j)$  according to these distances. Finally, it goes through this sorted list adding each edge  $(x_i, x_j)$  to  $E$  if it connects different connected components of  $G$ . After computing the distances, it is well known that this algorithm can be made to run in time  $O(n^2 \log n)$ , so the total running time is  $O(n^2 (T + \log n))$  where  $T$  is the time to compute the distance between a single pair of points.
Theorem 4.1. The  $k$ -clustering output by Algorithm 3 is a Min-IP stable clustering.
Proof. Let  $\mathcal{C}$  be the clustering output by the algorithm. Conditions (1) and (2) in the definition of a min-stable clustering are trivially satisfied. To prove that (3) holds, let  $C \in \mathcal{C}$  with  $|C| \geq 2$  and  $x \in C$ . Let  $y_0 \neq x$  be a point in  $C$  such that  $(x, y_0) \in E$  (such an edge exists because  $C$  is the connected component of  $G$  containing  $x$ ) and let  $y_1$  be the closest point to  $x$  in  $P \setminus C$ . When the algorithm added  $(x, y_0)$  to  $E$ ,  $(x, y_1)$  was also a candidate choice of an edge between connected components of  $G$ . Since the algorithm chose the edge of minimal length with this property,  $d(x, y_0) \leq d(x, y_1)$ . Thus, we get the desired bound:
$$
\min_{y\in C\setminus \{x\}}d(x,y)\leq d(x,y_{0})\leq d(x,y_{1}) = \min_{y\in P\setminus C}d(x,y).
$$
Theorem 4.2. The solution output by the greedy algorithm of  $k$ -center is a 3-approximate Max-IP stable clustering.
Proof. To recall, the greedy algorithm of  $k$ -center (aka Gonzalez algorithm [15]) starts with an arbitrary point as the first center and then goes through  $k - 1$  iterations. In each iteration, it picks a new point as a center which is furthest from all previously picked centers. Let  $c_{1},\dots ,c_{k}$  denote the selected centers and let  $r\coloneqq \max_{v\in P}d(v,\{c_1,\dots ,c_k\})$ . Then, each point is assigned to the cluster of its closest center. We denote the constructed clusters as  $C_1,\dots ,C_k$ . Now, for every  $i\neq j\in [k]$  and each point  $v\in C_i$ , we consider two cases:
$d(v,c_i)\leq r / 2$
$$
\max _ {u _ {i} \in C _ {i}} d (v, u _ {i}) \leq d (v, c _ {i}) + d (u _ {i}, c _ {i}) \leq 3 r / 2,
$$
$$
\max  _ {u _ {j} \in C _ {j}} d (v, u _ {j}) \geq d (v, c _ {j}) \geq d (c _ {i}, c _ {j}) - d (v, c _ {i}). \geq r / 2
$$
$d(v,c_i) > r / 2$
$$
\max  _ {u _ {i} \in C _ {i}} d (v, u _ {i}) \leq d (v, c _ {i}) + d (u _ {i}, c _ {i}) \leq 3 d (v, c _ {i}),
$$
$$
\max  _ {u _ {j} \in C _ {j}} d (v, u _ {j}) \geq d (v, c _ {j}) \geq d (v, c _ {i}).
$$
In both cases,  $\max_{u_i\in C_i}d(v,u_i)\leq 3\max_{u_j\in C_j}d(v,u_j)$
While the goal and the main contributions of our paper are mainly theoretical, we also implement our optimal Min-IP clustering algorithm as well as extend the experimental results for IP stable clustering given in [1]. Our experiments demonstrate that our optimal Min-IP stable clustering algorithm is superior to  $k$ -means++, the strongest baseline in [1], and show that our IP clustering algorithm for average distances is practical on real world datasets and is competitive to  $k$ -means++ (which fails to find good stable clusterings in the worst case [1]). We give our experimental results for Min-IP stability and defer the rest of the empirical evaluations to Section C. All experiments were performed in Python 3. The results shown below are an average of 10 runs for  $k$ -means++.
Metrics We measure the quality of a clustering using the same metrics used in [1] for standardization. Considering the question of  $f$ -IP stability (Definition 1.4), let the violation of a point  $x$  be defined as  $\mathrm{Vi}(x) = \max_{C_i \neq C(x)} \frac{f(x, C(x) \setminus \{x\})}{f(x, C_i)}$ .
For example, setting  $f(x,C) = \sum_{y\in C}d(x,y) / |C|$  corresponds to the standard IP stability objective and  $f(x,C) = \min_{y\in C}d(x,y)$  is the Min-IP formulation. Note point  $x$  is stable iff  $\operatorname{Vi}(x)\leq 1$ .
We measure the extent to which a  $k$ -clustering  $\mathcal{C} = (C_1, \ldots, C_k)$  of  $P$  is (un-)stable by computing  $\mathrm{MaxVi} = \max_{x \in P} \mathrm{Vi}(x)$  (i.e. maximum violation) and  $\mathrm{MeanVi} = \sum_{x \in P} \mathrm{Vi}(x) / |P|$  (mean violation).
Results For Min-IP stability, we have an optimal algorithm; it always returns a stable clustering for all  $k$ . We see in Figures 1 that for the max and mean violation metrics, our algorithm outperforms  $k$ -means++ by up to a factor of  $5\mathbf{x}$ , consistently across various values of  $k$ .  $k$ -means++ can return a much worse clustering under Min-IP stability on real data, motivating the use of our theoretically-optimal algorithm in practice.
Figure 1: Maximum and mean violation for Min-IP stability for the Adult dataset, as used in [1]; lower values are better.
We presented a deterministic polynomial time algorithm which provides an  $O(1)$ -approximate IP stable clustering of  $n$  points in a general metric space, improving on prior works which only guaranteed an  $O(n)$ -approximate IP stable clustering. We also generalized IP stability to  $f$ -stability and provided an algorithm which finds an exact Min-IP stable clustering and a 3-approximation for Max-IP stability, both of which hold for all  $k$  and in general metric spaces.
Anders Aamand is supported by DFF-International Postdoc Grant 0164-00022B from the Independent Research Fund Denmark and a Simons Investigator Award. Justin Chen and Allen Liu are supported in part by an NSF Graduate Research Fellowship under Grant No. 174530. Allen Liu is supported in part by a Hertz Fellowship. Fred Zhang is supported by ONR grant N00014-18-1-2562.
[1] Saba Ahmadi, Pranjal Awasthi, Samir Khuller, Matthaus Kleindessner, Jamie Morgenstern, Pattara Sukprasert, and Ali Vakilian. Individual preference stability for clustering. In International Conference on Machine Learning (ICML), 2022.
[2] Nishesh Anderson, Suman K Bera, Syamantak Das, and Yang Liu. Distributional individual fairness in clustering. arXiv preprint arXiv:2006.12589, 2020.
[3] P. Awasthi and M.-F. Balcan. Center based clustering: A foundational perspective. In Handbook of Cluster Analysis. CRC Press, 2014.
[4] Maria-Florina Balcan, Avrim Blum, and Santosh Vempala. A discriminative framework for clustering via similarity functions. In Symposium on Theory of computing (STOC), pages 671–680, 2008.
[5] Anna Bogomolnaia and Matthew O Jackson. The stability of hedonic coalition structures. Games and Economic Behavior, 38(2):201-230, 2002.
[6] B Brubach, D Chakrabarti, J Dickerson, A Srinivasan, and L Tsepenekas. Fairness, semi-supervised learning, and more: A general framework for clustering with stochastic pairwise constraints. In AAAI Conference on Artificial Intelligence (AAAI), 2021.
[7] Brian Brubach, Darshan Chakrabarti, John Dickerson, Samir Khuller, Aravind Srinivasan, and Leonidas Tsepenekas. A pairwise fair and community-preserving approach to k-center clustering. In International Conference on Machine Learning (ICML), pages 1178-1189, 2020.
[8] Darshan Chakrabarti, John P Dickerson, Seyed A Esmaeili, Aravind Srinivasan, and Leonidas Tsepenekas. A new notion of individually fair clustering:  $\alpha$ -equitable  $k$ -center. In International Conference on Artificial Intelligence and Statistics, pages 6387-6408. PMLR, 2022.
[9] Amit Daniely, Nati Linial, and Michael Saks. Clustering is difficult only when it does not matter. arXiv preprint arXiv:1205.4891, 2012.
[10] Jacques H Dreze and Joseph Greenberg. Hedonic coalitions: Optimality and stability. *Econometrica: Journal of the Econometric Society*, pages 987–1003, 1980.
[11] D. Dua and C. Graff. UCI machine learning repository, 2019. Adult data set available on https://archive.ics.uci.edu/ml/datasets/adult. Breast Cancer Wisconsin data set available on https://archive.ics.uci.edu/ml/datasets/breast+cancer+wisconsin+(diagnostic). Car Evaluation data set available on https://archive.ics.uci.edu/ml/datasets/Car+Evaluation. Drug Consumption data set available on https://archive.ics.uci.edu/ml/datasets/Drug+consumption+(quantified). Indian Liver Patient data set available on https://archive.ics.uci.edu/ml/datasets/ILPD+(Indian+Liver+Patient+Dataset).
[12] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Innovations in Theoretical Computer Science (ITCS), pages 214-226, 2012.
[13] Edith Elkind, Angelo Fanelli, and Michele Flammini. Price of pareto optimality in hedonic games. Artificial Intelligence, 288:103357, 2020.
[14] E. Fehrman, A. K. Muhammad, E. M. Mirkes, V. Egan, and A. N. Gorban. The five factor model of personality and evaluation of drug consumption risk, 2017.
[15] Teofilo F Gonzalez. Clustering to minimize the maximum intercluster distance. Theoretical computer science, 38:293-306, 1985.
[16] Piotr Indyk and Sandeep Silwal. Faster linear algebra for distance matrices. In Neural Information Processing Systems (NeurIPS), 2022.
[17] C. Jung, S. Kannan, and N. Lutz. A center in your neighborhood: Fairness in facility location. In Symposium on Foundations of Responsible Computing (FORC), 2020.
[18] Ron Kohavi et al. Scaling up the accuracy of naive-bayes classifiers: A decision-tree hybrid. In Kdd, volume 96, pages 202-207, 1996.
[19] S. Mahabadi and A. Vakilian. Individual fairness for  $k$ -clustering. In International Conference on Machine Learning (ICML), 2020.
[20] Maryam Negahbani and Deeparnab Chakrabarty. Better algorithms for individually fair  $k$ -clustering. Advances in Neural Information Processing Systems (NeurIPS), 34:13340-13351, 2021.
[21] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
[22] Jack Snoeyink. Point location. In Jacob E. Goodman and Joseph O'Rourke, editors, Handbook of Discrete and Computational Geometry, Second Edition, pages 767-785. Chapman and Hall/CRC, 2004.
[23] Ana-Andreea Stoica and Christos Papadimitriou. Strategic clustering. 2018.
[24] A. Vakilian and M. Yalciner. Improved approximation algorithms for individually fair clustering. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2022.
A Discussion on the Runtime of Algorithm 2
We remark that the runtime of our  $O(1)$ -approximate IP-stable clustering algorithm can potentially be improved if we assume special structure about the metric space, such as a tree or Euclidean metric. In special cases, we can improve the running time by appealing to particular properties of the metric which allow us to either calculate distances or implement our subroutines faster. For example for tree metrics, all distances can be calculated in  $O(n^2)$  time, even though  $T = O(n)$ . Likewise for the Euclidean case, we can utilize specialized algorithms for computing the all pairs distance matrix, which obtain speedups over the naive methods [16], or use geometric point location data structures to quickly compute quantities such as  $|B(x,r)|$  [22]. Our presentation is optimized for simplicity and generality so detailed discussions of specific metric spaces are beyond the scope of the work.
B Random Clustering in Unweighted Graphs
In this appendix, we show that for unweighted, undirected, graphs (where the distance  $d(u,v)$  between two vertices  $u$  and  $v$  is the length of the shortest path between them), randomly  $k$ -coloring the nodes gives an  $O(1)$ -approximate IP-stable clustering whenever  $k = O(n^{1/2} / \log n)$ .
Lemma B.1. Let  $\gamma = O(1)$  be a constant. There exists a constant  $c > 0$  (depending on  $\gamma$ ) such that the following holds: Let  $T = (V, E)$  be an unweighted tree on  $n$  nodes rooted at vertex  $r$ . Suppose that we randomly  $k$ -color the nodes of  $T$ . Let  $V_i \subseteq V$  be the nodes of color  $i$ , let  $X_i = \sum_{v \in V_i} d(r, v)$ , and let  $X = \sum_{v \in V} d(r, v)$ . If  $k \leq c \frac{\sqrt{n}}{\log n}$ , then with probability  $1 - O(n^{-\gamma})$ , it holds that  $X/2 \leq kX_i \leq 2X$  for all  $i \in [k]$ .
Proof. We will fix  $i$ , and prove that the bound  $X / 2 \leq X_i \leq 2X$  holds with probability  $1 - O(n^{-\gamma - 1})$ . Union bounding over all  $i$  then gives the desired result. Let  $\Delta = \max_{v \in V} d(r, v)$  be the maximum distance from the root to any vertex of the tree. We may assume that  $\Delta \geq 5$  as otherwise the result follows directly from a simple Chernoff bound. Since the tree is unweighted and there exists a node  $v$  of distance  $\Delta$  to  $r$ , there must also exist nodes of distances  $1, 2, \ldots, \Delta - 1$  to  $r$ , namely the nodes on the path from  $r$  to  $v$ . For the remaining nodes, we know that the distance is at least 1. Therefore,
$$
\sum_ {v \in V} d (r, v) \geq (n - \Delta - 1) + \sum_ {j = 1} ^ {\Delta} j = n + \left( \begin{array}{c} \Delta \\ 2 \end{array} \right) - 1 \geq n + \frac {\Delta^ {2}}{3},
$$
and so  $\mu_{i} = \mathbb{E}[X_{i}]\geq \frac{n + \Delta^{2} / 3}{k}$ . Since the variables  $(d(r,v)[v\in V])_{v\in V}$  sum to  $X_{i}$  and are independent and bounded by  $\Delta$ , it follows by a Chernoff bound that for any  $0\leq \delta \leq 1$
$$
\operatorname * {P r} [ | X _ {i} - \mu_ {i} | \geq \delta \mu_ {i} ] \leq 2 \exp \left(- \frac {\delta^ {2} \mu_ {i}}{3 \Delta}\right).
$$
By the AM-GM inequality,
$$
\frac {\mu_ {i}}{\Delta} \geq \frac {1}{k} \left(\frac {n}{\Delta} + \frac {\Delta}{3}\right) \geq \frac {2 \sqrt {n}}{\sqrt {3} k}.
$$
Putting  $\delta = 1 / 2$ , the bound above thus becomes
$$
\begin{array}{l} \Pr \left[ \left| X _ {i} - \mu_ {i} \right| \geq \frac {\mu_ {i}}{3} \right] \leq 2 \exp \left(- \frac {\sqrt {n}}{6 \sqrt {3} k}\right) \\ \leq 2 \exp \left(- \frac {\sqrt {n}}{1 1 k}\right) \leq 2 n ^ {- \frac {1}{1 1 c}}, \\ \end{array}
$$
where the last bound uses the assumption on the magnitude of  $k$  in the lemma. Choosing  $c = \frac{1}{11(\gamma + 1)}$ , the desired result follows.
Next, we state our result on the  $O(1)$ -approximate IP-stability for randomly colored graphs.
Theorem B.2. Let  $\gamma = O(1)$  and  $k \leq c \frac{\sqrt{n}}{\log n}$  for a sufficiently small constant  $c$ . Let  $G = (V, E)$  be an unweighted, undirected graph on  $n$  nodes, and suppose that we  $k$ -color the vertices of  $G$  randomly. Let  $V_i$  denote the nodes of color  $i$ . With probability at least  $1 - n^{-\gamma}$ ,  $(V_1, \ldots, V_k)$  forms an  $O(1)$ -approximate IP-clustering.
Proof. Consider a node  $u$  and let  $X_{i} = \sum_{v\in V_{i}\setminus \{u\}}d(u,v)$ . Node that the distances  $d(u,v)$  are exactly the distances in a breath first search tree rooted at  $v$ . Thus, by Lemma B.1, the  $X_{i}$ 's are all within a constant factor of each other with probability  $1 - O(n^{-\gamma -1})$ . Moreover, a simple Chernoff bound shows that with the same high probability,  $|V_{i}| = \frac{n}{k} +O\left(\sqrt{\frac{n\log n}{k}}\right) = \Theta \left(\frac{n}{k}\right)$  for all  $i\in [k]$ . In particular, the values  $Y_{i} = \frac{X_{i}}{|V_{i}\setminus\{u\}|}$  for  $i\in [k]$  also all lie within a constant factor of each other which implies that  $u$  is  $O(1)$ -stable in the clustering  $(V_{1},\ldots ,V_{k})$ . Union bounding over all nodes  $u$ , we find that with probability  $1 - O(n^{-\gamma})$ ,  $(V_{1},\dots,V_{k})$  is an  $O(1)$ -approximate IP-clustering.