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

PC-树和PQ-树的实验比较

Experimental Comparison of PC-Trees and PQ-Trees

Simon D. Fink, Matthias Pfretzschner, Ignaz Rutter

摘要:

PQ-树和PC-树是分别表示线性和循环顺序的集合的数据结构,它们受到元素的特定子集必须是连续的约束。虽然PC树与PQ树是等价的,但它们在概念上要比PQ树简单得多;更新PC树使一组元素变得连续只需要一个操作,而PQ树使用的更新过程是用九个必须递归匹配和应用的转换模板来描述的。尽管有这些理论上的优势,但迄今为止还没有实际的PC树实现。这可能是由于Hsu和McConnell最初的描述在某些地方只描绘了实现的细节。在本文中,我们描述了两种替代实现的PC树。对于第一个,我们遵循Hsu和McConnell的方法,填充必要的细节,并对原始算法提出改进。对于第二个,我们使用一种不同的技术来有效地表示树,使用Union-Find数据结构。在一个广泛的实验评估,我们比较我们的实现的PQ树,可在网上作为学术和其他软件库的一部分的各种其他实现。我们的研究结果表明,这两个PC树的实现击败他们最接近的完全正确的竞争对手,PQ树的实施从OGDF库,由2到4的一个因素,表明PC树不仅在概念上更简单,但在实践中也很快。此外,我们发现基于Union-Find的实现,虽然有一个稍差的渐近运行时,是基于Hsu和McConnell的描述的速度的两倍。

英文摘要:

PQ-trees and PC-trees are data structures that represent sets of linear and circular orders, respectively, subject to constraints that specific subsets of elements have to be consecutive. While equivalent to each other, PC-trees are conceptually much simpler than PQ-trees; updating a PC-trees so that a set of elements becomes consecutive requires only a single operation, whereas PQ-trees use an update procedure that is described in terms of nine transformation templates that have to be recursively matched and applied. Despite these theoretical advantages, to date no practical PC-tree implementation is available. This might be due to the original description by Hsu and McConnell in some places only sketching the details of the implementation. In this paper, we describe two alternative implementations of PC-trees. For the first one, we follow the approach by Hsu and McConnell, filling in the necessary details and also proposing improvements on the original algorithm. For the second one, we use a different technique for efficiently representing the tree using a Union-Find data structure. In an extensive experimental evaluation we compare our implementations to a variety of other implementations of PQ-trees that are available on the web as part of academic and other software libraries. Our results show that both PC-tree implementations beat their closest fully correct competitor, the PQ-tree implementation from the OGDF library, by a factor of 2 to 4, showing that PC-trees are not only conceptually simpler but also fast in practice. Moreover, we find the Union-Find-based implementation, while having a slightly worse asymptotic runtime, to be twice as fast as the one based on the description by Hsu and McConnell.

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

↑