domingo, 25 de diciembre de 2011

the very basics II

The very basics of graph dynamics: completion and compatibility


A production in MGG specifies some Boolean matrix operations. The first thing to do is to "complete" the matrices so the Boolean operations make sense. This is not a trivial fact because not only the number of elements in the matrices may differ but also their ordering. Somehow it has to be decided which nodes are the same in different graphs, respecting types. Notice that this is one source of non-determinism unless all types are different.


This property is closely related to the matching problem: Given a host graph (initial state to which the grammar is going to be applied), select the places where the productions are going to be applied.

Notice there is still another source of non-determinism in MGGs: A means to select the following production to be applied. This sort of non-determinism is avoided by providing a sequence of productions, which is nothing but a set of productions to be applied in a given order.

Completion is necessary to perform the algebraic operations and we will always assume in MGGs that it has been performed somehow. More on this in Sec. 4.2 of the MGG book. The two sources of non-determinism commented above are relevant if we consider MGG as a model of computation, which I will do in future posts.

Another algebraic need is compatibility. We give the adjacency matrix to specify the edges of a graph, which implicitly contains the nodes of the graphs. As productions may act on nodes independently, a vector of nodes is also given and we have to be sure that the adjacency matrix and the vector of nodes are compatible, i.e. they have the same nodes (no edge is incident to a node that does not belong to the graph). A production is said to be compatible if it outputs a compatible graph starting out of a compatible graph. A similar definition of compatibility is given for sequences in the MGG book (intermediate states have to be compatible).

Compatibility is in essence well-formedness of graphs.

I finish today with a quote from Richard Feynman: "The worthwhile problems are the ones you can really solve or help solve, the ones you can really contribute something to. ... No problem is too small or too trivial if we can really do something about it."

lunes, 12 de diciembre de 2011

the very basics I



The very basics of graph dynamics: productions

Today I comment on productions. Productions encode the most important notion to study: Dynamics. Starting out from one graph (L) we obtain another one (R) and this operation is named p (the production).

MGG considers simple digraphs (graphs with no "parallel edges"). We will see that this scheme in fact permits MGG to deal with multidigraphs (graphs with "parallel edges").

There are two actions that can be performed: adding or deleting one element (element = node or edge). The main reason to concentrate on simple digraphs is that their edges can be faithfully represented by a Boolean matrix (adjacency matrix). As we may also add and delete nodes, we need one further vector to know if one node belongs to the graph or not.

The actions (graph dynamics, productions) are encoded through the AND and OR operations from Boolean logics. Define two new matrices: e specify elements to be deleted and r elements to be added. Starting from two graphs (L and R) that "statically" define one transformation (L becomes R) we introduce two matrices that acting on L have as result R:

$p:L \rightarrow R \qquad R = p(L) = r \vee \left( \overline{e} \wedge L \right) = r \vee \overline{e} L$

(By default, the and operation is not explicitly written, as in the last equality.) So (e,r) encode the dynamics of the production. There are at least two non-equivalent ways to make p become a transformation between graphs: Swaps and derivations. A production could be understood as a means to represent an application from the set of graphs to the set of graphs (in general a multivalued application). In contrast, a direct derivation is the transformation of a concrete graph. This is why I said in this post that I find more natural to study productions than direct derivations.

This production characterization is novel to the very best of my knowledge. It is pretty easy and with loads of consequences (this topic is fully developed in Chap. 4 of the MGG book):
  1. It splits the "dynamics" (e, r) from the "statics" (L, R), so to speak.
  2. Dynamics can be studied independently of the graph it is going to be applied to (known as host graph, more on this when we get to derivations). This can not be done by any other approach to graph transformation as far as I know. In my opinion it is the first big advantage of MGGs.
  3. Even more so, it is possible to study the actions (e, r) independently from the graphs that define them (L, R). Its algebraic generalization gives rise to what are known as swaps. It will take us a little to get to them.
  4. Notice the "affine" or "linear" shape of the function (production), p(x) = ax + b.

A very nice Australian proverb to close today's post: The more you know, the less you need.

martes, 22 de noviembre de 2011

related approaches III

Main graph transformation approaches part 3 and last.


Here I close these three posts dedicated to other approaches to graph transformations or graph dynamics. I will almost limit today to an enumeration of them.


The so-called set theoretic or algorithmic approaches are node replacement and hyperedge replacement. The basic idea of node replacement is to substitute one node in the host graph with another graph. As always, this is specified by a production but this time the left hand side of the production (the initial set of the "function") is normally made up of a single node. Usually, this node also appears in the codomain (the right hand side). There are many variants grouped under the general term "node replacement". NLC, NCE, edNCE, etcetera.

The hyperedge replacement approach is quite similar to the node replacement approach, but acting on edges instead of nodes, i.e. edges are substituted by graphs. Conceptually, there are few similarities between these two approaches and MGG. Most of the comments that I make here for DPO/SPO apply - in my opinion - to the algorithmic approaches and also to the MSOL approach.

