Optimising Quantified Expressions in Constraint Models Ian P. Gent, - - PowerPoint PPT Presentation

optimising quantified expressions in constraint models
SMART_READER_LITE
LIVE PREVIEW

Optimising Quantified Expressions in Constraint Models Ian P. Gent, - - PowerPoint PPT Presentation

Optimising Quantified Expressions Optimising Quantified Expressions in Constraint Models Ian P. Gent, Ian Miguel and Andrea Rendl University of St Andrews, UK AIT Austrian Institute of Technology, Austria September 2010 Workshop on Modelling


slide-1
SLIDE 1

Optimising Quantified Expressions

Optimising Quantified Expressions in Constraint Models

Ian P. Gent, Ian Miguel and Andrea Rendl

University of St Andrews, UK AIT Austrian Institute of Technology, Austria

September 2010 Workshop on Modelling and Reformulation

slide-2
SLIDE 2

Optimising Quantified Expressions

Context of this Work

Quantified expressions in solver-independent constraint modelling languages

slide-3
SLIDE 3

Optimising Quantified Expressions

Context of this Work

Quantified expressions in solver-independent constraint modelling languages Example: forall i,j:int(1..n) . (i=j) ⇒ (q[i]-i = q[j]-j)

slide-4
SLIDE 4

Optimising Quantified Expressions

Context of this Work

Quantified expressions in solver-independent constraint modelling languages Example: forall i,j:int(1..n) . (i=j) ⇒ (q[i]-i = q[j]-j) powerful means to compactly represent a set of expressions

slide-5
SLIDE 5

Optimising Quantified Expressions

Context of this Work

Quantified expressions in solver-independent constraint modelling languages Example: forall i,j:int(1..n) . (i=j) ⇒ (q[i]-i = q[j]-j) powerful means to compactly represent a set of expressions same structure in all constraint modelling languages

slide-6
SLIDE 6

Optimising Quantified Expressions

Context of this Work

Quantified expressions in solver-independent constraint modelling languages Example: forall i,j:int(1..n) . (i=j) ⇒ (q[i]-i = q[j]-j) powerful means to compactly represent a set of expressions same structure in all constraint modelling languages

restriction: no decision variables in i1, . . . , im and int(lb..ub)

slide-7
SLIDE 7

Optimising Quantified Expressions

Goal and Contributions

Our Observation: quantified expressions can contain redundancies, often when formulated by novices

slide-8
SLIDE 8

Optimising Quantified Expressions

Goal and Contributions

Our Observation: quantified expressions can contain redundancies, often when formulated by novices Our Goal: automatically improve poorly formulated quantified expressions

slide-9
SLIDE 9

Optimising Quantified Expressions

Goal and Contributions

Our Observation: quantified expressions can contain redundancies, often when formulated by novices Our Goal: automatically improve poorly formulated quantified expressions Our Contributions:

we consider 2 kinds of redundancies

slide-10
SLIDE 10

Optimising Quantified Expressions

Goal and Contributions

Our Observation: quantified expressions can contain redundancies, often when formulated by novices Our Goal: automatically improve poorly formulated quantified expressions Our Contributions:

we consider 2 kinds of redundancies we propose means to detect and address those redundancies

slide-11
SLIDE 11

Optimising Quantified Expressions Loop-invariant Expressions

1 Loop-invariant Expressions 2 Weak Guards 3 Summary

slide-12
SLIDE 12

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Idea: analyse equivalent representations of quantified expressions

slide-13
SLIDE 13

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Idea: analyse equivalent representations of quantified expressions Example: (x = 0) ⇒ ∀i∈D. (x[i] = i)

slide-14
SLIDE 14

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Idea: analyse equivalent representations of quantified expressions Example: (x = 0) ⇒ ∀i∈D. (x[i] = i) ≡ ∀i∈D. (x = 0) ⇒ (x[i] = i)

slide-15
SLIDE 15

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Idea: analyse equivalent representations of quantified expressions Example: (x = 0) ⇒ ∀i∈D. (x[i] = i) ≡ ∀i∈D. (x = 0) ⇒ (x[i] = i) we call ‘(x = 0)’ loop-invariant

