Fast generation of random permutations via networks simulation
We consider the classical problem of generating random permutations with the uniform distribution. That is, we require that for an arbitrary permutation π of n elements, with probability 1/n! the machine halts with the ith output cell containing π(i), for 1≤i≤n. We study this problem on two models of parallel computations: the CREW PRAM and the EREW PRAM.
The main result of the paper is an algorithm for generating random permutations that runs in O(log log n) time and uses O(n1+o(1)) processors on the CREW PRAM. This is the first o(log n)-time CREW PRAM algorithm for this problem.
On the EREW PRAM we present a simple algorithm that generates a random permutation in time O(log n) using n processors and O(n) space. This algorithm matches the running time and the number of processors used of the best previously known algorithms for the CREW PRAM, and performs better as far as the memory usage is considered.
The common and novel feature of both our algorithms is to design first a suitable random network generating a permutation and then to simulate this network on the PRAM model in a fast way.
Unable to display preview. Download preview PDF.
- 1.R. Anderson, Parallel algorithms for generating random permutations on a shared memory machine, in Proc. 2nd Annual ACM Symposium on Parallel Algorithms and Architectures, (ACM Press, New York, 1990), 95–102.Google Scholar
- 2.A. Borodin and J. E. Hopcroft, Routing, merging, and sorting on parallel models of computation, J. Comput. System Sci. 30 (1985), 130–145.Google Scholar
- 5.M. Dietzfelbinger, M. Kutyłowski, and R. Reischuk, Exact lower time bounds for computing boolean functions on CREW PRAMs, J. Comput. System Sci. 48 (1994) 231–254.Google Scholar
- 6.R. Durstenfeld, Random permutation (Algorithm 235), Comm. ACM 7 (1964) 420.Google Scholar
- 8.T. Hagerup, Fast parallel generation of random permutations, in Proc. 18th Annual International Colloquium on Automata, Languages and Programming, ICALP'91, (Springer Verlag, LNCS 510, Heidelberg, 1991), 405–416.Google Scholar
- 9.D. E. Knuth, The Art of Computer Programming: Seminumerical Algorithms, volume 2, Addison-Wesley, Reading, Massachusetts, 2nd edition, 1981.Google Scholar
- 10.Y. Matias and U. Vishkin, Converting high probability into nearly-constant time — with applications to parallel hashing, in Proc. 23rd Annual ACM Symposium on Theory of Computing, (ACM Press, New York, 1991), 307–316.Google Scholar
- 11.G. L. Miller and J. H. Reif, Parallel tree contraction, in Proc. 26 Symposium on Foundations of Computer Science, (IEEE, Los Alamitos, 1985), 478–489.Google Scholar
- 12.G. L. Miller and J. H. Reif, Parallel tree contraction, Part 1: Fundamentals, Adv. in Comput. Res. 5 (1989) 47–72.Google Scholar
- 13.R. Motwani and P. Raghavan, Randomized Algorithms, Cambridge University Press, 1995.Google Scholar
- 14.K. Mulmuley, Computational Geometry. An Introduction Through Randomized Algorithms, Prentice Hall, Englewood Cliffs, New Jersey, 1994.Google Scholar
- 15.S. Rajasekaran and J. Reif, Optimal and sublogarithmic time randomized parallel sorting algorithms, SIAM J. Comput. 19 (1989) 594–607.Google Scholar
- 16.J. Reif, An optimal parallel algorithm for integer sorting, in Proc. 26 Symposium on Foundations of Computer Science, (IEEE, Los Alamitos, 1985), 490–503.Google Scholar
- 17.R. Sedgewick, Permutation generation methods, ACM Comput. Surv. 9 (1977) 138–164.Google Scholar