Optimal Heaviest Induced Ancestors
Abstract
We revisit the Heaviest Induced Ancestors (HIA) problem that was introduced by Gagie, Gawrychowski, and Nekrich [CCCG 2013] and has a number of applications in string algorithms. Let and be two rooted trees whose nodes have weights that are increasing in all root-to-leaf paths, and labels on the leaves, such that no two leaves of a tree have the same label. A pair of nodes is \emph{induced} if and only if there is a label shared by leaf-descendants of and . In an HIA query, given nodes and , the goal is to find an induced pair of nodes of the maximum total weight such that is an ancestor of~ and is an ancestor of . Let be the upper bound on the sizes of the two trees. It is known that no data structure of size can answer HIA queries in time [Charalampopoulos, Gawrychowski, Pokorski; ICALP 2020]. This (unconditional) lower bound is a factor away from the query time of the fastest -size data structure known to date for the HIA problem [Abedin, Hooshmand, Ganguly, Thankachan; Algorithmica 2022]. In this work, we resolve the query-time complexity of the HIA problem for the near-linear space regime by presenting a data structure that can be built in time and answers HIA queries in time. As a direct corollary, we obtain an -size data structure that maintains the LCS of a static string and a dynamic string, both of length at most , in time optimal for this space regime. The main ingredients of our approach are fractional cascading and the utilization of an -depth tree decomposition.
Cite
@article{arxiv.2302.01373,
title = {Optimal Heaviest Induced Ancestors},
author = {Panagiotis Charalampopoulos and Bartłomiej Dudek and Paweł Gawrychowski and Karol Pokorski},
journal= {arXiv preprint arXiv:2302.01373},
year = {2023}
}