slide-16
SLIDE 16

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Idea: analyse equivalent representations of quantified expressions Example: (x = 0) ⇒ ∀i∈D. (x[i] = i) ≡ ∀i∈D. (x = 0) ⇒ (x[i] = i) we call ‘(x = 0)’ loop-invariant Question: which representation is better?

slide-17
SLIDE 17

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Many different cases....

1 A∧∀IEI

≡ ∀IA∧EI

slide-18
SLIDE 18

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Many different cases....

1 A∧∀IEI

≡ ∀IA∧EI

2 A∨∃IEI

≡ ∃IA∨EI

3 mA+

IEI

  • I A+EI

where m = |I|

4 A∨(∀IEI))

≡ ∀IA∨EI

5 etc

slide-19
SLIDE 19

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Many different cases....

1 A∧∀IEI

≡ ∀IA∧EI

2 A∨∃IEI

≡ ∃IA∨EI

3 mA+

IEI

  • I A+EI

where m = |I|

4 A∨(∀IEI))

≡ ∀IA∨EI

5 etc

Intuitively, we expect the outside-representation to be better...

slide-20
SLIDE 20

Optimising Quantified Expressions Loop-invariant Expressions

Loop-invariant Expressions

Many different cases....

1 A∧∀IEI

≡ ∀IA∧EI

2 A∨∃IEI

≡ ∃IA∨EI

3 mA+

IEI

  • I A+EI

where m = |I|

4 A∨(∀IEI))

≡ ∀IA∨EI

5 etc

Intuitively, we expect the outside-representation to be better... is this true for all cases?

slide-21
SLIDE 21

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

We compare representations at solver level (flat representation)

slide-22
SLIDE 22

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

We compare representations at solver level (flat representation) We assume the solver provides:

(reifyable) n-ary conjunction (∀) (reifyable) n-ary disjunction (∃) n-ary sum ()

slide-23
SLIDE 23

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

We compare representations at solver level (flat representation) We assume the solver provides:

(reifyable) n-ary conjunction (∀) (reifyable) n-ary disjunction (∃) n-ary sum ()

Let’s look at one case (see paper for other cases): A⇒(∀IEI) ≡ ∀IA⇒EI

slide-24
SLIDE 24

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation Outside-Representation Original (∀IA ⇒ EI) A ⇒ (∀IEI)

slide-25
SLIDE 25

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation Outside-Representation Original (∀IA ⇒ EI) A ⇒ (∀IEI) Unrolled (A ⇒ E1) ∧ A ⇒ (E1 ∧ · · · ∧ Ek) . . . (A ⇒ Ek)

slide-26
SLIDE 26

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation Outside-Representation Original (∀IA ⇒ EI) A ⇒ (∀IEI) Unrolled (A ⇒ E1) ∧ A ⇒ (E1 ∧ · · · ∧ Ek) . . . (A ⇒ Ek) Flat a ⇒ e1 aux ⇔ (e1 ∧ · · · ∧ ek) (unnested) . . . a ⇒ aux a ⇒ ek

slide-27
SLIDE 27

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation Outside-Representation Original (∀IA ⇒ EI) A ⇒ (∀IEI) Unrolled (A ⇒ E1) ∧ A ⇒ (E1 ∧ · · · ∧ Ek) . . . (A ⇒ Ek) Flat a ⇒ e1 aux ⇔ (e1 ∧ · · · ∧ ek) (unnested) . . . a ⇒ aux a ⇒ ek 0 auxiliary variables 1 auxiliary variable k constraints 2 constraints

slide-28
SLIDE 28

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation: more constraints (increasing with k), no additional variables

slide-29
SLIDE 29

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation: more constraints (increasing with k), no additional variables Outside-Representation: only two constraints but 1 additional variable

slide-30
SLIDE 30

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Representations

Inside-Representation: more constraints (increasing with k), no additional variables Outside-Representation: only two constraints but 1 additional variable Let’s compare the representations in an example!

slide-31
SLIDE 31

Optimising Quantified Expressions Loop-invariant Expressions

Example: Peaceful Army of Queens

