and with a nave algorithm. We compare the performance of these algorithms as a function of the number of queries performed and the imbalance of the tree. For DAGs, we compare a transitive-closure based algorithm, an intelligent traversal algorithm, and our input-sensitive algorithm that uses LCA in trees. We compare the performance of these algorithms as a function of DAG density. We show that the input-sensitive algorithm outperforms the other two algorithms on all test data. Keywords: Least Common Ancestor (LCA), Directed Cyclic Graph (DAG), Range Minimum Query (RMQ), Shortest Path, Cartesian Tree, Genealogy, Pedigree, Data Structure. 1. INTRODUCTION One of the fundamental algorithmic problems on trees is how to nd the least common ancestor (LCA) of a given pair of nodes. The LCA of nodes u and v in a tree is the ancestor of u and v that is located farthest from the root. The