maximum density still life symmetries and lazy clause generation geoffrey chu, maria garcia de la...

25
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Upload: harry-lyons

Post on 19-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Maximum Density Still Life

Symmetries and Lazy Clause Generation

Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Page 2: 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

Page 3: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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

Page 4: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Nogood

• A constraint n of form: l1 /\ ... /\ ln → 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

Page 5: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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 d1, d2, …, dn lead to failure

– Decision nogood: d1 /\ … /\ dn → false

• Suppose is a symmetry

– Symmetric nogood: (d1) /\ … /\ (dn) → false is also valid

Page 6: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Symmetry Breaking During Search (2)

• x1 + x2 + x3 <= 5, alldiff(x1, x2, x3), xi {1,2,3}

• Nogood: [x1 = 1] /\ [x2 = 2] → false

• Since all variables are symmetric, we also have:

– [x1 = 1] /\ [x3 = 2] → false

– [x2 = 1] /\ [x1 = 2] → false, etc

• SBDS adds: (d1) /\ … /\ (dn) → false as a local constraint

• Prevents any symmetric partial assignment from being explored

Page 7: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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

Page 8: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Lazy Clause Generation

• Instrument propagators to explain each propagation

• e.g. x != y: [x = 3] → [y != 3]

• e.g. x <= y: [x >= 3] → [y >= 3]

• Explanations form an implication graph

• When conflict occurs, analyse implication graph

• Resolve explanation clauses together to derive a new nogood

Page 9: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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 /\ l1 /\ … /\ ln → false is current nogood

– Want to eliminate a

– Get the explanation for a: k1 /\ … /\ km → a

– Resolve to get: k1 /\ … /\ km /\ l1 /\ … /\ ln → false

Page 10: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-1UIP vs SBDS-DEC

• SBDS-DEC is a complete method:

– Once we have visited some partial assignment d1,..., dn, 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 n1UIP ≡ (l1 /\ ... /\ lm → false) be nogood from d1,..., dn

– We have: p(d1 /\ ... /\ dn) => l1 /\ ... /\ lm

– Suppose D => σ(d1) /\ ... /\ σ(dn)

– Then p(D) => σ(l1) /\ ... /\ σ(lm), so D is pruned by σ(n1UIP)

Page 11: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-1UIP Example

• 5-colour this graph (value sym)

• Already coloured x1, x2, x3, x4, x5

• Some values knocked out

Page 12: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-1UIP Example (2)

Set: x6 = 1

Page 13: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-1UIP Example (3)

Set: x7 = 2

Page 14: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-*

• 1UIP nogood: – [x8 != 1] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 1] /\ [x9 != 4] /\ [x9 != 5] → [x7 != 2]

• Decision nogood:– [x1 = 1] /\ [x2 = 2] /\ [x3 = 3] /\ [x4 = 4] /\ [x5 = 5] /\ [x6 = 1] → [x7 != 2]

• SBDS-1UIP uses symmetry 2 ↔ 3 to get: – [x8 != 1] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 1] /\ [x9 != 4] /\ [x9 != 5] → [x7 != 3]

• Which immediately prunes 3 from x7’s domain.

• SBDS-DEC cannot do this!

Page 15: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-1UIP Example (4)

• Add in nogoods, backtrack, and propagate:• [x8 != 1] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 1] /\ [x9 != 4] /\ [x9 != 5] → [x7 != 2]

• [x8 != 1] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 1] /\ [x9 != 4] /\ [x9 != 5] → [x7 != 3]

• Conflict again!

Page 16: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

SBDS-* (2)

• 1UIP: [x7 != 4] /\ [x7 != 5] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 4] /\ [x9 != 5] → [x6 != 1]

• DEC: [x1 = 1] /\ [x2 = 2] /\ [x3 = 3] /\ [x4 = 4] /\ [x5 = 5] → [x6 != 1]

• SBDS-1UIP uses symmetry 1 ↔ 2 and 1 ↔ 3 to get:

• [x7 != 4] /\ [x7 != 5] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 4] /\ [x9 != 5] → [x6 != 2]

• [x7 != 4] /\ [x7 != 5] /\ [x8 != 4] /\ [x8 != 5] /\ [x9 != 4] /\ [x9 != 5] → [x6 != 3]

• Which immediately prunes 2 and 3 from x6’s domain.

• SBDS-DEC again cannot do this!

Page 17: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Search Tree

• SBDS-DEC

– 10 nodes

– 6 failures

• SBDS-1UIP

– 3 nodes

– 2 failures

Page 18: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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 x10's domain)

• SBDS-1UIP can because 1UIP nogoods tells us exactly which vars involved in conflict, and 1 ↔ 2 and 1 ↔ 3 hold over x6, x7, x8, x9

Page 19: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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 x1 = 1, x2 = 2, x3 = 3, x4 = 4, x5 = 5, x6 = 1 to prune x1 = 1, x2 = 2, x3 = 3, x4 = 4, x5 = 5, x6 = 2

– Can correctly perform "cross orbital" pruning

– Can wipe out entire orbit without examining any member

Page 20: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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

Page 21: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Concert Hall

Size No Sym Break SBDS-DEC SBDS-1UIP

Time Fails Time Fails Time Fails20 259.8 686018 0.07 350 0.04 84

22 381.5 749462 0.17 1207 0.07 181

24 576.9 1438509 0.78 3426 0.10 275

26 483.4 1189930 2.26 5605 0.10 282

28 530.7 1282797 3.64 10530 0.68 1611

30 581.3 1251980 19.52 48474 0.27 761

32 542.4 936019 21.48 65157 0.40 1522

34 timeout 1039051 19.86 48837 1.10 2636

36 timeout 1223864 59.70 131142 1.40 3156

38 timeout 1027778 82.77 178170 1.91 5053

40 timeout 1447604 102.1 219454 2.96 6648

Page 22: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Graph Colouring Uniform

Size No Sym Break SBDS-DEC SBDS-1UIP

Time Fails Time Fails Time Fails30 140.7 282974 0.26 3049 0.01 14

32 211.4 390392 0.24 3677 0.01 17

34 213.9 272772 3.53 19975 0.01 25

36 195.9 296358 6.91 23842 0.01 36

38 224.0 297138 23.55 69480 0.01 55

40 250.9 423326 21.07 78918 0.01 83

Page 23: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Graph Colouring Biased

Size No Sym Break SBDS-DEC SBDS-1UIP

Time Fails Time Fails Time Fails20 13.25 39551 0.01 639 0.01 27

22 11.53 63984 0.02 727 0.01 25

24 66.60 154409 0.07 1992 0.01 35

26 74.77 277290 0.12 3385 0.01 55

28 130.5 280649 0.58 6402 0.01 62

30 267.6 480195 10.48 44385 0.01 101

32 331.7 600772 9.98 44216 0.01 232

34 219.9 387213 10.26 47470 0.20 806

36 442.6 709888 27.39 113252 0.01 317

38 382.5 631403 31.63 138787 0.10 798

40 465.6 531285 24.68 91847 0.02 410

Page 24: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

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!

Page 25: Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey

Thank you for listening!