Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
427655 | Information Processing Letters | 2010 | 5 Pages |
Abstract
We derive a new generalization of lowest common ancestors (LCAs) in dags, called the lowest single common ancestor (LSCA). We show how to preprocess a static dag in linear time such that subsequent LSCA-queries can be answered in constant time. The size is linear in the number of nodes.We also consider a “fuzzy” variant of LSCA that allows to compute a node that is only an LSCA of a given percentage of the query nodes. The space and construction time of our scheme for fuzzy LSCAs is linear, whereas the query time has a sub-logarithmic slow-down. This “fuzzy” algorithm is also applicable to LCAs in trees, with the same complexities.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics