Papers
Topics
Authors
Recent
Search
2000 character limit reached

Sorting under Partial Information with Optimal Preprocessing Time via Unified Bound Heaps

Published 14 Apr 2026 in cs.DS | (2604.12653v1)

Abstract: In 1972, Fredman proposes the problem of sorting under partial information: preprocess a directed acyclic graph $G$ with vertex set $X$ so that you can sort $X$ in $O(\log e(G))$ time, where $e(G)$ is the number of sorted orders compatible with $G$. Cardinal, Fiorini, Joret, Jungers and Munro [STOC'10] show that you can preprocess $G$ in $O(n{2.5})$ time and then sort $X$ in $O(\log e(G) + n)$ time and $O(\log e(G))$ comparisons. Recent work of van der Hoog and Rutschmann [FOCS'24] implies an algorithm with $O(nω)$ preprocessing time where $ω< 2.372$ and $O(\log e(G))$ sorting time. Haeupler, Hladík, Iacono, Rozhoň, Tarjan and Tětek [SODA'25] achieve an overall running time of $O(\log e(G) + m)$. In this paper, we achieve tight bounds for this problem: $O(m)$ preprocessing time and $O(\log e(G))$ sorting time. As a key ingredient, we design a new fast heap data structure that might be of independent theoretical interest.

Authors (1)

Summary

  • The paper introduces a novel unified bound heap that preprocesses DAGs in O(m) time and sorts items with O(log e(G)) comparisons, meeting information-theoretic lower bounds.
  • The methodology employs a multi-level tree structure with leader selection and bulk promotions to unify working set and time-finger bounds for adaptive performance.
  • The algorithm computes a topological order of a DAG and leverages the adaptive heap to avoid additional graph traversal, providing instance-optimal sorting under partial information.

Sorting under Partial Information: Optimal Preprocessing via Unified Bound Heaps

Problem Overview and Prior Work

The work addresses Fredman's classic sorting under partial information (SUPI) problem: Given a set XX of nn items with an unknown linear order LL, and a DAG GG over XX with edges certifying x<Lyx <_L y, the challenge is to preprocess GG to facilitate sorting XX using as few comparisons as possible, quantified by the information-theoretic lower bound Ω(loge(G))\Omega(\log e(G)) where e(G)e(G) is the count of linear extensions of nn0.

Classical polynomial-time algorithms either incurred suboptimal comparison costs or preprocessing overheads:

  • Early results (Fredman, Kahn-Kim) achieved optimal decision tree heights but required exponential-time preprocessing.
  • Cardinal et al. provided an nn1-preprocessing algorithm with nn2 queries and time in the sorting phase.
  • The fastest prior approach using van der Hoog and Rutschmann [HoogRutschmann24] reduced preprocessing to nn3 (with nn4) and optimal nn5 queries/time for sorting, assuming the partial order is already transitively closed.
  • Haeupler et al. obtained overall nn6 time for a DAG input, but the sorting phase included an nn7 term, hence not tight for sparse graphs.

The paper resolves the open question of achieving simultaneously optimal nn8 preprocessing time and nn9 sorting time (number of comparisons and computational time) for SUPI when LL0 is given as a DAG.

The Unified Bound Heap Data Structure

At the core of the result is a new heap structure, which supports a novel unified access bound. For a sequence of LL1 pushes and pops, where each item LL2 is pushed at time LL3 and popped at time LL4 (if ever), the cost to pop LL5 is:

LL6

Push is LL7 amortized, and the first pop is also LL8.

This unifies and strictly strengthens previously studied working set and time-finger bounds in heaps [iacono_improved_2000, elmasry_priority_2012], yielding adaptivity sensitive to both recency and "closeness" in insertion/popping time.

A key technical achievement is the construction of this heap: a nontrivial event as previous work shows that more direct analogues (e.g., using rank in the heap) are impossible without violating other efficiency desiderata [elmasry_priority_2012]. The authors design a multi-level tree structure blending main and index trees, carefully maintaining depth invariants via leader selection and grouping, and using bulk promotions to manage subtree minima efficiently.

Lemma: Any data structure with this unified bound also inherits the working set property, yielding amortized LL9 pop time where GG0 is the number of pushes since GG1's insertion.

Algorithm for Sorting under Partial Information

The SUPI algorithm (UniTopSort) proceeds in two phases:

  • Preprocessing: Compute a topological order of GG2 in GG3 time.
  • Sorting: Iterate over GG4 in topological order, pushing each item into the unified bound heap; repeatedly pop items to recover the sorted linear order.

Surprisingly, all graph structure beyond the topological order is only required for preprocessing, with the adaptive heap handling the sorting logic to achieve instance-optimal oracle query counts.

When GG5 is so small that GG6, i.e., GG7 contains a long path (almost sorted), the authors employ a reduction eliminating the GG8 additive term: partitioning out the path, sorting the remainder, and then merging in GG9 total time. This yields the final result:

Theorem: For any DAG XX0 on XX1, XX2 can be preprocessed in XX3 time so that, given XX4 extending XX5, XX6 can be sorted in XX7 comparisons and time.

Comparison to Prior SUPI Algorithms

The approach contrasts sharply with prior XX8-preprocessing, XX9-sorting solutions [haeupler2024fast], which used a different heap strategy guided by dynamic sources—inserting items as they became available and traversing adjacency lists during sorting. The proposed method pushes all items eagerly, leveraging the unified heap adaptivity to avoid further x<Lyx <_L y0 traversal after topological sorting, and incurs no dependence on x<Lyx <_L y1 in the sorting phase.

Alternative methods (e.g., using finger search trees [van_der_hoog_simpler_2025], merge/Huffman sort decompositions [cardinal_sorting_2013, HoogRutschmann24]) do not exploit self-adjusting heap dynamics and are structurally incompatible with the discussed optimal x<Lyx <_L y2 preprocessing and x<Lyx <_L y3 sorting time guarantees for DAG inputs.

Broader Implications and Future Directions

This result establishes sharp bounds, closing decades-long gaps for SUPI and providing the first heap with the unified bound for adaptivity. The unified bound heap is likely of independent combinatorial and algorithmic interest, with implications for adaptive data structures, instance-optimal algorithms in other domains (e.g., shortest paths [Haeupler24]), and potentially for progress on unified bounds for BSTs (dynamic optimality).

Several open questions are suggested:

  • Whether popular candidate structures like smooth heaps [kozma_smooth_2018] or pairing heaps match the unified bound.
  • Whether analogous unified bounds can be achieved for BST models, supporting conjectures about splay trees [iacono_alternatives_nodate].
  • Extensions to geometric and batch uncertainty models where SUPI-type reductions play a critical role (see, e.g., [van_der_hoog_preprocessing_2019, van_der_hoog_preprocessing_2022]), and whether the adaptive heap framework can accelerate preprocessing-bounded geometric computation after ambiguity is resolved.

Conclusion

The work provides a definitive solution to sorting under partial information for sparse DAGs, synthesizing a new heap structure with superior distribution-sensitive behavior and integrating it into an optimal SUPI algorithm with minimal preprocessing and information-theoretically minimal sorting cost. The techniques open prospects for new adaptive data structures and instance-optimal algorithms far beyond the SUPI setting.


Reference:

"Sorting under Partial Information with Optimal Preprocessing Time via Unified Bound Heaps" (2604.12653)

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.