Presentation is loading. Please wait.

Presentation is loading. Please wait.

Problem (hard) Solution CNF Satisfied assignment Encoding FINITE DOMAIN PROBLEM SOLVING Model Constraint Model Direct Constraint / Bits relation lost.

Similar presentations


Presentation on theme: "Problem (hard) Solution CNF Satisfied assignment Encoding FINITE DOMAIN PROBLEM SOLVING Model Constraint Model Direct Constraint / Bits relation lost."— Presentation transcript:

1

2 Problem (hard) Solution CNF Satisfied assignment Encoding FINITE DOMAIN PROBLEM SOLVING Model Constraint Model Direct Constraint / Bits relation lost Large CNF CSP solving Model Solution Translate Decoding SAT solving

3 Constraint Model Simplified CNF Encoding CNF Simplify Simplified Model Encoding OPTIMIZED SAT ENCODING CNF’’ Problems: Constraint / Bits relation lost Large CNF CNF’ Partial Evaluation Tools such as: SatELite, ReVivAl Based on Unit Propagation and Resolution. Simplified Model’ Encoding Partial Evaluation using Equi-Propagation

4 OUR APPROACH Constraint ( C 1, B 1 ) … M = Constraint ( C 1, B 1 ) Constraint ( C’ 3, B‘ 3 ) Constraint ( C’ n, B’ n ) … M’ = φ = Simplify CSP techniques Encoding Boolean techniques Constraint ( C 2, B 2 ) Constraint ( C 3, B 3 ) Constraint ( C n, B n ) Constraint ( C 2, B 2 ) φ1φ1 φ' 3 φ' n … Equi-Propagation Standard encodings

5 OUTLINE  Modeling Finite Domain CSP  Equi-Propagation  Experimentation  Conclusions

6 MODELING FINITE DOMAIN CSP representing numbers (integers) BinaryUnaryOrder encoding x i ↔ (X ≥ i) (X = 3) = [1,1,1,0,0] Direct encoding x i ↔ (X = i) (X = 3) = [0,0,0,1,0,0] SMALL

7 WHY ORDER ENCODING ? X ij X ≥ iX < j 1 0 good for representing ranges X u v i good for arbitrary sets good for arithmetic operations with constants: + 3 = * 3 = div 3 = aaabbbcccacbacbcf111cbacbafedg ab c d efg b=c e=f=g

8 x= -y, x=y, x=0, x=1 single EQUI-PROPAGATION Equi-propagation is the process of inferring new equational consequences from a constraint in the model (and other existing equational information). x can now be removed from all constraints.

9 diff(U1,U2) U1 { 0..4 } U1 = [x1,x2,x3,x4] U2 { 0..4 } U2 = [y1,y2,y3,y4] Xs = [a,d,b,x3,y2,c,y4] EQUI-PROPAGATION EXAMPLE sumBits(Xs)=3Constraints …… Simplify U1 { 1,3 } U1 = [1,x2,x2,0] U2 { 1,3 } U2 = [1,y2,y2,0] Xs = [a,1,b,x2,y2,c,0] U1 { 1,3 } U1 = [1,x2,x2,0] U2 { 1,3 } U2 = [1,-x2,-x2,0] Xs = [a,1,b,x2,-x2,c,0] Partial Data: φsumBits([a,b,c])=1φConstraints …… diff(U1,U2) 1≤U1≤3 and U1 ≠ 2 1≤U2≤3 and U2 ≠ 2 d = 1 Learned: Simplify Encoding x1=1, x3=x2, x4=0 y1=1, y3=y2, y4=0 d = 1 U1 ≠ U2 (y2= -x2) … sumBits([a,b,c])=1 Constraints

10 EQUI-PROPAGATION  A complete equi-propagator for a constraint can be implemented using binary decision diagrams (BDDs) and can be evaluate in polynomial time. When C(X1,…,Xk) a constraint about (fixed) “k” integers with n bits each, the BDD representing it is of size O(n^k)  Global constraints (such as allDiff) implemented using Ad-Hoc rules.  There is a strong connection between Simplify and Encoding because Simplify done on the “encoding bits” and might change the encoding accordingly.

11 Kakuro QCP / Sudoku BIBD Nonograms Graph Crossing N-Queens Magic Square MAS SCM / MCM System Diagnostic Protein folding

12 BALANCED INCOMPLETE BLOCK DESIGNS (BIBD) Definition: a 5-tuple of positive integers and require to partition v distinct objects into b blocks such that each block contains k different objects, exactly r objects occur in each block, and every two distinct objects occur in exactly l blocks. Variables: B 11, …, B bv Domains: B ij {0,1} Constraints: each row constraint: sum(B i1,…,B iv ) = r each column constraint: sum(B 1i,…,B bi ) = k each two rows constraint: sum(B i1 *B j1, …,B iv *B jv )= l BIBD b=10 v=6