Place two equally-sized armies of queens on a chess board such that they do not attack another, maximising the army size

slide-32
SLIDE 32

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Outside Representation

Non-attacking Constraints in model based on Smith et al (2004): forall fields(i,j) on the chess board.

slide-33
SLIDE 33

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Outside Representation

Non-attacking Constraints in model based on Smith et al (2004): forall fields(i,j) on the chess board. white queen at field(i,j) ⇒

slide-34
SLIDE 34

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Outside Representation

Non-attacking Constraints in model based on Smith et al (2004): forall fields(i,j) on the chess board. white queen at field(i,j) ⇒ forall k. no black queen at field(i,k) (same column)

slide-35
SLIDE 35

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Outside Representation

Non-attacking Constraints in model based on Smith et al (2004): forall fields(i,j) on the chess board. white queen at field(i,j) ⇒ forall k. no black queen at field(i,k) (same column) ∧ no black queen at field(k,j) (same row)

slide-36
SLIDE 36

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Outside Representation

Non-attacking Constraints in model based on Smith et al (2004): forall fields(i,j) on the chess board. white queen at field(i,j) ⇒ forall k. no black queen at field(i,k) (same column) ∧ no black queen at field(k,j) (same row) ∧ no black queen at field(i+k,j+k) (NW-diagonal) ∧ no black queen at field(i-k,j+k) (SW-diagonal) ∧ no black queen at field(i+k,j-k) (NE-diagonal) ∧ no black queen at field(i-k,j-k) (SE-diagonal)

slide-37
SLIDE 37

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Inside Representation

Alternatively, moving loop-invariant expression inside: forall fields(i,j) on the chess board.

slide-38
SLIDE 38

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Inside Representation

Alternatively, moving loop-invariant expression inside: forall fields(i,j) on the chess board. forall k. white queen at field(i,j) ⇒ no black queen at field(i,k) (column)

slide-39
SLIDE 39

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Inside Representation

Alternatively, moving loop-invariant expression inside: forall fields(i,j) on the chess board. forall k. white queen at field(i,j) ⇒ no black queen at field(i,k) (column) ∧ forall k. white queen at field(i,j) ⇒ ∧ no black queen at field(k,j) (row)

slide-40
SLIDE 40

Optimising Quantified Expressions Loop-invariant Expressions

Peaceful Army of Queens: Inside Representation

Alternatively, moving loop-invariant expression inside: forall fields(i,j) on the chess board. forall k. white queen at field(i,j) ⇒ no black queen at field(i,k) (column) ∧ forall k. white queen at field(i,j) ⇒ ∧ no black queen at field(k,j) (row) ∧ forall k. white queen at field(i,j) ⇒ ∧ no black queen at field(i+k,j+k) (NW-diagonal) ...

slide-41
SLIDE 41

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Inside- and Outside-Representation

What did we do?

1 We modelled two different PAQ models (in Essence’)

slide-42
SLIDE 42

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Inside- and Outside-Representation

What did we do?

1 We modelled two different PAQ models (in Essence’) 2 We translated both models to solvers Gecode and Minion

(using Tailor), generating:

slide-43
SLIDE 43

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Inside- and Outside-Representation

What did we do?

1 We modelled two different PAQ models (in Essence’) 2 We translated both models to solvers Gecode and Minion

(using Tailor), generating:

  • utside-representation

inside-representation

for both models

slide-44
SLIDE 44

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Inside- and Outside-Representation

What did we do?

1 We modelled two different PAQ models (in Essence’) 2 We translated both models to solvers Gecode and Minion

(using Tailor), generating:

  • utside-representation

inside-representation

for both models

3 We solved both representations using the same solving setup

slide-45
SLIDE 45

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Number of Constraints

Inside-Representation has far more constraints than Outside-Representation

0.7 1 2 5 10 15 500 1000 5000 10000 30000 Constraint Reduction with Inside Representation Constraints with Inside Representation (Forall-Impl) Problem Classes paq1 with CSE (Minion) paq1 with CSE (Gecode) paq3 with CSE (Minion) paq3 with CSE (Gecode) same #constraints

