Com CompSci Sci 275, 75, C ONSTRAI ONSTRAINT Netw Network orks - - PowerPoint PPT Presentation

com compsci sci 275
SMART_READER_LITE
LIVE PREVIEW

Com CompSci Sci 275, 75, C ONSTRAI ONSTRAINT Netw Network orks - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Com CompSci Sci 275, 75, CONSTRAI

ONSTRAINT Netw

Network

  • rks

Rina Dechter, Fall 2020

Fall 2020 1

Directional consistency Chapter 4

slide-2
SLIDE 2

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

slide-3
SLIDE 3

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

Fall 2020 3

B A G G B A

 , ,

slide-4
SLIDE 4

Fall 2020 4

Boolean constraint propagation

slide-5
SLIDE 5

Consistency for numeric constraints (Gausian elimination)

Fall 2020 7

3 , 10 , 7 3 ], 10 , 10 [ 5 , 10 ] 9 , 5 [ ], 5 , 1 [ 10 ], 15 , 5 [ ], 10 , 1 [                                z y y x adding by

  • btained

z x y consistenc path z y z y y x adding by y x y consistenc arc y x y x

Gausian elimination of Gausian Elinination of:

slide-6
SLIDE 6

Impact on graphs of i‐consistency

Fall 2020 8

slide-7
SLIDE 7

Tr Tractable classes classes

Fall 2020 9

  • Examples of Horn theories (each clause has at most one positive

literal)

  • ( A, B , C, D), ( D, F), A)
slide-8
SLIDE 8

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

slide-9
SLIDE 9

Backtrack‐free search: or

What level of consistency will guarantee global‐consistency

Backtrack free and queries: Consistency, All solutions Counting

  • ptimization

Fall 2020 11

Let’s explore how we can make a problem backtrack‐free with a minimal amount of effort

slide-10
SLIDE 10

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

slide-11
SLIDE 11

Algorithm for directional arc‐consistency (DAC)

) (

2

ek O

  • Complexity:

Fall 2020 13

slide-12
SLIDE 12

Directional arc‐consistency may not be enough 

Directional path‐consistency

Fall 2020 15

Not equal constraints Is it arc‐consistent?

slide-13
SLIDE 13

Algorithm directional path consistency (DPC)

Fall 2020 17

slide-14
SLIDE 14

Example of DPC

  • d=A,B,C,D,E

     

E D A C B

} 2 , 1 { } 2 , 1 { } 2 , 1 { } 2 , 1 { } 3 , 2 , 1 {

Fall 2020 18

R_CB = { (1,3)(2,3)} R_DB = {((1,1)(2,2)} R_DC = {(1,1)(2,2)(1,3)(2,3)}

slide-15
SLIDE 15

Directional i‐consistency

Fall 2020 19

slide-16
SLIDE 16

The induced‐width

DPC recursively connects parents in the ordered graph, yielding Induced‐ordered graph:

  • Width along ordering d, w(d):
  • max # of previous parents
  • Induced width w*(d):
  • The width in the ordered

induced graph: recursively connecting the parents from last to first

  • Induced‐width w*:
  • Smallest induced‐width over all
  • rderings
  • Finding w*
  • NP‐complete

(Arnborg, 1985) but greedy heuristics (min‐fill). E D A C B

Fall 2020 21

slide-17
SLIDE 17

Induced‐width (continued)

Fall 2020 22

slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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

slide-21
SLIDE 21

How to find a good induced‐width greedily

d d w

  • rdering

along graph primal the

  • f

width induced the ) (

*

The effect of the ordering:

4 ) (

1 *

 d w 2 ) (

2 *

 d w

Primal (moraal) graph A D E C B B C D E A E D C B A

slides4 COMPSCI 2020

slide-22
SLIDE 22

Greedy algorithms for induced‐width

  • Min‐width ordering
  • Min‐induced‐width ordering
  • Max‐cardinality ordering
  • Min‐fill ordering
  • Chordal graphs

Fall 2020 27

Primal (moraal) graph A D E C B

slide-23
SLIDE 23

Min‐induced‐width

Fall 2020 28

slide-24
SLIDE 24

Min‐width ordering

Fall 2020 29

slide-25
SLIDE 25

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

slide-26
SLIDE 26

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

  • rdering

Fall 2020 31

slide-27
SLIDE 27

Max‐cardinality ordering

Figure 4.5 The max-cardinality (MC) ordering procedure.

Fall 2020 32

slide-28
SLIDE 28

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

  • rdering in Figure 4.1(d). If we connect B and C, the resulting

induced graph is chordal.

Fall 2020 33

slide-29
SLIDE 29

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

slide-30
SLIDE 30

Width vs local consistency: solving trees

Fall 2020 35

slide-31
SLIDE 31

Tree‐solving

) ( :

2

nk O complexity

Fall 2020 36

slide-32
SLIDE 32

Width‐2 and DPC

Fall 2020 37

slide-33
SLIDE 33

Width vs directional consistency

(Freuder 82)

Fall 2020 38

slide-34
SLIDE 34

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

slide-35
SLIDE 35

Adaptive‐consistency

Fall 2020 40

slide-36
SLIDE 36

Bucket elimination

Adaptive Consistency (Dechter & Pearl, 1987)

Bucket E: E D, E  C Bucket D: D A Bucket C: C B Bucket B: B  A Bucket A: A C contradiction

=

D = C B = A

=

Fall 2020 41

slide-37
SLIDE 37

Adaptive‐consistency, bucket‐elimination

Fall 2020 42

slide-38
SLIDE 38

d

  • rdering
  • along
  • width
  • induced
  • (d)

: space ,

* * *

w (d))) exp(w O(n 1)) (d) exp(w O(n  : Time

     

E D A C B

} 2 , 1 { } 2 , 1 { } 2 , 1 { } 2 , 1 { } 3 , 2 , 1 {

: ) ( A B : ) ( B C : ) ( A D : ) ( B E C, E D, E : ) ( A Bucket B Bucket C Bucket D Bucket E Bucket      

A E D C B

: ) ( E B : ) ( E C , B C : ) ( E D : ) ( B A D, A : ) ( E Bucket B Bucket C Bucket D Bucket A Bucket      

E A D C B

|| RD

BE ,

|| RE || RDB || RDCB || RACB || RAB RA RC

BE

Bucket elimination

Adaptive Consistency (Dechter & Pearl, 1987)

Fall 2020 43

slide-39
SLIDE 39

The Idea of elimination

project and join E variable Eliminate   

EC DBC EB ED DBC

R R R R

3 value assignment

D B C RDBC

eliminating E

Fall 2020 44

slide-40
SLIDE 40

Variable elimination

Eliminate variables

  • ne by one:

“constraint propagation” Solution generation after elimination is backtrack-free

3

Fall 2020 45

slide-41
SLIDE 41

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

slide-42
SLIDE 42

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

slide-43
SLIDE 43

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

slide-44
SLIDE 44

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

slide-45
SLIDE 45

Sudoku’s propagation

  • http://www.websudoku.com/
  • What kind of propagation we do?

Fall 2020 50

slide-46
SLIDE 46

Sudoku

Each row, column and major block must be alldifferent “Well posed” if it has unique solution: 27 constraints

2 3 4 6

2

Constraint propagation

  • Variables: 81 slots
  • Domains =

{1,2,3,4,5,6,7,8,9}

  • Constraints:
  • 27 not-equal

Fall 2020 51

slide-47
SLIDE 47

Sudoku

Each row, column and major block must be alldifferent “Well posed” if it has unique solution

Fall 2020 52