Anytime Sorting Algorithms (Extended Version)
Emma Caizergues, François Durand, Fabien Mathieu
TL;DR
This work formalizes the problem of anytime sorting, where intermediate estimates of a sorted list must be produced after each $k$ comparisons and evaluated via Spearman's footrule. It introduces estimators that convert any comparison-based sort into an anytime algorithm, and proposes two new methods, Multizip sort and Corsort, to improve intermediate estimates and termination efficiency. Through extensive simulations, Corsort achieves a quasi-optimal performance profile with strong early estimates, while Multizip sort offers low termination overhead and robust intermediate results; ASort remains competitive for median-focused scenarios but with higher variance. The work provides open-source tooling and discusses practical considerations, highlighting Corsort as a strong empirical benchmark for future anytime sorting research, while noting the lack of a formal proof for Corsort’s average-case complexity and the extendability of the estimators to other sorting paradigms.
Abstract
This paper addresses the anytime sorting problem, aiming to develop algorithms providing tentative estimates of the sorted list at each execution step. Comparisons are treated as steps, and the Spearman's footrule metric evaluates estimation accuracy. We propose a general approach for making any sorting algorithm anytime and introduce two new algorithms: multizip sort and Corsort. Simulations showcase the superior performance of both algorithms compared to existing methods. Multizip sort keeps a low global complexity, while Corsort produces intermediate estimates surpassing previous algorithms.
