The tree inclusion problem: In linear space and faster

The tree inclusion problem: In linear space and faster
复制标题

树包含问题:在线性空间中且速度更快

DOI:
--
复制
发表时间:
2006
期刊:
TALG
影响因子:
--
通讯作者:
Inge Li Gørtz
Inge Li Gørtz
中科院分区:
--
文献类型:
--
作者:
Philip Bille;Inge Li Gørtz

文献摘要

被引文献

相似文献

给定两棵有根有序标记树<i>P</i>和<i>T</i>,树包含问题是通过删除<i>T</i>中的节点来确定是否可以从<i>T</i>中得到<i>P</i>。这个问题最近被认为是XML数据库中一个重要的查询原语。Kilpeläinen和Mannila[1995]提出了第一个使用二次时间和空间的多项式时间算法。此后,对于<i>P</i>和<i>T</i>叶数少或深度小的特殊情况,得到了若干改进结果。然而,在最坏的情况下,这些算法仍然使用二次的时间和空间。让<我> n < / i > <子> <我> < / i > < / sub >, <我> l < / i > <子> <我> < / i > < / sub >,和<我> d < / i > <子> <我> < / i > < /子>表示节点的数量,数量的叶子,树的深度和<我> < / i >∈<我> P < / i >, <我> < / i >。在本文中,我们证明了树包含问题可以在空间<i>O</i>(<i>n</i><sub><i>T</i></sub>)和时间上解决:0 <s:1> <s:1>⎬⎭<s:2> <s:2>录像机录像机nntlplt log log nT+ nTnPnTlog nT+ nTlog nT
Given two rooted, ordered, and labeled trees <i>P</i> and <i>T</i> the tree inclusion problem is to determine if <i>P</i> can be obtained from <i>T</i> by deleting nodes in <i>T</i>. This problem has recently been recognized as an important query primitive in XML databases. Kilpeläinen and Mannila [1995] presented the first polynomial-time algorithm using quadratic time and space. Since then several improved results have been obtained for special cases when <i>P</i> and <i>T</i> have a small number of leaves or small depth. However, in the worst case these algorithms still use quadratic time and space. Let <i>n</i><sub><i>S</i></sub>, <i>l</i><sub><i>S</i></sub>, and <i>d</i><sub><i>S</i></sub> denote the number of nodes, the number of leaves, and the depth of a tree <i>S</i> ∈ <i>P</i>, <i>T</i>. In this article we show that the tree inclusion problem can be solved in space <i>O</i>(<i>n</i><sub><i>T</i></sub>) and time: O⎛⎝min⎧⎨⎩lPnTlPlT log log nT + nTnPnTlog nT+ nT log 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.