• No results found

We now study approximate evaluation of degree-two #CSPs and Holant problems whose constraint language consists of a single arity 3 relation. The results are listed in Figure 4.4. The table only shows one member of each equivalence class under the symmetries of permuting variables and permuting the domain {0,1}, because these operations do not affect the computational complexity. Also, the problems shown to be in FP by Proposition 4.9 are not shown. Each relationR ⊆ {0,1}3is listed by writingijkfor each

(i, j, k)∈R. For example the first row represents the relation{(0,0,1),(0,1,0),(1,0,0)}. In each row:

• “FPRAS” means that#CSP2(R) has an FPRAS

• “#X”, where #X is #PM, #BIS or #SAT, means #CSP2(R) ≤AP #X ≤AP #CSP=2(R) • “≤AP #X” means#CSP≤2(R)≤AP#X R Complexity 100 010 001 #PM Lemmas 4.14 & 4.15 000 100 010 001 FPRAS Lemma 4.11 000 001 110 100 001 110 #SAT Lemma 4.17 000 100 001 110 100 010 001 110 #SAT Lemma 4.17 000 100 010 001 110 FPRAS Lemma 4.11 000 110 101 #PM Lemmas 4.14 & 4.16 000 100 110 101 FPRAS Lemma 4.12 000 010 110 101 100 001 110 101 #SAT Lemma 4.17 000 100 010 110 101 000 010 001 110 101 ≤AP#PM Lemma 4.14 100 010 001 110 101 ≤AP#PM Lemma 4.14 000 100 110 101 011 000 100 010 110 101 011 FPRAS Lemma 4.13 100 010 001 110 101 011 FPRAS Lemma 4.13 000 100 010 001 110 101 011 FPRAS Lemma 4.13 000 100 111 #BIS Lemma 4.17 000 100 010 111 000 100 101 111 #BIS Lemma 4.17 000 100 010 110 111 ≤AP#BIS Proposition 4.1 000 100 001 110 111 ≤AP#PM Lemma 4.14 000 100 010 001 110 111 FPRAS Lemma 4.13 000 010 001 110 101 111 FPRAS Lemma 4.13 000 100 010 001 110 101 111 FPRAS Lemma 4.13

Remark 4.10. The proof of Lemma 4.11 gives a deterministic FPRAS, sometimes called an FPTAS, for two rows.

4.4.1 FPRASes, and reductions from #CSPs to other problems Lemma 4.11. Let

R={(0,0,0),(1,0,0),(0,1,0),(0,0,1)}

S={(0,0,0),(1,0,0),(0,1,0),(0,0,1),(1,1,0)}.

Then#CSP≤2(R, S) has a FPRAS.

Proof. Given an instance (V, C) of #CSP2(R, S), let G be the multigraph with vertex set V, three edges xy, xz, yz for each h(x, y, z), Ri ∈ C, and two edges xz, yz for each

h(x, y, z), Si ∈ C. Then G has maximum degree four, and there is a bijection σ 7→ σ−1({1}) from satisfying assignments of (V, C) to independent sets of G. We can then

use an FPRAS for the problem of counting independent sets in multigraphs of maximum degree at most five [100].

Lemma 4.12. Let R = {(0,0,0),(1,0,0),(1,1,0),(1,0,1)}. Then #CSP≤2(R) has an

FPRAS.

Proof. We will reduce to computing the number of (not necessarily perfect) matchings in a multigraph, which has an FPRAS [70, Corollary 4.5]. For all integers k≥1define

Mk(x1, . . . , xk) =    1 if x1+· · ·+xk ≤1 0 otherwise.

Note thatM1(0) =M1(1) = 1. There is an expressibility reduction from#CSP≤2(R)

to #CSP2(NEQ, M3) whereNEQ ={(0,1),(1,0)}:

R(x, y, z) = X x0∈{0,1}

NEQ(x, x0)M3(x0, y, z).

By Lemma 4.5, #CSP≤2(NEQ, M3) ≤AP #CSP=2(NEQ, M1, M3). It remains to estab-

lish an AP-reduction from#CSP=2(NEQ, M1, M3)to the problem of counting matchings

in a multigraph. The important observation is that twoM constraints joined by aNEQ

constraint act like a singleM constraint:

X

x,y

Mk+1(x, x1, . . . , xk)NEQ(x, y)M`+1(y, y1, . . . , y`) =Mk+`(x1, . . . , xk, y1, . . . , y`)

