Parallel Weighted Random Sampling

Lorenz Hübschle-Schneider, Peter Sanders, Michael Wagner
2019 European Symposium on Algorithms  
Data structures for efficient sampling from a set of weighted items are an important building block of many applications. However, few parallel solutions are known. We close many of these gaps both for shared-memory and distributed-memory machines. We give efficient, fast, and practicable algorithms for sampling single items, k items with/without replacement, permutations, subsets, and reservoirs. We also give improved sequential algorithms for alias table construction and for sampling with
more » ... acement. Experiments on shared-memory parallel machines with up to 158 threads show near linear speedups both for construction and queries. ACM Subject Classification Theory of computation → Sketching and sampling; Theory of computation → Parallel algorithms; Theory of computation → Data structures design and analysis Supplement Material The code and scripts used for our experiments are available under the GPLv3 at https://github.com/lorenzhs/wrs. n i=1 w i . Define u := log U where U := w max /w min := max i w i / min i w i .
doi:10.4230/lipics.esa.2019.59 dblp:conf/esa/Hubschle-Schneider19 fatcat:ilqbdd4vsnda7kvwo7j3xzc7ly