Enum-S Ps

You might also like

Download as ps, pdf, or txt
Download as ps, pdf, or txt
You are on page 1of 24

[Pap94]

[Rav98]
[Rot98a]
[Rot98b]
[Sha98]
[SST95]
[Val79]
[Wan94]

C. Papadimitriou. Computational Complexity. Addison Wesley, 1994.


E. Ravve. Decomposition of Databases with Translation Schemes. PhD thesis, Department of Computer Science, Technion{Israel Institute of Technology, Haifa, 1998.
U. Rotics. Ecient Algorithms for Generally Intractable Graph Problems
Restricted to Speci c Classes of Graphs. PhD thesis, Technion- Israel Institute of Technology, 1998.
U. Rotics. Polynomial time (o(jvj7)) algorithm for the 3-clique-width problem. Preprint, 1998.
A. Sharell. Complexite Descriptive et l'approximation des fonctions de
denombrement. PhD thesis, L.R.I.{UPS, Paris, France, 1998.
S. Saluja, K. Subrahmanyam, and M. Thakur. Descriptive complexity of
]p functions. Journal of Computer and System Sciences, 50:493{505, 1995.
L.G. Valiant. The complexity of computing the permanent. Theoretical
Computer Science, 8:189{201, 1979.
E. Wanke. k-NLC graphs and polynomial algorithms. Discrete Appl.
Math., 54:251{266, 1994.

24

[GHR95]
[GJ79]
[GM96]
[Gn98]
[GRT97]
[Gur79]
[GV97]
[Hod93]
[Jer87]
[JO89]
[JO92a]
[JO92b]
[JO95a]
[JO95b]
[Joh90]
[KM96]
[KM97]
[KM99]
[Kog96]
[Mak92]
[MP96]
[MR98]

R. Greenlaw, H.J. Hoover, and W.L. Ruzzo. Limits to Parallel Computation. Oxford University Press, 1995.
M.G. Garey and D.S. Johnson. Computers and Intractability. Mathematical Series. W.H. Freeman and Company, 1979.
E. Gradel and K. Meer. Descriptive complexity theory over the real numbers. Lectures in Applied Mathematics, 32:381{403, 1996. A preliminary
version has been presented at the 27th ACM-Symposium on Theory of
Computing, Las Vegas, 1995.
M. Grohe and J. Mari no. De nability and descriptive complexity on
databases of bounded tree-width. Preprint, 1998.
V. Giakoumakis, , F. Roussel, and H. Thuillier. On P4-tidy graphs. Discrete Mathematics and Theoretical Computer Science, 1:17{41, 1997.
Y. Gurevich. Modest theory of short chains, I. Journal of Symbolic Logic,
44:481{490, 1979.
V. Giakoumakis and J. Vanherpe. On extended P4 -reducible and extended
P4-sparse graphs. Theoret. Comput. Sci., 180:269{286, 1997.
W. Hodges. Model Theory, volume 42 of Encyclopedia of Mathematics and
its Applications. Cambridge University Press, 1993.
M. Jerrum. Two{dimensional monomer{dimer systems are computationally intractable. Journal Stat. Phys., 48:121{134, 1987. Erratum in vol.
59 (1990), pages 1087-1088.
B. Jamison and S. Olariu. P4 -reducible graphs a class of tree representable
graphs. Studies Appl. Math., 81:79{87, 1989.
B. Jamison and S. Olariu. A linear-time recognition algorithm for P4 sparse graphs. SIAM J. Comput., 21:381{406, 1992.
B. Jamison and S. Olariu. A unique tree representation for P4 -sparse
graphs. Discrete Appl. Math., 35:115{129, 1992.
B. Jamison and S. Olariu. A linear-time algorithm to recognize P4 reducible graphs. Theoret. Comput. Sci., 145:329{344, 1995.
B. Jamison and S. Olariu. Linear-time optimization algorithms for P4 sparse graphs. Discrete Appl. Math., 61:155{175, 1995.
D.S. Johnson. A catalog of complexity classes. In J. van Leeuwen, editor,
Handbook of Theoretical Computer Science, volume 1, chapter 2. Elsevier
Science Publishers, 1990.
G.P. Kogan and J.A. Makowsky. Computing the permanent over elds
of characteristic 3: Where and why it becomes dicult. Technion{Israel
Institute of Technology, February 1996, submitted, 1996.
G.P. Kogan and J.A. Makowsky. The complexity of Schur functions in
nite elds of characteristic 2. May 1997, submitted, 1997.
G.P. Kogan and J.A. Makowsky. Computing Schur functions for Borchardt
matrices. in preparation, 1999.
G.P. Kogan. Computing the permanent over elds of characteristic 3:
Where and why it becomes dicult. In FOCS'96, pages 108{114. IEEE,
1996.
J.A. Makowsky. Model theory and computer science: An appetizer. In
S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in
Computer Science, volume 1, chapter I.6. Oxford University Press, 1992.
J.A. Makowsky and Y. Pnueli. Arity vs. alternation in second order logic.
Annals of Pure and Applied Logic, 78(2):189{202, 1996.
J. Makowsky and U. Rotics. On the cliquewidth of graphs with few P4 's.
accepted for publication in IJFCS, to appear 1999.

23

[BO98b]
[Bod93]
[Bod96]
[Bod97]
[Bod98]
[Bur98]
[CE95]
[CER93]
[CG96]
[CLS81]
[CM93]
[CMR98]
[CO98]
[Cou94]
[Cou99]
[DGP97]
[Die96]
[Dow98]
[EF95]
[FV59]
[FV98]
[GG98]

L. Babel and S. Olariu. On the p{connectednessof graphs { a survey.


Preprint, 1998.
H. Bodlaender. A tourist guide through tree width. Acta Cybernetica,
11:1{23, 1993.
H. L. Bodlaender. A linear time algorithm for nding tree{decompositions
of small treewidth. SIAM J. Comput., 25:1305{1317, 1996.
H. Bodlaender. Treewidth: Algorithmic techniques and results. In I. Privara and P. Ruzicka, editors, Proceedings of the 22nd International Symposium on Mathematical Foundation of Computer Science, MFCS'97, volume
1295 of Lecture Notes in Computer Science, pages 29{36. Springer, 1997.
H. Bodlaender. A partial k-arboretum of graphs with bounded tree width
(tutorial). Theoretical Computer Science, 208:1{45, 1998.
P. Burgisser. Completeness and Reduction in Algebraic Complexity Theory.
PhD thesis, Universitat Zurich, 1998.
B. Courcelle and J. Engelfriet. A logical characterization of the sets of
hypergraphs de ned by hyperedge replacement grammars. Mathematical
Systems Theory, 28:515{552, 1995.
B. Courcelle, J. Engelfriet, and G. Rozenberg. Handle-rewriting hypergraph grammars. J. Comput. System Sci., 46:218{270, 1993.
K. Compton and E. Gradel. Logical de nability of counting functions.
Journal of Computer and System Sciences, 53:283{297, 1996.
D.G. Corneil, H. Lerchs, and L. Stewart. Complement reducible graphs.
Disc. Appl. Math., 3:163{174, 1981.
B. Courcelle and M. Mosbah. Monadic second{order evaluations on tree{
decomposable graphs. Theoretical Computer Science, 109:49{82, 1993.
B. Courcelle, J.A. Makowsky, and U. Rotics. Linear time solvable optimization problems on certain structured graph families, extended abstract.
To appear in the proceedings of WG98, 1998.
B. Courcelle and S. Olariu. Upper bounds to the clique-width of graphs.
submitted for publication
(http://dept-info.labri.u-bordeaux.fr/courcell/ActSci.html), 1998.
B. Courcelle. Monadic second order graph transductions: A survey. Theoretical Computer Science, 126:53{75, 1994.
B. Courcelle. The monadic second order logic of graphs, XIV: uniformly sparse graphs and edge set quanti cation. http://dept-info.labri.ubordeaux.fr/ courcell/ActSci.html, 1999.
D. Du, J. Gu, and P.M. Pardalos, editors. Satis ability Problem: Theory
and Applications, volume 35 of DIMACS. American Mathematical Society,
1997.
R. Diestel. Graph Theory. Graduate Texts in Mathematics. Springer, 1996.
R.G. Downey. Parametrized Complexity. Springer, 1998.
H.D. Ebbinghaus and J. Flum. Finite Model Theory. Perspectives in
Mathematical Logic. Springer, 1995.
S. Feferman and R. Vaught. The rst order properties of algebraic systems.
Fundamenta Mathematicae, 47:57{103, 1959.
T. Feder and M. Vardi. The computational structure of monotone
monadicsnp and constraint satisfaction: A study through datalog and
group theory. To appear, xx:xxx{yyy, 1998.
E. Gradel and Y. Gurevich. Meta nite model theory. Information and
Computation, 140:26{81, 1998. See also: D. Leivant (Ed.), Logic and Computational Complexity, Selected Papers, Springer 1995, 313-366.

22

We are quite sure that a suitable version of the Feferman-Vaught Theorem


can be proved for First Order Logic using the method of [GG98, Chapter 5], and
extending this to Monadic Second Order Logic should be possible as well.
The notion of cliquewidth and treewidth of a meta nite structures can now
be de ned as depending only on the underlying nite structure. We conjecture
that theorems 5 and 4 have their suitable analogues.

Acknowledgements
The second author is indebted to Gregory Kogan for introducing him to the world
of permanents as documented in [Kog96,KM96,KM97,KM99]. He would also like
to thank Peter Burgisser, who made an early version of [Bur98] available, to M.
Grohe, who pointed out the bound on the treewidth of the incidence graph, and
to R. Bar-Yehuda, who reminded us of SAT.

References
[ACP87]

S. Arnborg, D.G. Corneil, and A. Proskurowski. Complexity of nding


embedding in a k{tree. In SIAM J. Algebric Discrete Methods, pages 227{
234, 1987.
[ALS91] S. Arnborg, J. Lagergren, and D. Seese. Easy problems for tree decomposable graphs. Journal of Algorithms, 12:308{340, 1991.
[Bab98a] L. Babel. On graphs with simple P4{structure. Preprint, 1998.
[Bab98b] L. Babel. Recognition and isomorphism of tree{like P4 {connected graphs.
Preprint, 1998.
[Bar96]
A.I. Barvinok. Two algorithmic results for the traveling salesman problem.
Mathematics of Operations Research, 21:65{84, 1996.
[BCS97] P. Burgisser, M. Clausen, and M.A. Shokrollahi. Algebraic Complexity
Theory, volume 315 of Grundlehren. Springer Verlag, 1997.
[BCSS98] L. Blum, F. Cucker, M. Shub, and S. Smale. Complexity and Real Computation. Springer Verlag, 1998.
[BGHK95a] H. Bodlaender, J. Gilbert, H. Hafsteinsson, and T. Kloks. Approximating
treewidth, pathwidth, and minimum elimination tree height. Journal of
Algorithms, 18:238{255, 1995.
[BGHK95b] H. Bodlaender, J. Gilbert, H. Hafsteinsson, and T. Kloks. Approximating
treewidth, pathwidth, and minimum elimination tree height. Journal of
Algorithms, 18:238{255, 1995.
[BK96]
H. Bodlaender and T. Kloks. Ecient and constructive algorithms for the
pathwidth and treewidth of graphs. Journal of Algorithms, 21:358{402,
1996.
[BO95]
L. Babel and S. Olariu. On the isomorphism of graphs with few P4 s. In
M. Nagl, editor, Graph Theoretic Concepts in Computer Science, 21th International Workshop, WG'95, volume 1017 of Lecture Notes in Computer
Science, pages 24{36. Springer Verlag, 1995.
[BO98a] L. Babel and S. Olariu. Domination and steiner tree problems on graphs
with few P4s. To appear in the proceedings of WG98, LNCS vol. xxxx,
1998.

21

Open problem 14
(i) Can cliquewidth k of a graph G be recognized in polynomial time?
(ii) Can cliquewidth k of a graph G be approximated in polynomial time with
ration log k?
(iii) If G has cliquewidth at most k, can the corresponding k-expression of G be
constructed in polynomial time?

For k = 3 Rotics, [Rot98b], has given a positive answer both to the recognition
and construction problem
We have presented here our results for graphs (and problems expressible as
graph problems). Treewidth has been generalized to arbitrary relational structures by Feder and Vardi in [FV98]. Grohe and Mari~no [Gn98] have shown the
following remarkable connection betwee MS() and the -formulas of the Fixed
Point Logic LFP .

Theorem 15 ((Grohe and Mari~no 1998)). On classes of  -structures of


bounded treewidth every MS() sentence (formula) is equivalent a LFP () formula.

Open problem 16 Is theorem 15 also true if treewidth is replaced by


cliquewidth ?

Similarly, cliquewidth can also be extended to arbitrary relational structures.


Our model theoretic proof easily adapts to this situation and theorem 5 remains
valid.
Another interesting line of research is the extension of our results to Meta nite Model Theory, as de ned in [GG98]. This combines nite structures (like
here the graphs) with in nite structures (like here the ring or eld where the
weight function takes its values) to form meta nite structures. Meta nite Model
Theory gives the framework to extend descriptive complexity theory, cf. [EF95],
to the computational model of Blum, Shub and Smale, cf. [BCSS98,GM96].
Our evaluation problems are easily seen to t into this framework. A notion of
Monadic Second Order Logic for meta nite structures is readily de ned and so
the class of MS() de nable classes of meta nite structures is well de ned. It
seems more general than, but closely related to, the various forms of Extended
Monadic Second Logic EMS as discussed in [ALS91,CM93].

Open problem 17 Does the Feferman-Vaught Theorem hold for Monadic Sec-

ond Order Logic over meta nite structures ?


Note that there several ways of giving a positive answer by restricting
Monadic Second Order Logic for Meta nite Model Theory to quanti cation over
unary predicates over the nite domain and constant functions from the nite
domain to the in nite domain. The real question is whether this is the best we
can do?

20

 and  (  and  ) in F
FM;k  MS1 . The there are formulas i;j
M;k such
i;j
i;j
i;j

that

G;zj= (Y1 ;::: ;Yt)

and

G;zj= (Y1 ;::: ;Yt)

k(Y1 ; : : : ; Yt )kG; =

k(Y1 ; : : : ; Yt )kG;z; =

G1 ;zj=

G1 ;zj=


i;j (Y1 ;::: ;Yt)

X

i;j (Y1 ;::: ;Yt)

k(Y1; : : : ; Yt)kG1 ;i;j


k(Y1; : : : ; Yt)kG1 ;zi;j

Remark 2. This lemma cane be generalized to other operations than i;j (G1 ) or

i!j (G1 ). In fact, any operation de ned as a scalar quanti erfree transduction
would do.

5.5 Proof of main theorem


The main theorem 5 is now proved by the following steps:
(i) Let and  be formulas in FM;k  MS1 . We rst compute all the nitely
many Hintikka formulas and all instances of lemma 1 and corollary 1 of
 This step depends only on and  and not on the graph G.
HM;k (x; y; X).
(ii) For all formulas of FM;k  MS1 we compute their equivalent presentations
as nite disjunctions of Hintikka formulas, using proposition 4. This step
depends only on and  and not on the graph G.
(iii) Given a graph G de ned by a k-expression t. Let tree(t) the parse tree of t.
This step depends on G and t. If we have to compute t from G we need the
assumtion that t can be computed in polynomial time from G alone.
(iv) We apply recursively, along tree(t), theorem 13 and lemma 3 to evaluate

(Y1 ;::: ;Yt) (


a;Y1;::: ;Yt)

w(a)

This last step is polynomial (linear) in the number v of vertices of G. There


are at most v many disjoint unions to perform, and the number of transductions between the disjoint unions is bounded by the number of formulas in
FM;k . This last step can also be used to construct an algebraic circuit, which
shows that the problem is VPK .

6 Conclusions and further research


Tree width, it turns out, is a feasible parameter to study the xed parameter
complexity of generating functions of MS2 de nable graph properties.
Clique width k of a graph G might be an equally feasible parameter to study
the xed parameter complexity of generating functions of MS1 de nable graph
properties. But this requires that the following problems have positive answers:
19

Lemma 2. In a  - structure G = G1  G2 we have


Y
Y
k(Y1 ; : : : ; Yt)kG; = k(Y1; : : : ; Yt)kG1 ;h1;  k(Y1 ; : : : ; Yt )kG2 ;h2;

and

j (Y1 ; : : : ; Yt) jG; =

X j (Y ; : : : ; Y ) j

t G1;h1;

We shall use the abbreviation


and

X j (Y ; : : : ; Y ) j

k(Y1 ; : : : ; Yt)kGi ;i =

Y k(Y ; : : : ; Y )k

j (Y1 ; : : : ; Yt) jGi;i =

X j (Y ; : : : ; Y ) j

t G2 ;h2;

t G1 ;h1;

t G1 ;h1;

Theorem 13. Let h1; and h2; be the Hintikka formulas associated with
in theorem 12. Using the notation of the previous lemma we have

G;zj= (Y1 ;::: ;Yt)

G1 ; z1 j= h1; (Y1; : : : ; Yt)


G2 ; z2 j= h2; (Y1; : : : ; Yt)

and

k(Y1 ; : : : ; Yt )kG; =

k(Y1; : : : ; Yt)kG1 ;1  k(Y1 ; : : : ; Yt)kG2 ;2

G;zj= (Y1 ;::: ;Yt)

G1 ; z1 j= h1; (Y1 ; : : : ; Yt)


G2 ; z2 j= h2; (Y1 ; : : : ; Yt)

as

j (Y1 ; : : : ; Yt ) jG; =

j (Y1 ; : : : ; Yt) jG1 ;1 + j (Y1 ; : : : ; Yt) jG2 ;2

5.4 Transductions and evaluation terms


We now want to evalutae evaluation terms of graphs G = i;j (G1) and G =
i!j (G1 ).
The operations i;j and i!j are special cases of quanti erfree FOL transductions. The following lemma is implictely already in [ALS91,CM93] and explicitely
in [CMR98].

Lemma 3. Let G; G1 be graphs over the same universe V , G = i;j(G1) and let
z be an assignement into elements and subsets of V . Let and  be formulas in
18

 and G2; z2 j= h2 (y ; X)



G1; z1 j= h1(x; X)
Proof. The proof follows from the connection between Hintikka formulas and
Ehrenfeucht-Frasse games, as given in, say, [Hod93,EF95].
Using proposition 3 and lemma 1 we get

Corollary 1.

(i) For every G = hV; E i and a 2 V m1 and (U) 2 P(V )m2 there is a unique
 2 HM;k (x; X)
 such that G; a; U j= hG (x; X)
.
Hintikka formula hG (x; X)
(ii) Similarly, with the notation of lemma 1, for each three graphs G = G1  G2
and and a 2 V1m1 and and b 2 V2m1 and (U) 2 P(V )m2 there are unique Hin 2 HM;k(x; y; X)
 such
 hG (x; y; X)
 hG (x; y; X);
tikka formulas hG(x; y; X);
 , G1; a1; U j= hG1 (x;2X1) and G2; a; U j= hG2 (y ; X2 ).
that G; a; U j= hG (x; yX)
 is nite, there are only nitely many triples G = G1  G2
(iii) As HM;k (x; y; X)
which di er with respect to their uniquely determined Hintikka formulas. The
same is true if we allow paramaters a; b and U .
 2
Theorem 12 ((Feferman and Vaught)). For every formula (x; y; X)


FM;k(x; y; X) there are nitely many Hinitikka formulas h1; (x; X) 2
 and h2; (y ; X)
 2 HM;k (y ; X)
 (  2 N) such that for every
HM;k(x; X)
 -structure G = G1  G2 and every assignment z as above we have
i for at least one 


G; z j= (x; y; X)

 and G2; z2 j= h2; (y ; X)



G1; z1 j= h1; (x; X)
The proof follows from proposition 4 and the lemma.

5.3 Evaluation terms over disjoint unions

Now we want to apply theorem 12 to evaluate evaluation terms of the forms


X
Y w(a) or X X w(a)
(Y1;::: ;Yt) (
a;Y1 ;::: ;Yt)

(Y1 ;::: ;Yt) (


a;Y1 ;::: ;Yt)

in a structure G = G1  G2.
We rst look at the terms
k(Y1 ; : : : ; Yt)kG; =
and

j (Y1 ; : : : ; Yt) jG; =

G;zj=(a;Y1;::: ;Yt )

G;zj=(a;Y1 ;::: ;Yt)

w(a)
w(a)

Let h1; , h2; ,  be the two Hintikka formulas associated with  by lemma
1.
17

proofs can be adapted to disjoint unions, but the rst to do so explicitely was
Y. Gurevich in [Gur79].
We present here an explicit version of this theorem for disjoint unions, which
allows us to solve also evaluation problems. In [CMR98] a similar proof was used.
In [Rav98] a systematic treatement of the Feferman-Vaught theorem and its use
in Database Theory is presented.
Proviso: For the remainder of this section we x a nite relational vocabulary  and look at MS() formulas with all the (free and bound) variables among
x1; : : :xm1 ; y1 ; : : :ym2 ; X1 ; : : :Xm3 . Put M = m1 +m2 +m3 . The quanti er rank
 the set of MS()
k of MS() formulas is de ned as usual. We denote by FM;k
formulas of quanti er rank at most k with M variables as indicated above. If
 is clear from the context we just write FM;k . For x; y; X vectors of variables
 with
 the subset of FM;k
among those M variables we denote by FM;k (x; y; X)

free variables x; y; X.
The following is folklore, [EF95].
 are nite.
Proposition 3. Up to logical equivalence FM;k and FM;k(x; y; X)

5.1 Hintikka formulas

 as forming a boolean
We can look at the equivalence classes of FM;k (x; y; X)

algebra BM;k (x; y; X), with ^; _; :; T; F interpreted in the natural way.
 is a formula equivalent to an atom in
A Hintikka formula h(x; y; X)

 the set of Hintikka formulas in
BM;k (x; y; X). We denote by HM;k (x; y; X)

FM;k(x; y; X).
The following is straight forward (using proposition 3):
 is nite.
Proposition 4. (i) HM;k(x; y; X)
(ii) The conjunction of any two non-equivalent Hintikka formulas h1; h2 2
 is inconsistent.
HM;k (x; y; X)
 is equivalent to a nite disjunction of Hin(iii) Every formula  2 FM;k (x; y; X)
.
tikka formulas of HM;k (x; y; X)

5.2 Disjoint unions


A fundamental property of Hintikka formulas concern disjoint unions of structures.
G = G1  G2 be  structures with universe V; V1 ; V2 respectively. Furthermore, let z be an assignment of the variables into G with values of xi in G1
and of yi in G2 . We denote by zi the assignement with zi (Xj ) = z(Xj ) \ Vi and
zi (xj ) = z(xj ) and zi (yj ) = z(yj ).
 2
Lemma 1. Assume G = G1  G2 . Then for every Hintikka formula h(x; y; X)
 there are unique Hinitikka formulas h1(x; X)
 2 HM;k (x; X)
 and
HM;k(x; y; X)
 2 HM;k (y ; X)
 such that every assignment z as above we have
h2(y ; X)

G; z j= h(x; y; X)
16

Theorem 10. ]SAT and SAT can be solved in (cw())  O(N) time, where
on depends on the clique width of  but not on N .

We do not know the size of f but it is at least exponential. For xed clique width
this is ultimately better than the trivial bound given by 2k  O(N).

Question 11 What are the families of sets of clauses of xed clique (tree) width

and how can they be characterized in terms relevant to research in satis ability?
Note that Horn clauses can have arbitrary large clique width. Note also that for
clauses of bounded size the notions of clique width and tree width coincide because
they are uniformly sparse, cf. the discussion in section 2.6.

The following variations of SAT from [GJ79, Appendix 9] (and also their
corresponding enumeration problems) are also MS1 de nable.
3SAT: Given S where each clause has at most three occurrencies, is there an
assignement which makes S true ? Here n  3k.
MONOTONE SAT: Given S where each clause has only positive or only
negative occurrencies, is there an assignement which makes S true ?
NOT-ALL-EQUAL SAT: Is there an assignement A which makes S true
and such that for every non-isolated clause C 2 Clause there is either a
v 2 V ar A which has a positive occurrence in C, or there is a u 2 A which
has a negative occurrence in C.
ONE-IN-EACH SAT: Is there an assignement A such that for every nonisolated clause C 2 Clause there is either exactly one v 2 A which has a
positive occurrence in C and none in A which has a negative occurrence in
C, or there is exactly one u 2 V ar A which has a negative occurrence in
C and none in A which has a positive occurrence.
HALF SAT: Is there an assignement A which makes at least half of the nonisolated clauses in S true ?
So Theorem 10 can also be formulated for these problems.

5 Feferman-Vaught Theorem
The proof of the main theorem makes use of the Feferman-Vaught Theorem for
Monadic Second Order Logic and disjoint unions of relational structures. The
theorem states that the set of MS() sentences of quanti er rank k true in
the disjoint union G1  G2 is uniquely determined by the corresponding sets of
formulas true in each of the components. As stated here this can be easily proved
using Ehrenfeucht{Frasse games, cf. [EF95]. We need a stronger version which
says exactly how the truth of one sentence in G1  G2 is determined by the truth
of certain formulas in each Gi. Such a statement can be obtained either directly
by explicit construction or via the use of Hintikka sentences (which describe
winning positions in the Ehrenfeucht{Frasse games). The rst approach is due
to Feferman and Vaught, [FV59] for generalized products. The second approach,
also for products, can be found in in W. Hodges delightful book [Hod93]. Both
15

4.3 F Factor Polynomials

Let F be a connected graph. Let the graph property FA(F) describe the graphs
all of whose connected components are isomorphic to F. A spanning subgraph
of a graph G which has the property FA(F) is called an F -factor of G. The
corresponding generating functions
Factn(F) = GF(Kn; FA(F))
are called the F-factor polynomials. This subsumes CF = Factn(F) for F an
m-cycle and (m) = r and n = mr. The property FA(F) is MS2 de nable but,
not MS1 de nable.
Deciding th existence of an F-factor is NP-complete, if F has at least three
nodes, cf. [GJ79, Problem GT12]. Burgisser showed in [Bur98]
Theorem 8 ((Burgisser 1998)). The family Factn(F) is VNPK -complete if
F has at least two nodes.
From theorem 4 we get immediately
Theorem 9. Let E be a class of graphs which is MS2 -de nable and let Gn is
a family of graphs of tree width k and size n. Then GF(Gn; E ) can be computed
in time ck  O(np ). In fact GF(Gn; E ) is in VPK .
Remark 1. Burgisser only considers cases where w : E ! K is a weight function
for edges. For MS1 de nable generating functions it is sometimes more natural
to look at weight functions on vertices. In the case of cliques both approaches
make sense, but in the case of colorings, the vertices should be weighted.

4.4 Satis ablity of propositional formulas

Our next application is SAT and ]SAT, the corresponding counting problem.
We shall phrase it as a graph theoretic problem. But the clique width of sets of
clauses seems an interesting concept in itself.
]SAT:
Input: A set of clauses  = fC1; : : : ; Cmg over variables p1; : : : ; pk. We denote
by N the size of , i.e. the sum of the sizes of the clauses.
Output: The cardinality of the set of assignments, i.e.
j fz : fp1 ; : : : ; pk g ! f0; 1g : z makes all the C1 ; : : : ; C m true g j
Complexity: The counting problem is ]P-complete, cf. [Val79].
We can code this as an MS1 -enumeration problem by looking at the bipartite
directed graph G = hV; C; E i connecting a variable from V with a clause from
C in one direction for positive, and in the other direction for negative occurence
in the clause. A satisfying assignment then is a subset of vertices V0 such that
every clause c there is v 2 V0 with (v; c) 2 E or there is v0 2 V V0 ) with
(c; v0) 2 E. Note that in this coding the clique width cw(G ) of G somehow
measures the complexity of the overlapping occurences of variables in clauses.
From theorem 5 we get
14

Strictly speaking GF(G; E ) is a function with argument w and value in K.


Furthermore, w is a function
w : f1; : : : ; ng2 ! K
which can be interpreted as an (n  n) matrix over K. If we view w(i; j) = ui; j
as indeterminates, GF(G; E ) is a multivariate polynomial in K[ui;j : i; j  n].
The permanent is the generating function for G = Kn , the clique on n
vertices, and Eper the perfect matchings, and the hamiltonian, similarly, is the
generating function for Eham the class of n-cycles. Similarly,Km;n is the complete
bipartite graph on m and n vertices, Rn is the two-dimensional (n  n) grid and
Cn is the corresponding three-dimensional grid.
In [Bur98] the complexity of many generating functions is discussed. Among
his examples we have also:

Cliques: Let EClique be the class of cliques, which is an MS1 property. By


[Bur98], GF(Kn; EClique) is ]P hard (or VNPK -complete).
Maximal Clique: Let EMaxClique be the class of maximal cliques, which is
an MS1 property. By [Val79], GF(Kn; EMaxClique) is ]P hard (or VNPK complete).

Perfect Matchings: Let EPerfM be the class of perfect matchings, which is


an MS2 property. By [Val79], GF(Cn; EPerfM ) is ]P hard (or VNPK complete).

Partial permanent: Let EPartM be the class of partial matchings, which is an


MS2 property. By [Jer87], both GF(Kn; Epm ) and GF(Rn; Epm ) are ]P hard
(or VNPK -complete).
4.2 Cycle Format Polynomials
Let  = ((1); (2); : : :P; (n)) denote a partition of n in frequency notation,
that is, (i) 2 N and i i(i) = n. We associate with  the graph property
CF  describing all graphs on n nodes consisting of (i) disjoint i-cycles. The
corresponding generating function
CF = GF(Kn; CF  )
is called the cycle format polynomial of . This includes the generating function
of perfect matchings (for (2) = n2 ) and the undirected Hamiltonian cycle polynomial UHCn (for (n) = 1). The property CF  is MS2 de nable but, not MS1
de nable, cf, [Mak92].
The complexity of CF was determined in [Bur98] as follows:

Theorem 7 (Burgisser 1998). Let n be a sequence of partitions of n such


that n n (1)  n for all n and some xed  > 0. Then the sequence CFn of
cycle format polynomials is VNPK complete.
13

3.2 Classes of bounded cliquewidth

In this section we list examples of classes of bounded cliquewidth.


Cliques Kn have cliquewidth 2. Actually, cographs are exactly the graphs of
cliquewidth  2. Trees (and hence the paths Pn) and their complements have
cliquewidth  3. The simple cycles Cn have cliquewidth  4 and for n  7 this
bound is sharp, cf. [MR98].
Cographs can be characterized by the absence of induced P4's. The
study of graph classes having few P4s have been very active in recent
years. Example for such graph classes are the classes of cographs, (extended)
P4{sparse graphs, (extended) P4{reducible graphs and P4{tidy, studied in
[CLS81,JO89,JO92b,JO92a,JO95a,JO95b,GRT97,GV97].
Babel and Olariu introduced in [BO95] the class of (q; t) graphs which for t =
q 3 extends all the graph classes mentioned above. In such a graph no set with at
most q vertices is allowed to induced more than t distinct P4s. Clearly, we assume
that q  4. In a series of papers (cf. [BO95,BO98a,BO98b,Bab98a,Bab98b])
Babel and Olariu studied the classes of (q; q 4) and (q; q 3) graphs.
In [Rot98a,MR98] the cliquewidth of the (q; t) graphs for almost all combinations of q and t was determined.
Theorem 6 ((Makowsky, Rotics 1998)). For every (q; q 3) graph G such
that q  7, G has cliquewidth  q, and a q{expression de ning it can be constructed in time O(jV j + jE j).
The proof is based on the the results of Babel (cf. [Bab98a]) which studied the
prime graphs of the class of (q; q 3) graphs.
Makowsky and Rotics [MR98] have introduced a technique for nding lower
bounds for the clique width. In particular, they showed that (6; 3) graphs and
(q; q) graphs have unbounded clique width for 4  q.

4 Applications: Generating Functions and Satis ability


Here we give some new applications of our main results. The rst concern algebraic complexity theory in the style of [BCS97]. We show how a wide class
of families of multivariate polynomials over a ring or eld K, which in general
are VNPK -complete, are tractable if the zero-coecients have a certain structure. The examples are all taken from [Bur98, Chapter 3]. Theorem 9 below
generalizes Theorem 1 to a large class of multivariate polynomials.

4.1 Generating Functions of Graph Properties


Let G = hV; E; wi be an edge weighted graph with weights in a eld K and E be a
class of (unweighted) graphs
Q closed under isomorphisms. We extend w to subsets
of E by de ning w(E 0 ) = e2E w(e). The generating function corresponding to
G and E is de ned by
X
GF(G; E ) =def fw(E 0) : hV; E 0 i 2 E and E 0  E g
0

12

De nition 5 ((i!j (G))). For a k-graph G as above we denote by i!j (G) the
renaming of i into j in G such that:

i!j (G) = hV; E; V10 ; : : :Vk0 i; where

Vi0 = ;, Vj0 = Vj [ Vi , and Vp0 = Vp for p 6= i; j .

These graph operations have been introduced in [CER93] for characterizing


graph grammars. For every vertex v of a graph G and i 2 f1; : : :kg, we denote by i(v) the k-graph consisting of one vertex v labeled by i.
Example 1. A clique with four vertices u; v; w; x can be expressed as:
2!1 (1;2(2(u)  2!1 (1;2(2(v)  2!1 (1;2(1(w)  2(x)))))))

De nition 6 ((k{expression)). With every graph G one can associate an al-

gebraic expression built using the 3 type of operations mentioned above which
de nes G. We call such an expression a k{expression de ning G, if all the labels in the expression are in f1; : : :; kg. Clearly, for every graph G, there is an
n{expression which de nes G, where n is the number of vertices of G.

De nition 7 ((The clique{width of a graph G, cwd(G))). Let C (k) be the


class of graphs which can be de ned by k{expressions. The clique-width of a graph
G, denoted cwd(G), is de ned by: cwd(G) = Minfk : G 2 C (k)g.
The clique{width is a complexity measure on graphs somewhat similar to tree
width, which yields ecient graph algorithms provides the graph is given with
its k{expression (for xed k). A related notion has been introduced by Wanke
[Wan94] in connection with graph grammars. C (1) is the class of edge-less graphs.
Cographs are exactly the graphs of clique width at most 2, and trees have
clique width at most 3 (cf. [CO98]).
Problem 1. Find characterization of graphs of clique width at most k; k  3.
Does there exist a polynomial time algorithms for recognizing the classes
C (k); k  4 ?
A polynomial time algorithm for recognizing the class C (3) is presented in
[Rot98b].
In the following sections when considering a k{expression t which de nes
a graph G, it will often be useful to consider the tree structure, denoted as
tree(t), corresponding to the k{expression t. For that we shall need the following
de nitions.
De nition 8 ((tree(t))). Let t be any k{expression, and let G be the graph
denoted by t. We denote by tree(t) the parse tree constructed from t in the
usual way. The leaves of this tree are the vertices of G, and the internal nodes
corresponds to the operations of t, and can be either binary corresponding to 
or unary corresponding to  or .
11

Now let C be as in the hypothesis of the proposition. Then it is, by [CE95,


Theorem 3.1], a subset of the image of a set of nite binary trees under an MStransduction. By composing this transduction with the one mapping G 7! I(G),
we get an MS-transduction de ning I(C) from trees, and we conclude the proof
by using [CE95, Theorem 2.1].
Let us summarize the discussion for a class of graphs of interest C:

{ either C  US(k) for some k and then Theorems 4 and 5 are applicable i C

has bounded tree-width, and both these theorems solve the same problems;
Theorem 4 gives actually the best complexity if combined with Bodlaender's
parsing algorithm [Bod96];
{ or C 6 US(k) for any k, then only Theorem 5 is applicable, provided C has
bounded clique-widh and a polynomial parsing algorithm is available.

3 Clique Width and Tree Width


3.1 Graph operations and clique-width
In this section we de ne the notions of graph operations and clique-width, as
presented in [CO98].

De nition 2 ((k{graph)). A k-graph is a labeled graph with (vertex) labels in


f1; 2; : : :; kg. A k-graph G, is represented as a structure hV; E; V1; : : :Vk i, where

V and E are the sets of vertices and edges respectively, and V1 ; : : :; Vk form a
partition of V , such that Vi is the set of vertices labeled i in G. Note that some
Vi 's may be empty. A non-labeled graph G = hV; E i, will be considered as a
1-graph such that all the vertices of G are labeled by 1.

De nition 3 ((G  H )). For k-graphs G; H such that G = hV; E; V1; : : :; Vk i


and H = hV 0 ; E 0; V10; : : :; Vk0 i and V \ V 0 = ; (if this is not the case then replace
H with a disjoint copy of H ), we denote by G  H , the disjoint union of G and
H such that:
G  H = hV [ V 0; E [ E 0; V1 [ V10 ; : : :; Vk [ Vk0 i

Note that G  G 6= G.

De nition 4 ((i;j(G))). For a k-graph G as above we denote by i;j (G), where


i=
6 j , the k-graph obtained by connecting all the vertices labeled i to all the
vertices labeled j in G. Formally:

i;j (G) = hV; E 0 ; V1 ; : : :Vk i ; where


E 0 = E [ f(u; v) : u 2 Vi ; v 2 Vj g
10

O(4k ) and an MS2 property of G can be written as an MS1 property of I(G).


The incidence graph of G = hV; E i is a bipartite graph of edges and vertices of
G with (v; e) 2 I(E) i the edge e starts at v and (e; w) 2 I(E) i the edge e
ends at w. In other words we replace every edge in E by a path of length 2.
Theorem 4 concerns a larger class of enumeration and evaluation problems
than Theorem 5 because these problems can be expressed in MS2 which is
a syntactically larger class than MS1 , used in Theorem 5. For example, the
class of nite Hamiltonian graphs, the class of cliques with an even number
of vertices, the class of graphs having a spanning tree of out degree at most
2 are de nable by MS2 formulas but (provably) not by MS1 ones. Proofs are
easy by Ehrenfeucht{Frasse games or by reduction to the Elgot-Buchi theorem,
saying that MS de nable languages are regular. For details of these techniques
cf. [EF95].
There are formulas in MS2 which are strictly more expressive than those of
MS1 in general, but this is not the case on graphs of special types like planar
graphs or graphs of bounded degree or bounded tree-width, cf. [Cou94]. All these
cases are subsumed by the following notion:
De nition 1. A graph G = hV; Ei is k-sparse if j E j k j V j. It is uniformly
k-sparse if every subgraph of G is k-sparse. We denote by US(k) the class of all
uniformly k-sparse graphs.

Courcelle proved in [Cou99] that for each k, one can construct a scalar MStransduction that associates with every graph G 2 US(k) (considered as a relational structure interpreting the vocabulary 1 ) a structure isomorphic to I(G).
It follows that every property of a graph in US(k) expressible by an MS2 formula over G is already expressible by an MS1 -formula over I(G) which, by
this result, can be translated into an equivalent MS1 formula in G. Furthermore,
if (X) is an MS2 formula expressing a property of a set of edges X of such
a graph G, then  can be translated into an MS1-formula (X1 ; :::; Xn) where
X1 ; :::; Xn denote sets of vertices and j X j=j X1 j +:::+ j Xn j and the integer
n depends only on k. It follows that MS2 de nable enumeration problems are
MS1 de nable on each class US(k).
However Theorems 4a and 5a are equally powerful on classes US(k), because
of the following two facts:
(i) MS2 and MS1 have the same expressive power, as explained above, and
(ii) a sub-class of US(k) has bounded tree width i it has bounded clique width.
This latter fact follows from the following proposition:
Proposition 2. If C is a class of graphs of bounded clique-width on which the
mapping G 7! I(G) is de nable by a scalar MS -transduction, then it is of
bounded tree-width.
Proof. (Sketch) It is proved in [CE95, Theorem 2.1] that if C is a class of graphs

such that I(C) is a subclass of the image of a set of nite binary trees under an
MS-transduction, then it has bounded tree-width.
9

(i) because the algorithm of [Bod96] is not implementable, and


(ii) because the bottom up traversal method uses very large sets of auxiliary
formulas (of cardinality being a tower of exponentials in the number of quanti ers).
Usable but nonlinear parsing algorithms to obtain tree decompositions exist, see
[Bod93,BGHK95b,Bod97,Bod98]. On the other hand, in concrete cases reasonable sets of auxiliary formulas can be constructed ad hoc by hand, rather than
being generated in a blind way from the formulas.
Courcelle and Olariu, [CO98] have de ned another type of hierarchical graph
decomposition, upon which a graph complexity measure called clique width can
be based (very much like tree width is based on tree decomposition). This notion
is recalled in section 3. We say that a class of graphs is O(nm )-e ectively of clique
width at most k if, for every graph in the class of size n, one can construct in
time O(nm ) a decomposition witnessing that its clique width is at most k.
We get a theorem somewhat similar to Theorem 4 that reads as follows:

Theorem 5. Let C be a class of graphs which is O((v + e)m )-e ectively of


bounded cliquewidth k. Then each MS1 de nable enumeration problem (given
by ) can be solved in time ck  O((v + e)m ), where ck is a constant which de-

pends only on  and k.


The same holds for evaluation problems, provided we assume that the arithmetic
operations in K take constant time (independently of the size of the values).
Actually, the evaluation problem is in non-uniform VPK .

2.6 Discussion
In the following discussion we compare theorems 4 and 5.
Theorem 5 concerns more classes of graphs than Theorem 4: if a graph has
tree width k, it has clique width O(4k ), and on the other hand, cliques have
clique width 2 and unbounded tree width. It follows that every class of bounded
tree width has bounded clique width but not vice-versa.
The parsing problem for clique width is in general in NP. It is known to be
polynomial for clique width at most 3, cf. [Rot98b], but not known to be either
polynomial or NP-complete for larger values of k. For this reason Theorem 5
has an additional hypothesis that the given graphs are parsable (with respect to
clique width) in polynomialtime, in order to yield a global polynomial algorithm.
This hypothesis is perhaps super ous, but this remains an open problem. However, there exist several classes of graphs for which speci c polynomial parsing
algorithms do exist, see section 3.
If we leave out the parsing problem, i.e. if we assume that the graphs are
given with their appropriate decompositions, then Theorems 4 and 5 have weaker
forms. Let us call them 4a and 5a respectively, where the corresponding algorithms are linear in the sizes of the trees representing the decompositions. Then
Theorem 4a is a consequence of theorem 5a. This is so because if a graph G has
tree width k, its incidence graph I(G) has tree width k + 1, hence clique width
8

Each of these counting problems can be turned into an evaluation problem


by introducing appropriate weight functions. In particular the permanent is the
evaluation problem arising from ]P erfMatch, and the hamiltonian is the evaluation problem arising from ]P Ham.

2.4 Complexity of de nable enumeration problems

We assume here that the reader is familiar with basic complexity theory as presented, say, in [Joh90,Pap94]. In dealing with evaluation problems over a eld
K it is more precise to use the algebraic complexity classes VPK and VNPK
introduced by Valiant, [Val79]. They are really based on algebraic circuits over
the eld K. A more thorough reference would be [BCS97] and [Bur98]. Computing the permanent over a xed eld K is VNPK -complete but not necessarily
in ]P unless one takes the size of the eld elements into account. Most of our
evaluation problems are ]P hard or VNPK complete over the eld K. But saying that a problem is in VPK is usually a stronger statement than just saying
it is in P if we assume unit cost for the arithmetic operations in K.
MS() de nable enumeration problems over arbitrary vocabularies are solvable in PSpace, but it is not clear whether they are in ]P.
Open problem 3 Assume that PSpace ]P 6= ;. Are there SOL (MSi ) de nable enumeration problems which are in PSpace ]P ?
By a result of Saluja, Subrahmanyam and Thakur [SST95], every enumeration
problem in ]P is SOL de nable, actually by a particularly simple SOL formula
with second order variables for the objects to be counted, and one binary relation variable which ranges over linear orders and is existentially quanti ed.
All other quanti cations are First Order. Note that already the MS() decision
problems can be arbitrarily complex within the polynomial hierarchy, cf. [MP96].
Further investigations into logical de nability of counting function were pursued
by Compton and Gradel, [CG96] and Sharell [Sha98].

2.5 Main results

We rst recall a result from [CM93,ALS91].

Theorem 4. Let C be a class of graphs which is of bounded treewidth k. Then


each MS2 de nable enumeration problem (given by ) can be solved in time
ck  O(v + e), where ck is a constant which depends only on  and k.

The same holds for evaluation problems, provided we assume that the arithmetic
operations in K take constant time (independently of the size of the values).
Actually, the evaluation problem is in non-uniform VPK .

The proof of this theorem is based on a bottom up traversal of the nite tree
representing a tree decomposition of width at most k of the given graph. Hence
one needs to parse the graph, i.e. to construct such a decomposition. This can be
done in time 0(v + e) by [Bod96] The algorithm returns either a failure message
if the graph has tree width more than k or a tree-decomposition of width at most
k. But theorem 4 does not yield an implementable algorithm for two reasons:
7

2.2 MSOL-de nable evaluation problems on graphs


When dealing with graphs we shall impose two kinds of restrictions: on the
vocabulary and on the arity of the quanti ed and free second order variables.
The logic MS(1 ) = MS1 over graphs allows one-sorted structures the universe of which consists of V , the vertices, and one binary relation symbol RE
for the edges, and an arbitrary but nite number of constant symbols and unary
predicate symbols. In this case the set variables range over subsets of V .
The logic MS(2 ) = MS2 over graphs allows two-sorted structures the universe of which consists of V and E, the vertices and edges respectively. We have
additionally one (in the undirected case) or two (in the directed case) binary
relation symbol Rsrc and Rtrg for the incidence relation between edges and vertices. Furthermore we allow an arbitrary but nite number of constant symbols
and unary predicate symbols, where the set variables range over subsets of V or
E. In the undirected case MS2 has the same expressive power as MS1 on the
incidence graph I(G) of a graph G. The incidence graph of G = hV; E i is the
bipartite graph obtained from G by taking V and E as two sorts of vertices and
the incidence relation as the edges. The same holds for the total graph T (G) of
G.
We speak of an MSi (FOL) de nable decision, enumeration or evaluation
problem if the de ning SOL formula is actually given as an MSi formula (as a
First Order formula).

2.3 Some classical examples


We rst look at counting or enumeration problems.
]Triang: The number of triangles in a graph is FOL de nable and computable
in polynomial time.
]k-Cliques: Counting cliques of size k is SOL2 de nable (here k is given as the
size of a unary predicate). For xed k it is computable in polynomial time.
All the problems below are ]P complete, cf, [Val79]. SOLi is Second Order Logic
with second order variables restricted to relations of arity atmost i.
] MaximalClique: Counting maximal cliques is MS1 de nable.
] k-colorings: Counting the number of di erent k-colorings is MS1 de nable.
] PHam: Counting Hamiltonian Paths (Circuits) is MS2 de nable.
] PerfMatch: Counting perfect matchings in a bipartite graphs is MS2 de nable.
] TriangPart: Counting partitions into induced subgraphs isomorphic to triangles is MS2 de nable.
]H -Part: Counting partitions into induced subgraphs isomorphic to H is MS2
de nable.
] MaximumCliques: Counting maximum cliques is SOL2 de nable.
] 3D-Match: The number of three dimensional matchings in three partite
graph is SOL3 de nable.
6

an SOL() de nable enumeration problem consist in determining, for each nite


-structure A with universe A the cardinality
j fX  Am : hA; X i j= (X)g j
where  is a second order -formula with X as its free variable which ranges over
subsets of Am . If  has no free variables this can be interpreted as a decision
problem.
The corresponding evaluation problem assumes that the elements of Am are
weighted with values in some ring or eld, say the reals R, given by a function
w : Am ! R
Sets X  Am are then given either the additive or multiplicative weight
X
Y
jX jw = w(a) or kX kw = w(a):
a2X

a2X

It consists in determining the value of


XfjX j : X  An and hA; X i j= (X)g
w
or
XfkX k : X  An and hA; X i j= (X)g
w
respectively. The multiplicative version gives us back counting in the case where
w(i; j) = 1 for (i; j) 2 E and w(i; j) = 0 for (i; j) 62 E.
Instead of using an m-ary set variable X we can also use nite sequences of
such variables (of xed length). The generalization is obvious and just complicates the notation. Less obvious is the use of parametrized families of de nable
sets of m-tuples instead of set variables. In this case X ranges over the sets of
the form
fa 2 Am : hA; Y1 ; : : : ; Yti j= (a; Y1; : : : ; Yt)g
and Y1; : : : ; Yt are rst or second order parameters ranging over elements and
subsets of A such that
hA; Y1; : : : ; Yti j= (Y1 ; : : : ; Yt)
Clearly, both  and are required to be SOL() formulas. In this case we shall
write the evaluation term as
X
Y w(a) or X X w(a)
(Y1 ;::: ;Yt) (
a;Y1 ;::: ;Yt)

(Y1;::: ;Yt) (


a;Y1 ;::: ;Yt)

SOL de nable enumeration and evaluation problems are solvable in PSpace,


but it is not clear whether they are always already in ]P  PSpace. However, the
SOL decision problems are exactly those which are in the polynomial hierarchy
PH.
It is a usefull exercise to go through the problems of [GJ79] to check which
of them can be recast as SOL de nable decision, enumeration or evaluation
problems. We shall discuss many examples after we have introduced Monadic
Second Order Logic.
5

there is a polynomial time approximation algorithm for treewidth with performance ratio O(logn), [BGHK95a]. Furthermore, checking treewidth for xed k
can be done in linear time, and if the answer is positive, the construction of a
tree decomposition can be done in linear time as well, [Bod96,BK96]. All this
together makes it attractive to use the treewidth as the parameter for xed
parameter complexity considerations.

1.4 Main result


Theorem 1, as stated, is new, but it can be proved using the automata theoretic
methods from [ALS91,CM93]. In [CMR98], those results were extended to optimization problems on graphs of xed cliquewidth, a notion introduced by Courcelle, Engelfriet and Rozenberg [CER93]. We shall give the detailed de nitions
in section 3. The proofs in [CMR98] are model theoretic rather than automata
theoretic. The purpose of this paper is to state and prove an extension of theorem
1 (Theorem 9 of section 4) to a wide class of generating functions of graph properties which are de nable in Monadic Second Order Logic. We also show that
many variations of the classical problem SAT are xed parameter tractable.
Both these applications are to the best of our knowledge new. We shall again
use a model theoretic proof similar to that presented in [CMR98]. We shall also
see that in many cases we can replace the treewidth by the cliquewidth.

1.5 Organization of the paper


In the next section we set up our logical framework of enumeration and evaluation problems which are de nable on Monadic Second Order Logic. In section
3 we collect the de nitions and examples around the notion of cliquewidth. In
section 4 we apply our main results to generating functions of graph properties
and to many variations of the classical problem SAT. In section 5 we give a
detailed proof of the Feferman-Vaught Theorem of Monadic Second Order Logic
for disjoint unions of structures and use it to prove our main result. In section
6, nally, we draw conclusions and discuss further research.

2 Framework and main results


We now present the general framework of our approach and then state the main
results.

2.1 SOL-de nable enumeration and evaluation problems


We assume the reader is familiar with Second Order Logic SOL over xed relational vocabularies , cf. [EF95]. Over nite relational structures with no restrictions on the vocabulary  (besides having no function symbols and being nite),
4

1.2 Linear rank of a matrix


Recall that the linear rank of M over a eld or ring K is the maximal number of row (column) vectors of M which are linearly independent over K. It is
interesting to compare our result with recent results due to Barvinok, [Bar96].
Theorem 2 ((Barvinok 1996)). There are functions gper (r) and gham(r)
such that for (n  n) matrices M over Zof linear rank r
(i) the permanent of M can be computed using gper (r)  O(nb) arithmetic operations for some constant b = O(r) and
(ii) the Hamiltonian of M can be computed using gham (r)  O(nc ) arithmetic
operations for some constant c = O(r2 ).
Kogan in [Kog96] looked at the linear rank of MM T 1 rather than of M and
showed that in elds of characteristc 3 and for matrices M with rk(MM T 1) 
1 the permanent per(M) can be computed in polynomial time. However, he also
shows that for rk(MM T 1)  2 the problem is again ]P hard. So this does not
give us another choice of parameters for xed parameter complexity of computing
the permanent.

1.3 Tree width vs. linear rank


Barvinok's results and ours are incomparable in the following sense:

Proposition 1. Tree width and linear rank are independent of each other. More
precisely

(i) For every n 2 N there are (n  n) matrices with linear rank n and treewidth
constant k.
(ii) For every n 2 N there are (n  n) matrices with linear rank 1 and treewidth
n 1.
Proof. (i): Let M be such that GM is the disjoint union of cliques of size at most
k+1 and containing at least one clique of size k+1. Then tw(GM ) = k. If K has
at least three elements2 , we can nd (j  j) matrices Mj with no zero elements
which have rank j. For each clique of j elements we choose the matrix Mj and
form M by placing these along the diagonal. Now M has linear rank n.
(ii): The (n  n) matrix En which has only one's as its entries has treewidth
n 1 and linear rank 1.

The linear rank of a matrix is a matrix property which depends on all the entries in the matrix and which can be computed in polynomialtime. The treewidth
of a matrix only depends on entries which do not vanish, i.e. only on GM . However, computing the exact treewidth is NP-hard, [ACP87]. On the other hand
2

As we want the matrix to have only non-zero entries, our eld must have at least
three elements

1 Prelude: Permanents and Hamiltonians

In this paper we study the complexity of counting or enumeration1 problems


over graphs which are de nable in fragments of Second Order Logic (SOL). We
also look at evaluation problems, which generalize the enumeration problems in
as much as they allow as to compute the total weight of the solutions rather
than just counting their number. Special cases of the evalutation problem are
the permanent and the hamiltonian of an (n  n) matrix over a eld K. Without
further assumptions on the matrices both these problems are ]P hard, [Val79].
We shall rst discuss our results for these cases.

1.1 Treewidth of a matrix


Let M = fmi;j g be an (n  n) matrix over a eld K. The permanent per(M) of
M is de ned as

X Ym

2Sn i

i;(i)

The hamiltonian ham(M) of M is de ned as


X Ym
i;(i)
2Hn i

where Hn is the set of hamiltonian permutations of f1; : : : ; ng. Recall that a


permutation  2 Sn is hamiltonian if the relation f(i; (i)) : i  ng is connected
and forms a cycle. We de ne a graph GM associated with M, possibly with
loops, as follows:
(i) The vertices of G are the set V = f1; 2; : : :ng.
(ii) The edges of GM are the pairs E = f(i; j) 2 V 2 : mi;j 6= 0g
(iii) Each edge e 2 E with e = (i; j) has a weight w(e) = mi;j .
The treewidth tw(G) of a graph G is the least width of any tree-decomposition
of G. For details, cf. [Die96, chapter 12]. The treewidth of a matrix M is now
de ned as the treewidth of GM , tw(M) =def tw(GM ). Knowing the treewidth of
a matrix leads to new algorithms for computing permanents and hamiltonians:
Theorem 1. Let M be an (n  n) matrix over a eld K .
(i) The permanent of an (n  n) matrix M of treewidth k can be computed in
time ck  n2 with ck independent of the matrix but possibly super-exponential
in k.
(ii) The hamiltonian of an (n  n) matrix M of treewidth k can be computed in
time dk  n2 with dk independent of the matrix but possibly super-exponential
in k.
In other words these problems are xed parametrized tractable problems in the
sense of [Dow98], where the parameter is the treewidth of the matrix. The algorithms can also be parallelized so as to be in NC, cf. [GHR95] but we shall not
pursue this further.
1

In [Val79] these problems are called enumeration problems. This might be misleading,
as we do not enumerate the solutions but we count them

On the Fixed Parameter Complexity of


Graph Enumeration Problems
De nable in Monadic Second Order Logic
B. Courcelle1 and J.A. Makowsky2? and U. Rotics3
LabRI
Universite de Bordeaux
Talence, France
e{mail: courcell@labri.u-bordeaux.fr
1

Department of Computer Science


Technion{Israel Institute of Technology
Haifa, Israel
e{mail: fjanos, roticsg@cs.technion.ac.il
2

Department of Computer Science


University of Toronto
Toronto, Canada
e{mail: froticsg@cs.toronto.edu

February 1999

Abstract. We discuss the parametrized complexity of enumeration and

evaluation problems on graphs de nable in Monadic Second Order Logic.


We show that for xed tree width, these problems are solvable in polynomial time. The same holds for xed clique width in the cases where
the clique decomposition can be computed in polynomial time and for
problems expressible by Monadic Second Order formulas without edge
set quanti cation. Such quanti cations are allowed in the case of graphs
with bounded tree width. As applications we discuss in detail how this
a ects the parametrized complexity of the permanent and the hamiltonian of a matrix, and more generally, various generating functions of
MSOL de nable graph properties. Finally our results are also applicable
to SAT and ]SAT .

partially supported by Grants of the French-Israeli Binational Foundation (19931995), the German Israeli Foundation (1995-1998) and by the Fund for Promotion
of Research of the Technion{Israeli Institute of Technology

You might also like