English

Simpler Optimal Sorting from a Directed Acyclic Graph

Data Structures and Algorithms 2026-02-10 v6

Abstract

Fredman proposed in 1976 the following algorithmic problem: Given are a ground set XX, some partial order PP over XX, and some comparison oracle OLO_L that specifies a linear order LL over XX that extends PP. A query to OLO_L has as input distinct x,xXx, x' \in X and outputs whether x<Lxx <_L x' or vice versa. If we denote by e(P)e(P) the number of linear extensions of PP, then loge(P)\log e(P) is a worst-case lower bound on the number of queries needed to output the sorted order of XX. Fredman did not specify in what form the partial order is given. Haeupler, Hlad\'ik, Iacono, Rozhon, Tarjan, and T\v{e}tek ('24) propose to assume as input a directed acyclic graph, GG, with mm edges and n=Xn=|X| vertices. Denote by PGP_G the partial order induced by GG. Algorithmic performance is measured in running time and the number of queries used, where they use Θ(m+n+loge(PG))\Theta(m + n + \log e(P_G)) time and Θ(loge(PG))\Theta(\log e(P_G)) queries to output XX in its sorted order. Their algorithm is worst-case optimal in terms of running time and queries, both. Their algorithm combines topological sorting with heapsort. Their analysis relies upon sophisticated counting arguments using entropy, recursively defined sets defined over the run of their algorithm, and vertices in the graph that they identify as bottlenecks for sorting. In this paper, we do away with sophistication. We show that when the input is a directed acyclic graph then the problem admits a simple solution using Θ(m+n+loge(PG))\Theta(m + n + \log e(P_G)) time and Θ(loge(PG))\Theta(\log e(P_G)) queries. Especially our proofs are much simpler as we avoid the usage of advanced charging arguments and data structures, and instead rely upon two brief observations.

Keywords

Cite

@article{arxiv.2407.21591,
  title  = {Simpler Optimal Sorting from a Directed Acyclic Graph},
  author = {Ivor van der Hoog and Eva Rotenberg and Daniel Rutschmann},
  journal= {arXiv preprint arXiv:2407.21591},
  year   = {2026}
}
R2 v1 2026-06-28T17:59:19.314Z