The tree inclusion problem: In linear space and faster
The tree inclusion problem: In linear space and faster
复制标题
树包含问题:在线性空间中且速度更快
DOI:
--
复制
发表时间:
2006
期刊:
影响因子:
--
通讯作者:
Inge Li Gørtz
中科院分区:
文献类型:
--
作者:
Philip Bille;Inge Li Gørtz
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.