Fast generation of random permutations via networks simulation

  • Artur Czumaj
  • Przemysława Kanarek
  • Mirosław Kutyłowski
  • Krzysztof Loryś
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1136)

Abstract

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≤in. 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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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. 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
  3. 3.
    R. Cole, Parallel merge sort, SIAM J. Comput. 17 (1988) 770–785.CrossRefGoogle Scholar
  4. 4.
    S. Cook, C. Dwork, and R. Reischuk, Upper and lower bounds for parallel random access machines without simultaneous writes, SIAM J. Comput. 15 (1986) 87–97.CrossRefGoogle Scholar
  5. 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. 6.
    R. Durstenfeld, Random permutation (Algorithm 235), Comm. ACM 7 (1964) 420.Google Scholar
  7. 7.
    A. Gottlieb and C. P. Kruskal, Complexity results for permuting data and other computations on parallel processors, J. Assoc. Comput. Mach. 31 (1984) 193–209.MathSciNetGoogle Scholar
  8. 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. 9.
    D. E. Knuth, The Art of Computer Programming: Seminumerical Algorithms, volume 2, Addison-Wesley, Reading, Massachusetts, 2nd edition, 1981.Google Scholar
  10. 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. 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. 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. 13.
    R. Motwani and P. Raghavan, Randomized Algorithms, Cambridge University Press, 1995.Google Scholar
  14. 14.
    K. Mulmuley, Computational Geometry. An Introduction Through Randomized Algorithms, Prentice Hall, Englewood Cliffs, New Jersey, 1994.Google Scholar
  15. 15.
    S. Rajasekaran and J. Reif, Optimal and sublogarithmic time randomized parallel sorting algorithms, SIAM J. Comput. 19 (1989) 594–607.Google Scholar
  16. 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. 17.
    R. Sedgewick, Permutation generation methods, ACM Comput. Surv. 9 (1977) 138–164.Google Scholar

Copyright information

© Springer-Verlag 1996

Authors and Affiliations

  • Artur Czumaj
    • 1
  • Przemysława Kanarek
    • 2
  • Mirosław Kutyłowski
    • 1
  • Krzysztof Loryś
    • 2
    • 3
  1. 1.Heinz Nixdorf Institute and Dept. of Mathematics & Computer ScienceUniversity of PaderbornPaderbornGermany
  2. 2.Institute of Computer ScienceUniversity of WrocławWrocławPoland
  3. 3.Department of Computer ScienceUniversity of TrierTrierGermany

Personalised recommendations