SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Theorem 4. (Theorem 1) Let  $A_{f}$  be a  $(\alpha_{1},\delta_{1})$  approximation to  $f$ ,  $\tilde{S}_{f,\beta}$  be a  $(\gamma ,\delta_2)$ -upper approximation to  $S_{f,\beta}^{*}$ , for  $\gamma = \beta = \frac{8\epsilon}{\ln(2 / \delta)}$ ,  $\alpha_{1} = \frac{4\epsilon}{\ln(2 / \delta)}$ . Then,  $A(D) = A_{f}(D) + Lap(\frac{8\alpha_{1}A_{f}(D) + 4\tilde{S}_{f,\beta}(D)}{\epsilon})$  is  $(\epsilon ,\frac{e^{\epsilon / 2} + 1}{2}\delta +2\delta_{1} + 2\delta_{2})$ -differentially private.
Proof. Set  $k = 4$ , using Lemma 11 with  $\alpha = k\epsilon = 4\epsilon$ , and  $\beta' = \beta + \gamma + 4\alpha_{1} = \frac{32\epsilon}{\ln(2 / \delta)} = \frac{2k^2\epsilon}{\ln(2 / \delta)}$ . Then, from Lemma 11, the  $Lap(2k) = Lap(8)$  distribution is  $(\alpha, \beta')$ -admissible. By Lemma 14,  $A(D) = f(D) + \frac{\tilde{S}_{f,\beta}(D)}{\alpha} Z = f(D) + \frac{\tilde{S}_{f,\beta}(D)}{4\epsilon} Lap(8) = f(D) + Lap(\frac{2\tilde{S}_{f,\beta}(D)}{\epsilon})$  is  $(\epsilon, \frac{e^{\epsilon / 2} + 1}{2}\delta + 2\delta_{1} + 2\delta_{2})$ -differentially private and the Theorem follows.
C Missing proofs of Section 4.1
The main target of this section is to calculate an approximation of  $\max a_{ij}^2$ , such that we can apply it to approximate a  $\gamma$ -approximation of  $S_{\Delta, \beta}$  for any  $\gamma$  and  $\beta$ . There are three key components of the analysis:
- Algorithm 4 uses diamond sampling to quickly calculate  $x_{ij}$  that approximates  $a_{ij}^2$  for every  $i, j$ . We use this algorithm as an important sub-routine in Algorithm 1 and 2. Lemma15 shows the utility of the algorithm. We note that due to the Lemma, the quality of each estimation  $x_{ij}$  depends on the true value  $a_{ij}^2$  itself—which is unknown and is the value we are trying to get. Hence, we cannot directly apply Algorithm 4 to get any approximation of  $\max a_{ij}^2$  as we need.
- Algorithm 1 uses multiple rounds of Algorithm 4 with increasing numbers of iterations. The main idea behind this process is that, with a small number of iterations, Algorithm 4 executes very quickly and gives us a rough estimation  $x_{ij}$  of  $a_{ij}^2$  for every  $i,j$ . We then check if the estimation is good enough. We know the estimation is considered good when  $\max_{ij} x_{ij} < \frac{3}{2}\tau_k \times \{\text{some constants}\}$ . Corollary 2, 3 will explain why. Finally, Lemma 18 concludes the utility of the output of the algorithm, such that after the last iteration  $k$ ,  $\tau_k$  is at most 4 times the value of  $\max a_{ij}^2$ .
- Algorithm 2 further improves the output of Algorithm 1. Now we know roughly how large  $\max_{ij}^2$  is, but only within a factor of 4. We will run the final instance of Algorithm 4 with a special constant  $\theta$ , which we use to control the approximation of the final estimation.  $\theta$  is set by  $\gamma$ -the approximation level required for  $\gamma$ -approximation of the smooth sensitivity described by the previous section (which in turn is set by  $(\epsilon, \delta)$ ). Lemma 19 concludes the final utility of our estimation.
We define the norm of matrix  $A$  as follows:  $\| A \| = \| A \|_1 = \sum_{ij} A_{ij}$ ,  $\| A_i \| = \sum_k A_{ik}$ . Note that degree  $d(i) = \| A_i \|$ ,  $\bar{d}(i) = \| 1 - A_i \|$ . The following concentration bound is shown in [2] for the output of Algorithm 4.
Lemma 15. Lemma 3 of [2]. Fix  $\theta >0$  and error probability  $\beta$ . For any  $a_{ij} > 0$ , if the number of samples  $s > 3\| W\| \log (2 / \beta) / (\theta^2 a_{ij}^2)$  then
$$
\Pr \left[ \left| \frac {x _ {i j} \| W \|}{s} - a _ {i j} ^ {2} \right| > \theta a _ {i j} ^ {2} \right] \leq \beta . \tag {5}
$$
The following two lemmas and corollaries relate upper and lower bounds on the random variable  $\max_{ij} x_{ij}$  output by Algorithm 4 to the quantity of interest,  $\max_{ij} a_{ij}^2$ .
Algorithm 4 Fast estimation of  $(a_{ij})^2$   
Input:  $G(V,E)$ , Number of iterations  $s$   
Output:  $x_{ij}$  that approximates  $a_{ij}^2$ , for all  $i,j$
1: Let  $A$  be the adjacency matrix of  $G$
2: for  $(k,i)\in E$  do
3:  $W_{ki} = d(k)d(i)$
4: end for
5:  $x\gets 0$
6: for  $l = 1, \dots, s$  do
7: Sample  $(k,i)$  with probability  $W_{ki} / \| W\| _1$
8: Sample  $j$  from  $\mathcal{N}_k$
9: Sample  $o$  from  $\mathcal{N}_i$
10:  $x_{ij} + = A_{oj}$
11: end for
12: Return  $x$
Lemma 16 states that if we choose a constant  $\tau$  that is close but larger than  $\max a_{ij}^2$ , then after running Algorithm 4 with  $s$  iterations, the maximum of  $x_{ij}$  is not larger than  $\tau \times \{\text{some constants}\}$ . Similarly, Lemma 17 states that if we choose a constant  $\tau$  that is close but smaller than  $\max a_{ij}^2$ , then after running Algorithm 4 with  $s$  iterations, the maximum of  $x_{ij}$  is not smaller than  $\tau \times \{\text{some constants}\}$ .
With appropriate selections of the constants, Corollary 2 and 2 summarize the two lemmas and describe the condition in which we may find a good value for  $\tau$ . They allow us to observe the output of an instance of Algorithm 4 and compare the outcome with a pre-determined value of  $\tau$ . Depending on the sign of the comparison  $\max x_{ij} \frac{\|W\|}{s} \geqslant \tau$ , we can decide that if we are over-estimating  $\tau$  (by Corollary 3) or under-estimating  $\tau$  (by Corollary 2).
The two lemmas and their corollaries below form the basis for Algorithm 1 that finds an appropriate value of  $\tau$  using binary search.
Lemma 16. For any  $\tau$  such that  $\max_{ij}a_{ij}^2 < \lambda \tau$  for some constant  $0 < \lambda$ , there exists a constant  $\lambda' > \lambda$  such that with probability at least  $1 - \frac{1}{poly(n)}$ ,  $\max_{ij}\frac{x_{ij}\|W\|}{s} \leq \lambda'\tau$ .
Proof. Consider any  $i, j$ . By Chernoff's bound,
$$
\Pr \left[ x _ {i j} > \left(1 + \theta^ {\prime}\right) \mathbb {E} \left[ x _ {i j} \right] \right] \leq \exp \left(- \frac {\theta^ {\prime 2} \mathbb {E} \left[ x _ {i j} \right]}{3}\right).
$$
As  $\mathbb{E}[x_{ij}] = \frac{a_{ij}^2s}{\|W\|}$ , we have that
$$
\Pr [ x _ {i j} \frac {\| W \|}{s} > (1 + \theta^ {\prime}) a _ {i j} ^ {2} ] \leq \exp \left(- \frac {\theta^ {\prime 2} s a _ {i j} ^ {2}}{3 \| W \|}\right).
$$
Setting  $\lambda' = \frac{(1 + \theta') a_{ij}^2}{\tau}$ , we have:
$$
1 + \theta^ {\prime} = \frac {\lambda^ {\prime} \tau}{a _ {i j} ^ {2}}.
$$
Therefore, we can lower bound  $\theta^{\prime}$  as follows:
$$
\begin{array}{l} \theta^ {\prime} = \frac {\lambda^ {\prime} \tau}{a _ {i j} ^ {2}} - 1 \\ = \frac {\lambda^ {\prime} \tau - a _ {i j} ^ {2}}{a _ {i j} ^ {2}} \\ \geq \frac {\lambda^ {\prime} \tau - \lambda \tau}{a _ {i j} ^ {2}} \\ = \frac {\tau (\lambda^ {\prime} - \lambda)}{a _ {i j} ^ {2}} \text {s i n c e} a _ {i j} ^ {2} > \lambda \tau . \\ \end{array}
$$
Now, we substitute  $(1 + \theta')a_{ij}^2$  by  $\lambda' \tau$ :
$$
\begin{array}{l} \Pr \left[ x _ {i j} \frac {\| W \|}{s} > \lambda^ {\prime} \tau \right] \leq \exp \left(- \frac {\theta^ {\prime 2} s a _ {i j} ^ {2}}{3 \| W \|}\right) \\ = \exp \left(- \frac {\theta^ {\prime 2} 3 \| W \| c \log n a _ {i j} ^ {2}}{3 \| W \| \theta^ {2} \tau}\right) \\ = \exp \left(- \frac {\theta^ {\prime 2} a _ {i j} ^ {2} c \log n}{\theta^ {2} \tau}\right) \\ \leq \exp \left(- \frac {\tau^ {2} (\lambda^ {\prime} - \lambda) ^ {2} a _ {i j} ^ {2} c \log n}{a _ {i j} ^ {4} \theta^ {2} \tau}\right) \\ = \exp \left(- \frac {\tau (\lambda^ {\prime} - \lambda) ^ {2} c \log n}{a _ {i j} ^ {2} \theta^ {2}}\right) \\ \leq \exp \left(- \frac {\left(\lambda^ {\prime} - \lambda\right)}{\lambda \theta^ {2}} c \log n\right) \\ = n ^ {- c} \frac {(\lambda^ {\prime} - \lambda) ^ {2}}{\lambda \theta^ {2}}. \\ \end{array}
$$
Selecting  $\lambda' > \lambda$  s.t  $c\frac{(\lambda' - \lambda)^2}{\lambda\theta^2} \geq 3$  and taking the union bound on all pairs  $ij$ , the Lemma follows.
Corollary 2. With  $c > 3, \theta = \frac{1}{2}, \lambda = 1, \lambda' = \frac{3}{2}$ , with probability at least  $1 - 1/n^{c-2}$ , if  $\max_{ij} x_{ij} \frac{\|W\|}{s} > \frac{3}{2}\tau$  then  $\max_{ij} a_{ij}^2 > \tau$ .
Lemma 17. For any  $\tau$  such that  $\max_{ij}a_{ij}^2 >\lambda \tau$  for some constant  $0 < \lambda$ , then there exists a constant  $\lambda ''\leq (1 - \theta)\lambda$  such that with probability at least  $1 - \frac{1}{poly(n)}$ ,  $\max_{ij}\frac{x_{ij}\|W\|}{s}\geq \lambda ''\tau$ .
Proof. Since  $\max_{ij} a_{ij}^2 > \lambda \tau$ , there exists pairs of nodes  $i'j'$  such that  $a_{i'j'}^2 > \lambda \tau$ . For such pairs  $i'j'$ , we have:
$$
\begin{array}{l} \Pr \left[ x _ {i ^ {\prime} j ^ {\prime}} ^ {2} \frac {\| W \|}{s} <   (1 - \theta) a _ {i ^ {\prime} j ^ {\prime}} ^ {2} \right] \leq \exp \left(- \frac {\theta^ {2} s a _ {i ^ {\prime} j ^ {\prime}} ^ {2}}{3 \| W \|}\right) \\ = \exp \left(- \frac {3 \theta^ {2} \| W \| a _ {i ^ {\prime} j ^ {\prime}} ^ {2} c \log n}{3 \| W \| \theta^ {2} \tau}\right) \\ = \exp \left(- \frac {a _ {i ^ {\prime} j ^ {\prime}} ^ {2} c \log n}{\tau}\right) \\ \leq \exp (- \lambda c \log n) = n ^ {- c \lambda}. \\ \end{array}
$$
Setting  $\lambda'' \leq (1 - \theta)\lambda$ , we have  $\lambda'' \leq \frac{(1 - \theta)a_{i'j'}^2}{\tau}$ , or  $\lambda''\tau \leq (1 - \theta)a_{i'j'}^2$ . Therefore  $\operatorname*{Pr}\left[x_{i'j'}^2\frac{\|W\|}{s} < \lambda''\tau\right] \leq \operatorname*{Pr}\left[x_{i'j'}^2\frac{\|W\|}{s} < (1 - \theta)a_{i'j'}^2\right] \leq n^{-c\lambda}$ . Choosing  $c$  such that  $c\lambda > 3$  and taking the union bound over all pairs  $i'j'$ , the Lemma follows.
Corollary 3. With  $c > 3, \theta = \frac{1}{2}, \lambda = 3, \lambda'' = \frac{3}{2}$ , with probability at least  $1 - 1/n^{c-2}$ , if  $\max_{ij} x_{ij} \frac{\|W\|}{s} < \frac{3}{2}\tau$  then  $\max_{ij} a_{ij}^2 < 3\tau$ .
Lemma 18. (Lemma 4) Let  $\tau_{k}$  is the output of Algorithm 1, with probability at least  $1 - 1 / n^{c - 3}$ ,  $\tau_{k} < \max_{ij}a_{ij}^{2} < 4\tau_{k}$ .
Proof. Assume the Algorithm 1 stops at step  $k$ . At step  $k - 1$ ,  $\max_{ij} x_{ij} < \frac{3}{2}\tau_{k - 1}$ , then by Corollary 3 we have  $\max_{ij} a_{ij}^2 < 3\tau_{k - 1} = 3\frac{4}{3}\tau_k = 4\tau_k$ . At step  $k$ ,  $\max_{ij} x_{ij} > \frac{3}{2}\tau_k$ , then by
Corollary 2 we have  $\max_{ij}a_{ij}^2 >\tau_k$ . Applying union bound on  $k$  steps, with probability at least  $1 - 1 / n^{c - 3}$  we have  $\tau_{k} < \max_{ij}a_{ij}^{2} < 4\tau_{k}$ , the Lemma follows.
Finally, in Algorithm 2, we postprocess the output of Algorithm 1 to obtain an accurate estimate of  $\max_{ij}a_{ij}^2$  and hence, the smooth sensitivity  $\tilde{S}_{\Delta ,\beta}(G)$ .
Lemma 19. (Lemma 5) With probability at least  $1 - \delta$  in Algorithm 2,  $\max_{ij} x_{ij} \frac{\|W\|}{s} \in (1 - \theta, 1 + \theta) \max_{ij} a_{ij}^2$ .
Proof. We split all pairs  $ij$  into 2 sets  $\{i'j': a_{i'j'}^2 < \tau\}$  and the remaining pairs  $\{\tilde{i}\tilde{j}\}$  that  $a_{\tilde{i}\tilde{j}}^2 > \tau$ . We will prove that the Algorithm will not output  $x_{i'j'}$  for any  $i'j'$ .
For every  $i'j'$  such that  $a_{i'j'}^2 < \tau$ , by Lemma 16, set  $\lambda = 1, \lambda' = \frac{3}{2}$ , since  $c \geq 12\theta^2$  or  $\frac{c(\lambda - \lambda')}{\lambda\theta^2} = \frac{12\theta^21/4}{\theta^2} = 3$ , we have  $\max_{i'j'} x_{i'j'} \frac{\|W\|}{s} < \frac{3}{2}\tau$  with probability at least  $1 - 1/n^{c-2}$ .
Because  $\max_{ij} a_{ij}^2 > \tau_k = 3\tau$ , by Lemma 17, set  $\lambda = 3$ ,  $\lambda' = \frac{3}{2}$ , since  $c \geq 2$  or  $c\lambda > 3$ , we have  $\max_{ij} x_{ij} \frac{\|W\|}{s} > \frac{3}{2}\tau$  with probability at least  $1 - 1/n^{c-2}$ .
Then with probability at least  $1 - 1 / 2n^{c - 2}$ , Algorithm 2 will not output any  $x_{i^{\prime}j^{\prime}}$ .
The remaining sets  $\{\tilde{i}\tilde{j}\}$  that  $a_{\tilde{i}\tilde{j}}^2 >\tau$ . By Lemma 15,  $\forall \tilde{i}\tilde{j}:x_{\tilde{i}\tilde{j}}\frac{\|W\|}{s}\in (1 - \theta ,1 + \theta)a_{\tilde{i}\tilde{j}}^2$ . Applying the union bound on all pair  $\tilde{i}\tilde{j}$  and setting  $c\geq \log_n(1 / (2\delta)) + 2$ , the Lemma follows.
Theorem 5. (Theorem 2)  $\tilde{S}_{\Delta, \beta}(G)$  output by Algorithm 2 is a  $(\gamma, \delta)$ -upper approximation to  $S_{\Delta, \beta}(G)$ .
Proof. From the result of Lemma 19, we have:
$$
(1 - \theta) \max _ {i j} a _ {i j} ^ {2} \leq \max _ {i j} x _ {i j} \frac {\| W \|}{s} \leq (1 + \theta) \max _ {i j} a _ {i j} ^ {2}
$$
Multiplying all terms by  $1 / (1 - \theta)$ , we have:
$$
\max  _ {i j} a _ {i j} ^ {2} \leq \max  _ {i j} x _ {i j} \frac {\| W \|}{s (1 - \theta)} \leq \frac {1 + \theta}{1 - \theta} \max  _ {i j} a _ {i j} ^ {2}
$$
$$
\max  _ {i j} a _ {i j} ^ {2} \leq \hat {a} ^ {2} \leq \frac {1 + \theta}{1 - \theta} \max  _ {i j} a _ {i j} ^ {2}
$$
$$
\max  _ {i j} a _ {i j} \leq \hat {a} \leq \sqrt {\frac {1 + \theta}{1 - \theta}} \max  _ {i j} a _ {i j}
$$
$$
\max _ {i j} a _ {i j} \leq \hat {a} \leq \sqrt {e ^ {2 \gamma}} \max _ {i j} a _ {i j}
$$
$$
\max  _ {i j} a _ {i j} \leq \hat {a} \leq e ^ {\gamma} \max  _ {i j} a _ {i j}.
$$
Therefore with probability at least  $1 - \delta$ , we have  $LS_{\Delta}^{(t)}(G) \leq \widehat{LS}_{\Delta}^{(t)}(G) \leq e^{\gamma} LS_{\Delta}^{(t)}(G)$  and hence:
$$
S _ {\Delta , \beta} (G) \leq \tilde {S} _ {\Delta , \beta} (G) \leq e ^ {\gamma} S _ {\Delta , \beta} (G),
$$
with probability at least  $1 - \delta$ . It follows that  $\tilde{S}_{\Delta, \beta}(G)$  is  $(\gamma, \delta)$ -upper approximation to  $S_{\Delta, \beta}(G)$ .
Theorem 6. (Theorem 2) Suppose  $\max_{ij} a_{ij} > 0$ . Algorithm 2 has a runtime of  $O\left(\frac{\log_n(2\delta)\|W\|_1 \log m \log n}{\left(\frac{e^{2\gamma} - 1}{e^{2\gamma} + 1}\right)^2 \max_{ij} a_{ij}^2} + m + \frac{\log n}{\beta} + n\right)$ .
Proof. Let  $m$  denote the number of edges in  $G$ . Then, computing  $W$  and  $\| W \|$  takes  $O(m)$  time and each sampling step requires  $O(\log m)$  time. However, we can perform the calculation of  $W$  and  $\| W \|$  once and reuse them for all Algorithms (4, 1, and 2). Each sampling step in Algorithm 4 takes  $O(\log m)$  time and there are  $s$  iterations which results in the total cost of  $O(s \log m)$ .
Algorithm 1 has a run-time of  $kO(s'\log m)$  where  $s' = O(\| W\|_1c\log n / (\theta^2\tau))$  as it executes Algorithm 4 with varying  $s = s'$  and  $k$  is the number of search steps. Since at the end of the search  $\tau_k > \max_{ij}a_{ij}^2 / 4$  w.h.p., we know that  $k = O(\log \frac{4n^2}{\max_{ij}a_{ij}^2})$ . In the first step, we start with  $\tau_0 = n^2$  and reduce  $\tau_k$  by a factor of  $3/4$  after each step. The total running time will be  $O(\| W\|_1\log m \times \frac{c\log n}{\theta^2} \times \frac{1}{n^2}(1 + (3/4)^{-1} + \ldots(3/4)^{-k}) = O\left(\frac{\|W\|_1c\log m\log n}{\theta^2\max_{ij}a_{ij}^2}\right)$ .
Finally, Algorithm 2 has a run-time of  $O\left(\frac{\log_n(2\delta)\|W\|\log m\log n}{\left(\frac{e^{2\gamma} - 1}{e^{2\gamma} + 1}\right)^2\max_{ij}a_{ij}^2} + m + \frac{\log n}{\beta} + n\right)$  taking into account the time required to compute  $W(O(m))$  and  $\tilde{S}_{\Delta,\beta}(G)$  ( $O(\log (n) / \beta + n))$ ) and substituting the values of  $c$  and  $\theta$  as described in the Algorithm.
D Details from Section 5
As mentioned earlier, Karwa et al. [23] introduce the notion of local sensitivity of local sensitivity for private counting of k-cliques. In this work, we generalize this notion to multi-level local sensitivity. Recall that  $f(G, S)$  denotes the number of embeddings of a fixed subgraph  $H$  in  $G$  that contains all pairs in  $S$  and  $f^{(k)}(G) = \max_{|S| = k} f(G, S)$ . The following lemma is at the core of our approach as it relates local sensitivity to subgraph counting.
Lemma 20. For all  $k \geq 0$  we have  $LS(f^{(k)}) \leq f^{(k + 1)}(G)$ .
Proof. When  $k = 0$  we have  $LS(f^{(0)}) = LS(f) = \max_{\{i,j\} \in L} |f(G \cup (i,j)) - f(G - (i,j))| = \max_{\{i,j\} \in L} f(G, \{i,j\}) = f^{(1)}(G)$ .
When  $k \geq 1$ , we have  $LS(f^{(k)}) = \max_{\{i,j\}} |f^{(k)}(G \cup (i,j)) - f^{(k)}(G - (i,j))|$ . We argue below that for each  $\{i,j\} \in L$ , we have  $|f^{(k)}(G \cup (i,j)) - f^{(k)}(G - (i,j))| \leq f^{(k+1)}(G)$ , and the statement follows. We have two cases.
Case 1.  $(i,j) \notin G$ : let  $S \subset L$ ,  $|S| = k$  be a subset such that  $f^{(k)}(G \cup (i,j)) = f(G \cup (i,j), S)$ . Let  $T \subset L$ ,  $|T| = k$  be a subset such that  $f^{(k)}(G) = f(G,T)$ . By definition of  $T$ , we have  $f(G,S) \leq f(G,T)$ . We have two sub-cases, depending on whether  $\{i,j\} \notin S$  or  $\{i,j\} \in S$ . First, suppose  $\{i,j\} \notin S$ . This implies  $f(G \cup (i,j), S) = f(G,S) + f(G,S \cup \{i,j\})$ , and
$$
\begin{array}{l} \left| f ^ {(k)} (G \cup (i, j)) - f ^ {(k)} (G) \right| = \left| f (G, S) + f (G, S \cup \{i, j \}) - f (G, T) \right| \\ \leq f (G, S \cup \{i, j \}) \leq f ^ {(k + 1)} (G). \\ \end{array}
$$
Next, suppose  $\{i,j\} \in S$ . Then,  $f(G,S) = f(G\cup (i,j),S)\geq f(G\cup (i,j),T)$ , from the definition of  $S$ . Since  $f(\cdot ,T)$  is monotone with respect to the set of edges in the graph, we have  $f(G\cup (i,j),T)\geq f(G,T)$ , which implies  $f(G,S)\geq f(G,T)$ . Combined with the earlier observation that  $f(G,T)\geq f(G,S)$ , we have  $f(G,T) = f(G,S)$ . This implies
$$
\left| f ^ {(k)} (G \cup (i, j)) - f ^ {(k)} (G) \right| = \left| f (G \cup (i, j), S) - f (G, T) \right| = \left| f (G, S) - f (G, T) \right| = 0 \leq f ^ {(k + 1)} (G)
$$
Thus, when  $(i,j)\notin G$ , in either sub-case, we have  $|f^{(k)}(G\cup (i,j)) - f^{(k)}(G)|\leq f^{(k + 1)}(G)$ .
Case 2.  $(i,j) \in G$ : we have  $|f^{(k)}(G \cup (i,j)) - f^{(k)}(G - (i,j))| = |f^{(k)}(G) - f^{(k)}(G - (i,j))| = |f^{(k)}(G' \cup (i,j)) - f^{(k)}(G')|$ , where  $G' = G - (i,j)$ . Repeating the argument in case 1 for the graph  $G'$ , we have  $|f^{(k)}(G' \cup (i,j)) - f^{(k)}(G')| \leq f^{(k+1)}(G') \leq f^{(k+1)}(G)$ .
Lemma 21. (Lemma 4.4 of [23]) Let  $\mathcal{B}$  be an  $(\epsilon_1, \delta_1)$ -differentially private algorithm such that  $\operatorname*{Pr}[\mathcal{B}(x) \geq LS_f(x)] > 1 - \delta_2$  for all  $x$ . Consider the algorithm  $\mathcal{A}$  that runs  $\mathcal{B}(x)$  to obtain
an estimate  $\widetilde{LS}$  of the local sensitivity and release both  $\widetilde{LS}$  and a noisy estimate  $f\colon \mathcal{A}(x) = (\widetilde{LS}, f(x) + \text{Lap}(\widetilde{LS} / \epsilon_2))$ , where  $\widetilde{LS} = \mathcal{B}(x)$ , and where  $\text{Lap}(\lambda)$  is a Laplace random variable with mean 0 and scale parameter  $\lambda$ . Then  $\mathcal{A}$  is  $(\epsilon_1 + \epsilon_2, \delta_1 + e^{\epsilon_1} \delta_2)$ -DP.
Algorithm 5 Estimating higher-order private local sensitivity.
Input:  $G, \epsilon, \delta$ , subgraph  $H$  with  $\ell$  edges
Output: Private estimate  $g^{(0)}$  for  $f(\hat{G})$
1: Let  $k_{m} = \ell$
2: for  $k = k_{m} - 1$  down to 0 do
3:  $g^{(k)}(G) = f^{(k)}(G) + g^{(k + 1)}(G)\frac{\ln 1 / \delta_2}{\epsilon_2} +Lap(g^{(k + 1)}(G) / \epsilon_2)$
4: end for
5: return  $g^{(0)}(G)$
We now give the proof of correctness for Algorithm 5 using Theorem 3.
Proof of Theorem 3
Proof. We prove by induction on  $k \geq 1$  that  $g^{(k_m - k)}(G)$  computed by Algorithm 5 is a  $((k + 1)\epsilon_2, \delta_2 + (k + 1)e^{\epsilon_2}\delta_2)$ -DP private estimate, and  $\operatorname*{Pr}[g^{(k_m - k)}(G) \geq f^{(k)}(G)] \geq 1 - \delta_2$ .
The base case is  $k = 1$ . Note that for  $k_{m} = \ell$ ,  $f^{(k_{m})} \leq 1$ , since once  $\ell$  edges are fixed, either we get a fixed subgraph, or it doesn't result in an embedding. Since  $LS(f^{(k_{m} - 1)}) \leq f^{(k_{m})}$ , it follows that  $g^{(k_{m} - 1)}$  is an  $(\epsilon_{2},0)$ -DP estimate. Further,  $\operatorname*{Pr}[g^{(k_{m} - 1)} < f^{(k_{m} - 1)}] = \operatorname*{Pr}[Lap(f^{(k_{m})} / \epsilon_{2}] < -f^{(k_{m})}\ln (1 / \delta_{2}) / \epsilon_{2}] < \delta_{2}$ , which proves the base case.
Next, consider  $k > 1$ . From Lemma 20,  $LS(f^{(k_m - k)}) \leq f^{(k_m - k + 1)}$ . Since  $g^{(k_m - k + 1)}$  is an  $(k\epsilon_2,\delta_2 + ke^{\epsilon_2}\delta_2)$ -DP estimate, and  $\operatorname*{Pr}[g^{(k_m - k + 1)} > f^{(k_m - k + 1)}] > 1 - \delta_2$  (by induction), it follows from Lemma 21 that  $g^{(k_m - k)}$  is an  $(k\epsilon_2 + \epsilon_2,\delta_2 + ke^{\epsilon_2}\delta_2 + e^{\epsilon_2}\delta_2)$ -DP estimate. Also,  $\operatorname*{Pr}[g^{(k_m - k)} > f^{(k_m - k)}] = \operatorname*{Pr}[Lap(g^{(k_m - k + 1)} / \epsilon_2) > - g^{(k_m - k + 1)}\ln 1 / \delta_2 / \epsilon_2] > 1 - \delta_2$ , and the inductive step follows.
Finally, we analyze the running time of Algorithm 5 using Lemma 6.
Proof of Lemma 6
Proof. Observe that  $f(G, S)$  can be computed in time  $O(n^{2(\ell - |S|)}$ , so that  $f^{(k)}$  can be estimated in time  $O((n^2)^\ell)$ . Therefore, the total running time for Algorithm 5 is  $O(n^{2\ell})$ .
Improved time for paths of length  $\ell$ . We show that for paths with  $\ell$  edges, the running time can be actually improved from  $O(n^{2\ell})$  to  $O(n^{\ell +1})$ , by keeping track of slightly more complicated information. For a subset  $S\subset L$  of pairs of nodes, let  $h(S)$  denote the set of unique nodes in  $S$ . Let  $\pi$  be a function, such that for each  $u\in h(S)$ ,  $\pi (u)$  specifies the position node  $u$  has in the embedding of the path. Let  $f(G,S,\pi)$  the number of paths containing the edges in  $S$ , but with the additional constraint that the ordering with respect to  $\pi$  be satisfied. Then, we have  $f^{(k)}(G) = \max_{|S| = k,\pi}f(G,S,\pi)$ .
Proof. (Sketch) Observe that  $f(G, S, \pi)$  can be computed in time  $O(n^{\ell + 1 - |h(S)|})$  time, since this involves considering the nodes in the remaining positions of the path, other than those specified by  $\pi$ . Further,  $f^{(k)}(G)$  can be computed in  $O(n^{\ell + 1})$  time, since we can first guess the set  $h(S)$  and the ordering  $\pi$  (instead of directly guessing  $|S|$  pairs of nodes), and then guess the remaining nodes.
Theorem 7. Let  $\mathcal{B}$  be an  $(\epsilon_1, \delta_1)$ -differentially private algorithm such that  $\operatorname*{Pr}[\mathcal{B}(x) \geq LS(f, x)] > 1 - \delta_2$  for all  $x$ . Let  $\hat{f}(x) \in [(1 - \epsilon_3)f(x), (1 + \epsilon_3)f(x)]$  be an approximation to  $f(x)$ , with  $\epsilon_3$  small enough so that  $\epsilon_3 f(x) \leq LS(f, x)$  for all  $x$ . Consider the algorithm  $\mathcal{A}$  that runs  $\mathcal{B}(x)$  releases:  $\mathcal{A}(x) = (\widetilde{LS}, \hat{f}(x) + \mathrm{Lap}(\widetilde{LS} / \epsilon_2))$ , where  $\widetilde{LS} = \mathcal{B}(x)$ , and where  $\mathrm{Lap}(\lambda)$  is a Laplace random variable with mean 0 and scale parameter  $\lambda$ . Then  $\mathcal{A}$  is  $(\epsilon_1 + (3 + \epsilon_3)\epsilon_2, e^{\epsilon_1}(\delta_1 + \delta_2) + \delta_2)$ -DP.
Proof. The proof is a modification of Lemma 4.4 of [23]). Define the following events
$$
\mathcal {A} (x) = \left(\widetilde {L S (f , x)} = \mathcal {B} (x), \hat {f} (x) + L a p \left(\widetilde {L S (f , x)} / \epsilon_ {2}\right)\right)
$$
$$
\mathcal {A} (y) = \left(\widetilde {L S (f , y)} = \mathcal {B} (y), \hat {f} (y) + L a p \left(\widetilde {L S (f , y)} / \epsilon_ {2}\right)\right)
$$
$$
\mathcal {A} _ {m i x} = (\widetilde {L S (f , x)} = \mathcal {B} (x), \hat {f} (y) + L a p (\widetilde {L S (f , x)} / \epsilon_ {2}))
$$
Let  $P_x, P_y$  and  $P_{mix}$  correspond to the distributions of these events.
We first compare  $P_{y}(S)$  and  $P_{mix}(S)$  for any subset  $S$ . Observe that  $\frac{P_{mix}(S)}{P_{y}(S)} = \frac{\operatorname*{Pr}[\mathcal{B}(x)\in S]}{\operatorname*{Pr}[\mathcal{B}(y)\in S]}$ . Since  $\mathcal{B}$  is  $(\epsilon_1,\delta_1)$ -DP, we have  $\operatorname*{Pr}[\mathcal{B}(y)\in S]\leq e^{\epsilon_1}\operatorname*{Pr}[\mathcal{B}(x)\in S] + \delta_1$ , which implies  $P_{y}(S)\leq e^{\epsilon_{1}}P_{mix}(S) + \delta_{1}$ .