Abstract
Most traditional merging and merging-based sorting algorithms are based on 2 sorters or 2 comparators. A new merging technique is developed, namely sloping-and-shaking multiway merging, and a corresponding multiway sorting method based only onk-sorters is proposed. The sloping-and-shaking merging algorithm mergesk sorted lists into one, wherek can be any prime number. The merging process is not a series of recursive applications of 2-way merging. It sorts the keys on them×k plane in vertical and horizontal directions, then along sloping lines with various slope rates step by step. Onlyk-sorters are needed in the merging or sorting process. The time needed to mergek sorted lists, withm of each, is (k+┌log2(m/k)┐)t k, and the time for sortingN keys is (1+(p−1)k+1/2(p−1)(p−2)┌log2 k┐)t k, wherep=log kN, andt k is the time to sortk keys. The proposed algorithms can be implemented either by hardwared sorting networks, or on general purpose parallel and vector machines. The traditional odd-even merging can be viewed as a special case of the multiway merging proposed (whenk is 2). While theoretically the proposed algorithms provide a new understanding of parallel merging and sorting processes, they may be used in practice to construct sorting circuits faster than 2-sorter based sorting methods.
Similar content being viewed by others
References
Knuth, D. E.,The Art of Computer Programming, Vol. 3,Sorting and Searching, Reading: Addison-Wesley Publishing Company, 1973.
Batcher, K. E., Sorting networks and their applications, in 1968Spring Joint Computer Conference, AFIPS Proceedings, Vol. 32, Washington D. C.: Thompson Book Company, 1968, 307–314.
Stone, H. S., Parallel processing with the perfect shuffle,IEEE Trans. on Computers, 1971, C-20(2): 153.
Thompson, C. D., Kung, H. T., Sorting on a mesh-connected parallel computer,Communications of the ACM, 1977, 20(4): 263.
Ja'Ja', J., Owens, M., VLSI sorting with reduced hardware,IEEE Trans. Computers, 1984, C-33(7): 668.
Nakatani, T., Huang, S. T., Arden, B. W.et al., K-way bitonic sort,IEEE Trans. Computers, 1989, C-38(2): 283.
Batcher, K. E., On bitonic sorting networks, inProc. of 1990International Conference on Parallel Processing, University Park: Pennsylvania State University Press, 1990,.
Alnuweiri, H. M., Prasanna Kumar, V. K., Optimal VLSI sorting with reduced number of processors,IEEE Trans. on Computers, 1991, C-40(1): 105.
Guan Xiaojun, Langston, M. A., Time-space optimal parallel merging and sorting,IEEE Trans. on Computers, 1991, C-40(5): 596.
Beck, M., Bitton, D., Wilkinsin, W. K., Sorting large files on a backend multiprocessor,IEEE Trans. on Computers, 1988, C-37(7): 769.
Rotem, D., Santoro, N., Sidney, J. B., Distributed sorting,IEEE Trans. on Computers, 1985, C-34(4): 372.
Iyer, B., Ricard, G., Varman, P., Percentile finding algorithm for multiple sorted runs, inProc. 15th International Conference on Very Large Databases, San Mateo: Morgan Kaufman Publishers, 1989, 135–144.
Varmen, P. J., Iyer, B. R., Scheufler, S. D., A multiprocessor algorithm for merging multiple sorted lists, inProc. of 1990International Conference on Parallel Processing, University Park: Pennsylvania State University Press, 1990,.
Leighton, T., Tight bound on the complexity of parallel sorting,IEEE Trans. on Computers, 1985, C-34(4): 344.
Chen, G. L.,Parallel Algorithm: Sorting and Searching (in Chinese), Heifei: The Press of China University of Sciences and Technology, 1990.
Liszka, K. J., Batcher, K. E., A modular merge sorting network, inProc. Frontiers'92, The Fourth Symposium on the Frontiers of Massively Parallel Computation (ed. Siegal, H. J.), Washington, D. C.: IEEE Computer Society Press, 1992, 164–169.
Liszka, K. J., Batcher, K. E., A generalized bitonic sorting network, inProc. 1993International Conference on Parallel Processing, University Park: Pennsylvania State University Press, 1993, I-105–I-108.
Parker, B., Parberry, I., Constructing sorting networks fromk-sorters,Information Processing Letters, 1989, 33: 157.
Lee, D., Batcher, K. E., A multiway merge sorting network,IEEE Trans. on Parallel and Distributed Systems, 1995, 6(2): 211.
Author information
Authors and Affiliations
Additional information
Project supported by the National “863” High-Tech Program of China and the National Natural Science Foundation of China.
Rights and permissions
About this article
Cite this article
Gao, Q., Liu, Z. Sloping-and-shaking. Sci. China Ser. E-Technol. Sci. 40, 225–234 (1997). https://doi.org/10.1007/BF02916597
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF02916597