We report on recent advances in rule-based graph programming, which allow us to match the time complexity of some fundamental imperative graph algorithms. In general, achieving the time complexity of graph algorithms implemented in conventional languages using a rule-based graph-transformation language is challenging due to the cost of graph matching. Previous work demonstrated that with rooted rules, certain algorithms can be implemented in the graph programming language GP 2 such that their runtime matches the time complexity of imperative implementations. However, this required input graphs to have a bounded node degree and (for some algorithms) to be connected. In this paper, we overcome these limitations by enhancing the graph data structure generated by the GP 2 compiler and exploiting the new structure in programs. We present three case studies: the first program checks whether input graphs are connected, the second program checks whether input graphs are acyclic, and the third program solves the single-source shortest-paths problem for graphs with integer edge-weights. The first two programs run in linear time on (possibly disconnected) input graphs with arbitrary node degrees. The third program runs in time $O(nm)$ on arbitrary input graphs, matching the time complexity of imperative implementations of the Bellman-Ford algorithm. For each program, we formally prove its correctness and time complexity, and provide runtime experiments on various graph classes.


翻译:我们报告了基于规则的图编程的最新进展,这使得我们能够匹配一些基本命令式图算法的时间复杂度。通常,由于图匹配的成本,使用基于规则的图变换语言实现传统语言中的图算法的时间复杂度颇具挑战性。先前的研究表明,采用有根规则后,某些算法可以在图编程语言GP 2中实现,其运行时能够匹配命令式实现的时间复杂度。然而,这要求输入图具有有界节点度数,并且(对于某些算法)要求图是连通的。本文通过增强GP 2编译器生成的图数据结构并在程序中利用新结构,克服了这些限制。我们提出了三个案例研究:第一个程序检查输入图是否连通,第二个程序检查输入图是否无环,第三个程序解决具有整数边权的图的单源最短路径问题。前两个程序在可能不连通且节点度数任意的输入图上线性时间内运行。第三个程序在任意输入图上以$O(nm)$时间运行,匹配了Bellman-Ford算法命令式实现的时间复杂度。对于每个程序,我们正式证明了其正确性和时间复杂度,并提供了各类图上的运行时实验。

0
下载
关闭预览

相关内容

图深度学习在时间序列处理中的应用:预测、重构与分析
专知会员服务
35+阅读 · 2024年11月30日
【新书】有趣的图算法:解码强大的算法,不再简化
专知会员服务
51+阅读 · 2024年10月2日
基于深度学习的图像匹配:方法、应用与挑战
专知会员服务
24+阅读 · 2024年7月19日
《图简化(Graph Reduction)》最新综述
专知会员服务
31+阅读 · 2024年2月10日
时序知识图谱表示学习
专知会员服务
154+阅读 · 2022年9月17日
【2022新书】图算法指南,A Guide to Graph Algorithms, 350页pdf
专知会员服务
84+阅读 · 2022年3月2日
图计算加速架构综述
专知会员服务
51+阅读 · 2021年4月5日
最新《图嵌入组合优化》综述论文,40页pdf
【图计算】人工智能之图计算
产业智能官
17+阅读 · 2020年4月3日
图论、图算法与图学习
专知
29+阅读 · 2019年6月24日
图嵌入(Graph embedding)综述
人工智能前沿讲习班
449+阅读 · 2019年4月30日
深度学习时代的图模型,清华发文综述图网络
GAN生成式对抗网络
13+阅读 · 2018年12月23日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月14日
Arxiv
0+阅读 · 6月4日
Arxiv
0+阅读 · 5月11日
Arxiv
0+阅读 · 4月6日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员