This work considers the (lowest) common ancestor problem in weighted \\directed acyclic graphs. \\The minimum-weight (lowest) common ancestor of two vertices is the vertex \\ among the set of (lowest) common ancestors with the\\ smallest ancestral distance. For the all-pairs minimum-weight common\\ ancestor problem we present an O(nm) algorithm for arbitrary edge weights\\ which is optimal for sparse graphs and an O(n^2.575) algorithm for dense\\ graphs with moderately bounded edge weights based on matrix multiplication.\\ The presented solutions to the all-pairs minimum-weight lowest common\\ ancestor problem are based upon solutions of the all-pairs all lowest common\\ ancestors problem in unweighted graphs, which represents an upper bound. For\\ the all-pairs all lowest common ancestors problem we give an O(nm k^2)\\ algorithm, with k the bound on the maximum number of lowest common ancestors\\ for pairs, and an O(nm width(G)) algorithm, where width(G) is the size of\\ the largest antichain (independent set) in the transitive closure of G. \\The ideas are applicable for fast matrix multiplication implying an O(n^3.616) algorithm.
«