Exact Reasoning: AND/ OR Search and Hybrids COMPSCI 276, Fall 2014 - - PowerPoint PPT Presentation

exact reasoning and or search and hybrids
SMART_READER_LITE
LIVE PREVIEW

Exact Reasoning: AND/ OR Search and Hybrids COMPSCI 276, Fall 2014 - - PowerPoint PPT Presentation

Exact Reasoning: AND/ OR Search and Hybrids COMPSCI 276, Fall 2014 Set 8, Rina dechter Probabilistic Inference Tasks Belief updating: = = BEL(X ) P(X x | evidence) i i i Finding most probable explanation (MPE) = x * arg


slide-1
SLIDE 1

Exact Reasoning: AND/ OR Search and Hybrids

COMPSCI 276, Fall 2014 Set 8, Rina dechter

slide-2
SLIDE 2

CS 276 2

Probabilistic Inference Tasks

=

X/A a * k * 1

e) , x P( max arg ) a ,..., (a evidence) | x P(X ) BEL(X

i i i

= =

  • Belief updating:
  • Finding most probable explanation (MPE)
  • Finding maximum a-posteriory hypothesis
  • Finding maximum-expected-utility (MEU) decision

e) , x P( max arg * x

x

= ) x U( e) , x P( max arg ) d ,..., (d

X/D d * k * 1

=

variables hypothesis : X A ⊆ function utility x variables decision : ) ( : U X D ⊆

slide-3
SLIDE 3

CS 276 3

Belief Updating

lung Cancer Smoking X-ray Bronchitis Dyspnoea

P (lung cancer= yes | smoking= no, dyspnoea= yes ) = ?

slide-4
SLIDE 4

CS 276 4

slide-5
SLIDE 5

CS 276 5

Conditioning generates the probability tree

∑ ∑ ∑ ∑

=

= = ) , | ( ) , | ( ) | ( ) | ( ) ( ) , (

e b c b

c b e P b a d P a c P a b P a P e a P

Complexity of conditioning: exponential time, linear space

slide-6
SLIDE 6

CS 276 6

Conditioning+ Elimination

∑ ∑ ∑ ∑

=

= = ) , | ( ) , | ( ) | ( ) | ( ) ( ) , (

e d c b

c b e P b a d P a c P a b P a P e a P

Idea: conditioning until of a (sub)problem gets small

* w

slide-7
SLIDE 7

CS 276 7

Loop-cutset decomposition

 You condition until you get a polytree B C

B

F

A

B C

B

F

A= 0 A= 0

A= 0

B C

B

F

A= 1 A= 1

A= 1

P(B|F= 0) = P(B, A= 0|F= 0)+ P(B,A= 1|F= 0) A= 0 A= 1 Loop-cutset method is time exp in loop-cutset size And linear space

slide-8
SLIDE 8

CS 276 8

OR search space

A D B C E F

1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

E C F D B A

1

Ordering: A B E C D F

slide-9
SLIDE 9

CS 276 9

AND/OR search space

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1

A D B C E F A D B C E F

Primal graph DFS tree

A D B C E F A D B C E F

slide-10
SLIDE 10

CS 276 10

OR vs AND/OR

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

AND/ OR OR

A D B C E F A D B C E F

1 1 1 1

slide-11
SLIDE 11

CS 276 11

AND/OR vs. OR

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1 A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

AND/ OR OR

A D B C E F A D B C E F

AND/ OR size: exp(4), OR size exp(6)

slide-12
SLIDE 12

CS 276 12

AND/OR vs. OR

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1 A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

E

1 1 1 1

C

1 1 1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

B

1 1

A

1

AND/ OR OR

A D B C E F A D B C E F No-goods (A= 1,B= 1) (B= 0,C= 0)

slide-13
SLIDE 13

CS 276 13

AND/OR vs. OR

E

1 1 1

C

1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1

B

1

A

1 A

OR AND

1 B

OR

B

AND

1 E

OR

C E C E C

OR

D F D F D F D F

AND

1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1

E

1 1 1

C

1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1

B

1

A

1

E

1 1 1

C

1 1 1 1 1 1

F

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

D

1 1 1 1 1 1 1 1

B

1

A

1

AND/ OR OR

A D B C E F A D B C E F (A= 1,B= 1) (B= 0,C= 0)

slide-14
SLIDE 14

CS 276 14

OR space vs. AND/OR space

width height

OR space AND/OR space

time(sec.) nodes backtracks time(sec.) AND nodes OR nodes

5 10 3.154 2,097,150 1,048,575 0.03 10,494 5,247 4 9 3.135 2,097,150 1,048,575 0.01 5,102 2,551 5 10 3.124 2,097,150 1,048,575 0.03 8,926 4,463 4 10 3.125 2,097,150 1,048,575 0.02 7,806 3,903 5 13 3.104 2,097,150 1,048,575 0.1 36,510 18,255 5 10 3.125 2,097,150 1,048,575 0.02 8,254 4,127 6 9 3.124 2,097,150 1,048,575 0.02 6,318 3,159 5 10 3.125 2,097,150 1,048,575 0.02 7,134 3,567 5 13 3.114 2,097,150 1,048,575 0.121 37,374 18,687 5 10 3.114 2,097,150 1,048,575 0.02 7,326 3,663

slide-15
SLIDE 15

CS 276 15

AND/OR search tree for graphical models

The AND/ OR search tree of a GM relative to a spanning-tree, T, has:

Alternating levels of: OR nodes (variables) and AND nodes (values)

Successor function:

The successors of OR nodes X are all its consistent values along its path

The successors of AND < X,v> are all X child variables in T

A solution is a consistent subtree

Task: compute the value of the root node

A B E

OR AND OR AND OR AND

C

OR AND

D 1 F 1 1 D 1 F 1 1 1 E C D 1 F 1 1 D 1 F 1 1 1 B E C D 1 F 1 1 D 1 F 1 1 1 E C D 1 F 1 1 D 1 F 1 1

A D B C E F A D B C E F

slide-16
SLIDE 16

CS 276 16

From DFS Trees to Pseudo-Trees (Freuder 85, Bayardo 95)

(a) Graph

4 6 1 3 2 7 5

(b) DFS tree depth=3 (c) pseudo- tree depth=2 (d) Chain depth=6

4 6 1 3 2 7 5 2 7 1 4 3 5 6 4 6 1 3 2 7 5

slide-17
SLIDE 17

Pseudo-tree definition

CS 276 17

Given undirected graph G = (V, E), a directed rooted tree T = (V, E′) defined

  • n all its nodes is a pseudo tree if any arc of G which is not included in E′ is

a back-arc in T , namely it connects a node in T to an ancestor in T . The

arcs in E′ may not all be included in E.

Given a pseudo tree T of G, the extended graph of G relative to T includes

also the arcs in E′ that are not in E: as GT = (V, E ∪ E′).

slide-18
SLIDE 18

CS 276 18

From DFS trees to Pseudo-trees

a 1 2 a 3 a 4

OR AND OR AND OR AND AND OR

b a b c c b 4 b a c c 4 b a c b 3 a 4 b a c b 4 b a c c 4 b a c c 3 a 4 b a c b 4 b a c c 4 b a c 7 a 5 a 6 b a c b 6 b a c c 6 b a c b 5 a 6 b a c b 6 b a c c 6 b a c c 5 a 6 b a c b 6 b a c c 6 b a c a 1 3 a 4 b c

OR AND OR AND OR AND

b c a 2 b c a b 4 b c a 2 b c a c 4 b c a 2 b c a 5 a 7 b c a 6 b c a b 7 b c a 6 b c a c 7 b c a 6 b c a

DFS tree depth = 3 pseudo- tree depth = 2

slide-19
SLIDE 19

CS 276 19

Finding min-depth Pseudo-trees

 Finding min depth DFS, or pseudo tree is NP-

complete, but:

 Given a tree-decomposition whose tree-width is

w* , there exists a pseudo -tree T of G whose depth, satisfies m < = w* log n,

slide-20
SLIDE 20

CS 276 20

Generating pseudo-trees from Bucket trees

F A C B D E E A C B D F (AF) (EF) (A) (AB) (AC) (BC) (AE) (BD) (DE)

Bucket-tree based on d d: A B C E D F

E A C B D F

Induced graph

E A C B D F

Bucket-tree used as pseudo-tree

AND AND AND AND

1

B

OR

B

1 1

C

OR

E C E C E C E

OR

D F D F D F D F D F D F D F D F

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

A

OR

AND/OR search tree Bucket-tree

ABE A ABC AB BDE AEF

bucket-A bucket-E bucket-B bucket-C bucket-D bucket-F

(AE) (BE)

Note: we plot order from top to bottom here

slide-21
SLIDE 21

Constructing Pseudo Trees

 Min-Fill

 Depth-first traversal of the induced graph obtained

along the min-fill elimination order, or generate the bucket-tree

 Variables ordered according to the smallest “fill-set”

 Hypergraph Partitioning

 Functions are vertices in the hypergraph and variables

are hyperedges

 Recursive decomposition of the hypergraph while

minimizing the separator size at each step

 Using state-of-the-art software package hMeTiS

(Kjaerulff, 1990) (Karypis and Kumar, 2000)

slide-22
SLIDE 22

Quality of the Pseudo Trees

Network

hypergraph min-fill

width depth width depth barley 7

13

7 23 diabetes 7

16

4 77 link 21

40

15 53 mildew 5

9

4 13 munin1 12

17

12 29 munin2 9

16

9 32 munin3 9

15

9 30 munin4 9

18

9 30 water 11

16

10 15 pigs 11

20

11 26 Network

hypergraph min-fill

width depth width depth spot5 47 152

39

204 spot28 108 138

79

199 spot29 16 23

14

42 spot42 36 48

33

87 spot54 12 16

11

33 spot404 19 26

19

42 spot408 47 52

35

97 spot503 11 20

9

39 spot505 29 42

23

74 spot507 70 122

59

160

Bayesian Networks Repository SPOT5 Benchmarks

slide-23
SLIDE 23

CS 276 23

AND/OR Search-tree properties (k

(k = domain size, m = pseudo-tree height. n = number of variables)

 Theorem: Any AND/OR search tree based on a pseudo-

tree is sound and complete (expresses all and only solutions)

 Theorem: Size of AND/OR search tree is O(n km)

Size of OR search tree is O(kn)

 Theorem: Size of AND/OR search tree can be bounded

by O(exp(w* log n))

 When the pseudo-tree is a chain we get an OR space

slide-24
SLIDE 24

CS 276 24

Tasks and value of nodes

V( n) is the value of the tree T(n) for the task:

Counting: v(n) is number of solutions in T(n)

Consistency: v(n) is 0 if T(n) inconsistent, 1 othewise.

Optimization: v(n) is the optimal solution in T(n)

Belief updating: v(n), probability of evidence in T(n).

Partition function: v(n) is the total probability in T(n).

Goal: compute the value of the root node recursively using

dfs search of the AND/ OR tree.

 Theorem: Complexity of AO dfs search is

 Space: O(n)  Time:

O(n km)

 Time:

O(exp(w* log n))

slide-25
SLIDE 25
slide-26
SLIDE 26

CS 276 26

A C B D E A D B C E

A B E D 1 C 1 C 1 1 1 E D 1 C 1 C 1 1 1 B E D 1 C 1 C 1 1 1 E D 1 C 1 C 1 1

Belief-updating on example

slide-27
SLIDE 27

CS 276 27

slide-28
SLIDE 28

A weight of a Solution Tree

28

slide-29
SLIDE 29

CS 276 29

A B E D 1 C 1 1 C 1 1 E D 1 C 1 1 C 1 P(A=0) P(B=0|A=0) P(B=1|A=0) P(E=0|A=0,B=0) P(D=0|B=0,C=0)× P(C=0|A=0) P(D=1|B=1,C=1)× P(C=1|A=0) P(D=0|B=0,C=1)× P(C=1|A=0) P(D=1|B=0,C=0)× P(C=0|A=0) P(D=1|B=0,C=1)× P(C=1|A=0) P(D=0|B=1,C=0)× P(C=0|A=0) P(D=0|B=1,C=1)× P(C=1|A=0) P(D=1|B=1,C=0)× P(C=0|A=0) P(E=1|A=0,B=0) P(E=0|A=0,B=1) P(E=1|A=0,B=1)

A C B D E A D B C E

Buckets relative to a pseudo-tree: BT (Xi) = { f ∈ F | Xi ∈ scope(f), scope(f) ⊆ pathT (Xi)} .

slide-30
SLIDE 30

30

AND/OR Tree DFS Algorithm (Belief Updating)

AND node: Combination operator (product) OR node: Marginalization operator (summation) Value of node = updated belief for sub-problem below

A B E

OR AND OR AND OR AND

C

OR AND

D 1 1 D 1 1 1 E C D 1 1 D 1 1 1 B E C D 1 1 D 1 1 1 E C D 1 1 D 1 1

A D B C E A D B C E B C D= 0 D= 1 0 0

.2 .8

0 1

.1 .9

1 0

.3

.7 1 1

.5 .5

) , | ( C B D P

.7 .8 .9 .5 .7 .8 .9 .5

Evidence: D= 1

A B E= 0 E= 1 0 0 .4

.6

0 1

.5 .5

1 0

.7 .3

1 1

.2 .8

) , | ( B A E P

Evidence: E= 0

.4 .5 .7 .2 A B= 0 B= 1

.4 .6

1

.1 .9

) | ( A B P

A C= 0 C= 1

.2 .8

1

.7 .3

) | ( A C P

A P(A)

.6

1

.4

) (A P

.2 .8 .2 .8 .1 .9 .1 .9 .4 .6 .1 .9 .6 .4 .8 .9 .8 .9 .7 .5 .7 .5 .8 .9 .8 .9 .7 .5 .7 .5 .4 .5 .7 .2 .88 .54 .89 .52 .352 .27 .623 .104 .3028 .1559 .24408 .3028 .1559

Result: P(D= 1,E= 0)

slide-31
SLIDE 31

CS 276 31

Complexity of AND/OR Tree Search

AND/OR tree OR tree Space O(n) O(n) Time

O(n km) O(n kw* log n)

[Freuder & Quinn85], [Collin, Dechter & Katz91], [Bayardo & Miranker95], [Darwiche01]

O(kn)

k = domain size m = height of pseudo-tree n = number of variables w* = treewidth

slide-32
SLIDE 32

CS 276 32

From Search Trees to Search Graphs

 Any two nodes that root identical subtrees

(subgraphs) can be merged

slide-33
SLIDE 33

CS 276 33

From Search Trees to Search Graphs

 Any two nodes that root identical subtrees

(subgraphs) can be merged

slide-34
SLIDE 34

CS 276 34

AND/ OR Tree

A D B C E F A D B C E F G H J K G H J K

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND AND

1 1 1 1 1 1 1 1

OR OR AND AND

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

slide-35
SLIDE 35

CS 276 35

An AND/OR graph

A D B C E F A D B C E F G H J K G H J K

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND AND

1 1 1 1 1 1 1 1

OR OR AND AND

G H H

0 1 0 1 0 1

1 G H H

0 1 0 1 0 1

J K K

0 1 0 1 0 1

1 J K K

0 1 0 1 0 1

slide-36
SLIDE 36

CS 276 36

Merging Based on Context

One way of recognizing nodes that can be merged:

context (X) = ancestors of X in pseudo tree that are connected to X, or to descendants of X

[ ] [A] [AB] [AE] [BC] [AB]

A D B E C F

pseudo tree

A E C B F D A E C B F D

slide-37
SLIDE 37

Context-Based Minimal AND/OR Search Graph

CS 276 37

Definiti tion

  • n 7

7.2.13 ( (con

  • nte

text m t minimal AND/OR search gr graph) The AND/OR search graph of M guided by a pseudo-tree T that is closed under context-based merge operator, is called the context minimal AND/OR search graph and is denoted by CT (R).

slide-38
SLIDE 38

CS 276 38

AND/OR Search Graph

A E C B F D

A D B E C F

A B C RABC 0 0 0 1 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 A B E RABE 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 1 A E F RAEF 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 B C D RBCD 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 1 1

Constraint Satisfaction – Counting Solutions

[ ] [A] [AB] [AE] [BC] [AB] Context

pseudo tree

context minimal graph

A

OR AND

B

OR AND OR

E

OR AND AND

1 C D D 1 1 1 1 E F F 1 1 1 C D D 1 1 1 1 B E F F 1 1 1 C 1 1 E 1 C 1

slide-39
SLIDE 39

CS 276 39

.8 .9 .7 .7 .8

AND/OR Tree DFS Algorithm (Belief Updating)

AND node: Combination operator (product) OR node: Marginalization operator (summation) Value of node = updated belief for sub-problem below

A B E C D 1 1 D 1 1 1 E C D 1 1 D 1 1 1 B E C D 1 1 D 1 1 1 E C D 1 1 D 1 1

B C D= 0 D= 1 0 0

.2 .8

0 1

.1 .9

1 0

.3

.7 1 1

.5 .5

) , | ( C B D P

.7 .8 .9 .5 .7 .8 .9 .5

Evidence: D= 1

A B E= 0 E= 1 0 0 .4

.6

0 1

.5 .5

1 0

.7 .3

1 1

.2 .8

) , | ( B A E P

Evidence: E= 0

.4 .5 .7 .2 A B= 0 B= 1

.4 .6

1

.1 .9

) | ( A B P

A C= 0 C= 1

.2 .8

1

.7 .3

) | ( A C P

A P(A)

.6

1

.4

) (A P

.2 .8 .2 .8 .1 .9 .1 .9 .4 .6 .1 .9 .6 .4 .9 .8 .9 .5 .7 .5 .8 .9 .5 .7 .5 .4 .5 .7 .2 .88 .54 .89 .52 .352 .27 .623 .104 .3028 .1559 .24408 .3028 .1559

Result: P(D= 1,E= 0)

A D B C E

[ ] [A] [AB] [BC] [AB] Context

A D B C E

slide-40
SLIDE 40

CS 276 40

.7 .8

AND/OR Graph DFS Algorithm (Belief Updating)

A B E C D 1 1 D 1 1 1 E C D 1 1 D 1 1 1 B E C 1 1 1 E C 1 1

A D B C E B C D= 0 D= 1 0 0

.2 .8

0 1

.1 .9

1 0

.3

.7 1 1

.5 .5

) , | ( C B D P

.7 .8 .9 .5

Evidence: D= 1

A B E= 0 E= 1 0 0 .4

.6

0 1

.5 .5

1 0

.7 .3

1 1

.2 .8

) , | ( B A E P

Evidence: E= 0

.4 .5 .7 .2 A B= 0 B= 1

.4 .6

1

.1 .9

) | ( A B P

A C= 0 C= 1

.2 .8

1

.7 .3

) | ( A C P

A P(A)

.6

1

.4

) (A P

.2 .8 .2 .8 .1 .9 .1 .9 .4 .6 .1 .9 .6 .4 .9 .8 .9 .5 .7 .5 .8 .9 .7 .5 .4 .5 .7 .2 .88 .54 .89 .52 .352 .27 .623 .104 .3028 .1559 .24408 .3028 .1559 A D B C E

[ ] [A] [AB] [BC] [AB] Context

B C Value 0 0 .8 0 1 .9 1 0 .7 1 1 .1

Cache table for D

Result: P(D= 1,E= 0)

slide-41
SLIDE 41

CS 276 41

AND/OR context minimal graph

C K H L 1 N N 1 1 F F F 1 1 1 1 F G 0 1 1 A 1 B B 1 1 E E E E 1 1 J J J J 1 1 A 1 B B 1 1 E E E E 1 1 J J J J 1 1 G 0 1 G 0 1 G 0 1 M 0 1 M 0 1 M 0 1 M 0 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 L 1 N N 1 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 D 0 1 D 0 1 D 0 1 D 0 1 K H L 1 N N 1 1 1 1 A 1 B B 1 1 E E E E 1 1 J J J J 1 1 A 1 B B 1 1 E E E E 1 1 J J J J 1 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 L 1 N N 1 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 D 0 1 D 0 1 D 0 1 D 0 1

B A C E F G H J D K M L N O P C H K D M F G A B E J O L N P [AB] [AF] [CHAE] [CEJ] [CD] [CHAB] [CHA] [CH] [C] [ ] [CKO] [CKLN] [CKL] [CK] [C]

(C K H A B E J L N O D P M F G)

C H K D M F G A B E J O L N P [AB] [AF] [CHAE] [CEJ] [CD] [CHAB] [CHA] [CH] [C] [ ] [CKO] [CKLN] [CKL] [CK] [C]

(C K H A B E J L N O D P M F G)

slide-42
SLIDE 42

CS 276 42

How Big Is the Context?

Theorem: The maximum context size for a pseudo tree is equal to the treewidth of the graph along the pseudo tree.

C H K D M F G A B E J O L N P [AB] [AF] [CHAE] [CEJ] [CD] [CHAB] [CHA] [CH] [C] [ ] [CKO] [CKLN] [CKL] [CK] [C]

(C K H A B E J L N O D P M F G)

B A C E F G H J D K M L N O P

max context size = treewidth

slide-43
SLIDE 43

CS 276 43

G E K F L H C B A M J D

Treewidth vs. Pathwidth

E K L H C A M J ABC BDEF BDFG EFH FHK HJ KLM

t reew eew idt h = 3 = (max cluster size) - 1

ABC BDEFG EFH FHKJ KLM

pa pat hw idt dt h = 4 = (max cluster size) - 1

D G B F

TREE CHAIN

slide-44
SLIDE 44

Tasks and value of nodes

V( n) is the value of the tree T(n) for the task:

Counting: v(n) is number of solutions in T(n)

Consistency: v(n) is 0 if T(n) inconsistent, 1 othewise.

Optimization: v(n) is the optimal solution in T(n)

Belief updating: v(n), probability of evidence in T(n).

Partition function: v(n) is the total probability in T(n).

 Theorem: Complexity of AO dfs search

tree is

 Space: O(n)  Time:

O(n km)

 Time:

O(exp(w* log n))

 Theorem: Complexity of AO dfs search tree is

 Space: O(n kw* )  Time:

O(n kw* )

We can have hybrids trading space for time

slide-45
SLIDE 45

CS 276 45

Complexity of AND/OR Graph Search

AND/OR graph OR graph Space

O(n kw*) O(n kpw*)

Time

O(n kw*) O(n kpw*)

k = domain size n = number of variables w* = treewidth pw* = pathwidth

w* ≤ pw* ≤ w* log n

slide-46
SLIDE 46

CS 276 46

Searching AND/OR Graphs

 AO(i): searches depth-first, cache i-context

 i = the max size of a cache table (i.e.

number of variables in a context)

i= 0 i= w*

Space: O(n) Time: O(exp(w* log n)) Space: O(exp w* ) Time: O(exp w* )

Space: O(exp(i) ) Time: O(exp(m_i+ i )

i

slide-47
SLIDE 47

CS 276 47

All four search spaces

E C F D B A

1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1

B

OR

B

AND

1 1

E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

E C F D B A

1 1 1 1 1

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1

AND

1 0 1 1 1 1

Full OR search tree Full AND/ OR search tree Context minimal OR search graph Context minimal AND/ OR search graph

A D B C E F A D B C E F

slide-48
SLIDE 48

CS 276 48

All four search spaces

E C F D B A

1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1

B

OR

B

AND

1 1

E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

AND

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

E C F D B A

1 1 1 1 1

A

OR AND

1 B

OR

B

AND

1 1 E

OR

C E C E C E C

OR

D F D F D F D F D F D F D F D F

AND

1 1

AND

1 0 1 1 1 1

Full OR search tree Full AND/ OR search tree Context minimal OR search graph Context minimal AND/ OR search graph

A D B C E F A D B C E F

Time- space

slide-49
SLIDE 49

The impact of the pseudo-tree

C K H L 1 N N 0 1 0 1 F F F 1 1 0 1 0 1 F G 1 1 A 1 B B 0 1 0 1 E E E E 0 1 0 1 J J J J 0 1 0 1 A 1 B B 0 1 0 1 E E E E 0 1 0 1 J J J J 0 1 0 1 G 1 G 1 G 1 M 1 M 1 M 1 M 1 P 1 P 1 O 1 O 1 O 1 O 1 L 1 N N 0 1 0 1 P 1 P 1 O 1 O 1 O 1 O 1 D 1 D 1 D 1 D 1 K H L 1 N N 0 1 0 1 1 1 A 1 B B 0 1 0 1 E E E E 0 1 0 1 J J J J 0 1 0 1 A 1 B B 0 1 0 1 E E E E 0 1 0 1 J J J J 0 1 0 1 P 1 P 1 O 1 O 1 O 1 O 1 L 1 N N 0 1 0 1 P 1 P 1 O 1 O 1 O 1 O 1 D 1 D 1 D 1 D 1

B A C E F G H J D K M L N O P C H K D M F G A B E J O L N P [AB] [AF] [CHAE] [CEJ] [CD] [CHAB] [CHA] [CH] [C] [ ] [CKO] [CKLN] [CKL] [CK] [C]

(C K H A B E J L N O D P M F G) (C D K B A O M L N P J H E F G)

F [AB] G [AF] J [ABCD] D [C] M [CD] E [ABCDJ] B [CD] A [BCD] H [ABCJ] C [ ] P [CKO] O [CK] N [KLO] L [CKO] K [C]

C 1 D 0 1 N 0 1 D 0 1 K 0 1 K 0 1 B 0 1 B 0 1 B 0 1 B 0 1 M 0 1 M 0 1 M 0 1 M 0 1 A 0 1 A 0 1 A 0 1 A 0 1 A 0 1 A 0 1 A 0 1 A 0 1 F 0 1 F 0 1 F 0 1 F 0 1 G 0 1 G 0 1 G 0 1 G 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 J 0 1 E 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 E 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 H 0 1 O 0 1 O 0 1 O 0 1 O 0 1 L 0 1 L 0 1 L 0 1 L 0 1 L 0 1 L 0 1 L 0 1 L 0 1 P 0 1 P 0 1 P 0 1 P 0 1 P 0 1 P 0 1 P 0 1 P 0 1 N 0 1 N 0 1 N 0 1 N 0 1 N 0 1 N 0 1 N 0 1

What is a good pseudo-tree? How to find a good one?

W= 4,h= 8 W= 5,h= 6

classes6-7 huji

Min-Fill

(Kjaerulff90)

Hypergraph Partitioning (h-Metis)

slide-50
SLIDE 50

Dead Caches

slide-51
SLIDE 51

AND/OR Context Minimal Graph

C K H L 1 N N 1 1 F F F 1 1 1 1 F G 0 1 1 A 1 B B 1 0 1 E E E E 1 0 1 J J J J 1 0 1 A 1 B B 0 1 0 1 E E E E 0 1 0 1 J J J J 0 1 0 1 G 0 1 G 0 1 G 0 1 M 0 1 M 0 1 M 0 1 M 0 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 L 1 N N 1 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 D 0 1 D 0 1 D 0 1 D 0 1 K H L 1 N N 1 1 1 1 A 1 B B 1 0 1 E E E E 1 0 1 J J J J 1 0 1 A 1 B B 1 0 1 E E E E 1 0 1 J J J J 1 0 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 L 1 N N 1 1 P 0 1 P 0 1 O 0 1 O 0 1 O 0 1 O 0 1 D 0 1 D 0 1 D 0 1 D 0 1

B A C E F G H J D K M L N O P C H K D M F G A B E J O L N P [AB] [AF] [CHAE] [CEJ] [CD] [CHAB] [CHA] [CH] [C] [ ] [CKO] [CKLN] [CKL] [CK] [C]

(C K H A B E J L N O D P M F G)

Variable Elimination AND/ OR Search

slide-52
SLIDE 52

CS 276 52

Available code

 http://graphmod.ics.uci.edu/group/Software

slide-53
SLIDE 53

CS 276 53

slide-54
SLIDE 54

CS 276 54

The recursive value rule

slide-55
SLIDE 55

AND/OR Search for Mixed Networks

 Read chapter 8.  No-good and good learning are

automatically performed by AND/OR (backjumping) and by caching.

classes6-7 huji

slide-56
SLIDE 56

AND/OR backtrack-free

CS 276 56

slide-57
SLIDE 57

AND/OR CPE (constraint probability evaluation)

slide-58
SLIDE 58

The Effect of Constraint Propagation in AND/OR CPE

1 2 A C 3 4 B C B 2 3 4 E D 3 4 3 4 H G 4 4 G I 4 I D 4 G E D 2 3 4 F F 4 K F 4 K 3 K 4 3 4 3 4 4 G D D 4 K F F B 4 D B

A D B C E F G H I K > > >

Domains are {1,2,3,4}

1 A C B 2 E D 3 3 H 4 4 I 4 2 F 3 K 4 G

CONSTRAINTS ONLY FORWARD CHECKING MAINTAINING ARC CONSISTENCY

1 2 A C 3 B C B 2 3 E D 3 3 H G 4 4 I 4 D 2 3 F F 3 K 4 3 3 D F B

A D B C E F G H I K

slide-59
SLIDE 59

Search for MPE/MAP problem

 Searching the AND/OR space by

 Branch and bound  Best-first

classes6-7 huji

slide-60
SLIDE 60

Searching the AND/OR space for MPE/MAP

Heuristic function f(xp) computes a lower bound on the best extension of xp and can be used to guide a heuristic search algorithm. We focus on:

  • 1. DF Branch-and-Bound

Use heuristic function f(xp) to prune the depth-first search tree Linear space

  • 2. Best-First Search

Always expand the node with the highest heuristic value f(xp) Needs lots of memory

f ≤ L L

classes6-7 huji

slide-61
SLIDE 61

AND/OR Branch-and-Bound (AOBB)

(Marinescu & Dechter, IJCAI’05)

61

n g(n) h(n)

lb(n) = g(n) + h(n) Maintain ub = best solution found so far

Prune subtree below n if lb(n) ≥ ub estimates the optimal cost below n

slide-62
SLIDE 62

CS 276 62

AND/OR w-cutset

A C B K G L D F H M J E A C B K G L D F H M J E A C B K G L D F H M J E C B K G L D F H M J E

3-cutset

A C B K G L D F H M J E C K G L D F H M J E

2-cutset

A C B K G L D F H M J E L D F H M J E

1-cutset

slide-63
SLIDE 63

CS 276 63

AND/OR w-cutset

A C B K G L D F H M J E A C B K G L D F H M J E A C B K G L D F H M J E

pseudo tree 1-cutset tree grahpical model

slide-64
SLIDE 64

CS 276 64

w-cutset Trees Over AND/ OR space

 Definition:

 T_w is a w-cutset tree relative to backbone tree T, iff T_w is

roots T and when removed, yields tree-width w.

 Theorem:

 AO(i) time complexity for pseudo-tree T is time

O(exp(i+ m_i)) and space O(i), m_i is the depth of the T_i tree.

 Better than w-cutset: O(exp(i+ c_i)) when c_i is the

number of nodes in T_i