Generalized sorting improved to near optimal efficiency

Generalized Sorting within an $O(\log\log n)$ Factor of Optimal

Data Structures and Algorithms

Summary

Generalized sorting is about figuring out the correct order of items when you can only compare certain pairs, not all. Previous methods could do this with lots of comparisons, which takes time. The authors refined earlier techniques and made it much faster, needing far fewer comparisons overall. Their approach gets really close to the best possible number of comparisons needed in the worst case.

What this means in practice

  • For database engineers: Optimize sorting data when only partial comparisons constrained by data links are possible, improving query performance.
  • For network protocol developers: Design faster ordering mechanisms for network nodes when communication is limited to specified connections.

Authors

Majid Daliri, Lester Mackey

Abstract

In generalized sorting (Huang, Kannan, and Khanna, FOCS, 2011), one aims to order a set of $n$ vertices using a restricted set of comparisons specified by a known graph. The near-optimal algorithm of Khanna, Putterman, and Song (2026) solves this problem with $O(n \log^4 n)$ expected comparisons whenever the hidden order is identifiable. We refine their method for predicting edge directions to recover the hidden order using $O(n\log n\log\log n)$ expected comparisons. This brings the upper bound within a factor of $O(\log\log n)$ of the worst-case lower bound.