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 a natural approach that solves the all-pairs LCA problem for the input dag in time O(nm). The ...
more >>>