arXivDaily arXiv每日学术速递 周一至周五更新
arXiv cs/0608124cs.DS
收藏

树包含问题:在线性空间和更快

The Tree Inclusion Problem: In Linear Space and Faster

Philip Bille, Inge Li Goertz

摘要:

给定两个有根的、有序的、有标签的树$P$和$T$,树包含问题是确定是否可以通过删除$T$中的节点从$T$获得$P$。这个问题最近被认为是XML数据库中一个重要的查询原语。Kilpeläinen和Mannila [ \emph{SIAM J. Comput. 1995} ]提出了第一个使用二次时间和空间的多项式时间算法。从那时起,当$P$和$T$具有少量叶或小深度的特殊情况下,已经获得了几个改进的结果。然而,在最坏的情况下,这些算法仍然使用二次时间和空间。令$n_S$、$l_S$和$d_S$表示树$S \in \{P, T\}$的节点数、叶数和最大深度百分比。本文证明了树包含问题在空间$O(n_T)$和时间上都可以求解: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})).这改进或匹配了已知的时间复杂度,同时仅使用线性空间而不是二次空间。这在实际应用中尤其重要,例如XML数据库,因为空间很可能成为瓶颈。

英文摘要:

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 [\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 $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 $n_S$, $l_S$, and $d_S$ denote the number of nodes, the number of leaves, and the %maximum depth of a tree $S \in \{P, T\}$. In this paper we show that the tree inclusion problem can be solved in space $O(n_T)$ 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