Title: Non-binary constraints
1(No Transcript)
2REFORMULATION
Non-binary constraints Dual Hidden Variable
Encodings
3REFORMULATION
From non-binary to binary
4Binary decomposable constraints
aka network decomposable
- allDiff(x,y,z)
- x ? y, x ? z, y ? z
- monotone(x,y,z)
- x lt y, y lt z
- even(x y z)
- no way
5Dual Variable Encoding
6(No Transcript)
7(No Transcript)
8Dual Variables
- Consider the two constraints C1 and C2
- C1 even(x y)
- C2 odd(yz)
- x,y,z in 0,1
- introduce variables VC1 and VC2
- domain of VC1 is set of allowed tuples for x and
y in constraint C1 - domain of VC2 is set of allowed tuples for y and
z in constraint C2 - introduce a constraint relation R21 where
- domain of R21 is allowed tuples between VC1 and
VC2 - position 2 in tuples in VC1 (agrees in y)
- position 1 in tuples in VC2 (agrees in y)
9- Consider the two constraints C1 and C2
- C1 even(x y)
- C2 odd(yz)
- x,y,z in 0,1
Dual Variables
C1 ltAgt ? C2 ltA,gt
10- Consider the two constraints C1 and C2
- C1 even(x y)
- C2 odd(yz)
- x,y,z in 0,1
Dual Variables
match on y
C1 ltAgt ? C2 ltA,gt
11- Consider the two constraints C1 and C2
- C1 even(x y)
- C2 odd(yz)
- x,y,z in 0,1
Dual Variables
match on y
C1 ltAgt ? C2 ltA,gt
12Dual Variables
Another example
Due to Stergiou Walsh
13Dual Variables
The hypergraph
14Hyper Graph
Hidden Variable Encoding
Dual Variable
15Dual Variables
Have a C variable for each constraint, with
domain the set of allowed tuples
Have constraints Rij between those C variables
that share variables in the original model to
ensure compatible pairs of tuples in positions i
and j
16Dual Variables
VC4 (0,0,0) (0,1,1) (1,0,1)
R21 R33
VC1 (0,0,1) (0,1,0) (1,0,0)
R33
R22 R33
R11
VC2 (0,0,1) (1,0,0) (1,1,1)
VC3 (0,1,0) (1,0,0) (1,1,0) (1,1,1)
R31
Have a C variable for each constraint, with
domain the set of allowed tuples
Have constraints Rij between those C variables
that share variables in the original model to
ensure compatible pairs of tuples in positions i
and j respectively
17Dual Variables
- (you could) Try this ?
- u,v,w,x, y, and z, in 0,1
- C1 oddSum(x,y,z)
- C2 notSame(u,v,w)
- C3 evenSum(w,x,y)
18Hidden Variable Encoding
19(No Transcript)
20(No Transcript)
21(No Transcript)
22Hidden Variable
Introduces dual variables as before (representing
allowed tuples for constraints) Additional
hidden variables binary constraints from the
dual to original variables
23Hidden 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
- notSame(x,y,z)
Allowed tuples are lt0,0,1gt,lt0,1,0gt,lt0,1,1gt,lt1,0,
0gt,lt1,0,1gt,lt1,1,0gt
W is in lt0,0,1gt,lt0,1,0gt,lt0,1,1gt,lt1,0,0gt,lt1,0,1gt,lt
1,1,0gt
Cxw W lt1,,gt ? x 1 Cyw Y lt,1,gt ? y
1 Czw W lt,,1gt ? z 1
24Hidden Variables
VC4 (0,0,0) (0,1,1) (1,0,1)
VC1 (0,0,1) (0,1,0) (1,0,0)
r24
r64
r11
r54
r21
r61
v1
v2
v3
v4
v6
v5
r63
r12
r32
r53
r43
r42
VC2 (0,0,1) (1,0,0) (1,1,1)
VC3 (0,1,0) (1,0,0) (1,1,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
25Upside
Downside
Variables have domains O(mk)
Higher level of consistency (GAC)
26Hidden variable encoding
AC on hidden variable encoding is equivalent to
GAC on original problem
27Dual 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
28Make a crossword puzzle
29(No Transcript)
30An 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)
31Original, non-binary, Encoding
1
2
3
4
5
6
A variable for each square Domain of each
variable is a .. z
7
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
32The Dual Encoding
1
2
3
4
5
6
7
1A
4D
4
4A
2D
Variables 1A 1 across 4D 4 down 2D
2 down 4A 4 across 7D 7 down
Domains 1A any 6 letter word 4A any 8 letter
word 4D any 5 letter word 2D any 7 letter
word 7D any 3 letter word
7D
33The Dual Encoding
1
2
3
4
5
6
7
1A
4D
4
4A
2D
1A-4D 4th of 1A equals 1st of 4D 1A-2D 2nd of
1A equals 1st of 2D 2D-4A 4th of 2D equals 2nd
of4D 4D-4A 4th of 4A equals 4th of 4D 4A-7D 7th
of 4A equals 2nd of 7D
7D
Binary Constraints
34(No Transcript)
35(No Transcript)
36(No Transcript)
37(No Transcript)
38(No Transcript)
39(No Transcript)
40(No Transcript)