Skip to main content

Fast generation of random permutations via networks simulation

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((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(n 1+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.

Partially supported by KBN grant 8 S503 002 07, TEMPUS project JEP 8145, EU ESPRIT Long Term Research Project 20244 (ALCOM-IT), DFG-Sonderforschungsbereich 376 “Massive Parallelität” and DFG Leibniz Grant Me872/6-1.

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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 

  3. R. Cole, Parallel merge sort, SIAM J. Comput. 17 (1988) 770–785.

    Article  Google Scholar 

  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.

    Article  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 

  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.

    MathSciNet  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Josep Diaz Maria Serna

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Czumaj, A., Kanarek, P., Kutyłowski, M., Loryś, K. (1996). Fast generation of random permutations via networks simulation. In: Diaz, J., Serna, M. (eds) Algorithms — ESA '96. ESA 1996. Lecture Notes in Computer Science, vol 1136. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61680-2_60

Download citation

  • DOI: https://doi.org/10.1007/3-540-61680-2_60

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61680-1

  • Online ISBN: 978-3-540-70667-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics