Adrian Balint
July 13, 2010
Andreas Fröhlich
Improving stochastic local search for
SAT with a new probability distribution
Page 2
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Introduction
SAT
I
Formula F as a set of clauses. Each clause as a set of literals.
I
Is there an assignment α, so that F (α) = 1?
SLS-solvers
I
Operate on complete assignments.
I
Try to change an initial assignment α0 in a way, so that it becomes
satisfying after several steps.
I
Use local information and heuristics to decide how to modify the
assignment in each search step.
Page 3
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Pseudocode of a typical SLS-solver
INPUT: formula F , cutoff.
OUTPUT: model for F or UNKNOWN.
SLS(F , cutoff)
for i =1 to maxTries
α = α0 = random assignment;
for j =1 to maxFlips
if (α is a model for F ) return α;
var = pickVar ();
α[var] = 1−α[var];
return UNKNOWN;
Page 4
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
SLS architectures
I
Differ in how to select a variable for flipping.
GSAT
I
Considers all variables.
WalkSAT
I
Only considers variables from a randomly chosen unsatisfied clause.
DLS
I
Similar to GSAT. Additionally uses clause-weighting.
Page 5
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Modern SLS-solvers
I
Can not be put into just one category.
I
Are hybrids of the different architectures e.g.:
I
adaptG2WSAT = GSAT + WalkSAT + adaptive scheme [Li07]
I
gNovelty+ = adaptG2WSAT + DLS-component [Pham07]
I
TNM = GSAT + WalkSAT-version + two noise schemes to switch
between [Wei09]
I
they all use a Novelty-version to escape from local minima.
Page 6
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Escaping from local minima
Novelty
I
Choose a random unsatisfied clause c ∈ F
I
Pick a variable x from c according to the following heuristic:
best score variable has min age?
yes
no
choose best variable
noise
choose second
best variable
1-noise
choose best variable
Page 7
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Escaping from local minima
adaptNovelty+
I
Additionally implements a random walk with probability wp.
I
Uses an adaptive scheme for setting the noise probability [Hoos02].
Page 8
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Novelty as a probability distribution
I
This can be seen as a probability distribution p on the variables of c.
I
p(x) can take only 4 different values:
I
Always chosen; p(x) = 1
I
Chosen, when no noise step occurs; p(x) = (1 − noise)
I
Chosen, when a noise step occurs; p(x) = noise
I
Never chosen; p(x) = 0
I
Information used to decide: score, age
I
Does not take into account the exact values of score and age.
I
Does not put different variables into relation.
Page 9
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Example
I
c = {x1 , x2 , x3 }
Case 1
I
score(x1 ) = 0, score(x2 ) = −3, score(x3 ) = −3
I
age(x1 ) = 104 − 2, age(x2 ) = 104 , age(x3 ) = 104 − 1
Case 2
I
score(x1 ) = −1, score(x2 ) = −2, score(x3 ) = −3
I
age(x1 ) = 103 , age(x2 ) = 104 , age(x3 ) = 107
I
Both cases are identical for Novelty+.
I
The only chance for x3 to be selected is by a random walk.
Page 10
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
New probability distribution
I
Define a probability distribution as a concatenation of continuous
functions on the variables of c.
I
Choose a random variable according to this distribution.
I
The form of this distribution p(x) :=
I
ps (x) is a function considering the score of x.
I
pa (x) is a function considering the age of x.
I
pa (x), ps (x) > 0
ps (x)·pa (x)
.
∑x̃∈c ps (x̃)·pa (x̃)
Page 11
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
New probability distribution
I
Define a probability distribution as a concatenation of continuous
functions on the variables of c.
I
Choose a random variable according to this distribution.
I
The form of this distribution p(x) :=
I
ps (x) := c1 score(x)
age(x) c2
pa (x) :=
+1
c3
I
ps (x)·pa (x)
.
∑x̃∈c ps (x̃)·pa (x̃)
I
c1 controls the influence of score on the decision.
I
c2 and c3 specify, how quick and how strong age starts to affect the
decision.
Page 12
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Properties of p
Like Novelty
I
Prefers variables with high score.
I
Prefers variables with high age.
Additionally
I
Takes into account the exact values of score and age.
I
Puts different variables into relation.
I
Does not need an explicit random walk.
I
I
Implicit random walk because of ps (x), pa (x) > 0.
Does not need an explicit noise scheme.
I
Growing age automatically leads to new decisions when getting stuck in
a certain part of the search space.
Page 13
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Implementation details
Sparrow
I
I
gNovelty+ as the basic module. gNovelty+ consists of:
I
Gradient-walk as in G2WSAT.
I
adaptNovelty+ to escape local minima.
I
Additive weighting scheme.
Replaced the adaptNovelty+ component by a WalkSAT-algorithm
using the presented probability distribution.
I
Specifying the parameters c1 = 4, c2 = 4, c3 = 105 .
I
Constants fixed for all instances.
I
Empirical values.
I
Not optimized yet.
Page 14
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Evaluation
Empirical Tests
I
2 sets of large random 3-SAT instances with ratio = 4.2
I
Not optimized for k -SAT, k 6= 3.
I
Benchmark 1:
I
I
64 different instances from SAT 2009 Competition (2k - 18k variables)
I
Each instance is solved 100 times (cutoff 1200 sec.)
Benchmark 2:
I
40 additional instances from SAT 2009 Competition (20k - 26k variables)
I
Each instance is solved 50 times (cutoff 2400 sec.)
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
60
0 20
0
0.0e+00
1.5e+08
3.0e+08
Success runs
100
Time in seconds
100 200 300
3.0e+08
Numbers of flips
1.5e+08
gnovelty+2T
Results: Sparrow vs gNovelty+
0.0e+00
Page 15
0
100
200
300
Sparrow
0
20
40
60
80
100
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Results: Sparrow vs TNM
Numbers of flips
100
60
100 150
0 20
0
0
50
100
150
4e+08
20
40
60
80
100
0
10
20
30
40
50
30
400
0 10
200
0
2e+08
0
50
600
0.0e+00
50
1.0e+08
0e+00
Success runs
Time in seconds
1.0e+08
3e+08
TNM
0.0e+00
0e+00
Page 16
0
100
300
500
Sparrow
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Results: Sparrow vs hybridGM3
0 20
0
50
0
100
100 150 200 250
0
20
40
60
80
100
0
10
20
30
40
50
50
1.0e+08
Success runs
60
150
0 50
0.0e+00
0.0e+00
0
0 10
100
30
300
1.0e+08
hybridGM3
1.0e+08
250
Time in seconds
100
Numbers of flips
0.0e+00
Page 17
0.0e+00
1.0e+08
200
300
Sparrow
400
Page 18
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Conclusion
Summary
I
Escaping local minima is a key feature for SLS-solvers
I
Variable selection in local minima should not be done in a
deterministic way
I
Detailed differentiation useful for variable selection.
Outlook
I
Implement more attributes.
I
Arbitrary complex function.
I
Variable expressions [Tompkins10].
Page 19
Improving stochastic local search for SAT with a new probability distribution | Balint, Fröhlich | July 13, 2010
Thank you for your attention!
© Copyright 2026 Paperzz