The Tree Inclusion Problem: In Linear Space and Faster
Abstract
Given two rooted, ordered, and labeled trees and the tree inclusion problem is to determine if can be obtained from by deleting nodes in . This problem has recently been recognized as an important query primitive in XML databases. Kilpeläinen and Mannila [\emph{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 and have a small number of leaves or small depth. However, in the worst case these algorithms still use quadratic time and space. Let , , and denote the number of nodes, the number of leaves, and the %maximum depth of a tree . In this paper we show that the tree inclusion problem can be solved in space and time: O(\min(l_Pn_T, l_Pl_T\log \log n_T + n_T, \frac{n_Pn_T}{\log n_T} + n_{T}\log n_{T})). 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
Metadata
- Comments
- Minor updates from last time
- Versions
- v1 (8/31/2006), v2 (9/7/2007), v3 (2/9/2009), v4 (10/7/2009), v5 (1/18/2011)
Related papers
Faster polynomial-space algorithms for poset problems
Shared title terminologycs.DSLászló Kozma, Junqi Tan
Linear-Time Pointer-Machine Algorithms for Path-Evaluation Problems on Trees and Graphs
Shared title terminologycs.DSAdam L. Buchsbaum, Loukas Georgiadis, Haim Kaplan et al.
How to Round Spiky Balls into Submission -- And Faster Algorithms For The Closest Vector Problem
Shared title terminologycs.DSDivesh Aggarwal, Aditya Morolia
A Deterministic Linear Time Algorithm for Minimum Spanning Tree
Shared title terminologycs.DSSanjeev Khanna, Aaron Putterman, Junkai Song
Linear Time Algorithms Based on Multilevel Prefix Tree for Finding Shortest Path with Positive Weights and Minimum Spanning Tree in a Networks
Shared title terminologycs.DSDavid S. Planeta
Randomized algorithm for the k-server problem on decomposable spaces
Shared title terminologycs.DSJudit Nagy-György