ε-halvers need (1 + κ (1 - 2ε)/2 - o(1)) n comparators #
A comparator network (ComparatorNetwork n s) on n wires applies s comparators in order;
comparator c puts the smaller of the values on its two distinct wires on minWire c and the
larger on maxWire c. It is an ε-halver (ComparatorNetwork.IsHalver) when on every input
in {0, 1}ⁿ with k ≤ n/2 ones at most ε k ones end in the bottom half (the wires
w < ⌊n/2⌋), and on every input with k ≤ n/2 zeros at most ε k zeros end in the top half.
For every 0 ≤ ε < 1/2 and δ > 0, and all large n, every ε-halver on n wires has at least
(1 + κ (1 - 2ε)/2 - δ) n comparators (eventually_le_size_of_isHalver), where
κ = π/(3 arccos((1 + 2√2)/4)) ≈ 3.5625 is 1/(2p) for the Gaussian edge-score pathwidth
coefficient p. As ε → 0 this is about 2.78 n; at ε = 1/10 about 2.43 n. With the rational
ordering coefficient 9/32 ≥ 2p it is at least (1 + 16 (1 - 2ε)/9 - δ) n, and with the
Fomin–Høie coefficient 1/3 it is (1 + 3 (1 - 2ε)/2 - δ) n. Ajtai, Komlós and Szemerédi (1983)
build ε-halvers of linear size from expanders, and Seiferas (Sorting networks of logarithmic
depth, further simplified, Algorithmica 53, 2009) and Paterson (Improved sorting networks with
O(log N) depth, Algorithmica 5, 1990) study their depth and size from above; no size lower bound
for ε-halvers beyond the trivial n - 1 of connectivity (IsHalver.le_add_one) was found in the
literature.
- The wire graph (
ComparatorNetwork.wireGraph). Every wire runs from an input terminal through the ends of the comparators acting on it to an output terminal; each comparator adds a link between its two ends. The graph is loopless with maximum degree three (wireGraph_loopless,wireGraph_maxDegreeLE), with2 n + 2 svertices andn + 3 sedges, so edges minus vertices iss - n. - Token conservation (
sub_le_card_cut). On a0-1input, a wire segment carries the value of its wire and a link carries the one that moves fromminWire ctomaxWire c. The flow is conserved at every comparator end, so for every vertex setLand inputsx,x', the cut ofLhas at leastnet x - net x'edges, wherenet ycounts the ones ofyat input terminals inLminus the ones of the output at output terminals inL. - Connectivity (
IsHalver.wireGraph_connected). A set of0 < k ≤ n/2wires closed under the comparators would keep its indicator input, and that of its complement, fixed, so anε-halver would put at mostε kof its wires in each half; forε < 1/2the closed sets are trivial (IsHalver.eq_empty_or_eq_univ_of_closed) and the wire graph is connected. - The cut lemma (
IsHalver.exists_le_card_cut). In any linear order of the vertices, take the lower setLwith exactlyh = ⌊n/2⌋input terminals, and letτtop output terminals lie inL. Ones on the inputs inLleave at mostε hones in the bottom half, sonet ≥ h - τ - ε h; zeros on the inputs inLleave at mostε hzeros in the top half, sonet ≤ ε h - τ. The cut ofLhas at least(1 - 2 ε) hedges. - Ordering bound. The graph-ordering hypothesis
OrderingBound A η Cthen gives(1 - 2ε) ⌊n/2⌋ ≤ (A + η) (s - n)⁺ + 3 log₂ (2 n + 2 s) + C(IsHalver.le_of_orderingBound), and sos ≥ (1 + (1 - 2ε)/(2A) - δ) nfor largen.
The network commutes with monotone maps. For a monotone f, evaluating on f ∘ x gives
f applied to the output on x. Taking f a threshold map to Bool, this is the 0-1
principle behind the 0-1 form of the halver property.
The wire graph has 2 n + 2 s vertices: two terminals per wire and two ends per
comparator.
The wire graph has n + 3 s edges: n + 2 s wire segments and s links.
The wire graph has no loops.
The wire graph has maximum degree three.
Token conservation. For inputs x and x' in {0, 1}ⁿ and a vertex set L, the cut of
L in the wire graph has at least net x - net x' edges, where net y is the number of ones of
y at input terminals in L minus the number of ones of N.eval y at output terminals in
L.
Closed sets of wires are trivial. For an ε-halver with ε < 1/2, every set of wires
closed under the comparators (each comparator has both wires in it or neither) is empty or all
wires.
The wire graph of an ε-halver with ε < 1/2 is connected.
The trivial bound. An ε-halver with ε < 1/2 on n wires has at least n - 1
comparators.
The cut lemma. Every linear order of the vertices of the wire graph of an ε-halver has
a lower set whose cut has at least (1 - 2 ε) ⌊n/2⌋ edges.
The finite bound. Under the graph-ordering hypothesis OrderingBound A η C, an
ε-halver with ε < 1/2 on n wires with s comparators satisfies
(1 - 2 ε) ⌊n/2⌋ ≤ (A + η) (s - n)⁺ + 3 log₂ (2 n + 2 s) + C.
Comparators from a general ordering coefficient. If A > 0 and every slack η > 0
admits a constant C with OrderingBound A η C, then for every 0 ≤ ε < 1/2, every δ > 0,
and all large n, every ε-halver on n wires has at least (1 + (1 - 2ε)/(2A) - δ) n
comparators.
ε-halvers need (1 + κ (1 - 2ε)/2 - o(1)) n comparators. For every 0 ≤ ε < 1/2, every
δ > 0, and all large n, every ε-halver on n wires has at least (1 + κ (1 - 2ε)/2 - δ) n
comparators, where κ = π/(3 arccos((1 + 2√2)/4)) ≈ 3.5625: about 2.78 n as ε → 0.
ε-halvers need (1 + 16 (1 - 2ε)/9 - o(1)) n comparators. The rational form of
eventually_le_size_of_isHalver, from the ordering coefficient 9/32 ≥ 2p: at least
(25/9 - δ) n comparators as ε → 0.
The cubic pathwidth coefficient. With the Fomin–Høie ordering coefficient 1/3, every
ε-halver on n wires has at least (1 + 3 (1 - 2ε)/2 - δ) n comparators for all large n.