arXiv Science⌕ Search

arXiv · 2612.00043

Tight Comparison Bounds for Stable Sorting with Predicted Repetitions and Bounded Lookahead

Abstract

With a strict comparator, verifying $x=y$ takes two comparisons. We study stable sorting under prefix deadlines: the order of the first $i$ records must be determined before any record beyond position $i+L$ is compared. An untrusted schedule predicts, for each later record, which of the first $q$ records shares its key. Even with correct predictions, schedules with equal label frequencies can require $n+o(n)$ or $2n-o(n)$ comparisons. A packing quantity explains this gap: for each label $c$, let $P_c$ be the largest number of its predicted positions pairwise more than $L$ apart. With at most $e$ wrong predictions and $Q=q+e$, the optimal worst-case comparison count is $n-1+\log_2(Q!)+\sum_c P_c-\mathbf{1}_{e=0}\min_c P_c+O(Q)$ for every schedule and lookahead $L$. The lower bound counts deadline-forced cycles in the comparison graph. The algorithm verifies all predicted equalities except for the largest key, whose records it only checks to be nondecreasing; one early new maximum cancels this saving. Without a schedule, a sorter can learn a repeated permutation from the keys; at zero lookahead, one new maximum raises its leading coefficient from $2-1/q$ to $2$. If each key's successor is predicted from its previous occurrence with $E$ mistakes, lookahead $\lceil\sqrt n\,\rceil$ suffices for $n+o(n)$ comparisons when $q(E+1)=o(n)$, while $o(\sqrt n)$ forces $2n-o(n)$. On two 32,768-record inputs, our implementation is within 3 and 7 comparisons of the optimum.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Shunqi Lu. 2026-11-27. Tight Comparison Bounds for Stable Sorting with Predicted Repetitions and Bounded Lookahead. https://arxiv.science/abs/2612.00043

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

FPT Parameterisations of Fractional and Generalised Hypertree Width

We present the first fixed-parameter tractable (FPT) algorithms for exact computation of generalized hypertree width (ghw) and fractional hypertree width (fhw). Our algorithms are parameterized by the target width, the rank, and the maximum degree of the input hypergraph. More generally, we show that testing f-width is in FPT for a broad class of width functions that we call manageable. This class contains the edge cover number $ρ$ and its fractional relaxation $ρ^*$, and thus covers both generalized and fractional hypertree width. We additionally extend our framework to also obtain an fpt algorithm for computing a discretized version of adaptive width. Our approach extends a recent algorithm for treewidth (Bojańcyk & Pilipczuk, LMCS 2022) that utilises monadic second-order transductions. To extend this idea beyond treewidth we develop new combinatorial machinery around elimination forests in hypergraphs, culminating in a structural normal form for optimal witnesses that makes transduction-based optimisation applicable in the much more general context of manageable width functions. This yields the first exact FPT algorithms for these measures under any nontrivial parameterisation and provides structural tools that may enable more direct optimisation algorithms

cs.DS↗

Approximation and parameterized algorithms for covering disjointness-compliable set families

Balancing charges in Generalized Point-to-Point Connection (GP2P) and meeting group quotas at several roots are instances of the same problem: covering a disjointness-compliable set family. An $α$-approximation for the restricted one-terminal problem in each residual instance gives a greedy $\max\{2,α\}H_τ$-approximation for $τ$ terminals. For edge costs, Zhao and Xiao subsequently reduced the logarithmic loss to a constant multiplier. For node costs we prove the harmonic bound with a deterministic oracle. Logarithmic loss is then unavoidable even when the one-terminal problem is a shortest path. In $O^*(3^τ)$ time we solve proper families exactly and obtain ratio $α+1$ when overlapping feasible components with disjoint terminal sets have feasible union. This condition holds for the multiroot applications. For Multiroot Quota Tree we obtain the one-root ratio in the same time. For GP2P, rooted Quota Tree is already the case of one negative node. Conversely, on general graphs we can approach any fixed deterministic one-root approximation ratio arbitrarily closely in fixed-parameter time in the number of components containing a negative node in an optimum. This gives a $(2+ε)$-approximation for every fixed $ε>0$.

cs.DS↗

Finite Pinwheel Covering

In perpetual scheduling theory, the Pinwheel Covering problem asks, given $n$ frequencies $f_i$, whether there exists an infinite schedule such that every $f_i$ consecutive entries contain at most one occurrence of $i\in [n]$. This models $n$ agents taking turns at executing a job, with a recovery period before working again. Pinwheel Covering is, in a sense, the dual of Pinwheel Packing (also known as Pinwheel Scheduling), which similarly asks for at least one occurrence of $i$ in every $f_i$ consecutive entries. The complexity of both problems is a major open question: both are known to be in PSPACE, but PSPACE-hardness remains unknown. Recently, a finite version of Pinwheel Packing requiring only $k$ occurrences of $i\in [n]$ was introduced by [Kanellopoulos et al., SODA 2026] and proven to be strongly NP-complete. In this work we introduce $k$-Visits Covering, the analogous finite version of Pinwheel Covering, establishing strong NP-completeness even for $k=2$. As a corollary, we obtain that a generalization of Pinwheel Covering with varying frequencies is strongly NP-hard. To the best of our knowledge, this is the first strong NP-hardness result in the covering setting. We complement these results with a linear-time algorithm for $2$-Visits Covering with two distinct frequencies and a randomized polynomial-time algorithm when the number of distinct frequencies is constant. Lastly, we study the density thresholds of $k$-Visits Covering and prove that no non-trivial density bounds exist, contrasting the finite packing version.

cs.DS↗