slide-46
SLIDE 46

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Number of Auxiliary Variables

Inside-Representation has 30% less auxiliary variables than Outside-Representation

0.5 0.7 1 2 5 10 15 50 100 1000 2000 Aux Variable Reduction with Inside Representation Number of Aux Variables with Inside-Representation Problem Classes paq1 with CSE (Minion) paq1 with CSE (Gecode) paq3 with CSE (Minion) paq3 with CSE (Gecode) same number of aux variables

slide-47
SLIDE 47

Optimising Quantified Expressions Loop-invariant Expressions

Comparing Number Solving Performance

0.5 0.7 1 1.3 1.5 2 2.5 3 0.01 0.1 1 10 50 100 1000 Solving Time Reduction with Inside Representation Solving Time with inside-representation (sec) Problem Classes paq1 with CSE (Minion) paq1 with CSE (Gecode) paq3 with CSE (Minion) paq3 with CSE (Gecode) same solving time

Inside-Rep. better in Minion (speedup of max. 300%) Inside-Rep. slightly better in Gecode (speedup of max. 30%)

slide-48
SLIDE 48

Optimising Quantified Expressions Loop-invariant Expressions

Conclusion on Loop-Invariant Expressions

Against our expectations: it can be beneficial to move loop-invariant expressions into quantifications

slide-49
SLIDE 49

Optimising Quantified Expressions Loop-invariant Expressions

Conclusion on Loop-Invariant Expressions

Against our expectations: it can be beneficial to move loop-invariant expressions into quantifications Difficult to make a general statement

depends on solver (provided propagators, architecture, etc) depends on problem structure

slide-50
SLIDE 50

Optimising Quantified Expressions Loop-invariant Expressions

Conclusion on Loop-Invariant Expressions

Against our expectations: it can be beneficial to move loop-invariant expressions into quantifications Difficult to make a general statement

depends on solver (provided propagators, architecture, etc) depends on problem structure

Tailor can automatically reformulate quantifications to inside/outside-representation

user can choose preferable representation (for each case) in translation settings

slide-51
SLIDE 51

Optimising Quantified Expressions Weak Guards

1 Loop-invariant Expressions 2 Weak Guards 3 Summary

slide-52
SLIDE 52

Optimising Quantified Expressions Weak Guards

Weak Guards

A guard B for an expression E has to hold to enforce E

B ⇒ E

slide-53
SLIDE 53

Optimising Quantified Expressions Weak Guards

Weak Guards

A guard B for an expression E has to hold to enforce E

B ⇒ E

Often used in modelling, mostly to restrict quantifying variables

slide-54
SLIDE 54

Optimising Quantified Expressions Weak Guards

Weak Guards

A guard B for an expression E has to hold to enforce E

B ⇒ E

Often used in modelling, mostly to restrict quantifying variables Example: forall i, j in (1..n). (i = j) ⇒ queen[i] + i = queen[j] + j

slide-55
SLIDE 55

Optimising Quantified Expressions Weak Guards

Weak Guards

If guards are weak they yield duplicate constraints

slide-56
SLIDE 56

Optimising Quantified Expressions Weak Guards

Weak Guards

If guards are weak they yield duplicate constraints forall i, j in (1..n). (i = j) ⇒ queen[i] + i = queen[j] + j

slide-57
SLIDE 57

Optimising Quantified Expressions Weak Guards

Weak Guards

If guards are weak they yield duplicate constraints forall i, j in (1..n). (i = j) ⇒ queen[i] + i = queen[j] + j is unrolled to: queen[1]+1 != queen[2]+2, queen[1]+1 != queen[3]+3, queen[2]+2 != queen[1]+1, queen[2]+2 != queen[3]+3, queen[3]+3 != queen[2]+2, queen[3]+3 != queen[1]+1, etc

slide-58
SLIDE 58

Optimising Quantified Expressions Weak Guards

Weak Guards

If guards are weak they yield duplicate constraints forall i, j in (1..n). (i = j) ⇒ queen[i] + i = queen[j] + j is unrolled to: queen[1]+1 != queen[2]+2, queen[1]+1 != queen[3]+3, queen[2]+2 != queen[1]+1, queen[2]+2 != queen[3]+3, queen[3]+3 != queen[2]+2, queen[3]+3 != queen[1]+1, etc

