Download PDFOpen PDF in browser

Minimizing Sorting Networks at the Sub-Comparator Level

15 pagesPublished: May 26, 2024

Abstract

Sorting networks are sorting algorithms that execute a sequence of operations indepen- dently of the input. Since they can be implemented directly as circuits, sorting networks are easy to implement in hardware – but they are also used often in software to improve performance of base cases of standard recursive sorting algorithms. For this purpose, they are translated into machine-code instructions in a systematic way.
Recently, a deep-learning system discovered better implementations than previously known of some sorting networks with up to 8 inputs. In this article, we show that all these examples are instances of a general pattern whereby some instructions are removed. We show that this removal can be done when a particular set of constraints on integers is satisfiable, and identify conditions where we can reduce this problem to propositional satisfiability. We systematically apply this general construction to improve the best-known implementations of sorting networks of size up to 128, which are the ones most commonly found in software implementations.

Keyphrases: constraint solving, program optimization, satisfiability, sorting networks

In: Nikolaj Bjørner, Marijn Heule and Andrei Voronkov (editors). Proceedings of 25th Conference on Logic for Programming, Artificial Intelligence and Reasoning, vol 100, pages 36-50.

BibTeX entry
@inproceedings{LPAR2024:Minimizing_Sorting_Networks_at,
  author    = {Luís Cruz-Filipe and Peter Schneider-Kamp},
  title     = {Minimizing Sorting Networks at the Sub-Comparator Level},
  booktitle = {Proceedings of 25th Conference on Logic for Programming, Artificial Intelligence and Reasoning},
  editor    = {Nikolaj Bjørner and Marijn Heule and Andrei Voronkov},
  series    = {EPiC Series in Computing},
  volume    = {100},
  publisher = {EasyChair},
  bibsource = {EasyChair, https://easychair.org},
  issn      = {2398-7340},
  url       = {/publications/paper/v6QM6},
  doi       = {10.29007/lzks},
  pages     = {36-50},
  year      = {2024}}
Download PDFOpen PDF in browser