MergeShuffle:一个非常快速的并行随机置换算法
MergeShuffle: A Very Fast, Parallel Random Permutation Algorithm
摘要:
本文介绍了一种算法MergeShuffle,这是一种非常有效的生成随机排列(或随机排列现有数组)的算法。它易于实现,在$n\log_2 n + O(1)$时间内运行,就地运行,使用$n\log_2 n + Θ(n)$随机位,并且可以在共享内存PRAM模型中跨任意数量的进程并行化。最后,我们使用OpenMP的初步模拟表明,它比Rao-Sandelius算法更有效,Rao-Sandelius算法是现有最快的随机置换算法之一。我们还展示了如何有可能进一步减少消耗的随机位的数量,通过引入第二个算法BalancedShuffle,一个变体的劳-Sandelius算法,这是更保守的方式,它递归分区数组被打乱。虽然这个算法是较少的实际利益,我们相信它可能是理论价值。我们的完整代码可在:https://github.com/axel-bacher/mergeshuffle
英文摘要:
This article introduces an algorithm, MergeShuffle, which is an extremely efficient algorithm to generate random permutations (or to randomly permute an existing array). It is easy to implement, runs in $n\log_2 n + O(1)$ time, is in-place, uses $n\log_2 n + Θ(n)$ random bits, and can be parallelized accross any number of processes, in a shared-memory PRAM model. Finally, our preliminary simulations using OpenMP suggest it is more efficient than the Rao-Sandelius algorithm, one of the fastest existing random permutation algorithms. We also show how it is possible to further reduce the number of random bits consumed, by introducing a second algorithm BalancedShuffle, a variant of the Rao-Sandelius algorithm which is more conservative in the way it recursively partitions arrays to be shuffled. While this algorithm is of lesser practical interest, we believe it may be of theoretical value. Our full code is available at: https://github.com/axel-bacher/mergeshuffle
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。