When using graph transformation rules to implement graph algorithms, a challenge is to match the efficiency of programs in conventional languages. To help overcome that challenge, the graph programming language GP 2 features rooted rules which, under mild conditions, can match in constant time on bounded degree graphs. In this paper, we present an efficient GP 2 program for computing minimum spanning trees. We provide empirical performance results as evidence for the program's subquadratic complexity on bounded degree graphs. This is achieved using depth-first search as well as rooted graph transformation. The program is based on Boruvka's algorithm for minimum spanning trees. Our performance results show that the program's time complexity is consistent with that of classical implementations of Boruvka's algorithm, namely O(m log n), where m is the number of edges and n the number of nodes.
翻译:当使用图形转换规则来实施图形算法时,一个挑战是如何匹配常规语言程序的效率。为了帮助克服这一挑战,图形程序语言 GP 2 具有扎根规则,在轻度条件下,这些规则可以在固定时间与受约束度图形相匹配。在本文中,我们提出了一个高效的GP 2 程序,用于计算最小宽度树。我们提供了实验性绩效结果,以证明在受约束度图形上程序亚水面复杂性。这是通过深度搜索和根基图形转换实现的。这个程序以Boruvka 的最小覆盖树算法为基础。我们的性能结果显示,这个程序的时间复杂性与Boruvka 算法(即O(m log n)的经典实施时间复杂性是一致的,即M是边缘数和N节点数。