schöning's random walk algorithm for k-sat -...
TRANSCRIPT
Schöning's Random Walk Algorithm for k-SAT
time:2016.12 group:LLWJJ
OUTLINE
2
The Boolean Satisfiability K-SAT Probabilistic Algorithm Analysis
OUTLINE
3
The Boolean Satisfiability K-SAT Probabilistic Algorithm Analysis
4
PART ONE PART THREE
The Boolean Satisfiability
𝐴𝐴 OR 𝐵𝐵
A B 0 1
0
1
0 1
1 1
5
PART ONE PART THREE
The Boolean Satisfiability
𝐴𝐴 OR 𝐵𝐵
A B 0 1
0
1
0 1
1 1 Satisfiable
6
PART ONE PART THREE
The Boolean Satisfiability
¬𝐴𝐴 AND 𝐴𝐴
1
0
1
0
0
A
7
PART ONE PART THREE
The Boolean Satisfiability
¬𝐴𝐴 AND 𝐴𝐴
1
0
1
0
0
A
Unsatisfiable
8
PART ONE PART THREE
The Boolean Satisfiability
(𝑨𝑨𝟏𝟏 AND 𝑨𝑨𝟐𝟐) XOR (𝐴𝐴3 AND ¬𝐴𝐴4) … 𝐴𝐴50
1
OUTLINE
9
The Boolean Satisfiability K-SAT Probabilistic Algorithm Analysis
10
PART ONE PART THREE
K-SAT
Literal: (𝑥𝑥, ¬𝑥𝑥) Clause: (𝑥𝑥1 ∨¬𝑥𝑥2∨𝑥𝑥3) Conjunctive Normal Form:
• 𝑥𝑥1∨¬𝑥𝑥2 ∧ ¬𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧¬𝑥𝑥1 • …∨ … ∧ …∨ … ∧...∧ …∨ …
K ≥ 3
11
PART ONE PART THREE
K-SAT
Example: 3-SAT • 𝑥𝑥1∨ 𝑥𝑥3 ∧ 𝑥𝑥2∨ 𝑥𝑥4 ∧ 𝑥𝑥1∨ 𝑥𝑥4∨ 𝑥𝑥2 ∧ 𝑥𝑥1∨ 𝑥𝑥2
2 2 3 2
1
OUTLINE
12
The Boolean Satisfiability K-SAT Probabilistic Algorithm Analysis
13
PART ONE
Probabilistic Algorithm
1 input: a formula in k-CNF with n variables Guess an initial assignment a∈{0,1}n,uniformly at
random Repeat 3n times: If the formula is satisfied by the actual assignment: stop and accept Let C be some clause not being satisfied by the actual assignment Pick one of the ≤k literals in the clause at random and flip its value in the current assignment
14
Probabilistic Algorithm
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j)
1 for 1 (true) for 0 (false)
15
Probabilistic Algorithm
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j)
1 for 1 (true) for 0 (false)
16
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j)
17
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) a(1) = 1000
18
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) a(1) = 1000 a(2) = 1001
19
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) a(1) = 1000 a(2) = 1001 a(3) = 1000
20
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) a(1) = 1000 a(2) = 1001 a(3) = 1000
21
Probabilistic Algorithm
1 for 1 (true) for 0 (false)
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) a(1) = 1000 a(2) = 1001 a(3) = 1000 a(4) = 1100, state 0, reached √
OUTLINE
22
The Boolean Satisfiability K-SAT Probabilistic Algorithm Analysis
23
NP-complete Problem all known algorithms require superpolynomial time search for an "almost" optimal solution Use randomness to get a faster average running
time, and allow the algorithm to fail with some small probability
Analysis
24
Suppose: existing satisfying assignment α* Success probability p
Expected independent repetitions 1𝑝𝑝
The probability that we don’t get a satisfying assignment after t repetitions is (1 − 𝑝𝑝)𝑡𝑡≤ 𝑒𝑒−𝑝𝑝𝑡𝑡
Analysis
acceptable
25
j := number of different bits between α and α * := Hamming distance between α and α *
Analysis
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state j) Reach state 0 after 3j steps a(1) = 1000 a(2) = 1001 a(3) = 1000 a(4) = 1100, state 0, reached √
26
Analysis – Intuition in 3-SAT
1 for 1 (true) for 0 (false)
j =2
j =1 j =2 j =1 j =0
27
the initial assignment α is ramdomly selected by j P 𝑋𝑋 = 𝑗𝑗 = 𝑛𝑛
𝑗𝑗 2−𝑛𝑛
Analysis – Intuition in 3-SAT
28
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) Initial State: a = 0000 (state 2)
Analysis – Intuition in 3-SAT
2 3 1
𝑥𝑥1, 𝑥𝑥2
23
𝑥𝑥3
13
29
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) a(1) = 1000 (state 1)
Analysis – Intuition in 3-SAT
1 2 0
𝑥𝑥2
13
𝑥𝑥3, 𝑥𝑥4
23
30
Example: 𝑥𝑥1∨𝑥𝑥2∨𝑥𝑥3 ∧ 𝑥𝑥2∨𝑥𝑥3 ∨𝑥𝑥4 ∧ ¬𝑥𝑥1∨¬𝑥𝑥4∨𝑥𝑥2 a* = 1100 (state 0) a(2) = 1001 (state 2)
Analysis – Intuition in 3-SAT
2 3 1
𝑥𝑥2
13
𝑥𝑥1, 𝑥𝑥3
23
31
A clause 𝑥𝑥a∨𝑥𝑥𝑏𝑏∨𝑥𝑥c not satisfied by the assignment α At least one literal needs to be flipped Pr 𝑖𝑖 → 𝑖𝑖 − 1 ≥ 1
3, Pr (𝑖𝑖 → 𝑖𝑖 + 1) ≤ 2
3
Analysis – Intuition in 3-SAT
i i+1 i-1
13
13
13
13
23
23
23
23
32
𝑃𝑃𝑖𝑖 := possibility of reaching 0 from i, walking ∞ long 𝑃𝑃𝑖𝑖 = 1
3𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1 , 𝑃𝑃0 = 1
Analysis – Intuition in 3-SAT
i i+1 i-1
13
13
13
13
23
23
23
23
33
𝑃𝑃𝑖𝑖 = 13𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1 (*)
𝑃𝑃𝑖𝑖 = 1 would be a solution to (*), but sadly it’s not true
Analysis – Intuition in 3-SAT
i i+1 i-1
13
13
13
13
23
23
23
23
34
𝑃𝑃𝑖𝑖 = 13𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1 (*)
𝑃𝑃𝑖𝑖 = 2−𝑖𝑖 is also a solution to (*)
Analysis – Intuition in 3-SAT
i i+1 i-1
13
13
13
13
23
23
23
23
35
𝑃𝑃𝑖𝑖 = 13𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1 (*)
𝑃𝑃𝑖𝑖 = 2−𝑖𝑖 is a solution to (*) Proof. By Mathematical Induction, when 𝑖𝑖 ≥ 3, 𝑃𝑃𝑖𝑖 = 2−𝑖𝑖, 𝑃𝑃𝑖𝑖−1 = 2−(𝑖𝑖−1), we can get 𝑃𝑃𝑖𝑖+1 = 2−(𝑖𝑖+1) from 𝑃𝑃𝑖𝑖 = 1
3𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1.
When 𝑖𝑖 = 1,2, 𝑃𝑃𝑖𝑖 = 2−𝑖𝑖 also exists. ∎
Analysis – Intuition in 3-SAT
36
𝑃𝑃𝑖𝑖 = 13𝑃𝑃𝑖𝑖−1 + 2
3𝑃𝑃𝑖𝑖+1 (*)
𝑃𝑃𝑖𝑖 = 2−𝑖𝑖 is a solution to (*) ∎ In fact, that “usually” happens in 3i steps
Analysis – Intuition in 3-SAT
37
PART ONE
Analysis – in k-SAT
To-do: calculate 𝑃𝑃𝑗𝑗 in k-SAT “Wrong” direction: i step “Right” direction: i+j step (i≤j)
j j+1 j-1 Right Right Right Right
Wrong Wrong Wrong Wrong
38
PART ONE PART THREE
Analysis – in k-SAT
To-do: calculate 𝑃𝑃𝑗𝑗 in k-SAT At least one literal needs to be flipped in a clause Pr(go wrong direction) ≤ 𝑘𝑘−1
𝑘𝑘
Pr(go right direction) ≥ 1𝑘𝑘
j j+1 j-1 ≥
1𝑘𝑘 ≤
𝑘𝑘 − 1𝑘𝑘
39
PART ONE PART THREE
Analysis – in k-SAT
To-do: calculate 𝑃𝑃𝑗𝑗 in k-SAT Using binominal coefficient
𝑃𝑃𝑗𝑗 ≥ ∑ 𝑗𝑗+2𝑖𝑖𝑖𝑖
𝑗𝑗𝑖𝑖=0 ∙ 𝑖𝑖
𝑗𝑗+2𝑖𝑖∙ 1
𝑘𝑘
𝑖𝑖+𝑗𝑗∙ 𝑘𝑘−1
𝑘𝑘
𝑖𝑖
~ 1𝑘𝑘−1
𝑗𝑗
40
PART ONE PART THREE
Analysis – in k-SAT
To-do: calculate overall success possiblity 𝑝𝑝 in k-SAT
P 𝑋𝑋 = 𝑗𝑗 = 𝑛𝑛𝑗𝑗 2−𝑛𝑛
𝑝𝑝 = ∑ P 𝑋𝑋 = 𝑗𝑗 ∗ 𝑝𝑝𝑗𝑗𝑛𝑛𝑗𝑗=0
≥ 12
𝑛𝑛∑ 𝑛𝑛
𝑗𝑗𝑛𝑛𝑗𝑗=0
1𝑘𝑘−1
𝑗𝑗
= 12
1 + 1𝑘𝑘−1
𝑛𝑛
41
PART ONE PART THREE
Analysis – in k-SAT
To-do: calculate overall success possiblity 𝑝𝑝 in k-SAT
𝑝𝑝 ≥ 12
1 + 1𝑘𝑘−1
𝑛𝑛 , especially 𝑝𝑝 ≥ 3
4
𝑛𝑛 in 3-SAT
Complexity of k-SAT is within a polynomial factor of
2 1 − 1𝑘𝑘
𝑛𝑛, especially (4
3)𝑛𝑛 in 3-SAT
THANKS Q & A