Skip to content

Generalized Sorting via Four-Cycles

Soheil Behnezhad, Shane Ferrante

cs.DS

Abstract

We study the generalized sorting problem where only a subset of the pairs can be compared. Equivalently, we are given an nn-vertex mm-edge graph G=(V,E)G=(V, E) where the vertex set VV is to be sorted, and the edge set EE indicates possible comparisons. The goal is to sort VV with as few (adaptive) queries to EE as possible. When GG is the complete graph, the problem is equivalent to standard sorting for which Θ(nlog⁡n)Θ(n \log n) queries are sufficient and necessary. All classical sorting algorithms crucially rely on the ability to compare any pair and do not imply an o(n2)o(n^2)-query algorithm in the general case. This was improved 15 years ago by Huang, Kannan, and Khanna [FOCS'11] who achieved a bound of O~(nn)\widetilde{O}(n\sqrt{n}). Kuszmaul and Narayanan [FOCS'21] later gave a bound of O~(mn)\widetilde{O}(\sqrt{m n}), which is more efficient for sparse graphs, but matches the O~(nn)\widetilde{O}(n\sqrt{n}) barrier for dense graphs. In this paper, we present an algorithm for generalized sorting that makes at most O~(n4/3)\widetilde{O}(n^{4/3}) queries, therefore breaking the longstanding O~(nn)\widetilde{O}(n\sqrt{n}) barrier for all graphs. The key to our result is to query edges that belong to many (specific types of) four-cycles. We show that querying such edges allows the algorithm to verify the direction of many other edges (specifically, their opposing edges in the four-cycles) and thus achieve a much better amortized query cost.

Create a lesson

Metadata

Comments
22 pages, 2 figures