SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Thus, we alternate between computing  $c = c(\pi)$ , meaning  $c$  is computed with the current  $\pi$ , and updating  $\pi$  with the computed  $c$  values, see the lines 5-10 in Algorithm 1. Each step of this iteration is guaranteed to lower the objective function value in (12) until convergence to a fixed point, see Appendix A.3. Modified formulation for a given weight matrix  $A_{ts}$  is discussed in Appendix A.5. Finally, Algorithm 1 summarizes LABOR including the actual sampling (lines 17-19) and computation of the edge weights (lines 20-22) due to the use of importance sampling.
3.3 Choosing how many neighbors to sample
The variance of Poisson Sampling when  $\pi_t = \frac{k}{d_s}$  is  $\frac{1}{k} - \frac{1}{d_s}$ . One might question why we are trying to match the variance of Neighbor Sampling and choose to use a fixed fanout for all the seed vertices. In the uniform probability case, if we have already sampled some set of edges for the vertices in  $S$ , and want to sample one more edge, then we should sample the new edge for the vertex  $s$ , whose variance would decrease the most. If vertex  $s$  currently has  $\tilde{d}_s$  sampled edges, then sampling one more edge for it would improve its variance from  $\frac{1}{\tilde{d}_s} - \frac{1}{d_s}$  to  $\frac{1}{1 + \tilde{d}_s} - \frac{1}{d_s}$ . Since the derivative of the variance with respect to  $\tilde{d}_s$  is monotonic, we can reason about the marginal improvements by comparing their derivatives, which is:
$$
\frac {\partial}{\partial \tilde {d} _ {s}} \left(\frac {1}{\tilde {d} _ {s}} - \frac {1}{d _ {s}}\right) = - \frac {1}{\tilde {d} _ {s} ^ {2}} \tag {19}
$$
Notice that the derivative does not depend on the degree  $d_{s}$  of the vertex  $s$  at all, and the greater the magnitude of the derivative, the more the variance of a vertex improves by sampling one more edge. Thus, choosing any vertex  $s$  with least number of edges sampled would work for us, that is  $s = \arg \min_{s' \in S} \tilde{d}_{s'}$ . In light of this observation, one can see that it is optimal to sample an equal number of edges for each vertex in  $S$ . This is one of the reasons LADIES is not efficient with respect to the number of edges it samples. On graphs with skewed degree distributions, it samples thousands of edges for some seed vertices, which contribute very small amounts to the variance of the estimator since it is already very close to 0.
3.4 Sampling a fixed number of neighbors
To make LABOR-0 even more similar to Neighbor Sampling, one can easily resort to Sequential Poisson Sampling by Ohlsson [1998] if one wants  $\tilde{d}_s = \min (k,d_s)$  instead of  $E[\tilde{d}_s] = \min (k,d_s)$ . Given  $\pi_t$ ,  $c_{s}$  and  $r_t$ , we pick the  $\tilde{d}_s = \min (k,d_s)$  smallest vertices  $t\to s$  with respect to  $\frac{r_t}{c_s\pi_t}$ , which can be computed in expected linear time by using the quickselect algorithm [Hoare, 1961].<sup>4</sup>
Table 1: Properties of the datasets used in experiments: numbers of vertices (  $|V|$ ), edges (  $|E|$ ), avg. degree  $(\frac{|E|}{|V|})$ , number of features, sampling budget used, training, validation and test vertex split.
Dataset	|V|	|E|	|E|/V|	# feats.	|V3| budget	train - val - test (%)
reddit	233K	115M	493.56	602	60k	66 - 10 - 24
products	2.45M	61.9M	25.26	100	400k	8 - 2 - 90
yelp	717K	14.0M	19.52	300	200k	75 - 10 - 15
flickr	89.2K	900K	10.09	500	70k	50 - 25 - 25
In this section, we empirically evaluate the performance of each method in the node-prediction setting on the following datasets: reddit [Hamilton et al., 2017], products [Hu et al., 2020a], yelp, flickr [Zeng et al., 2020]. Details about these datasets are given in Table 1. We compare our proposed LABOR variants LABOR-0, LABOR-1 and LABOR-*, where  $0, 1, *$  stand for the number of fixed point iterations applied to optimize (12), respectively, together with PLADIES (see Section 3.1), against the baseline sampling methods: Neighbor Sampling (NS) and LADIES. We do not include Fast-GCN in our comparisons as it is super-seeded by the LADIES paper. The works of Liu et al. [2020], Zhang et al. [2021], Huang et al. [2018], Cong et al. [2021], Dong et al. [2021] are not included in the comparisons because they either take into account additional information such as historical embeddings or their magnitudes or they have an additional sampling structure such as a vertex cache to sample from. Also the techniques in these papers are mostly orthogonal to the sampling problem and algorithms discussed in this paper, hence our proposed LABOR and PLADIES methods can be used together with them. However, we leave this investigation to future work.
We evaluate all the methods on the GCN model in (2) with 3 layers, with 256 hidden dimension and residual skip connections enabled. We use the Adam optimizer [Kingma and Ba, 2014] with 0.001 learning rate. We implemented LABOR variants and PLADIES in DGL $^5$  [Wang et al., 2019], and carried out our experiments using DGL with the Pytorch backend [Paszke et al., 2019], URLs are provided in Appendix A.8. Experiments were repeated 100 times and averages are presented.
4.1 Baseline Comparison of Vertex/Edge Efficiency
LABOR comparison against NS: In this experiment, we set the batch size to 1,000 and the fanout  $k = 10$  for LABOR and NS methods to see the difference in the sizes of the sampled subgraphs and also how vertex/edge efficient they are. In Figure 1, we can see that LABOR variants outperform NS in both vertex and edge efficiency metrics. Table 2 shows the difference of the sampled subgraph sizes in each layer. One can see that on reddit, LABOR-* samples  $6.9 \times$  fewer vertices in the 3rd layer leading much faster convergence in terms of cumulative number of sampled vertices. On the flickr dataset however, LABOR-* samples only  $1.3 \times$  fewer vertices. The amount of difference depends on two factors. The first is the amount of overlap of neighbors among the vertices in  $S$ . If the neighbors of vertices in  $S$  did not overlap at all, then one obviously can not do better than NS. The second is the average degree of the graph. With a fanout of 10, both NS and LABOR has to copy the whole neighborhood of a vertex  $s$  with degree  $d_s \leq 10$ . Thus for such graphs, it is expected that the difference will be insignificant. The average degree of the flickr is 10.09 (Table 1), and thus there is only a small difference between LABOR and NS.
${}^{4}$  A parallel  $\mathrm{C} +  +$  implementation of this idea can be found in dg1.graphbolt.LayerNeighborSampler.
Our CUDA and C++ implementations are available in DGL starting with version 1.0 as dgl.dataloading.LaborSampler and dgl.sampling.sample_labors.
Figure 1: The validation F1-score and training loss curves on different datasets with same batch size. The x-axis stands for cumulative number of vertices and edges used during training, respectively. The soft edges represent the confidence interval. Number of sampled vertices and edges can be found in Table 2.
As seen in Figure 1 and Table 2, LABOR-0 reduces both the number of vertices and edges sampled. On the other hand, when importance sampling is enabled, the number of vertices sampled goes down while number of edges sampled goes up. This is because when importance sampling is used, inclusion probabilities become nonuniform and it takes more edges per seed vertex to get a good approximation (see Equation (9)). Thus, LABOR-0 leads the pack when it comes to edge efficiency.
Layer sampling algorithm comparison: The hyperparameters of LADIES and PLADIES were picked to match LABOR-* so that all methods have the same vertex sampling budget in each layer (see Table 2). Figure 1 shows that, LADIES and PLADIES perform almost identically in terms of convergence, on all but the flickr dataset where there is a big difference between the two in favor of PLADIES. We also see that LABOR variants outperform LADIES variants on products, yelp, and flickr in terms of vertex efficiency with the exception of reddit, where the best-performing algorithm is PLADIES proposed by us. Regarding edge efficiency, however, we see that LADIES variants are inefficient and all LABOR variants outperform LADIES variants across all the datasets by up to  $13 \times$
Comparing LABOR variants: Looking at Table 2, we can see that LABOR-0 has the best runtime performance across all datasets. This is due to 1) sampling fewer edges, 2) not having the fixed point iteration overhead, compared to the other LABOR variants. By design, all LABOR variants should
Table 2: Average number of vertices and edges sampled in different layers (All the numbers are in thousands, lower is better). Last two columns show iterations (mini-batches) per second (it/s) and test F1-score, for both, higher is better. The hyperparameters of LADIES and PLADIES were picked to roughly match the number of vertices sampled by the LABOR-* to get a fair comparison. The convergence curves can be found in Figure 1. The timing information was measured on an NVIDIA T4 GPU. Green stands for best, red stands for worst results, with a  $5\%$  cutoff.
Dataset	Algo.	|V3|	|E2|	|V2|	|E1|	|V1|	|E0|	|V0|	it/s	test F1-score
reddit	PLADIES	24	2390	14.1	927	6.0	33.2	1	1.7	96.21 ± 0.06
LADIES	25	2270	14.5	852	6.0	32.5	1	1.8	96.20 ± 0.05
LABOR-*	24	1070	13.7	435	6.0	26.9	1	4.1	96.23 ± 0.05
LABOR-1	27	261	14.4	116	6.1	16.7	1	24.8	96.23 ± 0.06
LABOR-0	36	177	17.8	67	6.8	9.6	1	37.6	96.25 ± 0.05
NS	167	682	68.3	100	10.1	9.7	1	14.2	96.24 ± 0.05
products	PLADIES	160	2380	51.2	293	9.7	11.7	1	4.1	78.44 ± 0.24
LADIES	165	2230	51.8	270	9.7	11.5	1	4.2	78.59 ± 0.22
LABOR-*	166	1250	51.8	167	9.8	10.6	1	6.2	78.59 ± 0.34
LABOR-1	178	799	53.4	136	9.8	10.5	1	21.3	78.47 ± 0.26
LABOR-0	237	615	62.4	100	10.1	9.9	1	32.5	78.76 ± 0.26
NS	513	944	95.4	106	10.6	9.9	1	24.6	78.48 ± 0.29
yelp	PLADIES	100	1300	29.5	183	6.2	6.9	1	5.1	61.55 ± 0.87
LADIES	102	1280	29.7	182	6.2	6.9	1	5.3	61.89 ± 0.66
LABOR-*	105	991	30.7	158	6.1	6.8	1	13.3	61.57 ± 0.67
LABOR-1	109	447	31.0	96	6.2	6.8	1	27.3	61.71 ± 0.70
LABOR-0	138	318	35.1	54	6.2	6.3	1	27.2	61.55 ± 0.85
NS	188	392	42.5	55	6.3	6.3	1	23.0	61.50 ± 0.66
flickr	PLADIES	55	309	24.9	85	6.2	6.9	1	10.2	51.52 ± 0.26
LADIES	56	308	25.1	85	6.2	6.9	1	10.5	50.79 ± 0.29
LABOR-*	57	308	25.6	85	6.3	6.9	1	20.3	51.67 ± 0.27
LABOR-1	58	242	25.9	73	6.3	6.9	1	32.7	51.66 ± 0.24
LABOR-0	66	219	29.1	52	6.4	6.7	1	33.3	51.65 ± 0.26
NS	73	244	32.8	52	6.4	6.7	1	31.7	51.70 ± 0.23
have the same convergence curves, as seen in Appendix A.2 in Figure 3. Then, the decision of which variant to use depends on one factor: feature access speed. If vertex features were stored on a slow storage medium (such as, on host memory accessed over PCI-E), then minimizing number of sampled vertices would become the highest priority, in which case, one should pick LABOR-\*. Depending on the relative vertex feature access performance and the performance of the training processor, one can choose to use LABOR- $j$ , the faster feature access, the lower the  $j$ .
4.2 LABOR vs NS under vertex sampling budgets
In this experiment, we set a limit on the number of sampled vertices and modify the batch size to match the given vertex budget. The budgets used were picked around the same magnitude with numbers in the Table 2 in the  $|V_{3}|$  column and can be found in Table 1. Figure 2 displays the result of this experiment. Table 3 shows that the more vertex efficient the sampling method is, the larger batch size it can use during training. Number of sampled vertices is not a function of the batch size for the LADIES algorithm so we do not include it in this comparison. All of the experiments were repeated 100 times and their averages were plotted, that is why our convergence plots are smooth and differences are clear. The most striking result in this experiment is that there can be up to  $112 \times$  difference in batch sizes of LABOR-* and NS algorithms on the reddit dataset, which translates into faster convergence as the training loss and validation F1-score curves in Figure 2 show.
4.3 Importance Sampling, Fixed Point Iterations
In this section, we look at the convergence behavior of the fixed point iterations described in Section 3.2.2. Table 4 shows the number of sampled vertices in the last layer with respect to the number of fixed point iterations applied. In this table, the * stands for applying the fixed point iterations until
Figure 2: Validation F1-score and the training loss curves to evaluate vertex sampling efficiency under the same sampling budget. The x-axis stands for the number of training iterations. The batch size is chosen so that the # sampled vertices matches the vertex budget for each dataset and method and it is given in Table 3.
Table 3: The batch sizes used in Figure 2. These were chosen such that in expectation, each method samples with the same budget given in Table 1. Having a larger batch-size speeds up convergence.
Dataset	LAB-*	LAB-1	LAB-0	NS
reddit	10100	8250	3850	90
products	7750	6000	2750	700
yelp	3700	3300	1950	1120
flickr	3600	3100	1400	800
Table 4: Number of vertices (in thousands) in 3rd layer w.r.t # fixed point iterations (its). * denotes applying the fixed point iterations until convergence, i.e., LABOR-* , 1 its stands for LABOR-1 etc.
Dataset	NS	0	1	2	3	*
reddit	167	36	27	25	25	24
products	513	237	178	170	169	166
yelp	188	138	109	106	105	105
flickr	73	66	58	57	57	56
convergence, and convergence occurs in at most 15 iterations in practice before the relative change in the objective function is less than  $10^{-4}$ . One can see that most of the reduction in the objective function (12) occurs after the first iteration, and the remaining iterations have diminishing returns. Full convergence can save from  $14\% - 33\%$  depending on the dataset. The monotonically decreasing numbers provide empirical evidence for the presented proof in Appendix A.3.
In this paper, we introduced LABOR sampling, a novel way to combine layer and neighbor sampling approaches using a vertex-variance centric framework. We then transform the sampling problem into an optimization problem where the constraint is to match neighbor sampling variance for each vertex while sampling the fewest number of vertices. We show how to minimize this new objective function via fixed-point iterations. On datasets with dense graphs like Reddit, we show that our approach can sample a subgraph with  $7 \times$  fewer vertices without degrading the batch quality. We also show that compared to LADIES, LABOR converges faster with same sampling budget.
We would like to thank Dominique LaSalle and Kaan Sancak for their feedback on the manuscript, and also Murat Güney for their helpful discussions and for enabling the GPU acceleration of this project during the author's time at NVIDIA Corporation. This work was partially supported by the NSF grant CCF-1919021.
Hanqing Zeng, Muhan Zhang, Yinglong Xia, Ajitesh Srivastava, Andrey Malevich, Rajgopal Kannan, Viktor Prasanna, Long Jin, and Ren Chen. Decoupling the depth and scope of graph neural networks. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id= dOMtHWYONZ.
Qingru Zhang, David Wipf, Quan Gan, and Le Song. A Biased Graph Neural Network Sampler with Near-Optimal Regret. (NeurIPS):1-25, 2021. URL http://arxiv.org/abs/2103.01089.
Che Zheng, Hongzhi Chen, Yuxuan Cheng, Zhezheng Song, Yifan Wu, Changji, Li, James Cheng, Han Yang, and Shuai Zhang. Bytegnn: Efficient graph neural network training at large scale. Proc. VLDB Endow., 15:1228-1242, 2022a.
Da Zheng, Xiang Song, Chengru Yang, Dominique LaSalle, and George Karypis. Distributed hybrid cpu andgpu training for graph neural networks on billion-scale heterogeneous graphs. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 4582-4591, 2022b.
Difan Zou, Ziniu Hu, Yewen Wang, Song Jiang, Yizhou Sun, and Quanquan Gu. Layer-dependent importance sampling for training deep and large graph convolutional networks. Advances in Neural Information Processing Systems, 32(NeurIPS), 2019.
A.1 Derivation of Poisson Sampling variance
Following is a derivation of Equation (8) for the Horvitz-Thomson estimator. Note that we assume  $\operatorname{Var}(M_t) = 1, \forall t$ . Also,  $\operatorname{Var}(\mathbb{1}[r_t \leq \pi_t])$  is the variance of the bernoulli trial with probability  $\pi_t$  and is equal to  $\pi_t(1 - \pi_t)$ .
$$
\begin{array}{l} H _ {s} ^ {\prime} = \frac {1}{d _ {s}} \sum_ {t \rightarrow s} \frac {M _ {t}}{\pi_ {t}} \mathbb {1} [ r _ {t} \leq \pi_ {t} ] \\ \operatorname {V a r} \left(H _ {s} ^ {\prime}\right) = \operatorname {V a r} \left(\frac {1}{d _ {s}} \sum_ {t \rightarrow s} \frac {M _ {t}}{\pi_ {t}} \mathbb {1} \left[ r _ {t} \leq \pi_ {t} \right]\right) \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {\operatorname {V a r} \left(M _ {t}\right)}{\pi_ {t} ^ {2}} \operatorname {V a r} \left(\mathbb {1} \left[ r _ {t} \leq \pi_ {t} \right]\right) \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {\operatorname {V a r} \left(M _ {t}\right)}{\pi_ {t} ^ {2}} \pi_ {t} \left(1 - \pi_ {t}\right) \tag {20} \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {\operatorname {V a r} (M _ {t})}{\pi_ {t}} (1 - \pi_ {t}) \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {1}{\pi_ {t}} (1 - \pi_ {t}) \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \left(\frac {1}{\pi_ {t}} - 1\right) \\ = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {1}{\pi_ {t}} - \frac {1}{d _ {s}} \\ \end{array}
$$
A.2 Baseline Comparison of Vertex/Edge Efficiency (cont.)
Figure 3: The validation F1-score and training loss curves on different datasets with same batch size. The soft edges represent the confidence interval. The x-axis stands for the number of training iterations. Number of sampled vertices and edges can be found in Table 2.
Here, we show another version of Figure 1, replacing the x-axis with the number of training iterations, see Figure 3. We would like to point out that despite NS and LABOR variants sampling drastically
Table 5: The runtimes (ms) per iteration for the GATv2 model on NVIDIA A100 80GB corresponding to Table 2. The abbreviation OOM stands for an 'out-of-memory' error, which occurs when an excessive number of edges are sampled.
Dataset	LADIES	PLADIES	LABOR-*	LABOR-1	LABOR-0	NS
reddit	OOM	OOM	266.6	69.8	51.9	155.1
products	OOM	OOM	224.8	154.6	138.7	218.5
yelp	278.0	278.9	169.2	96.6	83.2	99.5
flickr	96.6	100.3	79.8	65.0	61.1	66.2
different number of vertices/edges as shown in Table 2 (up to  $7 \times$  fewer vertices), their convergence behavior is more or less the same, even indistinguishable on Yelp and Flickr.
A.3 Monotonic convergence proof of the fixed point iterations
Given any  $\pi^{(0)} > 0$  and one iteration to get  $\pi^{(1)}$  and one more iteration using  $c(\pi^{(1)})$  to get  $\pi^{(2)}$ , then we have the following observation:
$$
\pi_ {t} ^ {(1)} = \pi_ {t} ^ {(0)} \max  _ {t \rightarrow s} c _ {s} (\pi^ {(0)})
$$
$$
\frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {1}{\min (1 , c _ {s} (\pi^ {(0)}) \pi_ {t} ^ {(0)})} - \frac {1}{d _ {s}} = \frac {1}{k} - \frac {1}{d _ {s}}
$$
$$
\frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {1}{\min (1 , c _ {s} (\pi^ {(1)}) \pi_ {t} ^ {(1)})} = \frac {1}{d _ {s} ^ {2}} \sum_ {t \rightarrow s} \frac {1}{\min (1 , c _ {s} (\pi^ {(1)}) \max _ {t \rightarrow s ^ {\prime}} c _ {s ^ {\prime}} (\pi^ {(0)}) \pi_ {t} ^ {(0)})}
$$
Now, note that for a given  $t \in N(s)$ ,  $\max_{t \to s'} c_{s'}(\pi^{(0)}) \geq c_s(\pi^{(0)})$  since  $s \in \{s' \mid t \to s'\}$ . This implies that  $\max_{t \to s'} c_{s'}(\pi^{(0)}) \pi_t^{(0)} \geq c_s(\pi^{(0)}) \pi_t^{(0)}$ . Note that for  $\pi_t' = c_s(\pi^{(0)}) \pi_t^{(0)}, \forall t \to s$ , we have  $c_s(\pi') = 1$  for any given  $s$ . Since  $\max_{t \to s'} c_{s'}(\pi^{(0)}) \pi_t^{(0)} \geq c_s(\pi^{(0)}) \pi_t^{(0)} = \pi_t'$ ,  $\forall t \to s$ , this let's us conclude that the  $c_s(\pi^{(1)}) \leq 1$ , because the expression is monotonically increasing with respect to any of the  $\pi_t$ . By induction, this means that  $c_s^{(i)} \leq 1, \forall i \geq 1$ . Since  $\pi_t^{(i)} = \pi_t^{(0)} \prod_{j=0}^{i-1} \max_{t \to s'} c_{s'}(\pi^{(i-1)})$ ,  $\pi_t^{(i)}$  is monotonically decreasing. This means that the objective value in (12) is also monotonically decreasing and is clearly bounded from below by 0. Any monotonically decreasing sequence bounded from below has to converge, so our fixed point iteration procedure is convergent as well.
The intuition behind the proof above is that after updating  $\pi$  via (18), the probability of each edge  $t\rightarrow s:\pi_t c_s$  goes up because the update takes the maximum  $c_{s}$  over all possible  $s$ . This means each vertex gets higher quality estimators than the set variance target so we now have room to reduce the number of vertices sampled by choosing the appropriate  $c_{s}\leq 1$ . To summarize,  $\pi$  update step increases the quality of the batch which in turn let's the  $c_{s}$  step to reduce the total number of vertices sampled.
A.4 GATv2 runtime performance
We utilize the GATv2 model Brody et al. [2022] and show the runtime performance of different samplers in Table 5. All the hyperparameters were kept same as Section 4.1 and the number of attention heads was set to 8. The runtimes correlate with the  $|E_3|$  column in Table 2 for the GATv2 model as the computation and memory requirements depend on the number of edges. That is why the LADIES variants went out-of-memory on the reddit and products datasets.
A.5 Extension to the weighted case
If the given adjacency matrix  $A$  has nonuniform weights, then we want the estimate the following:
$$
H _ {s} = \frac {1}{A _ {* s}} \sum_ {t \rightarrow s} A _ {t s} M _ {t} \tag {21}
$$
where  $A_{*s} = \sum_{t\to s}A_{ts}$ . If we have a probability over each edge  $\pi_{ts},\forall (t\to s)\in E$ , then the variance becomes:
$$
\operatorname {V a r} \left(H _ {s} ^ {\prime \prime}\right) \leq \operatorname {V a r} \left(n H _ {s} ^ {\prime}\right) = \frac {1}{\left(A _ {* s}\right) ^ {2}} \left(\sum_ {t \rightarrow s} \frac {A _ {t s} ^ {2}}{\min  \left(1 , c _ {s} \pi_ {t s}\right)} - \sum_ {t \rightarrow s} A _ {t s} ^ {2}\right) \tag {22}
$$
In this case, we can still aim to reach the same variance target  $v_{s} = \frac{1}{k} -\frac{1}{d_{s}}$  or any given custom target  $v_{s}\in \mathbb{R}^{+}$  by finding  $c_{s}$  that satisfies the following equality:
$$
\frac {1}{\left(A _ {* s}\right) ^ {2}} \left(\sum_ {t \rightarrow s} \frac {A _ {t s} ^ {2}}{\min  \left(1 , c _ {s} \pi_ {t s}\right)} - \sum_ {t \rightarrow s} A _ {t s} ^ {2}\right) = v _ {s} \tag {23}
$$
In this case, the objective function becomes:
$$
\pi^ {*} = \underset {\pi \geq 0} {\arg \min } \sum_ {t \in N (S)} \min  \left(1, \max  _ {t \rightarrow s} c _ {s} \pi_ {t s}\right) \tag {24}
$$
Optimizing the objective function above will result in minimizing the number of vertices sampled. Given any  $\pi_{ts} > 0, \forall (t \to s)$ , then the fixed point iterations proposed for the non-weighted case in (18) can be modified as follows:
$$
\pi^ {(0)} = A, \forall (t \rightarrow s): \pi_ {t s} ^ {(i + 1)} = \max  _ {t \rightarrow s ^ {\prime}} c _ {s ^ {\prime}} (\pi^ {(i)}) \pi_ {t s ^ {\prime}} ^ {(i)} \tag {25}
$$
A more principled way to choose  $v_{s}$  in the weighted case is by following the argument presented in Section 3.3. There, the discussion revolves around the derivative of the variance with respect to the expected number of vertices sampled for a given seed vertex  $s$ . If we apply the same argument, then we get:
$$
v _ {s} (c _ {s}) = \frac {1}{(A _ {* s}) ^ {2}} \Big (\sum_ {t \to s} \frac {A _ {t s} ^ {2}}{\min (1 , c _ {s} \pi_ {t s})} - \sum_ {t \to s} A _ {t s} ^ {2} \Big)
$$
$$
\frac {\partial v _ {s}}{\partial c _ {s}} = \frac {- 1}{(A _ {* s}) ^ {2}} \sum_ {t \rightarrow s} \frac {\mathbb {1} [ c _ {s} \pi_ {t s} <   1 ] A _ {t s} ^ {2}}{c _ {s} ^ {2} \pi_ {t s}}
$$
$$
E \left[ \tilde {d} _ {s} \right]\left(c _ {s}\right) = \sum_ {t \rightarrow s} \min  \left(1, c _ {s} \pi_ {t s}\right)
$$