Abstract
The problem of designing space-efficient parallel merging algorithms is examined. It is shown that two sorted sequences of lengths m and n, m≤n, can be merged in O(n/p+log n) time on an EREW PRAM with p processors, using only a constant amount of extra storage per processor. After a slight modification, the algorithm runs on a DCM (Direct Connection Machine) within the same resource requirements. This construction avoids the α(log n) slowdown when EREW PRAMs are simulated by DCMs. Moreover, using similar techniques, it is shown that merging can be accomplished in O(n/p+log log m) time on a CREW PRAM with p processors, and O(1) extra space per processor. Our algorithms use a sequential algorithm for in-place merging as a subroutine, and if this is stable, also the parallel algorithms are stable.
On leave from Department of Computer Science, University of Turku, Lemminkäisenkatu 14 A, SF-20520 Turku, Finland.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
S.G. Akl. The Design and Analysis of Parallel Algorithms. Prentice-Hall, Englewood Cliffs, N.J., 1989.
R.J. Anderson, E.W. Mayr, and M.K. Warmuth. Parallel approximation algorithms for bin packing. Inform. and Comput., 82:262–277, 1989.
K.E. Batcher. Sorting networks and their applications. In Proc. of AFIPS Spring Joint Computer Conf., pages 307–314, 1968.
G. Bilardi and A. Nicolau. Adaptive bitonic sorting: An optimal parallel algorithm for shared memory models. SIAM J. Comput, 18:216–228, 1989.
A. Borodin and J.E. Hopcroft. Routing, sorting, and merging on parallel models of computation. J. Comput. System Sci., 30:130–145, 1985.
R. Cole. Parallel merge sort. SIAM J. Comput., 17:770–785, 1988.
E. Dekel and I. Ozsvath. Parallel external merging. J. Parallel Distr. Comput., 6:623–635, 1989.
D. Eppstein and Z. Galil. Parallel algorithmic techniques for combinatorial computation. Annual Reviews in Computer Science, 3:233–283, 1988.
X. Guan and M.A. Langston. Time-space optimal parallel merging and sorting. IEEE Trans. Comput., 40:596–602, 1991.
T. Hagerup and C. Rüb. Optimal merging and sorting on the EREW PRAM. Inform. Process. Lett., 33:181–185, 1989.
B.-C. Huang and M.A. Langston. Practical in-place merging. Comm. ACM, 31:348–352, 1988.
B.-C. Huang and M.A. Langston. Fast stable merging and sorting in constant extra space. In Proc. Internat. Conf. on Computing and Information, pages 71–80, 1989.
R.M. Karp and V. Ramachandran. A survey of parallel algorithms for shared memory machines. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science. North-Holland, Amsterdam, The Netherlands, 1990.
M.A. Kronrod. An optimal ordering algorithm without a field of operation. Dokladi Akademia Nauk SSSR, 186:1256–1258, 1969.
C.P. Kruskal. Searching, merging, and sorting in parallel computation. IEEE Trans. Comput., C-32:942–946, 1983.
C.P. Kruskal, L. Rudolph, and M. Snir. A complexity theory of efficient parallel algorithms. Theoret. Comput. Sci., 71:95–132, 1990.
H. Mannila and E. Ukkonen. A simple linear-time algorithm for in situ merging. Inform. Process. Lett., 18:203–208, 1984.
F.P Preparata. New parallel-sorting schemes. IEEE Trans. Comput., C-27:669–673, 1978.
M.J. Quinn. Designing Efficient Algorithms for Parallel Computers. North-Holland, New York, 1987.
J. Salowe and W. Steiger. Simplified stable merging tasks. J. Algorithms, 8:557–571, 1987.
B. Schieber and U. Vishkin. Finding all nearest neighbors for convex polygons in parallel: A new lower bound technique and a matching algorithm. Discrete Applied Math., 29:97–111, 1990.
J.T. Schwartz. Ultracomputers. ACM Trans. Program. Lang. Syst., 2:484–521, 1980.
Y. Shiloach and U. Vishkin. Finding the maximum, merging, and sorting in a parallel computational model. J. Algorithms, 12:88–102, 1981.
M. Snir. On parallel searching. SIAM J. Comput., 15:688–708, 1985.
H.S. Stone. Parallel processing with the perfect shuffle. IEEE Trans. Comput., C-20:153–161, 1971.
L.G. Valiant. General purpose parallel architectures. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science. North-Holland, Amsterdam, The Netherlands, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Katajainen, J., Levcopoulos, C., Petersson, O. (1992). Space-efficient parallel merging. In: Etiemble, D., Syre, JC. (eds) PARLE '92 Parallel Architectures and Languages Europe. PARLE 1992. Lecture Notes in Computer Science, vol 605. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55599-4_79
Download citation
DOI: https://doi.org/10.1007/3-540-55599-4_79
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55599-5
Online ISBN: 978-3-540-47250-6
eBook Packages: Springer Book Archive