120 likes | 239 Views
Making Path-Consistency Stronger for SAT. Pavel Surynek Faculty of Mathematics and Physics Charles University in Prague Czech Republic. Outline of the talk. Motivation SAT problems Constraint model of SAT and Path-consistency Modification of Path-consistency
E N D
Making Path-Consistency Stronger for SAT Pavel SurynekFaculty of Mathematics and PhysicsCharles University in PragueCzech Republic
Outline of the talk • Motivation • SAT problems • Constraint model of SAT andPath-consistency • Modification of Path-consistency • Complexity and propagation algorithm • Experimental evaluation • propagation strength comparison • comparison on SAT preprocessing Pavel Surynek CSCLP 2008
Motivation • Local consistencies • local inference often too weak for SAT • arc-consistency, path-consistency, i,j-consistency • insignificant gain in comparison with unit-propagation • expensive propagation w.r.t. inference strength • Global consistencies (global constraints) • strong global inference • often significant simplification of the problem • no explicit global constraints in SAT • Consistency based on structural properties • exploit structure for global propagation in SAT Pavel Surynek CSCLP 2008
Boolean Satisfaction Problem (SAT) • A Boolean formula is given - variables can take either a value true or false • The task is to find valuation of variables such that the formula is satisfied • or decide that no such valuation exists • Conjunctive normal form (CNF) - standard form of the input formula • variables: x1,x2,x3,... • literals: x1,x1,x2,x2, ... variable or its negation • clauses: (x1 x2 x3) ... disjunction of literals • formula: (x1 x2) (x1 x2 x3) ... conjunction of clauses • example: (x y) (x y) example: x = true y = false example: p cnf 3 2 1 -2 0 1 2 -3 0 ... Pavel Surynek CSCLP 2008
x1 V x2 x1 V x2 x2 V x3 x3 V x1 x2 V x3 x3 V x1 x2 x3 x2 x3 x1 x1 x1 x3 x3 x2 x2 V(x1 x2) x1 Constraint Model for SAT • example: V(x1 x2),V(x1 x2), ... • SAT as CSP: Literal encoding model (X,D,C) • X ... variables ↔ clauses • D ... variable domains ↔ literals • C ... constraints ↔ values standing for complementary literals are forbidden • Consider SAT CSP model as an undirected graph • vertices ↔ values in domains, edges ↔ allowed pairs of values (not all shown in the example) • example: V(x1 x2){x1, x2} • example: V(x1 x2) = x1 and V(x1 x2)= x1is forbidden Pavel Surynek CSCLP 2008
x1 V x2 x1 V x2 x2 V x3 x3 V x1 x2 V x3 x3 V x1 x2 x3 x3 x2 x1 x1 x1 x3 x3 x2 x2 x1 Path-Consistency for SAT:a graph interpretation • Let us have a sequence of variables (path) • pair of values is path-consistent w.r.t. to the sequence if there is a path between them in the graph that uses the edges between neighboring variables in the sequence • Ignores constraints not between variables neighboring in the sequence of variables Pavel Surynek CSCLP 2008
path ending in this vertex must not visit L1 more than two times x1 V x2 x1 V x2 x2 V x3 x3 V x1 x2 V x3 x3 V x1 L1 2 2 2 2 1 1 x2 x3 x2 x3 x1 2 2 1 2 L2 2 1 x1 x1 x3 x3 x2 x2 x1 Modified Path-Consistency for SAT • Deduce more information from constraints • decompose values into disjoint sets (called layers ... L1, L2,...) • deduce more information from constraints - calculate maximum numbers of visits by a path in layers • Stronger restriction on paths → stronger propagation Pavel Surynek CSCLP 2008
1 1 1 (v1,v2) (v1,v1) (v1,vn) L1 ... L2 1 1 1 (v2,v2) (v2,v1) ... (v2,vn) ... ... ... (vi,vk) {vi,vj}E (vj,vk+1) 1 1 1 (vn,v1) ... (vn,vn) Ln (vn,v2) NP-Completeness of Modified Path-Consistency • Enforcing modified path-consistency is difficult(NP-complete) • Theorem: Existence of a Hamiltonian path in a graph is reducible to the existence of the path respecting maximum numbers of visits. • Main idea of the proof: G=(V,E), where V={v1,v2,...,vn} Pavel Surynek CSCLP 2008
Approximation Algorithm • We need to relax from the exact enforcing the modified path-consistency • We use a variant of Dijkstra’s single-source shortest path algorithm • for each vertex we calculate the lower bound of number of visits in layers • if the lower bound of visits in Lifor the vertex x is k then every path starting in the original vertex and ending in x visits Li at least k-times • lower bounds allow us to check violation of the maximum number of visits → some paths may become forbidden Pavel Surynek CSCLP 2008
Experimental Evaluation:propagation strength of PC and MPC • Comparison of the number of filtered pairs of values • several benchmarkproblems from the SAT Library • comparison of PC and modified PC enforced by approximation algorithm • on some problems modified PC is significantly stronger • times were slightly higher for modified PC Pavel Surynek CSCLP 2008
Experimental Evaluation:PC and MPC on SAT preprocessing • Improvement ratio gained by preprocessing of SAT problems by modified PC in comparison with PC • the number of decision steps was measured • on some problems modified PC has a good effect Pavel Surynek CSCLP 2008
Conclusions and Future Work • We proposed a modified variant ofpath-consistency • We are trying to exploit global structural properties of the problem • Experimental evaluation indicates some advantages of modified path-consistency in comparison with the standard version • There are still many open questions for future work: • experimental evaluation on standard CSPs • more competitive evaluation with SAT solvers • better approximation algorithm, tractable cases Pavel Surynek CSCLP 2008