Docstoc

Hard SAT and CSP instances with Expander Graphs

Document Sample
Hard SAT and CSP instances with Expander Graphs Powered By Docstoc
					  Intro Background     Generation Results                                      CP’08, Sydney




Hard SAT and CSP instances with Expander
                Graphs

                             ´           ´   ´
                   Carlos Ansotegui, Ramon Bejar
                    `        ´
                   Cesar Fernandez, Carles Mateu

                             Departament d’Inform`atica
                               Universitat de Lleida



                             Sydney, Australia




        http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Esquema



1   Introduction


2   Previous Results


3   Generation Model


4   Empirical Results




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Hard instances for SAT and CSP


Goals

   Finding problem features that affect problem hardness
   Giving uniform explanations for both SAT and CSP on such
   hardness
   Measuring such parameters efficiently on given problems
   Creating an impact model of those features on problem
   hardness
   Build instance generators that exploit that information to create
   hard instances




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
         Intro Background     Generation Results                                      CP’08, Sydney

Hard instances for SAT and CSP


Our approach

   We started from previous results on hardness of UNSAT
   formulas. Key parameter: expansion
          High expansion of incidence graph implies high resolution width
          (Atserias)
   However, expansion not efficiently computable. So:
     1    Study parameters that will assure a lower bound on expansion
          (e.g. girth)
     2    Build generators that try to mantain such parameters as high as
          possible
     3    Empirically compare their hardness with standard models




               http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Esquema



1   Introduction


2   Previous Results


3   Generation Model


4   Empirical Results




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Graphs, Girth and Expansion

Bipartite graphs, girth
Bipartite graph: G = (L ∪ R, E ), where E ⊆ L × R

Girth: length of the smallest cycle in G

Expanders

    Expansion of X : |N(X )|/|X |, where
    N(X ) = {w ∈ V \ X | ∃v ∈ X , {v, w } ∈ E } is the set of outside
    neighbors of X
    A left (α, c)-expander is a bipartite graph (L ∪ R, E ) such that
    every subset of L of size at most α|L| has expansion at least c.



              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
         Intro Background     Generation Results                                      CP’08, Sydney

Variable and Literal Incidence Graphs



Incidence graphs for SAT instance F
G(F ) = (C ∪ V , E ) is its variable incidence graph such that (c, v) ∈ E
if and only if variable v appears in clause c.

LG(F ) = (C ∪ L, E ) is its literal incidence graph such that (c, l) ∈ E if
and only if literal l appears in clause c.

If LG(F ) = (C ∪ L, E ) is a left (α, c)-expander, then
G(F ) = (C ∪ V , E ), will be, at least, a left (α, c/2)-expander




               http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Variable and Literal Incidence Graphs



Literal incidence graph for CSP instance P
LG(P) = (NG ∪ L, E ), where:
    For every variable xi and domain value j ∈ dom(xi ) there is a
    vertex (xi , j) in L
    For every nogood tuple ngij = (vj1 = d1 , vj2 = d2 , . . . , vjk = dk )
    associated with a constraint Ci there is a vertex ngij in NG and k
    edges, one for every pair (ngij , (vjj ′ , dj ′ ))




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
         Intro Background     Generation Results                                       CP’08, Sydney

Literal incidence graph for CSPs

Given a CSP problem with 2 nogoods:
ng1 = (v1 = d1 , v2 = d2 , v3 = d3 ) ng2 = (v1 = d4 , v2 = d2 , v3 = d3 )
its literal incidence graph should look:


                           nogoods                   (variable,value)
                                                         (v1 , d1 )
                               ng1
                                                          (v1 , d4 )

                                                          (v2 , d2 )
                               ng2
                                                          (v3 , d3 )



               http://ai.udl.cat     Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Previous Results - Complexity of SAT

Width of a resolution refutation
The width of a resolution refutation is the length of the longest clause
in the refutation

High width ⇒ high proof size
If every resolution refutation of F requires width w , then every
                                              2
resolution refutation of F requires size 2Ω(w /n) (Ben-Sasson and
Wigderson)

High expansion ⇒ high width
if G(F ) is a left (α, c)-expander, any resolution refutation will have
width Ω(αn) if maximum right-degree of G(F ) is o(|C|), |C| = Ω(n)
and c > 1 (Atserias)

              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Expansion and the Matching Game

Matching game

    Two players: Prover, Disprover and r fingers for each player
    Disprover: tries to maintain a partial matching of size r forever
    Prover: tries to show that this is not possible, starting from an
    empty matching


Expansion versus partial consistent assignments
Any partial matching from C to V in G(F ) defines a partial truth
assignment for F

So, if G(F ) is a good expander, we have partial assingments that
satisfy many big subsets of clauses, even if F is UNSAT

              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
       Intro Background     Generation Results                                      CP’08, Sydney

Expansion of random bipartite graphs
Some results

   (k, −)-regular bipartite (L ∪ R, E ) with |L| = |R| will be a good
   expander with probability > 1/2
   If it is (k1 , k1 )-regular, then it wil almost always a good expander
   (Sipser and Spielman)



        1                         5                   1                        5
        2                         6                   2                        6
        3                         7                   3                        7
        4                         8                   4                        8
   Well balanced, high expansion Poorly balanced, low expansion


             http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                          CP’08, Sydney

Balance and Expansion
Balance is not enough to acheive the highest expansion !

     clauses                      literals         clauses                    literals
        1                            1                1                          1
        2                            2                2                          2
        3                            3                3                          3
        4                            4                4                          4
        5                            5                5                          5
        6                            6                6                          6
        7                            7                7                          7
        8                            8                8                          8
    Balanced, but low expansion                   Balanced and high expansion
              girth=4                                       girth=6


                       The key is avoiding small cycles
              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Esquema



