REFORMULATION Nonbinary constraints Dual Hidden Variable Encodings REFORMULATION
REFORMULATION Non-binary constraints Dual & Hidden Variable Encodings
REFORMULATION From non-binary to binary
Binary decomposable constraints • all. Diff(x, y, z) • x ≠ y, x ≠ z, y ≠ z • monotone(x, y, z) • x < y, y < z • even(x + y +z) • no way aka network decomposable
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding
Dual Variable Encoding A dual variable for each constraint
Dual Variable Encoding A dual variable for each constraint Domain is allowed tuples
Dual Variable Encoding A dual variable for each constraint Domain is allowed tuples Constraints if original variables shared
Dual Variable Encoding A dual variable for each constraint Domain is allowed tuples Constraints if original variables shared
Dual Variable Encoding Another wee example
Dual Variables Dual Variable Encoding Consider the two constraints C 1 and C 2 • C 1: even(x + y) • C 2: odd(y+z) • x, y, z in {0, 1} • introduce variables VC 1 and VC 2 • domain of VC 1 is set of allowed tuples for x and y in constraint C 1 • domain of VC 2 is set of allowed tuples for y and z in constraint C 2 • introduce a constraint relation R 21 where • domain of R 21 is allowed tuples between VC 1 and VC 2 • position 2 in tuples in VC 1 (agrees in y) • position 1 in tuples in VC 2 (agrees in y)
Consider the two constraints C 1 and C 2 Dual Variables • C 1: even(x + y) • C 2: odd(y+z) • x, y, z in {0, 1} VC 1: (<0, 0>, <1, 1>) R 21: (<0, 0, 1>, <1, 1, 0>) VC 2: (<0, 1>, <1, 0>) C 1 = <*A> C 2 = <A, *>
Consider the two constraints C 1 and C 2 Dual Variables • C 1: even(x + y) • C 2: odd(y+z) • x, y, z in {0, 1} VC 1: (<0, 0>, <1, 1>) match on y R 21: (<0, 0, 1>, <1, 1, 0>) VC 2: (<0, 1>, <1, 0>) C 1 = <*A> C 2 = <A, *>
Consider the two constraints C 1 and C 2 Dual Variables • C 1: even(x + y) • C 2: odd(y+z) • x, y, z in {0, 1} VC 1: (<0, 0>, <1, 1>) match on y R 21: (<0, 0, 1>, <1, 1, 0>) VC 2: (<0, 1>, <1, 0>) C 1 = <*A> C 2 = <A, *>
Dual Variables (you could) Try this • u, v, w, x, y, and z, in {0, 1} • C 1: odd. Sum(x, y, z) • C 2: not. Same(u, v, w) • C 3: even. Sum(w, x, y)
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Encoding
Hidden Variable Introduces dual variables as before (representing allowed tuples for constraints) Additional “hidden” variables binary constraints from the dual to original variables
Hidden Variables Introduce an additional hidden variable, and use the originals Add k binary constraints from originals to hidden variable Example • x, y, z in {0, 1} • not. Same(x, y, z) Allowed tuples are {<0, 0, 1>, <0, 1, 0>, <0, 1, 1>, <1, 0, 0>, <1, 0, 1>, <1, 1, 0>} W is in {<0, 0, 1>, <0, 1, 0>, <0, 1, 1>, <1, 0, 0>, <1, 0, 1>, <1, 1, 0>} W x y Cxw: W = <1, *, *> x = 1 Cyw: Y = <*, 1, *> y = 1 Czw: W = <*, *, 1> z = 1 z
Hidden Variables VC 4 (0, 0, 0) (0, 1, 1) (1, 0, 1) VC 1 (0, 0, 1) (0, 1, 0) (1, 0, 0) r 11 r 24 r 21 v 1 r 12 v 2 r 32 VC 2 (0, 0, 1) (1, 0, 0) (1, 1, 1) v 3 r 42 r 54 v 4 r 43 r 61 r 64 v 5 v 6 r 53 r 63 VC 3 (0, 1, 0) (1, 0, 0) (1, 1, 1) Have a C variable for each constraint, with domain the set of allowed tuples (as before) Have constraints rij between variable vi and dual variable VCJ to ensure Compatibility between dual and original variables
Upside Downside Variables have domains O(mk) Higher level of consistency (GAC)
Hidden variable encoding AC on hidden variable encoding is equivalent to GAC on original problem
Dual variable encoding AC on dual encoding is stronger than GAC on original encoding AC on dual encoding is stronger than AC on hidden variable encoding
Make a crossword puzzle
An example 1 2 3 4 5 6 7 4 Given the above grid and a dictionary, fill it. Then go get the clues (not my problem)
Original, non-binary, Encoding 1 2 3 4 5 6 7 A variable for each square Domain of each variable is {a. . z} 4 Constraints are k-ary For example, • 1 -across is set of 6 -tuples • 2 -down is set of 7 tuples • Tuples on 1 -across and 2 -down must be consistent
The Dual Encoding 1 2 3 4 5 6 7 1 A 4 D 2 D 4 A 4 Variables Domains 1 A 1 across 1 A: any 6 letter word 4 D 4 down 4 A: any 8 letter word 2 D 2 down 4 D: any 5 letter word 4 A 4 across 2 D: any 7 letter word 7 D 7 down 7 D: any 3 letter word 7 D
The Dual Encoding 1 2 3 4 5 6 7 1 A 4 D 2 D 4 A 4 1 A-4 D: 4 th of 1 A equals 1 st of 4 D 7 D 1 A-2 D: 2 nd of 1 A equals 1 st of 2 D 2 D-4 A: 4 th of 2 D equals 2 nd of 4 D 4 D-4 A: 4 th of 4 A equals 4 th of 4 D 4 A-7 D: 7 th of 4 A equals 2 nd of 7 D Binary Constraints
- Slides: 52