Professional Documents
Culture Documents
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
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.
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
Examples
121
122
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.
123
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
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
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
1t1 <t2 s
126
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].
127
128
(i,j)S
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.