Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey
Symmetries and Lazy Clause Generation Outline Definitions: CSP, symmetries, nogoods Symmetry Breaking During Search (SBDS) Lazy Clause Generation & 1UIP nogoods Can we combine them? -> SBDS-1UIP Experiments
CSP and Symmetries Constraint Satisfaction Problem (V, D, C) A set of variables V, a set of domains D, a set of constraints C An assignment is a solution if it satisfies all constraints A symmetry is a bijective mapping from assignments to assignments which preserves solutions, i.e., is a solution iff ( ) is a solution
Nogood A constraint n of form: l 1 /\... /\ l n → false Implied by original problem, i.e. C => n Used as a clausal propagator to reduce search If n-1 literals are true given current domain, then propagates to set last literal false
Symmetry Breaking During Search A dynamic symmetry breaking technique Reduce search by preventing solver from exploring nodes that are symmetric to previously explored nodes Can be thought of in terms of symmetric nogoods Suppose decisions d 1, d 2, …, d n lead to failure –Decision nogood: d 1 /\ … /\ d n → false Suppose is a symmetry –Symmetric nogood: (d 1 ) /\ … /\ (d n ) → false is also valid
Symmetry Breaking During Search (2) x 1 + x 2 + x 3 <= 5, alldiff(x 1, x 2, x 3 ), x i {1,2,3} Nogood: [x 1 = 1] /\ [x 2 = 2] → false Since all variables are symmetric, we also have: –[x 1 = 1] /\ [x 3 = 2] → false –[x 2 = 1] /\ [x 1 = 2] → false, etc SBDS adds: (d 1 ) /\ … /\ (d n ) → false as a local constraint Prevents any symmetric partial assignment from being explored
1UIP nogood SAT and LCG solvers do not use decision nogoods They use First Unique Implication Point (1UIP) nogood Empirically, 1UIP nogoods found to be much stronger than dec nogoods (in non-symmetric case) Key Idea: use 1UIP nogoods (SBDS-1UIP) instead of decision nogoods (SBDS-DEC) in SBDS
Lazy Clause Generation Instrument propagators to explain each propagation e.g. x != y: [x = 3] → [y != 3] e.g. x = 3] → [y >= 3] Explanations form an implication graph When conflict occurs, analyse implication graph Resolve explanation clauses together to derive a new nogood
1UIP Nogood Start with conflict clause While more than one literal from the last decision level remain, use resolution to eliminate the last one inferred –Suppose a /\ l 1 /\ … /\ l n → false is current nogood –Want to eliminate a –Get the explanation for a: k 1 /\ … /\ k m → a –Resolve to get: k 1 /\ … /\ k m /\ l 1 /\ … /\ l n → false
SBDS-1UIP vs SBDS-DEC SBDS-DEC is a complete method: –Once we have visited some partial assignment d 1,..., d n, any partial assignment containing a symmetric version will be pruned Theorem: SBDS-1UIP also guarantees this, given that the propagation engine p is: –Monotonic, i.e., if D' => D, then p(D') => p(D) –Symmetric, i.e., p(σ(D)) σ(p(D)) Proof: –Let n 1UIP ≡ (l 1 /\... /\ l m → false) be nogood from d 1,..., d n –We have: p(d 1 /\... /\ d n ) => l 1 /\... /\ l m –Suppose D => σ(d 1 ) /\... /\ σ(d n ) –Then p(D) => σ(l 1 ) /\... /\ σ(l m ), so D is pruned by σ(n 1UIP )
SBDS-1UIP Example 5-colour this graph (value sym) Already coloured x 1, x 2, x 3, x 4, x 5 Some values knocked out
SBDS-1UIP Example (2) Set: x 6 = 1
SBDS-1UIP Example (3) Set: x 7 = 2
SBDS-* 1UIP nogood: –[x 8 != 1] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 1] /\ [x 9 != 4] /\ [x 9 != 5] → [x 7 != 2] Decision nogood: –[x 1 = 1] /\ [x 2 = 2] /\ [x 3 = 3] /\ [x 4 = 4] /\ [x 5 = 5] /\ [x 6 = 1] → [x 7 != 2] SBDS-1UIP uses symmetry 2 ↔ 3 to get: –[x 8 != 1] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 1] /\ [x 9 != 4] /\ [x 9 != 5] → [x 7 != 3] Which immediately prunes 3 from x 7 ’s domain. SBDS-DEC cannot do this!
SBDS-1UIP Example (4) Add in nogoods, backtrack, and propagate: [x 8 != 1] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 1] /\ [x 9 != 4] /\ [x 9 != 5] → [x 7 != 2] [x 8 != 1] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 1] /\ [x 9 != 4] /\ [x 9 != 5] → [x 7 != 3] Conflict again!
SBDS-* (2) 1UIP: [x 7 != 4] /\ [x 7 != 5] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 4] /\ [x 9 != 5] → [x 6 != 1] DEC: [x 1 = 1] /\ [x 2 = 2] /\ [x 3 = 3] /\ [x 4 = 4] /\ [x 5 = 5] → [x 6 != 1] SBDS-1UIP uses symmetry 1 ↔ 2 and 1 ↔ 3 to get: [x 7 != 4] /\ [x 7 != 5] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 4] /\ [x 9 != 5] → [x 6 != 2] [x 7 != 4] /\ [x 7 != 5] /\ [x 8 != 4] /\ [x 8 != 5] /\ [x 9 != 4] /\ [x 9 != 5] → [x 6 != 3] Which immediately prunes 2 and 3 from x 6 ’s domain. SBDS-DEC again cannot do this!
Search Tree SBDS-DEC –10 nodes –6 failures SBDS-1UIP –3 nodes –2 failures
Other symmetry breaking methods? Can any other method exploit symmetries 1 ↔ 2 and 1 ↔ 3 here? SBDD also uses decision nogoods, so can't Static lex sym break is: min{i | x_i = 1} <... < min(i | x_i = 5}, can't since all 5 values already used, so constraint already satisfied Conditional symmetries can’t since 1 ↔ 2, 1 ↔ 3 are not symmetries of this subproblem (due to x 10 's domain) SBDS-1UIP can because 1UIP nogoods tells us exactly which vars involved in conflict, and 1 ↔ 2 and 1 ↔ 3 hold over x 6, x 7, x 8, x 9
Beyond complete?! SBDS-DEC, SBDD, Lex are all complete sym break methods for this example, i.e. for each set of symmetric assignments (an orbit), all but one assignment is pruned How can SBDS-1UIP be stronger?? With SBDS-DEC, SBDD, Lex, solver must visit at least one assignment in each orbit With SBDS-1UIP it does not necessarily have to! –Used failure of x 1 = 1, x 2 = 2, x 3 = 3, x 4 = 4, x 5 = 5, x 6 = 1 to prune x 1 = 1, x 2 = 2, x 3 = 3, x 4 = 4, x 5 = 5, x 6 = 2 –Can correctly perform "cross orbital" pruning –Can wipe out entire orbit without examining any member
Experimental Results Concert Hall Problem and the Graph Colouring Problem Both have variable and value symmetries Implemented SBDS in state of the art lazy clause solver Chuffed Show results for no sym break, SBDS-DEC and SBDS- 1UIP on Chuffed
Concert Hall SizeNo Sym BreakSBDS-DECSBDS-1UIP TimeFailsTimeFailsTimeFails timeout timeout timeout timeout
Graph Colouring Uniform SizeNo Sym BreakSBDS-DECSBDS-1UIP TimeFailsTimeFailsTimeFails
Graph Colouring Biased SizeNo Sym BreakSBDS-DECSBDS-1UIP TimeFailsTimeFailsTimeFails
Conclusion We combined SBDS and LCG Key Idea: use 1UIP nogoods in SBDS instead of decision nogoods SDBS-1UIP is at least as strong as SBDS-DEC Can be strictly stronger on some problems Can exploit types of symmetries that no other general method we are aware of can exploit Future Work: Try other kinds of nogoods in SBDS? What is the theoretical limit of the power of sym break? Completeness is apparently not the limit!
Thank you for listening!