berlin
Technische Universität Berlin
FACHBEREICH 3
MATHEMATIK
The Disjoint Cliques Problem
by
Klaus Jansen
Petra Scheffler
Gerhard Woeginger
No. 341/1992
Appeared in: Proc. FCT'93, Lecture Notes in Computer Science 710, (1993), 319{328.
The Disjoint Cliques Problem
Klaus Jansen Petra Scheer y
Gerhard Woeginger z
Abstract
Given a graph G = (V; E ), we consider the problem of nding a set of D
pairwise disjoint cliques in the graph with maximum overall number of vertices.
We determine the computational complexity of this problem restricted to a variety
of dierent graph classes. We give polynomial time algorithms for the problem
restricted to interval graphs, bipartite graphs, cographs, directed path graphs and
partial k-trees. In contrast, we show the NP-completeness for undirected path
graphs. Moreover, we investigate a closely related scheduling problem.
1 Introduction
In this paper we analyse the problem Disjoint Union of Cliques (DUC for short)
dened as follows.
Instance: A nite undirected graph G = (V; E ) and two positive integers
D; B jV j.
Question: Do there exist D pairwise disjoint cliques C1 ; : : :; CD in G such
P
that Di=1 jCi j B holds?
A set C V is a clique in a graph G = (V; E ) if each pair v; v 0 2 C of vertices
with v 6= v 0 is connected by an edge fv; v 0g 2 E . For arbitrary undirected graphs,
DUC is easily seen to be NP-complete: For D = 1, it turns into the well-known
Clique problem, and for B = jV j, it becomes the Partition into Cliques problem
(cf. Garey and Johnson [GJ] for more information on these two problems). Since the
problem DUC is a `hard' problem, we explore its restrictions to various special graph
classes and we hope to detect computationally better tractable cases.
The motivation for this approach comes from the NP-completeness table of Johnson [Jo], where the complexity of ten dierent graph problems restricted to a series of
graph classes is given. Two problems in the table of Johnson are the mentioned Clique
and Partition into cliques that are subproblems of DUC.
Both problems are polynomial solvable for chordal graphs. This yields to the natural
question whether DUC is also polynomial solvable restricted to chordal graphs. In
y
z
FB IV, Mathematik und Informatik, Universitat Trier, Postfach 3825, W-5500 Trier, Germany.
FB Mathematik, MA 6-1, TU Berlin, Strasse des 17. Juni 136, W-1000 Berlin 12, Germany.
Institut fur Informationsverarbeitung, TU Graz, Klosterwiesgasse 32, A-8010 Graz, Austria.
1
contrast to the expected answer the NP-completeness for Duc restricted to split graphs,
a subclass of the chordal graphs has been proved by Gavril and Yannakakis [GY].
But for interval graphs (Section 2) and for directed path graphs (Section 3) we give
algorithms with time complexity O(D jV j2 ) and O(D2 jV j2), respectively. Furthermore,
we show also the NP-completeness for undirected path graphs (Section 4) - another
subclass of chordal graphs.
Moreover, we study some other important graph classes for that we found polynomial time algorithms. These are the bipartite
p graphs (Section 5), cographs (Section 6)
and partial k-trees (Section 7) with O( jV j jE j), O(jV j2 ) and O(D2 jV j) as time
complexity, respectively.
The problem Duc was analysed rst by Frank [Fr]. He considered comparability
graphs and its complement graphs (co-comparability graphs) and gave an algorithm
for both graph classes with time complexity O(a b jV j2) where a is the cardinality
of a maximum clique and where b is the cardinality of a maximum independent set.
Gavril [Ga] proposed a slighty better algorithm which needs O(D jV j2) time steps
for comparability graphs and O(jV j3 + bjV j2log (jV j)) for co-comparability graphs. For
subclasses like the interval graphs (Section 2), bipartite graphs (Section 5) and cographs
(Section 6) we found algorithms with a better time complexity.
The exact denitions of the graph classes are given in the corresponding sections.
Finally, in Section 9 we investigate a scheduling problem closely related to DUC. We
derive a polynomial time approximation algorithm for the scheduling problem restricted
to graph classes on which Duc is polynomial time solvable.
Notation. We consider the optimization version of Duc in all those parts of our
paper where we give algorithms. That means, we describe how to nd the maximum
number !D (G) of vertices in D disjoint cliques given a graph G and a positive integer
D. Given a graph G and a set H V we denote with GjH the subgraph of G induced
by H .
2 Interval graphs
In this section we give an algorithm for DUC restricted to interval graphs with time
complexity O(D jV j2). Since each interval graph is also an co-comparability graph,
we improve the algorithm of Gavril with time complexity O(jV j3 + bjV j2log (jV j)). A
graph G = (V; E ) is an interval graph if one can associate with each vertex v 2 V
a closed interval Iv on the real line such that two vertices u; v 2 V are adjacent in
G if and only if Iu \ Iv 6= ;. An equivalent condition is that the interval graph can
be described as a sequence of maximal cliques A1 ; : : :; An such that each vertex v only
occurrs in consecutive cliques. Clearly, the number n is bounded by jV j. An consecutive
arrangement of the maximal cliques can be obtained in O(jV j + jE j) time [BL].
We denote with !k;i (G) the maximal size of at most k disjoint cliques in the interval
graph GjA1 [:::[Ai induced by the rst i cliques. These values satisfy the following
recursive relation.
2
Lemma 2.1
8
< maxf! ?1(G); max1 ?1 ! ?1 (G) + jA n A jg i; k > 1
i > 1; k = 1
! (G) = : max1 jA j
jA1j
i = 1; k 1
k;i
k;i
j
j
i
i
k
;j
i
j
j
Proof. The statement directly follows from the denition of the values !k;i (G) and
uses the consecutivity property of the maximal cliques A1 ; : : :; An.
2
The optimal value !D (G) is equal to !D;n (G). In the computation of !D (G) we
have to compute O(D jV j) values !k;i . In the following we consider the computation
of the set dierences.
Lemma 2.2 The cardinalities of the set dierences jAi n Aj j for 1 j < i n can be
computed in O(n2 ) time.
Proof. For each pair j; i with j < i we have to compute jAi n Aj j = jAij ? jAi \ Aj j.
Let us denote aj;i = jAi \ Aj j. From the consecutive property of the cliques we know
that
aj;i = jfv 2 V jfor all k; j k i : v 2 Ak gj:
The value aj;i gives the number of intervals starting before j and ending after i. To
compute these values we use numbers bj;i = jfv 2 V jfor all k; j k i : v 2 Ak ^ v 62
Aj?1 gj. A number bj;i gives the number of intervals starting at j and ending after
i. Moreover, we generate values cj;i = jfv 2 V jfor all k; j k i : v 2 Ak ^ v 62
Aj?1 ^ v 62 Ai+1 gj where cj;i denotes the number of intervals starting at j and ending
at i. The values cj;i can be computed directly from the sequence A1; : : :; An in O(n2 )
time. Then, using the recursion
aj;i =
and the recursion
(
aj?1;i + bj;i for 1 < j
b1;i
for 1 = j
(
bj;i+1 + cj;i for i < n
cj;n
for i = n
all values bj;i and aj;i with 1 j < i n are computed in O(n2 ) time. Therefore, the
cardinalities of all set dierences Ai n Aj can be generated in O(n2 ) time.
2
bj;i =
Summarizing, we derived the following result.
Theorem 2.3 For an interval graph G = (V; E ), !D (G) can be computed in time
O(D jV j ).
Proof. For each value !k;i (G) with 1 k D, 1 i jV j we need at most O(jV j)
2
2
comparisions.
3
3 Directed path graphs
In this section we consider the directed path graphs, a generalization of the interval
graphs. For these graphs we give a polynomial algorithm with time complexity O(D2 jV j2). A graph G = (V; E ) is a directed path graph , if it is the intersection graph of
directed paths in a directed tree. That means, that there is a directed tree T = (W; F )
with all arcs oriented from its root to the leaves and for every vertex v 2 V there is a
directed path Pv in T , such that for all pairs of vertices u; v 2 V with (u 6= v ) there is
an edge fu; v g 2 E , if and only if Pv and Pw have at least one node in common. Such a
representation of a directed path graph can be obtained in O(jV j + jE j) time [Di] and
the number of nodes in such a tree can be bounded by O(jV j).
For simplication we assume here that the tree is given as a binary tree. However,
each tree which represents a directed path graph can be transformed into an equivalent
binary tree. For a transformation of a general tree into a binary tree we refer to Figure
1. It shows a transformation of a node of out-degree k into a tree with only nodes of
out-degree two.
H
H
?@
?
@@
?
? q q q @
R
H1
-
Hk
p
p
p
?@
@@
?
?
@R
?
H n Hk
Hk
p @@@
@R
Hk?1
H n (H3 [ : : : [ Hk )
?@@
?
@@R
?
?
H1
H2
Figure 1: Transformation of a node with out-degree k
We denote by Tx the subtree of T rooted at node x, by Hx the set of vertices v
whose paths Pv go through x and by Gx the subgraph of G induced by those vertices
Vx that correspond to paths in Tx.
Lemma 3.1 Let x be a node in the tree T with two children l(x) and r(x). Then,
!d (Gx) with d 2 f1; : : :; Dg can be computed by the maximum of the following two
4
values:
(1) max0id [!i (Gl(x)) + !d?i (Gr(x))];
(2) max0id?1 [!i (Gl(x)jHxc ) + !d?i?1 (Gr(x)jHxc ) + jHx j]
where Hxc denotes the complement set Vx n Hx .
Proof. Given a set of d cliques C1; : : :; Cd in the graph Gx either one of the cliques
Cj is a subset of the vertex set Hx or for all j 2 f1; : : :; dg, Cj 6 Hx . In the second
case, every clique lies in the right subgraph Gr(x) or in the left subgraph Gl(x), but not
in both. Then, the d cliques can be divided into i cliques for the left and d ? i cliques
for the right subgraph with i 2 f0; : : :; dg. In the rst case, we can use instead of the
clique Cj Hx the larger clique Hx . Then, the other d ? 1 cliques lie in the left or
right subgraph.
2
The main idea in computing the value !D (G) is to generate for each subtree Tx
and for each predecessor y of x lying on the path from the root w to x in T the values
!d(GxjHyc ) and the values !d (Gx ) with d 2 f1; : : :; Dg. These values are computed in
postorder. Using the fact that the graph Gx jHxc is a subgraph of Gx jHyc we take for
!d(GxjHyc ) now the maximum of the following values:
(1) max0id [!i (Gl(x)jHyc ) + !d?i (Gr(x)jHyc )];
(2) max0id?1 [!i (Gl(x)jHxc ) + !d?i?1 (Gr(x)jHxc ) + jHx n Hy j]:
For a leaf we get for d > 0 the value !d (GxjHyc ) = jHx n Hy j and !d (Gx ) = jHxj and
for d = 0 the value zero. In postorder these values are computed for all vertices of the
tree, at rst for the leaves and then for the predecessors. In the following we consider
the computation of the cardinalities of the set dierences jHx n Hy j.
Lemma 3.2 The cardinalities of the set dierences jHx n Hy j can be computed in
O(jW j2) time for all pairs of nodes x and y, where y is a predecessor of x in the
tree T = (W; F ).
Proof. Let us denote ax;y = jHx \ Hy j. To compute these values we use numbers cx;y
and bx;y . The value cx;y gives the number of paths Pv starting at y and ending at x
and the value bx;y gives the number of paths Pv starting above to y and ending at x.
The values cx;y can be computed directly from the tree representation in O(jW j2) time.
The computation of the values bx;y can be done using the following recursion also in
quadratic time. Let p(y ) be the direct predecessor of a vertex y in the tree with y
unequal to the root w.
(
6 w
=
bx;y = bcx;p(y) + cx;y ifif yy =
w
x;y
Moreover, the values ax;y can be generated using the recursion:
(
a leaf,
ax;y = ab r(x);y + al(x);y + bx;y ifif xx isis not
a leaf.
x;y
5
Therefore, the set dierences jHx n Hy j = jHx j?jHx \ Hy j can be generated in O(jW j2)
time.
2
Theorem 3.3 For a directed path graph G = (V; E ), the problem Duc is solvable in
time O(D jV j ).
Proof. Use that at most O(D jV j ) values must be computed and that the computation
2
2
2
can be done in O(D) time for each recursion step. The sizes of the set dierences
jHx n Hy j can be computed2by preprocessing in O(jV j2) time. Therefore, the complete
algorithm needs O(D2 jV j ) time steps.
2
4 Undirected path graphs
An undirected path graph is a generalization of a directed path graph introduced in the
preceding section. Undirected path graphs are the intersection graphs of undirected
paths in an unrooted and undirected tree. The class of undirected path graphs, directed
path graphs and split graphs all are subclasses of the chordal graphs. Hence, the NPcompleteness result for split graphs implies that DUC is NP-complete for the more
general chordal graphs. Whereas for directed path graphs there exists a polynomial
time algorithm, we will show in this section that Duc is NP-complete for undirected
path graphs.
Theorem 4.1 The problem Duc is NP-complete for undirected path graphs.
Proof. We prove this by reduction from the NP-complete 3-SAT problem. We use
the restricted version where each literal occurrs at most three times in the clauses
(cf. [GJ]). Assume an instance of 3-SAT is given. Let X = fx1; x1; : : :; xn ; xng be its
set of variables and fc1; : : :; cmg be its set of clauses of size three. We construct now
an undirected path graph that has n + m cliques which cover (n + m)(6n + 3) vertices
if and only if there is a truth assignment that veries the given formula.
(1)
(3)
(3)
For each variable we dene six vertices x(1)
i ; xi , : : :; xi ; xi . We denote with
Yj = fyj;1; yj;2 ; yj;3g the set of the vertices corresponding to the variables in the j th clause cj with yj;k = xi(l) or yj;k = xi(l) . Using this setting, we dene now some
additional sets of vertices:
for each i 2 f1; : : :; ng we take one set Li of size n and two sets Ki(1) and Ki(2),
each of size 5n.
(2)
(3)
for each j 2 f1; : : :; mg we take three additional vertices c(1)
j ; cj and cj and
three sets Dj(1); Dj(2) and Dj(3), each of size 6n.
(2)
(3)
(1)
(2)
(3)
We denote Ai = fx(1)
i ; xi , xi g, Bi = fxi ; xi ; xi g and Xi = Ai [ Bi for each
i 2 f1; : : :; ng. Furthermore, we set X 0 = [ni=1 Xi.
6
We now dene the input graph G = (V; E ) for the DUC problem. Its vertex set is
S
S
(2) (3)
the union V = X 0 [ ni=1 (Li [ Ki(1) [ Ki(2)) [ mj=1 (Dj(1) [ Dj(2) [ Dj(3) [ fc(1)
j ; cj ; cj g).
We take an edge between a pair of vertices if and only if one of the following sets
contains both vertices. Each of the following sets forms a clique in G.
the set X 0.
for each i 2 f1; : : :; ng:
{ Xi [ L i .
{ Ai [ Li [ Ki .
{ Bi [ Li [ Ki .
for each j 2 f1; : : :; mg:
{ Yj [ fcj ; cj ; cj g.
{ fyj; g [ fcj ; cj g [ Dj .
{ fyj; g [ fcj ; cj g [ Dj .
{ fyj; g [ fcj ; cj g [ Dj .
(1)
(2)
(1)
1
2
3
(2)
(3)
(2)
(3)
(1)
(1)
(3)
(2)
(1)
(2)
(3)
First, we note that the graph G, given in this way is an undirected path graph.
This follows from the fact that we can arrange the cliques in a tree T , such that each
vertex in G lies in cliques of an undirected path in T . A possible arrangement of the
cliques in a tree is illustrated in Figure 2.
Now we prove the equivalence that G contains D = n + m cliques of size B =
(6n + 3) (n + m) if and only if there is a truth assignment that satises all m clauses.
Suppose we have a truth assignment, that satises the clauses. Let yj;ij with ij 2
f1; 2; 3g be a literal which satises the j .th clause. Then, we take the followings n + m
cliques with total size B = (6n + 3) (n + m).
if xi is true, take Bi [ Li [ Ki .
if xi is false, take Ai [ Li [ Ki .
if ij is one, take fyj; g [ fcj ; cj g [ Dj .
(2)
(1)
(2)
1
(3)
(1)
if ij is two, take fyj; g [ fcj ; cj g [ Dj .
(1)
2
(3)
(2)
if ij is three, take fyj; g [ fcj ; cj g [ Dj .
We show now, if a set of (n + m) cliques of total size (6n + 3) (n + m) is given,
then there must be a truth assignment for all m clauses. For that, consider the sizes of
the cliques. The maximum cliques have exactly the size 6n + 3 and can only be found
3
(1)
(2)
(3)
under the following:
7
fyj; ; cj ; cj g [ Dj
1
(2)
(3)
(1)
fyj; ; cj ; cj g [ Dj
(1)
(3)
(2)
fyj; ; cj ; cj g [ Dj
(1)
PPP
PPPP
PPPP
:::
:::
Yj [ fcj ; cj ; cj g
HH
HHH
HHH
X0
HHH
HH
HHH
:::
:::
Xi [ Li
QQ
QQ
QQ
2
(1)
Ai [ Li [ Ki(1)
(2)
3
(2)
(3)
(3)
Bi [ Li [ Ki(2)
Figure 2: An arrangement of the cliques in a tree
Clause-Cliques: for j 2 f1; : : :; mg:
fyj; g [ fcj ; cj g [ Dj .
fyj; g [ fcj ; cj g [ Dj .
fyj; g [ fcj ; cj g [ Dj .
Variable-Cliques: for i 2 f1; : : :; ng:
Ai [ Li [ Ki .
Bi [ Li [ Ki .
1
2
3
(2)
(3)
(1)
(1)
(3)
(2)
(1)
(2)
(3)
(1)
(2)
All other cliques in the graph have size less than (6n + 3) and cannot be chosen. But
also the chosen sets must be pairwise disjoint, and we must take (n + m) of them. So
it is not possible to take for an index i 2 f1; : : :; ng or j 2 f1; : : :; mg more than one
of the cliques; otherwise we loose at least one vertex. And this shows us directly, that
we can nd a truth assignment for all clauses.
2
5 Bipartite graphs
A graph G = (V; E ) is bipartite , if its edge set E satises E ffv; v 0gjv 2 V1; v 0 2 V2g
where V1 [ V2 = V and V1 \ V2 = ;. Such a partition in two independent sets for a
8
bipartite graph can be obtained in O(jV j + jE j) time [Go].
Since the largest cliques in a bipartite graphs are the edges, the maximum size of D
cliques can be computed by a matching algorithm. A matching in a graph G = (V; E )
is an edge set E 0 E with jfv jv 2 V ^ v 2 e for some e 2 E 0gj = 2 jE 0j. Compute a
matching of maximum cardinality in G and let D0 denote the number of edges in this
matching. If D0 D holds, we have !D (G) = 2D. If D0 < D holds, we easily see that
!Dp
(G) = minfD + D0; jV jg. Since the bipartite matching problem can be solved in
O( jV jjE j) time (see e.g. Micali and Vazirani [MV]), we proved the following theorem.
Theorem
p 5.1 For a bipartite graph G = (V; E ), !D (G) can be computed in polynomial
2
time O( jV j jE j).
6 Cographs
In this section, we show that Duc is solvable in O(jV j2 ) time when restricted to
cographs. Since each cograph is a comparability graph and since DUC is solvable
in O(D jV j2 ) time for comparability graphs, this gives an improvement eliminating
the factor D. Cographs are generated by disjoint union and product operations on
graphs (starting with single vertex graphs) and they can be represented by a parse tree
according to these operations. For graphs Gi = (Vi ; Ei) with V1 \ V2 = ;, the union
of G1 and G2, [(G1 ; G2) is given by (V1 [ V2; E1 [ E2 ). The product of G1 and G2 ,
denoted by (G1 ; G2), is obtained by rst taking the union of G1 and G2, and then
adding all the edges fv1 ; v2g with vi 2 Vi .
To each cograph, G one can associate a rooted binary tree, called a cotree of G.
Each non-leaf node in the tree is labelled either by [ (union) or by (product) and has
two children. Each node in the cotree corresponds to a cograph and a leaf corresponds
to a single-vertex graph. Corneil, Perl and Stewart [CPS] showed that it is linear time
O(jV j + jE j) decidable, whether a graph is a cograph. Moreover, within the same time
a corresponding cotree can be constructed. We investigate here the recursion of the
values !D (G) and the complexity of this problem restricted to cographs.
Lemma 6.1 Let G = (V; E ) be a cograph and let d 2 IN.
If V = fvg, then !d(G) = 1 for d 1 and !0(G) = 0.
If G = [(G1; G2), then !d (G) = max0id [!i(G1) + !d?i (G2)].
If G = (G1; G2), then !d (G) = !d(G1) + !d(G2).
Proof. For V = fvg, the size of d cliques can only be one (for d > 0). If we have a
product of two cographs, we can combine each pair of cliques C1 and C2 where Ci is a
clique in Gi . Hence, the maximum size of d cliques is given as the sum of both values
for G1 and G2. If we have a union of two cographs, a clique only lies in one of the
graphs G1 or G2 . Then, a choice of d cliques in G equals a choice of i cliques in G1
and d ? i cliques in G2 . Therefore, the maximum over all !i (Gi ) + !d?i (G2), 0 i d
gives !d (G).
2
9
Theorem 6.2 For a cograph G = (V; E ), DUC can be solved in polynomial time
O(jV j2).
Proof. For each node x of the cotree T which corresponds to a cograph Gx = (Vx; Ex)
we must only compute the values !d (Gx) for d jVxj. Given an union of two cographs
[(G1; G2) with sets of vertices V1 and V2 we get
!d (G) = maxf!i(G1) + !d?i (G2 )j0 i d; i jV1j; d ? i jV2 jg
where d jV j. Then, it follows that one can compute these values for an union and
(also for a product) in at most O(jV1j jV2j) time. Let t(n) denote the maximum total
time to compute all values for cotrees corresponding to cographs with n vertices. Then,
we have for all n > 1, t(n) max1in?1 c i (n ? i)+ t(i)+ t(n ? i), for some constant
c. This follows, because if G is the union or product of two disjoint cographs G1 and
G2 with i and n ? i vertices, then we get as computing time t(i) for G1 , t(n ? i) for G2
and at most c i (n ? i) for the root of the cotree. From this formula, it can be proved
by induction, that there exists a constant c0 with t(n) c0 n2 for each n 1.
2
7 Partial k-Trees
In this section we present a polynomial time algorithm for DUC on partial k-trees. For
any integer k, partial k-trees are the subgraphs of k-trees. A k-tree is a graph that can
be reduced to a k-clique by deletion of vertices of degree k with a completely connected
neighbourhood. Partial k-trees are well studied and known also as graphs that have a
tree-decomposition of width k. We give a denition of tree-decompositions below.
Many intractable problems are solvable in linear time for partial k-trees. Clique
and Partition into Cliques are two of them (cf. [Sch]). So it is natural to investigate
the complexity of the generalization of these problems. It turns out, that there is a
polynomial-time algorithm for DUC, too. The solution is found step by step in larger
and larger subgraphs of G that are determined by the tree-decomposition. This idea
was applied in [Sch] for many other problems and here it proves to be useful once more.
We use a special kind of tree-decompositions to represent partial k-trees.
Denition 7.1 A nice tree-decomposition of width k for a graph G = (V; E ) is a
pair (T; X ), where T is an oriented binary tree and X = fXt : Xt V; t 2 V (T )g with:
S X = V (G), and jX j k + 1 for every t 2 V (T ),
(i)
t
t
t2V (T )
(ii) for every fu; v g 2 E (G), there is a node t 2 V (T ) such that fu; v g Xt ,
(iii) Xi \ Xk Xj for all fi; j; kg V (T ) such that j is on the path from i to k in T ,
(iv) Xi = Xk = Xj if i 2 V (T ) has two children j and k. If j is the only child of i,
then there is a vertex v 2 V (G) that either Xi = Xj [ fv g or Xj = Xi [ fv g.
10
This kind of tree-decomposition is appropriate to handle partial k-trees eciently.
In fact, it is no restriction compared with the original denition by Robertson and
Seymour in [RS]. Indeed, the following fact is easy to prove, see [Sch]:
Lemma 7.2 Provided a tree-decomposition of width k for a graph G = (V; E ) is given,
then a nice tree-decomposition of the same width can be constructed in linear time. Its
tree T has at most O(jV j) nodes.
It is known, that a tree-decomposition of constant width k can be constructed in
polynomial time for a graph if one exists. The best algorithm has complexity O(jV j),
this is a recent result of Bodlaender (see [Bod]). Hence, given a partial k-tree, we can
obtain a nice tree-decomposition with width k in linear time.
A nice tree-decomposition gives a method to reconstruct the graph consecutively by
simple operations, starting with small graphs of size at most k + 1. This is convenient
to solve DUC. Similarly to Bern, Lawler and Wong [BLW], we consider k +1-terminal
graphs that are pairs (G; X ) consisting of a graph G together with a set of at most
k + 1 terminals X V (G). They are constructed by the following four operations:
Start: Take a (G; X ) with X = V (G). This operation corresponds to the leaves in
a decomposition-tree: For a leaf t we have the subgraph of G induced by the
terminal set Xt .
Forget: Take a (G; X ), where X = Y n fvg for a given terminal graph (G; Y ). This
operation corresponds to an edge (s; t) in the decomposition tree T , where s is
the only child of t and Y = Xs = Xt [ fv g. In this case, we have the same graph
as in the child, but one of its vertices is no longer a terminal (and hence, it cannot
be adjacent to any subsequent vertex of G).
Introduce: Take a (G; X ), where X = Y [ fvg and V (G) = V (H ) [ fvg and E (G) =
E (H ) [ F , where F f fv; yg : y 2 Y g for a given terminal graph (H; Y ). This
operation corresponds to an edge (s; t) in the decomposition tree T , where s is
the only child of t and Y = Xs = Xt n fv g. Here a new vertex is added to the
graph corresponding to the child s of t and to its terminal set.
Join: Take a (G; X ), where G = G1 [ G2 for two given terminal graphs (G1; X )
and (G2 ; X ) with the same set of terminals X . This operation corresponds to
a node with two children in the decomposition tree, where the two subgraphs
corresponding to the children are joined by identifying their terminals pairwise.
Let (T; X ) be a tree-decomposition of a graph G. Then, we get a sequence of
terminal graphs (Gt ; Xt) constructed according to the four composition operations,
starting with small graphs with at most k + 1 vertices and proceeding in post-order.
Observe, that each set of terminal nodes Xt is a separator that separates the graph Gt
from the rest of G. Most algorithms on partial k-trees base on this crucial property.
Moreover, we use the fact that every clique C of graph G must occur as subset C Xt
in at least one node t of the decomposition tree.
11
1
G:
JJ
J 3
4
2
5
@@ ?? @@ ??
@@ ??
@?@ ??@@ ??@@
?
? @
? @
? @
8
6
7
9
JJ J
10
1
H:
JJ
J
3
4
@@ ??
@?@
?
? @
8
7
JJ J
10
Figure 3: A graph G with a maximal disjoint union of two cliques that is not maximal
in its subgraph H .
While solving the optimization version of DUC, we are looking for a disjoint union
of cliques C1; : : :; CD in a graph G given with a tree-decomposition. We construct
larger and larger partial solutions in the sequence of subgraphs determined by the
tree-decomposition in a dynamic programming manner. Thus, we have to show that a
Principle of Optimality holds. Clearly, every solution for G induces at most D disjoint
cliques in every subgraph H G. But notice, that this union of cliques may not be
maximal in an arbitrary subgraph H . An example for this fact is shown in Figure 3. The
graph G has a disjoint union of two cliques that cover the 8 vertices f2; 3; 4; 5; 6; 7; 8; 9g.
Only 4 of them are contained in the subgraph H G. But a maximal union of two
cliques in H is given by the two triangles that cover the 6 vertices f1; 3; 4; 7; 8; 10g.
Hence, it is not sucient to solve DUC in the subgraphs corresponding to a node in
the decomposition tree. Nevertheless, a dynamic programming approach may be used
for DUC on partial k-trees. For its description we need some more notation. S
t Ct;i
A partial solution of DUC is a disjoint union of dt D cliques Kt = di=1
in the terminal graph (Gt ; Xt) for any node t of the decomposition tree. Denote the
set of terminal nodes that is covered by Kt by Yt (Kt) = Kt \ Xt. Denote the number
of vertices contained in Kt by bt(Kt ) = jKtj. The Principle of Optimality holds in the
following form:
Lemma 7.3 A partial solution Kt in the terminal graph (Gt; Xt) is contained in a
solution for DUC in G, if and only if there is a solution L in G such that for its
restriction Lt = L \ Gt the following holds:
(i) L \ Xt = Yt (Kt),
(ii) dt (Lt) = dt (Kt) and
12
(iii) bt (Lt) = bt (Kt).
This is obvious because of the separator property of Xt : We may simply replace the
parts Kt and Lt in the solutions. This makes it sucient for the algorithm to examine all partial solutions for the sequence of terminal graphs (Gt; Xt) given by a
tree-decomposition of G. We consider two partial solutions as equivalent, if they have
the same head:
Denition 7.4 Two disjoint unions of cliques Kt and Lt in a terminal graph (Gt; Xt)
are called equivalent if they full the conditions dt (Lt) = dt(Kt) and Yt (Lt) = Yt (Kt ).
An equivalence class of partial solutions is represented by a pair (Yt ; dt) that is called
its head. Here we denote dt := dt (Kt) (the number of cliques) and Yt := Yt (Kt ) Xt.
Lemma 7.5 The number of equivalence classes (Yt; dt) for any xed number dt is
bounded by 2jXtj , i. e. it is a constant depending only on the tree-width of G.
Now we are prepared to describe the dynamic programming algorithm that solves
in a partial k-tree G. It proceeds in post order all nodes t of the decomposition
tree and computes for all equivalence classes of partial solutions with at most D cliques
the following functions:
bt(Yt; dt) = maxfbt(Kt) : Kt is a partial solution in (Gt; Xt) with head (Yt ; dt)g
The computation of the functions bt can be done recursively, starting at the leaves.
We calculate the values for every pair (Yt ; dt) that is appropriate as head of a partial
solution, i. e. that satises dt D and Yt Xt . Depending on the local structure of
the decomposition tree the following cases occur:
DUC
Start:
bt(Yt ; dt) =
(
jYtj if there are dt disjoint cliques in Gt that cover exactly Yt;
?1 otherwise.
Forget: Let s be the child of t in the decomposition tree and v 2 Xs n Xt the unique
vertex of G that we forget at this node. This vertex v may be covered by a clique
or not. Hence we get: bt(Yt ; dt) = max f bs(Yt ; dt); bs (Yt [ fv g; dt)g.
Introduce: bt(Yt; dt) = max f bs(Yt n C; dt ? 1) + jC j : C Yt is a clique with v 2 C g
if v 2 Yt (otherwise bt (Yt ; dt) = bs (Yt ; dt)). There s is the child of t in the
decomposition tree and v is the only vertex from Xt n Xs . The new vertex v
can improve a partial solution for the child s. In this case, one clique must be
changed.
Join: Let the two children of t in the decomposition tree be s and s0. Every clique
of a partial solution must be contained in one of the two subgraphs (Gs ; Xs )
and (Gs0 ; Xs0 ) (where Xs = Xs0 = Xt holds). The cliques that are in both are
contained also in Xt . They are considered only once. Hence, we get: bt(Yt ; dt) =
max f bs (Ys ; ds) + bs0 (Ys0 ; ds0 ) : Yt = Ys [ Ys0 ; Ys \ Ys0 = ;; dt = ds + ds0 g.
13
Theorem 7.6 The optimization version of DUC can be solved in time O(D jV j) for
2
partial k-trees.
Proof. First we nd a tree-decomposition of width k for G. This needs time O(jV j)
by the algorithm of Bodlaender [Bod].
Then we calculate all appropriate values of the functions bt as described above. This
computation needs no more time than O(D 2k ) at start and forget nodes, O(D 22k )
at introduce nodes and at most O(D2 22k ) at join nodes. Since the decomposition tree
has at most jV (G)j nodes and k is a constant, we get at all O(D2 jV (G)j) time for
these calculations.
The last step of the algorithm is to compare all partial solutions for the root r of
the decomposition tree. This needs constant time. The answer for the given DUC is
b(G) = max f b(Yr; D) : Yr Xr g.
2
With the same approach as in the case of cographs (see Section 6), we get the
time bound O(jV j2) for this algorithm. Furthermore, it is clear that the construction
problem can be solved easily by backtracking. Here we ask not only for the maximal
number of vertices that may be covered by D cliques but also for the cliques realizing
this value. For this we store one feasible extension to the child (or children) maximizing
function bt in all appropriate cases during the original algorithm. Then, we walk once
more through the decomposition tree, now starting at the root r, to get a disjoint union
of cliques in G that covers b(G) vertices.
8 Application to a Scheduling Problem
The problem DUC is closely related to a scheduling problem dened as follows. Let
J be a set of unit-time jobs and let G = (J; E ) be a compatibility graph on J . If two
jobs are adjacent in G, they are compatible with each other and may be performed at
the same time. The kind of jobs we consider are simple supervision and control jobs as
supervising the operation of machines. Thus, these jobs are highly parallelizable and
one person may perform two or more of these jobs at the same time.
A worker w is described by his wage c(w) 2 IN per day and by a set of jobs J (w) J
he is able to fulll. We assume that there are several types of workers collected in a set
W . Workers of the same type have similar education, similar knowledge and similar
abilities, and hence they are able to perform the same jobs and earn the same wages.
Moreover, we assume that for each type there is an arbitrarily large number of workers
available. A worker w can execute a job set J 0 within D unit time intervals if J 0 J (w)
and if J 0 can be partitioned into D subsets of pairwise compatible jobs. (The intuition
is that during each time interval, the worker has to supervise several jobs in parallel ).
We are looking for a schedule of the jobs to an appropriate subset of the workers.
The main goal is to keep the overall money paid to the workers as small as possible
while completing all jobs. Given a time period D, a feasible schedule S with respect to
D consists of a sequence of workers w1; : : :; wk together with a partition of the jobs in
J into k sets J1; : : :; Jk such that job set Ji can be executed by worker wi within time
14
D. The cost of some feasible schedule is dened to be Pki=1 c(wi), the overall wage of
all employed workers. An optimum schedule is a feasible schedule with minimum cost.
It is straight forward to see that a set J 0 J (w) of jobs can be executed by a
worker w within D time intervals if and only if the subgraph of G induced by J 0 is
the union of at most D cliques. Thus, the problem DUC can be considered being
a special case of our scheduling problem (to nd the maximum number of jobs for
one worker). On the other hand, we propose the following approximation algorithm
for the scheduling problem. It has approximation ratio O(log (jJ j)) and the analysis
of our heuristic is based on Chvatal's greedy heuristic for the weighted set-covering
problem [Ch]. Chvatal studied the following problem:
Sets B1 ; : : :; Bm f1; : : :; ng, weightes c1 ; : : :; cm 2 IN and a
positive integer D.
Question: Is there a subset I f1; : : :; mg with [i2I Bi = f1; : : :; ng and
P
weight i2I ci D ?
Instance:
In each iteration of Chvatal's heuristic a set Bi is chosen which maximizes the
quotient jBciij . Then, the elements of Bi are deleted in the sets B1 : : : :; Bm and the
algorithm is iterated until the set f1; : : :; ng is covered. If C H is the weight of chosen
sets in the heuristic of Chvatal and if C is the weight of an optimal set covering,
Chvatal has shown that C H O(log (n)) C . Our proposed heuristic is the following
algorithm.
1. Compute for each type of worker w 2 W the graph Gw which is the vertex-induced
subgraph of G induced by the set J (w).
2. Compute for each graph Gw the size !D (Gw ).
3. Choose a type of worker w0 that maximizes the quotient !D (Gw )=c(w).
4. Compute the corresponding set H (w0) of jobs in Gw0 which generates !D (Gw0 )
and remove these jobs from each of the graphs Gw . Iterate the algorithm until
all jobs are covered.
The main step in the algorithm is Step 2, computing for the induced compatibility
graph Gw the maximum size of D cliques. Then, we get the following theorem.
Theorem 8.1 Let G be a graph class that is closed under the induced subgraph opera-
tion and on that DUC is solvable in polynomial time. Consider a scheduling problem
with compatibility graph G 2 G . Then, the above approximation algorithm constructs a
schedule whose cost is at most a factor O(log jJ j) away from the optimum cost.
2
Proof. Apply the weighted set covering algorithm given by Chvatal [Ch] to all sets
A J which can be executed together by one worker w 2 W . Then, A is a disjoint
union of D compatible sets of jobs. Of course, there are exponentially many such sets
15
A. The algorithm of Chvatal takes in each step one of these sets which maximizes
the quotient cj(AAj) where the weight of A is given by the wage of the corresponding
worker c(A) = c(wA). Denote the chosen set by M . After that the elements of M are
deleted and the algorithm P
is iterated. It is known that the algorithm of Chvatal has an
approximation ratio of O( bi=1 1i ) = O(log (b)), where b is equal to the cardinality of a
maximum sized set A in the instance of the set covering problem. Clearly, we can bound
the number b by jJ j. Our algorithm described above computes for each worker w 2 W
a disjoint union of D compatible sets of jobs of maximum size !D (Gw ). Then, at step
three the algorithm takes one of the workers w0 and the corresponding job set H (w0)
which maximizes the quotient !Dc((wG)w ) . Hence, this set H (w0) is the same as chosen by
the algorithm of Chvatal. In other words, the set M is equal to the set H (w0) chosen
P
in our algorithm. Therefore, we get the approximation ratio O( jJ j 1 ) = O(log (jJ j)).
i=1 i
But in our algorithm we must not generate all (exponentially many) sets of compatible
jobs executable by one worker. Each computation of !D (Gw ) for the graph Gw can
be done in polynomial time. In each iteration we must apply this algorithm at most
jW j times and the number of iterations can be bounded by jJ j. In total, we get a
polynomial time approximation algorithm.
2
References
[BLW] M. W. Bern, E. L. Lawler and A. L. Wong: Linear-time computations of subgraphs of decomposable graphs, Journal of Algorithms 8, 1987, 216{235.
[Bod] H. L. Bodlaender: A linear time algorithm for nding tree-decompositions of
small treewidth, Manuscript, Utrecht University, 1992.
[BL] S. Booth and S. Lueker: Testing for the consectutive ones property, interval
graphs, and graph planarity using PQ-tree algorithms, J. Comput. Syst. Sci.
13, 1976, 335{379.
[Bra] A. Brandtstadt: Special graph classes - a survey. Report SM-DU-199, Universitat-Gesamthochschule Duisburg 1991.
[Ch] V. Chvatal: A greedy heuristic for the set covering problem, Math. Oper. Res.
4, 1979, 233{235.
[CPS] D.G. Corneil, Y. Perl and L.K. Stewart: A linear recognition algorithm for
cographs, SIAM J. Comput. 4, 1985, 926{934.
[Di] P.F. Dietz: Intersection graph algorithms, Ph. D. thesis, Comput. Sci. Dept.,
Cornell Univ., Ithaka, NY (1984).
[Fr] A. Frank: On chain and antichain families of a partially ordered set. J. Combinatorial Theory (B) 29, 1980, 176{184.
16
[GJ] M.R. Garey and D.S. Johnson: Computers and Intractability: A Guide to the
Theory of NP-Completeness, Freeman, San Francisco, 1979.
[Ga] F. Gavril: Algorithms for maximum k-colorings and k-coverings of transitive
graphs, Networks 17, 1987, 465{470.
[GY] F. Gavril and M. Yannakakis: The maximum k-colorable subgraph problem for
chordal graphs, Information Processing Letters 24, 1987, 133{137.
[Go] M.C. Golumbic: Algorithmic graph theory and perfect graphs, Academic Press,
New York, 1980.
[Jo] D.S. Johnson: The NP-completeness column: an ongoing guide, Journal of
Algorithms 6, 1985, 434{451.
p
[MV] S. Micali and V.V. Vazirani: An O( jV jjE j) algorithm for nding maximum
matchings in general graphs, in: Proc. 21st Ann. IEEE Symp. Foundations of
Computer Science, Long Beach, California, 1980, 17{27.
[RS] N. Robertson and P. Seymour: Graph Minors. II. Algorithmic aspects of treewidth. Journal of Algorithms 7, 1986, 309{322.
[Sch] P. Scheer: Die Baumweite von Graphen als ein Ma fur die Kompliziertheit
algorithmischer Probleme. Report RMATH-04/89, K.-Weierstra-Institut fur
Mathematik, Berlin 1989.
17
Reports from the group
\Algorithmic Discrete Mathematics"
of the Department of Mathematics, TU Berlin
441/1995 Andreas S. Schulz, Robert Weismantel, Gunter M. Ziegler: 0/1{Integer
Programming: Optimization and Augmentation are Equivalent
440/1995 Maurice Queyranne, Andreas S. Schulz: Scheduling Unit Jobs with Compatible Release Dates on Parallel Machines with Nonstationary Speeds, to appear
in Springer Lecture Notes in Computer Science, Proceedings of IPCO IV
439/1995 Rolf H. Mohring, Matthias Muller-Hannemann: Cardinality Matching:
Heuristic Search for Augmenting Paths
436/1995 Andreas Parra, Petra Scheer: Treewidth Equals Bandwidth for AT-Free
Claw-Free Graphs
432/1995 Volkmar Welker, Gunter M. Ziegler, Rade T. Zivaljevic: Comparison Lemmas and Applications for Diagrams of Spaces
431/1995 Jurgen Richter-Gebert, Gunter M. Ziegler: Realization Spaces of 4Polytopes are Universal, to appear in Bulletin of the American Mathematical
Society, October 1995.
430/1995 Martin Henk: Note on Shortest and Nearest Lattice Vectors
429/1995 Jorg Rambau, Gunter M. Ziegler: Projections of Polytopes and the Generalized Baues Conjecture
428/1995 David B. Massey, Rodica Simion, Richard P. Stanley, Dirk Vertigan, Dominic J. A. Welsh, Gunter M. Ziegler: L^e Numbers of Arrangements and Matroid
Identities
408/1994 Maurice Queyranne, Andreas S. Schulz: Polyhedral Approaches to Machine
Scheduling
407/1994 Andreas Parra, Petra Scheer: How to Use the Minimal Separators of a
Graph for Its Chordal Triangulation
401/1994 Rudolf Muller, Andreas S. Schulz: The Interval Order Polytope of a Digraph, to appear in Springer Lecture Notes in Computer Science, Proceedings of
IPCO IV
396/1994 Petra Scheer: A Practical Linear Time Algorithm for Disjoint Paths in
Graphs with Bounded Tree-width
394/1994 Jens Gustedt: The General Two-Path Problem in time O(m log n), extended abstract
393/1994 Maurice Queyranne: A Combinatorial Algorithm for Minimizing Symmet-
ric Submodular Functions
392/1994 Andreas Parra: Triangulating Multitolerance Graphs
390/1994 Karsten Weihe: Maximum (s; t){Flows in Planar Networks in O(jV j log jV j)
Time
386/1994 Annelie von Arnim, Andreas S. Schulz: Facets of the Generalized Permutahedron of a Poset, to appear in Discrete Applied Mathematics
383/1994 Karsten Weihe: Kurzeinfuhrung in C++
377/1994 Rolf H. Mohring, Matthias Muller-Hannemann, Karsten Weihe: Using Network Flows for Surface Modeling
376/1994 Valeska Naumann: Measuring the Distance to Series-Parallelity by Path
Expressions
375/1994 Christophe Fiorio, Jens Gustedt: Two Linear Time Union-Find Strategies
for Image Processing
374/1994 Karsten Weihe: Edge{Disjoint (s; t){Paths in Undirected Planar graphs in
Linear Time
373/1994 Andreas S. Schulz: A Note on the Permutahedron of Series{Parallel Posets,
appeared in Discrete Applied Mathematics 57 (1995), pp. 85-90
371/1994 Heike Ripphausen{Lipa, Dorothea Wagner, Karsten Weihe: Ecient Algorithms for Disjoint Paths in Planar Graphs
368/1993 Stefan Felsner, Rudolf Muller, Lorenz Wernisch: Optimal Algorithms for
Trapezoid Graphs
367/1993 Dorothea Wagner: Simple Algorithms for Steiner Trees and Paths Packing
Problems in Planar Graphs, erscheint in \Special Issue on Disjoint Paths" (eds.
B. Gerards, A. Schrijver) in CWI Quarterly
365/1993 Rolf H. Mohring: Triangulating Graphs without Asteroidal Triples
359/1993 Karsten Weihe: Multicommodity Flows in Even, Planar Networks
358/1993 Karsten Weihe: Non-Crossing Path Packings in Planar Graphs with Applications
357/1993 Heike Ripphausen-Lipa, Dorothea Wagner, Karsten Weihe: Linear-Time
Algorithms for Disjoint Two-Face Paths Problems in Planar Graphs
354/1993 Dorothea Wagner, Karsten Weihe: CRoP: A Library of Algorithms for the
Channel Routing Problem
351/1993 Jens Gustedt: Finiteness Theorems for Graphs and Posets Obtained by
Compositions
350/1993 Jens Gustedt, Angelika Steger: Testing Hereditary Properties Eciently
349/1993 Stefan Felsner: 3-Interval Irreducible Partially Ordered Sets
348/1993 Stefan Felsner, Lorenz Wernisch: Maximum k-Chains in Planar Point Sets:
Combinatorial Structure and Algorithms
345/1993 Paul Molitor, Uwe Sparmann, Dorothea Wagner: Two-Layer Wiring with
Pin Preassignments
Reports may be requested from:
S. Marcus
Fachbereich Mathematik, MA 6{1
TU Berlin
Strae des 17. Juni 136
D-10623 Berlin { Germany
e-mail: [email protected]
Reports are available via anonymous ftp from:
ftp.math.tu-berlin.de
cd pub/Preprints/combi
le Report{<number>{<year>.ps.Z
© Copyright 2026 Paperzz