Com CompSci Sci 275, 75, C ONSTRAI ONSTRAINT Netw Network orks Rina Dechter, Fall 2020 Directional consistency Chapter 4 Fall 2020 1
Outline • Arc ‐ consistency algorithms • Path ‐ consistency and i ‐ consistency • Arc ‐ consistency, Generalized arc ‐ consistency, relation arc ‐ consistency • Global and bound consistency • Consistency operators: join, resolution, Gausian elimination • Distributed (generalized) arc ‐ consistency Fall 2020 2
Boolean constraint propagation • (A V � B) and (B) • B is arc ‐ consistent relative to A but not vice ‐ versa • Arc ‐ consistency by resolution: res((A V � B),B) = A Given also (B V C), path ‐ consistency: res((A V B),(B V C) = (A V C) Relational arc ‐ consistency rule = unit ‐ resolution A B G , G , A B Fall 2020 3
Boolean constraint propagation Fall 2020 4
Consistency for numeric constraints (Gausian elimination) x [ 1 , 10 ], y [ 5 , 15 ], x y 10 arc consistenc y x [ 1 , 5 ], y [ 5 , 9 ] by adding x y 10 , y 5 Gausian elimination of z [ 10 , 10 ], y z 3 path consistenc y x z 7 obtained by adding , x y 10 , y z 3 Gausian Elinination of: Fall 2020 7
Impact on graphs of i ‐ consistency Fall 2020 8
Tr Tractable classes classes • Examples of Horn theories (each clause has at most one positive literal) • ( � A, � B , � C, D), ( � D, F), �� A) Fall 2020 9
Outline • Directional Arc ‐ consistency algorithms • Directional Path ‐ consistency and directional i ‐ consistency • Greedy algorithms for induced ‐ width • Width and local consistency • Adaptive ‐ consistency and bucket ‐ elimination Fall 2020 10
Backtrack ‐ free search: or What level of consistency will guarantee global ‐ consistency Let’s explore how we can make a problem backtrack ‐ free with a minimal amount of effort Backtrack free and queries: Consistency, All solutions Counting optimization Fall 2020 11
Directional arc ‐ consistency: another restriction on propagation D4={white,blue,black} D3={red,white,blue} D2={green,white,black} D1={red,white,black} X1=x2, x1=x3, x3=x4 Fall 2020 12
Algorithm for directional arc ‐ consistency (DAC) • Complexity : 2 O ( ek ) Fall 2020 13
Directional arc ‐ consistency may not be enough Directional path ‐ consistency Not equal constraints Is it arc ‐ consistent? Fall 2020 15
Algorithm directional path consistency (DPC) Fall 2020 17
Example of DPC • d=A,B,C,D,E R_CB = { (1,3)(2,3)} R_DB = {((1,1)(2,2)} { 1 , 2 } E R_DC = {(1,1)(2,2)(1,3)(2,3)} { 1 , 2 , 3 } { 1 , 2 } D C B A { 1 , 2 } { 1 , 2 } Fall 2020 18
Directional i ‐ consistency Fall 2020 19
The induced ‐ width DPC recursively connects parents in the ordered graph, yielding Induced ‐ ordered graph: • Width along ordering d , w(d): E • max # of previous parents D C • Induced width w*(d): • The width in the ordered B A induced graph: recursively connecting the parents from last to first • Induced ‐ width w*: • Smallest induced ‐ width over all orderings • Finding w* • NP ‐ complete (Arnborg, 1985) but greedy heuristics (min ‐ fill). Fall 2020 21
Induced ‐ width (continued) Fall 2020 22
Induced ‐ width and DPC • The induced graph of (G,d) is denoted (G*,d) • The induced graph (G*,d) contains the graph generated by DPC along d, and the graph generated by directional i ‐ consistency along d. Fall 2020 23
Refined complexity using induced ‐ width • Consequently we wish to have ordering with minimal induced ‐ width • Induced ‐ width is equal to tree ‐ width to be defined later. • Finding min induced ‐ width ordering is NP ‐ complete Fall 2020 24
Outline • Directional Arc ‐ consistency algorithms • Directional Path ‐ consistency and directional i ‐ consistency • Greedy algorithms for induced ‐ width • Width and local consistency • Adaptive ‐ consistency and bucket ‐ elimination Fall 2020 25
How to find a good induced ‐ width greedily * w ( d ) the induced width of the primal graph along ordering d The effect of the ordering: A E B D C C B C D B E A D E A Primal (moraal) graph * * w ( d ) 4 w ( d ) 2 1 2 slides4 COMPSCI 2020
Greedy algorithms for induced ‐ width • Min ‐ width ordering • Min ‐ induced ‐ width ordering • Max ‐ cardinality ordering A • Min ‐ fill ordering • Chordal graphs B C D E Primal (moraal) graph Fall 2020 27
Min ‐ induced ‐ width Fall 2020 28
Min ‐ width ordering Fall 2020 29
Min ‐ fill algorithm • Prefers a node who adds the least number of fill ‐ in arcs. • Empirically, fill ‐ in is the best among the greedy algorithms (MW,MIW,MF,MC) Fall 2020 30
Chordal graphs and max ‐ cardinality ordering • A graph is chordal if every cycle of length at least 4 has a chord • Finding w* over chordal graph is easy using the max ‐ cardinality ordering • If G* is an induced graph it is chordal • K ‐ trees are special chordal graphs. • Finding the max ‐ clique in chordal graphs is easy (just enumerate all cliques in a max ‐ cardinality ordering Fall 2020 31
Max ‐ cardinality ordering Figure 4.5 The max-cardinality (MC) ordering procedure. Fall 2020 32
Example We see again that G in Figure 4.1(a) is not chordal since the parents of A are not connected in the max ‐ cardinality ordering in Figure 4.1(d). If we connect B and C , the resulting induced graph is chordal. Fall 2020 33
Outline • Directional Arc ‐ consistency algorithms • Directional Path ‐ consistency and directional i ‐ consistency • Greedy algorithms for induced ‐ width • Width and local consistency • Adaptive ‐ consistency and bucket ‐ elimination Fall 2020 34
Width vs local consistency: solving trees Fall 2020 35
Tree ‐ solving 2 complexity : O ( nk ) Fall 2020 36
Width ‐ 2 and DPC Fall 2020 37
Width vs directional consistency (Freuder 82) Fall 2020 38
Width vs i ‐ consistency • DAC and width ‐ 1 • DPC and width ‐ 2 • � and width ‐ (i ‐ 1) • backtrack ‐ free representation • If a problem has width 2, will DPC make it backtrack ‐ free? • Adaptive ‐ consistency : applies i ‐ consistency when i is adapted to the number of parents Fall 2020 39
Adaptive ‐ consistency Fall 2020 40
Bucket elimination Adaptive Consistency (Dechter & Pearl, 1987) = = Bucket E: E D, E C Bucket D: D A D = C Bucket C: C B A C Bucket B: B A B = A Bucket A: contradiction Fall 2020 41
Adaptive ‐ consistency , bucket ‐ elimination Fall 2020 42
Bucket elimination Adaptive Consistency (Dechter & Pearl, 1987) E Bucket ( E ) : E D, E C, E B D { 1 , 2 } Bucket ( D ) : D A E || R DCB C Bucket ( C ) : C B || R ACB { 1 , 2 , 3 } { 1 , 2 } Bucket ( B ) : B A D C || R AB B Bucket ( A ) : R A A B A Bucket ( A ) : A D, A B A { 1 , 2 } { 1 , 2 } Bucket ( D ) : D E || R DB D Bucket ( C ) : C B , C E || R D R C Bucket ( B ) : B E BE , C BE Bucket ( E ) : || R E B * Time : O(n exp(w (d) 1)) , E * space : O(n exp(w (d))) * w (d) - induced - width - along - ordering - d Fall 2020 43
The Idea of elimination eliminating E C R DBC D 3 value assignment B R R R R DBC ED EB EC DBC Eliminate variable E join and project Fall 2020 44
Variable elimination Eliminate variables one by one: “constraint propagation” Solution generation 3 after elimination is backtrack-free Fall 2020 45
Back to Induced width • Finding minimum ‐ w* ordering is NP ‐ complete (Arnborg, 1985) • Greedy ordering heuristics: min ‐ width, min ‐ degree, max ‐ cardinality (Bertele and Briochi, 1972; Freuder 1982), Min ‐ fill. Fall 2020 46
Solving Trees (Mackworth and Freuder, 1985) Adaptive consistency is linear for trees and equivalent to enforcing directional arc-consistency (recording only unary constraints) Fall 2020 47
Relational consistency ( Chapter 8 ) • Relational arc ‐ consistency • Relational path ‐ consistency • Relational m ‐ consistency • Relational consistency for Boolean and linear constraints: • Unit ‐ resolution is relational ‐ arc ‐ consistency • Pair ‐ wise resolution is relational path ‐ consistency Fall 2020 48
Outline • Directional Arc ‐ consistency algorithms • Directional Path ‐ consistency and directional i ‐ consistency • Greedy algorithms for induced ‐ width • Width and local consistency • Adaptive ‐ consistency and bucket ‐ elimination Fall 2020 49
Sudoku’s propagation • http://www.websudoku.com/ • What kind of propagation we do? Fall 2020 50
Recommend
More recommend