1 Introduction

A graph parameter is a function that associates with every graph a positive integer. One of the most famous graph parameters is tree-width, which was defined by Robertson and Seymour in [58]. See [3] for an overview on tree-width. Tree-width bounded graphs are interesting from an algorithmic point of view since several NP-complete graph problems can be solved in polynomial time on graph classes of bounded tree-width using dynamic programming [1, 2, 36, 48].

A further well known graph parameter is clique-width which was defined by Courcelle and Olariu in [23] through a composition mechanism for vertex-labeled graphs. The NLC-width of a graph was defined by Wanke in [63] by a composition mechanism similar to that for clique-width. Both parameters are more powerful than tree-width, since the clique-width and NLC-width of a graph can be bounded in its tree-width, but not vice versa.

Clique-width and NLC-width bounded graphs are also interesting from an algorithmic point of view. Several NP-complete graph problems can be solved in polynomial time on graph classes of bounded clique-width. For example, all graph properties which are expressible in monadic second order logic with quantifications over vertices and vertex sets (MSO1-logic) are decidable in linear time on clique-width bounded graphs which are given with an appropriate clique-width k-expression [19, 22]. Also by using fly-automata problems expressible in MSO1-logic can be solved if the graphs are given with a k-expression [18]. Furthermore, there are also a lot of NP-complete graph problems which are not expressible in MSO1-logic like Hamiltonicity, partition problems, and bounded degree subgraph problems but which can also be solved in polynomial time on clique-width bounded graphs [24, 26, 33, 47, 62, 63]. In order to apply these algorithms non-optimal expressions are sufficient. Such expressions can be found by the result shown in [56]: For every fixed k for every given graph G one can compute in polynomial time a clique-width g(k)-expression or assert that the clique-width of G is greater than k.

Distance-hereditary graphs have clique-width at most 3 [30]. The set of all graphs of clique-width at most 2 or NLC-width 1 is the set of all co-graphs, i.e. P 4-free graphs. Brandstädt et al. have analyzed the clique-width of graphs defined by forbidden induced one-vertex extensions of P 4 [8]. The clique-width and NLC-width of permutation graphs, interval graphs, grids, and planar graphs is not bounded [30]. Every graph of tree-width at most k has clique-width at most 3⋅2k − 1 [14]. See [46] for a survey on the clique-width of graph classes.

The recognition problem for graphs of clique-width or NLC-width at most k is still open for k ≥ 4 and k ≥ 3, respectively. The problem whether a graph has clique-width at most 3 is decidable in polynomial time [12] and the problem whether a graph has NLC-width at most 2 is also decidable in polynomial time [45, 51]. By the characterization in terms of co-graphs, it can be decided in linear time whether a graph has clique-width at most 2 or NLC-width 1 [13]. Computing NLC-width and computing clique-width is NP-hard [28, 34]. But the clique-width of tree-width bounded graphs is computable in linear time [27]. An approach to determine the clique-width using an encoding to propositional satisfiability (SAT) which is evaluated by a SAT solver was presented in [40]. This approach was extended by a combinatorial characterization of clique-width in [21].

A graph transformation f is a transformation that creates a new graph f(G 1, …, G n ) from a number of n ≥ 1 input graphs G 1, …G n . Examples are taking an induced subgraph of a graph, adding an edge to a graph, and generating the join of two graphs. A graph operation is a graph transformation which is deterministic and invariant under isomorphism. Examples are the edge complementation of a graph and generating the join of two graphs.Footnote 1 The graph theory books by Bondy and Murty [5] and by Harary [38] include a large number of transformations on graphs.

The impact of graph operations which can be defined by monadic second order formulas (so-called MS transductions) on graph parameters can often be shown in a very short way although the bounds are rough ones [15, 19].

Transformations that reduce graphs can be used to characterize sets of graphs by forbidden graphs. The property that a graph has tree-width at most k is preserved under the transformation taking minors, which is used to show that the set of graphs of tree-width at most k can be characterized by a finite set of forbidden minors [57].

Oum and Seymour introduced in [56] the rank-width of graphs, which is defined independently of vertex labels, but which is shown to be as powerful as clique-width. In [55] it is shown that the property that a graph has rank-width at most k is preserved under the transformation taking local complementation, which leads to a characterization of graphs of rank-width at most k by finitely many forbidden vertex-minors (i.e. taking induced subgraphs and local complementations).

It is still open if there exists a graph transformation that does not increase NLC-width or clique-width and which can be used to characterize graphs of NLC-width at most k or clique-width at most k by a set of finitely many forbidden subgraphs. Such characterizations would lead polynomial time recognition algorithms for the corresponding graph classes.

The effect of graph transformations on graph parameters is well studied, e.g. for band-width in [10], for tree-width in [3], for clique-width briefly in [16, 41], and for rank-width in [41]. The behavior of clique-width and NLC-width under various graph operations is considered in this paper, which is organized as follows. In Section 2, we recall the definitions of clique-width and NLC-width. In Section 3, we give an overview on the effect of the binary transformations join, disjoint union, union, products, corona, substitution, and 1-sum on the clique-width and NLC-width of given graphs. In Section 4, we consider the latter problem for the unary graph transformations quotient, subgraph, edge complement, bipartite edge complement, power of graphs, line graphs, local complementation, switching, Seidel complementation edge addition, edge subdivision, vertex identification, and vertex addition. For the transformations local complementation and Seidel complementation we even can bound the clique-width and NLC-width of every graph which is equivalent to a given graph, i.e. every graph which can be obtained by applying an arbitrary number of one of these transformations. In Section 5, we summarize our results, give extensions to directed and linear versions of clique-width and NLC-width, some conclusions, and an outlook.

2 Preliminaries

Graphs

We work with finite undirected graphs G = (V G , E G ), where V G is a finite set of vertices and E G ⊆ {{u, v}∣u, vV G , uv} is a finite set of edges.Footnote 2 For a vertex vV G we denote by N G (v) the set of all vertices which are adjacent to v in G, i.e. N G (v) = {wV G | {v, w} ∈ E G }. Vertex set N G (v) is called the set of all neighbors of v in G or neighborhood of v in G. Please note that v does not belong to N G (v). The degree of a vertex vV G , denoted by degG(x), is the number of neighbors of vertex v in G, i.e. degG(v) = |N G (v)|. We are discussing graphs only up to isomorphism. This allows us to define the path on n vertices P n = ({v 1, …, v n },{{v 1, v 2},…,{v n − 1, v n }}), which will be useful in several examples. For the definition of further special graphs we refer to the book of Brandstädt et al. [9].

Labeled Graphs

In order to define clique-width and NLC-width, we need finite undirected labeled graphs G = (V G , E G , lab G ), where V G is a finite set of vertices labeled by some mapping lab G : V G → [k] and E G ⊆ {{u, v}∣u, vV G , uv} is a finite set of edges. The labeled graph consisting of a single vertex labeled by a ∈ [k] is denoted by ∙ a . Most of the definitions for unlabeled graphs can be applied to labeled graphs. Thus, we just want to mention subgraphs and isomorphism for labeled graphs.

A labeled graph J = (V J , E J , lab J ) is a subgraph of G if V J V G , E J E G and lab J (u) = lab G (u) for all uV J . J is an induced subgraph of G if additionally E J = {{u, v} ∈ E G u, vV J }. Two labeled graphs G and J are isomorphic if there is a bijection f : V G V J that preserves adjacencies and the labelings, i.e. {u, v} ∈ E G ⇔{f(u), f(v)} ∈ E J and lab G (u) = lab J (f(u)) for all uV G .

Clique-Width

The notion of clique-widthFootnote 3 for labeled graphs is defined by Courcelle and Olariu in [23] as follows.

Definition 1 (Clique-width, 23)