slide-59
SLIDE 59

Optimising Quantified Expressions Weak Guards

Weak Guards

If guards are weak they yield duplicate constraints forall i, j in (1..n). (i = j) ⇒ queen[i] + i = queen[j] + j is unrolled to: queen[1]+1 != queen[2]+2, queen[1]+1 != queen[3]+3, queen[2]+2 != queen[1]+1, queen[2]+2 != queen[3]+3, queen[3]+3 != queen[2]+2, queen[3]+3 != queen[1]+1, etc

slide-60
SLIDE 60

Optimising Quantified Expressions Weak Guards

Addressing Weak Guards

Option1: remove duplicate constraints after quantification is unrolled

slide-61
SLIDE 61

Optimising Quantified Expressions Weak Guards

Addressing Weak Guards

Option1: remove duplicate constraints after quantification is unrolled

problem: only possible when quantification can be unrolled, i.e. all parameters are known

slide-62
SLIDE 62

Optimising Quantified Expressions Weak Guards

Addressing Weak Guards

Option1: remove duplicate constraints after quantification is unrolled

problem: only possible when quantification can be unrolled, i.e. all parameters are known

Option2: strengthen the guard!

slide-63
SLIDE 63

Optimising Quantified Expressions Weak Guards

Strengthening Guards

Our Idea: use unification to strengthen guards

slide-64
SLIDE 64

Optimising Quantified Expressions Weak Guards

Strengthening Guards

Our Idea: use unification to strengthen guards Unification Example:

What is the unifier for ‘x + i’ and ‘x + 3’?

slide-65
SLIDE 65

Optimising Quantified Expressions Weak Guards

Strengthening Guards

Our Idea: use unification to strengthen guards Unification Example:

What is the unifier for ‘x + i’ and ‘x + 3’? u = {3/i} (i substituted with 3)

We want to demonstrate the algorithm on an example...

slide-66
SLIDE 66

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

A Golomb Ruler has n ticks such that the distance between each tick is different, minimising the length of the ruler.

slide-67
SLIDE 67

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

A Golomb Ruler has n ticks such that the distance between each tick is different, minimising the length of the ruler. Sample Golomb Ruler with 4 ticks and length 6:

slide-68
SLIDE 68

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

‘The distances between all ticks are different’-Constraint:

slide-69
SLIDE 69

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

‘The distances between all ticks are different’-Constraint: forall i1, i2, i3, i4 : TICKS. ((i1>i2) ∧ (i3>i4) ∧ (i2=i4)) ⇒ (ruler[i1]-ruler[i2] = ruler[i3]-ruler[i4])

slide-70
SLIDE 70

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI)

slide-71
SLIDE 71

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI) (1) If EI’s root node corresponds to a binary commutative

  • perator then continue, otherwise stop.
slide-72
SLIDE 72

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI) (1) If EI’s root node corresponds to a binary commutative

  • perator then continue, otherwise stop.

forall i1, i2, i3, i4 : TICKS. ((i1>i2) ∧ (i3>i4) ∧ (i2=i4)) ⇒ (ruler[i1]-ruler[i2] = ruler[i3]-ruler[i4])

slide-73
SLIDE 73

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI) (2) Compute the set of unifiers U for the two children of EI, e1 and e2. UNIFY (ruler[i1]-ruler[i2], ruler[i3]-ruler[i4]): u1 = {i1/i3 ∧ i2/i4} u2 = {i3/i1 ∧ i4/i2} u3 = {i3/i1 ∧ i2/i4} u4 = {i1/i3 ∧ i4/i2}

slide-74
SLIDE 74

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI) (3) Search U for unifiers from which we can deduce equivalence of the quantifying variables. UNIFY (ruler[i1]-ruler[i2], ruler[i3]-ruler[i4]): u1 = {i1/i3 ∧ i2/i4} u2 = {i3/i1 ∧ i4/i2} u3 = {i3/i1 ∧ i2/i4} u4 = {i1/i3 ∧ i4/i2} we deduce that (i1 = i3) ∧ (i2 = i4)

