SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Proof of Theorem 2. We first show that the degrees of all the vertices in the similarity graph  $\mathsf{K}$  are preserved with high probability in the sparsifier  $\mathsf{G}$ . For any vertex  $v_{i}$ , let  $y_{i,1},\ldots ,y_{i,L}$  be the indices of the neighbours of  $v_{i}$  sampled by Algorithm 2.
For every pair of indices  $i \neq j$ , and for every  $1 \leq l \leq L$ , we define the random variable  $Z_{i,j,l}$  to be the weight of the sampled edge if  $j$  is the neighbour sampled from  $i$  at iteration  $l$ , and 0 otherwise:
$$
Z _ {i, j, l} \triangleq \left\{ \begin{array}{l l} \frac {k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} & \text {i f} y _ {i, l} = j \\ 0 & \text {o t h e r w i s e .} \end{array} \right.
$$
Then, fixing an arbitrary vertex  $x_{i}$ , we can write
$$
\deg_ {\mathbf {G}} (v _ {i}) = \sum_ {l = 1} ^ {L} \sum_ {i \neq j} Z _ {i, j, l} + Z _ {j, i, l}.
$$
$$
\begin{array}{l} \mathbb {E} \left[ \deg_ {\mathbf {G}} (v _ {i}) \right] = \sum_ {l = 1} ^ {L} \sum_ {j \neq i} \mathbb {E} \left[ Z _ {i, j, l} \right] + \mathbb {E} \left[ Z _ {j, i, l} \right] \\ = \sum_ {l = 1} ^ {L} \sum_ {j \neq i} \left[ \mathbb {P} \left[ y _ {i, l} = j \right] \cdot \frac {k \left(x _ {i} , x _ {j}\right)}{\widehat {p} (i , j)} + \mathbb {P} \left[ y _ {j, l} = i \right] \cdot \frac {k \left(x _ {i} , x _ {j}\right)}{\widehat {p} (i , j)} \right]. \\ \end{array}
$$
By Lemmas 1 and 2 and Corollary 1, we have
$$
\begin{array}{l} \mathbb {E} \left[ \deg_ {\mathsf {G}} (v _ {i}) \right] \geq \sum_ {j \neq i} \frac {k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \left(\frac {L \cdot k (x _ {i} , x _ {j})}{2 \deg_ {\mathsf {K}} (v _ {i})} + \frac {L \cdot k (x _ {i} , x _ {j})}{2 \deg_ {\mathsf {K}} (v _ {j})}\right) \\ = \sum_ {i \neq j} \frac {3 k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \left(p _ {i} (j) + p _ {j} (i)\right) \\ \geq \sum_ {i \neq j} \frac {5 k (x _ {i} , x _ {j})}{1 2} = \frac {5 \deg_ {\mathsf {K}} (v _ {i})}{1 2}, \\ \end{array}
$$
where the last inequality follows by the fact that  $\widehat{p}(i,j) \leq (36/5) \cdot p(i,j) \leq (36/5) \cdot (p_i(j) + p_j(i))$ . Similarly, we have
$$
\begin{array}{l} \mathbb {E} \left[ \deg_ {\mathbf {G}} (v _ {i}) \right] \leq \sum_ {j \neq i} \frac {k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \left(\frac {2 \cdot L \cdot k (x _ {i} , x _ {j})}{\deg_ {\mathbf {K}} (v _ {i})} + \frac {2 \cdot L \cdot k (x _ {i} , x _ {j})}{\deg_ {\mathbf {K}} (v _ {j})}\right) \\ = \sum_ {j \neq i} \frac {1 2 \cdot k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \left(p _ {i} (j) + p _ {j} (i)\right) \\ \leq \sum_ {j \neq i} 2 8 \cdot k \left(x _ {i}, x _ {j}\right) = 2 8 \cdot \deg_ {\mathsf {K}} \left(v _ {i}\right), \\ \end{array}
$$
where the inequality follows by the fact that
$$
\widehat {p} (i, j) \geq \frac {6}{7} \cdot p (i, j) = \frac {6}{7} \cdot \left(p _ {i} (j) + p _ {j} (i) - p _ {i} (j) \cdot p _ {j} (i)\right) \geq \frac {3}{7} \cdot \left(p _ {i} (j) + p _ {j} (i)\right).
$$
In order to prove a concentration bound on this degree estimate, we would like to apply the Bernstein inequality for which we need to bound
$$
\begin{array}{l} R = \sum_ {l = 1} ^ {L} \sum_ {j \neq i} \mathbb {E} \left[ Z _ {i, j, l} ^ {2} \right] + \mathbb {E} \left[ Z _ {j, i, l} ^ {2} \right] \\ = \sum_ {l = 1} ^ {L} \sum_ {j \neq i} \mathbb {P} [ y _ {i, l} = j ] \cdot \frac {k (x _ {i} , x _ {j}) ^ {2}}{\widehat {p} (i , j) ^ {2}} + \mathbb {P} [ y _ {j, l} = i ] \cdot \frac {k (x _ {i} , x _ {j}) ^ {2}}{\widehat {p} (i , j) ^ {2}} \\ \leq \sum_ {j \neq i} \frac {1 2 \cdot k (x _ {i} , x _ {j}) ^ {2}}{\widehat {p} (i , j) ^ {2}} \cdot (p _ {i} (j) + p _ {j} (i)) \\ \leq \sum_ {j \neq i} 2 8 \cdot \frac {k (x _ {i} , x _ {j}) ^ {2}}{\widehat {p} (i , j)} \\ \leq \sum_ {j \neq i} \frac {9 8}{3} \cdot \frac {k (x _ {i} , x _ {j}) ^ {2}}{p _ {i} (j)} \\ = \sum_ {j \neq i} \frac {9 8}{3} \cdot \frac {k (x _ {i} , x _ {j}) \cdot \deg_ {\mathsf {K}} (v _ {i}) \cdot \lambda_ {k + 1}}{C \log (n)} \\ = \frac {9 8 \cdot \deg_ {\mathsf {K}} (v _ {i}) ^ {2} \cdot \lambda_ {k + 1}}{3 \cdot C \log (n)}, \\ \end{array}
$$
where the third inequality follows by the fact that
$$
\widehat {p} (i, j) \geq \frac {6}{7} \cdot p (i, j) \geq \frac {6}{7} \cdot p _ {i} (j).
$$
Then, by applying Bernstein's inequality we have for any constant  $C_2$  that
$$
\begin{array}{l} \mathbb {P} \left[ | \deg_ {\mathsf {G}} (v _ {i}) - \mathbb {E} [ \deg_ {\mathsf {G}} (v _ {i}) ] | \geq \frac {1}{C _ {2}} \deg_ {\mathsf {K}} (v _ {i}) \right] \leq 2 \exp \left(- \frac {\deg_ {\mathsf {K}} (v _ {i}) ^ {2} / (2 \cdot C _ {2} ^ {2})}{\frac {9 8 \deg_ {\mathsf {K}} (v _ {i}) ^ {2} \lambda_ {k + 1}}{3 C \log (n)} + \frac {7 \deg_ {\mathsf {K}} (v _ {i}) ^ {2} \lambda_ {k + 1}}{6 C C _ {2} \cdot \log (n)}}\right) \\ \leq 2 \exp \left(- \frac {C \cdot \log (n)}{\left((1 9 6 / 3) \cdot C _ {2} ^ {2} + (7 / 3) \cdot C _ {2}\right) \cdot \lambda_ {k + 1}}\right) \\ = o (1 / n), \\ \end{array}
$$
where we use the fact that
$$
Z _ {i, j, l} \leq \frac {7 k (x _ {i} , x _ {j})}{6 p _ {i} (j)} = \frac {7 \deg_ {\mathsf {K}} (v _ {i}) \cdot \lambda_ {k + 1}}{6 C \cdot \log (n)}.
$$
Therefore, by taking  $C$  to be sufficiently large and by the union bound, it holds with high probability that the degree of all the nodes in  $G$  are preserved up to a constant factor. For the remainder of the
proof, we assume that this is the case. Note in particular that this implies  $\mathrm{vol}_{\mathbb{G}}(S) = \Theta (\mathrm{vol}_{\mathbb{K}}(S))$  for any subset  $S\subseteq V$
Next, we prove it holds for  $\mathsf{G}$  that  $\phi_{\mathsf{G}}(S_i) = O(k \cdot \phi_{\mathsf{K}}(S_i))$  for any  $1 \leq i \leq k$ , where  $S_1, \ldots, S_k$  form an optimal clustering in  $\mathsf{K}$ .
By the definition of  $Z_{i,j,l}$ , it holds for any  $1 \leq i \leq k$  that
$$
\begin{array}{l} \mathbb {E} \left[ \partial_ {\mathbf {G}} \left(S _ {i}\right) \right] = \mathbb {E} \left[ \sum_ {a \in S _ {i}} \sum_ {b \notin S _ {i}} \sum_ {l = 1} ^ {L} Z _ {a, b, l} + Z _ {b, a, l} \right] \\ \leq \sum_ {a \in S _ {i}} \sum_ {b \notin S _ {i}} \frac {1 2 k (x _ {a} , x _ {b})}{\widehat {p} (a , b)} \cdot \left(p _ {a} (b) + p _ {b} (a)\right) \\ = O \left(\partial_ {K} \left(S _ {i}\right)\right) \\ \end{array}
$$
where the last line follows by Corollary 1. By Markov's inequality and the union bound, with constant probability it holds for all  $i = 1,\dots ,k$  that
$$
\partial_ {\mathsf {G}} (S _ {i}) = O (k \cdot \partial_ {\mathsf {K}} (S _ {i})).
$$
Therefore, it holds with constant probability that
$$
\rho_ {\mathsf {G}} (k) \leq \max _ {1 \leq i \leq k} \phi_ {\mathsf {G}} (S _ {i}) = \max _ {1 \leq i \leq k} O (k \cdot \phi_ {\mathsf {K}} (S _ {i})) = O (k \cdot \rho_ {\mathsf {K}} (k)).
$$
Finally, we prove that  $\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}) = \Omega (\lambda_{k + 1}(\mathbf{N}_{\mathsf{K}}))$ . Let  $\overline{\mathbf{N}}_{\mathsf{K}}$  be the projection of  $\mathbf{N}_{\mathsf{K}}$  on its top  $n - k$  eigenspaces, and notice that  $\overline{\mathbf{N}}_{\mathsf{K}}$  can be written
$$
\overline {{\mathbf {N}}} _ {\mathsf {K}} = \sum_ {i = k + 1} ^ {n} \lambda_ {i} (\mathbf {N} _ {\mathsf {K}}) f _ {i} f _ {i} ^ {\mathsf {T}}
$$
where  $f_{1},\ldots ,f_{n}$  are the eigenvectors of  $\mathbf{N}_{\mathsf{K}}$ . Let  $\overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}$  be the square root of the pseudoinverse of  $\overline{\mathbf{N}}_{\mathsf{K}}$ .
We prove that the top  $n - k$  eigenvalues of  $\mathbf{N}_{\mathsf{K}}$  are preserved, which implies that  $\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}) = \Theta (\lambda_{k + 1}(\mathbf{N}_{\mathsf{K}}))$ . To prove this, for each data point  $x_{i}$  and sample  $1\leq l\leq L$ , we define a random matrix  $X_{i,l}\in \mathbb{R}^{n\times n}$  by
$$
X _ {i, l} = w _ {\mathsf {G}} (v _ {i}, v _ {j}) \cdot \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} b _ {e} b _ {e} ^ {\intercal} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2};
$$
where  $j = y_{i,l}$ ,  $b_{e} \triangleq \chi_{v_{i}} - \chi_{v_{j}}$  is the edge indicator vector, and  $x_{v_{i}} \in \mathbb{R}^{n}$  is defined by
$$
\chi_ {v _ {i}} (a) \triangleq \left\{ \begin{array}{l l} \frac {1}{\sqrt {\deg_ {K} (v _ {i})}} & \text {i f} a = i \\ 0 & \text {o t h e r w i s e .} \end{array} \right.
$$
$$
\sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {L} X _ {i, l} = \sum_ {\text {s a m p l e d e d g e s} e = \{v _ {i}, v _ {j} \}} w _ {\mathsf {G}} (v _ {i}, v _ {j}) \cdot \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} b _ {e} b _ {e} ^ {\intercal} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} = \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} \mathbf {N} _ {\mathsf {G}} ^ {\prime} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2}
$$
$$
\mathrm {N} _ {\mathrm {G}} ^ {\prime} = \sum_ {\text {s a m p l e d e d g e s} e = \{v _ {i}, v _ {j} \}} w _ {\mathrm {G}} (v _ {i}, v _ {j}) \cdot b _ {e} b _ {e} ^ {\intercal}
$$
is the Laplacian matrix of  $G$  normalised with respect to the degrees of the nodes in  $K$ . We prove that, with high probability, the top  $n - k$  eigenvectors of  $\mathbf{N}_{\mathsf{G}}^{\prime}$  and  $\mathbf{N}_{\mathsf{K}}$  are approximately the same. Then, we show the same for  $\mathbf{N}_{\mathsf{G}}$  and  $\mathbf{N}_{\mathsf{G}}^{\prime}$  which implies that  $\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}) = \Omega (\lambda_{k + 1}(\mathbf{N}_{\mathsf{K}}))$ .
We begin by looking at the first moment of  $\sum_{i=1}^{n} \sum_{l=1}^{L} X_{i,l}$ , and have that
$$
\begin{array}{l} \lambda_{\min}\left(\mathbb{E}\left[\sum_{i = 1}^{n}\sum_{l = 1}^{L}X_{i,l}\right]\right) = \lambda_{\min}\left(\sum_{i = 1}^{n}\sum_{l = 1}^{L}\sum_{\substack{j\neq i\\ e = \{v_{i},v_{j}\}}}\mathbb{P}\left[y_{i,l} = j\right]\cdot \frac{k(x_{i},x_{j})}{\widehat{p} (i,j)}\cdot \overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}b_{e}b_{e}^{\intercal}\overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}\right) \\ \geq \lambda_{\min}\left(\sum_{i = 1}^{n}\sum_{\substack{j\neq i\\ e = \{v_{i},v_{j}\}}}3p_{i}(j)\cdot \frac{k(x_{i},x_{j})}{\widehat{p} (i,j)}\cdot \overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}b_{e}b_{e}^{\intercal}\overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}\right) \\ \geq \lambda_ {\min } \left(\frac {5}{1 2} \cdot \overline {{\mathbf {N}}} _ {K} ^ {- 1 / 2} \mathbf {N} _ {K} \overline {{\mathbf {N}}} _ {K} ^ {- 1 / 2}\right) = \frac {5}{1 2}, \\ \end{array}
$$
$$
\widehat {p} (i, j) \leq \frac {3 6}{5} \cdot p (i, j) \leq \frac {3 6}{5} \cdot \left(p _ {i} (j) + p _ {j} (i)\right).
$$
$$
\begin{array}{l} \lambda_{\max}\left(\mathbb{E}\left[\sum_{i = 1}^{n}\sum_{l = 1}^{L}X_{i,l}\right]\right) = \lambda_{\max}\left(\sum_{i = 1}^{n}\sum_{l = 1}^{L}\sum_{\substack{j\neq i\\ e = \{v_{i},v_{j}\}}}\mathbb{P}\left[y_{i,l} = j\right]\cdot \frac{k(x_{i},x_{j})}{\widehat{p}(i,j)}\cdot \overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}b_{e}b_{e}^{\intercal}\overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}\right) \\ \leq \lambda_{\max}\left(\sum_{i = 1}^{n}\sum_{\substack{j\neq i\\ e = \{v_{i},v_{j}\}}}12\cdot p_{i}(j)\cdot \frac{k(x_{i},x_{j})}{\widehat{p} (i,j)}\cdot \overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}b_{e}b_{e}^{\intercal}\overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}\right) \\ \leq \lambda_ {\max } \left(2 8 \cdot \overline {{\mathbf {N}}} _ {K} ^ {- 1 / 2} \mathbf {N} _ {K} \overline {{\mathbf {N}}} _ {K} ^ {- 1 / 2}\right) = 2 8, \\ \end{array}
$$
$$
\widehat {p} (i, j) \geq \frac {6}{7} \cdot p (i, j) \geq \frac {3}{7} \cdot \left(p _ {i} (j) + p _ {j} (i)\right).
$$
Additionally, for any  $i$  and  $j = y_{i,l}$  and  $e = \{v_i,v_j\}$ , we have that
$$
\begin{array}{l} \| X _ {i, l} \| \leq w _ {\mathsf {G}} (v _ {i}, v _ {j}) \cdot b _ {e} ^ {\intercal} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} b _ {e} \\ = \frac {k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \cdot b _ {e} ^ {\intercal} \overline {{\mathbf {N}}} _ {K} ^ {- 1} b _ {e} \\ \leq \frac {k (x _ {i} , x _ {j})}{\widehat {p} (i , j)} \cdot \frac {1}{\lambda_ {k + 1}} \| b _ {e} \| ^ {2} \\ \leq \frac {7 \cdot \lambda_ {k + 1}}{3 C \log (n) \left(\frac {1}{\deg_ {\mathsf {K}} (v _ {i})} + \frac {1}{\deg_ {\mathsf {K}} (v _ {j})}\right)} \cdot \frac {1}{\lambda_ {k + 1}} \left(\frac {1}{\deg_ {\mathsf {K}} (v _ {i})} + \frac {1}{\deg_ {\mathsf {K}} (v _ {j})}\right) \\ \leq \frac {7}{3 C \log (n)}. \\ \end{array}
$$
Now, we apply the matrix Chernoff bound and have that
$$
\mathbb {P} \left[ \lambda_ {\max } \left(\sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {L} X _ {i, l}\right) \geq 4 2 \right] \leq n \left(\frac {e ^ {1 / 2}}{(1 + 1 / 2) ^ {3 / 2}}\right) ^ {1 2 C \cdot \log (n)} = O (1 / n ^ {c})
$$
for some constant  $c$ . The other side of the matrix Chernoff bound gives us that
$$
\mathbb {P} \left[ \lambda_ {\min } \left(\sum_ {i = 1} ^ {n} \sum_ {l = 1} ^ {L} X _ {i, l}\right) \leq 5 / 2 4 \right] \leq O (1 / n ^ {c}).
$$
Combining these, with probability  $1 - O(1 / n^{c})$  it holds for any non-zero  $x\in \mathbb{R}^n$  in the space spanned by  $f_{k + 1},\ldots ,f_{n}$  that
$$
\frac {x ^ {\mathsf {T}} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} \mathbf {N} _ {\mathsf {G}} ^ {\prime} \overline {{\mathbf {N}}} _ {\mathsf {K}} ^ {- 1 / 2} x}{x ^ {\mathsf {T}} x} \in (5 / 2 4, 4 2).
$$
By setting  $y = \overline{\mathbf{N}}_{\mathsf{K}}^{-1 / 2}x$ , we can rewrite this as
$$
\frac {y ^ {\intercal} \mathbf {N} _ {G} ^ {\prime} y}{y ^ {\intercal} \overline {{\mathbf {N}}} _ {K} ^ {1 / 2} \overline {{\mathbf {N}}} _ {K} ^ {1 / 2} y} = \frac {y ^ {\intercal} \mathbf {N} _ {G} ^ {\prime} y}{y ^ {\intercal} \overline {{\mathbf {N}}} _ {K} y} = \frac {y ^ {\intercal} \mathbf {N} _ {G} ^ {\prime} y}{y ^ {\intercal} y} \frac {y ^ {\intercal} y}{y ^ {\intercal} \overline {{\mathbf {N}}} _ {K} y} \in (5 / 2 4, 4 2).
$$
Since  $\dim(\operatorname{span}\{f_{k+1}, \ldots, f_n\}) = n - k$ , we have shown that there exist  $n - k$  orthogonal vectors whose Rayleigh quotient with respect to  $\mathbf{N}_{\mathsf{G}}'$  is  $\Omega(\lambda_{k+1}(\mathbf{N}_{\mathsf{K}}))$ . By the Courant-Fischer Theorem, we have  $\lambda_{k+1}(\mathbf{N}_{\mathsf{G}}') = \Omega(\lambda_{k+1}(\mathbf{N}_{\mathsf{K}}))$ .
It only remains to show that  $\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}) = \Omega (\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}^{\prime}))$ , which implies that  $\lambda_{k + 1}(\mathbf{N}_{\mathsf{G}}) = \Omega (\lambda_{k + 1}(\mathbf{N}_{\mathsf{K}}))$ . By the definition of  $\mathbf{N}_{\mathsf{G}}^{\prime}$ , we have that  $\mathbf{N}_{\mathsf{G}} = \mathbf{D}_{\mathsf{G}}^{-1 / 2}\mathbf{D}_{\mathsf{K}}^{1 / 2}\mathbf{N}_{\mathsf{G}}^{\prime}\mathbf{D}_{\mathsf{K}}^{1 / 2}\mathbf{D}_{\mathsf{G}}^{-1 / 2}$ . Therefore, for any  $x\in \mathbb{R}^n$  and  $y = \mathbf{D}_{\mathsf{K}}^{1 / 2}\mathbf{D}_{\mathsf{G}}^{-1 / 2}x$ , it holds that
$$
\frac {x ^ {\intercal} \mathbf {N} _ {\mathsf {G}} x}{x ^ {\intercal} x} = \frac {y ^ {\intercal} \mathbf {N} _ {\mathsf {G}} ^ {'} y}{x ^ {\intercal} x} = \Omega \left(\frac {y ^ {\intercal} \mathbf {N} _ {\mathsf {G}} ^ {'} y}{y ^ {\intercal} y}\right),
$$
where the final guarantee follows from the fact that the degrees in  $G$  are preserved up to a constant factor. The conclusion of the theorem follows by the Courant-Fischer Theorem.
Finally, we bound the running time of Algorithm 2 which is dominated by the recursive calls to Algorithm 1. We note that, although the number of nodes doubles at each level of the recursion tree (visualised in Figure 4), the total number of samples  $S$  and data points  $X$  remain constant for each level of the tree. Then, since the running time of the KDE algorithm is superadditive, the total running time of the KDE algorithms at level  $i$  of the tree is
$$
\begin{array}{l} T _ {i} = \sum_ {j = 1} ^ {2 ^ {i}} T _ {\mathsf {K D E}} (| S _ {i, j} |, | X _ {i, j} |, \epsilon) \\ \leq T _ {\mathrm {K D E}} \left(\sum_ {j = 1} ^ {2 ^ {i}} | S _ {i, j} |, \sum_ {j = 1} ^ {2 ^ {i}} | X _ {i, j} |, \epsilon\right) = T _ {\mathrm {K D E}} (| S |, | X |, \epsilon). \\ \end{array}
$$
Since there are  $O(\log(n))$  levels of the tree, the total running time of Algorithm 1 is  $\widetilde{O}(T_{\mathsf{KDE}}(|S|, |X|, \epsilon))$ . This completes the proof.
In this section, we include in Figures 6 and 7 some additional examples of the performance of the six spectral clustering algorithms on the BSDS image segmentation dataset. Due to its quadratic memory requirement, the SKLEARN GK algorithm cannot be used on the full-resolution image. Therefore, we present its results on each image downsampled to 20,000 pixels. For every other algorithm, we show the results on the full-resolution image. In every case, we find that our algorithm is able to identify more refined detail of the image when compared with the alternative algorithms.
(f) FAISS HNSW
(h) Original Image
(i) SKLEARN GK
(j) OUR ALGORITHM
(k) SKLEARN  $k$ -NN
(1) FAISS EXACT
(m) FAISS HNSW
(n) FAISS IVF
(o) Original Image
(p) SKLEARN GK
(q) OUR ALGORITHM
(r) SKLEARN  $k$ -NN
(s) FAISS EXACT
(t) FAISS HNSW
Figure 6: More examples on the performance of the spectral clustering algorithms for image segmentation.
(u) FAISS IVF
(m) FAISS HNSW
Figure 7: More examples on the performance of the spectral clustering algorithms for image segmentation.