...
首页> 外文期刊>Theoretical computer science >Faster algorithms for finding lowest common ancestors in directed acyclic graphs
【24h】

Faster algorithms for finding lowest common ancestors in directed acyclic graphs

机译:在有向非循环图中找到最低共同祖先的更快算法

获取原文
获取原文并翻译 | 示例
   

获取外文期刊封面封底 >>

       

摘要

We present two new methods for finding a lowest common ancestor (LCA) for each pair of vertices of a directed acyclic graph (dag) on n vertices and m edges. The first method is surprisingly natural and solves the all-pairs LCA problem for the input dag on n vertices and m edges in time O(nm). The second method relies on a novel reduction of the all-pairs LCA problem to the problem of finding maximum witnesses for Boolean matrix product. We solve the latter problem (and hence also the all-pairs LCA problem) in time O(n2+λ), where λ satisfies the equation ω(1,λ,1)=1+2λ and ω(1,λ,1) is the exponent of the multiplication of an n×nλ matrix by an nλ×n matrix. By the currently best known bounds on ω(1,λ,1), the running time of our algorithm is O(n2.575). Our algorithm improves the previously known O(n2.688) time-bound for the general all-pairs LCA problem in dags by Bender et al. Our additional contribution is a faster algorithm for solving the all-pairs lowest common ancestor problem in dags of small depth, where the depth of a dag is defined as the length of the longest path in the dag. For all dags of depth at most h≤nα, where α≈0.294, our algorithm runs in a time that is asymptotically the same as that required for multiplying two n×n matrices, that is, O(nω); we also prove that this running time is optimal even for dags of depth 1. For dags with depth h>nα, the running time of our algorithm is at most O(nω·h0.468). This algorithm is faster than our algorithm for arbitrary dags for all values of h≤n0.42.
机译:我们提出了两种新方法,可找到n个顶点和m个边上有向无环图(dag)的每对顶点的最低公共祖先(LCA)。第一种方法出奇的自然,它解决了在时间O(nm)的n个顶点和m个边上的输入dag的全对LCA问题。第二种方法依赖于将所有对LCA问题简化为寻找布尔矩阵乘积的最大证人的问题。我们在时间O(n2 +λ)中解决了后者的问题(因此也解决了全对LCA问题),其中λ满足方程ω(1,λ,1)= 1 +2λ和ω(1,λ,1 )是n×nλ矩阵与nλ×n矩阵相乘的指数。根据ω(1,λ,1)上目前最著名的界限,我们算法的运行时间为O(n2.575)。我们的算法针对Bags等人在dags中的一般全对LCA问题改进了先前已知的O(n2.688)时限。我们的另一项贡献是在深度较小的dags中解决所有对的最低公共祖先问题的更快算法,其中dag的深度定义为dag中最长路径的长度。对于所有深度达h≤nα(α≈0.294)的算法,我们的算法的渐近运行时间与将两个n×n矩阵相乘所需的时间相同,即O(nω);我们还证明即使对于深度为1的dags,此运行时间也是最佳的。对于深度为h>nα的dags,我们算法的运行时间最多为O(nω·h0.468)。对于h≤n0.42的所有值,该算法比我们的任意dags算法更快。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号