Stochastic and Worst-Case Generalized Sorting Revisited
Abstract
The \emph{generalized sorting problem} is a restricted version of standard comparison sorting where we wish to sort elements but only a subset of pairs are allowed to be compared. Formally, there is some known graph on the elements , and the goal is to determine the true order of the elements using as few comparisons as possible, where all comparisons must be edges in . We are promised that if the true ordering is for an unknown permutation of the vertices , then for all : this Hamiltonian path ensures that sorting is actually possible. In this work, we improve the bounds for generalized sorting on both random graphs and worst-case graphs. For Erd\H{o}s-Renyi random graphs (with the promised Hamiltonian path added to ensure sorting is possible), we provide an algorithm for generalized sorting with an expected comparisons, which we prove to be optimal for query complexity. This strongly improves over the best known algorithm of Huang, Kannan, and Khanna (FOCS 2011), which uses comparisons. For arbitrary graphs with vertices and edges (again with the promised Hamiltonian path), we provide an algorithm for generalized sorting with comparisons. This improves over the best known algorithm of Huang et al., which uses comparisons.
Keywords
Cite
@article{arxiv.2111.07222,
title = {Stochastic and Worst-Case Generalized Sorting Revisited},
author = {William Kuszmaul and Shyam Narayanan},
journal= {arXiv preprint arXiv:2111.07222},
year = {2021}
}