Let k be some positive integer. The class CW k of labeled graphs is recursively defined as follows.

  1. 1.

    The single vertex graph ∙ a for some a ∈ [k] is in CW k .

  2. 2.

    Let G = (V G , E G , lab G )∈CW k and J = (V J , E J , lab J )∈CW k be two vertex-disjoint labeled graphs, then

    $$G \oplus J:=(V^{\prime},E^{\prime},\text{lab}^{\prime})$$

    defined by V : = V G V J , E : = E G E J , and

    $$\text{lab}^{\prime}(u) \ := \ \left\{\begin{array}{ll} \text{lab}_{G}(u) & \text{if } u \in V_{G}\\ \text{lab}_{J}(u) & \text{if } u \in V_{J} \end{array} \right.$$

    for every uV is in CW k .

  3. 3.

    Let a, b ∈ [k] be two distinct integers and G = (V G , E G , lab G )∈CW k be a labeled graph, then

    1. (a)

      ρ ab (G):=(V G , E G , lab) defined by

      $$\text{lab}^{\prime}(u) \ := \ \left\{\begin{array}{ll} \text{lab}_{G}(u) & \text{if } \text{lab}_{G}(u) \not= a\\ b & \text{if } \text{lab}_{G}(u) = a \end{array} \right.$$

      for every uV G is in CW k and

    2. (b)

      η a, b (G) := (V G , E , lab G ) defined by

      $$E^{\prime}:=E_{G} \cup \{ \{u,v\} \mid u,v \in V_{G},~u\not=v,~\text{lab}(u)=a,~\text{lab}(v)=b \}$$

      is in CW k .

The clique-width of a labeled graph G, cw(G) for short, is the least integer k such that G ∈ CW k .

An expression X built with the operations ∙ a , ⊕, ρ ab , η a, b for integers a, b ∈ [k] is called a clique-width k-expression. If integer k is known from the context or irrelevant for the discussion, then we sometimes use the simplified notion expression for the notion k-expression. The graph defined by expression X is denoted by val(X). Every unlabeled graph G = (V, E) is considered as the labeled graph (V, E, lab) where lab:V → [1].

Example 1 (Clique-width expressions)

The following two clique-width expressions X 1 and X 2 define the labeled graphs G 1 and G 2 in Fig. 1.

$$X_{1}=\eta_{1,2}((\rho_{2 \to 1}(\eta_{1,2}(\bullet_{1} \oplus \bullet_{2}))) \oplus \bullet_{2})$$
$$X_{2}= \rho_{1 \to 2}(\eta_{2,3} (((\eta_{1,2}(\bullet_{1} \oplus \bullet_{2})) \oplus (\eta_{1,2}(\bullet_{1} \oplus \bullet_{2}))) \oplus \bullet_{3}))$$
Fig. 1
figure 1

Two labeled graphs G 1 and G 2 defined by expressions X 1 and X 3 and by expressions X 2 and X 4, respectively

Since the clique-width edge insertion operations can be arranged in several ways, it is sometimes useful to restrict to special clique-width expressions.

  • A clique-width expression X is irredundant, if for every subexpression η a, b (X ) of X, in the graph val(X ) no vertex labeled by a is adjacent to a vertex labeled by b. In [23] it is shown that every graph which can be defined by a clique-width k-expression can also be defined by an irredundant clique-width k-expression.

  • A clique-width expression X is separated, if for every subexpression X X of X, the set of labels of the graph defined by X is disjoint from the set of labels of the graph defined by X . Every clique-width k-expression can be transformed into an equivalent separated clique-width 2k-expression, see [23].

NLC-Width

The notion of NLC-widthFootnote 4 of labeled graphs is defined by Wanke in [63] as follows.

Definition 2 (NLC-width, 23)

Let k be some positive integer. The class NLC k of labeled graphs is recursively defined as follows.

  1. 1.

    The single vertex graph ∙ a for some a ∈ [k] is in NLC k .

  2. 2.

    Let G = (V G , E G , lab G )∈NLC k and J = (V J , E J , lab J )∈NLC k be two vertex-disjoint labeled graphs and S ⊆ [k]2 be a relation, then

    $$G \times_{S} J := (V^{\prime},E^{\prime},\text{lab}^{\prime})$$

    defined by V : = V G V J ,

    $$E^{\prime}:=E_{G} \cup E_{J} \cup \{\{u,v\} \mid u \in V_{G},~v \in V_{J},~(\text{lab}_{G}(u),\text{lab}_{J}(v)) \in S \},$$

    and

    $$\text{lab}^{\prime}(u) \ := \ \left\{\begin{array}{ll} \text{lab}_{G}(u) & \text{if } u \in V_{G}\\ \text{lab}_{J}(u) & \text{if } u \in V_{J} \end{array} \right.$$

    for every uV is in NLC k .

  3. 3.

    Let G = (V G , E G , lab G )∈NLC k and R : [k] → [k] be a function, then

    $$\circ_{R}(G) := (V_{G},E_{G},\text{lab}^{\prime})$$

    defined by

    $$\text{lab}^{\prime}(u) := R(\text{lab}_{G}(u))$$

    for every uV G is in NLC k .

The NLC-width of a labeled graph G, nlcw(G) for short, is the least integer k such that G ∈ NLC k .

An expression X built with the operations ∙ a , × S , ∘ R for a ∈ [k], S ⊆ [k]2, and R : [k] → [k] is called an NLC-width k-expression. If integer k is known from the context or irrelevant for the discussion, then we sometimes use the simplified notion expression for the notion k-expression. The graph defined by expression X is denoted by val(X). Every unlabeled graph G = (V, E) is considered as the labeled graph (V, E, lab) where lab:V → [1].

Example 2 (NLC-width expressions)

The following two NLC-width expressions X 3 and X 4 define the labeled graphs G 1 and G 2 in Fig. 1.

$$X_{3}= (\bullet_{1} \times_{\{(1,1)\}} \bullet_{1})\times_{\{(1,2)\}} \bullet_{2}$$
$$X_{4}=\circ_{\{(1,2),(2,2),(3,3)\}}(((\bullet_{1} \times_{\{(1,2)\}}\bullet_{2})\times_{\emptyset} (\bullet_{1} \times_{\{(1,2)\}}\bullet_{2}))\times_{\{(2,3)\}}\bullet_{3})$$

In contrast to clique-width expressions, NLC-width expressions are always irredundant.

Expression Trees

Every NLC-width k-expression X has by its recursive definition a tree structure that is called the NLC-width k-expression-tree for X. This tree T is an ordered rooted tree whose leaves correspond to the vertices of graph val(X) and the inner nodesFootnote 5 correspond to the operations of X, see [31]. In the same way we define the clique-width k-expression-tree for every clique-width k-expression, see [27]. If integer k is known from the context or irrelevant for the discussion, then we sometimes use the simplified notion expression-tree for the notion k-expression-tree. For some node u of expression-tree T, let T(u) be the subtree of T rooted at u. Note that tree T(u) is always an expression-tree. The expression X(u) defined by T(u) can simply be determined by traversing the tree T(u) starting from the root, where the left children are visited first. X(u) defines a (possibly) relabeled induced subgraph G(u) of G. For an inner node v of some expression-tree T and a leaf u of T(v) we define by lab(u, G(v)) the label of that vertex of graph G(v) that corresponds to u. A node u of T is called a predecessor of a node u of T if u is on a path from u to a leaf. A node u of T is called the least common predecessor of two nodes u 1 and u 2 if u is a predecessor of both nodes u 1, u 2, and no child of u is a predecessor of u 1, u 2.

Graph Parameters and Relations

There is a very close relation between the clique-width and the NLC-width of a graph. We denote two expressions X 1 and X 2 as equivalent, if the unlabeled versions of val(X 1) and val(X 2) are isomorphic.

Theorem 1 (44)

Every clique-width k-expression can be transformed into an equivalent NLC-width k-expression and every NLC-width k-expression can be transformed into an equivalent clique-width 2k-expression. Thus, for every graph G it holds

$$ \text{nlcw}(G)\leq \text{cw}(G)\leq 2\cdot \text{nlcw}(G). $$
(1)

In this paper we also refer to the notion of tree-widthFootnote 6 of a graph G, tw(G) for short, which was defined in the 1980s by Robertson and Seymour in [58] by the existence of a tree-decomposition and to the notion of rank-width of a graph G, rw(G) for short, which was introduced by Oum and Seymour in [56].

Theorem 2 (Proposition 6.3 of 56)

Every clique-width k-expression can be transformed into an equivalent rank-width k-expression and every rank-width k-expression can be transformed into an equivalent clique-width 2 k+1 −1-expression. Thus, for every graph G it holds

$$ \text{rw}(G)\leq \text{cw}(G)\leq 2^{\text{rw}(G)+1}-1. $$
(2)

The proof idea of Proposition 6.3 in [56] immediately leads the following bounds for NLC-width. The upper bound is lower, since NLC-width allows creating edges between equally labeled vertices.

Theorem 3

Every NLC-width k-expression can be transformed into an equivalent rank-width k-expression and every rank-width k-expression can be transformed into an equivalent NLC-width 2 k -expression. Thus, for every graph G it holds

$$ \text{rw}(G)\leq \text{nlcw}(G)\leq 2^{\text{rw}(G)}. $$
(3)

3 Binary Graph Operations and Graph Transformations

Let \(G_{1}=(V_{G_{1}},E_{G_{1}})\) and \(G_{2}=(V_{G_{2}},E_{G_{2}})\) be two non-empty graphs and let f be some binary graph operation which creates a new graph f(G 1, G 2) from G 1 and G 2. In this section we consider the NLC-width and clique-width of graph f(G 1, G 2) with respect to the NLC-width or clique-width of G 1 and G 2.

3.1 Disjoint Union

The disjoint union of two vertex-disjoint graphs G 1 and G 2, denoted by G 1G 2, is the graph with vertex set \(V_{G_{1}} \cup V_{G_{2}}\) and edge set \(E_{G_{1}} \cup E_{G_{2}}\). Since NLC-width and clique-width operations both contain the disjoint union it is easy to see that

$$\text{nlcw}(G_{1} \oplus G_{2})=\max(\text{nlcw}(G_{1}),\text{nlcw}(G_{2}))$$

and

$$\text{cw}(G_{1} \oplus G_{2})=\max(\text{cw}(G_{1}),\text{cw}(G_{2})).$$

These bounds imply that the NLC-width and clique-width of a graph can be computed by the maximum NLC-width or clique-width of its connected components.

3.2 Join

The join of two vertex-disjoint graphs G 1 and G 2, denoted by G 1G 2, is the graph with vertex set \(V_{G_{1}} \cup V_{G_{2}}\) and edge set

$$E_{G_{1}} \cup E_{G_{2}} \cup \{\{v_{1},v_{2}\}~|~v_{1}\in V_{G_{1}},v_{2}\in V_{G_{2}}\}.$$

It is obviously that

$$\text{nlcw}(G_{1} \otimes G_{2})=\max(\text{nlcw}(G_{1}),\text{nlcw}(G_{2}))$$

and

$$\text{cw}(G_{1} \otimes G_{2})=\max(\text{cw}(G_{1}),\text{cw}(G_{2}),2).$$

Since NLC-width does not change when building the edge complement graph (cf. Section 4.8) we conclude that the NLC-width of a graph also can be computed by the maximum NLC-width of its co-connected components, i.e. the connected components of the edge complement graph.

3.3 Union

The union of two graphs G 1 and G 2 with \(V_{G_{1}}=V_{G_{2}}\), denoted by G 1G 2, is the graph defined by the edge \(E_{G_{1}} \cup E_{G_{2}}\). Thus two vertices are adjacent in G 1G 2 if and only if they are adjacent in G 1 or they are adjacent in G 2.

Let G 1 be the disjoint union of m paths P n , each represented by a row in the adjacency matrix for G 1, and G 2 be the disjoint union of n paths P m , each represented by a column in the adjacency matrix for G 2. Then the union G 1G 2 is an n × m grid. Since paths have clique-width at most 3 and an n × m-grid has clique-width at least min(n, m) + 1 [30], it is not possible to bound the clique-width of G 1G 2 in the clique-width of G 1 and G 2, even if G 1 and G 2 are of bounded tree-width.

3.4 Substitution

Let G 1 and G 2 be two vertex-disjoint graphs and let \(v\in V_{G_{1}}\) a vertex. The substitution of v by G 2 in G 1, denoted by G 1[v/G 2], is the graph with vertex set \(V_{G_{1}}\cup V_{G_{2}} - \{v\}\) and edge set

$$E_{G_{1}}\cup E_{G_{2}} - \{\{v,w\} ~|~ w\in N_{G_{1}}(v)\} \cup \{\{u,w\}~|~u\in V_{G_{2}}, w\in N_{G_{1}}(v)\}.$$

Next we consider the NLC-width and clique-width of graph G 1[v/G 2].

Theorem 4

Let G 1 and G 2 be two vertex-disjoint graphs and \(v\in V_{G_{1}}\) a vertex, then it holds

$$\text{nlcw}(G_{1}[v/G_{2}])=\max(\text{nlcw}(G_{1}),\text{nlcw}(G_{2}))$$

and

$$\text{cw}(G_{1}[v/G_{2}])=\max(\text{cw}(G_{1}),\text{cw}(G_{2})).$$

Proof

Let G 1 be a graph of NLC-width k 1, \(v\in V_{G_{1}}\) a vertex, and G 2 be a graph of NLC-width k 2. Let T 1 be an NLC-width k 1-expression-tree for G 1 and T 2 be an NLC-width k 2-expression-tree for G 2. Next we construct from T 1 and T 2 an expression-tree T for G 1[v/G 2]. We start with a copy T of T 1. Let x be the leaf of T that corresponds to vertex v. We relabel x from ∙ into ∘ R , R(a) = for a ∈ [k 2]. Then we insert a copy of T 2 in T and make the root of the copy of T 2 adjacent to leaf x of T. The resulting tree is an expression-tree for G 1[v/G 2] using max(k 1, k 2) labels.

The clique-width result can be shown in the same way, see Lemma 3.4 in [23]. □

Vertex set \(V_{G_{2}}\) is also called a module of the graph G 1[v/G 2], since all vertices of \(V_{G_{2}}\) have the same neighbors in the graph G 1[v/G 2]. The substitution operation and quotient operation (cf. Section 4.5) are used in [44] and [22] to show that the NLC-width and clique-width of a graph can be obtained by the maximum NLC-width or clique-width of its prime subgraphs appearing as quotient graphs in a modular decomposition.

3.5 Product

A graph product of two vertex-disjoint graphs G 1 and G 2 is a new graph whose vertex set is \(V_{G_{1}} \times V_{G_{2}}\) and for two vertices (u 1, u 2) and (v 1, v 2) the adjacency in the product is defined by the adjacency, equality, or non-adjacency of u 1 and v 1 in G 1 and of u 2 and v 2 in G 2. Several results on graph products can be found in [38, 42, 43]. We consider the well known possibilities to define graph products shown in Table 1.

Table 1 Graph products

The cartesian, categorical, normal, and co-normal graph product applied to two paths P n and P m yields a graph whose clique-width cannot be bounded independently from n and m. Thus it is not possible to bound the clique-width of the cartesian, categorical, normal, or co-normal graph product in the clique-width of the involved graphs.

The lexicographic graph product, which is also known as graph composition, of two graphs G 1 and G 2 is denoted by G 1[G 2]. Let G 0 = G 1 and \(V_{G_{1}}=\{v_{1},\ldots ,v_{n}\}\). Then

$$G^{i}=G^{i-1}[v_{i}/G_{2}], ~~i=1,\ldots,n$$

is a sequence of n substitutions, such that G n defines graph G 1[G 2]. Thus we can apply Theorem 4 to obtain the following results.

Corollary 1

Let G 1 and G 2 be two vertex-disjoint graphs, then it holds

$$\text{nlcw}(G_{1}[G_{2}]) = \max(\text{nlcw}(G_{1}),\text{nlcw}(G_{2}))$$

and

$$\text{cw}(G_{1}[G_{2}]) = \max(\text{cw}(G_{1}),\text{cw}(G_{2})).$$

3.6 1-Sum

Let G 1 and G 2 be two vertex-disjoint graphs and let \(v\in V_{G_{1}}\) and \(w\in V_{G_{2}}\). The 1-sum of G 1 and G 2, denoted by G 1 v, w G 2, consists of the disjoint union of G 1 and G 2 in which the two vertices v and w are identified. That is, the graph G 1 v, w G 2 has vertex set \(V_{G_{1}}\cup V_{G_{2}} - \{v,w\}\cup \{z\}\) and edge set

$$\begin{array}{lcl} E_{G_{1}}\cup E_{G_{2}} &-& \{\{v,v_{1}\}\in E_{G_{1}}~|~v_{1} \in V_{G_{1}}\} \\ &-& \{\{w,w_{1}\}\in E_{G_{2}}~|~w_{1} \in V_{G_{2}}\} \\ &\cup&\{\{z,z_{1}\}~|~z_{1}\in N_{G_{1}}(v)\cup N_{G_{2}}(w)\}. \end{array} $$

Next we consider the NLC-width and clique-width of graph G 1 v, w G 2.

Theorem 5

Let G 1 and G 2 be two vertex-disjoint graphs, \(v\in V_{G_{1}}\) be a vertex, and \(w\in V_{G_{2}}\) be a vertex. For m 1 = max(nlcw(G 1 ), nlcw(G 2 )) it holds

$$m_{1}\leq \text{nlcw}(G_{1}\oplus_{v,w}G_{2})\leq m_{1}+1$$

and for m 2 = max(cw(G 1 ), cw(G 2 )) it holds

$$m_{2}\leq \text{cw}(G_{1}\oplus_{v,w}G_{2})\leq m_{2}+1.$$

Proof

Let G 1 be a graph of NLC-width k 1, \(v\in V_{G_{1}}\) a vertex, G 2 be a graph of NLC-width k 2, and \(w\in V_{G_{2}}\) a vertex. Let T 1 be an NLC-width k 1-expression-tree for G 1 and T 2 be an NLC-width k 2-expression-tree for G 2. We now construct an expression-tree T for the graph G 1 v, w G 2 from T 1 and T 2, which uses m 1+1 labels.

We start with a copy T of T 2. Let x be the leaf of T that corresponds to the vertex w. We relabel x to \(\bullet _{m_{1}+1}\) in order to substitute the vertex w by the vertex z. Now we consider all union nodes x 1 on the path from x to the root of T in T. If x is a left (right) child of x 1 and union node x 1 is labeled by × S and (lab(x, G(x 1)), ) ∈ S ((, lab(x, G(x 1))) ∈ S) for some ∈ [k 2] then we relabel x 1 by \(\times _{S^{\prime }}\), where S = S∪{(m 1+1, ) | (lab(x, G(x 1)), ) ∈ S, ∈ [k 2]} (S = S∪{(, m 1+1) | (, lab(x, G(x 1))) ∈ S, ∈ [k 2]}). This is done in order to make in G 1 v, w G 2 all vertices adjacent to z which are adjacent to w in G 2.

We insert a new root r labeled by ∘ R and an edge from r to the old root of T into T. The relabeling R maps every label from [m 1] to m 1+1 and label m 1+1 to , if the leaf y in T 1 which corresponds to vertex v is labeled by ∙ . Formally we have R : [m 1+1]→[m 1+1] and R(a) = m 1+1 if 1 ≤ am 1 and R(a) = if a = m 1+1.

Further we insert a copy of T 1 in T and replace the leaf y by the root r. The labeling for the vertex z ensures that all vertices which are adjacent to v in G 1 become adjacent to z in G 1 v, w G 2. The new root of T is the root of T 1. Now T defines the graph G 1 v, w G 2.

Since G 1 and G 2 are induced subgraphs of G 1 v, w G 2, the NLC-width of G 1 v, w G 2 is at least the maximum of the values NLC-width(G 1) and NLC-width(G 2).

In the same way we can show the clique-width result. The only difference is that we have to ensure a non-used label to realize the relabeling operation. We can assume that m 2>1 (otherwise cw(G 1 v, w G 2)=1) and thus there is some label ∈[m 2], , if the leaf y in T 1 which corresponds to vertex v is labeled by ∙ . Then the relabeling of tree T where w is labeled by m 2+1 can be done as follows. First we map all labels from [m 2] to , then we map label m 2+1 to , and finally we map label to m 2+1. The obtained tree can be glued to tree T 1 as described above. □

The shown NLC-width bounds are tight for m 1 = 1 and m 1 = 2, which can be verified by the 1-sums P 2 v, w P 3 and P 5 v, w P 6, where v and w are vertices of degree 1 within the involved paths.

If v and w in the definition of the 1-sum are not isolated vertices in G 1 and G 2 the new vertex z is also called an articulation vertex of the graph G 1 v, w G 2, since G 1 v, w G 2 without z has more connected components than G 1 v, w G 2. The maximal connected subgraphs of some graph G without any articulation vertex are called blocks of G. The bounds of Theorem 5 imply that the NLC-width and clique-width of a graph can be bounded by the maximum NLC-width or clique-width of its blocks and its number of blocks. By a deeper analysis in [4, 53] it has been shown that the clique-width of a graph can be bounded by the maximum clique-width of its blocks plus 2, which implies that every graph of clique-width k contains a block whose clique-width is at least k − 2.

3.7 Corona

The corona of graphs was introduced by Frucht and Harary in [29], when constructing a graph whose automorphism group is the wreath product of the two component automorphism groups. The corona of two vertex-disjoint graphs G 1 and G 2, denoted by G 1G 2, consists of the disjoint union of one copy of G 1 and \(|V_{G_{1}}|\) copies of G 2 and each vertex of the copy of G 1 is connected to all vertices of one copy of G 2, i.e. \(|V_{G_{1}}|\cdot |V_{G_{2}}|\) edges are inserted in the disjoint union of the \(|V_{G_{1}}|+1\) graphs.

The corona of G 1 and G 2 can also be obtained by applying 1-sum operations as follows. Let \(V_{G_{1}}=\{v_{1},\ldots ,v_{n}\}\) be the vertex set of G 1. For i = 1…, n we take a copy of G 2 and insert a dominating vertex w i (cf. Section 4.1) to that copy and obtain a graph G 2, i . Then by the sequence of 1-sums

$$(\ldots((G_{1}\oplus_{v_{1},w_{1}}G_{2,1})\oplus_{v_{2},w_{2}}G_{2,2})\ldots)\oplus_{v_{n},w_{n}}G_{2,n}$$

we obtain the corona G 1G 2. By this observation, we can bound the NLC-width and the clique-width of G 1G 2 in the NLC-width or the clique-width of its combined graphs by applying the idea of the proof of Theorem 5 on every leaf of an expression-tree for G 1.

Theorem 6

Let G 1 and G 2 be two vertex-disjoint graphs. Further let m 1 = max(nlcw(G 1 ), nlcw(G 2 )), then it holds

$$m_{1}\leq \text{nlcw}(G_{1} \wedge G_{2}) \leq m_{1} +1$$

and for m 2 = max(cw(G 1 ), cw(G 2 )) it holds

$$m_{2}\leq \text{cw}(G_{1} \wedge G_{2}) \leq m_{2} +1.$$

4 Unary Graph Operations and Graph Transformations

Let G = (V G , E G ) be a non-empty graph and f be some unary graph transformation which creates a new graph f(G) from G. In this section we consider the NLC-width and clique-width of the graph f(G) with respect to the NLC-width or clique-width of graph G.

4.1 Vertex Deletion and Vertex Addition

Vertex Deletion

Let G be a graph and vV G . By Gv we denote the graph which we obtain from G by removing vertex v and all edges incident to v. That is,

$$G-v=(V_{G}-\{v\},E_{G} - \{\{v,v^{\prime}\}~|~v^{\prime}\in N(v)\}).$$

Next we consider the NLC-width and clique-width of graph Gv.

Theorem 7

Let G be a graph and v ∈ V G , then it holds

$$1/2\cdot \text{nlcw}(G) \le\text{nlcw}(G-v)\le \text{nlcw}(G)$$

and

$$1/2\cdot\text{cw}(G) \le\text{cw}(G-v)\le \text{cw}(G). $$

Proof

An NLC-width k-expression-tree and also a clique-width k-expression-tree for the graph Gv can be obtained by a k-expression-tree T for the graph G by removing the leaf x corresponding to vertex v and some obvious cleaning of the tree because operations at predecessors of x lost one input.

Since we can obtain G by inserting v into Gv Theorem 8 leads the lower bounds. □

Vertex Addition

Let G be a graph, NV G , and vV G . By G + N v we denote the graph which we obtain from G by inserting vertex v with neighborhood N(v) = N. That is,

$$G+_{N} v=(V_{G}\cup\{v\},E_{G}\cup \{\{v,v^{\prime}\}~|~v^{\prime}\in N\}).$$

In the special case where N(v) = {v } for some v V G we call v a pendant vertex and where N(v) = V G we call v a dominating vertex.

Next we consider the NLC-width and clique-width of graph G + N v.

Theorem 8

Let G be a graph, N ⊆ V G , and v ∉ V G , then it holds

$$\text{nlcw}(G) \le\text{nlcw}(G+_{N} v)\le 2\cdot \text{nlcw}(G)$$

and

$$\text{cw}(G) \le\text{cw}(G+_{N} v)\le 2\cdot \text{cw}(G). $$

Proof

Let G be a graph of NLC-width k, NV G , vV G be a vertex, and T be an NLC-width k-expression-tree that defines the graph G. We now define an NLC-width 2k-expression-tree that defines the graph G + N v. We start with a copy T of T.

First we separate the neighborhood of v from the non-neighborhood by introducing k further labels k + 1,…,2k. Every leaf of T that corresponds to a vertex from G which is not from N will be relabeled from label ∙ a , a ∈ [k], into ∙ a + k .

Then we consider all nodes x on the paths from these relabeled leaves to the root of the so defined tree. If node x is a union node labeled by some × S , S ⊆ [k]2, then we relabel x by \(\times _{S^{\prime }}\) where S = {(a, b),(a, b + k),(a + k, b),(a + k, b + k) | (a, b) ∈ S}. If node x is a relabeling node labeled by some ∘ R , R : [k] → [k], then we relabel x by \(\circ _{R^{\prime }}\), where R :[2k] → [2k] and R (a) = R(a), if ik and R (a) = R(a) + k, if k + 1 ≤ a ≤ 2k. The resulting tree is denoted by T .

In a last step we insert two additional nodes t v and t r labeled by ∙1 and ×{(1, a) | a ∈ [k]}, respectively and two additional arcs from t r to t v and from t r to the root of T in T , such that t v is the left child of t r .

The resulting tree is denoted by T ″′. The tree T ″′ is an NLC-width 2k-expression-tree and T ″′ defines the graph G + N v.

Since we can obtain G by removing v from G + N v, Theorem 7 leads the lower bounds.

To prove the corresponding clique-width bound, we can construct a clique-width 2k-expression-tree T which defines the same graph as the tree T defined above using the same ideas as for NLC-width. Then we have to find a label for vertex v, which is not used in the graph defined by G(T ), since clique-width does not allow edge insertions between equal labeled vertices. This can be done by relabeling all vertices G(T ) labeled by k + 1,…,2k by e.g. k + 1 and then we can take, for k ≥ 2, one of the free labels e.g. label 2k to label the inserted vertex v. In the case k = 1, G consists of isolated vertices and G + N v is the disjoint union of one K 1, p , for some p, and isolated vertices. Thus also in this case G + N v has clique-width 2k = 2. □

The shown NLC-width bounds are tight for graphs of width 1 and 2. If we insert a vertex in a path of length 2 to get a path of length 3, we insert a vertex in a graph of NLC-width 1 and obtain a graph of NLC-width 2. If we insert vertex v in the graph Hv of Fig. 2, we insert a vertex in a graph of NLC-width 2 and obtain a graph of NLC-width 4.

Fig. 2
figure 2

The graph G has NLC-width 2. The graph H can be obtained from G by adding edge e and H has NLC-width 4

Since the addition of a dominating vertex will be used in several of our constructions (cf. Sections 3.7 and 4.12) we state the following result.

Corollary 2

Let G be a graph and v ∉ V G , then it holds

$$\text{nlcw}(G+_{V_{G}} v) =\text{nlcw}(G)$$

and

$$\text{cw}(G+_{V_{G}} v)=\max(\text{cw}(G),2).$$

Further it is possible to bound the NLC-width and clique-width of G + N v in the NLC-width and clique-width of G and the vertex degree d = |N| of v. The main idea is to label each vertex of G which should be adjacent to vertex v by a new label from {k + 1,…, k + d}. Then, the new vertex can easily be inserted in a last step. If we use clique-width operations we first have to relabel at least one of the used labels from {1,…, k} to get a free label in order to insert the new vertex.

Corollary 3

Let G be a graph, N ⊆ V G , d = |N|, and v ∉ V G , then it holds

$$\text{nlcw}(G) \le\text{nlcw}(G+_{N} v)\le \text{nlcw}(G)+d $$

and

$$\text{cw}(G) \le\text{cw}(G+_{N} v)\le \text{cw}(G)+d. $$

The addition of a vertex of high degree d = |V G |−d can be done more efficiently by adding a vertex of degree d in the edge complement and building the edge complement of the result. By the NLC-width bound of Section 4.8 we get the following result.

Corollary 4

Let G be a graph, N⊆V G , d=|V G |−|N|, and v∉V G , then it holds

$$\text{nlcw}(G) \le\text{nlcw}(G+_{N} v)\le \text{nlcw}(G)+d.$$

For clique-width the latter approach does not lead a better bound than that of Theorem 8.

4.2 Edge Addition and Edge Deletion

Let G be a graph and v, wV G two vertices. For {v, w}∉E G we define by G + {v, w} the graph we obtain from G by adding edge {v, w}. That is,

$$G+\{v,w\}=(V_{G},E_{G}\cup\{\{v,w\}\}).$$

For {v, w} ∈ E G we define by G − {v, w} the graph we obtain from G by deleting edge {v, w}. That is,

$$G-\{v,w\}=(V_{G},E_{G}-\{\{v,w\}\}).$$

Our next theorem shows that we can insert or delete an edge in a graph using at most 2 more labels.

Theorem 9

Let G be a graph and v,w ∈ V G be two different vertices, then it holds

$$\text{nlcw}(G) - 2\le\text{nlcw}(G\pm\{v,w\})\le \text{nlcw}(G) + 2$$

and

$$\text{cw}(G) - 2\le\text{cw}(G\pm\{v,w\})\le \text{cw}(G) + 2.$$

Proof

In order to show the upper bound on NLC-width, let G be a graph of NLC-width k and let v and w be two non-adjacent vertices of G. Further, let T be an NLC-width k-expression-tree that defines G. We now define an NLC-width (k + 2)-expression-tree that defines G + {v, w}. We start with a copy T of T. Let x and y be the leaves of T that correspond to vertices v and w, respectively, of the graph G. First, we relabel leaf x and y in T by ∙ k + 1 and ∙ k + 2, respectively.

Next we consider all union nodes x 1 on the path from x to the root of T in T . If x is a left (right) child of x 1 and union node x 1 is labeled by × S and (lab(x, G(x 1)), ) ∈ S ((, lab(x, G(x 1))) ∈ S) for some ∈ [k] then we relabel x 1 by \(\times _{S^{\prime }}\), where S = S∪{(k + 1, ) | (lab(x, G(x 1)), ) ∈ S, ∈ [k]} (S = S∪{(, k + 1) | (, lab(x, G(x 1))) ∈ S, ∈ [k]}). This is done in order to make all vertices which are adjacent to v in G also adjacent to v in G + {v, w}. In the same way we modify all union nodes on the path from y to the root of T in order to preserve the adjacencies of w in G + {v, w}.

Last we relabel the least common predecessor z of x and y in T to create the edge between v and w. Since z is always a union node in T , z is labeled by × S for some S ⊆ [k]2. If x is the left (right) child and y is the right (left) child of z in T then we relabel z by × S∪{(k + 1, k + 2)} S∪{(k + 2, k + 1)}).

The resulting tree is denoted by T . The tree T is an NLC-width (k + 2)-expression-tree and T defines the graph G + {v, w}.

The proof for edge deletion runs similar, we just have to leave out the above described relabeling of the least common predecessor z of x and y in T to create the edge between v and w.

For the lower bounds assume that H is obtained from G by inserting (deleting) an edge e and it holds NLC-width(H) < NLC-width(G)−2. Then by deleting (inserting) edge e from (in) H we obtain some graph G which is isomorphic to G. By our shown upper bound we conclude that NLC-width(G ) < NLC-width(G), which leads to a contradiction.

The results for clique-width can be shown by similar arguments. □

If we add or delete an edge in a graph of NLC-width 1, i.e. a co-graph, then we always obtain a graph of NLC-width at most 2, since we can label both end vertices of the new edge (both end vertices of the deleted edge) by the same label 2.

The graphs in Fig. 2 can be used to show that the NLC-width bounds of Theorem 9 cannot be improved for k = 2. For the edge addition we observe that the graph G has NLC-width 2 and the graph H, which we obtain after inserting edge e = {v, w} in G, has NLC-width 4 which was found by a computer program.Footnote 7 For the edge deletion we notice that the complement graph \(\overline {G}\) of G has NLC-width 2 and contains edge {v, w}. If we remove edge {x, y} from \(\overline {G}\) we obtain the graph \(\overline {H}\) which has NLC-width 4.

Our last theorem gives an answer of Question 6.3 of [23], which asks how different the clique-width of two graphs can be if they differ by exactly one edge. It remains to verify whether the given clique-width bounds of Theorem 9 are tight.

Problem 1

Is there a graph G and v, wV G , such that |cw(G)−cw(G + {v, w})|=2? Is there a graph H and {v, w} ∈ E H , such that |cw(H)−cw(H − {v, w})|=2? Or can the results on the clique-width of Theorem 9 be improved?

4.3 Edge Subdivision

Let G be some graph uV G , and {v, w} ∈ E G . The subdivision of {v, w} in G, S u b d i v(G, v, w) for short, has vertex set V G ∪{u} and edge set E G − {{v, w}}∪{{v, u},{w, u}}. The subdivision operation is also known as elementary refinement.

Next we analyze the effect of an edge subdivision on the NLC-width and clique-width of a given graph.

Theorem 10

Let G be a graph and {v,w}∈E G an edge, then it holds

$$\text{nlcw}(G) - 2 \le\text{nlcw}(Subdiv(G,v,w))\le \text{nlcw}(G) + 2$$

and

$$\text{cw}(G) - 2\le\text{cw}(Subdiv(G,v,w))\le \text{cw}(G) + 2.$$

Proof

First we want to show the upper bound for NLC-width. Let G be a graph of NLC-width k and let {v, w} be an edge of G. Let T be an NLC-width k-expression-tree that defines G. We now define an NLC-width (k + 2)-expression-tree that defines S u b d i v(G, v, w).

Let T be defined for T as in the proof of Theorem 9 for edge removing. In T we insert a new root r labeled by ×{(k + 1, k + 1),(k + 2, k + 1)} and a new node z (defining the vertex u which subdivides edge {v, w}) labeled by ∙ k + 1 and two edges, one from r to z and one from r to the root of T such that z is the right child of r.

The resulting tree is denoted by T . Then T is an NLC-width (k + 2)-expression-tree and it is easy to show that T defines the graph S u b d i v(G, v, w).

For the lower bounds assume that the graph S u b d i v(G, v, w) is obtained from G by subdividing an edge {v, w} and NLC-width(S u b d i v(G, v, w))<NLC-width(G)−2. Then we obtain by removing the inserted vertex u and inserting {v, w} in S u b d i v(G, v, w) a graph G isomorphic to graph G with NLC-width(G ) < NLC-width(G), by our upper bound in Theorem 9, and thus a contradiction.

Since clique-width operations do not allow edge insertions between equal labeled vertices, we have to do one additional relabeling ρ k + 1→k + 2 in order to label vertices v and w in the proof of Theorem 9 by k + 2 before inserting the new vertex in T. □

The upper bound for NLC-width(S u b d i v(G, v, w)) of Theorem 10 cannot be improved, since first subdividing an edge and deleting the new vertex corresponds to edge deletion, which needs two additional labels in general, see Fig. 2.

In the appendix of [23] it is shown that in a graph G of clique-width at least 4 every path of length at least 5, consisting of vertices which all have degree 2 in G and one end vertex of degree 1 in G, can be extended by subdivisions without increasing the clique-width of G.

There are several examples where a subdivision increases NLC-width and clique-width, e.g. a P 3, and several examples where a subdivision does not change NLC-width and clique-width, e.g. a P 4. It remains open, whether a subdivision can decrease the NLC-width and clique-width of graphs.

Problem 2

Is there some graph G and an edge {v, w} ∈ E G , such that nlcw(S u b d i v(G, v, w))<nlcw(G) or cw(S u b d i v(G, v, w))<cw(G)?

At least after subdividing all edges of a graph the resulting graph is bipartite. If we subdivide every edge of a graph G we obtain the so-called incidence graph I(G) of the graph G. Incidence graphs have unbounded clique-width in general, but incidence graphs of graphs of bounded tree-width have bounded clique-width, since subdivisions do not change the tree-width. The following very close bound has been shown in [7].

$$ \text{cw}(I(G)) \leq \text{tw}(G)+3 $$
(4)

Since there exist graphs of tree-width k and clique-width at least \(2^{\lfloor \frac {k}{2} \rfloor -1}\) by [14], the transformation from I(G) to G can increase clique-width exponentially. Further applications of bound (4) can be found in [17].

4.4 Vertex Identification and Edge Contraction

For some graph G and two different vertices v, wV G the identification of v and w in G, I d e n t(G, v, w) for short, has vertex set V G − {v, w} ∪ {u} and edge set

$$\begin{array}{lcl} E_{G}&- & \{\{v^{\prime},v^{\prime\prime}\}~|~ v^{\prime}\in V_{G}, v^{\prime\prime}\in\{v,w\}\}\\ &\cup& \{\{v^{\prime},u\}~|~ v^{\prime}\not\in\{v,w\} \text{ and }\{v^{\prime},v\}\in E_{G} \text{ or } \{v^{\prime},w\}\in E_{G}\}. \end{array} $$

Next we analyze the identification of two vertices in a graph with respect to the NLC-width and clique-width of the involved graphs.

Theorem 11

Let G be a graph and v,w ∈ V G , then it holds

$$1/4\cdot \text{nlcw}(G) \le\text{nlcw}(Ident(G,v,w))\le 2\cdot \text{nlcw}(G)$$

and

$$1/4\cdot \text{cw}(G) \le\text{cw}(Ident(G,v,w))\le 2\cdot \text{cw}(G).$$

Proof

For the upper bound we can delete v, w and insert u with neighborhood N(v) ∪ N(w) (cf. Theorem 8). The lower bound holds since we can obtain G from I d e n t(G, v, w) by removing u and inserting the vertices v and w, each with a factor of 2 (cf. Theorem 8). □

If the two vertices v and w of an identification are adjacent, i.e. {v, w} ∈ E G , we call the corresponding operation edge contraction, which is a well known minor operation. Courcelle has shown in [16] that there is a graph of clique-width 3, which yields a graph of clique-width greater than 3 by the contraction of a single edge. This disproves Conjecture 4.4 in [49] on the closure of graphs of bounded clique-width under edge contractions.

In the appendix of [23] it is shown that in a graph G of clique-width at least 4 every path of length at least 2, consisting of vertices which all have degree 2 in G and one end vertex of degree 1 in G, can be decreased by edge contractions without increasing the clique-width of G.

4.5 Subgraph

Subgraph

For an arbitrary subgraph H of a graph G, and thus also for an arbitrary minor, the clique-width of H and NLC-width of H cannot be bounded in the clique-width or NLC-width of G. This can easily be shown by the example of complete graphs, which all have NLC-width 1 and clique-width 2, while their subgraphs may have arbitrary large NLC-width and clique-width. By taking the number of removed edges into account, the bounds of Section 4.2 can be used to estimate the NLC-width and clique-width of subgraphs.

Induced Subgraph

Since every induced subgraph H of a graph G can be realized by vertex deletions, by Section 4.1 it holds

$$\text{nlcw}(H)\leq \text{nlcw}(G)$$

and

$$\text{cw}(H)\leq \text{cw}(G).$$

Although taking induced subgraphs does not increase the NLC-width and clique-width of a graph, characterizations for the classes NLC k , k ≥ 2, and CW k , k ≥ 3, by sets of forbidden induced subgraphs are unknown until now.

Quotient

If we remove all but one vertices of a module V V G from graph G, we denote the obtained graph as a quotient graph of G. Since every quotient graph of G is an induced subgraph of G, the quotient operation does not increase NLC-width or clique-width.

4.6 Power of a Graph

The d-th power G d of a graph G is a graph with the same set of vertices as G and an edge between two vertices if and only if there is a path of length at most d between them. Suchan and Todinca have shown in [62] the following bound.

$$\text{nlcw}(G^{d}) \le 2\cdot(d+1)^{\text{nlcw}(G)} $$

4.7 Line Graph

The line graph L(G) of a graph G has a vertex for every edge of G and an edge between two vertices if the corresponding edges of G are adjacent [64]. For some line graph L(G), the graph G is called the root graph of L(G). Even for complete graphs K n , the line graph operation generates graphs whose NLC-width cannot be bounded in the NLC-width of their root graphs [34]. But it is possible to bound the NLC-width and clique-width of line graphs in the tree-width of their root graphs, and even vice versa by the following bounds, which have been shown in [34].

$$1/4\cdot (\text{tw}(G)+1) \leq \text{nlcw}(L(G)) \leq \text{tw}(G)+2 $$
$$1/4\cdot (\text{tw}(G)+1) \leq \text{cw}(L(G)) \leq 2\cdot\text{tw}(G)+2 $$

4.8 Edge Complement

The edge complement graph \(\overline {G}\) of a graph G has the same vertex set as G and two vertices in \(\overline {G}\) are adjacent if and only if they are not adjacent in G, i.e.

$$\overline{G}=(V_{G},\{\{u,v\}~|~u,v\in V_{G}, u\neq v, \{u,v\}\not\in E_{G}\}).$$

The following bounds and proof ideas are known from [63] and [23].

Theorem 12

Let G be a graph, then

$$\text{nlcw}(\overline{G})= \text{nlcw}(G)$$

and

$$1/2\cdot\text{cw}(G)\le\text{cw}(\overline{G})\leq 2\cdot\text{cw}(G).$$

Proof

Let T be an NLC-width k-expression-tree that defines the graph G. We now define a new NLC-width k-expression-tree that defines the graph \(\overline {G}\). Let T be a copy of T. Every node labeled by × S in T is relabeled by \(\times _{S^{\prime }}\), where S = {(a, b) | (a, b)∉S, a, b ∈ [k]}. Finally tree T is an NLC-width k-expression-tree and defines graph \(\overline {G}\). Since the complement of the complement graph is the original graph, the claimed equality holds true.

Let G be a graph of clique-width k. In order to show the upper bound on the clique-width of graph \(\overline {G}\) we assume that we have given a separated 2k-expression for G (cf. Section 2 and [23]), which allows to exchange the existing edges by the non-existing edges. As above, since the complement of the complement graph is the original graph, the lower bound follows. □

4.9 Bipartite Complement

Let G be a bipartite graph with vertex partition V G = V 1V 2, such that there are no edges between two vertices of V 1 and no edges between two vertices of V 2. The bipartite complement \(\overline {G}^{\text {bip}}\) of G has the same vertex set as G and its edge set is obtained by complementing the edges between V 1 and V 2, i.e.

$$\overline{G}^{\text{bip}}=(V_{G}, \{\{u,v\} ~|~ \{u,v\}\not\in E_{G}, u\in V_{1}, v\in V_{2}\}).$$

The following clique-width bound is known from [52].

Theorem 13

Let G be a bipartite graph, then

$$1/2\cdot\text{nlcw}(G)\le\text{nlcw}(\overline{G}^{\text {bip}})\leq 2\cdot\text{nlcw}(G)$$

and

$$1/4\cdot\text{cw}(G) \le\text{cw}(\overline{G}^{\text {bip}})\leq 4\cdot\text{cw}(G).$$

Proof

Let G = (V, E) be a bipartite graph of clique-width k and T be a clique-width k-expression-tree for G. By Theorem 12 there is a clique-width 2k-expression-tree T for graph \(\overline {G}\). If we denote the bipartition G by V 1V 2, then we have to choose from \(\overline {G}\) only those edges where one vertex is from V 1 and one vertex is from V 2. Therefore in [52] for every label i ∈ [2k] two labels i 1 and i 2 for the vertices in V 1 and V 2 are introduced. We modify the nodes x in T as follows.

  1. 1.

    If x is a leaf labelled by ∙ i corresponding to a vertex from V 1 then we relabel x by \(\bullet _{i_{1}}\) and if x is a leaf labelled by ∙ i corresponding to a vertex from V 2 then we relabel x by \(\bullet _{i_{2}}\).

  2. 2.

    If x represents a relabeling operation ρ ij and y is the direct predecessor of x, then we relabel x by \(\rho _{i_{1}\to j_{1}}\), insert a further node x labelled by \(\rho _{i_{2}\to j_{2}}\) into T , and two new arcs from y to x and from x to x.

  3. 3.

    If x represents an edge insertion operation η i, j and y is the direct predecessor of x, then we relabel x by \(\eta _{i_{1},j_{2}}\) and insert a further node x labelled by \(\eta _{i_{2},j_{1}}\) into T , and two new arcs from y to x and from x to x.

This leads a clique-width 4k-expression-tree for graph \(\overline {G}^{\text {bip}}\). Since the bipartite complement of the bipartite complement graph is the original graph, the lower bound follows.

The NLC-width bounds can be obtained even easier, since by Theorem 12 there is an NLC-width k-expression-tree T for graph \(\overline {G}\). Thus we can obtain an NLC-width 2k-expression-tree for graph \(\overline {G}^{\text {bip}}\). □

4.10 Local Complementation

For some graph G and a vertex vV G the local complementation L C(G, v) is defined by Bouchet in [6] as follows. The graph L C(G, v) is obtained from the graph G by replacing the subgraph of G defined by N(v) by its edge complement, i.e. L C(G, v) has vertex set V G and edge set

$$\begin{array}{lcl} E_{G} & - & \{\{u,w\}~|~u,w\in N_{G}(v), \{u,w\}\in E_{G}\} \\ &\cup &\{\{u,w\}~|~u,w\in N_{G}(v), u\neq w, \{u,w\}\not\in E_{G}\}. \end{array} $$

In Corollary 2.7 in [55] it is shown that the rank-width of a graph does not change by applying local complementations, which leads to a characterization of graphs of rank-width at most k by finitely many forbidden vertex-minors (i.e. taking induced subgraphs and local complementations).

Next we consider the NLC-width and clique-width of graph L C(G, v).

Theorem 14

Let G be a graph and v ∈ V G , then

$$1/2\cdot\text{nlcw}(G) \le\text{nlcw}(LC(G,v))\le 2\cdot \text{nlcw}(G)$$

and

$$1/3\cdot\text{cw}(G) \le\text{cw}(LC(G,v))\le 3\cdot \text{cw}(G).$$

Proof

Let T be an NLC-width k-expression-tree that defines the graph G. We now define a new NLC-width 2k-expression-tree that defines the graph L C(G, v). We start with a copy T of T. The main idea is to separate the labels of the vertices in N(v) from the labels of the vertices in VN(v). Let n = |N(v)| and \(x_{1},\ldots ,x_{n^{\prime }}\) be the leaves of T that corresponds to vertices in N(v) of G.

For every leaf x i , i = 1,…, n , we modify the nodes x on the paths from x i to the root of T in T as follows.

  1. 1.

    If x is a leaf x i , i = 1,…, n , labeled by ∙ in T , then we relabel x by ∙ + k .

  2. 2.

    If x is a relabeling node labeled by ∘ R , then we relabel x by \(\circ _{R^{\prime }}\), such that R (a) = R(a), if 1 ≤ ak and R (a) = R(ak) + k, if k + 1 ≤ a ≤ 2k.

  3. 3.

    If x is a union node labeled by × S , then we relabel x by \(\times _{S^{\prime }}\), such that S = SS 1S 2, where S 1 = {(a + k, b + k) | (a, b)∉S} and S 2 = {(a, b + k),(a + k, b) | (a, b) ∈ S}. Set S 1 creates an edge between two vertices in N(v), if and only if these vertices are not adjacent in G and set S 2 creates an edge between one vertex of V G N(v) and one vertex of N(v), if and only if these vertices are adjacent in G.

These three steps create the complement graph of the subgraph induced by N(v). The resulting tree is denoted by T . The tree T is an NLC-width 2k-expression-tree and defines graph L C(G, v).

The lower bound follows since by L(L(G, v), v) we obtain G.

For the clique-width bounds we need k additionally labels to distinguish the vertices in N(v) from those in VN(v) and k further labels to create the complement graph of the subgraph induced by vertex set N(v). □

The graph G given in Fig. 3 (which is called paw or 3-pan in [9]) shows that the local complementation can increase or decrease the NLC-width and clique-width of a graph by 1. If we apply a local complementation on one of the vertices of degree 2 in G, we obtain a path on four vertices.

Fig. 3
figure 3

The graph G on the left side and has NLC-width 1 (clique-width 2). The graph H on the right side has NLC-width 2 (clique-width 3)

The proof of Theorem 14 implies the following bounds for the NLC-width and clique-width of the graph L C(G, v) using the vertex degree of v in the graph G.

Corollary 5

Let G be a graph and v ∈ V G , then

$$\text{nlcw}(LC(G,v))\le \text{nlcw}(G) + \min(\text{nlcw}(G),\deg_{G}(v))$$

and

$$\text{cw}(LC(G,v))\le \text{cw}(G) + 2\cdot \min(\text{cw}(G),\deg_{G}(v)).$$

Two graphs G and G on the same vertex set are called locally equivalent if there is a sequence of vertices (v 1, …, v ) such that G 0 = G, G i = L C(G i − 1, v i ) for i = 1,…, and G = G .

Theorem 15

Let G be a graph and G a graph which is locally equivalent to G, then it holds

$$\text{nlcw}(G^{\prime})\le 2^{\text{nlcw}(G)}$$

and

$$\text{cw}(G^{\prime})\le 2^{\text{cw}(G)+1}-1.$$

Proof

To show the clique-width bound let G be a graph of clique-width k. By Theorem 2 we know that G has rank-width at most k. Since the rank-width of a graph does not change by applying local complementations (cf. Corollary 2.7 in [55]), every graph G which is obtained by a sequence of local complementations on G also has rank-width at most k. Applying Theorem 2, we know that G has clique-width at most 2k + 1−1.

The NLC-width bound follows in the same way by Theorem 3. □

4.11 Seidel Switching

The switching operation is defined by Seidel in connection with regular structures, such as systems of equiangular lines, strongly regular graphs, or the so-called two-graphs, see [5961]. Several examples of applications of Seidel switching can be found in algorithms, e.g. in a polynomial-time algorithm for the P 3-structure recognition problem [39] and for the construction of bi-join decomposition of graphs [25]. Let G be a graph and vV G be a vertex. The graph S(G, v) has the same vertex set as G and its edge set is the edge set of G but changing the neighbors of v to non neighbors and vice versa. That is, the graph S(G, v) has vertex set V G and edge set

$$\begin{array}{lcl} E_{G} & - & \{\{v,w\}~|~w\in V_{G}, \{v,w\}\in E_{G}\} \\ & \cup & \{\{v,w\}~|~w\in V_{G},v\neq w, \{v,w\}\not\in E_{G}\}. \end{array} $$

Next we will show that one switching operation in a graph increases or decreases its NLC-width and clique-width by at most one.

Theorem 16

Let G=(V G ,E G ) be a graph and v∈V G , then it holds

$$\text{nlcw}(G)-1 \le\text{nlcw}(S(G,v))\le \text{nlcw}(G)+1$$

and

$$\text{cw}(G)-1 \le\text{cw}(S(G,v))\le \text{cw}(G)+1.$$

Proof

Let T be an NLC-width k-expression-tree that defines G and vV G . We now define a new NLC-width (k + 1)-expression-tree that defines S(G, v). We start with a copy T of T. Let x be the leaf of T that corresponds to vertex v of G. We relabel the leaf x in T by ∙ k + 1.

Now we consider the union nodes x 1 on the path from x to the root of T in T . If x is a left (right) child of x 1 and union node x 1 is labeled by × S then we relabel x 1 by \(\times _{S^{\prime }}\), where S = S∪{(k + 1, ) | (lab(x, G(x 1)), )∉S, ∈ [k]} (S = S∪{(, k + 1) | (, lab(x, G(x 1)))∉S, ∈ [k]}). This is necessary in order do make all vertices adjacent to v which are not adjacent to v in G, and vice versa.

The resulting tree is denoted by T . The tree T is an NLC-width (k + 1)-expression-tree and T defines the graph S(G, v).

The lower bound follows since by S(S(G, v), v) we obtain G.

In order to show the bound on the clique-width of graph S(G, v) we assume that we have given an irredundant expression for G (cf. Section 2). □

The NLC-width bounds given in Theorem 16 are best possible. For the upper bound consider the graph G of NLC-width 1 in Fig. 3. A switching operation on the graph G at one of the vertices of degree 2 creates a graph H which is isomorphic to a P 4, which has NLC-width 2. Further by S(H, v) we obtain the graph G, thus the lower bound is best possible too.

Two graphs G and G on the same vertex set are called switching equivalent if there is a sequence of vertices (v 1, …, v ) such that G 0 = G, G i = S(G i − 1, v i ) for i = 1,…, and G = G . It is shown in [11] that deciding if two graphs are switching equivalent is an isomorphism complete problem.

Theorem 17

Let G be a graph and G a graph which is switching equivalent to G by sequence (v 1 ,…,v ), then it holds

$$\text{nlcw}(G^{\prime})\le 2^{\text{nlcw}(G)+\ell}$$

and

$$\text{cw}(G^{\prime})\le 2^{\text{cw}(G)+\ell+1}-1.$$

Proof

Let G = (V, E) be a graph of NLC-width k. In order to express a sequence (v 1, …, v ) of switching operations by local complementations we insert 2 vertices u 1, …, u and w 1, …, w into G, such that N(u i ) = V − {v i } and N(w i ) = V. The resulting graph G has NLC-width at most k + (cf. Section 4.1) and rank-width at most k + (cf. Theorem 3). Further the sequence of local complementations (u 1, w 1, …, u , w ) on G creates a graph G , which is isomorphic to the graph obtained by the sequence (v 1, …, v ) of switching operations on graph G. Since the rank-width of a graph does not change by applying local complementations (cf. Corollary 2.7 in [55]), graph G also has rank-width at most k + . By Theorem 3 we know that G has NLC-width at most 2k + .

The clique-width result can be obtained using the same arguments but using Theorem 2 instead of Theorem 3. □

Problem 3

Can we bound the NLC-width and clique-width of G in Theorem 17 independently from the number of applied switching operations ? (For locally equivalent graphs and Seidel complementation equivalent graphs this is possible by Theorems 15 and 19.)

4.12 Seidel Complementation

The Seidel complementation operation is defined by Limouzy in [50] in order to give a characterization for permutation graphs. Let G be a graph and vV G be a vertex. The graph S C(G, v) has the same vertex set as G and its edge set is the edge set of G but complementing the edges between the neighborhood and the non-neighborhood of v. That is, the graph S C(G, v) has vertex set V G and edge set

$$\begin{array}{lcl} E_{G} \triangle \{\{x,y\} ~|~ \{v,x\}\in E_{G}, \{v,y\}\not\in E_{G}\}, \end{array} $$

where AB = (AB) ∪ (BA) denotes the symmetric difference of two sets A and B.

Next we consider the NLC-width and clique-width of graph S C(G, v).

Theorem 18

Let G = (V G , E G ) be a graph and v ∈ V G , then it holds

$$1/2\cdot\text{nlcw}(G)-1 \le\text{nlcw}(SC(G,v))\le 2\cdot\text{nlcw}(G)+1$$

and

$$1/2\cdot\text{cw}(G)-1\le\text{cw}(SC(G,v))\le 2\cdot\text{cw}(G)+1.$$

Proof

Let T be an NLC-width k-expression-tree that defines the graph G. We now define a new NLC-width (2k + 1)-expression-tree that defines the graph S C(G, v). We start with a copy T of T. The main idea is to separate the labels of the vertices in sets {v}, N(v), and V − (N(v) ∪ {v}) pairwise from each other.

First we separate the label of vertex v. Let x 0 be the leaf of T that corresponds to vertex v of G. We relabel the leaf x 0 in T by ∙2k + 1. Now we consider the union nodes x on the path from x 0 to the root of T in T . If x 0 is a left (right) child of x and union node x is labeled by × S then we relabel x by \(\times _{S^{\prime }}\), where S = S∪{(2k + 1, ) | (lab(x, G(x)), ) ∈ S, ∈ [k]} (S = S∪{(, 2k + 1) | (, lab(x, G(x))) ∈ S, ∈ [k]}). By this process the adjacencies of v do not change.

Next we separate the labels of the vertices in V − (N(v) ∪ {v}) and complement the edges between the neighborhood and the non-neighborhood of v. Let n = |V − (N(v) ∪ {v})| and \(x_{1},\ldots ,x_{n^{\prime }}\) be the leaves of T that correspond to vertices in V − (N(v) ∪ {v}) of G. For every leaf x i , i = 1,…, n , we modify the nodes x on the paths from x i to the root of T in T as follows.

  1. 1.

    If x is a leaf x i , i = 1,…, n , labeled by ∙ in T , then we relabel x by ∙ + k .

  2. 2.

    If x is a relabeling node labeled by ∘ R , then we relabel x by \(\circ _{R^{\prime }}\), such that R (a) = R(a), if 1 ≤ ak and R (a) = R(ak) + k, if k + 1 ≤ a ≤ 2k.

  3. 3.

    If x is a union node labeled by × S , then we relabel x by \(\times _{S^{\prime }}\), such that S = SS 1S 2, where S 1 = {(a + k, b + k) | (a, b) ∈ S} and S 2 = {(a, b + k),(a + k, b) | (a, b)∉S}. Set S creates an edge between two vertices in N(v), set S 1 creates an edge between two vertices in V − (N(v) ∪ {v}), and set S 2 creates an edge between one vertex in N(v) and one vertex in V − (N(v) ∪ {v}), if and only if these vertices are not adjacent in G.

These three steps complement the edges between the neighborhood and the non-neighborhood of v. The resulting tree is denoted by T . The tree T is an NLC-width (2k + 1)-expression-tree and defines graph S C(G, v).

The lower bound follows since by S C(S C(G, v), v) we obtain G.

In order to show the bound on the clique-width of graph S C(G, v) we assume that we have given an irredundant expression for G (cf. Section 2 and [23]). □

Two graphs G and G on the same vertex set are called Seidel complementation equivalent if there is a sequence of vertices (v 1, …, v ) such that G 0 = G, G i = S C(G i − 1, v i ) for i = 1,…, and G = G .

Theorem 19

Let G be a graph and G a graph which is Seidel complementation equivalent to G, then it holds

$$\text{nlcw}(G^{\prime})\le 2^{\text{nlcw}(G)}$$

and

$$\text{cw}(G^{\prime})\le 2^{\text{cw}(G)+1}-1.$$

Proof

Let G be a graph, vV G be a vertex, and G = S C(G, v). Let G 0 be the graph obtained from G by adding a dominating vertex v 0 and \(G^{\prime }_{0}\) be the graph obtained from G by adding a dominating vertex v 0. It is easy to check that \(G^{\prime }_{0}\) can be obtained from G 0 (up to isomorphism) by applying three local complementationsFootnote 8 at v, at v 0, and again at v. This implies that the rank-width of \(G^{\prime }_{0}\) and G 0 are equal (cf. Corollary 2.7 in [55]).

Now, suppose that G 1 and G 2 are two Seidel complementation equivalent graphs. Then G 1,0 and G 2,0 (both obtained by adding a dominating vertex v 0) are locally equivalent and therefore G 1,0 and G 2,0 have the same rank-width. Then the following estimations holds.

$$\begin{array}{lclll} \text{nlcw}(G_{1}) & = & \text{nlcw}(G_{1,0}) && \text{by Corollary 2} \\ & \leq & 2^{\text{rw}(G_{1,0})} && \text{by Theorem 3} \\ & = & 2^{\text{rw}(G_{2,0})} && \text{by Corollary 2.7 in [55] } \\ & \leq & 2^{\text{nlcw}(G_{2,0})} && \text{by Theorem 3} \\ & = & 2^{\text{nlcw}(G_{2})} && \text{by Corollary 2} \end{array} $$

Using Theorem 2 instead of Theorem 3 one can prove the clique-width bound. Since graphs of clique-width 1 are edgeless and for these graphs a Seidel complementation does not change the graph, we can restrict to graphs of clique-width is at least 2, such that the addition of dominating vertices does not change the width by Corollary 2. □

5 Conclusions and Outlook

We considered a number of binary graph transformations f which create a new graph f(G 1, G 2) from two graphs G 1 and G 2. In all cases in which it is possible to bound the NLC-width and clique-width of the combined graph f(G 1, G 2) in the NLC-width and clique-width of graphs G 1 and G 2 we show how to compute the corresponding expression in linear time in the size of the corresponding expressions for G 1 and G 2. Thus our results are constructive. In Table 2 we compare these results.

Table 2 Let G 1 and G 2 be two graphs of NLC-width (or clique-width) k 1 and k 2, respectively, and f be a binary graph transformation of the first column. The second column of the table shows the upper bound of the NLC-width of graph f(G 1, G 2). The third column gives the results for clique-width

Furthermore we have shown how the NLC-width and clique-width of a given graph change if we apply certain unary graph transformation f on this graph. In all cases in which it is possible to bound the NLC-width and clique-width of the resulting graph f(G) we also show how to compute the corresponding expression in linear time in the size of the corresponding expression for G. Although clique-width is the more famous concept, we obtain in all cases closer bounds for NLC-width(f(G)) for local transformations f. In Table 3 we compare our results concerning unary graph transformations.

Table 3 Let G be a graph of NLC-width (or clique-width) k and f be a unary graph transformation of the first column. The second column of the table shows the upper bound of the NLC-width of graph f(G). The third column gives the results for clique-width

Since the computation of NLC-width and clique-width is NP-hard [28, 34], it seems to be difficult to find an optimal k-expression for some given graph. Our results may help to find an expression for some graph of interest f(G), if we have an expression for graph G and f is one of the transformations listed in Table 3. For example, we can construct an NLC-width (k + )-expression for every graph which is switching equivalent to some graph with known NLC-width k-expression, where is the number of necessary switching transformations. As well, we can construct an (k + 2)-expression for every graph which differs only by one edge from a graph with known k-expression.

Our estimations can also be made for the clique-width of directed graphs, which was defined in [23] and for the NLC-width of directed graphs, which was defined in [35]. In order to carry over the notations local complementation, switching, Seidel complementation, and edge complement, we define for some directed graph G = (V, E) its complement digraph by

$$\overline{G}=(V,\{(u,v)~|~(u,v)\not\in E, u,v\in V, u\neq v\}).$$

For the neighborhood of a vertex vV the sets \(N_{G}^{+}(v)=\{u\in V~|~ (v,u)\in E\}\), \(N_{G}^{-}(v)=\{u\in V~|~ (u,v)\in E\}\), and \(N_{G}(v)=N_{G}^{+}(v)\cup N_{G}^{-}(v)\) can be chosen. In this way all bounds of Tables 2 and 3 can be shown in the same way as done for the parameters on undirected graphs in this paper.

Furthermore linear clique-width and linear NLC-width, which are defined in [32], can be bounded when considering graph operations. One difference to the general versions of the parameters is that the linear NLC-width and the linear clique-width do not allow the disjoint union or join of two graphs on more than one vertex. Thus for the transformations listed in Table 2 the linear NLC-width and linear clique-width bounds for disjoint union rises to max(k 1, k 2)+1 and for join rises to max(k 1, k 2)+1. A further difference is that the linear clique-width of \(\overline {G}\) is at most linear clique-width of G plus 1 [32] while the linear NLC-width does not change as known from the general version. This implies that for the transformations listed in Table 3 the linear clique-width bounds for edge complement reduces to k + 1, for bipartite complement reduces to 2k + 2, and for local complementation reduces to 2k + 1. All other mentioned bounds of Tables 2 and 3 can also be shown for the linear NLC-width and the linear clique-width.

There are several open questions. In nearly all cases, it remains to show that our bounds are best possible, or to improve them. Especially the clique-width bounds on bipartite complement and local complementation seem to be improvable.

Further it remains open if there are graph transformations (cf. Section 1 for the definition), which do not increase the clique-width or NLC-width of a given graph and make the given graph smaller, in order to define useful reduction rules or a characterization by forbidden graphs for graphs of bounded clique-width or graphs of bounded NLC-width. Among our considered transformations only the induced subgraph transformation does not increase the clique-width or NLC-width, which implies that there exist characterizations by sets of forbidden induced graphs for NLC k and CW k for every integer k. Unfortunately only for NLC1 and CW2, i.e. the set of all co-graphs, these sets are known. For the sets NLC3 there is no characterization by a set of finitely many forbidden induced subgraphs, since every n-vertex cycle C n with n ≥ 11 has NLC-width 4. The same holds for the set CW3, since every n-vertex cycle C n with n ≥ 7 has clique-width 4.

It is also an open problem to find graph operations that increase or decrease the NLC-width or clique-width of some graph by a fixed constant or a fixed factor, e.g. an operation such that for every graph G there is a positive integer c such that nlcw(f(G)) = c + nlcw(G) or nlcw(f(G)) = c⋅nlcw(G). This would imply a useful means in order to decrease NLC-width or clique-width in a controlled way. For rank-width the transformation from G = (V, E) into the bipartite graph B(G) = (V , E ), where V = V × {1,2,3,4} and

$$E^{\prime}=\{\{(v,i),(v,i+1)\}~|~ v\in V, i\in[3]\} \cup \{\{(v,1),(w,4)\}~|~ \{v,w\}\in E\}$$

increases the width by a factor of c = 2, see Lemma 5.3 in [54].