slide-75
SLIDE 75

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

STRENGTHEN_GUARD(∀I : D.BI ⇒ EI) (4) Add lex-ordering constraint C on all quantifying variables whose equivalence renders e1 and e2 equivalent C: i1, i2 ≤lex i3, i4 hence (i1 ≤ i3) ∧ (i1 < i3 ∨ i2 ≤ i4)

slide-76
SLIDE 76

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

Yielding the constraint with strengthend guard: forall i1, i2, i3, i4 : TICKS. ((i1>i2) ∧ (i3>i4) ∧ (i2=i4) ∧ (i1 ≤ i3) ∧ (i1 < i3 ∨ i2 ≤ i4)) ⇒ (ruler[i1]-ruler[i2] = ruler[i3]-ruler[i4])

slide-77
SLIDE 77

Optimising Quantified Expressions Weak Guards

Strengthening the Guard in Golomb Ruler

Yielding the constraint with strengthend guard: forall i1, i2, i3, i4 : TICKS. ((i1>i2) ∧ (i3>i4) ∧ (i2=i4) ∧ (i1 ≤ i3) ∧ (i1 < i3 ∨ i2 ≤ i4)) ⇒ (ruler[i1]-ruler[i2] = ruler[i3]-ruler[i4]) However: we have not implemented the algorithm yet!

slide-78
SLIDE 78

Optimising Quantified Expressions Weak Guards

Effects of Duplicate constraints

How bad is the effect of duplicate constraints due to weak guards?

in other words: is it worth putting energy into strengthening guards?

slide-79
SLIDE 79

Optimising Quantified Expressions Weak Guards

Effects of Duplicate constraints

How bad is the effect of duplicate constraints due to weak guards?

in other words: is it worth putting energy into strengthening guards?

We analyse the effects on two naive models in solver Minion and Gecode:

Naive n-Queens Naive Golomb Ruler

slide-80
SLIDE 80

Optimising Quantified Expressions Weak Guards

The Number of Duplicate Constraints

For both solvers: constant for n-Queens, linear within Golomb Ruler

0.95 1 1.1 1.5 2 2.5 25 50 100 1000 2500 Constraint Increase Factor Number of Constraints (when duplicates eliminated) Problem Classes golomb (Minion) golomb (Gecode) nQueensNaive (Minion) nQueensNaive (Gecode) same number of constraints

slide-81
SLIDE 81

Optimising Quantified Expressions Weak Guards

Effect on Solving Performance

strong effect in Gecode, mild effect in Minion

0.5 0.9 1 1.1 1.5 2 2.5 3 3.5 0.0001 0.001 0.01 0.05 0.1 1 10 100 1200 Solving Time Increase Factor Solving Time with eliminated duplicates (sec) Problem Classes golomb (Minion) golomb (Gecode) nQueensNaive (Minion) nQueensNaive (Gecode) same solving time

slide-82
SLIDE 82

Optimising Quantified Expressions Weak Guards

Conclusions for Weak Guards

Duplicate constraints can impair the solving performance

slide-83
SLIDE 83

Optimising Quantified Expressions Weak Guards

Conclusions for Weak Guards

Duplicate constraints can impair the solving performance We have an idea on how to strengthen guards to address this redundancy

slide-84
SLIDE 84

Optimising Quantified Expressions Weak Guards

Conclusions for Weak Guards

Duplicate constraints can impair the solving performance We have an idea on how to strengthen guards to address this redundancy We still need to implement/test/refine the algorithm..

slide-85
SLIDE 85

Optimising Quantified Expressions Summary

Summary

There is scope for optimisations in quantifications

slide-86
SLIDE 86

Optimising Quantified Expressions Summary

Summary

There is scope for optimisations in quantifications We can already provide some enhancement

slide-87
SLIDE 87

Optimising Quantified Expressions Summary

Summary

There is scope for optimisations in quantifications We can already provide some enhancement But there is still a lot to investigate!

slide-88
SLIDE 88

Optimising Quantified Expressions Summary

Thank You.