Domino Treewidth - CiteSeerX

2 downloads 0 Views 381KB Size Report
Hans L. Bodlaender. Joost Engelfriety. Abstract. We consider a special variant of tree-decompositions, called domino tree- decompositions, and the related ...
Domino Treewidth

Hans L. Bodlaender

Joost Engelfriet

UU-CS-1994-11 February 1994



Utrecht University

Department of Computer Science Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands, Tel. : + 31 - 30 - 531454

Domino Treewidth

Hans L. Bodlaender

Joost Engelfriet

Technical Report UU-CS-1994-11 February 1994

Department of Computer Science Utrecht University P.O.Box 80.089 3508 TB Utrecht The Netherlands

ISSN: 0924{3275

Domino Treewidth Hans L. Bodlaender



Joost Engelfriet

y

Abstract

We consider a special variant of tree-decompositions, called domino treedecompositions, and the related notion of domino treewidth. In a domino tree-decomposition, each vertex of the graph belongs to at most two nodes of the tree. We prove that for every k, d, there exists a constant c such that a graph with treewidth at most k and maximum degree at most d has domino treewidth at most c . The domino treewidth of a tree can be computed in O(n2 log n) time. There exist polynomial time algorithms that | for xed k | decide whether a given graph G has domino treewidth at most k. If k is not xed, this problem is NP-complete. The domino treewidth problem is hard for the complexity classes W [t] for all t 2 N, and hence the problem for xed k is unlikely to be solvable in O(n ), where c is a constant, not depending on k. k;d

k;d

c

1 Introduction A topic of much recent research in algorithmic graph theory is the treewidth of graphs. Applications of this research range from VLSI theory to expert systems (and many more). (See e.g., [5] for an overview.) In this paper, we introduce a special variant of treewidth: domino treewidth. This notion is derived from the usual notion of treewidth, by additionally requiring that every vertex v 2 V belongs to at most two node sets Xi. (See Section 2 for the precise de nitions.) Our interest in this notion is largely due to a maybe somewhat surprising result: for graphs of bounded degree and bounded treewidth, there is a uniform upper bound on the domino treewidth. The proof of this result is given in Section 3. We also investigate the algorithmic aspects of domino treewidth. In Section 5, we show that the problem to determine the domino treewidth of a given graph is NP-hard, and also is hard Department of Computer Science, Utrecht University, P.O. Box 80.089, 3508 TB Utrecht, the Netherlands. This author was partially supported by the ESPRIT Basic Research Actions of the EC under contract 7141 (project ALCOM II). y Department of Computer Science, Leiden University, P.O. Box 9512, 2300 RA Leiden, the Netherlands. This author was supported by the ESPRIT Basic Research Working Group COMPUGRAPH II. 

1

for the complexity classes W [t], for all t 2 N. The latter result tells us that it is unlikely that the problem, for xed k, to decide whether a given graph has domino treewidth  k, can be solved in O(nc) time, where c is a constant, not depending on k. Some special cases can be solved in polynomial time: for xed k, one can check in polynomial time whether the domino treewidth of a given graph is at most k. For trees, the domino treewidth can be computed in O(n log n) time. These results are shown in Section 4. 2

2 De nitions and preliminary results The notion of treewidth has been introduced by Robertson and Seymour [17].

De nition. A tree-decomposition of a graph G = (V; E ) is a pair (fXi j i 2 I g; T = (I; F )) with fXi j i 2 I g a collection of subsets of V , and T = (I; F ) a tree, such that

 Si2I Xi = V  for all edges fv; wg 2 E there is an i 2 I with v; w 2 Xi  for all i; j; k 2 I : if j is on the path from i to k in T , then Xi \ Xk  Xj . The width of a tree-decomposition (fXi j i 2 I g; T = (I; F )) is maxi2I jXij, 1. The treewidth of a graph G = (V; E ) is the minimum width over all tree-decompositions of G.

Let (fXi j i 2 I g; T = (I; F )) be a tree-decomposition of G = (V; E ). For each vertex v 2 V , we let Tv be the subgraph of T , induced by fi 2 I j v 2 Xig. Condition (iii) above can be rephrased as: for every v 2 V , Tv is connected, or as: for every v 2 V , Tv is a tree. We use size(G) to denote the number of vertices of G, and deg(v) to denote the degree of vertex v. The degree of G is the maximum degree of its vertices.

De nition. A tree-decomposition (fXi j i 2 I g; T = (I; F )) of G = (V; E ) is a domino tree-decomposition, if for every vertex v 2 V , size(Tv )  2, i.e., every vertex belongs to at most two sets Xi . The domino treewidth of a graph G is the minimum width over all domino tree-decompositions of G.

Equivalently, the de nition of a domino tree-decomposition is obtained from the rst de nition by changing its third condition into the following requirement: for all i; j 2 I , if i 6= j and fi; j g 62 F , then Xi \ Xj = ;. For a connected graph G, this means that T is the intersection graph of the family fXi j i 2 I g. Note that if d is the maximum degree of a graph G and k is its domino treewidth, then d  2k. Hence the domino treewidth of a graph is at least half its maximum degree. This shows, e.g., that there is no bound on the domino treewidth of trees. 2

Figure 1: A domino tree-decomposition As an example, the graph G in Figure 1 (and any similar graph) has domino treewidth 3. The dotted lines indicate a domino tree-decomposition of width 3. Note that domino tree-decompositions are easy to visualize. One easily observes that G has treewidth 2: G is outerplanar and all outerplanar graphs have treewidth  2 (see e.g., [3]). A well-known lemma for tree-decompositions is the following.

Lemma 1 Let (fXi j i 2 I g; T = (I; F )) be a tree-decomposition of G = (V; E ). Let v ; v ; : : : ; vr be a path in G. Suppose v 2 Xi , vr 2 Xk , and j is on the path from i to k in T . Then Xj \ fv ; : : : ; vr g = 6 ;. 0

1

0

0

A slightly stronger variant holds for domino tree-decompositions. The following lemma will be used later in this paper.

Lemma 2 Let (fXi j i 2 I g; T = (I; F )) be a domino tree-decomposition of G = (V; E ). Let v ; v ; : : : ; vr be a path in G. Suppose v 2 Xi , vr 2 Xk , and j is on the path from i to k in T , j = 6 i, j =6 k. Then jXj \ fv ; : : : ; vr gj  2. Proof: By Lemma 1, Xj \fv ; : : : ; vr g =6 ;. Suppose that Xj \fv ; : : : ; vr g = fv g. Let j 0 be the unique node with j 0 = 6 j and v 2 Xj0 . As the neighbors of v on the 0

1

0

0

0

0

path do not belong to Xj , they must belong to Xj0 . Either j is on the path from j 0 to i in T , or on the path from j 0 to k in T . Suppose the former. If = 0, then v 2 Xj \ Xj0 \ Xi, and i 6= j 0 : contradiction with dominoness. If > 0, then v , 2 Xj0 , and hence, by Lemma 1, Xj \ fv ; : : : ; v , g 6= ;, contradiction. In the case that j is on the path from j 0 to k, we can obtain a contradiction in a similar way. We conclude that Xj contains at least two vertices from the path v ; : : : ; vr . 2 1

0

1

0

3

Another well-known lemma is the following (for a short proof, see e.g. [9]).

Lemma 3 Let (fXi j i 2 I g; T = (I; F )) be a tree-decomposition of G = (V; E ). Suppose W  V forms a clique in G. Then there must be a node i 2 I with W  Xi .

3 Bounded treewidth and degree corresponds with bounded domino treewidth In this section, we give the proof of a structural result: graphs with bounded degree and bounded treewidth have bounded domino treewidth. A result like this was rst shown in the context of graph grammars in [14]. The proof of this result is rather lengthy, and will be given with the help of several lemmas. First, we introduce some notions, needed for the proof. For technical reasons, we assume in this section that the trees T taken from treedecompositions are rooted. This induces rootedness of each Tv in a natural way: the root of Tv is the node of Tv that is closest to the root of T . For a node i of a rooted tree, the parent of i and children of i (if they exist) are de ned in the usual way. The rank of i is the number of children of i. The rank of a tree is the maximum rank of its nodes. A leaf is a node of rank 0. Whenever we write down a tree arc fi; j g as (i; j ), this implicitly means that i is the parent of j , i.e., i is closer to the root of T than j . The height of a tree is the maximum distance between the root and the leaves. If i is a node, and T a tree, we sometimes denote the fact that x is a node of T as x 2 T . Also for technical reasons, we will, for each tree-decomposition, x a mapping : I ! P (E ), such that

 for every i 2 I , fv; wg 2 (i): fv; wg  Xi.  for every fv; wg 2 E , there is a unique i 2 I with fv; wg 2 (i). Note, that by the second condition of tree-decomposition, such a mapping always exists (but, in general, there may be more than one). The mapping xes a distribution of the edges of G over the nodes in I . Let XT = (fXi j i 2 I g; T = (I; F )) be a tree-decomposition of G = (V; E ), and let mapping and subtrees Tv be de ned as in Section 2 and above. Let v 2 V , and let i 2 I be a node in Tv (i.e., v 2 Xi). We say that i is a useful node of Tv , if there exists an edge fv; wg 2 (i), otherwise we say that i is a useless node of Tv . Our rst aim is to transform a tree-decomposition in such a way, that the tree has no useless nodes of rank 0 or 1 (cf. Lemma 7.) We start with removing useless nodes of degree 1. 4

We say that a tree-decomposition XT has property (U1), if for every vertex v 2 V , Tv has no useless nodes of degree 1.

Lemma 4 Let (fXi j i 2 I g; T = (I; F )) be a tree-decomposition of G = (V; E ) of width k. There exists a tree-decomposition (fYi j i 2 I g; T = (I; F )) of G = (V; E ) of width  k that has property (U1). Proof: If i is a useless node of Tv of degree 1, then remove i from Tv , i.e., remove v from Xi. Repeat this procedure as long as possible. The resulting treedecomposition has property (U1), and width  k. 2 We need some extra terminology. Let XT = (fXi j i 2 I g; T = (I; F )) be a tree-decomposition, let the subtrees Tv and mapping be as before. For every node i 2 I , de ne

chainXT (i) = fv 2 Xi j i is a useless node of rank 1 in Tv g For an arc (i; j ) of T (recall that the notation means that i is the parent of j ), de ne

passXT (i; j ) = chainXT (i) \ Xj Note that if j , j 0 are distinct children of i, then passXT (i; j ) \ passXT (i; j 0) = ;. We de ne maxp(XT ) = maxfjpassXT (i; j )j j (i; j ) 2 F g

Lemma 5 For every k, r 2 N, there exist k0 , r0 2 N, such that for every graph G = (V; E ) and for every tree-decomposition XT of G with property (U1) and of width  k, with the rank of T  r, if maxp(XT ) > 0, then there exists a treedecomposition XT 0 = (fXi0 j i 2 I 0 g; T 0 = (I 0 ; F 0)) of G with property (U1) and of width  k0 with the rank of T 0  r0 , such that maxp(XT 0 ) < maxp(XT ). Moreover the height and size of T 0 are at most the height and size of T , respectively. Proof: We begin by making an intermediate tree-decomposition XT 00, ful lling the property, that for every arc (i; j ), either jpassXT 00 (i; j )j < maxp(XT ), or for every arc (j; h) it holds that jpassXT 00 (j; h)j < maxp(XT ).

Proposition 6 For every k, r 2 N, there exist k00, r00 2 N, such that for every graph G = (V; E ) and for every tree-decomposition XT of G with property (U1) and of width  k, with the rank of T  r, if maxp(XT ) > 0, then there exists a tree-decomposition XT 00 = (fXi00 j i 2 I 00 g; T 00 = (I 00 ; F 00 )) of G with property (U1) and of width  k00 with the rank of T 00  r00, such that for every arc (i; j ) in T 00, either jpassXT 00 (i; j )j < maxp(XT ), or for every arc (j; h) it holds that jpassXT 00 (j; h)j < maxp(XT ). Moreover the height and size of T 00 are at most the height and size of T , respectively.

5

Proof: We say that an arc (i; j ) is maximal, if jpassXT (i; j )j = maxp(XT ), and

we say that a node i is maximal, if it has a maximal arc (i; j ). The idea of the construction is to fold certain paths of T , that consist of maximal arcs (i; j ), all with the same set of vertices passXT (i; j ). These vertices can then be removed from the folded path. We rst de ne these paths. To this aim, we de ne a marking of the nodes and arcs of T , in a top-down fashion. A node can either stay unmarked, or can be marked as initial, middle, or nal. An arc (i; j ) can either stay unmarked, or can be marked with the set of vertices passXT (i; j ). We now describe the marking procedure in detail. Consider a node i of T , and assume that the nodes and arcs on the path from i to the root already have been considered. Let h be the parent of i, if existing. We distinguish two cases.

Case 1. The arc (h; i) is unmarked, or i is the root of T . If i is a maximal node,

then mark i as initial, and mark each maximal arc (i; j ) with passXT (i; j ). After that, consider the children of i.

Case 2. The arc (h; i) is marked with the set of vertices . If there exists an arc

(i; j ) with passXT (i; j ) = , then mark this arc with , and mark i as middle. Such an arc is necessarily unique. If there is no such arc, then mark i as nal. After that, consider the children of i. It should be clear that the marked subgraph of T is a disjoint collection of trees. Each such tree has a root, marked initial, which is of rank at least 1; all other nodes in such a tree are marked either as middle, in which case they have rank 1, or as nal, in which case they have rank 0. Moreover, all the arcs on one path from the initial node to a nal node have the same mark; we will call this the mark of the path. Note that the marks of distinct paths are disjoint. Figure 2(a) shows an example of a marked subtree (in which all unlabeled nodes are marked `middle', and  ,  are disjoint sets of vertices); the gure also shows some (unmarked) arcs that do not belong to the marked subtree. We now describe the procedure, that computes the desired tree-decomposition XT 00. Perform the following steps for each marked subtree of T . 1

2

1. Identify the initial node with all the nal nodes. The resulting node of T 00 is called a bridge node. 2. For each path from the initial node to a nal node, let i ; : : : ; i be the middle nodes on the path,  0. For , 1   , identify i with i , , i.e., i with i , i with i , , i with i , , etc. The resulting nodes of T 00 are called folded nodes. 1

+1

2

1

3

1

2

3. De ne the sets Xj00 of folded or bridge nodes as the union of the sets Xi of the corresponding identi ed nodes. The mapping 00 is obtained similarly. (However, see below at point 5!) 6

initial 2

1

bridge

1

2

1

2

1

2

1

2

(b)

final 1 final (a)

Figure 2: (a) A marked subtree of T . (b) The folded marked subtree.

7

4. Unmarked nodes of T will stay the same in XT 00, with the same values for Xi and . These will be called the old nodes of T 00. 5. For each folded node j , remove  from Xj00 , where  is the mark of the path to which the corresponding middle nodes belong. In other words, each marked path from an initial node to a nal node is folded in two, and the vertices in the mark of that path are removed from the sets Xi. Note that if in Step 2, is odd, then the node that is half-way the path is not identi ed with another node. Figure 2(b) shows how the marked subtree of Figure 2(a) is folded. The nodes of T 00 are shown as shaded circles, containing the corresponding identi ed nodes of T (where all unlabeled nodes of T 00 are folded nodes). We rst prove that XT 00 is a tree-decomposition of G. It is easy to see that after we have applied Steps 1 { 4, we still have a tree-decomposition XT  of G. For each path from an initial node to a nal node with mark , the middle nodes are useless nodes of rank 1 in Tv for every v 2 . Hence, in Tv, the corresponding folded nodes form a chain of useless nodes of rank 1, ending in a useless leaf. So, we can safely remove v from all Xj for all folded nodes j (as in the proof of Lemma 4), which is done in Step 5. Since at most r + 1 nodes are identi ed with each other, the width of XT 00 is at most (r + 1)(k + 1) , 1, and the rank of T 00 is at most (r + 1)r. It remains to show that XT 00 has property (U1) and the property, stated in the proposition. For the second property, it is clearly sucient to show that for every arc (i; j ) in T 00:  if j is a folded node, then jpassXT 00 (i; j )j = 0.  if i is an old node or a bridge node, then jpassXT 00 (i; j )j < maxp(XT ). We rst show that if j is a folded node, then jpassXT 00 (i; j )j = 0. Consider a path from an initial node i to a nal node i , and let i ; : : : ; i be the middle nodes on the path, in top-down order. Let  be the mark of the path. First, we consider the case that i and j are both folded nodes. Suppose i is the result of identifying i and i , , and j is the result of identifying i and i , . Suppose v 2 passXT 00 (i; j ). Then v 62 , (i; j ) is an arc of Tv00, and i is a useless node of rank 1 in Tv00. Then, by the third property of tree-decomposition, either (i ; i ) or (i , ; i , ) is an arc of Tv , and i and i , , when belonging to Tv , are useless in Tv . The arcs (i ; h) with h 6= i and the arcs (i , ; h0), h0 6= i , do not belong to Tv , otherwise, i has rank more than 1 in Tv00. In the case that (i ; i ) is an arc of Tv , then we obtain that v 2 passXT (i ; i ) = , contradiction. In the case that (i , ; i , ) is an arc of Tv , then we obtain that v 2 passXT (i , ; i , ) = , contradiction. The remaining case is that (i , ; i , ) is an arc of Tv , but (i , ; i , ) is not. In this case, i , is a useless leaf of Tv , which contradicts property (U1). So, if i and j are both folded nodes, then passXT 00 (i; j ) = ;. 0

+1

1

+1

+1

+1

+1

+1

+1

+1

+2

+1

+1

+1

+1

+1

+2

+2

+1

8

+2

+1

The other case to consider is that i is a bridge node. Suppose i is the result of identifying i with all nal nodes, including i , and suppose j is the result of identifying i with i . Assume that v 2 passXT 00 (i; j ). As before, we have that v 62 , and either (i ; i ) or (i ; i ) is an arc of Tv . In the case that (i ; i ) is an arc of Tv , we obtain that v 2 passXT (i ; i ). In the case that (i ; i ) is an arc of Tv , we obtain that i is a useless leaf of Tv . In both cases, we have a contradiction. This proves that if j is a folded node, then jpassXT 00 (i; j )j = 0. Next, we show that for old nodes i, jpassXT 00 (i; j )j < maxp(XT ). j is either an old node, or the result of an identi cation of some nodes, one of which is a child of i. Let j be the node in T , corresponding to j , such that there is an arc (i; j ) in T . Since (i; j ) is unmarked in T , (i; j ) is not maximal, and hence jpassXT (i; j )j < maxp(XT ). Clearly, passXT (i; j ) = passXT 00 (i; j ): i is a useless node of rank 1 in Tv , if and only if it is a useless node of rank 1 in Tv00. Hence jpassXT 00 (i; j )j < maxp(XT ). We now show that for bridge nodes i, jpassXT 00 (i; j )j < maxp(XT ). Let i be the initial node, and f ; : : : ; fm be the nal nodes of T , corresponding to i. There are three cases. 0

+1

1

0

1

+1

0

0

1

1

+1

+1

0

0

0

0

0

0

0

1

Case 1. There is an unmarked arc (i ; j ), such that j corresponds to j . Consider v 2 passXT 00 (i; j ). Then (i ; j ) is in Tv , and hence v 62 passXT (i ; h) for all h 6= j 0

0

0

0

0

0

0

(otherwise, we would get a contradiction with the rank of i in Tv ). So, every child h of i with v 2 Xh corresponds to a node h0 in T 00 with v 2 Xh000 . It follows that v 2 passXT (i ; j ). As (i ; j ) is unmarked, and hence not maximal, we have that jpassXT 00 (i; j )j  jpassXT (i ; j )j < maxp(XT ). 0

0

0

0

0

0

0

0

Case 2. There is a marked arc (i ; j ), such that j corresponds to j and j is 0

0

0

0

a middle node. Then j is a folded node, and hence, by the proof given above, jpassXT 00 (i; j )j = 0.

Case 3. j corresponds to a node j , that is a child in T of a nal node f , for some , 1    m. Let (i ; h) be the rst arc of T on the path from i to f . We now claim that passXT 00 (i; j ) = passXT (i ; h) \ passXT (f ; j ). It is easy to verify that passXT (i ; h) \ passXT (f ; j )  passXT 00 (i; j ). For the other direction, let v 2 passXT 00 (i; j ). It is easy to see that v 2 passXT (f ; j ). To show that v 2 passXT (i ; h), we consider two cases. The rst case is that h = 6 f . Then, by property (U1), f is not a node of degree 0

0

0

0

0

0

0

0

0

1 in Tv , hence (h0; f ) is in Tv , where h0 is the last middle node on the path from i to f . In T 00 , h and h0 are identi ed (or equal), and so there is an arc (i; h00 ) in Tv with h00 6= j . (Recall that XT  is the tree-decomposition after Steps 1 { 4 of the operation, described above. h00 is either the result of identifying h and h0 or h00 = h = h0.) Since (i; h00) is not in Tv00 (because v 2 passXT 00 (i; j )), v is removed 0

9

from Xh0000 in Step 5 of the procedure, so v belongs to the mark of the path from i to f , hence v 2 passXT (i ; h). The second case is that h = f . Since f is not a node of degree 1 in Tv , (i ; h) is in Tv . From this it easily follows that v 2 passXT (i ; h). We conclude that passXT 00 (i; j ) = passXT (i ; h) \ passXT (f ; j ). Now, since f is nal, passXT (f ; j ) 6= passXT (i ; h). Since (i ; h) is maximal, jpassXT (f ; j )j  jpassXT (i ; h)j. Consequently, passXT (i ; h) \ passXT (f ; j ) is a proper subset of passXT (i ; h), and hence jpassXT 00 (i; j )j < jpassXT (i ; h)j = maxp(XT ). This proves the desired property. Finally, we show that property (U1) holds for XT 00. As this proof is very similar to the proofs given above, we just consider a few cases, and leave the remaining cases to the reader. Consider a path from an initial node i to a nal node i , let i ; : : : ; i be the middle nodes on the path, and let  be the mark of the path. Let 1   with + 1  , , and let i be the node of T 00 that is the result of identifying middle nodes i and i , . Assume now that i is a useless leaf of Tv00 (of degree 1). Then either (i , ; i ) or (i , ; i , ) is in Tv . All arcs (i ; j ) are not in Tv , arc (i , ; i , ) is not in Tv , and all arcs (i , ; h) with h 6= i , are not in Tv . Hence, if (i , ; i ) is in Tv , then i is a useless leaf of Tv , and if (i , ; i , ) is in Tv , then i , is a useless root of rank 1 of Tv . This contradicts property (U1) of XT . As a second and last case, we assume = 2 , 1, and consider the middle node i which is half-way the path from i to i . Then i is also a node of T 00 . Assume that i is a useless leaf of Tv00. Note that this implies that v 62 . Either (i , ; i ) or (i ; i ) is in Tv , and all arcs (i ; j ) with j 6= i are not in Tv . If (i ; i ) is in Tv , then v 2 passXT (i ; i ) = , a contradiction. If (i ; i ) is not in Tv , then (i , ; i ) is in Tv , and i is a useless leaf of Tv , contradicting property (U1) of XT . This ends the proof of Proposition 6 2 Now we can prove Lemma 5. First use the construction from Proposition 6. Apply the following operation to XT 00: identify each node i in T 00 that is at even distance to the root with all its children i ; : : : ; is (0  s  r00), see Figure 3. If j is the resulting node of T 0, then Xj0 = Xi00 [ Xi00 [    [ Xi00s , and 0(j ) = 00 (i ) [ 00 (i ) [    [ 00 (is ). Let XT 0 = (fX 0 j i 2 I 0 g; T 0 = (I 0 ; F 0 )) be the i resulting tree-decomposition. The width k0 of XT 0 is at most (r00 + 1)(k00 + 1) , 1, and the rank r0 of T 0 is at most r00 . It remains to show that maxp(XT 0 ) < maxp(XT ), i.e., that jpassXT 0 (i; j )j < maxp(XT ) for every arc (i; j ) of T 0. Consider an arc (i; j ) of T 0. Let i be the result of identifying a parent i with its children i ; i ; : : : ; is, and let j be the result of identifying parent j with its children j ; : : : ; js0 . Since (i; j ) is an arc in T 0, there must be an arc (i ; j ) in T 00 for some , 1   s. We now claim that passXT 0 (i; j ) = passXT 00 (i ; i ) \ passXT 00 (i ; j ). The inclusion passXT 00 (i ; i ) \ passXT 00 (i ; j )  passXT 0 (i; j ) is obvious. For the other 0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

+1

1

+1

1

+1

+2

+1

+2

+1

1

+1

+2

+1

1

1

+1

+1

+1

+1

+1

1

0

1

0

0

1

1

2

0

1

2

0

1

0

0

0

0

10

0

Figure 3: Example of operation in the proof of Lemma 5 direction, let v 2 passXT 0 (i; j ). It is easy to see that v 2 passXT 00 (i ; j ). As XT 00 has property (U1), this implies that i is a node in Tv00, i.e., that v 2 Xi00 . Since i is useless in Tv0 , i is useless in Tv00. Suppose that i is not of rank 1 in Tv00. Then, for some 6= , i is a node of Tv00. Since v 2 chainXT 0 (i), i must be a useless leaf of Tv00, contradicting property (U1). Hence v 2 passXT 00 (i ; i ). From the equality passXT 0 (i; j ) = passXT 00 (i ; i ) \ passXT 00 (i ; j ), we can conclude that jpassXT 0 (i; j )j  maxp(XT ) as follows. If jpassXT 00 (i ; i )j < maxp(XT ), then jpassXT 0 (i; j )j  jpassXT 00 (i ; i )j < maxp(XT ). Otherwise, by Proposition 6, maxp(XT ) > jpassXT 00 (i ; j )j  jpassXT 0 (i; j )j. In a similar way, one can show that XT 0 has property (U1). 2 0

0

0

0

0

0

0

0

0

0

0

Lemma 7 For every k, r 2 N, there exist k0 , r0 2 N, such that for every graph G = (V; E ) and for every tree-decomposition XT of G of width  k, with the rank of T  r, there exists a tree-decomposition XT 0 = (fXi0 j i 2 I 0 g; T 0 = (I 0 ; F 0 )) of G of width  k0 with the rank of T 0  r0 , such that for every vertex v 2 V , if size(Tv0 )  2, then Tv0 has no useless nodes of rank 1 or 0. Moreover the height and size of T 0 are at most the height and size of T , respectively. Proof: First we apply Lemma 4. Let XT 00 be the resulting tree-decomposition. Note that maxp(XT 00 )  k + 1. By applying Lemma 5 at most k + 1 times, we obtain a tree-decomposition XT 0 of bounded width, and of bounded rank, such that maxp(XT 0) = 0. This implies that chainXT 0 (i) = ;, for every node i in T 0, and hence that for every vertex v 2 V , if size(Tv0 )  2, then Tv0 has no useless nodes of rank 1 or 0. 2

11

Lemma 8 For every k, r, d 2 N, there exist k0, r0 2 N, such that for every graph G = (V; E ) with maximum degree  d and for every tree-decomposition XT of G of width  k, with the rank of T  r, there exists a tree-decomposition XT 0 = (fXi0 j i 2 I 0g; T 0 = (I 0; F 0)) of G of width  k0 with the rank of T 0  r0, such that for every vertex v 2 V , Tv0 has height at most one. Moreover the height and size of

T 0 are at most the height and size of T , respectively. Proof: First, we apply Lemma 7. Let XT 0 be the resulting tree-decomposition with width  k0 and rank of T 0 at most r0. Note that every tree Tv0 contains at most deg(v) useful nodes, so at most deg(v) nodes of rank 1 or 0. It follows that each Tv0 contains at most 2d , 1 nodes. Now apply the following operation to XT 0: let i be the rootS of T 0. Identify all trees Tv0 with v 2 Xi0 , i.e., we have one node i0 , with Xi000 = fj2Tv0 j v2Xi0 g Xj0 . Repeat this procedure with all subtrees in the forest, obtained by removing the set fj 2 Tv0 j v 2 Xi0 g from T 0. Let XT 00 be the resulting tree-decomposition. The width of XT 00 is at most (2d , 1)(k0 + 1) , 1, and the rank of T 00 is at most (2d , 1)(k0 + 1)r0, as we identify never more than (2d , 1)(k0 + 1) nodes. Suppose j is a node in Tv00 that is not the root of Tv00. Suppose i is the root node in T 0 of the subtree that was contracted to j . It follows that v 2 Xi0 , hence all nodes i0 in T 0 with v 2 Xi0 that are a descendant of i are contracted with i to j . So j is a leaf in Tv00. As nodes in Tv00 are either leaves or roots of Tv00, the height of Tv00 is at most one. 2 0

0

0

0

0

0

2

0

0

0

0

Theorem 9 For every k, r, d 2 N, there exist k0, r0 2 N, such that for every graph G = (V; E ) with maximum degree  d and for every tree-decomposition XT of G of width  k, with the rank of T  r, there exists a domino tree-decomposition XT 0 = (fXi0 j i 2 I 0 g; T 0 = (I 0; F 0)) of G of width  k0 with the rank of T 0  r0. Moreover the height and size of T 0 are at most the height and size of T , respectively. Proof: First apply Lemma 8. Let XT 0 be the resulting tree-decomposition with width  k0 and rank  r0. Then apply the following operation: identify all nodes that have a common parent in T 0. Let XT 00 be the resulting tree-decomposition, see Figure 4. The rank of T 00 is at most r02, and the width of XT 00 is at most r0  (k0 + 1) , 1. Moreover, each Tv00 consists of at most two nodes. 2

Corollary 10 For every k, d 2 N, there exists k0 2 N, such that every graph with

treewidth at most k and maximum degree at most d has domino treewidth at most k0 . Moreover, given a graph G = (V; E ) with treewidth at most k and maximum degree at most d, one can nd a domino tree-decomposition of width at most k0 in O(jV j) time. Proof: It is well known that a graph with treewidth k has a tree-decomposition of width k and of rank 2. The rst part of the result now follows directly from Theorem 9. One can nd a tree-decomposition of G with width  k and with O(jV j) nodes

12

Figure 4: Example of operation in the proof of Theorem 9 in O(jV j) time [4]. It is easy to transform this tree-decomposition into one with the same width and of rank 2 in O(jV j) time. The constructions, described in the proofs of Lemmas 4, 5, 7, 8, and Theorem 9 can be carried out in O(jV j) time in total. (Each of the described operations costs O(jI j) = O(jV j) time, and at most 2k + 5 such operations are carried out.) 2 Inspecting the proofs in this section, it can be seen that k0 is double exponential in k. We do not know whether this is optimal.

Corollary 11 For every k, d 2 N, there exists k0 2 N, such that every graph

G = (V; E ) with treewidth at most k and maximum degree at most d has a domino tree-decomposition of width at most k0 and with the height of the tree O(log jV j). Proof: Using the algorithm of [16], one obtains a tree-decomposition of G with width  6(k + 1), and with the height of the tree O(log jV j). Observing this algorithm, it follows directly that the rank of the tree is bounded by the maximum number of components of a graph G[V , S ] with jS j  4(k + 1), which is at most 4(k +1)d, assuming that G is connected. (Otherwise, apply the algorithm separately for every connected component.) So now we can apply Theorem 9. 2

Corollary 12 For every class of graphs G , the following statements are equivalent: 1. There exists a constant c 2 N, such that every graph in G has domino treewidth at most c. 2. There exist constants k; d 2 N, such that every graph in G has treewidth at most k and maximum degree at most d.

There is also a connection with the notion of strong treewidth, as introduced by Seese [18].

De nition. A strong tree-decomposition of a graph G = (V; E ) is a pair (fXi j i 2 I g; T = (I; F )) with fXi j i 2 I g a collection of disjoint subsets of V , and T = (I; F ) a tree, such that

13

 Si2I Xi = V  for all edges fv; wg 2 E , either there is an i 2 I with v; w 2 Xi , or there are i, i0 2 I , that are adjacent in T ((i; i0 ) 2 F ), and v 2 Xi, w 2 Xi0 . The width of a strong tree-decomposition (fXi j i 2 I g; T = (I; F )) is maxi2I jXij.

The strong treewidth of a graph G = (V; E ) is the minimum width over all strong tree-decompositions of G. Note that in general, a strong tree-decomposition of a graph G, is not a treedecomposition of G. Note also that every tree has strong treewidth 1 (take fXi j i 2 I g to consist of all singleton vertex sets). As observed in [18], every graph of strong treewidth  k is of treewidth  2k , 1. However, there is a set of graphs of treewidth 2, that is of unbounded strong treewidth. As an example, consider the set of all paths with one additional vertex that is adjacent to all vertices of the path. It is not dicult to see that if such a graph has a strong tree-decomposition of width k, then the tree has height at most 1, and the graph has at most k(k + 1) vertices. A similar example is the set of all `wheels'. However, if a graph has bounded treewidth and bounded degree, then it is also of bounded strong treewidth. In fact, a domino tree-decomposition of width  k can easily be turned into a strong tree-decomposition of width  k + 1: if Tv is a tree with two nodes i and j with j the child of i, then remove v from Xj . It is straightforward to check that this procedure gives a strong tree-decomposition. Thus, the following extension of Corollary 12 follows.

Corollary 13 For every class of graphs G , the following statements are equivalent: 1. There exists a constant c 2 N, such that every graph in G has domino treewidth at most c.

2. There exist constants k; d 2 N, such that every graph in G has treewidth at most k and maximum degree at most d. 3. There exist constants k0; d 2 N, such that every graph in G has strong treewidth at most k0 and maximum degree at most d.

4 Algorithms for determining domino treewidth 4.1 Domino treewidth of trees

It is easy to see that every tree T has domino treewidth  d , 1, where d is the maximum degree of T ; thus, its domino treewidth lies between d and d , 1. 1 2

14

In this subsection we show that there exists an O(kn) time algorithm to determine whether the domino treewidth of a given tree is at most k. We use dynamic programming to do this. Let T = (V; E ) be a tree. Choose an arbitrary vertex r 2 V , and consider T as a rooted tree with r as root. Denote the subtree of T , formed by a vertex v and all its descendants by T (v) = (Vv ; Ev ). For each vertex v 2 V , let Wk (v) be de ned as the minimum, over all domino tree-decompositions (fXi j i 2 I g; T = (I; F )) of T (v) of width at most k, of the minimum size of a set Xi with v 2 Xi. Wk (v) is 1, if there does not exist a domino tree-decomposition of T (v) with width at most k. To test whether T has domino treewidth at most k, we compute for all v 2 V , Wk (v), in a bottom-up order. Clearly, the domino treewidth of T is at most k, if and only if Wk (r) 6= 1. Suppose k  1. For a leaf vertex v, one can observe directly that Wk (v) = 1. We now describe how we can compute Wk (v) of a vertex v, given the values of Wk (w ); : : : ; Wk (wp), for the children w ; : : : ; wp of v. Pj2S Wk (wj ) j S  f1; : : : ; pg; Pj2S Wk (wj ) Proposition 14 W ( v ) = min f 1 + k  k ^ Pj2f ;:::;pg,S Wk (wj )  kg. Pj2S Wk (wj )  k and Proof: Consider a set S  f 1 ; : : : ; p g , such that Pj2f ;:::;pg,S Wk (wj )  k. For j; 1  j  p, take a domino tree-decomposition of T (wj ) with a set Xhj containing wj and of size Wk (wj ). Now, merge these domino tree-decompositions in the following way: take two new nodes i , i with an arc between them. PutSv in Xi and in Xi . Identify all nodes hj , with j 2 S , with i (so, Xi = fvg [ S j2S Xhj ). Identify all nodes hj , with j 2 f1; : : : ; pg , S , with i (so, Xi = fvg [ j2f ;:::;pg,S Xhj ). The resulting domino tree-decomposition is a tree-decomposition of T (v), with width at most k, and with a set, containing v of P size 1 + j2S Wk (wj ). Now, suppose we have a domino tree-decomposition (fXi j i 2 I g; T = (I; F )) of T (v) of width at most k with the minimum size of a set Xi with v 2 Xi. There must be at most 2 nodes, say i and i of which the sets contain v. (If there is only one such node, add a new node i0 with Xi0 = fvg.) Let S = fj j wj 2 Xi g. As (fXi \ Vwj j i 2 I g; T = (I; F )) is a domino tree-decomposition of T (wj ) of width at most k, it follows that Xi contains at least Wk (wj ) vertices from T (wj ) for j 2 S . So Pjeach jXi j  1 + Pj2S Wk (wj ). Since Xi  k + 1, this implies that W 2S k (wj )  k. P With similar arguments one can show that jXi j  1+ j2f ;:::;pg,S Wk (wj ) and that Pj2f ;:::;p g,S Wk (wj )  k. 2 Finding the set S which achieves the minimum value, as described in Proposition 14 above, when given the values Wk (wj ) for all children of v, corresponds to an instance of a variant of the knapsack problem, and can be solved by a standard dynamic programming algorithm in O(p  k) time. (See e.g., [15], Chapter 5.) So, Wk (v) can be computed in O(deg(v)  k) time, given the values Wk (wj ) for all children of v. 1

1

1

1

0

0

0

0

1

1

1

1

1

2

1

1

1

1

2

1

15

1

1

The total time to compute Wk (r) hence is O(Pv2V deg(v)  k) = O(k  jV j): compute successively all values Wk (v), in a bottom-up manner in the tree.

Theorem 15 There exists an O(kn) algorithm to compute whether the domino treewidth of a tree with n vertices is at most k.

The algorithm can output a corresponding domino tree-decomposition within the same time bounds. To nd the domino treewidth of a given tree T , one can do binary search on the value of k, and use the procedure described above. This approach costs, in the worst case, O(n log n) time. We conjecture that some improvements will be possible to this bound. 2

4.2 Fixed parameter algorithms

In this section, we show that the problem whether the domino treewidth of a given graph G is at most k, for constant k, is solvable in polynomial time. Our algorithm has a similar structure as the O(nk ) algorithm from Arnborg et al [2] to recognize graphs with treewidth at most k. The additional technicalities are involved. For R  V , G[R] = (R; ffv; wg 2 E j v; w 2 Rg) denotes the subgraph of G = (V; E ), induced by R. For sets S  V , B  S , D  ffv; wg 2 E j v 2 S g, de ne R(S; D) = fv 2 V j there exists a path from v to a vertex in S that does not use edges in Dg Pk (S; D; B ) , there exists a domino tree-decomposition (fXi j i 2 I g; T = (I; F )) of G[R(S; D)] with width at most k, such that there exists an i 2 I with Xi = S and for all i 2 I : i 6= i ) Xi \ B = ;. Note that if v 2 R(S; D) , S , then v can only be adjacent to vertices in R(S; D). From now on we assume (w.l.o.g.) that the node sets of a tree-decomposition are non-empty. +2

0

0

0

Lemma 16 Let G = (V; E ) be a connected graph. The domino treewidth of G is at most k, if and only if there exists a set S  V with S 6= ;, jS j  k + 1, and Pk (S; ;; ;). Proof: ): Take a domino tree-decomposition (fXi j i 2 I g; T = (I; F )) of G with width at most k, and take S = Xi for an arbitrary i 2 I . (: Note that R(S; ;) = V . The result now follows from the de nition. 2 Note that Pk (S; D; B ) is true if jS j  k + 1 and R(S; D) = S . Lemma 17 Let G = (V; E ) be a connected graph. Let S  V , B  S , D  ffv; wg 2 E j v 2 S g, S =6 ;, jS j  k + 1, and R(S; D) =6 S . Pk (S; D; B ) is true, if and only if at least one of the following two properties holds:

16

1. 9S 0  R(S; D) : 9D0  ffv; wg 2 E j v 2 S 0g :

       

jS 0j  k + 1 S0 = 6 ; B \ S0 = ; :9v 2 S 0 , S : 9w 2 S , S 0 : fv; wg 2 E Pk (S 0; D0; S \ S 0) R(S; D) = R(S 0; D0) [ (S , S 0) (S , S 0) \ R(S 0; D0) = ; jR(S 0; D0)j < jR(S; D)j or (B = ; and S \ S 0 6= ;) 2. 9D  ffv; wg 2 E j v 2 S g: 9D  ffv; wg 2 E j v 2 S g: 9B  S : 9B  S :  R(S; D ) [ R(S; D ) = R(S; D)  R(S; D ) \ R(S; D ) = S  jR(S; D )j < jR(S; D)j  jR(S; D )j < jR(S; D)j  Pk (S; D ; B )  Pk (S; D ; B )  S =B [B  B B [B Proof: ): Suppose Pk (S; D; B ) holds. Let (fXi j i 2 I g; T = (I; F )) be a domino tree-decomposition of G[R(S; D)] with width at most k, and let i 2 I such that Xi = S and for all iS= 6 i : Xi \ B = ;. Note that if v 2 i2I Xi , S , then v can only be adjacent to vertices in Si2I Xi: if fv; wg 2 E and v 2 R(S; D) , S , then we have w 2 R(S; D). Let r be the number of neighbors of i in T . As R(S; D) = 6 S , we have that 1

2

1

2

1

2

1

2

1 2

1

1

2

2

1

2

1

2

0

0

0

0

r > 0. We consider two cases.

Case 1.

Suppose r = 1. Let i be the unique neighbor of i in T . We will show that the rst property, mentioned in the lemmaSholds. Take S 0 = Xi . Write W = i2I ,fi g Xi = R(S; D) , (S , S 0). Take D0 = ffv; wg 2 E j v 2 S 0; w 62 W g. 1

1

0

0

Proposition 18 R(S 0; D0) = W . 17

Proof: We rst observe that vertices in W , S 0 can only be adjacent to vertices in W . In fact, let v 2 W , S 0 and fv; wg 2 E . Since the tree-decomposition is domino, v 62 S and so w 2 R(S; D). Using the de nition of tree-decomposition, it follows that w 62 S , S 0. Hence w 2 W . Suppose v 2 R(S 0; D0) , W . There exists a path from v to a vertex in S 0, avoiding edges in D0, say v ; v ; : : : ; vs, v = v , vs 2 S 0 . Let vj be the last vertex on the path that does not belong to W . j = 6 s, because S 0  W . Now fvj ; vj g 2 E , vj 62 W , vj 2 W . Using the above observation, it follows that vj must belong to S 0, which contradicts the fact that fvj ; vj g 62 D0. So, R(S 0; D0)  W . Suppose v 2 W . As G is connected, there is a path in G from v to a vertex in 0

1

0

+1

+1

+1

+1

S 0. Let s be the rst vertex in S 0 on this path. By the above observation, the path up to s does not use edges in D0, so v 2 R(S 0; D0). 2 From the proposition, it follows directly that (S , S 0) \ R(S 0; D0) = ;, and that R(S; D) = R(S 0; D0) [ (S , S 0 ). Clearly, jS 0j  k + 1, S 0 6= ;. Pk (S 0; D0; S \ S 0) holds: consider the domino tree-decomposition (fXi j i 2 I , fi gg; T [I , fi g]). If v 2 S 0 , S and w 2 S , S 0, there is no Xi containing both v and w, so by de nition of tree-decomposition, fv; wg 62 E . Finally, we consider two subcases: 0

0

Case 1.1. S  S 0. Now R(S 0; D0) = R(S; D), B = ;, and S \ S 0 = S 6= ;. Case 1.2. S 6 S 0. Clearly, now jR(S 0; D0)j < jR(S; D)j holds. Case 2.

Suppose r  2. Let i ; : : : ; ir be the neighbors of i , and let T = (I ; F ); : : : ; Tr = (Ir ; Fr ) be the subtrees of T [I , fiSg], such that Tj contains the node ij . Write I 0 = I [    [ Ir, , I 00 = Ir , W = i2I 0 Xi [ Xi , W = Si2I 00 Xi [ Xi . Using the properties of tree-decompositions, we have that W \ W = Xi . Vertices in W , S can only be adjacent to vertices in W ; vertices in W , S can only be adjacent to vertices in W . Now take: 1

0

1

1

1

0

1

1

1

2

0

1

1

0

2

1

0

2

2

D D B B

1 2 1 2

= = = =

ffv; wg 2 E j v 2 S; w 62 W g ffv; wg 2 E j v 2 S; w 62 W g fv 2 S j 8i 2 I 0 : v 62 Xig fv 2 S j 8i 2 I 00 : v 62 Xi g 1 2

Similar as was done in Case 1 of this proof, one can show that W = R(S; D ) and W = R(S; D ). Now R(S; D) = W [ W = R(S; D ) [ R(S; D ). R(S; D ) \ 1

2

2

1

18

2

1

2

1

1

R(S; D ) = W \ W S= Xi = S . As Si2I 0 Xi 6= ; and Si2I 00 Xi 6= ;, we have R(S; D) , R(S; D ) = i2I 00 Xi 6= ;, and R(S; D) , R(S; D ) 6= ;. Pk (S; D ; B ) holds: look at the domino tree-decomposition (fXi j i 2 I 0 [ fi gg; T [I 0 [ fi g]). By de nition of B , Xi \ B = ; for all i 2 I 0. In the same way it follows that Pk (S; D ; B ) holds. If v 2 S , B , then there exists an i0 2 I 0 with v 2 Xi0 . When there exists also an i00 2 I 00 with v 2 Xi00 , then v would belong to the three sets Xi , Xi0 , Xi00 . It follows that v 2 S , B implies v 2 B . Hence S = B [ B . Finally, it is clear that when v 2 B , then also v 2 B and v 2 B , so B  B \ B . This ends the analysis of Case 2, and of the ) part of the proof. (: First suppose we have sets S 0, D0, ful lling the rst property mentioned in the lemma. Write B 0 = S \ S 0. There exists a domino tree-decomposition (fXi j i 2 I g; T = (I; F )) with width at most k of G[R(S 0; D0)] with for some i 2 I : Xi = S 0 and for all i 6= i , Xi \ B 0 = ;. Take a new node i 62 I , and take Xi = S . Let T 0 be the tree, obtained by making i adjacent to i in T . We claim that (fXi j i 2 I [ fi gg; T 0) is a domino tree-decomposition for G[R(S; D)] with Xi = S , and for all i 6= i , Xi \ B = ;. Clearly, the width of thisSdomino tree-decomposition is at most k. S First, i2I [fi g Xi = i2I Xi [ Xi = R(S 0; D0) [ S = R(S 0; D0) [ (S , S 0) = R(S; D). Secondly, if fv; wg 2 E , v; w 2 R(S; D), then  if v; w 2 R(S 0; D0) : 9i 2 I : v; w 2 Xi.  if v 2 R(S 0; D0), w 2 S , S 0, then v 2 S 0. Also, by assumption, v 62 S 0 , S . So v; w 2 Xi .  if v; w 2 S , S 0: v; w 2 Xi . Using that S \ R(S 0 ; D0)  S 0, one easily veri es the third condition of treedecomposition. Now we check dominoness. Vertices in S , S 0 only belong to Xi and to no other set Xi, i 2 I . Vertices in S \ S 0 belong to Xi and Xi , but, by assumption, not to any set Xi, i 2 I , fi g. Clearly, all vertices in R(S; D) , S belong to at most two sets Xi, i 2 I , and not to Xi . Finally, for all v 2 B , and for all i 2 I [ fi g: if v 2 Xi, then v 62 S 0, v 2 S , so v 62 R(S 0; D0), hence i = i . This ends the analysis of the case that the rst property holds. Now suppose we have sets D , D , B , B ful lling the second property mentioned in the lemma. Take domino tree-decompositions (fXi j i 2 I g; T = (I ; F )) of G[R(S; D )] and (fYi j i 2 I g; T = (I ; F )) of G[R(S; D )], with width at most k and with for some i 2 I , i 2 I : Xi = Yi = S , for i 2 I , fi g: Xi \ B = ;; for i 2 I , fi g: Xi \ B = ;. Let T be obtained by taking the union of T and T and identifying i and i . Write for i 2 I : Zi = Xi, and for i 2 I : Zi = Yi. 2

1

2

0

1

1

2

1

0

0

1

2

1

2

1

0

1

2

1

2

1

2

1

2

1

1

1

0

0

0

1

0

0

0

0

0

0

0

0

0

1

1

0

0

0

1

2

1

2

1

1

2

1

2

2

1

2

2

2

2

1

2

1

1

1

2

1

1

2

1

1

1

2

2

19

2

1

2

Consider the tree-decomposition (fZi j i 2 I [ I g; T ). We claim that this is a domino tree-decomposition of G[R(S; D ) [ R(S; D )] = G[R(S; D)] with width at most k, such that Zi = S , and for all i 2 I [ I , fi g: B \ Zi = ;. The latter condition follows from earlier made assumptions, as B  B \ B . It is straightforward to verify that we indeed have a tree-decomposition of width at most k, using that R(S; D ) [ R(S; D ) = R(S; D), and R(S; D ) \ R(S; D ) = S . Dominoness also holds: for v 62 S , it follows directly that v belongs to at most two sets Zi, i 2 I [ I . If v 2 B , then v does not belong to a set Zi, i 2 I , fi g. So v belongs to at most two sets Zi, i 2 I [ I , both with i 2 I . A similar analysis applies when v 2 B . This ends the analysis of the case that the second property holds. 2 1

2

1

2

1

1

2

1

1

1

1

2

2

1

2

2

2

2

1

2

2

1

1

Theorem 19 For xed k, there exists an algorithm, that checks whether a given graph G with n vertices has domino treewidth at most k in O(n2k+3) time. Proof: Since it clearly suces to consider connected components, we may assume that G is connected. First, we compute for all S  V with jS j  k + 1, D  ffv; wg 2 E j v 2 S g, the set R(S; D). Then, we sort all pairs (S; D) in order of increasing size of R(S; D). In order of increasing size of R(S; D), we will compute for all B  S , in order of decreasing size of B , the value of Pk (S; D; B ). For this, we use the result of Lemma 17. We check whether one of the properties holds. Note that all values of Pk , referred to in the characterization of Lemma 17 have been computed before they are needed. The rst property can be checked by looking at all O(nk+1) possible guesses for S 0, and all O(1) guesses for D0. (This number only depends on the maximum degree of a vertex in G, and k; both may be assumed to be bounded by constants.) For each such guess, the property can be veri ed in O(n) time. The second property can be checked similarly. It follows that the time per triple (S; D; B ) to compute Pk (S; D; B ) is O(nk+2). As we have O(nk+1) triples (S; D; B ) to look at, the total time becomes O(n2k+3). Finally, we look up whether for any S , Pk (S; ;; ;) holds. (Cf. Lemma 16.) 2 The algorithm can be modi ed such that it outputs | when existing | a domino tree-decomposition of the input graph with width at most k, and such that it still uses O(n2k+3) time. It might be possible to improve the running time somewhat.

5 Hardness results

In this section, we show that the domino treewidth problem is W [t]-hard for all t 2 N, where the notion of W [t]-hardness is taken from the work of Downey and Fellows (see [11, 12, 13, 1]). Also, we prove the problem to be NP-complete. Both results follow from the same transformation from Longest Common Subsequence. To be precise, we establish W [t]-hardness for the following problem: 20

Domino Treewidth

Instance: Graph G = (V; E ), integer k. Parameter: k. Question: Is the domino treewidth of G at most k? The fact that domino treewidth is W [t]-hard for all t 2 N (as in the theory on

xed parameter intractability, developed by Downey and Fellows), suggests strongly that it is impossible to nd algorithms for the domino treewidth  k problem that use f (k)pol(n) time, i.e., where only the constant factor in the running time depends on k. (Note that such algorithms do exist for some related problems, like treewidth  k, pathwidth  k.) The classes W [t] denote classes of parameterized problems: problems Q  f(k; s) j k 2 N; s 2  g, for some alphabet . To prove W [t]-hardness for a problem P , it suces to nd a W [t]-hard problem Q and functions f; h : N ! N, g : N   !  , such that for all (k; s) 2 N   : (k; s) 2 Q , (f (k); g(k; s)) 2 P , and f is any computable function, and g is computable in time h(k)  jsjc for some constant c. (I.e., the time is polynomial in the length of the non-parameter part of the input, but may depend in any way on the parameter.) The Longest Common Subsequence problem is the following: Longest Common Subsequence

Instance: Alphabet , strings s ; : : : ; sr 2  , integer m 2 N. Parameter: r. Question: Does there exist a string in  of length at least m, that is 1

a subsequence of each string s ; : : : ; sr ? 1

Very recently, it has been shown that Longest Common Subsequence is W [t]-hard for all t 2 N [7, 8].

Theorem 20 For all t 2 N, Domino Treewidth is W [t]-hard. Proof: We give a transformation from Longest Common Subsequence.

Let an instance , s ; : : : ; sr , m of Longest Common Subsequence be given. We suppose we have a numbering of the characters in , say  = f ; : : : ; l g. Let l = jj, k = 20r + 40r , 1, q = m(lr + 1). We now de ne a graph G = (V; E ), that consists of the following components: 1

2

2

1

Two anchors. Take two cliques, each with k + 1 vertices, with vertex sets A = fai j 1  i  k + 1g and A = fai j 1  i  k + 1g. 1

1

2

2

The oor. Take q cliques of (k + 1) = 8r + 16r vertices, fb i j 1  i  (k + 1); 1   qg. Take edges:  fb i ; b j g, 1   q, 1  i; j  (k + 1), i 6= j . 2 5

2

2 5

21

2 5

 fb i ; b j g, 1  < q, 1  i; j  (k + 1).  fai ; bj g, 1  i; j  (k + 1).  fai ; bqj g, 1  i; j  (k + 1). The number is chosen because 2  < 1, and 3  > 1. To ease presentation, we will denote vertices ai with 1  i  (k + 1) also as bi , and vertices ai with 1  i  (k + 1) also as bqi . +1

1

2 5

2 5

1

2 5

2

2 5

2 5

2 5

+1

2 5

2

2 5

1

0

The hills. We have m `hills'. Take vertices fc i;j j 1   m; 1  i  l  r ; 1  j  (k + 1) , (2r + 1)g. Take edges:  fc i;j ; b lr  , i g, 1   m, 1  i  l  r , 1  j  (k + 1) , (2r + 1). 2

1 5

( 2 +1) ( 1

1)+

 ,1)+i+1 g, 1   m,

 fc i;j ; b lr

1 5

2

( 2 +1) ( 1

1  i  l  r , 1  j  (k + 1) , (2r + 1). 2

1 5

Each hill, together with the adjacent oor vertices, represents a character of the subsequence.

The string components. For each string si, 1  i  r, we have a string component. Below, we describe the di erent parts for the ith string component. Suppose si = si si    sili . 1 2

The string path. Take a path with li  (lr + 1) + 2 vertices, and attach it to a and a : take vertices fdij j 0  j  li  (lr + 1) + 1g, edges fdij ; dij g, fdi ; a g, fdili lr ; a g. 2

1 1

2 1

(

2 +1)+1

2

2 1

+1

0

1 1

The blobs. We take li + 1 cliques of 2r + 2 vertices, and attach these to the string paths. Take vertices feij;j0 j 0  j  li; 1  j 0  2r + 2g. Take edges:  feij;j0 ; eij;j00 g, 0  j  li ; 1  j 0 ; j 00  2r + 2, j 0 =6 j 00.  feij;j0 ; dij lr g, 0  j  li, 1  j 0  2r + 2.  feij;j0 ; dij lr g, 0  j  li, 1  j 0  2r + 2. (

2 +1)

(

2 +1)+1

The idea is that blobs cannot come on top of hills. This forces a precise way how the part between blobs falls over a hill (if it does). Each such part represents a character in the string si; the lr + 1 vertices in such a part are needed for symbol checking. 2

22

1st anchor

2nd anchor

A 1

1st hill C

1 C 1

B

1 C 2

1

B

1

2nd hill C

2 B

m−th hill C

m C 1

2 C 2 lr

2 C 2

2 C 1

1 C 2 lr

2

A 2

m

m C 2

m C 2 lr

lr 2+1

B

q

: anchor (clique)

: floor cliques

Figure 5: Anchors, oor, and hills.

A 1

A 2 i E 0

d

a

i 0

1 1

i E 1

d

i d 2 lr +1

i 1

1st character

i E li −1

i E 2

d

i 2 (lr +1)+1

d

i E li

i 2 2(lr +1)

2nd character

l −th character i

: anchor (clique)

: string path vertices : blobs

Figure 6: The i-th string component: string path, and blobs.

23

a

2 1

The symbol checkers. These vertices are used to check that the chosen characters for the di erent strings are the same. Take vertices ff ;i i, rl j, l t j 1   li; 1  j  r; t = si g[ff ;i j, rl i, l t j 1   li; 1  j  r; t = 6 si g. If ver(

(

1)

+(

1) +

i exists, make it adjacent to the vertices di tex f ; , (

lr2 +1)+

1)(

1)

+(

1) +

and di , (

lr2 +1)+ +1 .

1)(

Let G = (V; E ) be the resulting graph. Parts of this construction are illustrated in Figures 5 and 6. We denote: B = fb i j 1  i  (k + 1)g, C = fc i;j j 1  i  l  r ; 1  j  (k , 1) , (2r + 1)g, Ci = fc i;j j 1  j  (k , 1) , (2r + 1)g, and Eji = feij;j0 j 1  j 0  2r + 2g. 2 5

1 5

2

1 5

Proposition 21 The domino treewidth of G is at most k, if and only if s ; : : : ; sr 1

have a common subsequence of length at least m. Proof: ): Suppose (fXi j i 2 I g; T = (I; F )) is a domino tree-decomposition of G of width  k. First, note that there must be nodes h0, h with A1  Xh , A2  Xh (Lemma 3). Consider the path in T between h0 and h , and number the nodes on this path consecutively h0; h1 ; h2; : : : ; h ,1; h . In fact, as jA1j = jA2j = k + 1, A1 = Xh and A2 = Xh . It follows that all vertices of the form a1i or b1j , 1  i; j  52 (k + 1), must be element of Xh : these form a clique, which (by Lemma 3) must be contained in a node-set of a node, adjacent to h0 (by dominoness), and by Lemma 1, it cannot be another node than h1 (because there is a path in G from a vertex b1j to a vertex in A2 that avoids vertices in A1 ). Now, we claim, with induction to , that for all j , 1  j  52 (k + 1), b j and b j +1 are in Xh . We know this holds for = 0. Let 0 <  q. All nodes b j and b j0+1 form together a clique. By Lemma 3, there is a node i0 , with Xi0 containing this clique. i0 6= h , otherwise Xh contains too many vertices. Hence i0 is a neighbor of h (by dominoness). If i0 6= h +1 , then note that there are 25 (k + 1) vertex disjoint paths from vertices in the set fb j0+1 j 1  j 0  25 (k + 1)g to vertices in the set A2 , that avoid vertices of the form b j ,1 or b j . By Lemma 1, this gives in total 56 (k + 1) vertices that belong to Xh , contradiction. So, all nodes of the form b j and b j0+1 belong to Xh . It follows that = q + 2. For each hill vertex c i;j , note that there is a unique node containing the neighbors of the vertex, namely h( ,1)(lr +1)+i+1 , so c i;j 2 Xh , lr i . For each blob, there must be a node, containing all vertices in the blob (as it is a clique). However, such a node cannot be a node of the form h( ,1)(lr +1)+i+1 , as the number of hill vertices plus the blob size plus the number of oor vertices that would belong to the node would be larger than k + 1. Call nodes of this form hill nodes. Nodes of the form h (lr +1)+1 are called valley nodes. Note that each hill node also contains at least two vertices per string path (because of Lemma 2). These 2r vertices, with the hill vertices and the oor vertices give in total k vertices, so only one extra vertex is possible. Consider a blob, with vertices Eji = feij;j0 j 1  j 0  2r + 2g. There must be a node i0 2 I , with Eji [ fdj(lr +1) ; dj(lr +1)+1 g  Xi0 (Lemma 3). We have already 0

0

1

+1

+1

2

(

2

2

2

2

24

1)(

2 +1)+ +1

argued that i0 is not a hill node. Suppose i00 is the rst node on the path from i0 to h that is also on the path from h to h . We claim that i00 is a valley node. If i0 is a valley node, then we are done, as in that case i0 = i00 . Suppose i0 is not a valley node, hence i0 is not on the path from h to h . It follows that Xi00 must contain at least four nodes of the ith string path (Lemma 2), and, hence, that i00 cannot be a hill node, so must be a valley node. Write f (i; j ) = , if the node i00 as above is of the form h lr . It is easy to see that does not depend on the choice of i0 . Note that f (i; j )  f (i; j + 1); if not, then the string path between blob Eji and blob Eji must go back over a hill: that hill then gets too many string path vertices in its node sets. We also must have f (i; 0) = 0, and f (i; li) = m. So, for each i, there are exactly m values i ; i ; : : : ; mi , with i < i <    < mi , and for all p, 1  p  m: f (i; pi , 1) = p , 1 and f (i; pi ) = p. We now claim, that all subsequences sii sii    simi are equal. Consider the two characters sipi = t and sjpj = t0 . We must show these are equal. Write  = (p , 1)(lr + 1) + 1, and 0 = p(lr + 1) + 1. h is the valley node, just before the pth hill, and h0 is the valley node just after the pth hill. Xh must contain i a vertex dipi , lr  for some   0. Xh0 must contain a vertex dpi lr ,0 for some 0  0. Note that the distance in T between h and h0 equals the length of the path between these vertices for  = 0 = 0, plus one. From dominoness, it follows, that for all , 0   lr , we must have that dipi , lr 2 Xh \ Xh . A similar analysis holds for the nodes on the j th string path. In particular, we have that i000 = h i, rl j, l t is the unique node that coni tains dipi , lr i, rl j , l t and d pi , lr i, rl j , l t , and is the unique j j node that contains d pj , lr i, rl j , l t and d pj , lr i, rl j , l t . Both fipi ; i, rl j, l t and fjpj ; i, rl j, l t when existing, must belong to i000 . As i000 is a hill node, they cannot exist both, otherwise Xi000 contains too many vertices. As fipi ; i, rl j, l t exists (we assumed t = sipi ), we have that fjpj ; i, rl j, l t does not exist, and hence that sjpj = t = sipi . It follows that all subsequences sii sii    simi are equal, hence the strings si, 1  i  r have a common subsequence of length m. (: Suppose subsequences sii sii    simi of strings si are all equal. We show how to construct a domino tree-decomposition of G of width k. First, we take nodes h , : : : , hq , forming a path. Put all vertices of A in Xh , all vertices of A in Xhq , and all vertices of the form b i (0   q + 1, 1  i  (k + 1)) in Xh and Xh . Next, put each hill vertex in the unique node set that contains the neighbors of the hill vertex, i.e., put c i;j in Xh , lr i . Let 1  i  r. We now consider the ith string component. For all p, 1  p  m, , 0   lr , put dipi , lr in Xh p, lr , and in Xh p, lr . Put the vertices feipi , ;j j 1  j  2r + 2g in Xh p, lr , and put the vertices 0

0

0

(

2 +1)+1

+1

1

2

1

1

2

2

(

2

2 +1)+1+

1)(

(

+(

1)(

2 +1)+(

1)

+(

(

(

(

1)

1)

+(

+(

2 +1)

(

2

(

2

1) +

1)(

1) +

(

2 +1)+(

(

1)

1)

1)

1)(

+(

+(

+(

2 +1)+1+

1)(

+ +1

1) +

2 +1)+(

1)

+(

1) +

(

1) + +1 1)(

2 +1)+(

1)

+(

(

1)

1) + +1

1) +

1) +

1

1

+

+(

1) +

2

2

0

+2

1

(

2

(

1)(

1)(

0

2

2 5

+2

+1

2 +1)+ +1

2 +1)+1+

(

1

1)(

2 +1)+1+

(

25

1)(

2 +1)+1

(

1)(

2 +1)+2+

feipi ;j j 1  j  2r + 2g in Xhp lr

. If pi + 1 6= pi , we must `fold' the part from the ith string component between what is put on top of the pth hill and what is on top of the (p + 1)st hill. First, we de ne sets Yj , pi  (lr + 1)  j  pi  (lr + 1), and put (for j in this range), dij and dij in Yj . Also, for each blob and symbol checker vertex v, if their neighbors belong to some set Yj , put v in Yj . Note that the maximum size of a set Yj is 2r + 4. The sequence of sets Ypi  lr ; : : : ; Ypi  lr forms a domino tree-decomposition, with the tree being a path. Note that the rst, and the last set of this domino tree-decomposition are contained in Xhp lr . We now take d (pi  (lr + 1) , (pi  (lr + 1)) , 1)e new nodes, by identifying the second and one but last node of the node sets Y , the third and the second but last node of the node sets Y , etc, i.e., we take sets Zt = Ypi  lr t [ Ypi  lr ,t , and make the new node with set Zt adjacent to the node with set Zt in the tree T . Also, make Z adjacent to hp lr . Further, put vertices ei ;j0 and di in Xh , put eili;j0 and dili lr in Xhq , and `fold' the rst and the last part of the ith string i path, in case  6= 1, or mi 6= li, respectively. Finally, symbol checker vertices that are not yet placed are put in that set that contains both its neighbors. It is a tedious but rather straightforward veri cation, that the construction above gives a domino tree-decomposition of G with width k. We just note that Xhp lr contains at most (k + 1) + 2r(2r + 4) = (k + 1) + (k + 1) vertices. 2 The theorem now follows from the transformation, given above, and the fact that Longest Common Subsequence is W [t] hard for all t 2 N [7, 8]. 2 (

+1

2 +1)+1

2

2

+1

+1

(

1 2

2

+1

2 +1)

+1 (

(

2

(

2 +1)+

+1 (

2 +1)

2 +1)+1

2 +1)

+1

1

(

(

2 +1)+1

2 +1)+1

0

0

1

+1

1

4 5

4 5

1 5

(

2 +1)+1

Theorem 22 Domino Treewidth is NP-complete. Proof: Membership in NP is trivial. Observe that the transformation, given in the proof of Theorem 20, is a polynomial time transformation from the NP-complete Longest Common Subsequence problem to Domino Treewidth. Hence, the latter is NP-complete. 2

6 Conclusions In this paper, we considered the notion of domino treewidth. We showed a correspondence between bounded domino treewidth, and bounded degree and treewidth, and obtained several results on the complexity of determining the domino treewidth of a given graph. We believe the notion of domino treewidth can be of use for other investigations in the (algorithmic) theory on the treewidth of graphs. For instance, having a domino tree-decomposition of logarithmic height, and of bounded width allows easy schemes for some problems on graphs that can be changed dynamically under the operations: delete an edge, change the weight or label of a vertex or edge, where 26

each such operation takes logarithmic time: for many problems, there are algorithms, solving these problems in linear time, of the type, where for each node `something' is computed, and this information can be computed, given the information for the children of the node in constant time. For many problems, it is easy to see that when the graph is changed by an edge deletion or a weight or label change of an edge or vertex, for nodes that do not have an endpoint of the edge involved or the vertex involved in its node-set, and this holds also for all its descendants, the information to be computed is not changed. So, when we have a domino tree-decomposition, only O(log n) nodes must have their information recomputed, so the update can be done in O(log n) time. Unfortunately, the large constants involved make this scheme impractical. Other approaches for dynamic algorithms on graphs with bounded treewidth, which may be more practical, can be found e.g. in [6, 10].

References [1] K. A. Abrahamson, R. G. Downey, and M. R. Fellows. Fixed-parameter tractability and completeness IV: On completeness for W [P ] and PSPACE analogues. Technical Report DCS-216-IR, Department of Computer Science, University of Victoria, Victoria, B.C., Canada, 1993. [2] S. Arnborg, D. G. Corneil, and A. Proskurowski. Complexity of nding embeddings in a k-tree. SIAM J. Alg. Disc. Meth., 8:277{284, 1987. [3] H. L. Bodlaender. Some classes of graphs with bounded treewidth. Bulletin of the EATCS, 36:116{126, 1988. [4] H. L. Bodlaender. A linear time algorithm for nding tree-decompositions of small treewidth. In Proceedings of the 25th Annual Symposium on Theory of Computing, pages 226{234, New York, 1993. ACM Press. [5] H. L. Bodlaender. A tourist guide through treewidth. Acta Cybernetica, 11:1{ 23, 1993. [6] H. L. Bodlaender. Dynamic algorithms for graphs with treewidth 2. To appear in proceedings WG'93, 1994. [7] H. L. Bodlaender, R. G. Downey, M. R. Fellows, and H. T. Wareham. The parameterized complexity of sequence alignment and consensus (extended abstract). To appear in: proceedings Conference on Pattern Matching '94, 1993. [8] H. L. Bodlaender, M. R. Fellows, and M. Hallett. Beyond NP-completeness for problems of bounded width: Hardness for the W hierarchy. Manuscript. To appear in: proceedings STOC'94, 1994. 27

[9] H. L. Bodlaender and R. H. Mohring. The pathwidth and treewidth of cographs. SIAM J. Disc. Meth., 6:181{188, 1993. [10] R. F. Cohen, S. Sairam, R. Tamassia, and J. S. Vitter. Dynamic algorithms for optimization problems in bounded tree-width graphs. In Proceedings of the 3rd Conference on Integer Programming and Combinatorial Optimization, 1993. [11] R. G. Downey and M. R. Fellows. Fixed-parameter tractability and completeness I: Basic results. Manuscript, 1991. To appear in SIAM J. Comput. [12] R. G. Downey and M. R. Fellows. Fixed-parameter tractability and completeness II: On completeness for W [1]. Manuscript, 1991. To appear in Theoretical Computer Science, Ser. A. [13] R. G. Downey and M. R. Fellows. Fixed-parameter tractability and completeness III: Some structural aspects of the W hierarchy. Technical Report DCS-191-IR, Department of Computer Science, University of Victoria, Victoria, B.C., Canada, 1992. [14] J. Engelfriet, L. M. Heyker, and G. Leih. Context-free graph languages of bounded degree are generated by Apex graph grammars. Technical Report 9116, Department of Computer Science, Leiden University, Leiden, the Netherlands, 1991. To appear in Acta Informatica. [15] E. Horowitz and S. Sahni. Fundamentals of Computer Algorithms. Pitman, London, 1978. [16] B. Reed. Finding approximate separators and computing tree-width quickly. In Proceedings of the 24th Annual Symposium on Theory of Computing, pages 221{228, 1992. [17] N. Robertson and P. D. Seymour. Graph minors. II. Algorithmic aspects of tree-width. J. Algorithms, 7:309{322, 1986. [18] D. Seese. Tree-partite graphs and the complexity of algorithms. In L. Budach, editor, Proc. 1985 Int. Conf. on Fundamentals of Computation Theory, Lecture Notes in Computer Science 199, pages 412{421, Berlin, 1985. Springer Verlag.

28