arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.21591cs.DS
收藏

从有向无环图中获得更简单的最优排序

Simpler Optimal Sorting from a Directed Acyclic Graph

Technical University of Denmark, DTU(丹麦技术大学)

Ivor van der Hoog, Eva Rotenberg, Daniel Rutschmann

AI总结:

本文提出了一种基于有向无环图的简单最优排序算法,通过结合拓扑排序与堆排序,以更简洁的方式实现线性扩展数的最优查询和运行时间。

摘要:

Fredman于1976年提出了一个算法问题:给定一个 ground set X,某些 partial order P over X,以及一个 comparison oracle O_L,该 oracle 指定一个 linear order L over X,该 order extends P。对 O_L 的查询以 distinct x, x' ∈ X 为输入,并输出 x <_L x' 或相反。如果用 e(P) 表示 P 的线性扩展数目,则 log e(P) 是输出 X 排序顺序所需查询次数的最坏情况下限。Fredman 没有指定 partial order 是以何种形式给出的。Haeupler, Hladík, Iacono, Rozhon, Tarjan, 和 Tětek('24)提出假设输入是一个有向无环图 G,具有 m 条边和 n = |X| 个顶点。用 P_G 表示由 G 诱导的偏序。算法性能以运行时间和查询次数衡量,他们使用 Θ(m + n + log e(P_G)) 的时间和 Θ(log e(P_G)) 的查询次数来输出 X 的排序顺序。他们的算法在运行时间和查询次数上都是最坏情况最优的。他们的算法结合了拓扑排序与堆排序。他们的分析依赖于使用熵的复杂计数论证、递归定义的集合以及他们在图中识别出的排序瓶颈顶点。在本文中,我们摒弃了复杂性。我们证明当输入是一个有向无环图时,该问题允许一个简单的解决方案,使用 Θ(m + n + log e(P_G)) 的时间和 Θ(log e(P_G)) 的查询次数。尤其是我们的证明更加简单,因为我们避免了使用高级收费论证和数据结构,而是依赖于两个简短的观察。

英文摘要:

Fredman proposed in 1976 the following algorithmic problem: Given are a ground set $X$, some partial order $P$ over $X$, and some comparison oracle $O_L$ that specifies a linear order $L$ over $X$ that extends $P$. A query to $O_L$ has as input distinct $x, x' \in X$ and outputs whether $x <_L x'$ or vice versa. If we denote by $e(P)$ the number of linear extensions of $P$, then $\log e(P)$ is a worst-case lower bound on the number of queries needed to output the sorted order of $X$. Fredman did not specify in what form the partial order is given. Haeupler, Hladík, Iacono, Rozhon, Tarjan, and Tětek ('24) propose to assume as input a directed acyclic graph, $G$, with $m$ edges and $n=|X|$ vertices. Denote by $P_G$ the partial order induced by $G$. Algorithmic performance is measured in running time and the number of queries used, where they use $Θ(m + n + \log e(P_G))$ time and $Θ(\log e(P_G))$ queries to output $X$ in its sorted order. Their algorithm is worst-case optimal in terms of running time and queries, both. Their algorithm combines topological sorting with heapsort. Their analysis relies upon sophisticated counting arguments using entropy, recursively defined sets defined over the run of their algorithm, and vertices in the graph that they identify as bottlenecks for sorting. In this paper, we do away with sophistication. We show that when the input is a directed acyclic graph then the problem admits a simple solution using $Θ(m + n + \log e(P_G))$ time and $Θ(\log e(P_G))$ queries. Especially our proofs are much simpler as we avoid the usage of advanced charging arguments and data structures, and instead rely upon two brief observations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