Exact sizes of networks that select the three or four largest of n elements
Version 1 / Nov 12, 2026 / CC BY 4.0
Abstract
We study -selection networks, which move the largest of inputs to given lines in any order, and the least number of comparators in such a network. Alekseev showed that . For we raise this bound by for every , and by when ; as far as we know, these are the first improvements at powers of two. The proofs follow the weights of the lines, and a pruning step of Yao extends the gain to every . For , Yao's upper bound is exact for . For the new bound is for all , and the value that Knuth expected is exact for . Their lower bounds rest on exhaustive searches at a few sizes and on the fact that one more input costs at least two more comparators. Most of the results are also proved in Lean 4, some through compiled checks.
References
- Alekseev, V. E. Sorting algorithms with minimum memory. Kibernetika, vol. 5, no. 5, pp. 99–103. 1969. English translation: Cybernetics 5 (1969), 642–648DOI
- Asín, Roberto; Nieuwenhuis, Robert; Oliveras, Albert; Rodríguez-Carbonell, Enric. Cardinality networks: a theoretical and empirical study. Constraints, vol. 16, no. 2. 2011DOI
- Codish, Michael; Zazon-Ivry, Moshe. Pairwise cardinality networks. Logic for Programming, Artificial Intelligence, and Reasoning (LPAR-16), vol. 6355, pp. 154–172. 2010DOI
- de Moura, Leonardo; Ullrich, Sebastian. The Lean 4 theorem prover and programming language. Automated Deduction – CADE 28, vol. 12699, pp. 625–635. 2021DOI
- Jimbo, Shuji; Maruoka, Akira. A method of constructing selection networks with depth. SIAM J. Comput., vol. 25, no. 4. 1996DOI
- Karpiński, Michał; Piotrów, Marek. Smaller selection networks for cardinality constraints encoding. Principles and Practice of Constraint Programming (CP 2015). 2015. arXiv:1502.04551arXivDOI
- Knuth, Donald E. Errata for The Art of Computer Programming, Vol. 3, second edition. Entries of 12 September 2003: replacement of exercise 5.3.4–20 and its answer. https://www-cs-faculty.stanford.edu/~knuth/taocp.htmllink
- Knuth, Donald E. The Art of Computer Programming, Vol. 3: Sorting and Searching. Addison-Wesley. 1998
- Pippenger, Nicholas. Selection networks. SIAM J. Comput., vol. 20, no. 5, pp. 878–887. 1991DOI
- Qu, Yicheng; Tasbihi, Amir; Kschischang, Frank R. Constituent automorphism decoding of Reed–Muller codes. IEEE Trans. Commun. 2025. arXiv:2409.03700arXivDOI
Show all 16 referencesShow fewer references
- Tomar, Tejasvi Singh. Lead-pattern potentials and exact values of merging networks. 2026. Zenodo, version 5, doi:10.5281/zenodo.23756850 (https://doi.org/10.5281/zenodo.23756850)link
- Tomar, Tejasvi Singh. Lean development for ``Exact sizes of networks that select the three or four largest of elements''. 2026. Zenodo, doi:\leandoi (https://doi.org/\leandoi)link
- Tomar, Tejasvi Singh. Supplement to ``Exact sizes of networks that select the three or four largest of elements''. 2026. Checksum file \textttSHA256SUMS with SHA-256 hash \texttt\suppsums\dots. Zenodo, doi:\suppdoi (https://doi.org/\suppdoi)link
- Yao, Andrew C. Bounds on selection networks. 15th Annual Symposium on Switching and Automata Theory, pp. 110–116. 1974DOI
- Yao, Andrew C. Bounds on selection networks. SIAM J. Comput., vol. 9, no. 3, pp. 566–582. 1980DOI
- Yao, Andrew Chi-Chih. A Study of Concrete Computational Complexity. 1975. Report UIUCDCS-R-75-716
Version history
- v1 · 17 pagesSubmitted by Tejasvi Singh TomarPublished on Zenodo: https://doi.org/10.5281/zenodo.23801189CurrentNov 12, 2026