Beruflich Dokumente
Kultur Dokumente
Helge Wiemann
University of Bremen
studies of computer science
hwiemann@tzi.de
Abstract
This paper shall give an introduction into the theory
of rule-based graph transformation which is itself a wellstudied area in the context of computer science. It begins
with a short introduction to the topic of graphs and continues with the description of some quite important notions
which are essential for the understanding of the theory of
graph transformation. The topic of the algebraic approach
as the central method for graph transformations is presented as the main topic in this paper, strengthened by illustrations of the two sub approaches SPO (single-pushout approach) and DPO (double-pushout diagram) which is more
frequently used in practice than the SPO. All theoretical aspects are often accompanied by an application example to
illustrate them related to practice. At the end of this paper
you will find a comparison of the two sub approaches as a
final conclusion and a special application example of the
DPO.
1. Introduction
Die grossartige Schonheit eines Graphen besteht darin,
dass er unklare, schwer durchschaubare Ratsel auf ein
wunderbares Ding aus Linien und Knotenpunkten
reduzieren kann.
(D. Olivastro. Das chinesische Dreieck: die kniffligsten
mathematischen Ratsel aus 10000 Jahren. Droemer
Knauer, Munchen, 1995, S.273)
When we talk about graphs, we talk about a powerful
and well-established tool to represent various data structures as well as states of concurrent and distributed systems.
More generally speaking you can describe whole sets of
objects including the relations between them [2].
Famous examples and various kinds of graphs are the
following ones [2] :
flow diagrams
Petri nets
UML diagrams
Entity-Relationship diagrams
finite automata
maps (e.g. of roads or countries)
In many cases you do not only want to build up graphs as
a static structure with a static behavior of its objects. If you
need to have a dynamical structure you need a graph which
is able to transform. For instance you are firing transitions
in Petri Nets or UML state diagrams or you want to transform a graph by deleting nodes or edges in the case of other
UML object diagrams. Graphs are quite generic structures
and therefore graph transformations combine the concepts
of graphs and the application of rules to transform them.
Graphs are well-suited and often used structures and
because of their quite different applications, you can find
graphs in many different application areas as various kinds.
They can be directed or undirected, maybe labeled or unlabeled. They can be simple or multiple and they are
equipped with binary edges or hyperedges [2]. Sometimes,
2. graph rewriting
Before we will go further to the explicit approaches of
graph transformations, we first have to introduce some important notions around the topic graph rewriting for the better understanding.
2.2. subgraphs
Formally a graph G is a real subgraph of another graph
H, if it satisfies the following conditions: all nodes of G
also consist in H (VG in VH ), all edges of G also consist in
H (EG in EH ), every edge in G has the same source node
in H (s(e)G = s(e)H ), analog has every edge in G the same
target node in H (t(e)G = t(e)H ) and finally every edge in
G must have the same label in the other graph H.
With a given graph, you can simply obtain a subgraph
by removing some nodes and edges, with the essential
condition that the removal of a node is accompanied by the
removal of all its adjacent edges. More formally speaking:
the given graph, as is generally known, is a system G =
(V,E,s,t,l). You want to remove nodes and edges, so that
you have in this case additionally a pair of nodes and edges,
written as X = (VX ,EX ) in (V,E).
3. algebraic approach
There are several approaches of graph rewriting, one
of them is the algebraic approach which based on the just
mentioned category of theory. Actually the algebraic approach is divided into sub approaches, in this paper we will
discuss two of them, namely the single-pushout approach
(SPO) and the more frequently used double-pushout approach (DPO). Both approaches have the same intention to
perform rule-based transformation of graphs as the method
to execute local changes on graphs for the use of them in
dynamical environments. Generally speaking the algebraic
approach should specify formally and visually the semantics of rule-based systems. The rules have to express which
part of graph is to be replaced by another graph. The general
production is always described as p: L R [1]
If you want to transform a graph, you can have many
problems, such as there are some edges left after the deletion of nodes and these edges do not have any source or target node. These transformations are forbidden. To find out
which transformations on a graph are allowed, we use the
important upper mentioned gluing condition. If the match
satisfies the gluing condition, the graph transformation is
valid and be can performed without any problems later on.
The action of gluing two graphs is a construction in the context of the category of graphs and graph morphisms and is
called pushout.
Step 1: finding a match L in G which maintains the gluing condition (Figure 10)
for the graph rewriting step. You can use the graphical rule
representation without an interface graph by depicting only
the graphs L and R. Thus a rewriting step is only defined by
a single pushout diagram with a single graph morphism as
arrows as a the formal rule (production) r: L R [1]
6. References
1. Grzegorz Rozenberg, editor: Handbook of Graph
Grammars and Computing by Graph Transformation.
Vol.1: Foundations. World Scientific,Singapore,1997.
2. H.-J. Kreowski, R. Klempien-Hinrichs, S. Kuske:
Some Essentials of Graph Transformation. University
of Bremen, Department of Computer Science. Bremen
3. H.-J. Kreowski: Formale Sprachen: Graphtransformation. Universitt Bremen, Sommersemester 2004
4. www.wikipedia.de