Generalized sorting: is n·polylog n comparisons enough, and what is the exact complexity?
On this page15 sections
Difficulty 28: a complete claimed randomized O(n log^4 n) algorithm exists, so the question of Huang, Kannan and Khanna may be settled once it is checked, but it is an unrefereed preprint under two days old, and the O(n log n) question, deterministic algorithms and lower bounds above n log n remain open; rated slightly above the AKPW spanning-tree entry (22) because more parts stay open. Application value 12: indirect, sharpens query-complexity techniques; direct uses (restricted or costly comparisons) are niche. Leverage 15: a few results in one subfield, restricted-comparison sorting and sorting with predictions.
The problem
Sorting when only some pairs can be compared: can it be nearly as cheap as ordinary sorting? An unrefereed 2026 claim says yes.
- 1Only some pairs may be compared
- 2Ordinary sorting costs about n log n
- 32011 best method: about n to the 3/2
- 4Nov 2026 preprints claim near-linear
- 5Log factors, determinism still open
The setup. There are items with a hidden ranking from smallest to largest, a total order. You also have a graph : the items are its vertices, and an edge between two items means you may ask which of the two is smaller. You never learn anything about a pair that is not an edge. The graph is promised to contain a Hamiltonian path that visits the items in sorted order; this guarantees that the ranking can be recovered at all. Your cost is the number of questions (comparisons), which you may choose one at a time depending on earlier answers. If has every edge, this is ordinary sorting, which needs about comparisons, and no method can beat that. This lower bound is the only one known for the general problem.
The question. For the worst graph, how many comparisons are needed? Asking about every edge costs , the number of edges, which can be near . In 2011 Huang, Kannan and Khanna gave a randomized method using about comparisons ( hides logarithmic factors) and asked whether the true cost must be at least for some fixed . Kuszmaul and Narayanan (2021) improved the dependence on to , which does not help on dense graphs, and solved the case of random graphs with about comparisons.
The 2026 claims. Behnezhad and Ferrante (4 November) claim by asking about edges that lie on many four-cycles: each answer then lets you infer the direction of other edges in those cycles for free. Khanna, Putterman and Song (5 November) claim expected comparisons. Their idea has two stages. First, predict the direction of every edge: sample some edges, find an ordering consistent with the sampled answers, and repeat several passes to remove errors until the prediction is wrong on only about edges. Second, repair the prediction: an earlier algorithm of Lu, Ren, Sun and Zhang fixes a prediction with wrong edges using comparisons. Randomness enters through the sampling, so the bound is on the expected number of comparisons.
What stays open. Even if the claim is right, a gap of remains between and the lower bound . Nobody knows the best deterministic method (one with no random choices), or whether a fast program, not just a small number of questions, can reach near-linear cost; the new paper lists these as open. No lower bound above is known for any graph.
Status. Both papers are unrefereed. DARC lists the problem as OPEN, with the Khanna et al. result recorded as a claim under review.
Go deeper
The full technical text.
Items carry a hidden total order . A known undirected graph on the items contains the Hamiltonian path of , and a comparison of an edge of reveals which endpoint is smaller. Let be the least (expected, or worst-case for deterministic algorithms) number of comparisons that recovers , and over -vertex graphs. Huang, Kannan and Khanna asked whether for some constant . The problem listed here asks for the full picture: is , and what is its exact order? In particular, do comparisons suffice for every graph (the only general lower bound is ), what is the deterministic complexity, and can near-linear comparison counts be reached by polynomial-time algorithms?
Words on this page (9)
- graph
- A set of points (vertices) with some pairs joined by lines (edges).
- total order
- A ranking in which any two items can be compared, so every item has a definite place in a single line.
- comparison sort
- A sorting method that learns the order only by asking which of two items is smaller.
- Hamiltonian path
- A route through a graph that visits every vertex exactly once.
- big-O notation
- A way to say how fast a quantity grows, ignoring constant factors; O(n log n) grows far slower than n squared.
- randomized algorithm
- A method that makes random choices, so its cost is judged on average over those choices.
- sorting algorithm
- A procedure that rearranges a list into order, such as smallest to largest.
- preprint
- A research paper shared publicly before independent experts have reviewed it, so its claims are not yet confirmed.
- tilde-O
- Big-O with logarithmic factors hidden, so Õ(n^1.5) means n^1.5 times some power of log n.
New to this? Read first (4)
- Khanna, Putterman, Song, A Near-Optimal Generalized Sorting Algorithm (arXiv, unrefereed)The claimed result; the abstract is short and states the question it answers.
- Behnezhad, Ferrante, Generalized Sorting via Four-Cycles (arXiv, unrefereed)The other November 2026 claim, with a short description of the four-cycle idea.
- Kuszmaul, Narayanan, Stochastic and Worst-Case Generalized Sorting RevisitedIntroduces the problem and shows the random-graph case in detail.
- Comparison sort (Wikipedia)Why ordinary sorting needs about n log n comparisons.
Path to understanding
foundations → problemThe research entries this problem rests on, in the order to read them. Each links to its explainer.
- Start with
- Step 2
- Step 3
- Then
- Generalized sorting: is n·polylog n comparisons enough, and what is the exact complexity?The problem
State of the art
Accepted results. Huang, Kannan and Khanna (FOCS 2011) gave a randomized algorithm using comparisons and asked whether comparisons are necessary. Kuszmaul and Narayanan (FOCS 2021) proved for graphs with edges and an optimal expected bound for Erdos-Renyi graphs with a Hamiltonian path added. Lu, Ren, Sun and Zhang (2020) gave comparisons when a prediction with errors is available. The only general lower bound is the of ordinary sorting.
Claimed improvements (both unrefereed preprints). Behnezhad and Ferrante, arXiv:2611.06745 (v1, 4 November 2026), claim comparisons on every graph by querying edges that lie in many four-cycles. Khanna, Putterman and Song, arXiv:2611.08397 (v1, 5 November 2026), claim a randomized algorithm with expected comparisons on every graph, which would answer the Huang-Kannan-Khanna question negatively and leave a factor to the sorting lower bound. Their authors report that ChatGPT 6-Astra was essential to the bounds. DARC has not checked either argument, and as of 6 November 2026 the papers are one to two days old.
Why the problem stays open. Even if the 2026 claims hold, the following are not settled: whether comparisons suffice on every graph; the deterministic complexity (the new paper lists this as open); whether near-linear query counts are reachable in polynomial time (the algorithm is reported not to be); and any lower bound above for a specific graph family.
Realistic applications
Direct uses are limited: ranking items when only some pairs can be compared at all or comparisons are expensive, such as tournaments with restricted matchups or costly pairwise tests. The main value is methodological: predicting answers by sampling and then repairing the prediction is a pattern that may carry over to other query-complexity questions.
What counts as solved
A refereed or expert-accepted proof of an upper bound of comparisons on every graph (randomized and, separately, deterministic) together with a matching lower bound for some graph family, or a proof that comparisons are necessary. Acceptance of the 2026 preprint alone would settle the Huang-Kannan-Khanna question but not this problem.
How it gets verified
To verify: Expert reviewOnly expert review of the argument is possible today.
Expert review of the Khanna-Putterman-Song argument: the prediction-construction lemma (each phase orients at least half of the remaining edges with O(n) expected errors using O(n log^3 n) queries), the bipartite bounded-degree reduction, the error-isolation passes and the use of the Lu et al. prediction-repair algorithm, checked against the stated bound of O(n log^4 n) expected queries on every graph with a Hamiltonian path. In addition, a consistency check with the Behnezhad-Ferrante four-cycle algorithm, and an implementation that counts queries on adversarial graphs (which can falsify but not prove the bound). Refereed publication or acceptance by specialists in query complexity would settle the claim; the open remainder (O(n log n), determinism, lower bounds) needs new results.
Claims
Connected problems
No connected problems.
Progress
- Nov 5, 2026Claimed O(n log^4 n) comparisons (preprint)source
Khanna, Putterman and Song posted arXiv:2611.08397 (v1, 5 November 2026). Unrefereed; DARC has not checked it.
- Nov 4, 2026Claimed Õ(n^(4/3)) via four-cycles (preprint)source
Behnezhad and Ferrante posted arXiv:2611.06745 (v1, 4 November 2026). Unrefereed.
- Nov 14, 2021Õ(sqrt(mn)) comparisons; optimal for random graphssource
Kuszmaul and Narayanan (FOCS 2021) gave O(n log(np)) expected comparisons for random graphs and Õ(sqrt(mn)) in general.
- Oct 31, 2020Sorting with predictions: O(n log n + w)source
Lu, Ren, Sun and Zhang showed that a prediction of every edge with w errors can be repaired with O(n log n + w) comparisons, the tool later reused.
- Oct 1, 2011Generalized sorting in Õ(n^(3/2)) comparisonssource
Huang, Kannan and Khanna (FOCS 2011; the date is a placeholder for the symposium month) gave a randomized algorithm using about min(m, n^(3/2)) comparisons and asked whether n^(1+eps) is necessary. Bound as quoted in the later papers cited here.