首页    期刊浏览 2024年11月26日 星期二
登录注册

文章基本信息

  • 标题:Linear-Time Graph Algorithms in GP 2
  • 本地全文:下载
  • 作者:Graham Campbell ; Brian Courtehoute ; Detlef Plump
  • 期刊名称:LIPIcs : Leibniz International Proceedings in Informatics
  • 电子版ISSN:1868-8969
  • 出版年度:2019
  • 卷号:139
  • 页码:1-23
  • DOI:10.4230/LIPIcs.CALCO.2019.16
  • 出版社:Schloss Dagstuhl -- Leibniz-Zentrum fuer Informatik
  • 摘要:GP 2 is an experimental programming language based on graph transformation rules which aims to facilitate program analysis and verification. However, implementing graph algorithms efficiently in a rule-based language is challenging because graph pattern matching is expensive. GP 2 mitigates this problem by providing rooted rules which, under mild conditions, can be matched in constant time. In this paper, we present linear-time GP 2 programs for three problems: tree recognition, binary directed acyclic graph (DAG) recognition, and topological sorting. In each case, we show the correctness of the program, prove its linear time complexity, and also give empirical evidence for the linear run time. For DAG recognition and topological sorting, the linear behaviour is achieved by implementing depth-first search strategies based on an encoding of stacks in graphs.
  • 关键词:Graph transformation; rooted graph programs; GP 2; linear-time algorithms; depth-first search; topological sorting
国家哲学社会科学文献中心版权所有