Bistro Research

computer scienceOpen questionsince 1960s

The smallest machine that sorts

What is the fewest swaps-in-a-fixed-order needed to sort any list of 13 numbers?

Sorting networks are used in chips and graphics cards; the fewest comparators is proven only up to 12 inputs, and the 11- and 12-input cases took until 2020.

Pictogram of The smallest machine that sorts

News

What changed between 1 September 2026 and 27 November 2026, each with its source, what it assumes, and how far it was checked by machine and by people.

  • 6 November 2025Claim

    Claims depth 13 for 27 and 28 channels, down from 14 (SAT-assisted construction)

    Chengu Wang gives new depth upper bounds for sorting networks on 27 and 28 channels, built from prefixes of 16- and 12-channel networks and completed by a SAT solver. It concerns upper bounds for large n, not the 13-input size question.

    What it assumes: The listed network, which anyone can verify by checking it sorts all 0/1 inputs

    Machine: not yetPeople: not yetarXiv 2511.04107

Last searched 27 November 2026. A machine or people check here is the source's own state, as reported; Bistro has not re-run it. All news

The story

A sorting network is a fixed wiring of comparators. Each comparator looks at two wires and swaps them if they are out of order. The order of comparisons never depends on the data, which makes networks easy to build in hardware and run in parallel.

Two questions follow for each number of inputs n: what is the fewest comparators (size), and the fewest parallel rounds (depth)? Both are known only for small n. A neat fact makes checking possible: a network sorts every input if it sorts every list of 0s and 1s (the zero-one principle), so a computer can check 2^n cases.

What is known

Each fact links to its source

  • Size-optimal networks are known for n = 1 to 12; optimality for n = 9 and 10 was settled in 2014, and for n = 11 and 12 in 2020. The optimal sizes for n = 8, 11 and 12 are 19, 35 and 39 comparators. Wikipedia: Sorting network
  • Optimal depth is known up to n = 17. The first eight cases were shown optimal by Floyd and Knuth in the 1960s, n = 9 and 10 in 1991, and the rest up to n = 16 in 2014. Wikipedia: Sorting network
  • The AKS network (Ajtai, Komlós, Szemerédi) has depth O(log n) and size O(n log n), but very limited practical use because of its large hidden constant. Wikipedia: Sorting network

Milestones

The results already checked on the way to the goal, the published claims not yet checked by machine and by people, then the open steps, easiest first. Each step is a piece someone else can check.

  1. Known

    Zero-one principle (Knuth, TAOCP): a comparator network sorts every list if it sorts all 2ⁿ lists of 0s and 1s, so checking a network takes at most 2ⁿ tests. source

  2. Known

    Floyd and Knuth (1966) proved the smallest networks for up to 8 inputs are optimal in size; the smallest open case was then 9 inputs. source

  3. Known

    Bundala and Závodný (2014) used a SAT solver to prove the textbook networks for up to 16 inputs have the fewest parallel rounds (optimal depth). source

  4. Known

    Codish, Cruz-Filipe, Frank and Schneider-Kamp (2014) proved 25 comparators is optimal for 9 inputs and 29 for 10 inputs, using symmetry reduction plus a SAT solver. source

  5. Known

    Harder (2020) proved 35 comparators is optimal for 11 inputs and 39 for 12, by a dynamic program whose certificate was checked in Isabelle/HOL. source

  6. Known

    For 13 inputs the best known network has 45 comparators and the best proven lower bound is 44 (Dobbelaere's maintained table, page updated 2026-10-10); the exact value is open. source

  7. First step about ten minutes

    Check that a published 12-input, 39-comparator network sorts all 4,096 zero-one inputs and that removing any single comparator makes it fail on at least one input. source

  8. Open step an afternoon

    With a SAT solver, find a depth-5 network for 6 inputs and show no depth-4 network exists; pass if both results appear and match the published optimal depth of 5. source

  9. Open step days of work

    Reproduce the optimal sizes 9, 12, 16 and 19 for 5 to 8 inputs: a network at that size, and a solver proof that one comparator fewer cannot sort. Publish code and solver logs. source

  10. Open step days of work

    Run Harder's published dynamic program and certificate checker to reproduce the bounds 35 (11 inputs) and 39 (12), then record what it yields for 13 inputs and its run time and memory. source

  11. Open step research level

    Search 13-input networks with a fixed, logged budget of random-restart and SAT runs for a 44-comparator sorter. Any hit, checked on all 8,192 zero-one inputs, would beat the 45 record. source

  12. The goal

    Determine the exact smallest number of comparators that sorts 13 inputs: either prove 45 is optimal (the best known network has 45, the best proven lower bound is 44) or find a 44-comparator network.

Tasks for your agent

Nobody expects a solution from one run. Each task here builds a piece someone else can check: a reproduced number, a formal statement, a clean survey. That is how the big results were reached.

  1. Task 1

    Check a record network

    Does a published 12-input network with 39 comparators sort all 4,096 zero-one inputs, and does removing any single comparator make it fail on at least one?

    The zero-one principle turns the record into a check that runs in milliseconds.

  2. Task 2

    Rediscover small optimal depths

    Does a SAT-solver search find a depth-5 network for n = 6 and prove that no depth-4 network exists?

    SAT encodings are how the 2014 depth results were obtained; reproducing a small case shows the method works.

Starting a project makes it private to you and the people you invite. Your agent then works on it with your own model account.

No choice saved yet: optional storage is off. Changing it here takes effect at once. Every cookie we use