An algorithm on weighted graphs is called universally optimal if it is optimal for every input graph, in the worst case taken over all weight assignments. Informally, this means the algorithm is competitive even with algorithms that are optimized for only one specific input graph. Universal optimality was recently introduced [Haeupler et al. 2024] as an alternative to the stronger, but often unachievable instance optimality. In this paper, we extend the concept of universal optimality to data structures. In particular, we investigate the following dynamic graph problem: Given a vertex-weighted forest, maintain the minimum-weight vertex of every tree under edge deletions. The problem requires $Θ(\log n)$ amortized time per operation in general, but only $O(1)$ time if the initial forest is a path. We present a data structure that has optimal total running time for every fixed initial forest and every fixed number of operations/queries $m$, when taking the worst case over all weight assignments and operation sequences of length $m$. This definition of universal optimality is easily adapted to other data structure problems. Our result combines two techniques: (1) A decomposition of the input into paths, to take advantage of the $O(1)$-time path-specific data structure; and (2) splay trees [Sleator and Tarjan 1985], which, informally speaking, are used to optimally handle a certain sorting-related subproblem. We apply our data structure to solve problems related to Cartesian trees, path minimum queries, and bottleneck vertex/edge queries, each with a certain universal optimality guarantee. Our data structure also can be modified to support edge weights instead of vertex weights. Further, it generalizes to support semigroup sum queries instead of minimum queries, in universally optimal time.
翻译:若一个加权图算法对于所有输入图,在考虑所有权重分配的最坏情况下都是最优的,则称其为普遍最优的。非正式地说,这意味着该算法即使与那些仅针对某一特定输入图进行优化的算法相比也具有竞争力。普遍最优性最近被提出[Haeupler et al. 2024],作为对更强但通常无法实现的实例最优性的一种替代。在本文中,我们将普遍最优性的概念扩展到数据结构。具体来说,我们研究以下动态图问题:给定一个顶点加权的森林,在边删除操作下维护每棵树的最小权重顶点。该问题在一般情况下每次操作需要$Θ(\log n)$的摊销时间,但如果初始森林是一条路径,则仅需$O(1)$时间。我们提出了一种数据结构,对于每个固定的初始森林和固定的操作/查询次数$m$,当考虑所有长度为$m$的权重分配和操作序列的最坏情况时,该结构具有最优的总运行时间。这种普遍最优性的定义很容易适用于其他数据结构问题。我们的结果结合了两种技术:(1) 将输入分解为路径,以利用$O(1)$时间的路径特定数据结构;(2) 伸展树[Sleator and Tarjan 1985],非正式地说,它被用来最优地处理某个与排序相关的子问题。我们应用我们的数据结构来解决与笛卡尔树、路径最小值查询以及瓶颈顶点/边查询相关的问题,每种情况都具有某种普遍最优性保证。我们的数据结构也可以修改为支持边权重而非顶点权重。此外,它可以推广到支持半群和查询而非最小值查询,并在普遍最优的时间内完成。