Optimal Sorting Circuits for Short Keys

A long-standing open question in the algorithms and complexity literature is whether there exist sorting circuits of size o(n log n). A recent work by Asharov, Lin, and Shi (SODA’21) showed that if the elements to be sorted have short keys whose length k = o(log n), then one can indeed overcome the n log n barrier for sorting circuits, by leveraging non-comparison-based techniques. More specifically, Asharov et al. showed that there exist O(n) · min(k, log n)-sized sorting circuits for k-bit keys, ignoring poly log∗ factors. Interestingly, the recent works by Farhadi et al. (STOC’19) and Asharov et al. (SODA’21) also showed that the above result is essentially optimal for every key length k, assuming that the famous Li-Li network coding conjecture holds. Note also that proving any unconditional super-linear circuit lower bound for a wide class of problems is beyond the reach of current techniques. Unfortunately, the approach taken by Asharov et al. to achieve optimality in size somewhat crucially relies on sacrificing the depth: specifically, their circuit is super-polylogarithmic in depth even for 1-bit keys. Asharov et al. phrase it as an open question how to achieve optimality both in size and depth. In this paper, we close this important gap in our understanding. We construct a sorting circuit of size O(n)·min(k, log n) (ignoring poly log∗ terms) and depthO(log n). To achieve this, our approach departs significantly from the prior works. Our result can be viewed as a generalization of the landmark result by Ajtai, Komlós, and Szemerédi (STOC’83), simultaneously in terms of size and depth. Specifically, for k = o(log n), we achieve asymptotical improvements in size over the AKS sorting circuit, while preserving optimality in depth. *Author ordering is randomly generated. ar X iv :2 10 2. 11 48 9v 1 [ cs .D S] 2 3 Fe b 20 21

[1]  丸岡 章,et al.  Selection Networks with $8n$ log$_2$ $n$ Size and $O$(log $n$) Depth , 1991 .

[2]  V. E. Alekseev Sorting algorithms with minimum memory , 1969 .

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

[4]  Kartik Nayak,et al.  OptORAMa: Optimal Oblivious RAM , 2020, IACR Cryptol. ePrint Arch..

[5]  W. Haemers Interlacing eigenvalues and graphs , 1995 .

[6]  David G. Kirkpatrick,et al.  Upper Bounds for Sorting Integers on Random Access Machines , 1984, Theor. Comput. Sci..

[7]  Mike Paterson,et al.  Improved sorting networks withO(logN) depth , 1990, Algorithmica.

[8]  Torsten Suel,et al.  On Probabilistic Networks for Selection, Merging, and Sorting , 1995, SPAA '95.

[9]  Michal Kouck'y,et al.  Sorting Short Integers , 2021, ICALP.

[10]  Rafail Ostrovsky,et al.  Oblivious tight compaction in O(n) time with smaller constant , 2020, IACR Cryptol. ePrint Arch..

[11]  Bruce M. Maggs,et al.  On-Line Algorithms for Path Selection in a Nonblocking Network , 1996, SIAM J. Comput..

[12]  Karl Beecher Merging , 2020, Going Further with Git.

[13]  Nicholas Pippenger Self-Routing Superconcentrators , 1996, J. Comput. Syst. Sci..

[14]  Andrew Chi-Chih Yao Bounds on Selection Networks , 1974, SWAT.

[15]  Akira Maruoka,et al.  Expanders obtained from affine transformations , 1985, STOC '85.

[16]  Sarvar Patel,et al.  PanORAMa: Oblivious RAM with Logarithmic Overhead , 2018, 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS).

[17]  Rajeev Raman,et al.  Sorting in linear time? , 1995, STOC '95.

[18]  Manuel Blum,et al.  Time Bounds for Selection , 1973, J. Comput. Syst. Sci..

[19]  Yijie Han,et al.  Deterministic sorting in O(nloglogn) time and linear space , 2004, J. Algorithms.

[20]  Moni Naor,et al.  Is There an Oblivious RAM Lower Bound? , 2016, ITCS.

[21]  Elaine Shi,et al.  Oblivious Parallel Tight Compaction , 2020, IACR Cryptol. ePrint Arch..

[22]  Stephen A. Cook,et al.  Upper and Lower Time Bounds for Parallel Random Access Machines without Simultaneous Writes , 1986, SIAM J. Comput..

[23]  Elaine Shi,et al.  Lower bounds for external memory integer sorting via network coding , 2019, STOC.

[24]  Joel I. Seiferas,et al.  Sorting Networks of Logarithmic Depth, Further Simplified , 2009, Algorithmica.

[25]  Mikkel Thorup Randomized sorting in O(n log log n) time and linear space using addition, shift, and bit-wise boolean operations , 1997, SODA '97.

[26]  Michael T. Goodrich,et al.  Zig-zag sort: a simple deterministic data-oblivious sorting algorithm running in O(n log n) time , 2014, STOC.

[27]  John C. Mitchell,et al.  Data-Oblivious Data Structures , 2014, STACS.

[28]  Elaine Shi,et al.  Can We Overcome the n log n Barrier for Oblivious Sorting? , 2019, IACR Cryptol. ePrint Arch..

[29]  Kasper Green Larsen,et al.  Lower Bounds for Multiplication via Network Coding , 2019, ICALP.

[30]  Nicholas Pippenger,et al.  Selection Networks , 1990, SIAM J. Comput..

[31]  John E. Savage,et al.  Models of computation - exploring the power of computing , 1998 .

[32]  E. Szemerédi,et al.  O(n LOG n) SORTING NETWORK. , 1983 .

[33]  Zvi Galil,et al.  Explicit Constructions of Linear-Sized Superconcentrators , 1981, J. Comput. Syst. Sci..

[34]  Audra E. Kosh,et al.  Linear Algebra and its Applications , 1992 .

[35]  Baochun Li,et al.  Network Coding : The Case of Multiple Unicast Sessions , 2004 .

[36]  Elaine Shi,et al.  Sorting Short Keys in Circuits of Size o(n log n) , 2020, SODA.

[37]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[38]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .