Вы находитесь на странице: 1из 12

How to Solve NP-hard Graph Problems

on Clique-Width Bounded Graphs


in Polynomial Time
Wolfgang Espelage, Frank Gurski , and Egon Wanke
Department of Computer Science, D-40225 D
usseldorf, Germany
{espelage,gurski,wanke}@cs.uni-dueseldorf.de

Abstract. We show that many non-MSO1 NP-hard graph problems can


be solved in polynomial time on clique-width and NLC-width bounded
graphs using a very general and simple scheme. Our examples are partition into cliques, partition into triangles, partition into complete bipartite subgraphs, partition into perfect matchings, partition into forests,
cubic subgraph, Hamiltonian path, minimum maximal matching, and
vertex/edge separation problems.

Introduction

Graphs of bounded clique-width are dened by three operations for vertexlabeled graphs, the vertex disjoint union G H of two graphs, the addition
of edges i,j (G) between vertices labeled by i and vertices labeled by j, and the
relabeling ij (G) of vertices labeled by i into vertices labeled by j, see [3].
Graphs of bounded NLC-width are dened by two similar operations, the union
G S H of two graphs that additionally creates all edges between vertices from
G labeled by i and vertices from H labeled by j for every pair (i, j) S, and the
relabeling R (G) of vertices labeled by i into vertices labeled by R(i), see [11].
The clique-width or NLC-width of a graph is the minimum number of labels
needed to dene it. Every graph of clique-width at most k has NLC-width at
most k and every graph of NLC-width at most k has clique-width at most 2k,
see [8].
Clique-width and NLC-width bounded graphs are especially interesting from
an algorithmic point of view. A lot of NP-hard graph problems can be solved in
polynomial time for graphs of bounded clique-width or bounded NLC-width if
an expression for the graph is explicitly given. For example, all graph properties
which are expressible in monadic second order logic with quantications over
vertices and vertex sets (MSO1 -logic) are decidable in linear time on clique-width
and NLC-width bounded graphs, see [2]. The MSO1 -logic has been extended by
counting mechanisms which allow the expressibility of optimization problems
concerning maximal or minimal vertex sets, see [2]. All these graph problems


The work of the second author was supported by the German Research Association
(DFG) grant WA 674/9-1.

A. Brandst
adt and V.B. Le (Eds.): WG 2001, LNCS 2204, pp. 117128, 2001.
c Springer-Verlag Berlin Heidelberg 2001


118

Wolfgang Espelage, Frank Gurski, and Egon Wanke

expressible in extended MSO1 -logic can also be solved in linear time on cliquewidth and NLC-width bounded graphs.
If a graph G has clique-width or NLC-width at most k then the edge complement G has clique-width at most 2k, see [3], and NLC-width at most k, see
[11]. The set of all graphs of clique-width at most 2 or NLC-width 1 is the set of
all labeled cographs. The clique-width and NLC-width of permutation graphs,
interval graphs, grids and planar graphs are not bounded by some xed integer
k, see [6]. An arbitrary graph with n vertices has clique-width at most n r,
if 2r < n r, and NLC-width at most  n2 , see [8]. Every graph of tree-width
at most k has clique-width at most 3 2k1 , see [5], and NLC-width at most
2k+1 1, see [11]. The graphs of clique-width at most 2 or NLC-width 1 do not
have bounded tree-width. In [7], it is shown that every graph of clique-width or
NLC-width at most k which does not contain the complete bipartite graph Kn,n
for some n > 1 as a subgraph has tree-width at most 3k(n 1) 1. The recognition problem for graphs of clique-width or NLC-width at most k is still open
for k 4 and k 3, respectively. Clique-width of at most 3 is decidable in time
O(n2 m), where n is the number of vertices and m is the number of edges of the
input graph, see [1]. NLC-width of at most 2 is decidable in time O(n4 log(n)),
see [9].
There are many NP-hard graph problems which are not expressible in extended MSO1 -logic, but which are, nevertheless, solvable in polynomial time on
clique-width and NLC-width bounded graphs, see also [11]. In this paper, we
extend this problem list by partition into independent sets/cliques (chromatic
number), partition into independent sets/cliques of bounded size (partition into
triangles), partition into complete bipartite subgraphs, partition into perfect
matchings, partition into forests, degree bounded subgraph problems (the cubic subgraph problem), the Hamiltonian path problem, the minimum maximal
matching problem, and various vertex/edge separation problems. All these problems are not expressible in extended MSO1 -logic. The input of our algorithms
is always a clique-width or NLC-width expression. Note that clique-width and
NLC-width expressions can simply be transformed into each other.
The aim of this paper is to illustrate the power of our simple scheme to design
such polynomial time algorithms. We also demonstrate that it is sometimes
much more convenient to use an NLC-width expression instead of a clique-width
expression. This is especially the case for degree bounded subgraph problems
and vertex/edge separation problems. The proofs of the correctness are more or
less straight forward and are omitted in this version due to space limitations.
We are not interested in bounding the constants in the running times of the
algorithms which are sometimes more than double exponential in k (the cliquewidth of the graphs). Such considerations seem to be only interesting if the time
complexity can be reduced to O(nc ), where c is independent of k. Up to now,
no such algorithms are known for the examples of this paper.

NP-hard Graph Problems on Clique-Width Bounded Graphs

119

Preliminaries

Let [k] := {1, . . . , k} be the set of all integers between 1 and k. We work with
nite undirected labeled graphs G = (V, E, lab), where V is a nite set of vertices
labeled by some mapping lab : V [k] and E {{u, v} | u, v V, u = v} is a
nite set of edges. For a vertex set U V let lab(U ) = {lab(u) | u U } and
lab2 (U ) be the set of all labels i such that U has at least two vertices labeled
by i. A labeled graph J = (V  , E  , lab ) is a subgraph of G if V  V , E  E
and lab (u) = lab(u) for all u V  . J is an induced subgraph of G if additionally
E  = {{u, v} E | u, v V  }. The labeled graph consisting of a single vertex
labeled by i [k] is denoted by i .
The notion of clique-width for labeled graphs is dened by Courcelle and
Olariu in [3].
Denition 1 (Clique-width, [3]). Let k be some positive integer. The class
CWk of labeled graphs is recursively dened as follows.
1. The single vertex graph i for some i [k] is in CWk .
2. Let G = (VG , EG , labG ) CWk and J = (VJ , EJ , labJ ) CWk be two vertex
disjoint labeled graphs. Then GJ := (V  , E  , lab ) dened by V  := VG VJ ,
E  := EG EJ , and

labG (u) if u VG
, u V 
lab (u) :=
labJ (u) if u VJ
is in CWk .
3. Let i, j [k] be two distinct integers and G = (V, E, lab) CWk be a labeled
graph then
(a) i,j (G) := (V, E  , lab) dened by
E  := E {{u, v} | u, v V, lab(u) = i, lab(v) = j} is in CWk and
(b) ij (G) := (V, E, lab ) dened by
lab (u) :=

lab(u) if lab(u) = i
, u V
j
if lab(u) = i

is in CWk .
The notion of NLC-width1 of labeled graphs is dened in [11].
Denition 2 (NLC-width, [11]). Let k be some positive integer. The class
NLCk of labeled graphs is recursively dened as follows.
1. The single vertex graph i for some i [k] is in NLCk .
2. Let G = (VG , EG , labG ) NLCk and J = (VJ , EJ , labJ ) NLCk be two
vertex disjoint labeled graphs and S [k]2 be a relation, then G S J :=
1

The abbreviation NLC results from the node label controlled embedding mechanism
originally dened for graph grammars.

120

Wolfgang Espelage, Frank Gurski, and Egon Wanke

(V  , E  , lab ) dened by V  := VG VJ , E  := EG EJ {{u, v} | u


VG , v VJ , (labG (u), labJ (v)) S}, and

labG (u) if u VG
lab (u) :=
, u V 
labJ (u) if u VJ
is in NLCk .
3. Let G = (V, E, lab) NLCk and R : [k] [k] be a function, then R (G)
:= (V, E, lab ) dened by lab (u) := R(lab(u)), u V is in NLCk .
The clique-width (NLC-width) of a labeled graph G is the least integer k
such that G CWk (G NLCk , respectively). An expression X built with
the operations i , , ij , i,j for integers i, j [k] is called a clique-width kexpression. An expression X built with the operations i , S , R for i [k],
S [k]2 , and R : [k] [k] is called an NLC-width k-expression. The graph
dened by expression X is denoted by val(X).
The polynomial time algorithms we want to introduce for NP-hard graph
problems on clique-width and NLC-width bounded graphs are based on the
following scheme, see also [11]. Let be a graph problem for labeled graphs. If
there is a mapping F that maps every clique-width k-expression X onto some
abstract structure F (X) such that for all k-expressions X, Y (1.) the size of
F (X) is polynomially bounded in the size of X, (2.) the answer to for val(X)
is computable in polynomial time from F (X), (3.) F (i ) is computable in time
O(1), (4.) F (X Y ) is computable in polynomial time from F (X) and F (Y ),
and (5.) F (i,j (X)) and F (ij (X)) are computable in polynomial time from
F (X) then for every clique-width k-expression X, the answer to for val(X)
is computable in polynomial time from X. This works also for NLC-width kexpressions built with the operations i , S , and R instead of i , , i,j , and
ij . Then F (X S Y ) has to be computable in polynomial time from F (X)
and F (Y ), and F (R (X)) has to be computable in polynomial time from F (X).
In the next section, we frequently use the notion of a multi set, i.e., a set that
may have several equal elements. For a multi set M with elements x1 , . . . , xn we
write M = x1 , . . . , xn . There is no order on the elements of M. The number
how often an element x occurs in M is denoted by (M, x). Two multi sets M1
and M2 are equal if for each element x M1 M2 , (M1 , x) = (M2 , x),
otherwise they are called dierent. The empty multi set is denoted by .
For two distinct integers i, j let Rij : [k] [k] be dened by Rij (t) = t
if t = i, and Rij (t) = j if t = i. For R : [k] [k] and L [k] let R(L) =
{R(i) | i L} and ij (L) = Rij (L). For L [k]r , r > 1, let R(L) =
{(R(i1 ), . . . , R(ir )) | (i1 , . . . , ir ) L} and ij (L) = Rij (L).

Examples

Problem 1 (partition into independent sets (into cliques)).


INSTANCE: Graph G = (V, E), positive integer r |V |.
QUESTION: Is there a partition of V into r disjoint sets V1 , . . . , Vr such that

NP-hard Graph Problems on Clique-Width Bounded Graphs

121

V1 Vr = V and no set Vt , 1 t r, has two vertices joined by an edge


(every set Vt , 1 t r, induces a complete subgraph, respectively)?
Let G = (V, E, lab) = val(X) for some clique-width k-expression X. For a
disjoint partition of V into independent sets V1 , . . . , Vr let M be the multi set
lab(V1 ), . . . , lab(Vr ). Let F (X) be the set of all multi sets M for all disjoint
partitions of vertex set V into independent sets. Then F (X) is polynomially
k
bounded in the size of X, because F (X) has at most (|V | + 1)2 1 multi sets
each with at most |V | nonempty subsets of [k]. The following observations show
that F (i ) is computable in time O(1), F (X Y ) is computable in polynomial
time from F (X) and F (Y ), and F (i,j (X)), and F (ij (X)) are computable in
polynomial time from F (X).
1. F (i ) = {{i}}
2. Starting with set D = {} F (X) F (Y ), extend D by all triples that can
be obtained from some triple (M, M , M ) D by removing a set L from
M or a set L from M and inserting it into M, or by removing both sets
and inserting L L into M.
k
D gets at most (|V | + 1)3(2 1) triples and thus is computable in polynomial
time.
F (X Y ) = {M | (M, , ) D}
3. F (i,j (X)) = {L1 , . . . , Lr  F (X) | {i, j}  Lt for t = 1, . . . , r}
4. F (ij (X)) = {ij (L1 ), . . . , ij (Lr ) | L1 , . . . , Lr  F (X)}
There is a partition of the vertex set of val(X) into r independent sets if and
only if there is some M F (X) consisting of r label sets. A partition of G =
(V, E, lab) into cliques corresponds to a partition of its edge complement G =
(V, E, lab), E = {{u, v} | u, v V, u = v, {u, v}  E}, into independent sets. A
2k-expression X for val(X) can easily be obtained from X in polynomial time,
see [3]. This proves the following result.
Theorem 1. Given a clique-width k-expression X for some xed integer k, then
the problems partition into independent sets and partition into cliques for graph
val(X) are solvable in polynomial time in the size of X.
The problem partition into independent sets (chromatic number) is also
shown in [10] to be solvable in polynomial time on clique-width bounded graphs.
Due to its simplicity, we have used the chromatic number problem as our introducing example. Note that our solution diers from that given in [10].
Problem 2 (partition into independent sets (into cliques) of bounded size).
INSTANCE: Graph G = (V, E), positive integer s |V |.
QUESTION: Is there a partition of V into disjoint sets V1 , . . . , Vr of size s such
that V1 Vr = V and no set Vt , 1 t r, has two vertices joined by an
edge (every set Vt , 1 t r, induces a complete graph of G, respectively)?
Let s be some xed integer. For a disjoint partition of V into independent sets
V1 , . . . , Vr of size s let M be the multi set (lab(V1 ), |V1 |), . . . , (lab(Vr ), |Vr |).
Let F (X) be the set of all multi sets M for all disjoint partitions of vertex set

122

Wolfgang Espelage, Frank Gurski, and Egon Wanke


k

V into independent sets of size s. Then F (X) has at most (|V | + 1)(2 1)s
multi sets each with at most |V | tuples (L, x), where L is a nonempty subset of
[k] and 1 x s.
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable in the same
way as for the problem partition into independent sets. The only dierence worth
to emphasize is the computation of F (X Y ) in the case where we remove both
tuples, the tuple (L , x ) from M and the tuple (L , x ) from M . In this case,
we insert (L L , x + x ) into M only if x + x s.
There is a partition of val(X) into independent sets of size s if and only if
there is some M F (X) such that for all (L, x) M, x = s. This and the
edge complement property of clique-width bounded graphs proves the following
theorem.
Theorem 2. Given a clique-width k-expression X for some xed integer k, then
the problems partition into independent sets of bounded size and partition into
cliques of bounded size for graph val(X) are solvable in polynomial time.
The problem partition into cliques of size three is also called partition into
triangles.
Problem 3 (partition into complete bipartite graphs).
INSTANCE: Graph G = (V, E), positive integer r |V |.
QUESTION: Is there a partition of V into r disjoint sets V1 , . . . , Vr such that
V1 Vr = V and each set Vt , 1 t r, induces a complete bipartite graph?
Let V1,1 , V1,2 , . . . , Vr,1 , Vr,2 be a disjoint partition of vertex set V into independent sets such that the subgraphs Gt induced by the vertices from Vt,1 Vt,2
are bipartite (not necessarily complete bipartite) for t = 1, . . . , r. Let M be the
multi set that has a triple (L1 , L2 , LE ) for every pair (Vt,1 , Vt,2 ) dened as follows. L1 = lab(Vt,1 ), L2 = lab(Vt,2 ), and LE is the set of all label pairs (i, j) such
that there are two nonadjacent vertices u Vt,1 , v Vt,2 labeled by lab(u) = i,
lab(v) = j. Let F (X) be the set of all multi sets M dened as above for all
disjoint partitions of vertex set V into bipartite graphs. Then F (X) has at most
k

k2

(|V | + 1)2 2 2 multi sets each with at most |V | triples (L1 , L2 , LE ), where L1
and L2 are subsets of [k] and LE is a subset of [k] [k].
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable as follows.
1. F (i ) = {({i}, , ), (, {i}, )}
2. Starting with set D = {} F (X) F (Y ) extend D by all triples that
can be obtained from some triple (M, M , M ) D by removing a triple
(L1 , L2 , LE ) from M or a triple (L1 , L2 , LE ) from M and inserting it into
M, or by removing both triples and inserting (L1 L1 , L2 L2 , LE LE
L1 L2 L1 L2 ) into M.
F (X Y ) = {M | (M, , ) D}
3. We say M F (X) is feasible for operation i,j if for every (L1 , L2 , LE ) M,
{i, j}  L1 and {i, j}  L2 .
If M is feasible for operation i,j then let i,j (M) be the multi set obtained
from M by removing (i, j) and (j, i) from all sets LE for all (L1 , L2 , LE )
M.

NP-hard Graph Problems on Clique-Width Bounded Graphs

123

F (i,j (X)) = {i,j (M) | M F (X), M feasible for i,j }


4. For operation ij and M F (X), let ij (M) be the multi set obtained
from M by substituting every triple (L1 , L2 , LE ) M by
(ij (L1 ), ij (L2 ), ij (LE )).
F (ij (X)) = {ij (M) | M F (X)}
There is a partition of val(X) into r complete bipartite graphs if and only if
there is some M F (X) consisting of r triples (L1 , L2 , ) such that L1 and L2
are nonempty.
Theorem 3. Given a clique-width k-expression X for some xed integer k, then
the problem partition into complete bipartite graphs for val(X) is solvable in
polynomial time.
Problem 4 (partition into perfect matchings).
INSTANCE: Graph G = (V, E), positive integer r |V |.
QUESTION: Is there a partition of V into r disjoint sets V1 , . . . , Vr such that
V1 Vr = V and each set Vt , 1 t r, induces a perfect matching?
A vertex set V  V is called edge independent if the subgraph G of G
induced by V  does not contain two incident edges. Let V1 , . . . , Vr be a disjoint
partition of vertex set V into edge independent sets. For such a partition of V
let M be the multi set that has a 4-tuple (L1 , L2 , LE , LU ) for every vertex
set Vt , 1 t r, dened as follows. L1 = lab(Vt ), L2 = lab2 (Vt ), LE is the
set of all label sets {i, j} such that the subgraph Gt of G induced by the vertices
of Vt has two adjacent vertices labels by i and j, respectively, and LU is the
set of all labels i such that Gt has a vertex labeled by i that is not incident to
any edge of Gt . Let F (X) be the set of all multi sets M dened as above for
all disjoint partitions of vertex set V into edge independent sets. Then F (X)
k

k2

has at most (|V | + 1)(2 1)2 2 2 multi sets each with at most |V | 4-tuples
(L1 , L2 , LE , LU ), where L1 is a nonempty subset of [k], L2 and LU are
subsets of [k], and LE is a subset of {{i, j} | i, j [k]}.
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable as follows.
1. F (i ) = {({i}, , , {i})}
2. Starting with set D = {} F (X) F (Y ) extend D by all triples that
can be obtained from some triple (M, M , M ) D by removing a 4-tuple
(L1 , L2 , LE , LU ) from M or a 4-tuple (L1 , L2 , LE , LU ) from M and
inserting it into M, or by removing both 4-tuples and inserting
(L1 L1 , L2 L2 (L1 L1 ), LE LE , LU LU )
into M.
F (X Y ) = {M | (M, , ) D}
3. We say M F (X) is feasible for operation i,j if for every 4-tuple
(L1 , L2 , LE , LU ) M the following holds. If {i, j} L1 then {i, j}
L1 L2 and either {i, j} LE or i, j LU . If M is feasible for operation

124

Wolfgang Espelage, Frank Gurski, and Egon Wanke

i,j then let i,j (M) be the multi set obtained from M by the following
modication of the 4-tuples (L1 , L2 , LE , LU ) M. If i, j L1 L2
and i, j LU then remove i, j from LU and insert {i, j} into LE .
F (i,j (X)) = {i,j (M) | M F (X), M feasible for i,j }
4. For operation ij let ij (M) be the multi set obtained from M by the
following modication of the 4-tuples (L1 , L2 , LE , LU ) M. If i, j L1
then insert j into L2 . Then relabel every label i into label j in every set
L1 , L2 , LU , and LE .
F (ij (X)) = {ij (M) | M F (X)}
There is a partition of val(X) into r perfect matchings if and only if there
is some M F (X) consisting of r 4-tuples (L1 , L2 , LE , LU ) such that LU is
empty.
Theorem 4. Given a clique-width k-expression X for some xed integer k, then
the problem partition into perfect matchings for val(X) is solvable in polynomial
time.
Problem 5 (partition into forests).
INSTANCE: Graph G = (V, E), positive integer r |V |.
QUESTION: Is there a partition of V into r disjoint sets V1 , . . . , Vr such that
V1 Vr = V and each set Vt , 1 t r, induces a forest?
Let V1 , . . . , Vr be a disjoint partition of the vertex set V such that the subgraphs Gt of G induced by the vertices from Vt are forests for t = 1, . . . , r. For
such a partition of V let M be the multi set that has a triple (L1 , L2 , LT ) for
every vertex set Vt , 1 t r, dened as follows. L1 = lab(Vt ), L2 = lab2 (Vt ),
and LT is the set of all triples (K1 , K2 , KE ) such that Gt has a maximal connected component (a tree) T = (VT , ET , labT ) and K1 = lab(VT ),
K2 = lab2 (VT ), and KE is the set of all label sets {i, j} such that VT has two
nonadjacent vertices labeled by i and j, respectively. Let F (X) be the set of
all multi sets M dened as above for all disjoint partitions of vertex set V into
forests.
The size of F (X) is polynomially bounded in the size of X, because F (X)
k

2
2k 2k 2k

has at most (|V | + 1)(2 1)2 2


multi sets each with at most |V | triples
(L1 , L2 , LT ), where L1 is a nonempty subset of [k], L2 is a subset of [k],
and LT is a set of triples (K1 , K2 , KE ) where K1 is a nonempty subset of
[k], K2 is a subset of [k], and KE is a subset of {{i, j} | i, j [k]}.
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable as follows.
1. F (i ) = {({i}, , {({i}, , )})}
2. Starting with set D = {} F (X) F (Y ) extend D by all triples that
can be obtained from some triple (M, M , M ) D by removing a triple
(L1 , L2 , LT ) from M or a triple (L1 , L2 , LT ) from M and inserting it
into M, or by removing both triples and inserting (L1 L1 , L2 L2
(L1 L1 ), LT LT ) into M.
F (X Y ) = {M | (M, , ) D}

NP-hard Graph Problems on Clique-Width Bounded Graphs

125

3. We say M F (X) is feasible for operation i,j if for every triple (L1 , L2 ,
LT ) M, {i, j}  L2 and for every triple (K1 , K2 , KE ) LT , {i, j} 
KE , and if i L1 K1 then j  K2 , and if j L1 K1 then i  K2 .
If M is feasible for operation i,j then let i,j (M) be the multi set obtained
from M by the following modication of the triples (L1 , L2 , LT ) M.
Assume i L1 L2 , for j L1 L2 change i and j. Then let
(K1,1 , K1,2 , K1,E ), . . . , (Ks,1 , Ks,2 , Ks,E ) LT
be all triples such that i K1,1 and j Kt,1 for t = 2, . . . , s. Remove



) into LT
these s triples from LT and insert a new triple (K1
, K2
, KE
dened asfollows.

K1
=
Kt,1 ,

K2


KE
=

1ts

1ts

1ts

Kt,2
Kt,E


1t1
<t2 s

Kt1 ,1 Kt2 ,1 , and


{{i , j  } | i Kt1 ,1 , j  Kt2 ,1 } {i, j} .

1t1 <t2 s

F (i,j (X)) = {i,j (M) | M F (X), M feasible for i,j }


4. For operation ij let ij (M) be the multi set obtained from M by the
following modication of the triples (L1 , L2 , LT ) M. If both labels i, j
are in L1 or in K1 of some triple (K1 , K2 , KE ) LT then insert j into
L2 or K2 , respectively.
Then relabel every i into j in every set of (L1 , L2 , LT ).
F (ij (X)) = {ij (M) | M F (X)}
There is a partition of val(X) into r forests if and only if there is some
M F (X) consisting of r triples.
Theorem 5. Given a clique-width k-expression X for some xed integer k, then
the problem partition into forests for val(X) is solvable in polynomial time.
Problem 6 (cubic subgraph).
INSTANCE: Graph G = (V, E).
QUESTION: Is there a nonempty subset E  E such that in graph (V, E  )
every vertex has either degree 3 or degree 0?
We illustrate this example with an NLC-width k-expression instead of a
clique-width k-expression. For some xed integer s and a subset of edges E  E
such that in G = (V, E  , lab) all vertices have degree s, let M be the following
multi set. M has for every vertex u V a tuple (lab(u), deg(u)), where deg(u) is
the vertex degree of u in G . Let F (X) be the set of all multi sets M for integer
s and all such subsets E  . Then F (X) has at most (|V | + 1)k(s+1) multi sets
each with |V | tuples (l, d), where l is a label from [k] and d is an integer between
0 and s.
F (i ), F (X S Y ), and F (R (X)) are computable as follows.

126

Wolfgang Espelage, Frank Gurski, and Egon Wanke

1. F (i ) = {(i, 0)}
2. Starting with set D = {} F (X) F (Y ) extend D by all triples that can
be obtained from some triple (M, M , M ) D by
(a) removing a tuple (l , d ) from M or (l , d ) from M and inserting it
into M or by
(b) removing a tuple (l , d ) from M and choosing at most r, 1 r s d ,
tuples (l1 , d1 ), . . . , (lr , dr ) from M such that (l , lt ) S and dt < s for
t = 1, . . . , r, and inserting (l , d + r) into M and changing every (lt , dt )
into (lt , dt + 1) without removing them from M .
F (X S Y ) = {M | (M, , ) D}
3. F (R (X)) = {(R(l1 ), d1 ), . . . , (R(lt ), dt ) | (l1 , d1 ), . . . , (lt , dt ) M}
There is a subgraph of val(X) with at least one edge such that all vertices
have degree 3 or 0 if and only if there is some M F (X) such that for all
(l, d) M, d = 3 or d = 0 and there is at least one (l, d) M with d = 3.
Theorem 6. Given an NLC k-expression X for some xed integer k, then the
cubic subgraph problem for val(X) is solvable in polynomial time.
Problem 7 (Hamiltonian path).
INSTANCE: Graph G = (V, E).
QUESTION: Is there a simple path of length |V | in G?
For a subset of edges E  E such that subgraph G = (V, E  , lab) contains
no cycles and every vertex in G has degree at most 2, let M be the following
multi set. M has a multi set lab(v1 ), lab(vr ) for every path p = v1 , . . . , vr ,
r 1, in G , where v1 , vr have degree 1 in G . Let F (X) be the set of all multi
2
sets M for all such subsets E  E. Then F (X) has at most (|V | + 1)k multi
sets each with at most |V | multi sets of size two.
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable as follows.
1. F (i ) = {i, i}
2. F (X Y ) = {M M | M F (X), M F (Y )}
3. F (i,j (X)) can be computed from F (X) as follows. Starting with set D =
F (X), extend D by all multi sets that can be obtained from a multi set M
of D by removing two multi sets i1 , j1 , i2 , j2 , where i = i1 and j = j2 ,
and inserting the new multi set i2 , j1 . The resulting set D is F (i,j (X)).
4. F (ij (X)) = {ij (M ) | M M | M F (X)}
Graph val(X) has a Hamiltonian path if and only if F (X) has a multi set
M consisting of exactly one multi set.
Theorem 7. Given a clique-width k-expression X for some xed integer k, then
the Hamiltonian path problem for val(X) is computable in polynomial time.
A simple modication leads to a polynomial time solution for the Hamiltonian
circuit problem as in [11].

NP-hard Graph Problems on Clique-Width Bounded Graphs

127

Problem 8 (minimum maximal matching).


INSTANCE: Graph G = (V, E), positive integer r |E|.
QUESTION: Is there a subset E  E with |E  | r such that |E  | is a maximal
matching, i.e. no two edges in E  share a common vertex and every edge in
E E  shares a common vertex with some edge in E  ?
For a subset of edges E  E and a disjoint partition of V into three sets
V1 , V2 , V3 such that V1 is an independent set and E  is a perfect matching for
the vertices of V2 , we dene a triple (lab(V1 ), |E  |, lab(u1 ), . . . , lab(us )), where
V3 = {u1 , . . . , us }. Let F (X) be the set of all triples dened as above for all such
edge sets and partitions.
Then F (X) has at most 2k |V2 | (|V | + 1)k triples of size at most k + 1 + |V |.
F (i ), F (X Y ), F (i,j (X)), and F (ij (X)) are computable as follows.
1. F (i ) = {(, 0, i), ({i}, 0, )}
2. F (X Y ) = {(L L , t + t , M M ) | (L, t, M) F (X), (L , t , M )
F (Y )}
3. F (i,j (X)) can be computed from F (X) as follows. Starting with set D =
F (X), remove all triples (L, t, M) from D for which {i, j} L, and then
extend D by all triples (L, t + 1, M {i}, {j}) for all triples (L, t, M) in
D, where {i}, {j} M. The resulting set D is F (i,j (X)).
4. F (ij (X)) = {(ij (L), t, ij (M)) | (L, t, M) F (X)}
There is a subset E  E with |E  | = r such that |E  | is a maximal matching
in G if and only if there is some triple (L, r, ) F (X).
Theorem 8. Given a clique-width k-expression X for some xed integer k, then
the minimum maximal matching problem for val(X) is computable in polynomial
time.
Let us nally consider some vertex and edge separation problems. Let F (X)
be the set of all 5-tuples (lab(V1 ), |V1 |, |V2 |, lab(V3 ), |V3 |) for all disjoint partitions
of vertex set V into three sets V1 , V2 , V3 such that G has no edge between a vertex
from V1 and a vertex from V3 . Then F (X) has at most 2k (|V | + 1) (|V | +
1) 2k (|V | + 1) 5-tuples. F (i ) = {({i}, 1, 0, , 0), (, 0, 1, , 0), (, 0, 0, {i}, 1)}.
F (X S Y ) is the set of all 5-tuples (L1 , x1 , x2 , L3 , x3 ) obtained from two 5tuples (L1 , x1 , x2 , L3 , x3 ) F (X) and (L1 , x1 , x2 , L3 , x3 ) F (Y ) such that
L1 = L1 L1 , x1 = x1 + x1 , x2 = x2 + x2 , L3 = L3 L3 , x3 = x3 + x3 , if
there is no pair (i, j) S such that i L1 and j L3 or i L3 and j L1 .
F (R (X)) = {(R(L1 ), x1 , x2 , R(L3 ), x3 ) | (L1 , x1 , x2 , L3 , x3 ) F (X)}.
The vertex separation problem whether G = val(X) has a vertex set V2 of
size r such that G without the vertices of V2 can be partitioned into two
disjoint sets V1 , V3 of size |V | such that there is no edge between vertices
from V1 and vertices from V3 , for some given r and , can now be solved in
polynomial time.
Let F (X) be the set of all triples
(lab(u1 ), . . . , lab(ur ), x, lab(ur+1 ), . . . , lab(un ))

128

Wolfgang Espelage, Frank Gurski, and Egon Wanke

for all disjoint partitions of V = {u1 , . . . , un } into V1 = {u1 , . . . , ur } and V2 =


{ur+1 , . . . , un } such that x is the number of edges between the vertices from V1
and V2 . Then F (X) has at most (|V | + 1)k (|E| + 1) (|V | + 1)k triples.
F (i ) = {(i, 0, ), (, 0, i)}. F (XS Y ) is the set of all triples (M1 , x, M2 )
obtained from two triples (M1 , x , M2 ) F (X) and (M1 , x , M2 ) F (Y ) such
that M1 = M1 M1 , M2 = M2 M2 , and


(M1 , i) (M2 , j) +
(M2 , i) (M1 , j).
x = x + x +
(i,j)S

(i,j)S

F (R (X)) = {(R(M1 ), x, R(M2 )) | (M1 , x, M2 ) F (X)}.


The edge separation problem whether there is a partition of the vertex set
of G = val(X) into two disjoint sets V1 , V2 of size |V | such that there are at
most r edges between vertices from V1 and vertices from V2 , for some given r
and , can now be solved in polynomial time.

References
1. D.G. Corneil, M. Habib, J.M. Lanlignel, B. Reed, and U. Rotics. Polynomial
time recognition of clique-width at most three graphs. In Proceedings of Latin
American Symposium on Theoretical Informatics (LATIN 2000), volume 1776 of
LNCS. Springer-Verlag, 2000.
2. B. Courcelle, J.A. Makowsky, and U. Rotics. Linear time solvable optimization
problems on graphs of bounded clique width. Theory of Computing Systems,
33(2):125150, 2000.
3. B. Courcelle and S. Olariu. Upper bounds to the clique width of graphs. Discrete
Applied Mathematics, 101:77114, 2000.
4. D.G. Corneil, Y. Perl, and L.K. Stewart. A linear recognition algorithm for
cographs. SIAM Journal on Computing, 14(4):926934, 1985.
5. D.G. Corneil and U. Rotics. On the relationship between clique-width and treewidth. In Proceedings of Graph-Theoretical Concepts in Computer Science, LNCS,
Springer-Verlag, 2001. to appear
6. M.C. Golumbic and U. Rotics. On the clique-width of perfect graph classes. IJFCS:
International Journal of Foundations of Computer Science, 11(3):423443, 2000.
7. F. Gurski and E. Wanke. The tree-width of clique-width bounded graphs without
Kn,n . In Proceedings of Graph-Theoretical Concepts in Computer Science, volume
1938 of LNCS, pages 196205. Springer-Verlag, 2000.
Johansson. Clique-decomposition, NLC-decomposition, and modular decom8. O.
position - relationships and results for random graphs. Congressus Numerantium,
132:3960, 1998.
Johansson. NLC2 decomposition in polynomial time. In Proceedings of Graph9. O.
Theoretical Concepts in Computer Science, volume 1665 of LNCS, pages 110121.
Springer-Verlag, 1999.
10. D. Kobler and U. Rotics. Polynomial algorithms for partitioning problems on
graphs with xed clique-width. In Proceedings of the ACM-SIAM Symposium on
Discrete Algorithms, pages 468476 ACM-SIAM, 2001.
11. E. Wanke.
k-NLC graphs and polynomial algorithms.
Discrete Applied Mathematics, 54:251266, 1994. Revised version, http://www.cs.uniduesseldorf.de/wanke.

Вам также может понравиться