Samples with replacement when the neighbourhood is smaller than the
budget; the budget is what bounds the per-batch cost regardless of
node degree.
Usage
morie_gsageemd_sample(adj, v, size, rng)
Arguments
- adj
Adjacency list keyed by node.
- v
Node whose neighbours are sampled.
- size
Sample size.
- rng
Generator environment (shared with the Python arm).
Value
Integer vector of neighbour ids.
References
Hamilton, W. L. et al. (2017).
Examples
adj <- list(`0` = c(1L, 2L), `1` = 0L, `2` = 0L)
morie_gsageemd_sample(adj, v = 0, size = 3, rng = rmorie:::.ghc_rng(1)) # sampled with replacement
#> [1] 2 2 2