The Tree Inclusion Problem: In Linear Space and Faster
Philip Bille, Inge Li Goertz
Abstract
Given two rooted, ordered, and labeled trees P and T the tree inclusion problem is to determine if P can be obtained from T by deleting nodes in T. This problem has recently been recognized as an important query primitive in XML databases. Kilpeläinen and Mannila [SIAM J. Comput. 1995] presented the first polynomial time algorithm using quadratic time and space. Since then several improved results have been obtained for special cases when P and T have a small number of leaves or small depth. However, in the worst case these algorithms still use quadratic time and space. Let nS, lS, and dS denote the number of nodes, the number of leaves, and the %maximum depth of a tree S ∈ \P, T\. In this paper we show that the tree inclusion problem can be solved in space O(nT) and time: O((lPnT, lPlT nT + nT, nPnT nT + nT nT)). This improves or matches the best known time complexities while using only linear space instead of quadratic. This is particularly important in practical applications, such as XML databases, where the space is likely to be a bottleneck.
Create a lesson
Related papers
Constructive Arboricity in Almost-Linear Time for Dense Graphs
Iman Gholami, Mohammad T. Hajiaghayi, Mahdi JafariRaviz et al.
Tight asymptotic competitive ratio for the Canadian Traveller Problem on unit-weighted grids
Pierre Bergé, Vsevolod Chernyshev, Malory Marin et al.
Breaking Two Barriers for Dynamic Planar Reachability
Adam Karczmarz, Michał Włodarczyk
Deterministic Girth Approximation in Weighted Undirected Graphs
Avi Kadria
Polynomial directed treewidth forces a large bramble with congestion two
Victor A. Campos, Raul Lopes, Rodrigo Nogueira et al.
Minimizing fuzzy Kripke models over residuated lattices
Linh Anh Nguyen