Skip to main content
Log in

Sloping-and-shaking

Multiway merging and sorting

  • Published:
Science in China Series E: Technological Sciences Aims and scope Submit manuscript

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.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Knuth, D. E.,The Art of Computer Programming, Vol. 3,Sorting and Searching, Reading: Addison-Wesley Publishing Company, 1973.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. Stone, H. S., Parallel processing with the perfect shuffle,IEEE Trans. on Computers, 1971, C-20(2): 153.

    Article  MATH  Google Scholar 

  4. Thompson, C. D., Kung, H. T., Sorting on a mesh-connected parallel computer,Communications of the ACM, 1977, 20(4): 263.

    Article  MATH  MathSciNet  Google Scholar 

  5. Ja'Ja', J., Owens, M., VLSI sorting with reduced hardware,IEEE Trans. Computers, 1984, C-33(7): 668.

    Article  Google Scholar 

  6. Nakatani, T., Huang, S. T., Arden, B. W.et al., K-way bitonic sort,IEEE Trans. Computers, 1989, C-38(2): 283.

    Article  MATH  MathSciNet  Google Scholar 

  7. Batcher, K. E., On bitonic sorting networks, inProc. of 1990International Conference on Parallel Processing, University Park: Pennsylvania State University Press, 1990,.

    Google Scholar 

  8. Alnuweiri, H. M., Prasanna Kumar, V. K., Optimal VLSI sorting with reduced number of processors,IEEE Trans. on Computers, 1991, C-40(1): 105.

    Article  MathSciNet  Google Scholar 

  9. Guan Xiaojun, Langston, M. A., Time-space optimal parallel merging and sorting,IEEE Trans. on Computers, 1991, C-40(5): 596.

    Article  Google Scholar 

  10. Beck, M., Bitton, D., Wilkinsin, W. K., Sorting large files on a backend multiprocessor,IEEE Trans. on Computers, 1988, C-37(7): 769.

    Article  Google Scholar 

  11. Rotem, D., Santoro, N., Sidney, J. B., Distributed sorting,IEEE Trans. on Computers, 1985, C-34(4): 372.

    MATH  MathSciNet  Google Scholar 

  12. 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.

    Google Scholar 

  13. 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,.

    Google Scholar 

  14. Leighton, T., Tight bound on the complexity of parallel sorting,IEEE Trans. on Computers, 1985, C-34(4): 344.

    MATH  MathSciNet  Google Scholar 

  15. Chen, G. L.,Parallel Algorithm: Sorting and Searching (in Chinese), Heifei: The Press of China University of Sciences and Technology, 1990.

    Google Scholar 

  16. 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.

    Chapter  Google Scholar 

  17. 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.

    Google Scholar 

  18. Parker, B., Parberry, I., Constructing sorting networks fromk-sorters,Information Processing Letters, 1989, 33: 157.

    Article  MATH  MathSciNet  Google Scholar 

  19. Lee, D., Batcher, K. E., A multiway merge sorting network,IEEE Trans. on Parallel and Distributed Systems, 1995, 6(2): 211.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Project supported by the National “863” High-Tech Program of China and the National Natural Science Foundation of China.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02916597

Keywords

Navigation