Efficient Dynamic Weighted Set Sampling and Its Extension
Fangyuan Zhang, Mengxu Jiang, Sibo Wang
Abstract
Given a weighted set S of n elements, weighted set sampling (WSS) samples an element in S so that each element
a i
; is sampled with a probability proportional to its weight w (
a i
). The classic alias method pre-processes an index in O ( n ) time with O ( n ) space and handles WSS with O (1) time. Yet, the alias method does not support dynamic updates. By minor modifications of existing dynamic WSS schemes, it is possible to achieve an expected O (1) update time and draw t independent samples in expected O ( t ) time with linear space, which is theoretically optimal. But such a method is impractical and even slower than a binary search tree-based solution. How to support both efficient sampling and updates in practice is still challenging. Motivated by this, we design BUS , an efficient scheme that handles an update in O (1) amortized time and draws t independent samples in O (log n + t) time with linear space.
A natural extension of WSS is the weighted independent range sampling (WIRS) , where each element in S is a data point from R. Given an arbitrary range Q = [ℓ, r ] at query time, WIRS aims to do weighted set sampling on the set
S Q
of data points falling into range Q. We show that by integrating the theoretically optimal dynamic WSS scheme mentioned above, it can handle an update in O (log n ) time and can draw t independent samples for WIRS in O (log n + t ) time, the same as the state-of-the-art static algorithm. Again, such a solution by integrating the optimal dynamic WSS scheme is still impractical to handle WIRS queries. We further propose WIRS-BUS to integrate BUS to handle WIRS queries, which handles each update in O (log n ) time and draws t independent samples in O (log 2 n + t ) time with linear space. Extensive experiments show that our BUS and WIRS-BUS are efficient for both sampling and updates.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b7a0a0e3-67fd-4013-ad04-701ec243adcaCited by top-tier papers4
- Independent Range Sampling on Interval DataDaichi AmagataICDE 2024 · 9 citations
- GENTI: GPU-powered Walk-based Subgraph Extraction for Scalable Representation Learning on Dynamic GraphsZihao Yu, Ningyi Liao, Siqiang LuoVLDB 2024 · 8 citations
- Poisson Sampling over Acyclic JoinsLiese Bekkers, Frank Neven, Lorrens Pantelis, Stijn VansummerenSIGMOD 2026 · 1 citation
- RidgeWalker: Perfectly Pipelined Graph Random Walks on FPGAsHongshi Tan, Yao Chen, Xinyu Chen, Qizhen Zhang et al.HPCA 2026
Builds on2
Related papers
- DIPS: Optimal Dynamic Index for Poisson πps SamplingJinchao Huang, Sibo WangKDD 2025
- Practical Dynamic Extension for Sampling IndexesDouglas B. Rumbaugh, Dong XieSIGMOD 2024 · 3 citations
- WOR and p's: Sketches for ℓp-Sampling Without ReplacementEdith Cohen, Rasmus Pagh, David P. WoodruffNeurIPS 2020
- Optimal Dynamic Subset Sampling: Theory and ApplicationsLu Yi, Hanzhi Wang, Zhewei WeiKDD 2023 · 4 citations
- FIRAS: A Framework for Interval Range Search and SamplingDaichi Amagata, Panagiotis Simatis, Panagiotis Bouros, Nikos MamoulisSIGMOD 2026 · 4 citations
