Graph decompositions for cartesian products

Abstract In this paper we describe an algorithmic construction that, given a tree-decomposition of a graph G and a path-decomposition of a graph H , provides a tree-decomposition of the cartesian product of G and H . From the latter, we derive upper bounds on the treewidth and on the pathwidth of the cartesian product, expressed in terms of the treewidth and of the pathwidth of the two involved graphs. On the other hand, in the context of graph grammars and graph logic, we prove that the cartesian product of a class of graphs by a finite set of graphs preserves the property of being a context-free set, and if the graphs in the finite set are all connected, the property of being an MS -definable set is also preserved.