We describe a framework for maintaining forest algebra representations of trees of logarithmic height. Such a representations can be computed in O(n) time and updated in O(log(n)) time. The framework is of potential interest for data structures and algorithms for trees whose complexity depend on the depth of the tree (representation). We provide an exemplary application of the framework to the problem of efficiently enumerating answers to MSO-definable queries over trees which are subject to local updates. We exhibit an algorithm that uses an O(n) preprocessing phase and enumerates answers with O(log(n)) delay between them. When the tree is updated, the algorithm can avoid repeating expensive preprocessing and restart the enumeration phase within O(log(n)) time. Our algorithms and complexity results in the paper are presented in terms of node-selecting tree automata representing the MSO queries.
翻译:我们描述了保持对数高度树的森林代数表示的框架。这种表示可以用O(n)时间计算,并在O(log(n)时间进行更新。这个框架对于复杂程度取决于树的深度的树木的数据结构和算法具有潜在的兴趣(表示),我们对高效率地罗列MOO(n)预处理阶段的可定义的树木查询答案的问题提供了一个示范性应用框架。我们展示了一种使用O(n)预处理阶段的算法,并用O(log(n)时间)的延迟来列举答案。当树被更新时,算法可以避免重复昂贵的预处理,并在O(log(n)时间)时间内重新启动查点阶段。我们的文件的算法和复杂结果以不脱选择树的自动模型来表示,代表MOSO的查询。