The I/O complexity of sorting and related problems
We provide tight upper and lower bounds, up to a constant factor, for the number of accesses (I/Os) to secondary storage required for four sorting-related problems: sorting, the fast Fourier transform (FFT), permutation networks, and permuting records. The bounds hold both in the worst case and in the average case. Secondary storage is modeled as a magnetic disk capable of transfering P blocks each containing B records in a single time unit; the records in each block must be input from or output to B contiguous locations on the disk. We give two optimal algorithms for the problems, which are variants of merge sorting and distribution sorting. In particular we show for P=1 that the standard merge sorting algorithm is an optimal external sorting method. Our sorting algorithms use the same number of I/Os as does the permutation phase of key sorting, except when the internal memory size is extremely small, thus substantiating the popular adage that key sorting is not better. We also give a simpler and more direct derivation of a result due to Hong and Kung, which gives the FFT lower bound for the special case B=P=O(1).
KeywordsFast Fourier Transform Internal Memory Single Track Magnetic Disk Block Transfer
Unable to display preview. Download preview PDF.
- R. Beigel and J. Gill. Personal communication (1986).Google Scholar
- M. Blum, R. W. Floyd, V. Pratt, R. L. Rivest, and R. E. Tarjan. “Time Bounds for Selection,” Journal of Computer and System Sciences, 7 (1973), 448–461.Google Scholar
- R. W. Floyd. “Permuting Information in Idealized Two-Level Storage,” Complexity of Computer Calculations, Plenum, New York (1972), 105–109.Google Scholar
- Hong J. W. and H. T. Kung. “I/O Complexity: The Red-Blue Pebble Game,” Proceedings of the 13th Annual ACM Symposium on Theory of Computing, Milwaukee, WI (October 1981), 326–333.Google Scholar
- D. E. Knuth. The Art of Computer Programming. Volume III: Sorting and Searching. Addison-Wesley, Reading, MA (1973).Google Scholar
- F. T. Leighton. “Tight Bounds on the Complexity of Parallel Sorting,” IEEE Transactions on Computers, C-34(4), Special Issue on Sorting (April 1985).Google Scholar
- E. E. Lindstrom and J. S. Vitter. “The Design and Analysis of BucketSort for Bubble Memory Secondary Storage,” IEEE Transactions on Computers, C-34(3) (March 1985), 218–233.Google Scholar
- J. E. Savage and J. S. Vitter. “Parallelism in Space-Time Tradeoffs,” Advances in Computing Research, Volume 4: Special Issue on Parallel and Distributed Computing, JAI Press, Greenwich, CT (1987), 117–146.Google Scholar
- C. L. Wu and T. Y. Feng. “The Universality of the Shuffle-Exchange Network,” IEEE Transactions on Computers, C-30(5) (May 1981), 324–332.Google Scholar