for all x1, . . . , xk, y1, . . . , y` ∈ {0,1}. We will use this identity to eliminate constraints

until we are only left with constraints over{Mk|k≥1}.

We are given an instance (V, C) of #CSP=2(NEQ, M1, M3) and an error parameter

• ZV,C =miZVi,Ci, and

• degCi(v) = 2 for allv∈Vi, and

• Ci consists of constraints over {NEQ,PIN0,PIN1} ∪ {Mk|k≥1}, where PIN0 =

{(0)} andPIN1={(1)},

we will show that if Ci uses aNEQ, PIN0, or PIN1 constraint, then we can efficiently

construct (mi+1, Vi+1, Ci+1) with these same three properties, such that Vi+1 is a strict

subset ofVi. Note that|Ci|is necessarily bounded by2|Vi|, so to get a polynomial time

algorithm we only need to ensure that each step runs in polynomial time in|Vi|.

Consider the case where, for two variables x, y ∈ Vi, the constraint h(x, y),NEQi

appears twice in Ci. Then we can set Vi+1 = Vi \ {x, y}, set Ci+1 to be Ci with the

two h(x, y),NEQi constraints removed, and set mi+1 = 2mi. This is correct because

ZVi,Ci = 2·ZVi+1,Ci+1. We denote this transformation by:

P

x,yNEQ(x, y)NEQ(x, y)→2.

This notation means that the summed variables and constraints represented by the left-hand-side are deleted, and we multiplymi by2. In this case we do not introduce any

new constraints. Since NEQ is a symmetric relation (as are PIN0, PIN1, and Mk), the

order of variables does not matter: we can apply the same transformation ifh(x, y),NEQi

and h(y, x),NEQi are inCi.

A more complicated case is when there is a constraint h(x, y),NEQi, and x appears in a constraint using Mk for somek≥1, andy appears in a different constraint, using M` for some ` ≥ 1 (possibly with k = `). Set Vi+1 = Vi \ {x, y}, let Ci+1 be the

result of deleting these three constraints using x or y then inserting a new constraint

h(x1, . . . , xk, y1, . . . , y`), Mk+`i, and set mi+1 = mi. This is correct because ZVi,Ci = ZVi+1,Ci+1. We denote this transformation by

P

x,yMk+1(x, x1, . . . , xk)NEQ(x, y)M`+1(y, y1, . . . , y`)→Mk+`(x1, . . . , xk, y1, . . . , y`).

Again, we delete the summed variables and constraints represented by the left-hand-side, and the order of variables in a constraint does not matter. In this case we do not need to multiply mi, but we do get a new constraint, represented by the expression on the

If Ci has a h(x),PIN0i or h(x),PIN1i constraint for some x ∈ Vi, we can apply one

of the following transformations, depending on which other constraintx appears in:

P xPIN0(x)PIN0(x)→1 P xPIN1(x)PIN1(x)→1 P xPIN0(x)PIN1(x)→0 P xMk+1(x, x1, . . . , xk)PIN0(x)→Mk(x1, . . . , xk) P

xMk+1(x, x1, . . . , xk)PIN1(x)→PIN0(x1). . .PIN0(xk)

P

xPIN0(x)NEQ(x, y)→PIN1(y) P

xPIN1(x)NEQ(x, y)→PIN0(y)

If Ci has a h(x, y),NEQi constraint for some x, y ∈ Vi, we can apply one of the

following transformations, depending on whether x = y, or otherwise depending on which other constraintsx andy appear in:

P

xNEQ(x, x)→0 P

x,yNEQ(x, y)NEQ(x, y)→2 P

x,yNEQ(z, x)NEQ(x, y)NEQ(y, w)→NEQ(z, w) P

x,yMk+1(x, x1, . . . , xk)NEQ(x, y)M`+1(y, y1, . . . , y`)→Mk+`(x1, . . . , xk, y1, . . . , y`) P

x,yMk+1(x, x1, . . . , xk)NEQ(x, y)NEQ(y, z)→Mk+1(z, x1, . . . , xk) P

x,yMk+2(x, y, x1, . . . , xk)NEQ(x, y)→2PIN0(x1). . .PIN0(xk)

(It is possible to show that some of these rules are unnecessary, but that argument seems to be much more complicated than just covering extra cases.)

The remaining case is that Ci does not contain a NEQ, PIN0 or PIN1 constraint.

LetGbe the multigraph whose vertex set isCi and, for each variablev∈Ci, there is an edge between the two constraints in whichv is used inCi. The number of matchings in GisZVi,Ci, and we wish to approximateZV,C =miZVi,Ci. By [70, Corollary 4.4] we can find an approximation q of ZVi,Ci satisfying the FPRAS condition Pr(e−εZVi,Ci ≤q ≤ eεZVi,Ci)≥ 34. We can then outputmiq.

We will use the results of Chapter 3 concerning windable strictly terraced functions. By Theorem 3.5, the condition for an arity three relation to be windable simplifies to:

There are at least four triples (x, y, z)∈Rwith (1−x,1−y,1−z)∈R. (Wind)

Also note that an arity three relationR is strictly terraced whenever it is coindependent, that is,(1−x, y, z),(x,1−y, z),(x, y,1−z)∈/ R for all(x, y, z)∈R. Thus:

Lemma 4.13. Let R be a coindependent relation satisfying (Wind). Then #CSP≤2(R)

Proof. The function U defined by U(0) = U(1) = 1 is windable and strictly terraced.

#CSP2(R) =AP #CSP=2(R, U) by Lemma 4.5, and #CSP=2(R, U) has an FPRAS by

Theorem 3.4.

Lemma 4.14. If R⊆ {0,1}3 satisfies (Wind) then #CSP

≤2(R)≤AP #PM.

Proof. By Theorem 3.6, R has a matchings circuit. The function U defined by U(0) = U(1) = 1 has a matchings circuit (take a vertex of fugacity 1 with one external edge). The reduction is given by Theorem 3.5 and Lemma 4.5.

4.4.2 Reductions from other problems to Holant problems

The following reduction is essentially due to Fisher [53].

Lemma 4.15. #PM≤AP#CSP=2(PM3)

Proof. The reduction is given a graphGand error parameterε. For any degree-1vertex

v we can delete v and its neighbour; repeating this process gives a graph with the same number of perfect matchings and no vertices of degree 1. If G has a vertex of degree zero or if |G| is odd, then G has no perfect matchings and we can output zero. So we may assume thatGhas minimum degree at least two and that |G|is even. Replace any vertex of degreek >3 by vertices of degree 2and 3as shown in Figure 4.5.

...

... ...

Figure 4.5: A vertex of degreek >3is transformed to vertices of degree two and three, preserving the total number of perfect matchings. In words, the vertex is replaced by a pathv1u1v2u2. . . uk−3vk−2, and thekedges that were incident tov are now incident

to v1, v1, v2, v3, . . . , vk−3, vk−2, vk−2respectively.

This produces a multigraphG0 with the same number of perfect matchings asG, and where every vertex has degree 2 or 3, and with an even number of vertices. Any graph has an even number of odd-degree vertices, so G0 has an even number of even-degree vertices. Enumerate the degree 2 vertices as v1, . . . , v2k. For each 1 ≤ i ≤ k add new

verticesxi, yi and edges vixi, vi+1xi, xiyi, yiyi to produce a new multigraph G00. Observe

that for allithe edgexiyi is in every perfect matching inG00, soG00has the same number of perfect matchings asG.

LetC consist of one constrainth(e1, e2, e3),PM3i for each vertex inG00 with incident

edges e1, e2, e3 (possibly with repeats, corresponding to loops in G00). The reduction

calls the oracle on (E(G00), C) with error parameter ε. This is correct because number of perfect matchings inG00 isZE(G00),C.

Proof. DefineF:{0,1}2

R≥0 by F(0,0) = 1and F(1,1) = 2andF(0,1) =F(1,0) =

0. It suffices to establish the following reductions:

#PM≤AP #CSP=2(PM3)

AP #CSP=2(R,PIN1)

AP #CSP=2(R,{(1,1)}) ≤AP #CSP=2(R, F)

≤AP #CSP=2(R).

The first reduction#PM≤AP#CSP=2(PM3)is Lemma 4.15. The second is an express-

ibility reduction#CSP=2(PM3)≤AP #CSP=2(R,PIN1):

PM3(x, y, z) =

X

i,j∈{0,1}

R(x, i, j)R(i, y, z)PIN1(j) (x, y, z∈ {0,1}).

The third reduction#CSP=2(R,PIN1)≤AP#CSP=2(R,{(1,1)})follows from Lemma 4.8.

For the fourth reduction #CSP=2(R,{(1,1)}) ≤AP #CSP=2(R, F) we are given an instance(V, C)of#CSP=2(R,{(1,1)})and error parameterε, which we can assume is less than1/2. Letkbe|V|+ 1 +dlog2ε−1e: the least integer satisfying2|V|−k ε/2. Denote

the constraints using{(1,1)}byh(x1, y1),{(1,1)}i,. . .,h(xm, ym),{(1,1)}i. Let(V0, C0)

denote the result of replacing, for each 1≤i≤m, the constrainth(xi, yi),{(1,1)}iby

h(xi, vi,1), Fi,h(vi,1, vi,2), Fi, . . .h(vi,k−1, yi), Fi (4.3)

where vi,1, . . . , vi,k−1 are new variables. The reduction calls the oracle with error pa-

rameter ε/2 to obtain a value q, outputs zero if q/2mk < 1/2, and otherwise outputs

q/2mk.

For any σ:V → {0,1} letσ0:V0 → {0,1} denote the extension of σ withσ0(vi,1) =

· · · = σ0(vi,k−1) = σ(xi) for each 1 ≤ i≤ m. If σ is a satisfying assignment of (V, C),

then the weight of σ is 1 and the weight of σ0 is 2mk. Summing over σ we get ZV,C ≤ ZV0,C0/2mk. Conversely any assignment of (V0, C0) of positive weight is of the form σ0 for some σ, and if σ is not a satisfying assignment of (V, C) then the weight of σ0 is at most 2(m−1)k. Summing over σ we get

ZV,C≤ZV0,C0/2mk≤ZV,C+ 2|V|−k.

With probability at least 3/4, the valueq satisfies

If ZV,C = 0 then q/2mk ≤ eε/22|V|−k < 1/2 so the reduction correct outputs zero. If ZV,C ≥1 then e−ε/2ZV,C ≤q/2mk≤eε/2(ZV,C+ 2|V|−k) ≤eε/2(ZV,C+ε/2) ≤eε/2ZV,C(1 +ε/2) ≤eεZV,C as required.

The fifth reduction #CSP=2(R, F)≤AP #CSP=2(R) is an expressibility reduction:

F(x, y) = X i,j∈{0,1}

R(i, j, x)R(i, j, y) (x, y∈ {0,1})

Lemma 4.17. Let R⊆ {0,1}3, and assume:

• for all (x, y, z)∈R we havex≤y

• either (0,0,0),(1,1,1)∈R and (0,0,1),(1,1,0)6∈R, or (0,0,0),(1,1,1)6∈R and

(0,0,1),(1,1,0)∈R

Then#CSP=2(R) =AP #CSP(R), so the classification of Proposition 4.1 applies.

Proof. The reduction #CSP=2(R) ≤AP #CSP(R) is obvious. For the other direction

we will use the technique of 2-simulating equality from [51]. The reduction is given an instance (V, C) of #CSP(R). For each v ∈ V let degC(v) denote the total number of occurrences of v in C. Let V0 consist of distinct variables wv,i, wv,i0 for each v∈ V and each 1≤i≤degC(v). Let C0 consist of constraints:

• h(wv,i0 , w0v,i+1, wv,i), Rifor eachv∈V and each1≤i≤degC(v)wherew0v,degC(v)+1

means wv,0 1, and

• h(wv1,i1, wv2,i2, wv3,i3), Rifor each constrainth(v1, v2, v3), Ri ∈Csuch that this use of v1 is the i1’th occurrence of v1, this use ofv2 is the i2’th occurrence ofv2, and

this use ofv3 is thei3’th occurrence of v3.

For eachv ∈V, theh(wv,i0 , wv,i0 +1, wv,i), Riconstraints force the variableswv,i0 to take the same value for 1 ≤i ≤ degC(v). Given a satisfying assignment σ of (V, C) we get a satisfying assignment σ0 of (V0, C0) by, for each v ∈ V and each 1 ≤ i ≤ degC(v), setting σ0(wv,i) = σ(v), and σ0(wv,i0 ) = σ(v) if (0,0,0) ∈ R, and σ0(w0v,i) = 1−σ(v)

if (0,0,0) 6∈ R. Conversely any satisfying assignment of (V0, C0) arises as σ0 for some satisfying assignment σ of (V, C). Therefore (V0, C0) is an instance of#CSP=2(R) such thatZV0,C0 =ZV,C.

4.5

Downsets in directed acyclic graphs of maximum degree