Abstract
We present and analyze efficient new algorithms for generating a random variate distributed according to a dynamically changing set of weights. The base version of each algorithm generates the discrete random variate in O(log* N) expected time and updates a weight in O(2log* N) expected time in the worst case. We then show how to reduce the update time to O(log* N) amortized expected time. The algorithms are simple, practical, and easy to implement. We show how to apply our techniques to a recent algorithm of Hagerup, Mehlhorn, and Munro in order to obtain an expected constant time in the worst case for generation and update, with no assumptions about the input being made. We give parallel algorithms for parallel generation and update having optimal processors × time product. We also give an efficient dynamic algorithm for maintaining ε-heaps of elements; each query is required to return an element whose value is within an ε factor of the maximal element value. For ε = 1/polylog(n), each query, insertion, or deletion takes O(log log log n) time, with high probability.
Original language | English |
---|---|
Pages | 361-370 |
Number of pages | 10 |
State | Published - 1993 |
Externally published | Yes |
Event | Proceedings of the Fourth Annual ACM-SIAM Symposium on Discrete Algorithms - Austin, TX, USA Duration: 25 Jan 1993 → 27 Jan 1993 |
Conference
Conference | Proceedings of the Fourth Annual ACM-SIAM Symposium on Discrete Algorithms |
---|---|
City | Austin, TX, USA |
Period | 25/01/93 → 27/01/93 |