Fast rule-based graph programs

•Rooted rules are essential for fast rule-based graph algorithms.•Cycle graphs, trees, binary DAGs can be recognised by graph reduction in linear time.•Topological sorting has a linear-time implementation in the rule-based language GP2.•Depth-first search and 2-colouring have linear-time implementat...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Science of computer programming Jg. 214; S. 102727
Hauptverfasser: Campbell, Graham, Courtehoute, Brian, Plump, Detlef
Format: Journal Article
Sprache:Englisch
Veröffentlicht: Elsevier B.V 01.02.2022
Schlagworte:
ISSN:0167-6423, 1872-7964
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:•Rooted rules are essential for fast rule-based graph algorithms.•Cycle graphs, trees, binary DAGs can be recognised by graph reduction in linear time.•Topological sorting has a linear-time implementation in the rule-based language GP2.•Depth-first search and 2-colouring have linear-time implementations in GP2. Implementing graph algorithms efficiently in a rule-based language is challenging because graph pattern matching is expensive. In this paper, we present a number of linear-time implementations of graph algorithms in GP 2, an experimental programming language based on graph transformation rules which aims to facilitate program analysis and verification. We focus on two classes of rule-based graph programs: graph reduction programs which check some graph property, and programs using a depth-first search to test some property or perform an operation such as producing a 2-colouring or a topological sorting. Programs of the first type run in linear time without any constraints on input graphs while programs of the second type require input graphs of bounded degree to run in linear time. Essential for achieving the linear time complexity are so-called rooted rules in GP 2, which, in many situations, can be matched in constant time. For each of our programs, we prove both correctness and complexity, and also give empirical evidence for their runtime.
ISSN:0167-6423
1872-7964
DOI:10.1016/j.scico.2021.102727