Algorithms for SAT Based on Search in Hamming Balls
Author : Evgeny Dantsin, Edward A. Hirsch,
and Alexander Wolpert
Speaker : 羅正偉
Outline
Definition of SAT problem Introduction of this paper Definitions and notation Randomized Algorithm
Preliminary: K-SAT problem
m
j
n
jm
CCCm
C
xxxn
KCCCCm
,...,, clauses
thesatisfies that assignmentA truth :Output
form. normal econjunctiv is
each For .,...,, riablesboolean va on
|| with ,...,, clauses :Input
21
21
21
Preliminary-A fact
2-SAT is in P, but 3-SAT is NP-complete.
Preliminary-Hamming Ball
Definition: The Hamming ball of radius R around a truth assignment A is the set of all assignments whose Hamming distance to A is less than or equal to R.
The assignment A is called the center of the ball.
The volume of a ball is the number of assignments that belong to the ball.
Introduction
In this paper a randomized algorithm for SAT is given, and its derandomized version is the first non-trivial bound for a deterministic SAT algorithm with no restriction on clause length.
For k-SAT, Schuler’s algorithm is better than this one.
Notation
(0,1)on defined x)-(1x)log-(1-x-xlogH(x)
T to settingby obtained formula the:|F
),..., riableboolean va (i.e. literal :
R. radius of {0,1}in ball Hamming a of volume:R)V(n,
Aat centered R, radius , {0,1}in ball Hamming a :R)B(A,
ball Hamming a of radius :R
formula CNF a :F
22
i
1i
n
n
l
xxl
Tl
n
i
Fact about H(x)
The graph of H(x) is
x
y
A bound of V(n,R)
formula. sStirling’by proceed then and ,
R)C(n,C(n,1)C(n,0)R)V(n, Proof. 2.
2),(2)/1(8
1
have wen/2,RFor 1.
)/()/(
nnRHnnRH RnVnRR
Randomized Algorithm
The randomized algorithm is called Random-Balls, and it invokes procedures called Ball-Checking and Full-Ball-Checking.
Ball-Checking algorithms
no""5.return
Sreturn S, assignment satisfying a returns thisif
1),-RT,|A T,|(F Invoke
k to1 i4.For
Aby falsified is that Fin ... clauseshortest a 3.Choose
no""“"return clauseempty an contains For 0R 2.If
Areturn A,under trueare Fin clauses all 1.If
no""“"or assignment satisfying :
Rnumber A, assignment F, formula :
1
ii
k
llingBall-Check
ll
ing(F,A,R)Ball-Check
Output
Input
Procedure
Observations
The recursion depth is at most R Any literal is altered at most once during
execution of Ball-Checking, and at any time, those remaining variables are assigned as in the original assignment
Lemma 1
There is a satisfying assignment in B(A,R) iff Ball-Checking(F,A,R) returns a satisfying assignment in B(A,R)
Proof. By induction of R (see reference)
Lemma2
The running time of Ball-Checking(F,A,R) is at most , where k is the maximum length of clauses occurring at step 3 in all recursive calls.
Proof. The recursion depth is at most R and the maximum degree of branching is at most k.
Rpoly(n)mk
Full Ball Checking
Procedure Full-Ball-Checking(F,A,R)Input: formula F over variables
, assignment A, number ROutput: satisfying assignment or “no”
1.Try each assignment A’ in B(A,R), if it satisfies F, return it.
2.Return “no”
nxx ,...,1
Observation
Full-Ball-Checking runs in time poly(n)mV(n,R)
Randomized algorithm
no""3.return
found. assignmentany return R),A,,Checking(F-Ball
invoke else R),A,,Checking(F-Ball-Full invoke A,by satisfied
literals R andA by falsified literals with clauses a contains F (b)If
randomat uniformly A assignmentan (a)Choose
:following the timesN2.Repeat
2R/n)-8R(1 1.N
no""or assignment satisfying :
nR0 s.t. R, numbers s,n variableover F formula :
)R,(F,
))/(1(
l
ll
llsRandom-Bal
nRHn
Output
Input
Algorithm
Lemma 3
Correctness of Random-Balls.
For any R, l, the following holds:(a)If F is unsatisfiable, then Random-Balls
returns “no”, (b)else Random-Balls finds a satisfying
assignment with probabability 1/2
Proofs of lemma 3
e
enRR
NnnnRH
1/1/n)-(1 since follows inequalitylast The
/1))/1(8
21()R)/2V(n,-(1
A]chosen any contain t doesn' R),Pr[B(A'
chosen] R)B(A,any in coverednot is Pr[A'
any), (if A' assignment satisfying aFor (b)
trivial.is (a)
Proof
n
)/(Nn
A bound of V(n,R)
formula. sStirling’by proceed then and ,
R)C(n,C(n,1)C(n,0)R)V(n, Proof. 2.
2),(2)/1(8
1
have wen/2,RFor 1.
)/()/(
nnRHnnRH RnVnRR
REVIEW!!
Probability of correctness
So the prob. of correctness = 1 – 1/e > 1/2 Choosing N to be k times larger will reduce
the probability of error to less than . Note this doesn’t ruin the time complexity
we need.
ke
Lemma 4
Consider the execution of Random-Balls(F,R,l) that invokes Ball-Checking. For any input R, l, the maximum length of clauses chosen at step 3 of Procedure Ball-Checking is less than l.
Ball-Checking algorithms
no""5.return
Sreturn S, assignment satisfying a returns thisif
1),-RT,|A T,|(F Invoke
k to1 i4.For
Aby falsified is that Fin ... clauseshortest a 3.Choose
no""“"return clauseempty an contains For 0R 2.If
Areturn A,under trueare Fin clauses all 1.If
no""“"or assignment satisfying :
Rnumber A, assignment F, formula :
1
ii
k
llingBall-Check
ll
ing(F,A,R)Ball-Check
Output
Input
Procedure
REVIEW!!
Proof of lemma 4
ion.contradict a A,by satisfied literals Rmost at has
D R,|C|-|D| R, isdepth recursion theSince A.by falsified
literals k has D Thus A.by falsified re’ that theyso
A, original in the as assigned are ,..., of variables
The D. clause some ofdecendent a is clause Then this
3. stepat chosen be k),...(C clause aLet
1
1
l
ll
lll
k
k
Lemma 5
For any R, l, let p be the probability (taken over random assignment A) that Random-Balls invokes Full-Ball-Checking. Then
)1)((m2p
Rl
RHl
Proof of lemma 5
||
||)||/),|(min(|
D||
D|D|)||D|-t)/H((|
D||
D||
D|-|
2
2
2/||),|min(|
-t|D| since 2
2
2
-t)|D||,DV(|
2
-t)|D||,DC(||,1)DC(||,0)DC(|2
2t))|,DC(|-1)|D||,DC(||)D||,D(C(|
A]by falsified literals -R)|D|,max(least tat has Pr[D
2(b)] ofcondition thesatisfies Pr[D
F,in D clause aFix
D
DDRlDH
n
n
DRlD
l
Proof of lemma 5(conti.)
required as
,|D|such since m2
2(b)]condition satisfies D Pr[some Thus
2
|D|))H(R/(R|D||)D|H(R/
exponentR,-|D| If
|D|))H(R/(R
|D|R))/(-H(1|D||)D|/-H(1
exponentR,-|D| If
1) - )))(H(R/(R(
1) - )))(H(R/(R(D||
l
l
l
l
lll
l
ll
l
因此上式
上式分子的
上式分子的
Fact about H(x)
The graph of H(x) is
x
y
REVIEW!!
Theorem 1
n0.712-n2 2 m poly(n)
mostat is )R,(F,
of timerunning expected
the,n1.87 and n0.339RFor
llsRandom-Bal
l
Proof of theorem 1
)2(m m poly(n)
)R)V(n,(p m poly(n)
)*p)-(1R)V(n,(p m poly(n) T
).algorithms checking Ball theofeither
(by Checking-Ball of timerunning expected
theis T whereT,*N estimate toneed We
)()1)((R
nn
RH
lR
RHl
R
R
l
l
l
Proof of Theorem 1(conti.)
--
2
--n2
)()1)(()nn
RH( -n
2 2 minimize toneed weThus
,Rlog-H(R/n)n and ))R
RH(-(1
where
)2(22poly(n)m
)2(m2poly(n)m
TN Thus
ll
l
l Rn
n
RH
lR
RHl
Proof of Theorem 1 (conti.)
Assign R=a ,l=b ,where a < b constants. We use the fact ln(1+x)=x+o(x).
n n
Proof of theorem1(conti.)
Proof of Theorem 1 (conti.)
Taking a=0.339, b=1.87, we have Φ ,ψ>0.712 , proving the theorem.n
Reference
E. Dantsin, A. Goerdt, E. A. Hirsch, R. Kannan, J. Kleinberg, C. Papadimitriou, P. Raghavan, and U. Schoning. A deterministic
algorithm for K-SAT based on local search. Theoretical Computer Science, 289(1):69-83, October 2002.
n
k)
1
22(