On the expressive power of permanents and perfect matchings of matrices of bounded pathwidth/cliquewidth
Some 25 years ago Valiant introduced an algebraic model of computation in order to study the complexity of evaluating families of polynomials. The theory was introduced along with the complexity classes VP and VNP which are analogues of the classical…
Authors: Uffe Flarup (IMADA), Laurent Lyaudet (LIP)
On the expressiv e p o w er of p ermanen ts and p erfect matc hings of matrices of b ounded path width/cliquewidth Uffe Flarup 1 , Laurent Ly audet 2 1 Department of Mathematics and Computer Science Syddansk Univ ersitet, Campusvej 55, 5230 Od en se M, Denmark e–mail: flarup@imada.sdu.dk; fax: +45 65 93 26 91 2 Lab oratoire de l’Informatique du P arall´ elisme ⋆ ⋆ ⋆ Ecole N ormale Sup´ erieure de Lyon, 46, all ´ ee d’Italie, 69364 Lyo n Cedex 07, F rance e–mail: laurent.ly audet@ens-lyon.fr; fax: + 33 4 72 72 80 80 Abstract. Some 25 y ears ag o V alian t in t rodu ced an algebraic model of computation in order to stud y the complexity of ev aluating families of p olynomials. The theory was introduced along with th e complexity classes VP and VNP which are analogues of the classical classes P and NP. F amilies of p olynomials th at are difficult to ev aluate (t h at is, VNP-complete) in cludes t he p ermanent and hamiltonian p olynomials. In a previous pap er the auth ors together with P . K oiran stud ied the expressive p ow er of p ermanent and hamiltonian p olynomials of matrices of bou n ded treewidth, as w ell as the expressive p ow er of p erfect matchings of p lanar graphs. I t was established that the p ermanent and h amiltonian p olynomials of m atrices of b ound ed treewidth are equiv alen t to arithmetic form ulas. Also, the sum of weigh t s of p erfect matchings of planar graphs w as sho wn to b e equiv alent to (w eakly) sk ew circuits. In this p aper w e contin ue the research in t he direction describ ed ab o ve, and study the ex- pressiv e pow er of p ermanents, h amiltonians and p erfect matc h in gs of matrices that ha ve b ounded pathwidth or bounded cliquewidth . In particular, w e p ro ve that permanents, hamiltonians and perfect matc hings of matrices t h at hav e b ounded path width express exactly ari thmetic form ulas. This is an improv emen t of our previous result for ma tri- ces of b ounded treewidth. Also, for matrices of b ounded wei ghted cliquewidth w e show membership in VP for these polynomials. 1 In t ro duction In this pap er w e cont inue the work that was started in [8]. Our fo cus is on e asy sp ecia l c ases of otherwise difficult to ev aluate p olynomials , and their r elation to v a rious classes o f arithmetic circuits. It is c o njectured tha t the per manent and hamilto nia n p olynomials are ha rd to ev aluate. Indeed, in V aliant’s mo del [16,17] these families of p olyno mia ls are both VNP -complete. In the bo olean framework they are complete for the complexity cla ss ♯ P [18]. Ho wever, for matrices of bo unded treewidth the p ermanent and hamiltonia n p olynomia ls c an efficien tly b e ev alua ted - the num b er of ar ithmetic oper ations being po lynomial in the size o f the matrix [4]. An earlier result along these lines is related to co mputing weigh ts of pe rfect ma tc hings in a gr aph: The sum of w eights o f a ll perfect matc hings in a weigh ted (undirected) graph is another hard to ev a luate p olynomial, but for planar g raphs it can b e ev aluated efficiently due to Kasteleyn’s theore m [10]. ⋆ ⋆ ⋆ UMR 5668 ENS Lyon, CNRS, UCBL, I N RIA. Research Rep ort RR2008-05 By means of reductions these ev a lua tion methods c a n a ll b e seen as genera l-purp ose ev a l- uation algo rithms for certain clas ses of po lynomials. As a n example, if a n arithmetic for mu la represents a p oly no mial P then one can construct a matrix A o f b ounded treewidth such that: (i) The entries of A are v aria bles of P , or consta n ts from the underlying field. (ii) The p ermanent of A is equal to P . It tur ns out that the co nverse holds as well, so with resp ect to the computational co m- plexity computing the p ermanent of a b o unded treew idth matrix is equiv a lent to ev aluating an arithmetic formula. In [8] the following r esults (with abuse of notation) were established: (i) pe r manent/hamiltonian(bounded treewidth matrix) ≡ arithmetic formulas. (ii) pe r fect matchings(planar matrix) ≡ arithmetic skew circuits. One can also by similar tec hniques show that: (iii) pe r fect matchings(bounded treewidth ma tr ix) ≡ arithmetic formulas. Other notions of gra ph “width” hav e bee n defined in the litterature besides treewidth, e.g. pathwidt h, cliquewidth and rankwidth. Here we would like to study the ev a luation metho ds men- tioned ab ov e, but co nsidering matrices A that ha ve b ounded pa th width or b ounded c liquewidth instead of b ounded treewidth. I n this pa pe r w e establish the following results: (i) pe r /ham/p erf. match.(bounded pathwidth matr ix) ≡ arithmetic skew circuits of b ounded width ≡ arithmetic weakly sk ew circuits of b ounded width ≡ ar ithmetic formulas. (ii) arithmetic formulas ⊆ per/ ha m/p erfect matchings(bounded cliquewidth matrix) ⊆ VP. Overview of the p ap er. The second section o f the paper introduces definitions used through- out the pap e r and provides so me s ma ll technical r esults related to gr aph widths. In particular we show equiv alence b etw een the weight ed definitio ns of cliquewidth, NLC-width a nd m-cliq uewidth with res pec t to b oundedness . Sections 3 and 4 are devoted to the expressiveness of the per ma- nent , hamiltonian, and p erfect matchings of the graphs of bounded pathwidth and bounded weigh ted cliquewidth resp ectively . W e prov e in Section 3 that p erma nent , hamiltonian, and p er- fect matc hings limited to bo unded pathwidth gr aphs express arithmetic formulas. In Section 4, we show that for all thr e e polyno mials the complexity is b etw een arithmetic formulas and VP for graphs of b ounded weighted cliquewidth. 2 Definitions and preliminary results 2.1 Arithmetic circuits Definition 1. An a rithmetic circuit is a finite, acyclic, dir e ct e d gr aph. V ert ic es hav e inde gr e e 0 or 2, wher e those with inde gr e e 0 ar e r eferr e d to as inputs . A single vertex must have outde gr e e 0, and is r eferr e d to as output . Each vertex of inde gr e e 2 must b e lab ele d by either + or × , thus r epr esenting c omputation. V ertic es ar e c ommonly r eferr e d to as gates and e dges as arrows . By interpreting the input gates either as constants o r v ar iables it is ea sy to prove b y induction that each ar ithmetic circuit naturally repr esents a p olynomial. In this paper v a r ious sub class e s of arithmetic circuits will be considered: F or we akly skew circuits w e have the re s triction that for every multiplication ga te, at lea st o ne of the incoming 2 arrows is from a sub circ uit whose only c o nnection to the re s t of the cir cuit is through this incoming ar row. F or skew circ uits we hav e the restriction that for every m ultiplication gate, at least one of the incoming arrows is from an input gate. F or formulas all ga tes (exce pt o utput) hav e outdegree 1. Thus, reuse of partial results is not allow ed. F or a deta iled description of v a rious s ub cla sses of ar ithmetic circuits, along with examples , we refer to [1 4]. Definition 2. The size of a cir cuit is the total numb er of gates in the cir cuit. The depth of a cir cuit is the length of the longest p ath fr om an input gate to the output gate. 2.2 P athwidth and treewi d th Since the definition o f pathwidth is closely related to the definition of treewidth (bo unded pathwidt h is a s pe c ial case o f bounded treewidth) we also include the definition of treewidth in this pap er. T reewidth for undirected graphs is commonly defined a s follows: Definition 3. L et G = h V , E i b e a gr aph. A k -tr e e-de c omp osition of G is: (i) A tr e e T = h V T , E T i . (ii) F or e ach t ∈ V T a subset X t ⊆ V of size at most k + 1 . (iii) F or e ach e dge ( u, v ) ∈ E t her e is a t ∈ V T such that { u, v } ⊆ X t . (iv) F or e ach vertex v ∈ V the set { t ∈ V T | v ∈ X t } forms a (c onne cte d) subtr e e of T . The tre ewidth of G is t hen the sm al lest k such that ther e exists a k -tr e e-de c omp osition for G . A k - path -de c omp osition of G is then a k -tr e e-de c omp osition wher e the “tr e e” T is a p ath (e ach vertex t ∈ V T has at most one child in T ). Example 1. Here we show that cycles hav e path width at mos t 2 by constr ucting a path-deco m- po sition o f G where each X t has s iz e at most 3. Let v 1 , v 2 , . . . , v n be the vertices of a gr aph G which is a cycle . The edges of G are ( v 1 , v 2 ) , ( v 2 , v 3 ) , . . . , ( v n − 1 , v n ) , ( v n , v 1 ). The v ertex v 1 is con taine d in ev ery X t of th e path-decomp osition. V ertices v 2 and v 3 are con tained in X 1 , vertices v 3 and v 4 are contained in X 2 , and so o n. Finally , vertices v n − 1 and v n are contained in X n − 2 . This gives a path-de c omp o sition of G of width 2. The pa th width (treewidth) o f a directed, weigh ted gra ph is naturally defined as the pathwidth (treewidth) of the underlying , undirected, unw eig h ted gra ph. The pathwidt h (treewidth) of an ( n × n ) matrix M = ( m i,j ) is defined a s the path width (treewidth) of the directed gra ph G M = h V M , E M , w i where V M = { 1 , . . . , n } , ( i, j ) ∈ E M iff m i,j 6 = 0 , and w ( i, j ) = m i,j . Notice that G M can hav e lo ops. Lo ops a ffect neither the pathwidth nor the tr e ewidth of G M but are impo rtant for the c haracteriz ation o f the per manent p olyno mial. 2.3 Cliquewidth, N LCwidth and m-cli quewidth Although ther e e x ists ma ny alg orithmic res ults for g raphs of b ounded treewidth, ther e a re still cla sses of “trivia l” graphs that ha v e un bo unded treew idth. Cliques are an example of such gr aphs. Cliquewidth is a different no tion of “width” for graphs, and it is more general than tre e width since graphs of b ounded treewidth hav e b ounded cliq uewidth, but cliques hav e bo unded cliquewidth and unbounded tree width. 3 W e reca ll the definitions of cliquewidth, NLCwidth and m- cliquewidth for unw eighted, undi- rected gr aphs. Then we introduce the new notions of W -clique w idth, W - NLCwidth and W -m- cliquewidth whic h are v a riants of the preceding ones for weighte d, dir e ct e d graphs. These graph widths are a ll defined using t erms over an universal algebr a. When w e refer to parse-trees it means the parse- trees o f these terms. Definition 4 ([3,5]). A gr aph G has cliquewidth (denote d cw d ( G ) ) at most k iff t her e ex ists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstructe d using a finite n umb er of the fol lowing op er ations (name d clique op er ations): (i) v er a , a ∈ S (b asic c onstru ct: cr e ate a single vertex with lab el a ). (ii) ρ a → b ( H ) , a, b ∈ S (r ename al l vertic es with lab el a to have lab el b inste ad). (iii) η a,b ( H ) , a, b ∈ S , a 6 = b ( add e dges b etwe en a l l c ouples of vertic es wher e one of them has lab el a and t he other has lab el b ). (iv) H ⊕ H ′ (disjoint union of gr aphs). Example 2. Using the clique algebra , the c liq ue with four vertices K 4 is cons tr ucted by the following term us ing only t wo s o urce labels ; S = { a, b } : η a,b (( ρ a → b ( η a,b (( ρ a → b ( η a,b ( v er a ⊕ v er b ))) ⊕ v er a ))) ⊕ v er a ) . Definition 5 ([1 9]). A gr aph G has NLCwi dth (denote d w N L C ( G ) ) at most k iff t her e exists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstru cte d using a finite numb er of the fol lowing op er ations (name d NLC op er ations): (i) v er a , a ∈ S (b asic c onstru ct: cr e ate a single vertex with lab el a ). (ii) ◦ R ( H ) for any mapping R fr om S to S (for every so ur c e lab el a ∈ S r en ame al l vertic es with lab el a to have lab el R ( a ) inste ad). (iii) H × S H ′ for any S ⊆ S 2 (disjoint union of gr aphs to which ar e adde d e dges b etwe en a l l c ouples of vertic es x ∈ H (with lab el l x ), y ∈ H ′ (with lab el l y ) having ( l x , l y ) ∈ S ). One imp orta nt distinction b etw een cliquewidth and NLCwidth on one side and m-cliquewidth (to b e defined b elow) on the other side is that in the first t wo each vertex is assig ned exactly one lab el, and in the la st one each vertex is assigned a set of labels (pos sibly empt y). Definition 6 ([6]). A gr aph G has m-cliquewidth (denote d mcwd ( G ) ) at most k iff ther e exists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstru cte d using a finite numb er of the fol lowing op er ations (name d m-clique op er ations): (i) v er A (b asic c onst ru ct: cr e ate a single vertex with a set of lab els A , A ⊆ S ). (ii) H ⊗ S,h,h ′ H ′ for any S ⊆ S 2 and any h, h ′ : P ( S ) → P ( S ) (disjo int union of gr aphs to which is adde d e dges b etwe en al l c ouples of vertic es x ∈ H , y ∈ H ′ whose sets of lab els L x , L y c ontain a c ouple of lab els l x , l y such that ( l x , l y ) ∈ S . Then the lab els of vertic es fr om H ar e change d via h and the lab els of vertic es fr om H ′ ar e change d via h ′ ). It is stated in [6] (a pro of sketc h o f this r esult is g iven in [6 ], one o f the inequa lities is pr ov en in [9]) that mcwd ( G ) ≤ w d N L C ( G ) ≤ cw d ( G ) ≤ 2 mcw d ( G )+1 − 1 . Hence, cliquewidth, NLC-width and m-cliquewidth are equiv alent with resp ect to b oundedness. 4 W e hav e seen that the definition o f pathwidt h and treewidth for weigh ted g r aphs straight forward was defined as the width o f the underly ing, unw eighted graph. This is a ma jor differ- ence compa r ed to cliquewidth. W e ca n see that if we consider non-edg es as edges of weight 0, then every weigh ted g raph has a clique (which has b ounded cliquewidth 2) a s its underlying, un weigh ted gr a ph. Our main motiv a tion for studying b ounded cliquewidth matrices is to obtain efficient algo- rithms for ev aluating p o ly nomials like the p ermanent a nd hamiltonian fo r such ma tr ices. F or this reason, it is not re a sonable to define the c liq uewidth of a weighted gra ph as the cliq ue w idth of the underlying, un weighted gr aph, because then computing the per manent of a matrix of cliquewidth 2 is as difficult as the gener al case. Hence, we put r estrictions on how weights are assigned to edges: Edges added in the sa me ope r ation betw een v ertices having the same pair of lab els, will all hav e the same weigh t. W e now introduce the definitions of W -cliquewidth, W -NLCwidth a nd W - m-cliquewidth. W e will consider simple, weigh ted, directed gra phs wher e the w eights are in so me set W . In the three following constructio ns, a n arc from a vertex x to a vertex y is only added b y relev a nt op erations if there is not alrea dy an ar c from x to y . The op era tions that differ fro m the unw eighted case are indicated by b old font. Definition 7. A gr aph G has W -cliquewid th (d enote d W cwd ( G ) ) at most k i ff ther e exists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstructe d using a finite n umb er of the fol lowing op er ations (name d W - clique op er ations): (i) v er a , a ∈ S (b asic c onstru ct: cr e ate a single vertex with lab el a ). (ii) ρ a → b ( H ) , a, b ∈ S (r ename al l vertic es with lab el a to have lab el b inste ad). (iii) α w a,b ( H ) , a, b ∈ S , a 6 = b , w ∈ W (ad d missing ar cs of weight w fr om al l vertic es with lab el a t o al l vertic es with lab el b ). (iv) H ⊕ H ′ (disjoint union of gr aphs). Definition 8. A gr aph G has W -NLCwidth (denote d W wd N L C ( G ) ) at most k iff ther e exists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstru cte d using a finite numb er of the fol lowing op er ations (name d W - NLC op er ations): (i) v er a , a ∈ S (b asic c onstru ct: cr e ate a single vertex with lab el a ). (ii) ◦ R ( H ) for any mapping R fr om S to S (for every so ur c e lab el a ∈ S r en ame al l vertic es with lab el a to have lab el R ( a ) inste ad). (iii) H × S H ′ for any p artial function S : S 2 × {− 1 , 1 } → W (disjoint union of gr aphs to which ar e adde d ar cs of weight w for e ach c ouple of vertic es x ∈ H , y ∈ H ′ whose lab els l x , l y ar e such that S ( l x , l y , s ) = w ; t he ar c is fr om x to y if s = 1 and fr om y t o x if s = − 1 ). Definition 9. A gr aph G has W - m-cliquewidth (denote d W mcw d ( G ) ) at m ost k iff ther e exists a set of sour c e lab els S of c ar dinality k such that G c an b e c onstru cte d using a finite numb er of the fol lowing op er ations (name d W - m-clique op er ations): (i) v er A (b asic c onst ru ct: cr e ate a single vertex with set of lab els A , A ⊆ S ). (ii) H ⊗ S,h,h ′ H ′ for any p artial function S : S 2 × {− 1 , 1 } → W and any h, h ′ : P ( S ) → P ( S ) (disjoint union of gr aphs t o which is adde d missing ar cs of weight w for e ach c ouple of vertic es x ∈ H , y ∈ H ′ whose set s of lab els L x , L y c ontain l x , l y such that S ( l x , l y , s ) = w ; the ar c is fr om x to y if s = 1 and fr om y to x if s = − 1 . Then the lab els of vertic es fr om H ar e change d via h and the lab els of vertic es fr om H ′ ar e change d via h ′ ). 5 In the last opera tio n for W -m-cliquewidth, there is a p oss ibility t hat t wo (or more) ar cs a re added from a vertex x to a vertex y during the same o per ation and then the o btained gra ph is not simple. F or this reaso n, we will consider as well-formed ter ms only the ter ms (or parse- tr ees) where this do es not o cc ur . The three preceding c o nstructions of graphs can b e extended to weighted graphs with loops by adding the ba s ic constructs v er l oop w a or v e rl oop w A which creates a s ingle vertex with a lo op of w eig ht w and lab el a or set of lab els A . If G is a w eight ed graph (directed or not) with lo ops and U nl oop ( G ) denotes the weighted graph (directed or not) o btained from G by removing all lo ops, then one can easily show the following re s ult. – W cwd ( G ) = W cw d ( U nloop ( G )). – W wd N L C ( G ) = W w d N L C ( U nloop ( G )). – W mcwd ( G ) = W mcw d ( U nl oop ( G )). This justifies the fact that we overlook technical details for lo o ps in the pro of o f the following theorem. Theorem 1 shows that the inequalities betw een the three widths a re still v alid in the weigh ted case. It justifies our definitions o f cliquewidth for weigh ted graphs. F o r the pro of w e collect the ideas in [6,9] a nd comb ine them with our definitions for weighted gr aphs. Theorem 1. F or any weighte d gr aph G , W mcw d ( G ) ≤ W w d N L C ( G ) ≤ W cwd ( G ) ≤ 2 W mc wd ( G )+1 − 1 . Pr o of. Firs t inequa lity: Let G b e a w eighted gr aph of W -NLCwidth at most k and T be a parse- tr ee constructing G with W - NLC op erations on a set of so urce labe ls S of car dina lit y k . W e ca n consider without loss of generality that in T : - there ar e no t wo consecutive ◦ R ( H ) op era tio ns, otherwise we can r eplace T by T ′ where the t wo consecutive no des of T with ◦ R ( H ) a nd ◦ R ′ ( H ) oper ations on them have been re pla ced by one no de ◦ R ′′ ( H ) ( R ′′ = R ′ ◦ R ). - no v er a op eration is follow ed b y a ◦ R ( H ) op eration, o therwise we ca n r e place T b y T ′ where this tw o op er a tions are replaced b y v er b where b = R ( a ). - each H × S H ′ op eration is follow ed by exactly one ◦ R ( H ) op era tio n, otherwise we can add an ◦ I d ( H ) op eration if there is none ( I d is the identit y function from S to S ). W e can replace the W - NLC o per ation v er a by the W - m- clique o pe r ation v er { a } , and the con- secutives W -NLC o p er ation H × S H ′ and ◦ R ( H ) by the W -m-clique op er a tion H ⊗ S,h,h H ′ where h ( { a } ) = { R ( a ) } , ∀ a ∈ S . It is clear that these replace ments in T will give a parse-tre e constructing G with W -m-clique op er ations on the same set of s ource lab e ls S of cardinality k . Hence, we have W mcwd ( G ) ≤ W wd N L C ( G ). Second inequality: Let G b e a weigh ted gr a ph of W -cliquewidth a t most k and T be a parse-tr ee constructing G with W -clique op erations on a set of source lab els S o f cardinality k . W e can cons ider without loss of generality that in T : - after a disjoint union op eration H ⊕ H ′ all ar cs in G from x ∈ H to y ∈ H ′ (resp. fro m y to x ) ar e added betw een the disjoint unio n op eration H ⊕ H ′ and the first follo wing op eration O of disjoint union or renaming. Otherwise consider the first oper ation α w a,b ( H ) after O adding an a rc betw een a vertex x ′ from H and a vertex y ′ from H ′ . W e can add an op eration α w a ′ ,b ′ ( H ) b efore O where a ′ (resp. b ′ ) is the lab el in H ⊕ H ′ of the tail (r esp. head) of the arc added by the ope r ation α w a,b ( H ). 6 - each op er ation α w a,b ( H ) add at least one arc. - all α w a,b ( H ) op erations ar e b etw een a disjoint union op eration H ⊕ H ′ and the first following op eration O of disjoint union or renaming. W e ca n repla ce the W - clique oper ation v e r a by the W -NLC op era tion v er a , and the W - clique op eration ρ a → b ( H ) by the W - NLC op eration ◦ R ( H ) where R ( a ) = b and R ( c ) = c, ∀ c ∈ S , c 6 = a . Finally ea ch group consisting of a H ⊕ H ′ W -clique op era tio n and the fo llowing α w a,b ( H ) W -clique oper ations c an b e replaced b y the W -NLC op eration G × S G ′ where S ( a, b, 1) = S ( a, b, − 1) = w if there is an α w a,b ( H ) o pe r ation in the gr oup. It is clear that these replacements in T will give a parse - tree co nstructing G with W -NLC op er a tions on the same set of sourc e lab els S of ca rdinality k . Hence , we hav e W wd N L C ( G ) ≤ W cwd ( G ). Last inequality: Let G b e a weigh ted graph of W -m-cliquewidth at mo st k and T be a par se-tree constructing G with W -m-clique op erations on a set of source lab els S of ca rdinality k . L et S ′ be a s e t of source lab els of cardinality 2 k +1 − 1, S ′ = S l ⊔ S r ⊔ { empty } where |S l | = |S r | = 2 k − 1. W e define thr ee bijections l : P ( S ) \ ∅ → S l , r : P ( S ) \∅ → S r , and u : S l → S r such that u ( l ( A )) = r ( A ) , ∀ A ∈ P ( S ). W e will denote b y ρ f a sequence of ρ a → b W -clique ope rations re alizing a function f from S ′ to S ′ . W e asso ciate to each f unction S : S 2 × { − 1 , 1 } → W a seq uence α S consisting of α w l ( A ) ,r ( B ) (resp. α w r ( B ) ,l ( A ) ) W - clique op er ations for all co uples ( a, b ) ∈ S 2 , ( A, B ) ∈ ( P ( S ) \ ∅ ) 2 such that S ( a, b, 1) = w (resp. S ( a, b, − 1) = w ), a ∈ A and b ∈ B . W e can r eplace the W -m-clique op er a tion v er A by the W -clique op era tio n v e r l ( A ) if A 6 = ∅ and v er empty otherwise. Each W -m-cliq ue o per ation H ⊗ S,h,h ′ H ′ will b e replaced by the following W -clique o p er ations: - apply ρ u to the subtree cons tructing H ′ . - make a H ⊕ H ′ W -clique o p er ation. - apply α S . - apply ρ l ◦ h ◦ l − 1 . - apply ρ l ◦ h ′ ◦ r − 1 . It is clear that these repla c emen ts in T will give a par se-tree construc ting G with W -clique op erations o n the s e t of source lab els S ′ of c ardinality 2 k +1 − 1. Hence, we hav e W cwd ( G ) ≤ 2 W mc wd ( G )+1 − 1. ⊓ ⊔ 2.4 P erm anent and hamiltoni an p olynom ials In this pap er we take a gra ph theor etic approach to dea l with p ermanent and hamiltonian p oly- nomials. The rea son for this is that a natural way to define path width, treewidth o r cliquewidth of a matrix M is by the width of the graph G M (see Section 2 .2), also see e.g. [12]. Definition 10. A cycle cov er of a dir e cte d gr aph is a subset of the e dges, such that these e dges form disjoint, dir e cte d cycles (lo ops ar e al lowe d). F urt hermor e, e ach vertex in the gr aph must b e in one (and only one) of these cycles. The weight of a cycle c over is the pr o duct of weights of al l p articip ating e dges. Definition 11. The p ermane nt of an ( n × n ) matrix M = ( m i,j ) is the su m of weights of al l cycle c overs of G M . 7 The per manent of M can also be defined by the formu la per ( M ) = X σ ∈ S n n Y i =1 m i,σ ( i ) . The eq uiv alence with Definition 11 is clear since any p ermutation c a n b e written down as a pro duct of disjoint cycles, and this deco mpo sition is unique. The hamiltonian p olynomial ham( M ) is defined similar ly , except that we only sum ov e r cycle co vers co nsisting of a single cycle (hence the name). There is a na tur al w ay of representing p olynomials by p erma nent s. Indeed, if the entries of M ar e v ariables or constants f rom some field K , then f = p e r ( M ) is a p olynomial w ith co efficients in K (in V a liant’s terminolo gy , f is a pr o jection of the p erma nen t po lynomial). In the next sections we study the pow er of this representation in the ca se where M has bo unded pathwidt h or b o unded cliquewidth. 2.5 Connections b et w ee n p ermanen ts and sum of weigh ts of p erfect matc hings Another c ombinatorial characteriza tio n o f the p erma nent is b y sum of weigh ts of p erfect match- ings in a bipartite graph. W e will use this connection to deduce res ults for the perma nent from results for the sum o f w eight s of per fect matchings and vice v ersa. Definition 12. L et G b e a dir e cte d gr aph (weighte d or n ot). We define the inside-outside graph of G , denote d I O ( G ) , as the bip artite, un dir e cte d gr aph (weighte d or not) obtaine d as fol lows: – s plit e ach vert ex u ∈ V ( G ) in two vertic es u + and u − ; – e ach ar c uv (of weight w ) is r eplac e d by an e dge b etwe en u + and v − (of weight w ) . A lo op on u (of weight w ) is r eplac e d by an e dge b etwe en u + and u − (of weight w ). It is well-known that the p er manent o f a matrix M can b e defined as the sum of weigh ts of all per fect matchings of I O ( G M ). W e can see that the a djacency matrix of I O ( G M ) is 0 M M t 0 . Lemma 1. If G has tr e ewidth (p athwidth) k , then I O ( G ) has tr e ewidth (p athwidth) at most 2 · k + 1 . Pr o of. Let h T , ( X t ) t ∈ V ( T ) i b e a k -tree(pa th)-decomp osition of G . It is clear that h T , ( X ′ t ) t ∈ V ( T ) i , where X ′ t = { u + , u − | u ∈ X t } , is a tree(path)-deco mpo s ition of I O ( G ) o f width 2 · k + 1 . ⊓ ⊔ Lemma 2. If G has W -cli quewidth k , then I O ( G ) has W -cliquewi dth at most 2 · k . Pr o of. Let T b e a pa rse-tree constructing G with W -clique operatio ns on a set of s o urce la- bels S o f ca rdinality k . W e can replace the W -clique operation ve r a by the three operatio ns ( v er a + ) ⊕ ( ve r a − ), and the W -clique op eratio n ρ a → b ( H ) by the W - clique op era tions ρ a + → b + ( H ) and ρ a − → b − ( H ). Finally each α w a,b ( H ) W -clique opera tio n can b e replac e d by the η w a + ,b − ( H ) W - clique op eration. It is cle a r that these replace men ts in T will give a par se-tree constructing I O ( G ) with W -clique op er ations on the set of so ur ce labels { a + , a − | a ∈ S } of size 2 · k . ⊓ ⊔ 8 3 Expressiv eness of matrices of b ounded pathwid th In this section we study the expressive p ow er of p ermanents, hamiltonians and per fect matchings of matrices o f b ounded pathwidth. W e will pr ove that in each cas e we capture exa ctly the families of p olynomia ls computed by p olynomia l size skew circuits o f b o unded width. A by-pro duct of these pro ofs will b e a pr o of of the eq uiv alence b etw een p olynomia l size skew circuits of b ounded width and p olynomia l size we akly skew cir cuits of b ounded width. This equiv alence can not b e immediately deduce d from the alrea dy known eq uiv alence b etw e e n p olynomia l size skew circuits and p o lynomial size w eakly skew circuits in the unbounded width case [15] (the pro ofs in [15] use a combinatorial characterization o f the complexity o f the determinant as the sum of weigh ts of s , t -paths in a g raph of poly no mial size with distinguished vertices s and t . The additional difficulties to extend thes e pro ofs to c ir cuits and g raphs of b ounded width w ould b e equiv ale nt to the ones we dea l with). W e will then prove that skew circuits of b ounded width are equiv alent to arithmetic formulas. Definition 13. An arithmetic cir cuit ϕ has b ounded width k ≥ 1 if ther e exists a finite set of total ly or der e d layers such that: - Each gate of ϕ is c ontaine d in exactly 1 layer. - Each layer c ontains at most k gates. - F or every n on- input gate of ϕ if that gate is in some layer n , then b oth input s t o it ar e in layer n + 1 . Theorem 2. The p olynomial c ompute d by a we akly skew cir cuit of b oun de d wid th c an b e ex- pr esse d as the p ermanent of a matrix of b ounde d p athwidth. The size of the matrix is p olynomial in the size of the cir cuit. Al l entries in the m atrix ar e either 0, 1, c onstants of the p olynomial, or variabl es of the p olynomial. Pr o of. Let ϕ be a weakly skew circuit of b ounded width k ≥ 1 and l > 1 the num b er of lay ers in ϕ . The directed gr a ph G we construct will ha ve pathwidth a t most 7 · k 2 − 1 (each ba g in the path-decomp osition will co ntain at mos t 7 · k 2 vertices) a nd the num b er of bags in the pa th- decomp osition will be l − 1. G will hav e t wo distinguis hed v ertices s and t , and the sum o f weigh ts of all directed paths from s to t equals the v a lue co mputed b y ϕ . The vertex s will b e in all bags of the path-deco mpo sition of G . Since ϕ is a weakly skew circuit we consider a dec o mpo sition of it into disjoint s ubcir cuits defined recursively as follows: The output gate of ϕ b elongs to the main sub cir cuit . If a gate in the main sub circuit is an addition gate, then bo th of its input gates ar e in the main sub cir cuit as well. If a gate g in the main subcircuit is a multiplication ga te, then we k now that at least one input to g is the output gate of a sub c ir cuit which is disjoint from ϕ except for its c o nnection to g . This sub circuit forms a disjoint multiplic ation-input sub cir cuit . The o ther input to g b elongs to the main sub circuit. If so me disjoin t multiplication-input s ubcir cuit ϕ ′ contains at least one mult iplication gate, then we make a decompositio n o f ϕ ′ recursively . Note that such a decomp osition of a weakly skew cir c uit not necessarily is unique (nor do es it need to b e), b ecause b oth inputs to a m ultiplication gate can be disjoint from the rest of the circuit, and then any o ne of these tw o can b e c hosen as the one that b elongs to the main subcir cuit. Let ϕ 0 , ϕ 1 , . . . , ϕ d be the disjoin t sub circuits obtained in the decompo sition ( ϕ 0 is the main sub c ircuit). The graph G will have a vertex v g for every gate g of ϕ and d + 1 additional vertices s = s 0 , s 1 , . . . , s d ( t will corresp ond to v g where g is the output g a te of ϕ ). F o r every ga te g 9 in the subcir cuit ϕ i , the following co nstruction will ensure that the s um of weigh ts o f directed paths from s i to v g is equal to the v alue co mputed at g in ϕ . F or the constr uction of G we pr o cess the de c omp osition of ϕ in a b ottom-up manner. Let subcircuit ϕ i be a leaf in the decompositio n of ϕ (so ϕ i consists so le ly of addition ga tes and input gates). Assume that ϕ i is lo cated in lay ers top i through b ot i (1 ≥ top i ≥ bot i ≥ l ) o f ϕ . First we a dd a vertex s i to G in bag bot i − 1, and for each input ga te with v alue w in the b ottom lay er bot i of ϕ i we a dd a vertex to G also in bag bot i − 1 along with an edge of weigh t w fr om s i to that vertex. Let n ra nge from bot i − 1 to top i : Add the alr e ady created vertex s i to bag n − 1 and handle input gates o f ϕ i in lay er n a s previously descr ibe d. F or each addition ga te of ϕ i in lay er n w e add a new vertex to G (which is added to bags n a nd n − 1 of the pa th-decomp osition of G ). In bag n w e alrea dy hav e tw o vertices that represent inputs to this addition gate, so we add edges of weight 1 from b oth of these to the newly added vertex. The vertex repres ent ing the output gate of the circuit ϕ i is deno ted b y t i . The sum of weigh ted directed paths from s i to t i equals the v alue computed by the s ubcir cuit ϕ i . Let ϕ i be a sub circuit in the decomp os ition o f ϕ that contains multiplication ga tes. Addition gates and input gates in ϕ i are handled as b efore. Let g be a multiplication gate in ϕ i in lay er n a nd ϕ j the disjoint m ultiplication-input sub circuit that is o ne of the inputs to g . W e know that v ertices s j and t j already a re in bag n , so w e add an edge o f weight 1 from t he v ertex representing the other input to g to the vertex s j , and a n edge o f w eight 1 fr om t j to a newly created vertex v g that represe n ts gate g , and then v g is added to bags n and n − 1 . F or every b (1 ≥ b ≥ l − 1 ) we need to s how that only a constan t n um ber of vertices ar e added to bag b during the en tire pro ce ss. Every gate in lay er b of ϕ is repres ent ed b y a vertex, and these v ertices may all b e added to bag b . Ev ery g ates in la yer b + 1 are also represented by a vertex, a nd all of these are a dded to ba g b (b ecause they are used as input her e). So far we hav e at most 2 · k g ate vertices in each bag. In addition a num b er of s i vertices are also added to bag b . F or each sub cir c uit ϕ j that has a gate in layer b or b + 1, we hav e the cor resp onding s j vertex in bag b , so what rema ins is to show that at most 3 · k 2 disjoint subcir cuits have a gate in lay er b or b + 1. Each o f these subcir cuits are in exactly one of the following 3 s ets: C 1 : Sub circuits that have a gate in layer b , but NONE of them are mult iplication ga tes. C 2 : Sub circuits that DO have a multiplication gate in lay er b . C 3 : Sub circuits that have their r o ot in la yer b + 1. There are at most k 2 sub c ircuits in the set C 2 . Otherwis e, since t wo inputs to a multiplication gate are in different s ub cir cuits and since sub circuits in C 2 are disjoint lay er b + 1 w o uld co n tain at lea st 2 · ( k 2 + 1) gates and th us hav e width more than k . By how sub circuits are constructed, all subcircuits in C 3 are considered as the disjoint m ultiplication- input subcir cuit of distinct m ultiplication gates in lay er b , so there are at leas t | C 3 | multiplication gates in lay er b . Since sub c ircuits in C 1 do NOT ha v e multip lication gates in lay er b we hav e tha t | C 1 | + | C 3 | ≤ k . Thu s, at mo st | C 1 | + | C 2 | + | C 3 | ≤ 3 · k 2 distinct s ubcir cuits hav e their s i vertex a dded to bag b . Note that in lay e r 1 of ϕ we just hav e the output gate. This ga te is repre sented by the v e r tex t of G which is in bag 1 of the path-decomp os ition. The sum of weigh ts of all directed pa ths from s to t in G can by induction b e shown to b e equal to the v a lue computed b y ϕ . The fina l step in the reduction to the p erma nent p olyno mia l is to add an edge of weigh t 1 from t back to s and lo ops of weight 1 a t all no des different from s and t . ⊓ ⊔ The pro o f of Theorem 2 c a n b e mo dified to w or k for the hamiltonian p olyno mial as well. W e adapt the idea used to show univ er sality of the hamiltonian p oly nomial in [13]. F or the 10 per manent polynomia l each bag in the path-decomp osition contains a t mos t 7 · k 2 vertices; for each of these vertices w e now need to introduce o ne ex tr a vertex in the sa me bag. In addition each bag m ust con tain 2 more vertices in order to establish a connection to adjacent bags in the path-decomp osition. In total ea ch bag now con tains at most 7 · k + 2 vertices. Theorem 3. The p olynomial c ompute d by a we akly skew cir cuit of b oun de d wid th c an b e ex- pr esse d as the sum of weights of p erfe ct matchings of a symm et ric matrix of b ounde d p athwidth. The size of the matrix is p olynomial in the size of the cir cuit. A l l entries in the matrix ar e either 0, 1, c onstants of the p olynomial, or variables of the p olynomial. Pr o of. It is a dir e c t consequence of Theore m 2 and Lemma 1. ⊓ ⊔ Now we prove that the p ermanent, the ha miltonian, and the sum of weights o f p erfect matchings of a bo unded pathwidth graph can b e express e d as a sk ew c ir cuit of b ounded width. Theorem 4. The hamiltonian of a matrix of b ounde d p athwidth c an b e expr esse d as a skew cir cuit of b ounde d width. The size of the cir cuit is p olynomial in the size of t he matrix. Pr o of. Let M b e a matrix of bo unded pathwidt h k a nd let G M be the underlying, directed graph. Each ba g in the pa th-decomp osition of G M contains at most k + 1 vertices. W e refer to one end of the path-decomp osition a s the le af of the path-decomp osition and the other as the r o ot (reca ll that path-decomp ositions are sp ecial ca ses of tree-decomp ositio ns). W e pro cess the path-decomp osition of G M from the leaf tow ar ds the ro o t. The ov erall idea is the same as the pro of of Theorem 5 in [8] – namely to consider w eighted partial path covers (i.e. par tial cov ers consisting solely of paths) of subgr aphs of G M that are induced by the path-decomp osition of G M . During the pr o cessing of the pa th- de c o mpo sition of G M at every level dis tinct from the ro ot, new partial path cov ers are c o nstructed b y taking one previously generated partial path cov er and then add at mo st ( k + 1) 2 new edges, so all the multiplication gates we ha ve in our circuit are skew. F or any bag in the path-deco mpo sition of G M we only need to consider a n umber of partial path cov er s that depends solely o n k , so the circuit we pro duce has b ounded width. At the roo t we add sets o f edges to partial path cov ers to form hamiltonian cycles. ⊓ ⊔ Theorem 5. The su m of weights of p erfe ct matchings of a symmetric matrix of b ounde d p ath- width c an b e ex pr esse d as a skew cir cuit of b ou n de d width. The size of t he cir cuit is p olynomial in the size of the matrix. Pr o of. Let M be a symmetric ma trix of b ounded path width k a nd let G M be the underlying, undirected graph. Each ba g in the path-deco mp os ition of G M contains at mo st k + 1 vertices. W e proces s the pa th-decomp osition of G M from the leaf tow ar ds the ro ot. The pro of is very similar to the pro of of Theorem 4 – namely to consider weigh ted matchings of subgraphs o f G M that are induced by the ma tch ing of G M . During the pr o cessing o f the ma tch ing of G M at every level distinct from the ro ot, new matc hings are constructed b y taking one previously generated matching and then a dd at most ( k + 1) 2 new edges, so all the m ultiplication ga tes we hav e in our circuit are skew. F or any bag in the path-decomp osition of G M we only need to consider a nu mber of matchings that dep ends so lely o n k , so the circuit we pro duce has bounded width. At the ro ot we sum o nly the weigh ts of p erfe ct matc hings to obtain the output o f the circuit. ⊓ ⊔ Theorem 6. The p ermanent of a matrix of b ounde d p athwidth c an b e expr esse d as a skew cir cuit of b ounde d width. The size of t he cir cuit is p olynomial in the size of t he m atrix . 11 Pr o of. It is a dir e c t consequence of Theore m 5 and Lemma 1. ⊓ ⊔ Corollary 1. A family of p olynomials is c omputable by p olynomial size skew cir cuits of b ounde d width if and only if it is c omputable by p olynomial size we akly skew cir cuits of b ou n de d width. Pr o of. It is trivial to s ee that a family of p oly nomials co mputed by p olynomial s ize skew circuits of bo unded width can b e computed by p olynomial size weakly skew c ir cuits of b ounded width. Conv er sely , if a family of p olyno mials is computed by p oly no mial size weakly skew circuits of bo unded width then by Theo rem 2 it c an b e expr essed as the p erma nent s o f b ounded pathwidth graphs whic h can b e computed by p olynomial size skew cir cuits of b ounded width accor ding to Theorem 6. ⊓ ⊔ W e nee d the following Theor em from [1] to prove the eq uiv alence b etw een poly nomial size skew cir cuits of bounded width and p olynomial size ar ithmetic formulas. Theorem 7. Any arithmetic formula c an b e c ompute d by a line ar bije ction stra ight-line pr o gr am of p olynomial size that u ses thr e e r e gisters. Let R 1 , . . . , R m be a set of m re g isters, a linea r bijection str aight-line (LBS) pro gram is a vector of m initial v alues given to the registers plus a sequence o f instructions of the for m (i) R j ← R j + ( R i × c ), o r (ii) R j ← R j − ( R i × c ), o r (iii) R j ← R j + ( R i × x u ), or (iv) R j ← R j − ( R i × x u ), where 1 ≤ i, j ≤ m , i 6 = j , 1 ≤ u ≤ n , c is a constant, and x 1 , . . . , x n are v ariables ( n is the nu mber o f v a riables). W e supp ose without loss of g enerality tha t the v alue computed by the LBS progra m is the v alue in the firs t register after all instructions have b een executed. Theorem 8. A family of p olynomials is c omputable by p olynomial size skew cir cu its of b ounde d width if and only if it is c omputable by a family of p olynomial size arithmetic formulas. Pr o of. Let ( f n ) b e a family of p olyno mials computable by p olynomial size skew circuits of bo unded width, then by Theorem 2 it ca n b e ex pressed a s the per manents of b ounded pathwidt h graphs. Since gra phs of b ounded pathwith have b ounded tre ewidth, we know by Theor em 5 in [8] that it can b e computed by a family of po lynomial size a rithmetic formulas. Conv er sely , if ( f n ) is a family o f p olyno mial s ize a rithmetic for mulas, then by Theo rem 7, it is computable b y linear bijection straight-line progr ams of p oly no mial size that use three reg isters. W e will mo dify these progra ms to obtain equiv alent sk ew circuits of width 6 . At eac h step, the set of indices { i, j, k } will b e equal to { 1 , 2 , 3 } . Suppo se the initial v alues of the three registers are r 1 , r 2 , r 3 , then the fir st layer of our sk ew circuit contains three input gates with the three v alues r 1 , r 2 , r 3 along with tw o others inputs which will b e defined according to the next instructio n in the straight-line program. If the next ins tr uction is R j ← R j + ( R i × U ) whe r e U is a v ariable or a constan t, then we ass ig n the v alues 0 a nd U to the tw o input gates no t already defined in the current lay er l and we create a new lay er l − 1 with three addition gates corres po nding to R i , R j , R k whose inputs are the gate corresp o nding to R i (resp. R j , R k ) in lay er l and the input with v a lue 0 in lay er l . W e also put a multiplication gate whose inputs are the gate cor resp onding to R i and the input with v a lue U in layer l . And w e put again an input ga te with v alue 0. Then we create a 12 new la yer l − 2 with thre e addition gates corresp onding to R i , R j , R k whose inputs ar e the gate corres p o nding to R i (resp. R j , R k ) and the input with v alue 0 for i, k or the gate c o mputing ( R i × U ) for j in lay er l − 1. W e a lso put t wo others inputs which will b e defined a ccording to the next instruction. If the next instruction is R j ← R j − ( R i × U ), then we need to create one mo re lay er than in the first case. W e first as sign the v alues 0 a nd U to the t w o input gates not already defined in the cur r ent lay er l and we create a new lay er l − 1 with three addition g ates corr esp onding to R i , R j , R k whose inputs are the gate corre s po nding to R i (resp. R j , R k ) in lay er l a nd the input with v alue 0 in lay er l . W e also put a multiplication g ate whose inputs ar e the g ate corres p o nding to R i and the input with v alue U in la yer l . And we put again an input ga te with v alue 0 and another one with v a lue − 1 . Then we cr eate an intermediate new lay er l − 2 with three addition g a tes co rresp onding to R i , R j , R k whose inputs ar e the gate corresp onding to R i (resp. R j , R k ) and the input with v alue 0. W e also put a multip lication ga te who se inputs are the gate computing ( R i × U ) and the input with v alue − 1 in la yer l − 1 . And we put again an input gate with v a lue 0. Finally we create a new lay er l − 3 with three addition gates cor resp onding to R i , R j , R k whose inputs ar e the gate co rresp onding to R i (resp. R j , R k ) and the input with v alue 0 for i , k or the gate computing − ( R i × U ) for j in lay er l − 2. W e also put t w o other s inputs which will be de fined according to the next instructio n. In b o th cases, it is clear b y induction tha t the three g ates of the current layer co rresp onding to R i , R j , R k are co mputing the v alues in these registers if w e ex e cute the instructions trea ted so far. Hence the re sult. ⊓ ⊔ 4 Expressiv eness of matrices of b ounded weigh ted cliquewidth In this section we study the expressive p ow er of p ermanents, hamiltonians and per fect matchings of matrices that hav e bounded weight ed cliquewidth. W e fir st prov e that every arithmetic for mula can b e express ed a s the p erma ne nt, hamiltonian, or sum of weigh ts of p erfect matchings of a matr ix of b ounded W -clique width, using the results for the b ounded pathwidth matrices and the following lemma. Lemma 3. L et G b e a weighte d gr aph (dir e cte d or not) with weights in W . If G has p athwidth k , then G has W -cliquewid th at most k + 2 . Pr o of. Let h T , ( X t ) t ∈ V ( T ) i b e a k -path-dec o mpo sition of G . W e refer to one end of the path- decomp osition a s the le af of the pa th-decomp osition and the other as the r o ot . Let G t be the subgraph of G induced by the v ertices in bags b elow X t . W e prov e b y induction on th e heigh t o f h T , ( X t ) t ∈ V ( T ) i that every graph G t can be con- structed by W -clique o p e rations using at mos t k + 2 distinct labels. Mo r eov e r, at the end of this construction all vertices in bag X t hav e distinct lab els a nd all other vertices have a s ink lab el. If | V ( T ) | = 1 then G has at mo st k + 1 v er tices. W e can create them with k + 1 distinct lab els and add indep endently eac h edge betw een tw o vertices using W -clique op era tions. Suppo se | V ( T ) | > 1, let r be the ro ot a nd t b e its child. By induction, G t can b e co nstructed by W -clique opera tions using at most k + 2 dis tinct lab els. F or all vertex v ∈ X t \ X r , we a dd a renaming op era tio n which giv es sink lab el to v (this rena ming op eration r enames only v since, by induction, v has distinct label from other vertices). Since | X r | ≤ k + 1 and all vertices in V ( G ) \ X r hav e sink lab el, we ca n create the v ertices of X r \ X t with distinct lab e ls and a dd them b y disjoin t unio n to the current construction. It is now clear that a ll the vertices o f X r 13 hav e distinct lab els th us we can a dd independently each edge b etw een t wo vertices. Hence the conclusion. ⊓ ⊔ Theorem 9. Every arithmetic formula c an b e expr esse d as the p ermanent of a matrix of W - cliquewidth at most 22 and size p olynomial in n , wher e n is t he size of the formula. Al l entries in the matrix ar e either 0, 1, c onst ants of the formula, or variables of the formula. Pr o of. Let ϕ b e a formula of siz e n . Due to the pro of o f Theorem 8, we know that it can b e computed b y a sk ew cir cuit of width 6 and size O ( n O (1) ). Hence it is equal to the p ermanent of a gra ph of size O ( n O (1) ), pathwidth at mos t 7 · 6 2 − 1 = 20 by Theorem 2, and W -cliquewidth at most 20 + 2 = 22 by Lemma 3. ⊓ ⊔ F or the hamiltonian the W -cliquewidth b e comes ((7 · 6 + 2) − 1) + 2 = 45 instea d. Theorem 10. Every arithmetic formula c an b e expr esse d as the sum of weights of p erfe ct match- ings of a symmetric matrix of W -cli quewidth at most 44 and size p olynomial i n n , wher e n is the size of t he formula. Al l entries in the matrix ar e eithe r 0 , 1, c ons t ants of t he formula, or variables of t he formula. Pr o of. It is a dir e c t consequence of Theore m 9 and Lemma 2. ⊓ ⊔ Alternatively w e can mo dify the cons tructions o f b ounded tr eewidth g raphs expres sing formu- las in [8]. Thes e mo difications req uire more work than the pr eceding pro ofs but we obtain smaller constants s ince we obtain gr a phs of W -cliquewidth a t most 13/3 4/26 (instead of 22/ 45/44 ) whose per manent/hamiltonian/sum of weights o f perfect matc hings are equal to formulas. The pro ofs of these constants are giv en in the Appendix . Due to our r estrictions o n how weigh ts are assig ned in our definition of b ounded W - clique- width it is not true that weighte d graphs of bo unded treewidth hav e b o unded W -cliq uew idth. In fa ct, if one tries to follow the pro ofs in [5,2] that show that graphs o f b ounded treewidth hav e b ounded cliq uewidth, then o ne obtains that a weighted gr aph G of treewidth k has W - cliquewidth at most 3 · ( | W G | + 1 ) k − 1 or 3 · ( ∆ + 1 ) k − 1 . W G denotes the set of w eights on the edges of G and ∆ is the maximum degre e of G . W eigh ted trees still have bounded w eighted cliquewidth (the bound is 3), but w e can sho w that t here e xists a family of weighted graphs with treewidth 2 and unbounded W -cliquewidth [11]. W e now turn to the upp er b ound on the complexity of the p ermanent, hamiltonian, and s um of weigh ts of perfect matchings of gr aphs of bounded weigh ted cliquewidth. W e show that in a ll three cases the complex ity is at most the complexity of VP. The decision version o f the hamiltonian cycle problem has been shown to b e p olyno mial time s o lv able in [7] for matrices o f b o unded cliquewidth. Here w e ex tend these ideas in o r der to compute the hamiltonian po lynomial efficiently (in VP) for b ounded W -m-cliquewidth matrices. Definition 14. A path cover of a dir e cte d gr aph G is a subset of the e dges of G , such that these e dges form disjoint, dir e cte d, non-cyclic p aths in G . We r e quir e that every vertex of G is in (ex actly) one p ath. F or te chnic al r e asons we al low “ p aths” of length 0, by having p aths that start and end in the same vertex. S uch c onstr u ctions do not have the same interpr etation as a lo op. Th e weight of a p ath c over is the pr o duct of weights of al l p articip ating e dges (in the sp e cial c ase wher e ther e ar e no p articip ating e dges the weight is define d t o b e 1). Theorem 11. The hamiltonian of an n × n matrix of b ounde d W - m-cliquewidth c an b e expr esse d as a cir cu it of size O ( n O (1) ) and t hu s is in VP . 14 Pr o of. Let M b e a n n × n matrix of b ounded W -m-cliquewidth. By G we denote the underlying, directed, weigh ted graph for M . The circuit is constr uc ted bas e d on the pars e - tree T for G . By T t we denote the s ubtree of T ro oted at t fo r some no de t ∈ T . By G t we denote the s ubgraph of G constructed from the pa rse-tree T t . The ov era ll idea is to pro duce a circuit that computes the sum of weigh ts of all hamiltonian cycles of G . T o obtain this there w ill b e non-output ga tes that compute w eig h ts of a ll pa th cov er s of a ll G t graphs, and then w e combine these subresults. Of co ur se, the total num ber of path c overs can grow exp onentially with the size of G t , s o we will not “de s crib e” pa th covers directly by the edges par ticipating in the covers. Instead we describ e a pa th cov er o f some G t graph by the lab e ls ass o ciated with the sta r t- a nd end-vertices of the paths in the cov er . Such a description do not uniquely descr ibe a path cov er , b eca use tw o differe n t path covers of the same g raph c a n contain the same n umber of pa ths and a ll these paths can have the same labels asso ciated. How ever, we do not need the weight of each individual path cover. If multip le pa th cov er s of some graph G t share the sa me desc r iption, then w e just compute the sum of weigh ts of these path covers. F or a lea f in the par se-tree T o f G we construct a single gate of c o nstant weigh t 1, repr esenting a path cover consisting of a single “path” o f length 0, starting a nd ending in a vertex with the given la be ls . Per definition this pa th cov er has w e ig ht 1. F or a n int ernal no de t ∈ T the grammar rule desc r ib es which edg e s to add and how to rela b e l vertices. W e obtain new path covers b y considering a path cover from the le ft child of t and a path cov e r from the righ t child of t : F or eac h such pair of path covers consider a ll subsets of edges added at no de t , and for every subset of edges chec k if the addition o f these edges to the pair of path covers will result in a v alid path cov er. If it do es, then a dd a ga te that computes the weight of this path co ver, by multiplying the weight o f the left path cov er , the w eight o f the right path cov er and the total weight o f the newly added edges. After all pair s of path covers hav e b e en pro cesse d, chec k if any of the resulting path cov ers have the sa me des cription - namely that the num be r of paths in some path covers a re the sa me, and that these paths have the same lab els for star t- and end-vertices. If m ultiple pa th cov er s ha ve the same descr iption then add addition gates to the circuit and produce a sing le gate which computes the s um of w eig hts of all these path cov ers. F or the ro ot no de r of T we combine path c ov er s from the children of r to pr o duce hamiltonian cycles, instead of pa th cov er s . Finally , the output of the circuit is a summa tio n of all g ates computing weigh ts of hamiltonian cycles. Pro of of correctness: The fir st step of the pr o of is b y induction ov er the height of the parse- tree T . W e will show that for each non-r o ot no de t of T there is for every path cover description of G t a co rresp onding gate in the circuit that computes the sum o f weights o f a ll path covers of G t with that description. F or the base cases - leav es of T - it is trivially true. F or the inductive step we consider tw o disjoint graphs that are b eing connected with edges at a no de t of the parse-tre e T . Edges a dded at no de t are only added in her e, a nd not at any other no des in T , s o ev er y path co ver o f G t can b e split into 3 parts: A path cover of G t l , a path cov e r of G t r and a po lynomial num b er of edges added at no de t . Consider a path cover description along with a ll path cov e rs of G t that hav e this description. All of these pa th cov ers can b e split into 3 s uch parts, and by our induction hypothesis the weigh ts o f the path cov ers of G t l and G t r are computed in alrea dy constructed gates. In or der to complete the pr o of of correctness we hav e to handle the ro ot t of T in a sp ecial wa y . At the ro ot we do not compute w eights of path co vers, but instead co mpute weigh ts of hamiltonian cycles. Every hamiltonian cycle of G can (similar ly to path covers) b e split into 3 15 parts: A path c ov er of G t l , a path cover of G t r and a polynomia l num be r of edges added at the ro ot of T . By o ur inductio n hypothesis all the needed weights a re already computed. The size of the circuit is p o ly nomial since at each step the n umber of path cover descr iptions is po lynomially b ounded once the W -m-cliquewidth is b o unded. ⊓ ⊔ Theorem 12. The sum of weights of p erfe ct matchi ngs of an n × n symmetric matrix of b oun de d W -NLCwidth c an b e expr esse d as a cir cuit of size O ( n O (1) ) and t hu s is in VP . Pr o of. Let M b e an n × n symmetric matrix of b ounded W -NLCwidth. B y G we denote the underlying, undirected, weighted g raph for M . The c ircuit is constructed based on the parse-tre e T for G . By T t we denote the subtree o f T rooted at t for some no de t ∈ T . By G t we deno te the subgraph of G co nstructed from the pars e - tree T t . Let k b e the W -NLCwidth of G . W e ass ume without loss of genera lity that T is a pars e-tree on the set of lab els { a 1 , . . . , a k } . The ov er all idea is muc h similar to that of Theo rem 11, namely to pr o duce a circuit that computes the sum of weigh ts o f all p erfect matchings of G . T o obtain this there will be non- output gates that compute weigh ts of all ma tc hings of all G t graphs, and then we combine these subresults. Of course, the total num b er of matchings can grow exp onentially with the size o f G t , so we will not “descr ib e ” ma tc hings directly by the edges par ticipating in the cov ers. Instead we describ e a matching of some G t graph b y the lab els asso ciated to the uncov ered vertices. More precisely , for ea ch matching of G t and e a ch lab el a we give the num b er of a -vertices which a r e not cov er ed b y the ma tching. Suc h a description do not uniquely describ e a matching, beca use t wo different matchings of the sa me graph can hav e the same n um ber of uncov er ed vertices which hav e the s a me la b e ls asso ciated. How ever, w e do not need the weigh t of e ach individual matching. If multiple matchings of some graph G t share the same desc r iption, then we just compute the sum of weigh ts of these matchings. It is clear that the num ber o f description needed is at most n k . F or a leaf v er a i in the parse-tre e T of G w e construct a single terminal g a te of con- stant weigh t 1, r epresenting an empty matching. The description a sso ciated to this gate is (( a 1 , 0) , . . . , ( a i , 1) , . . . , ( a k , 0)). F or a n in ternal no de t ∈ T with op eration ◦ R ( H ) we just need to change the de s cription of terminal gates in the circuit c o nt ructed so far. More precisely , if the description of the gate w a s (( a 1 , n 1 ) , . . . , ( a i , n i ) , . . . , ( a k , n k )) then it b ecomes (( a 1 , X a j ∈ R − 1 ( a 1 ) n j ) , . . . , ( a i , X a j ∈ R − 1 ( a i ) n j ) , . . . , ( a k , X a j ∈ R − 1 ( a k ) n j )) . F or an in ternal no de t ∈ T with o per ation H × S H ′ the grammar r ule descr ib e s which edges to add. W e first crea te a m ultiplication ga te using the v alues of each co uple of ter minal gates of the left child l of t and the righ t child r of t . It cor r esp onds to the weigh ts of the disj oint unions of the matchings of l and r . There is at most n 2 k such ga tes. T o eac h gate, w e a sso ciate a left a nd right description corresp onding to the vertices from l and r . Those gates are the new terminal gates. W e put the follo wing total order a 1 < a 2 < · · · < a k on the labels and the corres p o nding lexicogr aphic order on the co uples ( a i , a j ). W e w ill consider that the e dges added via S are added by blo cks cor resp onding to a couple ( a i , a j ) (All edges in the same blo ck are added at the same time) and that a ll blo cks of edges are added sequen tially in lexicogr aphic order. Th us w e ha ve at most k 2 steps of a dding edges to consider. Suppose S ( a i , a j ) = w ij . F or the step corresp onding to ( a i , a j ) we o btain new matchings by considering each terminal gate g 0 . Let (( a 1 , n 1 ) , . . . , ( a i , n i ) , . . . , ( a k , n k )) and (( a 1 , n ′ 1 ) , . . . , ( a j , n ′ j ) , . . . , ( a k , n ′ k )) b e the 16 left and right description of g 0 . Let n min = m i n { n i , n ′ j } . F or a ll matching corresp onding to g 0 and a ll p b etw een 0 and n min we can o btain n i p · n ′ j p matchings by adding p edge s of w eight w ij betw een p v ertices amo ng n i of G l and p vertices a mong n ′ j of G r . Hence, for all p 6 = 0 we add a multiplication g ate with inputs g 0 and the constant n i p · n ′ j p · ( w ij ) p . This new ga te g p has left and rig h t description (( a 1 , n 1 ) , . . . , ( a i , n i − p ) , . . . , ( a k , n k )) and (( a 1 , n ′ 1 ) , . . . , ( a j , n ′ j − p ) , . . . , ( a k , n ′ k )). Ther e ar e at most 2 · n 2 k +1 such new gates since p < n . Finally we make an addition tree computing the addition of the gates g p which ha ve the s a me left and righ t description. Each such tree needs at most O ((2 k + 2 ) log( n )) new gates and there a re at mo st 2 · n 2 k trees. The o utputs o f these tr ees ar e the new terminal gates. When all the k 2 steps of adding edges are done we compute the des cription of each ter minal gate as the sum of its left and right desc r iption then we put an addition tree c omputing the addition o f the terminal gates which hav e the same global description. The o utputs of these trees are the new terminal gates. Finally , we obtain the output of the cir cuit at the ro ot no de r of T . It is the output of the terminal gate with descriptio n (( a 1 , 0) , . . . , ( a i , 0) , . . . , ( a k , 0)). Pro of of correctness: The fir st step of the pr o of is b y induction ov er the height of the parse- tree T . W e will show that for each no de t of T there is for every matching desc r iption o f G t a corres p o nding gate in the circuit that computes the sum of weight s of all matc hing s of G t with that description. F or the base cases - leav es of T - it is trivially true. F or the inductive step we c onsider tw o disjoint graphs that a re be ing connected with edges at a no de t of the par se-tree T . E dg es added at no de t are only a dded in here, and not at a n y o ther no des in T , so every matching of G t can be split in to 3 parts: A matching of G t l , a matching o f G t r and a polynomia l n um ber of edges added at no de t . Consider a matc hing description along with all matchings of G t that hav e this description. All of these ma tc hings can b e split into 3 such parts, and b y o ur induction h ypo thesis the weigh ts of the path cov ers of G t l and G t r are computed in already co ns tructed gates. The num b er of new ga tes added for eac h op eration H × S H ′ is at most O ( k 2 · n 2 k +1 ). Since the num b er of these op er a tions is at most n , we obtain a circuit of p o lynomial size. ⊓ ⊔ Theorem 13. The p ermanent of an n × n matrix of b ounde d W -m-cliquewid th c an b e expr esse d as a cir cu it of size O ( n O (1) ) and t hu s is in VP . Pr o of. It is a dir e c t consequence of Theore m 12 and Lemma 2. ⊓ ⊔ 5 Ac kno wledgemen ts Much of this work was done while U. Flarup was visiting the ENS Lyon during the s pring semester of 2007 . This v isit was partially made possible b y funding from Am bassade de F rance in Denmark, Service de Co op´ eration et d’Action Culturelle, Ref.:39/2 007-CSU 8.2.1. References 1. M. Ben-Or and R. Cleve. Comput ing Algebraic F orm ulas Using a Constant Number of Registers. In STOC 198 8, Pro ceedings of the Tw entieth Annual ACM Symp osium on Theory of Computing, pages 254 –257 A CM (1988). 2. D. Corneil and U. Rotics. On the R elationship Bet w een Clique-W id th and T reewidth. SIA M Journal on Co mputing 34, pages 825–8 47 (2005). 17 3. B. Courcelle, J. Engelfriet and G. Rozenberg. Context-free Handle-rewriting Hyp ergraph Grammars. In Graph- Grammars and Their Application to Computer Science, pages 253–268, 1990. 4. B. Courcelle, J. A . Mako wsky and U. Rotics. On the fixed parameter complexity of graph enumer- ation problems definable in monad ic second-order logic. Discrete Applied Mathematics 108, pages 23–52 (2001 ). 5. B. Courcel le and S . Olariu. Upp er bounds to the clique width of graphs. Discrete Applied Mathe- matics 101 , pages 77–114 (2000). 6. B. Courcelle and A. Twigg. Compact F orbidden- Set R outing. In ST ACS 2007, Proceedings of t he 24th International Symp osium on Theoretical Asp ects of Computer Science, volume 4393 of Lecture Notes in Computer Science, pages 37–4 8 Springer V erlag (2007). 7. W. Esp elage, F. Gurski and E. W anke. Ho w t o solve NP-hard graph p roblems on clique- width b ounded graphs in polynomial time. Lecture Notes in Computer Science 2204 ( 2001). 8. U. Flarup, P . Koiran and L. Lyaudet. On the expressive p ow er of p lanar perfect matc hing and p ermanents of bounded treew idth matrices . In ISAAC 2007, 18th International S ymp osium on Algorithms and Computation, vo lume 4835 of Lecture Notes in Computer Science, pages 124–13 6 Springer V erlag (2007). 9. O. Johansson. Clique-decomposition, NLC-decomp osition, and mod ular decomp osition - relation- ships and results for random graphs. Congressus Numeranti um 132, pages 39– 60 (1998 ). 10. P . W. Kasteleyn. Graph theory and crystal physics. In F. Harary , editor, Graph Theory and Theoretical Ph ysics, pages 43–110 . Academic Press (1967). 11. L. Lyaudet and I . T o dinca. Pri v ate comm unication (2007). 12. J. A. Mako wsky and K. Meer. Polynomials of boun ded treewidth. F oundations of Computational Mathematics, Pro ceedings of the Smalefest 2000, F elip e Cuck er and J. Maurice Ro jas, edts., W orld Scientific 2002, p ages 211 –250 (2002). 13. G. Malod. P olynˆ omes et coefficients. Ph.D. thesis (2003). 14. G. Malo d and N. Portier. Characterizing V aliant’s Algebraic Complexity Cla sses. In MF CS 2006, Proceedings of the 31st International Symp osium on Mathematica l F oundations of Computer Sci- ence, volume 41 62 of Lecture Notes in Computer S cience, pages 704–7 16 Springer V erlag (2006). 15. S . T o d a. Classes of arithmet ic circuits capturing the complexit y of computing the d eterminant. IEICE T ransactions on Information and S ystems, E75-D, p. 116 -124 (1992 ). 16. L. G. V alian t. Completeness classe s in a lgebra. In Proc. 11 th A CM Symp osium on Theory of Computing, pages 249–261 (1979). 17. L. G. V aliant. Red u cibilit y by algebraic pro jections. In Logic and A lgorithmic (an I nternational Symp osium held in honour of Ernst Sp eck er), pages 365–380. Monographie n o 30 de L’Enseignement Math´ ematique (1982). 18. L. G. V alian t . The complexity of computing the p ermanent. Theoretical Computer Science 8, pages 181–201 (1979). 19. E. W anke. k- NLC Graphs and Polynomial Algorithms. Discrete A pplied Mathematics 54, pages 251–266 (1994). 6 App endix Theorem 14. Every arithmetic formula c an b e expr esse d as the p ermanent of a matrix of W - cliquewidth at most 13 and size p olynomial in n , wher e n is t he size of the formula. Al l entries in the matrix ar e either 0, 1, c onst ants of the formula, or variables of the formula. Pr o of. Let ϕ b e a for mu la of size n . Due to [8] we know that ϕ can b e express ed a s the p e rmanent of a matrix M that has tre ewidth at most 2 and size at most ( n + 1) × ( n + 1). Let G b e the underlying gr aph of M a nd let T = h V T , E T i b e the 2-tree-decomp osition of G . With only a linear increas e in size of T we can assume that T is a binary tr e e -decomp osition. 18 Based on the tree-decomp osition T of G we co ns truct a g raph G ′ of b ounded W -cliquewidth such that (with slight abuse of notation) pe r ( G ) = p er ( G ′ ). A ma jor difference betw een g ram- mars for bo unded treewidth matrices and grammars for bo unded cliquewidth matrices is that we cannot “ merge” t w o v ertices int o a single v ertex when dealing with g rammars for bo unded cliquewidth matrices. As a cons equence the graphs G a nd G ′ will not be isomorphic, but ther e will b e a 1 to 1 co rresp ondence betw een their cycle covers. F or e very non-lo o p edge ( u, v ) of G there ca n b e multiple no des t ∈ V T such that u and v bo th ar e in the set X t . W e say that an edge ( u, v ) o f G “ b elo ng” to a no de t ∈ V T , if t is the no de closest to the ro ot o f T where u and v both a r e in X t (for every edge such a no de is uniquely defined). The general idea for the constructio n of G ′ is as follows: W e pr o cess T in a bo ttom-up manner. F or a no de t ∈ V T we first construct subg raphs representing the children l and r o f t , then we a dd the edges belonging to t using a special labeling scheme for the vertices. W e do not hav e a lab el in the gr ammar for each v ertex of G b ecause this will not r esult in a constant nu mber of la be ls . Instead, since | X l | ≤ 3 and | X r | ≤ 3 we use lab els to represent vertices in X l and X r and reuse these lab els during the pro cessing of T . A vertex v o f G is represented through multiple vertices in G ′ , bu t only t wo of them ar e “active” at any time during the construction of G ′ : One v ertex of indegree 0 is mana ging edg es leaving v in G , and one vertex of outdegree 0 is managing edges entering v in G . Since X l and X r bo th hav e size at most 3 we then need the following lab els for this scheme: left-a-in, left-a-out , left-b-in, left-b-out, left-c-in and left-c-out (and 6 similar lab els for right ). In addition to that we also need a sink lab el, g iv ing a total of 13 lab els needed to co nstruct G ′ . Pro cess ing T to construc t G ′ : F o r a leaf t of T we construct 6 vertices (or 4, if | X t | = 2), with the labels left-a-in, left-a-out, left-b-in, left-b-out, left-c-in and left-c-out (ass uming t is the left child of its parent). F or non-lo o p edges b elong ing to no de t , e.g. a dir ected edge from the vertex repr e sented with lab els left-b-in/out to the v e r tex represented with la bels lef t-a-in/out of weigh t w , w e then add edg es (actually just a single edge is added b ecause b oth of the la b els are only as signed to one vertex o f G ′ ) from vertices with lab el left-b-out to vertices with labe l left-a-in of weight w . Next, if a vertex of G , e.g. the vertex represented by left-b-in/out , is not present in X p ( p b eing the parent of t in T ), then we add an edge o f weigh t 1 from left-b-in to left-b-out . F urther more, if that v ertex has a lo op of weight w we add an edg e of weigh t w from left-b-out to left-b-in . In b oth ca ses we then r ename left-b-out and left-b-in to sink . F or an internal no de t ∈ V T (including the root of T ) we first consider vertices of G that are in b oth X l and X r , e.g. left-a-in/o ut and right-b-in/out represent the same vertex o f G . W e assume that t is the left child of its par ent in T . W e a dd a loop of w eight 1 to each of right- b-in and right-b-out . Then we add an edge of weigh t 1 from right-b-in to left-a-in and an edg e of weigh t 1 fro m left-a-out to right-b-out . Then right-b-in and right-b-out ar e r enamed to sink . Next w e add tw o vertices to G ′ for every vertex in X t that are not in X l nor X r . There will b e “av aila ble” in/out lab els for these tw o vertices, since in this cas e at lea st tw o other vertices were renamed to sink during pro cessing of each child of t . Next we co ns ider all edges of G belo ng ing to t . Assume ther e is a directed edg e from the vertex represented by right-c-in/out to the v ertex represented by left-b-in/out of w eight w , then w e add an edge of weigh t w from right-c-out to left-b-in . Last, if a vertex of G , e.g. the vertex represented by left-b-in/out , is not presen t in X p ( p b eing the parent o f t in T ) o r if t is the r o ot of T then we add an edge of weigh t 1 from left-b-in to left-b-out . F urther mo re, if that v er tex has a lo op o f weigh t w w e add a n edge o f weigh t w from left-b-out to left-b-in . In b oth ca ses we then r ename left-b-out and left-b-in to sink . 19 Pro of of correctness: A v e rtex v of G is repres ent ed through t wo disjoin t sets of vertices in G ′ : One set o f vertices mana g ing edges en ter ing v in G , and one set of vertices manag ing edges lea ving v in G . W e denote these sets of vertices in G ′ as v in and v out . A vertex of G ′ belo ng to v in if a t s o me p oint during the proce s sing of T it were a ssigned an in label whic h w a s representing v in G . By our c onstruction it is cle a r that every v ertex of G ′ belo ng to either v in or v out for ex actly 1 v er tex v of G , and the set v in form a directed tree whe r e all no n-lo op edges lead towards the ro o t and ha ve weight 1. All non-ro o t vertices in this tree ha v e a lo op of w eight 1. The set v out has equiv a lent prop erties, with the exc eption that non-lo op edges lead tow ar ds the leav es instead of the ro ot. Now cons ider t wo v e r tices u a nd v o f G a long with a directed edge o f w eight w from u to v , and conside r the trees u out and v in in G ′ . At s ome p oint in the constructio n of G ′ an edge of weigh t w w as added from a vertex in u out to a vertex in v in in G ′ , so ther e is a path of weigh t w from the ro o t of u out to the ro o t of v in and all vertices of u out and v in not in this path hav e a lo o p o f weigh t 1 . So in a cycle co ver of G w he r e we include the edge from u to v we then hav e an equiv alent path in G ′ and all remaining vertices in u out and v in are then cov ered by lo o ps. In o rder to “co nt inue” the construction of the path in G ′ we then also have an edge of weigh t 1 from the r o ot of v in to the r o ot of v out . In or der to simulate loops in cycle co vers o f G ′ we hav e added an edge fro m the ro o t of v out back to the ro o t o f v in of same w e ig ht as the loop in G . So a lo op in G cor resp onds to a cycle of length 2 in G ′ , and then all o ther no des in b oth v in and v out are cov ered by lo ops of weigh t 1. It is then easy to verify that cycle covers in G ′ are in bijection with cy c le cov ers o f G and the co rresp onding pairs of cycle cov ers ha ve s ame w eight. Fina lly , note that be tw een any tw o vertices o f G ′ there is at mos t 1 edg e so w e can find a matrix M ′ such tha t the under lying gra ph of M ′ is equiv alent to G ′ and then per ( M ′ ) = per ( M ). ⊓ ⊔ Theorem 15. Every arithmetic formula c an b e expr esse d as the hamiltonian of a matrix of W - cliquewidth at most 34 and size p olynomial in n , wher e n is the size of the formula. All entries in the matrix ar e either 0, 1, or c onstants of the formula, or variables of t he formula. Pr o of. Let ϕ b e a formula of size n . Due to [8] we know that ϕ can be express ed as the hamil- tonian of a matrix M that ha s treewidth at most 6 and size at most (2 n + 1 ) × (2 n + 1). Le t G b e the under lying, weighted, directed graph for the ma trix M a nd let T = h V T , E T i b e the binary 6-tree-deco mpo sition of G . With only a linea r inc r ease in size of T we ca n assume that T is a binary tree-decomp os ition. The o verall idea is the same as in Theo rem 14 - namely to pro ces s the tree-deco mpo sition T of G . Since a ll | X t | ≤ 7 in this tree-decomp osition we instead need at least 2 · 14 + 1 = 2 9 lab els during the pro cess ing of T to co nstruct G ′ . How ever, if we just use the exact same idea as in Theor em 9, then for every cycle cov er in the pro duced gr aph many v e r tices are cov ered through lo ops. Instead of intro ducing such loops w e “eliminate” them using the same idea as in [13] used for showing universality of the hamiltonia n po lynomial. W e need 5 additional lab els for this construction: left-h1, left- h2, right-h1, right-h2 and temp , for a total o f 34 la be ls . F or a lea f t o f T we star t the pr o cessing of t b y construc ting t wo vertices and lab el them left-h1 and left-h2 (as s uming t is the left child of its par ent in T ), a nd add an edge of weigh t 1 from left-h1 to left-h2 . Remaining pro cess ing of t is done as b e fore. F or an in terna l node t of T we first add an edge of w eight 1 from left-h2 to right-h1 , rename left-h2 and right-h1 to sink , and rename right-h2 to left-h2 (assuming t is the left c hild of its parent in T ). So me v er tices, e.g . the vertex with label right-c-in , ma y have a lo op added during 20 the pro cessing of t . Instead of adding such a lo op we do the following: Add a new vertex w ith lab el temp , add a n edge of weigh t 1 from left-h2 to right-c-in , a dd a n edge of weigh t 1 from right-c-in to t emp , a dd an edge of weigh t 1 from left-h2 to temp , rename left-h2 to sink , rename temp to left-h2 . Remaining pro ce ssing of t is done as b efore. When we reach the ro ot r o f T w e consider any vertex of X r , e.g. the v er tex repres e n ted by la b els left-a-in/out . In the final step, instead of a dding an edge of weight 1 from left-a-in to left-a-out , we add an edge of weight 1 from left-a-in to left-h1 and an edge of weigh t 1 fro m left-h2 to left-a-out . Now, for every hamiltonian cycle of G we break up the equiv alent cycle o f G ′ and visit any remaining vertices of G ′ along a path of total weight 1. ⊓ ⊔ Theorem 16. Every arithmetic formula c an b e expr esse d as the sum of weights of p erfe ct match- ings of a symmetric matrix of W -cli quewidth at most 26 and size p olynomial i n n , wher e n is the size of t he formula. Al l entries in the matrix ar e eithe r 0 , 1, c ons t ants of t he formula, or variables of t he formula. Pr o of. It is a dir e c t consequence of Theore m 14 and Lemma 2. ⊓ ⊔ 21
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment