A Faster Algorithm for Propositional Model Counting Parameterized by Incidence Treewidth
Friedrich Slivovsky and Stefan Szeider
1
A Faster Algorithm for Propositional Model Counting Parameterized - - PowerPoint PPT Presentation
A Faster Algorithm for Propositional Model Counting Parameterized by Incidence Treewidth Friedrich Slivovsky and Stefan Szeider 1 Propositional Model Counting (#SAT) 2 Propositional Model Counting (#SAT) SAT Does have a satisfying
Friedrich Slivovsky and Stefan Szeider
1
2
2
SAT
Does have a satisfying assignment?
φ
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 𝖣𝗉𝖮𝖰
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
2
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Π𝖰
3
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
Δ𝖰
3
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
Δ𝖰
3
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
…
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
Δ𝖰
3
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
…
𝖰𝖨 = ⋃
i
Σ𝖰
i
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
Δ𝖰
3
Toda’s Theorem Every problem in the polynomial hierarchy can be solved in polynomial time using a #SAT oracle.
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
…
𝖰𝖨 = ⋃
i
Σ𝖰
i
3
SAT
Does have a satisfying assignment?
φ
#SAT
Count the satisfying assignments of .
φ
Σ𝖰
3
Π𝖰
3
Δ𝖰
3
Toda’s Theorem Every problem in the polynomial hierarchy can be solved in polynomial time using a #SAT oracle. #SAT #P-complete even for
𝖰 𝖮𝖰 Σ𝖰
2
𝖣𝗉𝖮𝖰 Π𝖰
2
Δ𝖰
2
…
𝖰𝖨 = ⋃
i
Σ𝖰
i
4
Probabilistic Inference
4
Pr(A|B) = Pr(A ∧ B) Pr(B) Probabilistic Inference
4
Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference
4
Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exact Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Exact Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Knowledge Compilation Exact Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Knowledge Compilation Dynamic Programming Exact Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Knowledge Compilation Dynamic Programming Approximate Exact Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Knowledge Compilation Dynamic Programming Approximate Exact Hashing-Based Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Model Counters Exhaustive DPLL Knowledge Compilation Dynamic Programming Approximate Exact Hashing-Based Pr(A|B) = Pr(A ∧ B) Pr(B) #(A ∧ B) #B Probabilistic Inference Circuit Design
4
Product Configuration
Decomposition-Based
5
treewidth measures the “tree-likeness” of a graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
treewidth measures the “tree-likeness” of a graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x2
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x3
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
(x1 ∨ x2 ∨ ¬x3) ∧ (¬x1 ∨ x2 ∨ x3) ∧ (¬x2 ∨ x3) ∧ (x1 ∨ x2 ∨ x4)
x1 x2 x4 x3
treewidth measures the “tree-likeness” of a graph primal graph incidence graph
x1 x2 x4 x3
5
primal treewidth k
primal treewidth k incidence treewidth k*
primal treewidth k incidence treewidth k*
primal treewidth k incidence treewidth k*
k* ≤ k + 1
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F)
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F) 2O(k) ⋅ p(F)
Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F) 4k* ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003 Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003
2k ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003
2k ⋅ p(F)
Samer and Szeider 2007 Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003
2k ⋅ p(F)
Samer and Szeider 2007
2k* ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003
2k ⋅ p(F)
Samer and Szeider 2007
2k* ⋅ p(F)
Our result Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
primal treewidth k incidence treewidth k*
k* ≤ k + 1 f(k) ⋅ p(F) f(k*) ⋅ p(F)
Fischer, Makowsky, Ravve 2006 Samer and Szeider 2007
4k* ⋅ p(F) 4k ⋅ p(F) 2O(k) ⋅ p(F)
Bacchus, Dalmao, Pitassi 2003
2k ⋅ p(F)
Samer and Szeider 2007
2k* ⋅ p(F)
Our result
O p t i m a l u n d e r E T H
Fischer, Makowsky, Ravve 2006 Courcelle, Makowsky, Rotics 2001
7
7
“node”
7
“node”
7
“node” “bag”
7
“node” “bag”
7
is contained in a bag.
“node” v w “bag”
7
is contained in a bag.
appears form a connected subtree.
“node” v w “bag”
7
is contained in a bag.
appears form a connected subtree.
“node” v v w “bag”
7
is contained in a bag.
appears form a connected subtree.
“node” v v w v “bag”
7
is contained in a bag.
appears form a connected subtree.
“node” v v w v The width of a tree decomposition is the size of its largest bag - .
1
“bag”
7
8
x2 x2 x4 x3 C2 C2 C2 x3 C1 x1
8
x2 x2 x4 x3 C2 C2 C2 x3 C1
t
x1
8
x2 x2 x4 x3 C2 C2 C2 x3 C1
t
x1
8
x2 x2 x4 x3 C2 C2 C2 x3 C1
t
x1
assignment of bag variables
8
x2 x2 x4 x3 C2 C2 C2 x3 C1
t
x1
assignment of bag variables subset of bag clauses
9
x4 x3 C2 x4 x3 C2 x4 x3 C2
… …
9
x4 x3 C2 x4 x3 C2 x4 x3 C2
t
… …
9
x4 x3 C2 x4 x3 C2 x4 x3 C2
t t1
… …
9
x4 x3 C2 x4 x3 C2 x4 x3 C2
t t1 t2
… …
9
x4 x3 C2 x4 x3 C2 x4 x3 C2
t t1 t2
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
… …
10
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
10
f, g : 2S → ℤ
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
10
f, g : 2S → ℤ
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
|S| = k
10
f, g : 2S → ℤ (f *c g)(Y) = ∑
A∪B=Y
f(A) g(B)
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
|S| = k
10
f, g : 2S → ℤ (f *c g)(Y) = ∑
A∪B=Y
f(A) g(B)
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
|S| = k Y ⊆ S
10
f, g : 2S → ℤ (f *c g)(Y) = ∑
A∪B=Y
f(A) g(B)
A1, A2 ⊆ χc(t) A1 ∩ A2 = A
|S| = k Y ⊆ S
All values of the covering product can be computed with arithmetic operations.
f *c g O(2kk)
Theorem (Björklund, Husfeldt, Kaski, Koivisto 2007)
4k* ⋅ p(F)
#SAT with incidence treewidth k*
4k* ⋅ p(F)
#SAT with incidence treewidth k*
Fast Zeta- and Möbius Transform Covering Product
4k* ⋅ p(F)
#SAT with incidence treewidth k*
Fast Zeta- and Möbius Transform Covering Product
4k* ⋅ p(F)
#SAT with incidence treewidth k*
Fast Zeta- and Möbius Transform Covering Product
4k* ⋅ p(F) 2k* ⋅ p(F)
#SAT with incidence treewidth k*
Fast Zeta- and Möbius Transform Covering Product