Longest Common Extensions in Trees
Abstract
The longest common extension (LCE) of two indices in a string is the length of the longest identical substrings starting at these two indices. The LCE problem asks to preprocess a string into a compact data structure that supports fast LCE queries. In this paper we generalize the LCE problem to trees and suggest a few applications of LCE in trees to tries and XML databases. Given a labeled and rooted tree of size , the goal is to preprocess into a compact data structure that support the following LCE queries between subpaths and subtrees in . Let , , , and be nodes of such that and are descendants of and respectively. \begin{itemize} \item : (path-path ) return the longest common prefix of the paths and . \item : (path-tree ) return maximal path-path LCE of the path and any path from to a descendant leaf. \item : (tree-tree ) return a maximal path-path LCE of any pair of paths from and to descendant leaves. \end{itemize} We present the first non-trivial bounds for supporting these queries. For queries, we present a linear-space solution with query time. For queries, we present a linear-space solution with query time, and complement this with a lower bound showing that any path-tree LCE structure of size must necessarily use time to answer queries. For queries, we present a time-space trade-off, that given any parameter , , leads to an space and query-time solution. This is complemented with a reduction to the the set intersection problem implying that a fast linear space solution is not likely to exist.
Cite
@article{arxiv.1412.1254,
title = {Longest Common Extensions in Trees},
author = {Philip Bille and Pawel Gawrychowski and Inge Li Goertz and Gad M. Landau and Oren Weimann},
journal= {arXiv preprint arXiv:1412.1254},
year = {2015}
}