A sorting network is a fixed arrangement of compare-and-exchange operations that performs sorting on every input. Each comparator reads two values, sends the smaller to one specified output wire, and sends the larger to the other. The pairs of wires compared and the direction of each comparator are fixed before the input values are known (Bose and Nelson 1962, Knuth 1998).
The size of a sorting network is the number of comparators. In a layered network the depth is the number of layers, with comparators in a layer acting on disjoint
pairs of wires. For example, the network on three wires that compares ,
, and
in that order, always sending the smaller value to the
lower-numbered wire, has size and depth 3.
By the zero-one principle, a comparator network sorts arbitrary inputs iff it sorts every input whose values are 0 or 1 (Knuth 1998). A threshold that maps each value to 0 or 1 in nondecreasing order commutes with each comparator. If the output contains an inverted pair, a threshold separating its two values produces an unsorted binary output.
Let
be the least number of comparators in a sorting network on
inputs. The Bose-Nelson sorting problem asks for
(Bose and Nelson 1962). Juillé (1995) constructed
a 45-comparator network on 13 inputs. Tomar (2026a) reports a computer-assisted lower
bound of 45 for this size, so
. The lower bound uses
an exhaustive search with a certificate. Tomar reports Lean kernel checks for both
the lower bound and the 45-comparator construction (Tomar 2026ab). These are results
about size.