1   Introduction


2   Previous Results


3   Generation Model


4   Empirical Results




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Generation of high girth bipartite graphs


We modify the algorithm for non-bipartite graphs of (Sunil Chandran,
2003) to generate a high girth bipartite (k, −)-regular graph
(V1 ∪ V2 , E )


Step 1: create an initial graph with no cycles
Step 1: Initialize E with a random matching from V1 to V2 such that
∀v ∈ V1 , degree(v) = 1 and
∀v ∈ V2 , degree(v) = ⌊|V1 |/|V2 |⌋ ∨ degree(v) = ⌊|V1 |/|V2 |⌋ + 1




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
          Intro Background     Generation Results                                      CP’08, Sydney

Generation of high girth bipartite graphs

Step 2: create cycles of maximum length
For i = |V1 | + 1 To k |V1 |
  1 LT := {u ∈ V1 | degree(u) < k }

  2   RT := {u ∈ V2 | degree(u) ≤ degree(v ), ∀v ∈ V2 }
  3   maxdist := 1
  4   While (maxdist = 1) do
       1 T :=
          {(u, v ) | (u, v ) ∈ LT × RT dist(u, v ) ≥ dist(x , y )∀(x , y ) ∈ LT × RT }
       2 dmin := degree(u), where u ∈ RT
       3 maxdist := dist(u, v ), where (u, v ) ∈ T
       4 if (maxdist = 1) then RT := {u ∈ V2 | degree(u) = dmin + 1}

  5   E := E ∪ (u, v ), where (u, v ) ∈ T



                http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Generation of hard k-SAT or n-ary CSP instances


k-SAT
Build a k-SAT formula F from a literal incidence graph LG(F ) using
the previous algorithm. Parameters: k, |C| y |V |

We use the literal incidence graph, because we compare our model
with previous models that balance the ocurrences of literals, and
expansion c in LG(F ) assures, at least, expansion c/2 in G(F )

n-ary CSP
Build a n-ary CSP instance P from a literal incidence graph LG(P)
using the previous algorithm. Parameters: arity, |V |, |D| y |NG|



              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Esquema



1   Introduction


2   Previous Results


3   Generation Model


4   Empirical Results




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Empirical comparison

We compare our high-girth model, against previous models for k-SAT
and CSP
k-SAT

    Random k-SAT:
    Balanced model 1: (Bayardo et al.)
    Balanced model 2: (Boufkhad et al.)


CSP
model E: select uniformly at random the set of |NG| nogoods for P,
from the set of possible nogoods of arity k with |V | variables and
domain |D|


              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
                                   Intro Background        Generation Results                                                  CP’08, Sydney

Results - k-SAT


Random and balanced models versus high girth model
                                             V130 4-SAT kcnfs                                             V116 5-SAT kcnfs
                                                                                                 5
                         250                                                            1.5×10
                                                              Bipart. High Girth                                       Bipart. High Girth
                         200                                  Lit-bal-1                                                Lit-bal-1
 Median Time (seconds)




                                                              Lit-bal-2
                                                                                                 5
                                                              Random                       10
                         150


                         100
                                                                                                 4
                                                                                         5×10

                         50


                           0                                                                 0
                               8    8.5       9      9.5        10       10.5      11                17    18          19           20
                                             Ratio clauses/vars                                           Ratio clauses/vars




                                          http://ai.udl.cat          Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Results - k-SAT with Local Search
5-SAT using WalkSAT




                                                  70 Variables
                  50 most           high girth       lit-bal-1 random
                   w-best            1000/-          0.12/29   0.08/27
                  w-novelty          83.9/21        0.055/45 0.03/41

                                                  90 Variables
                  50 most           high girth      lit-bal-1  random
                   w-best            1000/-         0.17/29 0.075/27
                  w-novelty         76,57/15        0.06/47    0.04/47

                         Median time / best noise parameter.
                                Using WalkSAT v46.




              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
        Intro Background     Generation Results                                      CP’08, Sydney

Results - Expansion


  Expansion for maximal (|L|/3) left subsets of the literal incidence
graph (C ∪ L, E ) for 3SAT instances with 330 variables in the peak of
                               hardness
                                           C=1160             C=1420
                                          g |N(S)|           g |N(S)|
                         random           4   272.6          4 287.7
                         lit-bal-1        4   272.8          4 288.2
                         lit-bal-2        4   272.1          4 287.3
                        high girth       10 283.9            8 303.0

Our model is almost as balanced as the previous ones, but expansion
is higher !


              http://ai.udl.cat    Hard SAT and CSP instances with Expander Graphs
                                   Intro Background     Generation Results                                                        CP’08, Sydney

Results - CSP


Random versus high girth model
                                               V40 D3 3-arity                                                V25 D3 4-arity
                        100                                                            100
Median Time (seconds)




                        10                                                             10                                        HG Minion-sdf
                                                                                                                                 Rand Minion-sdf
                                                                HG Minion-sdf                                                    HG Kcnfs
                                                                Rand Minion-sdf                                                  Rand Kcnfs
                                                                HG Kcnfs                                                         HG Minisat
                                                                Rand Kcnfs                                                       Rand Minisat
                          1                                     HG Minisat               1
                                                                Rand Minisat




                        0.1                                                            0.1
                              20          25           30          35             40         50   60   70       80     90     100      110 120
                                           Ratio nogoods/vars                                               Ratio nogoods/vars




                                         http://ai.udl.cat      Hard SAT and CSP instances with Expander Graphs

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:2
posted:3/27/2010
language:English
pages:23
Description: Hard SAT and CSP instances with Expander Graphs