4c092669e930ac2bdf901f42412f968c.ppt
- Количество слайдов: 107
Reasoning with global constraints Christian Bessiere LIRMM (CNRS/U. Montpellier) France
Background
Constraint networks A set X={X 1, …, Xn} of variables A set D={D(X 1), …D(Xn)} of domains, where D(Xi) is the finite set of values for Xi A set C={C 1, …Ce} of constraints
Agreements on domains Domains are given in extension to allow any type of reasoning If ||D(Xi)|| denotes the size of the encoding, ||D(Xi)|| = |D(Xi)| Example: n n D(X)={1, . . , 100} ||D(X)|| = 100 (not log 2(100))
Agreements on domains Domains are subsets of the set Z of integers We inherit the total ordering on integers Example: n n D(X)={1, . . , 100} Special values: min(X)=1, max(X)=100
Set variables It is sometimes convenient to consider a Boolean vector <S 1, …, Sn> as a set variable S with domain 2{1. . n} In this case, D(S) is represented by its required values lb(S) and possible values ub(S) lb(S) 1 2 [Gervet 94] S 1: {1} S 2: {1} S 3: {0, 1} S 4: {0, 1} S 5: {0} ub(S) 1 2 3 4 S can take values: {1, 2}, {1, 2, 3}, {1, 2, 4}, {1, 2, 3, 4}
Constraints A constraint c specifies the allowed combinations of values on a sequence X(c)=(Xi 1, …, Xiq) of variables Y X Classical definition in CSPs: 1 n c D(Xi 1) x. . . X D(Xiq) 3 2 Example: 7 n c X < Y D(X)={3, 7, 8, 10} 4 D(Y)={1, 2, 4, 7, 9} c={(3, 4), (3, 7), (3, 9), (7, 9), (8, 9)} 8 10 7 9
…Not satisfactory because it does not fit what is done in practice: X < Y is not encoded as a set of pairs! n And even if it was, we do not want to remove all pairs (v, w) from c each time a value v is removed from D(X) 1 3 7 8 10 because it does not permit to express all types of local consistencies (see bound consistency in [Dechter 03]) 2 4 7 9
Constraints A constraint c specifies the allowed combinations of values on a sequence X(c)=(Xi 1, …, Xiq) of variables c Z|X(c)| c = {allowed tuples on X(c)} c is independent of the effective domains of its variables So, a constraint c is defined by any Boolean function fc with domain Z|X(c)| c X < Y is the set {…(-11, -7), …, (0, 4), (0, 5), (0, 6), …, (7, 9), (7, 10)…} of all tuples (v, w) where v<w.
Non-binary versus global constraints Non-binary: c with scope X(c), |X(c)|>2 Global constraint: class G of constraints defined by a Boolean function f. G with domain Z* n alldiff : f. G(t)=1 iff v, w t, v w A constraint c on X(c) belongs to a class G iff c = {t Z|X(c)| | f. G(t)=1} n Alldiff(X 1, X 2, X 3)= {t Z 3 | t[1] t[2], t[2] t[3]} Restriction: checking if f. G(t)=1 is polynomial
Some global constraints Nvalue(X 1. . Xn, N) number of values taken by Xi’s is equal to N n (2, 1, 3, 3, 3) is allowed Alldiff(X 1. . Xn) Nvalue(X 1. . Xn, n) Atmost[k, v](X 1. . Xn) at most k variables take value v n (2, 5, 1, 4) is allowed if k=2, v=2 See Beldiceanu’s catalog (>200 global constraints) [Bel&al 05]
Do we need global constraints? …or at least: ‘do we need all of them when specifying a CP toolkit? ’ Why global constraints? n Expressiveness (semantic globality) expressing new things n Effectiveness of propagation (operational globality) producing powerful effects n Efficiency of propagation (algorithmic globality) producing the result with little wasted effort [Bes. Van. H 03]
Part 1: Semantic Globality
Expressiveness Global constraints permit a high-level programming approach: a whole pattern in a single constraint n Allowed shifts in a nurse rostering w Strech constraint: at most 5 working days and not morning after night w. NNRRMMAAAARNMMRR But are they all necessary? n does each permit to express what others can’t? [Pesant 04]
Early work Encode non-binary constraints as binary ones n n n Primal representation Hidden representation Dual representation [Montanari 74, Dec. Pea 89, Jan&al 89, Dechter 90, Ros&al 90]
Early work: Primal graph Keep the same variables/domains Replace non-binary constraints by their binary projections (inside DX(c)) Alldiff(X 1, . . X 4): X 1 X 2 n sol(N)=alldiff(X 1. . X 4) X 4 X 3
Early work: Primal graph But, it does not always work X + Y = Z with D(X)={1, 2, 3} D(Y)={2, 4, 6} D(Z)={1, 3, 5, 7} X+Y=Z 1 2 3 1 4 5 1 6 7 3 2 5 3 4 7 X 12 14 16 32 34 Y sol(N)= 13 15 17 35 37 23 25 45 47 67 Z X 1 1 1 3 3 Y 2 2 4 4 6 2 4 Z 3 5 5 7 7 5 7
Early work: Hidden repr. Keep the original variables Add a new variable Hc for each original constraint c D(Hc)={t | t c DX(c)} Binary constraints between Hc and Xi X(c) that accept (t, v) iff t[Xi]=v Hc X Hc 2 Y Z W Hc Z 123 3 124145 5 167 7 325 5 347 7
Early work: Hidden repr. D(Hc)={t | t c DX(c)} |D(Hc)| O(dk) Exponential size of the representation
Early work: Dual repr. c 1 Forget original variables Add a new variable Vc for each original constraint D(Vc)={t | t c DX(c)} Vc 1 X(c 1) X(c 2) c(Vc 1, Vc 2) 123 (t 1, t 2) c(Vc 1, Vc 2) iff t 1[X(c 1) X(c 2)] = t 2[X(c 1) X(c 2)] 145 167 325 347 W c 2 X Y Z Y+Z>2 W, D(W)={5, 6} Vc 1 c Vc 2 475 655 676 Vc 2
Early work: Dual repr. D(Vc)={t | t c DX(c)} |D(Vc)| O(dk) Exponential size of the representation
Semantic globality (relative to L) When does a global constraint help expressing something new in a language L? If it cannot be polynomially decomposed with constraints in L
A sample language Range, Roots, and basic arithmetic primitives [Comics 05]
A sample language Range(X 1, . . . , Xn, S, T) X(S)=T, where X({i})=Xi 1 v 1 i vj n T vm S
A sample language Roots(X 1, . . . , Xn, S, T) S=X-1(T) S S T T
Semantic globality (relative to L) When does a global constraint help expressing something new in a language L? n If it cannot be polynomially decomposed with constraints in L w On the same variables w With extra variables
Decomposition (relative to L) alldiff(X 1, . . , Xn): n n n Atmost[1, 1](X 1, . . , Xn) Atmost[1, 2](X 1, . . , Xn) Atmost[1, 3](X 1, . . , Xn) … Atmost[1, v](X 1, . . , Xn), v D(Xi), i
Decomposition with extra variables (relative to L) atmost[k, v](X 1, . . Xn) X 1 X 2 X 3 X 4 1 1 2 2 3 3 4 4 5 5 Roots(X 1, . . Xn, S, {v}) |S| k atmost is decomposable in L ( k=2, v=2 ) X 1…X 4 1122 1123 … 1222 … 2222 … 4455 S={2, 3, 4} |S|>k S={} |S|≤k
Decomposition with extra variables (relative to L) Nvalue(X 1, . . Xn, N) X 1 X 2 X 3 X 4 1 1 2 2 3 3 4 4 5 5 N 1 2 3 4 X 1…X 4 N 1122 1123 1125 … 1235 … 4455 2 3 3 4 2 Range(X 1, . . Xn, {1. . n}, T) |T|=N Nvalue is decomposable in L X 1 X 2 X 3 X 4 1 T 2 3 4 5
Decomposition relative to L G decomposable relative to L if: n c G, D on X(c), N=(X(c) Y, D’, C) such that w Xi X(c), D’(Xi)=D(Xi) w c’ C, c’ L w sol(N)[X(c)] = sol(X(c), D, {c}) w ||N|| is poly in ||c||+||D||
Absolute semantic globality When does a global constraint help expressing something new? (independently of any language) If it cannot be polynomially decomposed with constraints of bounded arity w On the same variables w With extra variables
Absolute decomposition G k-decomposable if n c G, D on X(c), N=(X(c) Y, D’, C) such that w w Xi X(c), D’(Xi)=D(Xi) c’ C, |X(c’)| k sol(N)[X(c)] = sol(X(c), D, {c}) ||N|| is poly in ||c||+||D|| G is decomposable if k s. t. G is k-decomposable
Absolute decomposition Alldiff clique of binary inequalities n Alldiff(X 1. . X 4) X 1 X 2 X 4 Alldiff is decomposable X 3
Absolute decomposition Atmost[k, v](X 1. . Xn)? Atmost[3, 2]: X 1 1122 1123 … 4455 X 2 U U U X 4 U X 3 Atmost 3 among 4 atmost 3 among 3 universal constraint Atmost is not decomposable on the same variables
Absolute decomposition with extra variables Atmost[k, v](X 1. . Xn): n n n B 0…Bn, D(Bi)={0, …, n} (Xi=v & Bi=Bi-1+1) (Xi v & Bi = Bi-1), i B 0=0, Bn k X 1 X 2 Xi …… B 0 B 1 Bi-1 Bi …… atmost is 3 -decomposable Xn-1 Bn-1 Xn Bn
Absolute decomposition with extra variables c ( Xi = k): n n n Y 0…Yn, D(Yi)={0, …, k} Yi = Yi-1+Xi, i Y 0=0, Yn = k X 1 X 2 Xi …… Y 0 Y 1 Yi-1 Yi …… Xi = k is not decomposable ||D(Yi)|| exponential in ||(X, D, {c}) || Xn-1 Yn-1 Xn Yn
Part 2: Complexity of Reasoning
Reasoning with global constraints All CP solvers propagate constraints ‘propagate’ usually means: remove value v in D(Xi), Xi X(c) if not t c, t[Xi]=v and t[Xj] D(Xj) j This is the maximum amount of inconsistency information a constraint taken alone can project on a variable, aka: Generalized Arc Consistency (GAC ) c is X+Y=Z X Y Z 1 2 4 3 3 6 5 7
Questions related to GACSupport[c, D, X, v]: n Does value v for X have a support on c in D? n GACSupport[X, 1]? yes n GACSupport[X, 2]? no X + Y = Z 1 2 4 3 3 6 5 7
Questions related to GAC Is. It. GAC[c, D]: n n n Does GACSupport[c, D, X, v] answer ‘yes’ for each X X(c) and each value v D(X)? Is. It. GAC[D]? no Is. It. GAC[D 1]? yes X + Y = Z 1 2 4 3 3 6 5 7
Questions related to GAC No. GACWipe. Out[c, D]: n n n Is there any non empty D’ D on which Is. It. GAC[D’] answers yes? No. GACWipe. Out[D]? yes X + Y = Z 1 2 1 No. GACWipe. Out[D 2]? no 2 4 3 3 6 5 7
Questions related to GAC max. GAC[c, D’, D]: n n n Is it the case that Is. It. GAC[c, D’] answers ‘yes’ and not D’’, D’ D’’ D such that Is. It. GAC[D’’]? max. GAC[D, D]? no max. GAC[D 1, D]? no X + Y = Z 1 2 4 3 3 6 5 7
Questions related to GAC max. GAC[c, D’, D]: n n Is it the case that Is. It. GAC[c, D’] answers ‘yes’ and not D’’, D’ D’’ D such that Is. It. GAC[D’’]? max. GAC[D, D]? no max. GAC[D 1, D]? no max. GAC[D 3, D]? yes X + Y = Z 1 2 4 3 3 6 5 7
Questions related to GACDomain[c, D]: n n The domain D’ such that max. GAC[D’, D] answers yes GACDomain[D]? X + Y = Z D 3 1 2 4 3 3 6 5 7
GAC reasoning is intractable GACSupport is in NP (poly certificate) Let G be the class of constraints defined by X 1 , where is a 3 Sat formula GACSupport(c, {0, 1}n, X, 1) solves the SAT problem GACSupport is NP-complete
GAC reasoning is intractable GACSupport is NP-complete Is. It. GAC is NP-complete No. GACWipe. Out is NP-complete GACDomain is NP-hard max. GAC?
max. GAC is DP-complete A decision problem P is DP-complete iff there exists two problems Q 1 (NP-c) and Q 2 (co. NP-c) such that P answers ‘yes’ when Q 1 answers ‘yes’ and Q 2 answers ‘no’ Let G 1 and G 2 be two 3 Col problems (on the nodes s 1. . sn): X 1 X 2 …… Xn 1, 2, 3 4, 5, 6 c(Xi, Xj) forbids (v, w) if v (1, 2, 3) and w (4, 5, 6) or vice versa (si, sj) G 1 c(Xi, Xj) forbids (11), (22), (33) on Xi, Xj (si, sj) G 2 c(Xi, Xj) forbids (44), (55), (66) on Xi, Xj max. GAC(c, {1. . 3}n, {1. . 6}n) answers yes iff G 1 is 3 colorable and G 2 is not
Complexity summary Problem Complexity class GACSupport NP-complete Is. It. GAC NP-complete No. GACWipe. Out NP-complete GACDomain NP-hard max. GAC DP-complete
Questions related to GAC Let G be a class of constraints GACSupport(G) n Is. It. GAC(G) n No. GACWipe. Out(G) n max. GAC(G) n GACDomain(G) …are the same as before but constraints must belong to G n
Dependencies between GAC questions Suppose GACSupport(G) is NP-complete No. GACWipe. Out is in NP GACSupport(G)[c, D, X, v] can be solved by a call to No. GACWipe. Out(G)[c, DX=v] No. GACWipe. Out(G) is NP-complete
Dependencies between GAC questions GACSupport No. GACWOut Is. It. GACDomain max. GAC A B: A NP-hard B NP-hard
A question related to GAC: Entailment captures the idea that a constraint is no longer necessary in the network, that is, for any subdomain D’ of D, c is GAC Entailed[c, D]: n Is DX(c) c ? Example: n c (X Y Z) Entailed(D 1): no n Entailed(D 2): yes n X Y Z 1 2 4 3 3 6 5
Entailment is intractable If there is a single tuple in D violating c, Entailed(c, D) is false there is a tuple satisfying the negation nc of c So, Entailed(c, D) No. GACWipe. Out(nc, D) Entailed is co. NP-complete
Part 3: Operational Globality
Do we need global constraints? Expressiveness Effectiveness of propagation producing powerful effects Efficiency of propagation producing the result with little wasted effort
Effectiveness of propagation Global constraints give a global view on what values are consistent or not But are they all necessary? n do they permit to rule out values decompositions cannot?
Early work: decomposability of Montanari A constraint c is M-representable iff its primal graph N=(X(c), D, C) is such that sol(X(c), D, C)=c (ie, 2 -decomp on the same vars) X 1 X 4 1, 2, 3, 4 1, 2, 3 X 2 1, 2, 3, 4 Alldiff is M-representable [Montanari 74] 1, 2, 3 alldiff 1, 2, 3, 4 X 3 1, 2, 3, 4
Early work: decomposability of Montanari A constraint c is M-decomposable iff Y X(c), sol(X(c), D, C)[Y] is M-representable X 1 X 4 1, 2, 3, 4 1, 2, 3 alldiff X 2 1, 2, 3, 4 (1, 2, 3) is accepted whereas it does not extend to X 4 1, 2, 3, 4 X 3 Alldiff is not M-decomposable 1, 2, 3, 4
Early work: decomposability of Montanari If a constraint c is M-decomposable into N=(X(c), D, C) then N is globally consistent AC on N is equivalent to GAC on c
Early work: decomposability of Montanari This condition is too restrictive Eg, it is well-known that if N is tree structured, AC prunes all non consistent values 1 2 3 < 1 2 3 = 1 2 3 < 1 2 3
Early work: tree structure If a global constraint G can be decomposed as a tree-structured binary network N then GAC(c) is equivalent to AC(N) Allequal(X 1, . . X 4): n X 1 X 2 = GAC(c)=AC(N) = X 4 [Gen&al 00] = X 3
Operational globality When do global constraints help propagating something more? n n If all decompositions in L hinder propagation If all absolute decompositions hinder propagation
Operational globality (wrt L) alldiff(X 1, . . , Xn): n n GAC on alldiff prunes values 2 and 3 from X 1, X 2 because D(X 3)=D(X 4)={2, 3} Atmost[1, 1](X 1, . . , Xn) Atmost[1, 2](X 1, . . , Xn) Atmost[1, 3](X 1, . . , Xn) … X 1 X 2 X 3 X 4 1 1 2 2 3 3 4 4 Decomposition hinders GAC Atmost[1, 2] 112 113 … 213 … 423 … 443 3 2 3 3 3
Operational globality (wrt L) atmost[k, v](X 1, . . Xn) k=2, v=2 X 1 X 2 X 3 X 4 1 1 2 2 3 3 4 4 GAC on atmost prunes value 2 from X 1, X 2 because there exist 2 variables X 3 and X 4 with D={2} Roots(X 1, . . Xn, S, {2}) |S| 2 Roots puts 3 and 4 in lb(S) |S| 2 removes 1 and 2 from ub(S) Roots prunes 2 from X 1, X 2 Decomposition preserves GAC
Operational globality (wrt L) Nvalue(X 1, . . Xn, N) with N=1 X 2 X 3 X 4 1 1 2 2 3 3 4 4 5 5 Range(X 1, . . Xn, {1. . n}, T) |T|=N {} T {1, 2, 3, 4, 5} …and both constraints are AC …whereas all 1, 4, and 5 should be pruned from Xi’s Decomposition hinders GAC
Operational globality When do global constraints help propagating something more? n n If all decompositions in L hinder propagation If all absolute decompositions hinder propagation
Absolute operational globality Alldiff is decomposable but: 1, 2, 3, 4 2, 3 1, 2, 3, 4 alldiff 2, 3 1, 2, 3, 4 Decomposition hinders GAC 2, 3
Absolute operational globality Atmost: X 1 X 2 X 3 …… B 0 B 1 B 2 B 3 …… n n n Xn-1 Bn-1 Xn Bn B 0…Bn, D(Bi)={0, …, n} (Xi=v & Bi=Bi-1+1) (Xi v & Bi = Bi-1), i Bn k Acyclic hypergraph Decomposition preserves GAC
Operational globality When do global constraints help propagating something more? n n n If all decompositions in L hinder propagation If all absolute decompositions hinder propagation Relaxing absolute decomposition
Relaxing absolute decomposition Absolute decomposition requires bounded arity (this was necessary from the semantic point of view) Relaxation: Let LP be the language of all constraints on which GAC is polynomial G is GAC-poly-time decomposable iff there exists a decomposition of G wrt LP that does not hinder propagation How to know which constraints are decomposable? [Comics 04]
Using computational complexity Computational complexity can help deciding the existence of decompositions that preserve GAC If No. GACWipe. Out(G) is NP-complete, then there does not exist any GAC-poly-time decomposition for G
Example Our decomposition of Nvalue ’’Range(X 1, . . Xn, {1. . n}, T) |T|=N’’ hinders GAC Nvalue(X 1, . . Xn, n) is polynomial to propagate ( alldiff) What about Nvalue(X 1, . . Xn, N), where N is a variable?
Reduction of 3 Sat Let be a 3 Sat formula on x 1. . xn with m clauses Xi {-i, i}, i 1. . n Xn+j {f, -g, h}, cj=xf xg xh N {n} Nvalue(X 1, …, Xn+1, …, Xn+m, N) has a solution iff is satisfiable Nvalue cannot be GAC-poly-time decomposed X 1 … Xi … Xn Xn+1 -1 1 -i i -n n … Xn+j f -g h … Xn+m
Do we need global constraints? Expressiveness Effectiveness of propagation producing powerful effects Efficiency of propagation producing the result with little wasted effort
Efficiency of propagation Does GAC have the same complexity on decomposition and on the original constraint? Example: Range can be encoded as a Gcc constraint, but GAC on Gcc is more expensive than on Range Algorithmic globality [Regin 96, Comics 06]
So what? If a constraint has some inherent globality n n n Semantic: no way to escape! Operational: do we accept losing pruning? Algorithmic: do we accept a slow-down? Otherwise: write a specific algorithm (see other talks) use a generic GAC algorithm
Part 4: Generic Algorithms
GAC 3(X, D, C) Q {(Xi, c) | c C and Xi X(c)} While Q do Pick (Xi, c) from Q If Revise(Xi, c) then If D(Xi)= then return False Update Q Return True Revise(Xi, c) Change False For each vi D(Xi) do t seek. Support(Xi, vi, c) If t=nil then remove vi from D(Xi) Change True Return Change [Mackworth 77]
Space of tuples 3 4 5 1 2 X+Y=Z 3 4 5 1 3 2 4 5 1 2 3 4 5 D(X)={1, 2, 3} D(Y)={1, 2} D(Z)={3, 4, 5} 3 3 4 5 1 2 3 4 5
seek. Support 3 2 X+Y=Z seek. Support(X, 1) 4 5 1 3 2 4 5 1 2 3 4 5 3 3 4 5 1 2 3 4 5
seek. Support 3 2 X+Y=Z seek. Support(Y, 1) 4 5 1 3 2 4 5 1 2 3 4 5 3 3 4 5 1 2 3 4 5
GAC 3 seek. Support: O(dk-1) checks Nb of calls: O(kd) per change GAC 3(X, D, C) Q {(Xi, c) | c C and Xi X(c)} While Q do Pick (Xi, c) from Q If Revise(Xi, c) then If D(Xi)= then return False Update Q Revise(Xi, c) Change False For each vi D(Xi) do t seek. Support(Xi, vi, c) If t=nil then remove vi from D(Xi) Change True Return Change Number of checks: O(k 2 dk+1)
Techniques used to be efficient Ordering + Last support
Ordering + Last 3 2 X+Y=Z seek. Support(Z, 4) 4 5 1 3 2 4 5 1 2 3 4 5 3 Last(Z, 4) 3 4 5 1 2 3 4 5 Last(Z, 4)
GAC 2001 Revise 2001(Xi, c) Revise(Xi, c) Change False For each vi D(Xi) do if Last(Xi, vi, c) non valid then t seek. Support(Xi, vi, c) If t=nil then remove vi from D(Xi) Change True Return Change O(dk-1) per value [Bes&al 01] t seek. Next. Support(Xi, vi, c, Last) If t=nil then remove vi from D(Xi) Change True Else Last(Xi, vi, c) t Return Change Number of checks: O(kdk)
Techniques used to be efficient Ordering + Last support Multidirectionality What does it mean? If a tuple t=((X, v), …(Y, w), …) has been found (not to) to support (X, v), it also (doesn’t) supports (Y, w)
Using multidirectionality 1. Do not check a tuple t if t has already been checked before 2. Do not look for support for (Xi, v) if a tuple supporting it has already been checked
Using multidirectionality 1. Do not check a tuple t if t has already been checked before Observe that if t has been checked when looking for support for (Xi, v), Last(Xi, v) guarantees it won’t be checked again by seek. Next. Support(Xi, v) …what about seek. Next. Support(Xj, w)? GAC 2001 doesn’t ensure (1)
GAC-schema 3 4 5 1 2 seek. Next. Support(Z, 4) 3 4 5 1 3 2 4 5 1 2 Last(Z, 4) 3 4 5 1 2 [Bes. Rég 97] Last(X, 2) 3 4 5 3 Last(X, 1), Last(Y, 2) 3 4 5 Last(Y, 1)
Using multidirectionality 1. Gddf 2. Do not look for support for (Xi, v) if a tuple supporting it has already been checked Last is not enough GAC-schema ensures (2) thanks to its finegrained data structure n n S[t]: set of values supported by t SC[Xi, v]: set of supporting tuples containing (Xi, v)
GAC-schema seek. Next. Support(Xi, v) SC[Xj, w] SC[Xi, v] Xj seek. Next. Support(Xj, w)? … v 2 … w … t: S[t] Xi Last. C[Xj, w] …v … w… Last. C[Xi, v]
GAC-schema Ordering + Last support Multidirectionality Number of checks: O(dk) = the best complexity (like GAC 4 which reads all tuples in advance)
GAC-schema We always supposed that a constraint check is polynomial This is true when c is defined by a function fc But what happens with Table constraints? (ie, a list of allowed tuples)
Table constraints Use GAC 4 heavy updates of his huge lists Use GAC-schema+table n n It looks for valid tuples in the table T(c) instead of allowed tuples in D(X 1) x … x D(Xk) It can explore an exponential number of tuples in the table which are no longer valid Use GAC+allowed n It jumps from T(c) to DX(c) and from DX(c) to T(c) [Lho. Reg 05, Lec. Sym 06]
Alternatives: binary encodings AC on hidden representation AC on dual representation
AC on hidden representation AC(hidden) GAC(c) Specialized AC-hidden algorithm It requires updating the (exponential) hidden domain ( GAC 4) [Sam. Ste 04]
AC on dual representation AC(dual) Pairwise consistency Wipe. Out(GAC) Wipe. Out(PW) c 1 X Y Z Vc 1 Vc 2 123 475 X+Y=Z, Y+Z>2 W 145 655 D(X)={1, 2, 3} 167 675 D(Y)={2, 4, 6} 325 676 D(Z)={1, 3, 5, 7} 347 D(W)={5, 6} [Bee&al 83, Jan&al 89] W c 2
Part 5: Other levels of consistency
Weaker levels of consistency Bound consistency was first introduced for arithmetic constraints on real variables Several adaptations to finite domain variables The most common (and most interesting) is BC(Z), which gets rid of domain size The others: BC(D), Range. C explore domains, BC(R) is trivial on most constraints [Apt 03, Dechter 03, Cho&al 05, Bessiere 05]
BC(Z) Definition: n n A tuple t on c is a bound support iff t c and min(Xi) t[Xi] max(Xi), Xi X(c) Xi is bound consistent on c iff bound supports t, t’ such that t[Xi]=min(Xi) and t’[Xi]=max(Xi)
Bound consistency(Z) Y = X 2 X Y BC(Z) -1 0 1 2 3 0 GAC 3 4
Bound consistency(Z) Decomposability analysis for BC(Z)? It depends on domains representation When reasoning with BC, it is often the case that we accept domains represented as intervals It changes the size of the encoding!
Effect of the size c ( Xi = k): n n n Y 0…Yn, D(Yi)=[0…k] Yi =Xi+Yi-1, i Y 0=0, Yn = k ||D(Yi)|| polynomial in (X, D, {c}) if domains are encoded as intervals Xi = k is decomposable on intervals In addition, BC(Z) on the decomposition is equivalent to BC(Z) on Xi = k So, Xi = k is BC-poly-time decomposable n (remember it was not GAC-poly-time decomposable)
Y Effect of the size (2) BC(Z) can require an exponential number of checks even if the domain is small Let c(X, Y) be the constraint that accepts (v, w) iff v=0 or (w mod 2 n)base_2 is a model of 3 Sat formula 1 X 0 1 ? 01101001 If D(X)={0, 1} and D(Y)={1, 2 n}, checking BC(Z) on (X, 1) is equivalent to solving SAT( ) BC(Z) is NP-hard whereas GAC takes 3 checks! 2 n
Stronger levels of consistency Reasoning on several constraints at a time Often requires deleting tuples in constraints (pairwise, relational…) n Exponential size and makes propagation difficult [Decvan. B 95] Pairwise consistency c 1 123 145 167 325 347 c 2 475 655 676
Stronger levels of consistency We can adapt inverse consistencies of the binary case n Relational PIC, P(air)W(ise)IC Wipe. Out(PWIC) iff Wipe. Out(GAC(PW)) Efficient algorithm for PWIC: beats GAC quite often [Fre. Elf 96, Ste. Wal 06]
The end
4c092669e930ac2bdf901f42412f968c.ppt