English

Listing, Verifying and Counting Lowest Common Ancestors in DAGs: Algorithms and Fine-Grained Lower Bounds

Data Structures and Algorithms 2022-04-26 v1

Abstract

The AP-LCA problem asks, given an nn-node directed acyclic graph (DAG), to compute for every pair of vertices uu and vv in the DAG a lowest common ancestor (LCA) of uu and vv if one exists. In this paper we study several interesting variants of AP-LCA, providing both algorithms and fine-grained lower bounds for them. The lower bounds we obtain are the first conditional lower bounds for LCA problems higher than nωo(1)n^{\omega-o(1)}, where ω\omega is the matrix multiplication exponent. Some of our results include: - In any DAG, we can detect all vertex pairs that have at most two LCAs and list all of their LCAs in O(nω)O(n^\omega) time. This algorithm extends a result of [Kowaluk and Lingas ESA'07] which showed an O~(nω)\tilde{O}(n^\omega) time algorithm that detects all pairs with a unique LCA in a DAG and outputs their corresponding LCAs. - Listing 77 LCAs per vertex pair in DAGs requires n3o(1)n^{3-o(1)} time under the popular assumption that 3-uniform 5-hyperclique detection requires n5o(1)n^{5-o(1)} time. This is surprising since essentially cubic time is sufficient to list all LCAs (if ω=2\omega=2). - Counting the number of LCAs for every vertex pair in a DAG requires n3o(1)n^{3-o(1)} time under the Strong Exponential Time Hypothesis, and nω(1,2,1)o(1)n^{\omega(1,2,1)-o(1)} time under the 44-Clique hypothesis. This shows that the algorithm of [Echkardt, M\"{u}hling and Nowak ESA'07] for listing all LCAs for every pair of vertices is likely optimal. - Given a DAG and a vertex wu,vw_{u,v} for every vertex pair u,vu,v, verifying whether all wu,vw_{u,v} are valid LCAs requires n2.5o(1)n^{2.5-o(1)} time assuming 3-uniform 4-hyperclique requires n4o(1)n^{4 - o(1)} time. This defies the common intuition that verification is easier than computation since returning some LCA per vertex pair can be solved in O(n2.447)O(n^{2.447}) time [Grandoni et al. SODA'21].

Keywords

Cite

@article{arxiv.2204.10932,
  title  = {Listing, Verifying and Counting Lowest Common Ancestors in DAGs: Algorithms and Fine-Grained Lower Bounds},
  author = {Surya Mathialagan and Virginia Vassilevska Williams and Yinzhan Xu},
  journal= {arXiv preprint arXiv:2204.10932},
  year   = {2022}
}

Comments

To appear in ICALP 2022. Abstract shortened to fit arXiv requirement