Monadic Second Order Logics (MSOL) have been used by Courcelle et al. to model graph dynamics and the transformations are defined in terms of MSOL formulas (known as definable transductions). Again, from the conceptual point of view, there are very few similarities between the MSOL approach and MGGs, hence being difficult to make a comparison.

I finish this review by commenting on the relational approach. This one is more algebraic in its origins as it uses relations to define the dynamics (recall that a relation between the sets S and T is a subset of the Cartesian product S*T). However, it promptly tends to Dedekind categories, becoming closer and closer to the categorical approaches. In fact, Dedekind categories provide a variation of the DPO approach in which there are graph variables and replication is possible. We will touch on variables when we introduce graph constraints. Replication has not been introduced in MGGs so far, though my personal view is that it is not a basic operation, i.e. if replication is needed then an algorithm should be defined to carry it out (something I have not tried, to be honest, but that does not seem to be too difficult).

There is a small overview of all these approaches in Chap. 3 of the MGG book and a much more comprehensive one in the three volumes series "Handbook of graph grammars and computing by graph transformation".

Let's end witha cite from Raymond Louis Wilder: There is nothing mysterious, as some have tried to maintain, about the applicability of mathematics. What we get by abstraction from something can be returned.

sábado, 12 de noviembre de 2011

related approaches II

Main graph transformation approaches part 2

I continue today with SPO and DPO and my personal view of them. I want to start by acknowledging the deep and clever ideas and results that have been derived so far. If you are DPO/SPO fan, please, comment!

In my humble opinion, there are some advantages and disadvantages to the way DPO and SPO are defined. The good news are that both can deal with labelled multigraphs (which are of great interest to applied computer scientists) in a quite abstract way. MGG also deals with them (more on this in future posts). However...

From a theoretical point of view, in DPO/SPO you can not really study a production alone but one has to consider where that production is going to be applied. Roughly speaking, if I think of a production as a function that transforms a small set of elements, I have to specify all the domain and not just the part the function acts on. More technically, you have to study direct derivations and not productions. In my personal opinion, productions are the "natural" object of study and not direct derivations. Of course this is arguable. My main point here is that I would like to consider the functions that make up my graph transformation system (these are productions) and apply them to different systems (initial state), but I do not want to specify the system along with the functions (these are direct derivations), i.e. I would like to have uncoupled the functions and the actual set they are going to be applied to. Otherwise stated, I want to be able to specify my algorithm independently of the concrete instance of the problem it is going to be applied to.

In DPO (not in SPO) a direct derivation may specify the simultaneous addition and deletion of one element, say a node of a graph. This is a quite counter intuitive fact to me. I would say that one function may perform at most one action on one element. This has several consequences, mostly related to dangling conditions (edges incident to non-existent nodes). I will not enter this topic for now and leave it for a future posts on matching.

Nevertheless, my main slight objection is the difficulty in using other branches from mathematics. Some examples follow:
  1. MGG generalizes previous approaches to graph constraints and application conditions through so-called diagrams (see Ch. 7 in the MGG Book). In essence, they plug monadic second order logics into MGG. I think that a similar construction is a hard task for DPO/SPO not to say for adhesive HLR categories.
  2. When one studies sequences of productions and sequential independence (to what extent the order inside the sequence matters) groups of permutations arise naturally. They are easily handled in MGG (some posts on this topic to come) but I do not see an easy way (nor a difficult one) to do the same in DPO. We are thus limited for the moment, as far as I know, to study pairs of productions through the critical pairs lemma, which is a clear limitation as the results of Ch. 6 in the MGG book show.
  3. Some concepts - which I find natural - are not so straightforward to define. What is called the nihil matrix in MGG (Sec. 4.4 in the MGG book; basically elements that "should not be") does not have a clear counterpart. It is one of the fundamental pieces to build bridges between MGG and complex analysis (some preliminar results can be found in this paper).
  4. Complexity theory is probably the most prominent area of modern computer science. How does one study DPO/SPO as model of computations? What are their relationships with other models such as Turing Machines and Boolean Circuits? Are there interesting submodels of computation? To the best of my knowledge there is no attempt to study this, in my opinion due to its inherent difficulty. I will dedicate several posts to this particular topic for MGG in the future.
  5. Other promising directions of research are for example the introduction of harmonic analysis. Notice that productions have a kind of linear structure, which can be studied with the Fourier transform over locally compact Abelian groups. This is my current research topic. Due to the abstractness of the pushout construction, this kind of stuff seems to lie too far from DPO/SPO.
There are other examples but I think previous points illustrate my view. Please, do not misunderstand my criticism because I do acknowledge the importance of DPO and SPO (visit this webpage for its current state and available tools). I just try to highlight the potential benefits to moving (or at least complement) from a categorical perspective to a more purely algebraic point of view, i.e. MGG. The next post will not be so long. I will try to brush over other approaches to graph dynamics.


Another quote from Alfred North Whitehead which I absolutely subscribe: Fundamental progress has to do with the reinterpretation of basic ideas.

jueves, 27 de octubre de 2011

related approaches I

Main graph transformation approaches part 1

