Fast Generation of Random Permutations Via Networks Simulation

Abstract. We consider the problem of generating random permutations with uniform distribution. That is, we require that for an arbitrary permutation π of n elements, with probability 1/n! the machine halts with the i th 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 outperforms each of the previously known algorithms for the exclusive write PRAMs. The common and novel feature of both our algorithms is first to design a suitable random switching network generating a permutation and then to simulate this network on the PRAM model in a fast way.

[1]  Allan Borodin,et al.  Routing, Merging, and Sorting on Parallel Models of Computation , 1985, J. Comput. Syst. Sci..

[2]  J. Reif,et al.  Parallel Tree Contraction Part 1: Fundamentals , 1989, Adv. Comput. Res..

[3]  Richard J. Anderson Parallel algorithms for generating random permutations on a shared memory machine , 1990, SPAA '90.

[4]  Torben Hagerup Fast Parallel Generation of Random Permutations , 1991, ICALP.

[5]  Richard Cole,et al.  Parallel merge sort , 1988, 27th Annual Symposium on Foundations of Computer Science (sfcs 1986).

[6]  Donald E. Knuth,et al.  The art of computer programming. Vol.2: Seminumerical algorithms , 1981 .

[7]  Donald E. Knuth The Art of Computer Programming 2 / Seminumerical Algorithms , 1971 .

[8]  Allan Gottlieb,et al.  Complexity Results for Permuting Data and Other Computations on Parallel Processors , 1984, JACM.

[9]  Stephen A. Cook,et al.  Upper and Lower Time Bounds for Parallel Random Access Machines without Simultaneous Writes , 1986, SIAM J. Comput..

[10]  Rajeev Motwani,et al.  Randomized Algorithms , 1995, SIGA.

[11]  Babak Sadeghiyan,et al.  Design of Hashing Algorithms , 1993, Lecture Notes in Computer Science.

[12]  John H. Reif,et al.  An optimal parallel algorithm for integer sorting , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[13]  Gary L. Miller,et al.  Parallel tree contraction and its application , 1985, 26th Annual Symposium on Foundations of Computer Science (sfcs 1985).

[14]  Ketan Mulmuley Computational Geometry , 1993 .

[15]  Rüdiger Reischuk,et al.  Exact Lower Time Bounds for Computing Boolean Functions on CREW PRAMs , 1994, J. Comput. Syst. Sci..

[16]  Sanguthevar Rajasekaran,et al.  Optimal and Sublogarithmic Time Randomized Parallel Sorting Algorithms , 1989, SIAM J. Comput..

[17]  Robert Sedgewick,et al.  Permutation Generation Methods , 1977, CSUR.

[18]  Uzi Vishkin,et al.  Converting high probability into nearly-constant time—with applications to parallel hashing , 1991, STOC '91.

[19]  Ketan Mulmuley,et al.  Computational geometry - an introduction through randomized algorithms , 1993 .