SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Algorithm 3: DELETE  $(p)$
1  $r_{\mathrm{max}}\coloneqq 2^{\lceil \log_2\Delta \rceil}$    
2  $S_{\beta},S_{2\beta},S_{4\beta},S_{8\beta},\ldots ,S_{r_{\mathrm{max}}} \leftarrow$  FindNeighbours(p,4)   
3  $T_{\beta},T_{2\beta},T_{4\beta},T_{8\beta},\ldots ,T_{r_{\mathrm{max}}} \leftarrow$  FindNeighbours  $(p,1 + (3 + 8\varepsilon) / \varepsilon)$    
4  $E_{\beta /2}\gets \emptyset ,D_{\beta}\gets \emptyset ,\delta_{\beta}\gets \emptyset$    
5  $r\gets \beta$    
6 while  $r\leq r_{\mathrm{max}}$  do   
7  $E_r\gets \emptyset$    
8  $D_{2r}\gets \emptyset \delta_{2r}\gets \emptyset$    
9 // updating the weights of the points in the level   
10  $w_{r}(\mathrm{rep}_{r}(p))\leftarrow w_{r}(\mathrm{rep}_{r}(p)) - 1$    
11 for all  $q\in D_r$  do   
12  $w_{r}(q)\leftarrow w_{r}(q) + \delta_{r}[q]$    
13  $D_{2r},\delta_{2r}\leftarrow$  UPDATEWEIGHT  $(D_{2r},\delta_{2r},\mathrm{rep}_{2r}(q),\delta_r[q])$    
14 // updating the level   
15 for all  $q\in N_{r / 2}\backslash \{p\}$  that  $rep_{r}(q) = p$  and all  $q\in E_{r / 2}$  do   
16 if  $rep_{r}(q) = p$  then   
17  $\begin{array}{rl} & D_{2r},\delta_{2r}\leftarrow \text{UPDATEWEIGHT} (D_{2r},\delta_{2r},rep_{2r}(p), - w_{r / 2}(q))\\ & w_r(x)\leftarrow w_r(x) + w_{r / 2}(q)\\ & D_{2r},\delta_{2r}\leftarrow \text{UPDATEWEIGHT} (D_{2r},\delta_{2r},rep_{2r}(x),w_{r / 2}(q)) \end{array}$    
17   
18 // finding a new representative in  $N_{r}$  for q   
19 if q has a parent x in  $N_{r}\backslash \{p\}$  then   
20  $\begin{array}{rl} & {\mathrm{rep}_r(q)\leftarrow x}\\ & {w_r(x)\leftarrow w_r(x) + w_{r / 2}(q)}\\ & {D_{2r},\delta_{2r}\leftarrow \mathrm{UpdateWEIGHT} (D_{2r},\delta_{2r},rep_{2r}(x),w_{r / 2}(q))} \end{array}$    
21   
22   
23 else  
24 // adding q to  $N_r$    
25  $N_r\gets N_r\cup \{q\} ,E_r\gets E_r\cup \{q\}$    
26  $\mathrm{rep}_r(q)\gets q,w_r(q)\gets w_{r / 2}(q)$    
27 if  $d(q,p)\leq 4r$  then   
28  $\begin{array}{rl} & S_r\leftarrow S_r\cup \{q\} \\ & if d(q,p)\leq (1 + (3 + 8\varepsilon) / \varepsilon)\cdot rthen\\ & T_r\leftarrow T_r\cup \{q\} \end{array}$    
29   
30   
31 // finding all children of q by exploring  $S_{r / 2}$    
32 for all s e S/2 do.   
33 if d(q,s)le r then. Save q as a parent of s, and s as a child of p   
34   
35 // finding all parents of q in  $N_{2r}$  by exploring  $S_{2r}$    
36 for all s e S/2 do.   
37 if d(q,s)le 2r then Save s as a parent of q, and q as a child of s UpdateNeighbourhoodElevate(q,r,Tt)   
38   
39   
40  $N_r\gets N_r\backslash \{p\}$    
41 r- 2r   
42 UPDATENeIGHBOURHOODREMOVE(p,r)
Further,  $B_{q,r}^{3}$  (and  $B_{q,r}^{1}$ ) contains all points whose neighborhoods need to be updated to include  $q$ . The procedure iterates through all  $q' \in T_{r'}$ , so the running time is  $O(|T_{r'}|) = O(\varepsilon^{-\dim} 2^{O(\dim)})$ .
Procedure UPDATEWEIGHT  $(D,\delta ,q,\omega)$
1 if  $q\notin D$  then
$$
\begin{array}{l} \begin{array}{l} \mathbf {2} \\ \mathbf {3} \end{array} \left[ \begin{array}{c} D \leftarrow D \cup \{q \} \\ \delta [ q ] \leftarrow 0 \end{array} \right. \\ 4 \delta [ q ] \leftarrow \delta [ q ] + \omega \\ 5 \text {r e t u r n} C, \delta \\ \end{array}
$$
Procedure UPDATENEIGHBOURHOODELEVATE  $(q, r', T_{r'})$ : a procedure to update neighbourhoods after adding  $q$  to  $N_{r'}$
$$
1 r := r ^ {\prime} / \varepsilon
$$
$$
\triangleright r ^ {\prime} = \varepsilon r
$$
2 if  $r > \beta \cdot 2^{\lceil \log_2\Delta \rceil}$  then
3 return
4  $B_{q,r}^{3}\gets \emptyset$  ，  $B_{q,r}^{1}\gets \emptyset$
5 for all  $q^{\prime}\in T_{r^{\prime}}$  do
6 if  $d(q,q^{\prime})\leq (3 + 8\varepsilon)r$  then
7  $\begin{array}{rlr}{\big{\downarrow}}&{}&{B_{q,r}^{3}\gets B_{q,r}^{3}\cup\{q\},B_{q^{\prime},r}^{3}\gets B_{q^{\prime},r}^{3}\cup\{p\}}\end{array}$
8 if  $d(q,q^{\prime})\leq (1 + 4\varepsilon)r$  then
9  $\begin{array}{rlr}{\big{\downarrow}} & {B_{q,r}^{1}\gets B_{q,r}^{1}\cup \{q^{\prime}\} ,} & {B_{q^{\prime},r}^{1}\gets B_{q^{\prime},r}^{1}\cup \{q\}} \end{array}$
Procedure UPDATENEIGHBOURHOODREMOVE  $(p, r')$ : a procedure to update neighbourhoods after removing  $p$  from  $N_{r'}$
2 if  $r > \beta \cdot 2^{\lceil \log_2\Delta \rceil}$  or  $p \notin N_{r'}$  then
3 return
4 for all  $q \in B_{p,r}^3$  do
5  $\begin{array}{r}\big{\lfloor}B_{q,r}^{3}\leftarrow \hat{B}_{q,r}^{3}\setminus \{p\} \end{array}$
6 for all  $q \in B_{p,r}^{1}$  do
7  $\left\lfloor B_{q,r}^{1}\right\rfloor \leftarrow \dot{B}_{q,r}^{1}\setminus \{p\}$
8 Delete  $B_{p,r}^{3}$  and  $B_{p,r}^{1}$
To prove the update time of Algorithm 3, we first prove Lemma A.10 and Lemma A.11.
Lemma A.10. Let  $r \in R$ . Then, the set  $E_r$  in Algorithm 3 is of size  $2^{O(\dim)}$ .
Proof. Lemma A.8 states that  $d(p,q) \leq r$  holds for any  $q \in E_r$ . Moreover,  $E_r \subseteq N_r$ , which implies that the distance between any two points in  $E_r$  is more than  $r$  by the definition of  $N_r$ . Therefore, the definition of doubling dimension implies that  $|E_r| \leq 2^{O(\dim)}$ .
Lemma A.11. Let  $r \in R$ . Then the set  $D_r$  in Algorithm 3 is of size  $2^{O(\dim)}$ .
Proof. To prove the lemma, we first claim that for any  $r \in R$ , if  $y \in D_r$ , then  $d(p, y) \leq 2r$ . We prove the claim by induction on  $r$ . For the base case, we consider  $r = \beta$ . Since  $D_{\beta} = \emptyset$ , the claim trivially holds for  $r = \beta$ . Now, we show that if the claim holds for  $r \in R$ , then it also holds for  $2r$ . Let  $v$  be a point in  $D_{2r}$ . Then,  $v$  is added to  $D_{2r}$  in one of the Lines 13, 17, or 22 of Algorithm 3. If it is added in Line 13, it means that there is a point  $q \in D_r$ , such that  $v = \mathrm{rep}_{2r}(q)$ . By the induction hypothesis, we have  $d(p, q) \leq 2r$ . Besides, we know that
$d(q,v) = d(q,\mathrm{rep}_{2r}(q))\leq 2r.$  Hence,  $d(p,v)\leq 4r = 2(2r)$  holds by the triangle inequality. If  $v$  is added to  $D_{2r}$  in Line 17, we have  $v = \mathrm{rep}_{2r}(p)$ , and we know that  $d(p,\mathrm{rep}_{2r}(p))\leq 2r$ . Therefore,  $d(p,v) = d(p,\mathrm{rep}_{2r}(p))\leq 2r\leq 2(2r)$ . Finally, we consider the case that  $v$  is added to  $D_{2r}$  in Line 22. In this case,  $v = \mathrm{rep}_{2r}(x)$  for a point  $x\in N_r$ , and  $x = \mathrm{rep}_r(q)$  for a point  $q\in N_{r / 2}$  such that either  $q$  was a child of  $p$  or  $q\in E_{r / 2}$ . If  $q$  was a child of  $p$ , then  $d(p,q)\leq r$ , and if  $q\in E_{r / 2}$ , then  $d(p,q)\leq r / 2\leq r$  by Lemma A.8. Therefore,  $d(p,q)\leq r$  always holds. Besides,  $d(q,x)\leq r$ , as  $x$  is a parent of  $q$ . Moreover, we have  $d(x,\mathrm{rep}_{2r}(x))\leq 2r$ . Putting everything together we have
$$
d (p, v) = d \left(p, \operatorname {r e p} _ {2 r} (x)\right) \leq d (p, q) + d (q, x) + d \left(x, \operatorname {r e p} _ {2 r} (x)\right) \leq r + r + 2 r = 2 (2 r).
$$
Thus, our claim holds.
In addition,  $D_r \subseteq N_r$ , which means that the distance between any two points in  $D_r$  is more than  $r$ . Adding this to the claim, the definition of doubling dimension implies that  $D_r$  is of size  $2^{O(\dim)}$ .
Now, we can discuss the update time for maintaining our data structure after each deletion.
Lemma A.12. Let  $n$  be the size of the point set  $P_{t}$ . Then after deletion of any point from  $P_{t}$ , we can update our data structure in time  $2^{O(\dim)}\varepsilon^{-2\dim}\log \Delta \log n$ .
Proof. As we discussed in Section A.2, to maintain the heaps, a  $2^{O(\dim)} \varepsilon^{-\dim} \log n$  factor will be multiplied by the running time of Algorithm 3. Hence, it is enough to show that the running time of Algorithm 3 is  $2^{O(\dim)} \varepsilon^{-\dim} \log \Delta$ .
In Algorithm 3, we first call FindNeighbours for  $\gamma = 4$  and  $\gamma = 1 + (3 + 8\varepsilon) / \varepsilon$  to find sets  $S_{r}$  and  $T_{r}$ , which take time  $2^{O(\dim)}\log \Delta$  and  $2^{O(\dim)}\varepsilon^{-\dim}\log \Delta$ , respectively, according to Lemma A.5.
We next iterate over  $O(\log \Delta)$  levels and in each level, we iterate over some children of  $p$  and the elevated points  $E_{r/2}$ , and then we call UpdateNeighbourhoodRemove, which takes  $O(|B_{p,r}^3| + |B_{p,r}^1|) = O(2^{O(\dim)}\varepsilon^{-\dim})$ . The number of  $p$ 's children and the elevated points are  $2^{O(\dim)}$  by Lemma A.2 and Lemma A.10, respectively. Thus, we iterate over  $2^{O(\dim)}$  points in each level, and in each iteration, all the operations other than UpdateNeighbourhoodElevate can be done in time  $2^{O(\dim)}$ . Besides, the running time of UpdateNeighbourhoodElevate is  $O(|T_{r'}|) = O(2^{O(\dim)}\varepsilon^{-\dim})$ . Hence, the total running time of the iteration over the  $O(\log \Delta)$  levels is  $O(2^{O(\dim)}\varepsilon^{-\dim}\log \Delta)$ .
Proof of Lemma 2.3 Now, adding Lemma A.7 and Lemma A.12 together, finishes the proof of Lemma 2.3, which is about the update time of our data structure.
Lemma 2.3. Let  $n$  be the size of point set  $P_t$ . Then after insertion/deletion of any point to  $P_t$ , we can update our data structure in time  $2^{O(\dim)} \varepsilon^{-2\dim} \log \Delta \log n$ .
Lemma 2.1. Let  $p \in P_t$  and  $r \in R$ . Then  $d(p, \text{rep}_r(p)) \leq 2r$ . In particular,  $d(p, \text{rep}_{\varepsilon r}(p)) \leq 2\varepsilon r$ , where  $\varepsilon = 2^{\lfloor \log \varepsilon' \rfloor}$  for the error parameter  $\varepsilon'$ .
Proof. Let  $r' \in R$ . As  $N_{2r'}$  is a  $2r'$ -net of  $N_{r'}$ , we know that  $d(\mathrm{rep}_{r'}(p), \mathrm{rep}_{2r'}(\mathrm{rep}_{r'}(p))) \leq 2r'$ . Further, by definition,  $\mathrm{rep}_{2r'}(p) = \mathrm{rep}_{2r'}(\mathrm{rep}_{r'}(p))$  and hence,  $d(\mathrm{rep}_{r'}(p), \mathrm{rep}_{2r'}(p)) \leq 2r'$ . Thus,
$$
d \left(p, \operatorname {r e p} _ {r} (p)\right) \leq \sum_ {\substack {r ^ {\prime} <   r, \\ r ^ {\prime} \in R}} d \left(\operatorname {r e p} _ {r ^ {\prime}} (p), \operatorname {r e p} _ {2 r ^ {\prime}} (p)\right) \leq 2 \sum_ {\substack {r ^ {\prime} <   r, \\ r ^ {\prime} \in R}} r ^ {\prime} = 2 \beta \sum_ {\ell <   \log \frac {r}{\beta}} 2 ^ {\ell} \leq 2 \beta 2 ^ {\log \frac {r}{\beta}} = 2 r. \tag{1}
$$
For  $r' = \varepsilon r$ , we make a case distinction. If  $\varepsilon r \geq \beta$ , then  $\varepsilon r \in R$  and hence  $d(p, \mathrm{rep}_{\varepsilon r}(p)) \leq 2\varepsilon r$  by Equation (1). If  $\varepsilon r < \beta$ , then  $d(p, \mathrm{rep}_{\varepsilon r}(p)) = 0 \leq 2\varepsilon r$  because  $\mathrm{rep}_{\varepsilon r}(p) = p$  by definition.
Lemma 2.2. Let  $r \in R$  and  $p \in N_{\varepsilon r}$ . The sets  $B_{p,r}^{1}$  and  $B_{p,r}^{3}$  defined above are of size at most  $\frac{2^{O(\dim)}}{\varepsilon^{\dim}}$ . In particular, the size is  $O(\varepsilon^{-\dim})$  for a constant doubling dimension  $\dim$ .
Proof. By recursively applying the definition of doubling dimension  $i$  times, we can cover a ball of radius  $(3 + 8\varepsilon)r$  with at most  $2^{i\dim}$  balls of radius  $\frac{(3 + 8\varepsilon)r}{2^i}$ . For  $i = \lceil \log \frac{3 + 8\varepsilon}{\varepsilon / 2} \rceil$  it follows that  $B_{p,r}^3$  can be covered by  $(2 \cdot \frac{3 + 8\varepsilon}{\varepsilon / 2})^{\dim} \in \frac{2^{O(\dim)}}{\varepsilon^{\dim}}$  balls of radius  $\frac{\varepsilon r}{2}$ . As  $B_{p,r}^3 \subseteq N_{\varepsilon r}$ , the distance between any pair of points in  $B_{p,r}^3$  is at least  $\varepsilon r$ . Therefore, each of the  $\frac{\varepsilon r}{2}$ -balls contains at most one point, which finishes the proof.
Lemma 3.1. Let  $k$  be an integer,  $0 \leq i \leq k$ , and  $r \in R$ . After the  $i$ -th iteration of the loop in Line 3,  $H_{r}[y]$  is the total weight of unmarked points in  $B_{y,r}^{1}$  for each  $y \in N_{\varepsilon r}$ . More formally,  $H_{r}[y] = w_{\varepsilon r}(B_{y,r}^{1} \cap U_{i})$  for any  $y \in N_{\varepsilon r}$  after the  $i$ -th iteration.
Proof. Let  $H_r^i$  denote the state of the heap and  $M^i$  the set Marked at the end of iteration  $i$ , and  $H_r^0$  and  $M^0$  denote the respective sets before entering the for-loop. It can easily be seen that  $M^i = \cup_{j \leq i} B_{c_j, r}^3$  for every  $i \leq k$  by a simple induction. Initially,  $M^0 = \emptyset = \cup_{j \leq 0} B_{c_j, r}^3$ . Now assume  $M^{i-1} = \cup_{j \leq i-1} B_{c_j, r}^3$  for some  $i < k$ . Noting that  $M^{i-1}$  is only updated in line 7 of MAXCOVERAGE( $k, r$ ), Lines 6 and 7 imply that all points from  $B_{c_i, r}^3$  that are not in  $M^{i-1}$  yet are added to  $M^{i-1}$ . Therefore,  $M^i = M^{i-1} \cup B_{c_i, r}^3 = \cup_{j \leq i} B_{c_j, r}^3$ . Recall that  $U_i = N_{\varepsilon r} \setminus \cup_{j \leq i} B_{c_j, r}^3$ . This directly implies that  $U_i$  corresponds to the set of points that are still unmarked at the end of iteration  $i$ , that is  $U_i = N_{\varepsilon r} \setminus M^i$ . From this, it also immediately follows that  $U_i = U_{i-1} \setminus B_{c_i, r}^3$ .
Now we can show  $H_r^i[x] = w_{\varepsilon r}(B_{x,r}^1 \cap U_i)$  for all  $i \leq k$ . For  $i = 0$ , the heap is not modified and no points are covered yet, i.e.  $H_r^0[x] = w_{\varepsilon r}(B_{x,r}^1)$  and  $U_0 = N_{\varepsilon r}$ . Now assume  $H_r^{i-1}[x] = w_{\varepsilon r}(B_{x,r}^1 \cap U_{i-1})$  for some  $i < k$ . Lines 6 to 9 in MAXCOVERAGE( $k, r$ ) are equivalent to
$$
\forall y \in B _ {c _ {i}, r} ^ {3} \backslash M ^ {i - 1} \forall x \in B _ {y, r} ^ {1}: \text {d e c r e a s e} H _ {r} [ x ] \text {b y} w _ {\varepsilon r} (y). \tag {2}
$$
Neighborhood membership is a symmetric relation in the following sense. If  $x \in N_{\varepsilon r}$  is contained within the local neighborhood of  $y \in N_{\varepsilon r}$ , then the converse is also true: For every  $x, y \in N_{\varepsilon r}$  such that  $x \in B_{y,r}$  it also holds  $y \in B_{x,r}$ . Therefore, Equation (2) is equivalent to
$$
\forall x \in N _ {\varepsilon r} \forall y \in B _ {c _ {i}, r} ^ {3} \cap B _ {x, r} ^ {1} \backslash M ^ {i - 1}: \text {d e c r e a s e} H _ {r} [ x ] \text {b y} w _ {\varepsilon r} (y) ,
$$
which means that during iteration  $i$ , the heap value of  $x \in N_{\varepsilon r}$  is reduced by  $w_{\varepsilon r}(B_{c_i,r}^3 \cap B_{x,r}^1 \setminus M^{i-1})$ . Because of the equality  $B_{c_i,r}^3 \cap B_{x,r}^1 \setminus M^{i-1} = B_{c_i,r}^3 \cap B_{x,r}^1 \cap U_{i-1}$ , we can deduce
$$
\begin{array}{l} H _ {r} ^ {i} [ x ] = H _ {r} ^ {i - 1} [ x ] - w _ {\varepsilon r} \big (B _ {c _ {i}, r} ^ {3} \cap B _ {x, r} ^ {1} \cap U _ {i - 1} \big) = w _ {\varepsilon r} \big (B _ {x, r} ^ {1} \cap U _ {i - 1} \big) - w _ {\varepsilon r} \big (B _ {c _ {i}, r} ^ {3} \cap B _ {x, r} ^ {1} \cap U _ {i - 1} \big) \\ \stackrel {(3)} {=} w _ {\varepsilon r} \left(B _ {x, r} ^ {1} \cap U _ {i - 1} \setminus \left(B _ {c _ {i}, r} ^ {3} \cap B _ {x, r} ^ {1} \cap U _ {i - 1}\right)\right) = w _ {\varepsilon r} \left(B _ {x, r} ^ {1} \cap U _ {i - 1} \setminus B _ {c _ {i}, r} ^ {3}\right) \\ = w _ {\varepsilon r} \left(B _ {x, r} ^ {1} \cap U _ {i}\right), \\ \end{array}
$$
where (3) follows from the fact that  $w_{\varepsilon r}(X \setminus Y) = w_{\varepsilon r}(X) - w_{\varepsilon r}(Y)$  for  $Y \subseteq X \subseteq N_{\varepsilon r}$ .
Lemma 3.6. Let  $OPT > 0$  be the optimal radius for the  $k$ -center clustering of  $P_t$  with  $z$  outliers, and let  $r^*$  be the minimum number in  $R$  such that  $r^* \geq OPT$ . Then FINDCENTERS  $(k, z)$  returns a  $(3 + 10\varepsilon)\rho$ -approximate solution for  $k$ -center clustering problem with  $z$  outliers, where  $\rho = \frac{r^*}{OPT}$ .
Proof. We first show that  $\hat{r} \leq r^{*}$ . To do this, we consider two cases:  $\hat{r} > 2$  or  $\hat{r} \leq 2$ . For the first case, it holds that the outliers Weight returned by MAXCOVERAGE  $(k, \hat{r}/2)$  is more than  $z$ , and then we can conduct that  $OPT > \hat{r}/2$ . It is because otherwise, MAXCOVERAGE  $(k, \hat{r}/2)$ . outliers Weight would be less than  $z$  by Lemma 3.5, which is a contradiction. It means that  $r^{*} > \hat{r}/2$ , and then according to the definition of  $R$  and  $r^{*}$  we have  $r^{*} \geq \hat{r}$ . Now we consider the second case that  $\hat{r} \leq 2$ . Since  $OPT > 0$ , we have  $OPT \geq \mathrm{d}_{\min} = 2$ . Adding it to  $OPT \leq r^{*}$ , which is an assumption of this lemma, we have  $\hat{r} \leq 2 \leq OPT \leq r^{*}$ . Thus  $\hat{r} \leq r^{*}$  holds in both cases.
Due to Lemma 3.2 and Lemma 3.5, MAXCOVERAGE  $(k,\hat{r})$  returned by FINDCENTERS  $(k,z)$  is a set of  $k$  centers such that all but at most  $z$  points in  $P_{t}$  are within distance  $(3 + 10\varepsilon)\hat{r}$  of these centers. Hence, FINDCENTERS  $(k,z)$  returns a  $\frac{(3 + 10\varepsilon)\hat{r}}{OPT}$ -approximation solution. We also showed that  $\hat{r} \leq r^{*}$ , therefore, the approximation ratio is at most  $(3 + 10\varepsilon)\rho$ , where  $\rho = \frac{r^{*}}{OPT}$ .
Lemma 3.7. Let  $OPT > 0$ , and let  $\varepsilon > 0$  be fixed. We define  $m := \lceil 1 / \log_2(1 + \varepsilon) \rceil$ . Suppose we have  $m$  parallel instances of our data structure with parameter  $\beta = 2^{i/m-1}$  for the  $i$ -th instance. Then in at least one of the instances, we find a  $(3 + O(\varepsilon))$ -approximation solution for  $k$ -center clustering with  $z$  outliers by calling FINDCENTERS $(k, z)$ .
Proof. Since we assume  $OPT > 0$ , then we have  $OPT \geq \mathrm{d}_{\min} = 2$ . Let  $j^{*} \in [1, [\log \Delta]]$  be such that  $2^{j^{*} - 1} < OPT \leq 2^{j^{*}}$ , and let  $i^{*} \in [1, m]$  be such that  $2^{j^{*} - 1 + (i^{*} - 1) / m} < OPT \leq 2^{j^{*} - 1 + i^{*} / m}$ . For the instance with parameter  $\beta = 2^{i^{*} / m - 1}$ , we have  $\beta \cdot 2^{j^{*}} = 2^{j^{*} - 1 + i^{*} / m} \in R$ . Therefore by Lemma 3.6, FINDCENTERS  $(k, z)$  returns a  $(3 + 10\varepsilon)\rho^{*}$ -approximation solution, where  $\rho^{*} = 2^{j^{*} - 1 + i^{*} / m} / OPT$ . To finish the proof of Lemma, we show that  $\rho^{*} \leq (1 + \varepsilon)$ , which immediately implies a  $(3 + O(\varepsilon))$ -approximation solution. According to the definition of  $i^{*}$  we have  $\rho^{*} = 2^{j^{*} - 1 + i^{*} / m} / OPT \leq 2^{j^{*} - 1 + i^{*} / m} / 2^{j^{*} - 1 + (i^{*} - 1) / m} = 2^{1 / m}$ . Besides,  $m \geq 1 / \log_2(1 + \varepsilon)$  holds by the definition for  $m$ , which means  $1 / m \leq \log_2(1 + \varepsilon)$ . Therefore,  $2^{1 / m} \leq (1 + \varepsilon)$ , and then we have  $\rho^{*} \leq 2^{1 / m} \leq (1 + \varepsilon)$ , which finishes the proof.
Lemma 3.8. Let  $u$  be the number of times that MAXCOVERAGE(k, r) updates heap  $H$ . Then copying heap  $H_r$  in Line 2, as well as all these  $u$  updates, can be handled in total time  $O(u \log n)$ .
Proof. Procedure MAXCOVERAGE  $(k,r)$  sets  $H$  as a copy of  $H_{r}$ , and then it decreases the value of some keys in  $H$  during the algorithm. Note that it never inserts or deletes a new key to  $H$ , and the only possible update is decreasing the value of a key. We claim that it is not necessary to really copy the heap  $H_{r}$ , which takes  $O(|H_r|) = O(n)$  time. Instead, we apply all the updates on  $H_{r}$  and then undo them at the end of MAXCOVERAGE  $(k,r)$ . Although the procedure can change  $H_{r}$  as we defined, we guarantee that  $H_{r}$  is the same at the start and end of the procedure. To do this, we keep a record of all  $u$  updates, and at end of MAXCOVERAGE  $(k,r)$ , we undo all these  $u$  updates, which means increasing the value of each updated key with the decreased value. Since the number of updates is  $u$ , then we can do all the reverse updates in  $O(u\log |H_r|) = O(u\log n)$ .
Lemma 3.9. Let  $k$  and  $z$  be two given parameters. Then FINDCENTERS  $(k, z)$  described in Algorithm 1 has a time complexity of  $2^{O(\dim)} \varepsilon^{-2} \dim k \log n \log \log \Delta$ .
Proof. FINDCENTERS  $(k, z)$  perform a binary-search on  $R$  and in each search, it invokes MAXCOVERAGE two times. Therefore, MAXCOVERAGE is called  $O(\log |R|)$  times in total, which is  $O(\log \log \Delta)$  as  $|R| = O(\log \Delta)$ . Hence, it remains to show that the running time of MAXCOVERAGE  $(k, r)$  is  $2^{O(\dim)}\varepsilon^{-2} \dim k \log n$ .
Now, we discuss the running time of MAXCOVERAGE $(k,r)$ . This procedure consists of  $k$  iterations, in which we iterate on all elements  $y \in B_{c_i,r}^3$ . Recall that Lemma 2.2 states  $B_{c_i,r}^3$  is of size at most  $\frac{2^{O(\dim)}}{\varepsilon^{\dim}}$ . Then for any  $y$ , we iterate on all elements  $x \in B_{y,r}^1$  and update  $H[x]$  in Line 9. Again by Lemma 2.2, the size of  $B_{y,r}^1$  is at most  $\frac{2^{O(\dim)}}{\varepsilon^{\dim}}$ . Therefore, we update heap  $H$  at most  $\left(\frac{2^{O(\dim)}}{\varepsilon^{\dim}}\right)^2 \cdot k$  times. Then by Lemma 3.8, these heap updates and also copying heap  $H_r$  in Line 2 are done in total time of  $2^{O(\dim)} \varepsilon^{-2\dim} k \log n$ .
Proof of Theorem 1.1.
Theorem 1.1. Let  $(M,d)$  be a metric space of bounded doubling dimension dim, and let  $\varepsilon >0$  be an error parameter. There exists a deterministic dynamic algorithm that allows the insertion or deletion of points from  $M$  using worst-case  $\varepsilon^{-O(\dim)}\log n\log \Delta$  update time. Moreover, at any time  $t$ , it can be queried by parameters  $k$  and  $z$  to compute  $a(3 + \varepsilon)$ -approximate solution for the  $k$ -center problem with  $z$  outliers of  $P_{t}$  using worst-case  $\varepsilon^{-O(\dim)}k\log n\log \Delta$  query time, where  $P_{t}$  is the set of points that are inserted but not deleted up to time  $t$ , and  $n$  is the size of  $P_{t}$ .
Proof. We maintain  $m = \lceil 1 / \log_2(1 + \varepsilon) \rceil$  instances of our data structure with parameter  $\beta = 2^{i / m - 1}$  for the  $i$ -th instance. We first discuss the approximation ratio. If  $OPT > 0$ , then we find a  $(3 + O(\varepsilon))$ -approximation solution by Lemma 3.7. Otherwise if  $OPT = 0$ , then by Lemma 3.5, the outliers Weight returned by MAXCOVERAGE $(k, 0)$  is at most  $z$ . In this case, we return a solution with radius 0 in Line 2, which is an exact solution.
Now we discuss the update time. If we maintain  $m = O(1 / \log (1 + \varepsilon))$  instances of our data structure in parallel, it incurs an  $O(1 / \log (1 + \varepsilon)) = O(\varepsilon^{-1})$  factor in the time complexity. In each instance, the update time per insert/delete is  $2^{O(\dim)}\varepsilon^{-2\dim}\log \Delta \log n$  by Lemma 2.3, and the  $k$  centers can be computed in time  $O(2^{O(\dim)}\varepsilon^{-2\dim}k\log n\log \log \Delta)$  by Lemma 3.9. Therefore, we handle each insert/delete in  $2^{O(\dim)}\varepsilon^{-(2\dim +1)}\log \Delta \log n = \varepsilon^{-O(\dim)}\log n\log \Delta$  total time and we can find the centers in  $O(2^{O(\dim)}\varepsilon^{-(2\dim) + 1}k\log n\log \log \Delta) = \varepsilon^{-O(\dim)}k\log n\log \log \Delta$  total time.