We explore the fundamental problem of sorting through the lens of learning-augmented algorithms, where algorithms can leverage possibly erroneous predictions to improve their efficiency. We consider two different settings: In the first setting, each item is provided a prediction of its position in the sorted list. In the second setting, we assume there is a "quick-and-dirty" way of comparing items, in addition to slow-and-exact comparisons. For both settings, we design new and simple algorithms using only $O(\sum_i \log \eta_i)$ exact comparisons, where $\eta_i$ is a suitably defined prediction error for the $i$th element. In particular, as the quality of predictions deteriorates, the number of comparisons degrades smoothly from $O(n)$ to $O(n\log n)$. We prove that the comparison complexity is theoretically optimal with respect to the examined error measures. An experimental evaluation against existing adaptive and non-adaptive sorting algorithms demonstrates the potential of applying learning-augmented algorithms in sorting tasks.
翻译:我们通过学习增强算法的视角探索排序这一基础问题,其中算法可利用可能存在误差的预测来提升效率。我们考虑两种不同场景:第一种场景中,每个元素被提供其在排序列表中位置的预测;第二种场景中,假设存在一种“快速粗略”的比较方式,以及慢速精确的比较方式。针对这两种场景,我们设计出新颖简洁的算法,仅需$O(\sum_i \log \eta_i)$次精确比较,其中$\eta_i$是第$i$个元素经过适当定义的预测误差。特别地,随着预测质量下降,比较次数从$O(n)$平滑退化至$O(n\log n)$。我们证明该比较复杂度在理论上对所述误差度量而言是最优的。与现有自适应和非自适应排序算法的实验评估表明,将学习增强算法应用于排序任务具有显著潜力。