Abstract
We present two 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). As a corollary, we obtain an O(n 2)-time algorithm for finding genealogical distances considerably improving the previously known O(n 2.575) time-bound for this problem.
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(n^{{2}+\frac{1}{4-\omega}})\), where ω =2.376 is the exponent of the fastest known matrix multiplication algorithm. This improves the previously known \(O(n^{\frac{\omega+3}{2}})\) time-bound for the general all-pairs LCA problem in dags.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Alon, N., Naor, M.: Derandomization, Witnesses for Boolean Matrix Multiplication and Construction of Perfect hash functions. Algorithmica 16, 434–449 (1996)
Bender, M.A., Pemmasani, G., Skiena, S., Sumazin, P.: Finding Least Common Ancestors in Directed Acyclic Graphs. In: Proc. the 12th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 845–853 (2001)
Galil, Z., Margalit, O.: Witnesses for Boolean Matrix Multiplication and Shortest Paths. Journal of Complexity, 417–426 (1993)
Cottingham Jr., R.W., Idury, R.M., Shäffer, A.A.: Genetic linkage computations. American Journal of Human Genetics 53, 252–263 (1993)
Nykänen, M., Ukkonen, E.: Finding lowest common ancestors in arbitrarily directed trees. Inf. Process. Lett. 50(6), 307–310 (1994)
Shäffer, A.A., Gupta, S.K., Shriram, K., Cottingham Jr., R.W.: Avoiding recomputation in linkage analysis. Human Heredity 44, 225–237 (1994)
Tarjan, R.E.: Applications of path compression on balanced trees. Journal of the ACM 26(4), 690–715 (1979)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kowaluk, M., Lingas, A. (2005). LCA Queries in Directed Acyclic Graphs. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds) Automata, Languages and Programming. ICALP 2005. Lecture Notes in Computer Science, vol 3580. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11523468_20
Download citation
DOI: https://doi.org/10.1007/11523468_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-27580-0
Online ISBN: 978-3-540-31691-6
eBook Packages: Computer ScienceComputer Science (R0)