cs.DS — Data Structures and Algorithms
Sorting networks on 13 inputs need 45 comparators
Let be the least number of comparators in a sorting network on inputs (the Bose–Nelson problem). We prove , so Juillé's network is optimal and . We also prove for , where is the least worst-case number of comparators met by the two largest inputs in a network that delivers them to fixed outputs, and is an explicit function of Van Voorhis. This proves the twenty tabulated lower bounds on for , which rested on an inequality of Van Voorhis whose published proof is invalid, and raises each of them by one. Both proofs use computer searches. Harder's method for applies Van Voorhis's one-value argument to the set of - vectors that a prefix of a network produces; for we extend the method from the largest value to the two largest. A search over prefixes bounds the rest of each network by deleting the comparators that the two largest, or the two smallest, inputs meet in it; the costs of the remaining sets are bounded using and exact values computed with Harder's program. The search writes a certificate, which is checked by a separate verifier and by a kernel-checked proof in Lean 4.