All-Pairs LCA in DAGs: Breaking through the O(n2.5) barrier
Fabrizio Grandoni, Giuseppe F. Italiano, Aleksander Lukasiewicz, Nikos Parotsidis, Przemyslaw Uznanski
Abstract
Let G = (V, E) be an n-vertex directed acyclic graph (DAG). A lowest common ancestor (LCA) of two vertices u and v is a common ancestor w of u and v such that no descendant of w has the same property. In this paper, we consider the problem of computing an LCA, if any, for all pairs of vertices in a DAG. The fastest known algorithms for this problem exploit fast matrix multiplication subroutines and have running times ranging from (n2.687) [Bender et al. SODA'01] down to (n2.615) [Kowaluk and Lingas ICALP'05] and (n2.569) [Czumaj et al. TCS'07]. Somewhat surprisingly, all those bounds would still be Ω(n2.5) even if matrix multiplication could be solved optimally (i.e., ω = 2). This appears to be an inherent barrier for all the currently known approaches, which raises the natural question on whether one could break through the (n2.5) barrier for this problem. In this paper, we answer this question affirmatively: in particular, we present an for ω = 2) algorithm for finding an LCA for all pairs of vertices in a DAG, which represents the first improvement on the running times for this problem in the last 13 years. A key tool in our approach is a fast algorithm to partition the vertex set of the transitive closure of G into a collection of (ℓ) chains and (n/ℓ) antichains, for a given parameter ℓ. As usual, a chain is a path while an antichain is an independent set. We then find, for all pairs of vertices, a candidate LCA among the chain and antichain vertices, separately. The first set is obtained via a reduction to (max, min) matrix multiplication. The computation of the second set can be reduced to Boolean matrix multiplication similarly to previous results on this problem. We finally combine the two solutions together in a careful (non-obvious) manner.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9b297023-0d81-41f9-bd5c-bcb4d39d1ebfCited by top-tier papers4
- New Diameter-Reducing Shortcuts and Directed Hopsets: Breaking the BarrierShimon Kogan, Merav ParterSODA 2022 · 7 citations
- Subquadratic dynamic path reporting in directed graphs against an adaptive adversaryAdam Karczmarz, Anish Mukherjee, Piotr SankowskiSTOC 2022 · 5 citations
- Universe Reduction for APSP: Equivalence of Three Fine-Grained HypothesesNick FischerSTOC 2026 · 2 citations
- Fine-Grained Optimality of Partially Dynamic Shortest Paths and MoreBarna Saha, Virginia Vassilevska Williams, Yinzhan Xu, Christopher YeSODA 2025
Builds on2
Related papers
- Improved Additive Approximation Algorithms for APSPCe Jin, Yael Kirkpatrick, Michal Stawarz, Virginia Vassilevska WilliamsSODA 2026
- Sparsifying, Shrinking and Splicing for Minimum Path Cover in Parameterized Linear TimeManuel Cáceres, Massimo Cairo, Brendan Mumey, Romeo Rizzi et al.SODA 2022 · 20 citations
- New Graph Decompositions and Combinatorial Boolean Matrix Multiplication AlgorithmsAmir Abboud, Nick Fischer, Zander Kelley, Shachar Lovett et al.STOC 2024 · 2 citations
- New Algorithms for All Pairs Approximate Shortest PathsLiam RodittySTOC 2023
- Lower Bounds for Non-adaptive Local Computation AlgorithmsAmir Azarmehr, Soheil Behnezhad, Alma Ghafari, Madhu SudanFOCS 2025 · 2 citations
