Beyond Binary Search: Parallel In-Place Construction of Implicit Search Tree Layouts

We present parallel algorithms to efficiently permute a sorted array into the level-order binary search tree (BST), level-order B-tree (B-tree), and van Emde Boas (vEB) layouts in-place. We analytically determine the complexity of our algorithms and empirically measure their performance. Results indicate that on both CPU and GPU architectures B-tree layouts provide the best query performance. However, when considering the total time to permute the data and to perform a series of search queries, our vEB permutation provides the best performance on the CPU. We show that, given an input of N=500M 64-bit integers, the benefits of query performance (compared to binary search) outweigh the cost of in-place permutation using our algorithms when performing at least 5M queries (1% of N) and 27M queries (6% of N), on our CPU and GPU platforms, respectively.

[1]  Richard E. Ladner,et al.  A Comparison of Cache Aware and Cache Oblivious Static Search Trees Using Program Instrumentation , 2000, Experimental Algorithmics.

[2]  Timothy J. Purcell Sorting and searching , 2005, SIGGRAPH Courses.

[3]  Daniele D'Angeli,et al.  Shuffling matrices, Kronecker product and Discrete Fourier Transform , 2016, Discret. Appl. Math..

[4]  Alok Aggarwal,et al.  The input/output complexity of sorting and related problems , 1988, CACM.

[5]  W. H. Inmon,et al.  Dw 2.0: The Architecture for the Next Generation of Data Warehousing , 2008 .

[6]  Michael T. Goodrich,et al.  Fundamental parallel algorithms for private-cache chip multiprocessors , 2008, SPAA '08.

[7]  Fabio Cannizzo,et al.  A fast and vectorizable alternative to binary search in O(1) with wide applicability to arrays of floating point numbers , 2015, J. Parallel Distributed Comput..

[8]  Harold S. Stone,et al.  Parallel Processing with the Perfect Shuffle , 1971, IEEE Transactions on Computers.

[9]  M. V. Wilkes,et al.  The Art of Computer Programming, Volume 3, Sorting and Searching , 1974 .

[10]  Richard P. Brent,et al.  The Parallel Evaluation of General Arithmetic Expressions , 1974, JACM.

[11]  Nodari Sitchinava,et al.  Empirical Evaluation of the Parallel Distribution Sweeping Framework on Multicore Architectures , 2013, ESA.

[12]  John A. Ellis,et al.  Computing the cycles in the perfect shuffle permutation , 2000, Inf. Process. Lett..

[13]  Peiyush Jain A Simple In-Place Algorithm for In-Shuffle , 2008, ArXiv.

[14]  Jeffrey Scott Vitter,et al.  Algorithms and Data Structures for External Memory , 2008, Found. Trends Theor. Comput. Sci..

[15]  Christian Ronse,et al.  A generalization of the perfect shuffle , 1983, Discret. Math..

[16]  Faith Ellen,et al.  Permuting in Place , 1995, SIAM J. Comput..

[17]  Gerth Stølting Brodal,et al.  Cache oblivious search trees via binary trees of small height , 2001, SODA '02.

[18]  Ulrike Stege,et al.  A Provably, Linear Time, In-place and Stable Merge Algorithm via the Perfect Shuffle , 2015, ArXiv.

[19]  William M. Kantor,et al.  The mathematics of perfect shuffles , 1983 .

[20]  John A. Ellis,et al.  In situ, Stable Merging by Way of the Perfect Shuffle , 2000, Comput. J..

[21]  Pat Morin,et al.  Array Layouts for Comparison-Based Searching , 2015, ACM J. Exp. Algorithmics.

[22]  Mehmet Emin Dalkiliç,et al.  A simple shuffle-based stable in-place merge algorithm , 2011, WCIT.

[23]  Marc Davio,et al.  Kronecker products and shuffle algebra , 1981, IEEE Transactions on Computers.

[24]  Yi-Jen Chiang,et al.  Experiments on the Practical I/O Efficiency of Geometric Algorithms: Distribution Sweep vs. Plane Sweep , 1995, WADS.

[25]  S. Sitharama Iyengar,et al.  Introduction to parallel algorithms , 1998, Wiley series on parallel and distributed computing.

[26]  Frank Ruskey,et al.  In-place permuting and perfect shuffling using involutions , 2012, Inf. Process. Lett..

[27]  Sayyada Fahmeeda Sultana,et al.  Video Encryption Algorithm and Key Management using Perfect Shuffle , 2017 .

[28]  Jeffrey Shallit,et al.  The Cycles of the Multiway Perfect Shuffle Permutation , 2002, Discret. Math. Theor. Comput. Sci..

[29]  M. G.,et al.  In Situ , 2021, Encyclopedic Dictionary of Archaeology.

[30]  R. Bayer,et al.  Organization and maintenance of large ordered indices , 1970, SIGFIDET '70.