13 We can swap between two rows or two columns to generate another valid solution. BALANCED INCOMPLETE BLOCK DESIGNS (BIBD) k r r- ll

14 BIBD – BEE VS SUGAR Sugar (v1.14.7) (SymB)BEE (SymB)instance SAT (sec.) CNF size (clauses) generate (sec.) SAT (sec.) CNF size (clauses) compile (sec.) 8.99160783039.361.234941311.34 13.24248813612.011.736985791.65 36.43275311311.7413.6012119413.73 0.01371631.910.0000.02 1.8754008923.580.39815630.56 2.2662377364.810.561094420.81 0.429338816.020.06245940.10 --∞0.171130530.34 8.5256900742.651.33920590.64 ∞4660864.248.461160160.51 (CSP to CNF Encoder) Faster SAT solving time Smaller CNF Faster time to generate CNF

15 BIBD – BEE VS SATELITE SatELite (SymB)BEE (SymB)instance SAT (sec.) CNF size (clauses) preprocs (sec.) SAT (sec.) CNF size (clauses) compile (sec.) 1.655661911.271.234941311.34 2.188025761.671.736985791.65 5.1813971882.7313.6012119413.73 0.0000.010.0000.02 0.20795421.020.39815630.56 0.351052421.140.561094420.81 0.05238281.20.06245940.10 0.1411186910.450.171130530.34 8.93976231.011.33920590.64 ∞1341460.648.461160160.51 (CNF-Level preprocessor) Solving time About the same size Preprocess time

16 CONCLUSIONS  When encoding CSP model to SAT holding both representation for each constraint gives the ability to apply simplify techniques from both worlds on each constraint.  Apply complete CNF simplification on each constraint is possible in polynomial time.  By using the Equi-Propagation technique we generates a small optimized CNF which than can be simplify using CNF-Level simplifications. Constraint Model Simplified CNF EncodingCNF Simplified Model Encoding CNF’’ CNF’ Partial Evaluation Simplified Model Encoding Partial Evaluation using Equi-Propagation Constraint ( C1, φ 1 ) … M = Constraint ( C1, φ 1 ) Constraint ( C’3, φ‘ 3 ) Constraint ( C’n, φ’ n ) … M’ = Simplify CSP techniques Boolean techniques Constraint ( C2, φ 2 ) Constraint ( C3, φ 3 ) Constraint ( Cn, φ n ) Constraint ( C2, φ 2 ) Equi-Propagation

17 Questions ?

18 BIBD – BEE + SATELITE SatELite (SymB)BEE (SymB)instance SAT (sec.) CNF size (clauses) preprocs (sec.) SAT (sec.) CNF size (clauses) compile (sec.) 0.834875231.431.234888911.34 1.396905961.861.736923611.65 4.1812014393.1613.6012037583.73 0.00-- 00.02 0.11629690.840.39649680.56 0.20840571.000.56873330.81 0.05240071.150.06249120.10 0.1310793611.400.171091210.34 1.87854260.921.33863310.64 2.311153410.668.461154210.51 (CNF-Level preprocessor)

19 MINION v0.10BEE (SymB)instance SymB+ (sec.) SymB (sec.) [M’06] (sec.) SAT (sec.) CNF size (clauses) compile (sec.) 0.381.120.471.234941311.34 0.421.360.541.736985791.65 0.521.770.6613.6012119413.73 0.150.671.260.0000.02 0.311.4212.220.39815630.56 0.3513.40107.430.561094420.81 0.311.37∞0.06245940.10 0.351.71∞0.171130530.34 0.92∞∞1.33920590.64 75.87∞∞8.461160160.51 BIBD – BEE VS MINION (Constraint solver) Modeling control

20 NONOGRAMS Definition: an nXm board of cells to color black or white and given clues per row and column of a board. A clue is a number sequence indicating blocks of cells to be colored black. Variables: B 11, …, B nm R 11,…R 1k,…,R m1,…R mp C 11,…C 1q,…,C n1,…,C nr Domains: B ij {0,1} R mo {0,..,n} C no {0,..,m} Constraints: block constraint: block(R ij,R ij +,[B 1i,…,B ni ]) space constraint: block(R ij +,R ij+1,[-B 1i,…,-B ni ]) no overlap constraint: leq(R ij + +1, R ij+1 )

21 NONOGRAMS There are dedicates solvers such as Jan Wolter's pbnsolve (http://webpbn.com/pbnsolve.html)http://webpbn.com/pbnsolve.html Ben-Gurion University Solver (http://www.cs.bgu.ac.il/~benr/nonograms/)http://www.cs.bgu.ac.il/~benr/nonograms/ BEE is faster than the dedicated solvers on the hard puzzles. 5,000 random 30x30 puzzles Selected human puzzles


Download ppt "Problem (hard) Solution CNF Satisfied assignment Encoding FINITE DOMAIN PROBLEM SOLVING Model Constraint Model Direct Constraint / Bits relation lost."

Similar presentations


Ads by Google