无前置条件的线性时间图程序
Linear-Time Graph Programs without Preconditions
AI总结:
本文通过增强GP 2编译器生成的图数据结构,克服了先前线性时间图程序对输入图连通性和节点度有界的限制,实现了环检测、连通分量编号和广度优先搜索三个程序在任意输入图上的线性时间运行,并提供了经验证据。
摘要:
我们报告了基于规则的图编程领域的一项近期突破,该突破使我们能够达到命令式线性时间算法的时间复杂度。一般而言,由于图匹配的成本,使用图变换规则在传统语言中实现图算法的复杂度是具有挑战性的。先前的工作表明,使用有根规则,某些算法可以通过图编程语言 GP 2 在线性时间内执行。然而,对于保留输入图结构的非破坏性算法,实现线性运行时间要求输入图是连通的且节点度有界。在本文中,我们通过增强 GP 2 编译器生成的图数据结构并在程序中利用新结构来克服这些前置条件。我们展示了三个案例研究:一个环检测程序、一个为图的连通分量编号的程序,以及一个广度优先搜索程序。这些程序中的每一个都在连通和非连通的任意节点度的输入图上以线性时间运行。我们通过使用各类输入图的计时结果,为线性时间复杂度提供了经验证据。
英文摘要:
We report on a recent breakthrough in rule-based graph programming, which allows us to reach the time complexity of imperative linear-time algorithms. In general, achieving the complexity of graph algorithms in conventional languages using graph transformation rules is challenging due to the cost of graph matching. Previous work demonstrated that with rooted rules, certain algorithms can be executed in linear time using the graph programming language GP 2. However, for non-destructive algorithms that retain the structure of input graphs, achieving linear runtime required input graphs to be connected and of bounded node degree. In this paper, we overcome these preconditions by enhancing the graph data structure generated by the GP 2 compiler and exploiting the new structure in programs. We present three case studies, a cycle detection program, a program for numbering the connected components of a graph, and a breadth-first search program. Each of these programs runs in linear time on both connected and disconnected input graphs with arbitrary node degrees. We give empirical evidence for the linear time complexity by using timings for various classes of input graphs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。