Today I start a small series of posts that touch on the different approaches "available in the market" to graph dynamics. More material can be found in chapter 3 of the MGG book, and the reader is referred there for the missing details. Let's start saying that there is a very active community made up mainly of computer scientists dedicated to this topic. The ideas behind them are deep and the results derived after over almost 40 years of research very interesting.

Nowadays, no doubt, the most important approach to graph transformation is the one known as algebraic approach. However, I will refer to it as categorical approach because it uses category theory. There is no algebra in it. In fact, it is not a single approach: At least there exist the single pushout (SPO) and the double pushout (DPO) approaches, and a generalization known as adhesive HLR categories (AHLRC). A good book on the topic is this one.

The main advantage of using category theory, in principle, is that once a result is established, it applies to any mathematical structure that belongs to that category. However, DPO and SPO should not be thought of as theories that study a concrete category, but rather as using a categorical construction to define the application of a production to a concrete host graph (this is known as a derivation). In particular, SPO uses a pushout construction and DPO uses two pushout constructions. (This is explained in detail in pp. 22 and 23 and 41-49 in the MGG book.) The one that does study categories to which results can be extended is AHLRC. As far as I know, AHLRC only deals with DPO and in general does not apply to SPO.

The next post is about what I see as advantages and "problems" of SPO and DPO. It is just my personal view


I quote Alfred North Whitehead to finish today's post: Everything of importance has been said before by somebody who did not discover it.

sábado, 15 de octubre de 2011

a bit of history

How it all started, its current state and my future plans


Some years ago, in order to finish my phD, I looked for the advice of professor Roberto Moriyón, head of the computer science department (Escuela Politécnica Superior) at U.A.M. He kindly explained to me what the research activity was and what he thought could be more interesting for me.

So following Roberto's advice I met Juan de Lara who proposed to study distributed simulation protocols using graph transformation systems. I immediately became interested in the topic and started to study the so-called algebraic approach to graph transformation. Actually it uses category theory. (I will comment on this and other approaches in a future post.)

Not much time passed before I started to miss a real algebraic approach to graph transformation and it seemed to me that it should not be too difficult to begin with one. So I sent to Juan a new thesis proposal (in fact, seven in a few weeks) which would become the seeds of Matrix Graph Grammars. In them I included an algebraic (Boolean) characterization of production (a production is just a function - or morphism or application - that transforms one graph into another graph), an initial characterization of sequential independence (to what extent the order of productions inside a sequence matters) and some comments on parallelism (in essence, if two productions can be applied in any order without altering the resulting graph).
We then started to develop such approach by studying completion, coherence, initial digraphs, composition, matching, sequentialization, parallelism, restrictions (graph constraints and application conditions) and reachability. I will dedicate some posts to all of them. In some hard-to-explain sense, I feel that they are a "closed" set of results. This is basically what the Matrix Graph Grammars book include.

My intention for the future is to write a second volume, to get to complexity theory. The first few results can be found here. I need to present MGG as a model of computation, which is not foreseen to be very difficult. I'll touch on this too, but probably not soon. Some topics that I would also love to include are termination and confluence (basically, existence and uniqueness) but it takes time... We'll see.


Erwin Schrödinger once wrote: No self is of itself alone.

viernes, 30 de septiembre de 2011

(tentative) intentions

Roadmap for the next months


My plan for the short-mid term for the blog is to provide a conceptual approach to graph transformation, keeping aside technicalities and concentrating mainly on the ideas, as proposed by Goldreich et al.

My (tentative) roadmap is the following: a few posts revisiting the history and background of MGG and related topics. I will comment on other approaches to graph dynamics. Then we will check the main concepts of MGG, "informally" so to speak: completion, coherence, initial digraphs, composition, matching, sequentialization, parallelism, restrictions (graph constraints and application conditions) and reachability. I will try to propose directions for further research if it seems to me that I have something sensible to say.

This will possibly amuse myself for several months. Later, or maybe in the meanwhile, I will touch on topics such as labelling, multigraphs and some others. More advanced topics will be also addressed. As we progress, we will be hopefully entering the realms of complexity theory.

From time to time I will insert non-related topics if I'm aware of something interesting in the world of mathematics. The main topic here is discrete mathematics but in principle I do not close the door to any interesting stuff.


Donald Knuth: The most important thing in the programming language is the name. A language will not succeed without a good name. I have recently invented a very good name and now I am looking for a suitable language.

lunes, 19 de septiembre de 2011

MGG blog starts running!

Finally, I have decided to start this blog on Matrix Graph Grammars in blogger. Some of the entries were previously published in a blog that I maintained in my own server... but I gave up... this is easier, cheaper, ..., oh, dude.

I will try to maintain this blog entries as regularly as possible, but unfortunately this does not mean once per day or even once per week. My intention is to comment on what I'm currently investigating, mainly focused on matrix graph grammars, but it is possible that I might include other (un)related topics.

I'd like to include a quote in every post. The following one from Aristotle is illuminating: one swallow does not make a summer, nor does one day; and so too one day, or a short time, does not make a man blessed and happy.