arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.01376cs.DScs.DB
收藏

子树模式及其应用

Subtree Mode and Applications

King’s College London(伦敦国王学院);CWI, Amsterdam, The Netherlands(荷兰阿姆斯特丹国家数学与计算机科学中心);Vrije Universiteit, Amsterdam, The Netherlands(荷兰阿姆斯特丹自由大学)

Jialong Zhou, Ben Bals, Matei Tinca, Ai Guan, Panagiotis Charalampopoulos, Grigorios Loukides, Solon P. Pissis

AI总结:

本文提出子树模式问题,设计了时间最优的算法,用于计算树中每个节点的子树中最频繁的颜色,适用于文本分析和生物学等领域。

摘要:

值的集合的模式(即集合中最频繁的值)是关键的汇总统计量。在给定数组的某个范围中找到模式是非常重要的,因此构建一个数据结构来解决这个问题实际上就是著名的范围模式问题。在本工作中,我们引入了子树模式(SM)问题,这是在叶着色树中的类比问题,其中任务是计算给定节点的子树中的叶子的最频繁颜色。SM受到文本分析和生物学等领域中数据层次化的需求的启发,这些数据可以表示为(叶着色)树。我们的主要贡献是一个时间最优的算法,能够在O(N)时间内为输入的N节点树的每个节点计算答案。我们进一步展示了如何将我们的解决方案适应于节点着色树,或者在给定k=O(1)的情况下计算最频繁的颜色的前k个,在最优的O(N)时间内。此外,我们证明当输入是一个源着色的有向无环图而不是叶着色树时,同样快速的解决方案的可能性极低。我们在具有多达73亿个节点的树的真实数据集上的实验表明,我们的算法比基线快至少一个数量级,并且空间效率更高。它们还显示了在模式挖掘、序列到数据库搜索和生物学应用中的有效性。

英文摘要:

The mode of a collection of values (i.e., the most frequent value in the collection) is a key summary statistic. Finding the mode in a given range of an array of values is thus of great importance, and constructing a data structure to solve this problem is in fact the well-known Range Mode problem. In this work, we introduce the Subtree Mode (SM) problem, the analogous problem in a leaf-colored tree, where the task is to compute the most frequent color in the leaves of the subtree of a given node. SM is motivated by several applications in domains such as text analytics and biology, where the data are hierarchical and can thus be represented as a (leaf-colored) tree. Our central contribution is a time-optimal algorithm for SM that computes the answer for every node of an input $N$-node tree in $O(N)$ time. We further show how our solution can be adapted for node-colored trees, or for computing the $k$ most frequent colors, for any given $k=O(1)$, in the optimal $O(N)$ time. Moreover, we prove that a similarly fast solution for when the input is a sink-colored directed acyclic graph instead of a leaf-colored tree is highly unlikely. Our experiments on real datasets with trees of up to $7.3$ billion nodes demonstrate that our algorithm is faster than baselines by at least one order of magnitude and much more space efficient. They also show that it is effective in pattern mining, sequence-to-database search, and biology applications.

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

↑