slides set 9
play

Slides Set 9: AND/OR search for Probabilistic Networks Rina - PowerPoint PPT Presentation

Algorithms for Reasoning with graphical models Slides Set 9: AND/OR search for Probabilistic Networks Rina Dechter (Dechter1 chapter 6 and 7 ) slides9 828X 2019 Algorithms for Reasoning with graphical models Class6: AND/OR search for


  1. Arc Weights for AND/OR Trees ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 D E D Evidence: E=0 OR A .6 .4 AND 0 1 OR B B .4 .6 .1 .9 AND 0 1 0 1 OR E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D D D D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C OR to AND arc weight <X,x> is the B C D=0 D=1 0 0 .2 .8 product of factors that all their 0 1 .1 .9 arguments are just assigned at AND 1 0 .3 .7 1 1 .5 .5 node X=x but not before Evidence: D=1 slides9 828X 2019

  2. Cost of a Solution Tree ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 D E D Evidence: E=0 OR A .6 .4 AND 0 1 OR B B .4 .6 .1 .9 AND 0 1 0 1 OR E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D D D D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 A solution tree includes the root and has a single child for ( | , ) P D B C any OR node, and all children of any of its AND nodes B C D=0 D=1 0 0 .2 .8 0 1 .1 .9 Cost of the solution tree: the product of weights on its arcs 1 0 .3 .7 1 1 .5 .5 Cost of (A=0,B=1,C=1,D=1,E=0) = 0.6 ∙ 0.6 ∙ 0.5 ∙ 0.8 ∙ 0.5 = 0.0720 Evidence: D=1

  3. Arc Weights for AND/OR Trees OR to AND arc weight (X,x) is the product of factors f that are instantiated at the AND node X=x but not before A P(A=0) 0 B P(B=0|A=0) P(B=1|A=0) 0 1 E D E D P(E=0|A=0,B=0) P(E=1|A=0,B=0) P(E=0|A=0,B=1) P(E=1|A=0,B=1) 0 1 0 1 0 1 0 1 C C C C P(D=0|B=0,C=0)× P(D=0|B=0,C=1)× P(D=1|B=0,C=0)× P(D=1|B=0,C=1)× P(D=0|B=1,C=0)× P(D=0|B=1,C=1)× P(D=1|B=1,C=1)× P(D=1|B=1,C=0)× P(C=0|A=0) P(C=1|A=0) P(C=0|A=0) P(C=1|A=0) P(C=0|A=0) P(C=1|A=0) P(C=1|A=0) P(C=0|A=0) 0 1 0 1 0 1 0 1 slides9 828X 2019

  4. The Value Function for (Probability of Evidence) ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 P(D=1,E=0)=? D E D Evidence: E=0 OR A .6 .4 AND 0 1 OR B B .4 .6 .1 .9 OR AND 0 1 0 1 OR E C E .54 C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D .7 .5 D D . D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C Value of node = updated belief for sub‐problem below B C D=0 D=1 0 0 .2 .8 𝑤�𝑜 � � � AND node: product 0 1 .1 .9 � � ∈����������� 1 0 .3 .7 𝑥 𝑜, 𝑜 � 𝑤�𝑜 � � � 1 1 .5 .5 OR node: Marginalization by summation ��∈����������� Evidence: D=1,E=0 slides9 828X 2019

  5. The Value Function (Probability of Evidence) ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 P(D=1,E=0)=? D E D Evidence: E=0 OR .24408 A .6 .4 AND AND .3028 0 .1559 1 OR .3028 .1559 B B .4 .6 .1 .9 OR .352 (=.4 · . 88) AND .623 0 .27 1 0 .104 1 OR .5 .7 .4 E .88 C E .54 C E .89 C .2 E .52 C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND .8 .9 .7 .5 .8 .9 .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR .8 D D .9 .7 .5 .8 D D .9 .7 .5 D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C Value of node = updated belief for sub‐problem below B C D=0 D=1 0 0 .2 .8 𝑤�𝑜 � � � AND node: product 0 1 .1 .9 � � ∈����������� 1 0 .3 .7 𝑥 𝑜, 𝑜 � 𝑤�𝑜 � � � 1 1 .5 .5 OR node: Marginalization by summation ��∈����������� Evidence: D=1 slides9 828X 2019

  6. The Value Function ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 D E D Evidence: E=0 OR A .6 .4 AND 0 1 OR B B .4 .6 .1 .9 AND 0 1 0 1 OR E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D D D D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C • B C D=0 D=1 V(n) is dictated by the query of interest 0 0 .2 .8 • V(n) the value of the sub‐problem represented by T(n) 0 1 .1 .9 1 0 .3 .7 • For sum‐inference it is the probability mess below n 1 1 .5 .5 • Can be computed recursively based on child values. Evidence: D=1,E=0 slides9 828X 2019

  7. The Value Function ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 D E D Evidence: E=0 OR A .6 .4 AND 0 1 OR B B .4 .6 .1 .9 AND 0 1 0 1 OR E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D D D D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C • B C D=0 D=1 V(n) is dictated by the query of interest 0 0 .2 .8 • V(n) the value of the sub‐problem represented by T(n) 0 1 .1 .9 1 0 .3 .7 • For sum‐inference it is the probability mess below n 1 1 .5 .5 • Can be computed recursively based on child values. Evidence: D=1 slides9 828X 2019

  8. The Value Function for Optimization A A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 C A F 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 B 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 D B E C E 𝐺 ∗ � min � � 𝑔 � �𝑦 � � Objective function: � D F 5 OR w(A,0) = 0 w(A,1) = 0 A AND 5 0 1 OR 5 B 2 0 Node Value AND 6 5 0 1 (bottom‐up evaluation) 3 4 C C OR 3 1 E E 3 1 3 5 5 4 1 3 OR – minimization 0 1 AND 5 0 2 1 0 2 2 0 0 2 0 1 0 1 AND – summation 5 2 0 2 2 0 0 2 OR D D D D F F F F 5 6 4 2 3 0 2 2 2 4 1 0 3 0 2 2 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 slides9 828X 2019

  9. The Value Function for Optimization A A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 C A F 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 B 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 D B E C E 𝐺 ∗ � min � � 𝑔 � �𝑦 � � Objective function: � D F 5 OR A 0 0 5 AND 7 0 1 OR 5 7 B B 2 0 1 4 6 5 6 4 AND 0 1 0 1 3 4 C 4 4 C C 3 C OR 1 2 E E E 0 E 3 1 3 5 5 4 1 3 0 2 5 2 2 5 3 0 5 2 0 2 2 0 0 1 0 2 5 2 1 0 2 0 0 1 1 0 AND 0 1 0 1 0 1 0 1 0 1 0 1 5 2 0 2 2 0 0 2 5 2 1 0 2 0 1 0 D D D D D D OR F F D D F F F F F F AND 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 5 6 4 2 3 0 2 2 2 4 1 0 3 0 2 2 5 6 4 2 1 2 0 4 2 4 1 0 1 2 0 4 AND node = Combination operator (summation) OR node = Marginalization operator (minimization)

  10. The AND/OR Counting Value(#CSP) A A F B B C solution E C E D D F OR 11 A AND 5 6 0 1 OR 5 B B 6 OR node: Marginalization operator (summation) AND 4 1 0 0 4 2 1 1 OR 2 2 1 E C 1 E C 4 2 E C 1 E 1 C AND node: Combination operator (product) AND 2 0 0 0 1 0 1 1 0 1 0 1 2 1 0 1 0 1 2 0 1 0 1 1 1 1 1 0 1 0 0 1 OR 2 1 2 0 1 1 1 D F D F 0 D 2 F 1 D 2 F 1 1 1 D F D F 1 D F D F 1 AND 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 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 Value of node = number of solutions below it slides9 828X 2019

  11. Summary: AND/OR Search Tree for GMs • The AND/OR search tree of R relative to a pseudo‐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 A – The successors of AND <X,v> are all X child variables in T F – Arc‐weight are assigned from the model factors B C • E D A solution is a consistent subtree. Its cost, the product of the weights. • Query: compute the value of the root node A B E C OR A D F AND 0 1 OR B B AND 0 1 0 1 OR E C E C E C E C AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D F D F D F D F D F D F D F D F AND 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 slides9 828X 2019

  12. Size and Traversal of AND/OR Search Tree AND/OR tree OR tree Space O(n) O(n) O(n k h ) O(k n ) Size= O(n k w* log n ) Time (Freuder & Quinn85), (Collin, Dechter & Katz91), (Bayardo & Miranker95), (Darwiche01) k = domain size h= height of pseudo‐tree ∗ h n = number of variables w*= treewidth slides9 828X 2019

  13. AND/OR vs. OR Spaces OR space AND/OR space width height Time (sec.) Nodes Time (sec.) AND nodes OR nodes 5 10 3.15 2,097,150 0.03 10,494 5,247 4 9 3.13 2,097,150 0.01 5,102 2,551 5 10 3.12 2,097,150 0.03 8,926 4,463 4 10 3.12 2,097,150 0.02 7,806 3,903 5 13 3.11 2,097,150 0.10 36,510 18,255 Random graphs with 20 nodes, 20 edges and 2 values per node slides9 828X 2019

  14. Pseudo‐trees slides9 828X 2019

  15. PseudoTree Definition Given undirected graph G = (V, E), a directed rooted tree T = (V, E′) defined on 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′). slides9 828X 2019

  16. Pseudo Trees A psedo‐tree of a graph is a tree spanning its nodes, where all arcs in the graph not in the tree are back‐arcs 1 4 1 6 2 3 2 7 5 3 ∗ h (a) Graph 4 7 1 1 2 7 5 3 5 3 5 4 2 7 6 6 4 6 (b) DFS tree (c) Pseudo tree (d) Chain height=3 height=2 height=6 slides9 828X 2019

  17. Extended Graphs Question: given, n,k,w,h,b develop and expression that study the size of the AND/OR search tree As a function of these parameters, which are not independent of each other slides9 828X 2019

  18. From DFS‐Trees to Pseudo‐Trees 4 1 6 6 7 2 4 6 4 5 3 3 5 2 7 1 1 3 2 7 5 (c) (b) (a) 237 AND nodes 1 OR a b c AND 2 7 2 7 2 7 OR b c b c a c a c a b a b AND 3 3 5 5 3 3 5 5 3 3 5 5 OR a c a b a c a b b c a b b c a b b c a c b c a c AND OR 4 4 4 4 6 6 6 6 4 4 4 4 6 6 6 6 4 4 4 4 6 6 6 6 b c b b c c b c b b c c a c a c a c a c a c a c a a b b a b a a b b a b AND 1 OR 108 AND nodes a b c AND 3 5 3 5 3 5 OR a b c a b c a b c a b c a b c a b c AND 4 2 4 2 4 2 7 6 7 6 7 6 4 2 4 2 4 2 7 6 7 6 7 6 4 2 4 2 4 2 7 6 7 6 7 6 OR AND b c b c c c b b b c b c c c b b c c a c a c a a c c a c a c a a b b a a a b a b b b a a a b a b slides9 828X 2019

  19. From DFS to Pseudo Trees OR 1 AND a b c OR 2 7 AND a b c a b c DFS tree OR 3 3 3 5 5 5 AND a b c a b c a b c a b c a b c a b c depth = 3 OR 4 4 4 4 4 4 4 4 4 6 6 6 6 6 6 6 6 6 AND a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c OR 1 AND a b c OR 3 5 AND a b c a b c pseudo- tree OR 4 2 4 2 4 2 7 6 7 6 7 6 depth = 2 AND a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c slides9 828X 2019

  20. Finding Min‐Depth Pseudo‐Trees • Finding min depth DFS, or pseudo tree is NP‐ complete, but: • Given a tree‐decomposition whose treewidth is w*, there exists a pseudo ‐tree T of G whose depth, satisfies h <= w* log n, slides9 828X 2019

  21. Finding Min‐height Pseudo‐Trees • Finding a min height pseudo‐tree is NP‐complete, but: • Given a tree‐decomposition with treewidth w*, there exists a pseudo‐tree whose height satisfies – h <= w* log n • Optimality of h and w* cannot be achieved at once. 4 1 2 2 6 3 3 7 5 1 W*=1 4 h=7 5 6 w*=2 h=3 7 slides9 828X 2019

  22. AND/OR Search‐tree properties (k = domain size, h = 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 k h ) Size of OR search tree is O(k n ) • 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 slides9 828X 2019

  23. Summary: Queries 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. – Max‐Inference: v(n) is the optimal solution in T(n) – Sum‐Inference: v(n) is probability of evidence in T(n). – Mixed‐Inference: v(n) is the marginal map in T(n). • Goal : compute the value of the root node recursively traversing the AND/OR tree. Complexity of searching depth‐first is – Space: O(n) O(n 𝑙 � ) – Time: – Time: 𝑃�𝑙 �∗���� � slides9 828X 2019

  24. Outline: Search • Review Graphical Modes OR A • AND/OR search spaces, pseudo‐trees AND 0 1 OR B B – AND/OR search trees AND 0 1 0 1 OR C C C C E E E E AND 0 1 0 1 0 1 0 1 – AND/OR search graphs OR D D F F D D F F AND 01 01 – Generating good pseudo‐trees Context minimal AND/OR search graph – Brute‐force AND/OR 18 AND nodes • Heuristic search (HS) for AND/OR spaces – Basic Heuristic search (Depth and Best) – AND/OR Depth‐first HS (branch and bound) – AND/OR Best‐first heuristic search – The Guiding MBE heuristic – Marginal Map (max‐sum‐product) A=yellow A=green • Hybrids of search and Inference E D M B=blue B=green B=red B=blue L C A E D M E D M E D M E D M • Summary and Class 2 L L L L B K C C C C H F K K K K G J H H H H F F F F G G G G J J J J slides9 828X 2019

  25. From Search Trees to Search Graphs • Any two nodes that root identical subtrees or subgraphs can be merged slides9 828X 2019

  26. From Search Trees to Search Graphs • Any two nodes that root identical subtrees or subgraphs can be merged slides9 828X 2019

  27. J A A AND/OR Tree F B B C K E C E D D F G J G H OR A H K AND 0 1 OR B B AND 0 1 0 1 OR E C E C E C E C AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D F D F D F D F D F D F D F D F AND 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 G G J J G G J J J J G G J J G G J J G G J J G G J J G G J J OR G G AND 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 OR H H H H K K K K H H H H K K K K H H H H K K K K H H H H K K K K H H H H K K K K H H H H K K K K H H H H K K K K H H H H K K K K AND 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 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 slides9 828X 2019

  28. J A A AND/OR Graph F B B C K E C E D D F G J G H OR A H K AND 0 1 OR B B AND 0 1 0 1 OR E C E C E C E C AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D F D F D F D F D F D F D F D F AND 0 1 0 1 G G J J OR AND 0 1 0 1 0 1 0 1 OR H H H H K K K K AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 slides9 828X 2019

  29. Merging Based on Context • context (X) = ancestors of X in pseudo tree, connected to X, or to descendants of X C C A A F F • context (X) = parents in the D D B B E E induced graph • max |context| = induced width [ ] A = treewidth B [A ] [ AB ] [ A B ] C E pseudo tree [AE ] D F [ BC ] context( ) = [ ] slides9 828X 2019

  30. Context‐Based Minimal AND/OR Search Graph Definition 7.2.13 (context minimal AND/OR search 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 C T ( R ) . slides9 828X 2019

  31. AND/OR Tree DFS Algorithm (Value=Sum‐Product) ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 Result: P(D=1,E=0) D E D Evidence: E=0 OR .24408 A .6 .4 AND .3028 0 .1559 1 OR .3028 .1559 B B .4 .6 .1 .9 AND .352 .623 0 .27 1 0 .104 1 OR .5 .7 .4 E .88 C E .54 C E .89 C .2 E .52 C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND .8 .9 .7 .5 .8 .9 .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR .8 D D .9 .7 .5 .8 D D .9 .7 .5 D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C B C D=0 D=1 0 0 .2 .8 0 1 .1 .9 1 0 .3 .7 1 1 .5 .5 Evidence: D=1,E=0 slides9 828X 2019

  32. AND/OR Search Graph (Value=Sum‐Product) Context ( | , ) ( | ) ( | ) ( A ) P E A B P B A P C A P A [ ] A A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 [A] 1 .1 .9 1 .7 .3 1 .4 B 0 1 .5 .5 B C 1 0 .7 .3 [AB] 1 1 .2 .8 E C [AB] Result: P(D=1,E=0) Evidence: E=0 E D D [BC] .24408 A .6 .4 .3028 .1559 0 1 .3028 .1559 B B .4 .6 .1 .9 .352 .623 .27 .104 0 1 0 1 .5 .7 .4 .88 .54 .89 .2 .52 E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 .8 .9 .7 .5 .8 .9 .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 .8 .9 .7 .5 D D D D .8 .9 .5 .7 ( | , ) P D B C B C Value 0 1 0 1 0 1 0 1 0 0 .8 B C D=0 D=1 0 1 .9 0 0 .2 .8 1 0 .7 0 1 .1 .9 1 1 .1 1 0 .3 .7 1 1 .5 .5 Cache table for D Evidence: D=1,E=0 slides9 828X 2019

  33. AND/OR Search Graph (Optimization) A A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 C A F 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 B 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 D B E C E 𝐺 ∗ � min � � 𝑔 � �𝑦 � � Objective function: � D F OR A AND 0 1 OR B B AND 0 1 0 1 C C C C OR E E E E 0 1 0 1 0 1 AND 0 1 0 1 0 1 0 1 0 1 D D OR D D F F F F B C Value AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 Context minimal AND/OR search graph 1 1 Cache table for D slides9 828X 2019

  34. Merging Based on Context • context (X) = ancestors of X in pseudo tree, connected to X, or to descendants of X C C A A F F • context (X) = parents in the D D B B E E induced graph • max |context| = induced width [ ] A = treewidth B [A ] [ AB ] [ A B ] C E pseudo tree [AE ] D F [ BC ] context( ) = [ ] slides9 828X 2019

  35. How Big Is The Context? • Theorem: The maximum context‐size of a pseudo‐tree equals the treewidth along the pseudo tree. C [ ] F G K H [C] [C] B A max context size = treewidth L A [CK] [CH] J N B [CKL] [CHA] H E O E [CKLN] [CHAB] F [AB] C D P J [CKO] [CHAE] G [AF] L D [CEJ] K M N M [CD] P O (C K H A B E J L N O D P M F G) slides9 828X 2019

  36. Treewidth vs. Pathwidth G ABC BDFG D A B BDEF F C treewidth = 3 EFH E M K = (max cluster size) ‐ 1 H L FHK J HJ KLM G ABC D A B BDEFG F C E EFH pathwidth = 4 M K H = (max cluster size) ‐ 1 FHKJ L J KLM slides9 828X 2019

  37. A All Four Search Spaces B E C D F A 0 1 A 0 1 B 0 1 0 1 B 0 1 0 1 C 0 1 0 1 0 1 0 1 C 0 1 0 1 0 1 0 1 D D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 E E 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 F 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 F 0 1 Full OR search tree Context minimal OR search graph 126 nodes 28 nodes OR A OR A AND 0 1 AND 0 1 OR B B OR B B AND 0 1 0 1 AND 0 1 0 1 C C OR C E C OR C C C C E E E E E E E AND 0 1 0 1 0 1 0 1 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR D D D D F F F F OR D D D D D D F F F F D D F F F F AND 0 1 0 1 AND 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 Context minimal AND/OR search graph Full AND/OR search tree 18 AND nodes 54 AND nodes k = domain size n = number of variables Any query is best computed w*= treewidth over the context‐minimal AND/OR space pw*= pathwidth slides9 828X 2019

  38. A All Four Search Spaces B E C D F A 0 1 A 0 1 B AND/OR graph OR graph 0 1 0 1 B 0 1 0 1 C 0 1 0 1 0 1 0 1 C 0 1 0 1 0 1 0 1 D D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 O(n k w* ) O(n k pw* ) Space E E 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 F 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10 1 0 1 0 1 0 1 F 0 1 Full OR search tree Time Context minimal OR search graph O(n k w*+1 ) O(n k pw*+1 ) 126 nodes 28 nodes size OR A OR A AND 0 1 AND 0 1 OR B B OR B Computes any query: B AND 0 1 0 1 AND 0 1 0 1 • Constraint satisfaction C C OR C E C OR C C C C E E E E E E E • Max‐Inference: Optimization AND 0 1 0 1 0 1 0 1 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 • Sum‐Inference: Weighted counting OR D D D D F F F F OR D D D D D D F F F F D D F F F F AND • Mixed‐Inference: Marginal Map, 0 1 0 1 AND 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 • Maximum expected utility Context minimal AND/OR search graph Full AND/OR search tree 18 AND nodes 54 AND nodes k = domain size n = number of variables Any query is best computed w*= treewidth over the context‐minimal AND/OR space pw*= pathwidth slides9 828X 2019

  39. AND/OR Search and Variable Elimination AND/OR Search C F G 0 1 B A K K H H J 0 1 0 1 0 1 0 1 H L L L L E A A A A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 C D L N N N N N N N N B B B B B B B B K M 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 N P O O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E 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 C [ ] P P P P P P P P J J J J J J J J J J J J J J J J K [C] H [C] 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 L A [CK] [CH] N B [CKL] [CHA] D D D D D D D D F F F F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 O E [CKLN] [CHAB] F [AB] J P [CKO] [CHAE] M M M M G G G G G [AF] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D [CEJ] M [CD] (C K H A B E J L N O D P M F G) slides9 828X 2019

  40. AND/OR Search and Variable Elimination C F G 0 1 B A K K H H J 0 1 0 1 0 1 0 1 H L L L L E A A A A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 C D L N N N N N N N N B B B B B B B B K M 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 N P O O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E 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 C [ ] P P P P P P P P J J J J J J J J J J J J J J J J K [C] H [C] 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 L A [CK] [CH] N B [CKL] [CHA] D D D D D D D D F F F F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 O E [CKLN] [CHAB] F [AB] J P [CKO] [CHAE] M M M M G G G G G [AF] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D [CEJ] M Variable Elimination [CD] (C K H A B E J L N O D P M F G) slides9 828X 2019

  41. AND/OR Search and Variable Elimination C AND/OR Search F G 0 1 B A K K H H J 0 1 0 1 0 1 0 1 H L L L L E A A A A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 C D L N N N N N N N N B B B B B B B B K M 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 N P O O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E 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 C [ ] P P P P P P P P J J J J J J J J J J J J J J J J K [C] H [C] 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 L A [CK] [CH] N B [CKL] [CHA] D D D D D D D D F F F F 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 O E [CKLN] [CHAB] F [AB] J P [CKO] [CHAE] M M M M G G G G G [AF] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D [CEJ] M Variable Elimination [CD] (C K H A B E J L N O D P M F G) slides9 828X 2019

  42. Road Map: Search • Review Graphical Modes OR A • AND/OR search spaces, pseudo‐trees AND 0 1 OR B B – AND/OR search trees AND 0 1 0 1 A OR C C C C E E E E AND 0 1 0 1 0 1 0 1 – AND/OR search graphs B OR D D F F D D F F AND 01 01 E C – Generating good pseudo‐trees Context minimal AND/OR search graph D F – Brute‐force AND/OR 18 AND nodes • Heuristic search for AND/OR spaces – Basic Heuristic search (Depth and Best) – Depth‐first AND/OR branch and bound – Best‐first AND/OR search – The Guiding MBE heuristic – Marginal Map (max‐sum‐product) A=yellow A=green E D M B=blue B=green B=red B=blue L C A E D M E D M E D M E D M • Hybrids of search and Inference L L L L B K C C C C H F K K K K G J • H H H H Summary and Class 2 F F F F G G G G J J J J slides9 828X 2019

  43. Finding Good Pseudo-Trees slides9 828X 2019

  44. Finding Min‐Height Pseudo‐Trees • Finding min height 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 h <= w* log n, slides9 828X 2019

  45. Constructing Pseudo‐Trees • Min‐Fill [Kjaerulff, 1990] – Depth‐first traversal of the induced graph obtained along the min‐fill elimination order – Variables ordered according to the smallest “fill‐set” • Hypergraph Partitioning [Karypis and Kumar, 2000] – 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 slides9 828X 2019

  46. Variable Orderings and Pseudo‐Trees Note: we order from top to bottom here A (A) A Bucket‐tree = pseudo‐tree bucket-A A B (AB) B C (AC) (BC) C AB bucket-B A F C E (AE) (BE) (AE) E bucket-C ABC ABE bucket-E E D (BD) (DE) D B D F (AF) (EF) F bucket-D BDE AEF bucket-F d : A B C E D F Bucket-tree based on d Induced graph Bucket-tree A A OR 0 1 AND Finding small height or small width pseudo‐trees is NP‐hard B OR B B So, which orderings would give good pseudo‐trees? AND 0 1 0 1 C E OR C E C E C E C E AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D F OR D F D F D F D F D F D F D F D F AND 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 Bucket-tree used as AND/OR search tree pseudo-tree slides9 828X 2019

  47. Quality of Pseudo‐Trees Network hypergraph min‐fill Network hypergraph min‐fill width depth width depth width depth width depth barley 7 13 7 23 spot5 47 152 39 204 diabetes 7 16 4 77 spot28 108 138 79 199 link 21 40 15 53 spot29 16 23 14 42 mildew 5 9 4 13 spot42 36 48 33 87 munin1 12 17 12 29 spot54 12 16 11 33 munin2 9 16 9 32 spot404 19 26 19 42 munin3 9 15 9 30 spot408 47 52 35 97 munin4 9 18 9 30 spot503 11 20 9 39 water 11 16 10 15 spot505 29 42 23 74 pigs 11 20 11 26 spot507 70 122 59 160 Bayesian Networks Repository SPOT5 Benchmarks For more see [Dechter 2013 ] slides9 828X 2019

  48. Finding Min‐height Pseudo‐Trees • Finding a min height pseudo‐tree is NP‐complete, but: • Given a tree‐decomposition with treewidth w*, there exists a pseudo‐tree whose height satisfies – h <= w* log n • Optimality of h and w* cannot be achieved at once. 4 1 2 2 6 3 3 7 5 1 W*=1 4 h=7 5 6 w*=2 h=3 7 slides9 828X 2019

  49. Hypergraphs Decomposition slides9 828X 2019

  50. The Impact of the Pseudo‐Tree F G W=4,h=8 Min‐Fill C C [ ] (Kjaerulff90) 0 1 B A K K H H K [C] H [C] 0 1 0 1 0 1 0 1 J L L L L H A A A A L A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 [CK] [CH] E N N N N N N N N B B B B B B B B C 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 N [CKL] B [CHA] O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E L 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 O E 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 [CKLN] [CHAB] K M F [AB] P P P P P P P P J J J J J J J J J J J J J J J J N J P [CKO] [CHAE] 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 P G [AF] O What is a good D D D D D D D D F F F F D [CEJ] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 pseudo‐tree? Hypergraph M [CD] M M M M G G G G How to find a 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Partitioning (C K H A B E J L N O D P M F G) • Choose pseudo-tree with a minimal search graph good one? (h‐Metis) C • But determinism and pruning for optimization is 1 0 C [ ] D D K K unpredictable 0 1 0 1 0 1 0 1 W=5,h=6 B B B B M M M M O O O O K D [C] [C] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 A A A A A A A A L L L P P P P P P P P L L L L L 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 B M [CD] O 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 [CD] [CK] 0 1 0 1 0 1 0 1 0 1 0 1 F F F F 0 1 0 1 0 1 0 1 A [BCD] L N N N N N N N N P [CKO] [CKO] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 G G G G J J J J J J J J J J J J J J J J 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 F J [AB] [ABCD] N [KLO] E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E 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 G [AF] E H [ABCDJ] [ABCJ] H H H H H H H H H H H H H H H H 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 slides9 828X 2019 (C D K B A O M L N P J H E F G)

  51. Road Map: Search • Review Graphical Modes OR A • AND/OR search spaces, pseudo‐trees AND 0 1 OR B B – AND/OR search trees AND 0 1 0 1 OR C C C C E E E E AND 0 1 0 1 0 1 0 1 – AND/OR search graphs OR D D F F D D F F AND 01 01 – Generating good pseudo‐trees Context minimal AND/OR search graph – Brute‐force AND/OR 18 AND nodes • Heuristic search (HS) for AND/OR spaces – Basic Heuristic search (Depth and Best) – AND/OR Depth‐first HS (branch and bound) – AND/OR Best‐first heuristic search – The Guiding MBE heuristic – Marginal Map (max‐sum‐product) • Hybrids of search and Inference • Summary and Class 2 slides9 828X 2019

  52. Types of queries  Max-Inference Harder  Sum-Inference  Mixed-Inference • • NP-hard : exponentially many terms All solved by AND/OR Depth‐first search, • Linear memory, exp(h) time or • We will focus on approximation algorithms • exp(w*) memory and time • But, we can do better by: – Anytime : very fast & very approximate ! Slower & more accurate • Pruning while searching • Generating upper and lower bounds anytime slides9 828X 2019

  53. Search Spaces for a Tree GM slides9 828X 2019

  54. AND/OR Tree DFS Algorithm (Belief Updating) ( | , ) ( | ) ( | ) ( A ) A A P E A B P B A P C A P A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 B 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 B C 1 .1 .9 1 .7 .3 1 .4 0 1 .5 .5 E C 1 0 .7 .3 1 1 .2 .8 Result: P(D=1,E=0) D E D Evidence: E=0 OR .24408 A .6 .4 AND .3028 0 .1559 1 Searching the AND/OR tree Dfs is straightforward OR .3028 .1559 B B .4 .6 .1 .9 AND .352 .623 0 .27 1 0 .104 1 OR .5 .7 .4 E .88 C E .54 C E .89 C .2 E .52 C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 AND .8 .9 .7 .5 .8 .9 .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OR .8 D D .9 .7 .5 .8 D D .9 .7 .5 D D D D .8 .9 .5 .8 .9 .7 .5 .7 AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 ( | , ) P D B C OR node: Marginalization operator (summation) B C D=0 D=1 0 0 .2 .8 0 1 .1 .9 AND node: Combination operator (product) 1 0 .3 .7 1 1 .5 .5 Value of node = updated belief for sub‐problem below Evidence: D=1 slides9 828X 2019

  55. AND/OR Graph DFS Algorithm (Belief Updating) Context ( | , ) ( | ) ( | ) ( A ) P E A B P B A P C A P A [ ] A A B=0 B=1 A C=0 C=1 A P(A) A B E=0 E=1 0 .4 .6 0 .2 .8 0 .6 0 0 .4 .6 [A] 1 .1 .9 1 .7 .3 1 .4 B 0 1 .5 .5 B C 1 0 .7 .3 [AB] 1 1 .2 .8 E C [AB] Result: P(D=1,E=0) Evidence: E=0 E D D [BC] .24408 A .6 .4 .3028 .1559 0 1 Searching the AND/OR graph should avoid .3028 .1559 dead caches, less simple B B .4 .6 .1 .9 .352 .623 .27 .104 0 1 0 1 .5 .7 .4 .88 .54 .89 .2 .52 E C E C E C E C .4 .2 .8 .5 .2 .8 .7 .1 .9 .2 .1 .9 .8 .9 .7 .5 .8 .9 .7 .5 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 .8 .9 .7 .5 D D D D .8 .9 .5 .7 ( | , ) P D B C B C Value 0 1 0 1 0 1 0 1 0 0 .8 B C D=0 D=1 0 1 .9 0 0 .2 .8 1 0 .7 0 1 .1 .9 1 1 .1 1 0 .3 .7 1 1 .5 .5 Cache table for D Evidence: D=1 slides9 828X 2019

  56. AND/OR Search Graph (Optimization) A A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 C A F 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 B 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 D B E C E 𝐺 ∗ � min � � 𝑔 � �𝑦 � � Objective function: � D F OR A AND 0 1 OR B B AND 0 1 0 1 C C C C OR E E E E 0 1 0 1 0 1 AND 0 1 0 1 0 1 0 1 0 1 D D OR D D F F F F B C Value AND 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 Context minimal AND/OR search graph 1 1 Cache table for D slides9 828X 2019

  57. Dead Caches F G B A J H E C C D 0 1 L K M K N K H H C [ ] P 0 1 0 1 O 0 1 0 1 K H [C] [C] L L L L A A A A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 L A [CK] [CH] N N N N N N N N B B B B B B B B N B [CKL] [CHA] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 O E [CKLN] [CHAB] O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E F [AB] 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 P J [CKO] [CHAE] G [AF] P P P P P P P P J J J J J J J J J J J J J J J J D [CEJ] 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 M [CD] D D D D D D D D F F F F (C K H A B E J L N O D P M F G) 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 M M M M G G G G 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (Darwiche 2000) slides9 828X 2019

  58. Dead Caches F G B A J H E C C D 0 1 L K M K N K H H C [ ] P 0 1 0 1 O 0 1 0 1 K H [C] [C] L L L L A A A A 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 L A [CK] [CH] N N N N N N N N B B B B B B B B N B [CKL] [CHA] 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 O E [CKLN] [CHAB] O O O O O O O O O O O O O O O O E E E E E E E E E E E E E E E E F [AB] 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 P J [CKO] [CHAE] G [AF] P P P P P P P P J J J J J J J J J J J J J J J J D [CEJ] 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 M [CD] D D D D D D D D F F F F (C K H A B E J L N O D P M F G) 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 M M M M G G G G 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (Darwiche 2000) slides9 828X 2019

  59. slides9 828X 2019

  60. Searching AND/OR Graphs • AND/OR(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* i Space: O(exp w*) Space: O(n) Time: O(exp w*) Time: O(exp(w* log n)) Space: O(exp(i) ) Time: O(exp(m_i+i ) m_i is related to the size of the i-cutset. slides9 828X 2019

  61. Different Levels of Caching slides9 828X 2019

  62. Search for Mixed Deterministic and Probabilistic Graphical Models slides9 828X 2019

  63. AND/OR Search for Mixed Networks . • Graph‐based No‐good and good learning are automatically performed by AND/OR (backjumping) and by caching. slides9 828X 2019

  64. AND/OR Backtrack‐Free slides9 828X 2019

  65. AND/OR CPE (Constraint Probability Evaluation) slides9 828X 2019

  66. The Effect of Constraint Propagation in AND/OR A A B C B C > D E F D E F > > G H I K A G H I K Domains are {1,2,3,4} 1 2 3 4 B C B C B B 2 3 4 2 3 4 3 4 3 4 4 CONSTRAINTS ONLY D E D D E F F F D D F F D 3 4 3 4 4 3 4 4 4 4 G H G I I G K K K G K 4 4 4 4 A 1 2 3 B C B C B 2 3 2 3 3 3 D E D F F D F FORWARD CHECKING 3 3 3 G H I K 4 4 4 4 A 1 B C 2 2 D E F 3 3 3 MAINTAINING ARC CONSISTENCY G H I K 4 4 4 4 slides9 828X 2019

  67. Available code • http://graphmod.ics.uci.edu/group/Software slides9 828X 2019

  68. Outline: Search • Review Graphical Modes OR A • AND/OR search spaces, pseudo‐trees AND 0 1 OR B B – AND/OR search trees AND 0 1 0 1 OR C C C C E E E E AND 0 1 0 1 0 1 0 1 – AND/OR search graphs OR D D F F D D F F AND 01 01 – Generating good pseudo‐trees Context minimal AND/OR search graph – Brute‐force search 18 AND nodes • Heuristic search (HS) for AND/OR spaces – Basic Heuristic search (Depth and Best) – AND/OR Depth‐first HS (branch and bound) – AND/OR Best‐first heuristic search – The Guiding MBE heuristic – Marginal Map (max‐sum‐product) • Hybrids of search and Inference • Summary and Class 2 slides9 828X 2019

  69. Basic Heuristic Search We assume min‐sum problems in the following ��𝑦 𝑔 � � ) Heuristic function computes a lower bound on the best extension of 𝑦 � � partial configuration and can be used to guide heuristic search. We focus on: 1. Branch‐and‐Bound 2. Best‐First Search ��𝑦 𝑔 � � ) Use heuristic function to Always expand the node with ��𝑦 𝑔 � � ) prune the depth‐first search tree the lowest heuristic value Linear space Needs lots of memory BnB is upper‐bound anytime MAP slides9 828X 2019

  70. Basic Heuristic Search; Best‐First Task: compute v(root): MAP, Marginal ,MMAP Each node is a sub‐problem • Best‐First Algorithms, (A*) (defined by current conditioning) – Expand nodes in OPEN list v(root) in order of min f(n) – Terminates with first full solution (for mpe) • Properties – Optimal, if h(n � � 𝒘�𝒐� v(n) g(n) – Expands least set of nodes n h(n) ; h(n) � 𝒘�𝒐� – exponential memory – Not anytime solution for MAP – Yields lower bounds on value, anytime f(n) = g(n) + h(n) � 𝑕 𝑜 � 𝑤 𝑜 =f*(n) f(n) is a lower bound on best cost through n slides9 828X 2019

  71. Basic Heuristic Search; Depth‐First • Depth‐First (B&B for MAP) – Expand in dfs order – Update UB with each solution 𝑕�𝑜� – Prunes if f(n) ≥ UB • Properties – Can use only linear memory v(n) Prunes if – Yields upper bounds anytime n h(n) ; h(n) � 𝒘�𝒐� f 𝑜 � 𝑉𝐶 ℎ�𝑜� (UB) Upper Bound = best solution so far slides9 828X 2019

  72. Partial Solution Tree for AND/OR A A A A A 0 0 0 0 B C B C B C B C B C D 0 0 0 0 1 0 1 0 Pseudo tree D D D D 0 1 0 1 (A=0, B=0, C=0, D=1) (A=0, B=1, C=0, D=0) (A=0, B=1, C=0, D=1) (A=0, B=0, C=0, D=0) Extension(T’) – solution trees that extend T’ g(T’) = conditioned value of a node V(T’) = the combined value below T’ f*(T’) = conditioned value through T’ slides9 828X 2019

  73. Exact Evaluation Function Conditioned value of a node A A A B C f 1 (ABC) A B F f 2 (ABF) B D E f 3 (BDE) 0 0 0 2 0 0 0 3 0 0 0 6 C F 0 0 1 5 0 0 1 5 0 0 1 4 B 0 1 0 3 0 1 0 1 0 1 0 8 B 0 1 1 5 0 1 1 4 0 1 1 5 C D 1 0 0 9 1 0 0 6 1 0 0 9 F 1 0 1 3 1 0 1 5 1 0 1 3 1 1 0 7 1 1 0 6 1 1 0 7 D E E 1 1 1 2 1 1 1 5 1 1 1 4 9 OR A 0 0 AND 0 1 OR 9 B 0 0 AND 9 0 1 2 4 3 3 F F v(F) OR C D C D 2 5 0 0 3 5 3 5 0 AND 0 1 4 0 5 1 0 1 0 1 0 4 5 OR E tip nodes E v(D,0) 6 4 8 5 AND 0 1 0 1 f*(T’) = w(A,0) + w(B,1) + w(C,0) + w(D,0) + v(D,0) + v(F) slides9 828X 2019

  74. Heuristic Evaluation Function A A A B C f 1 (ABC) A B F f 2 (ABF) B D E f 3 (BDE) 0 0 0 2 0 0 0 3 0 0 0 6 C F 0 0 1 5 0 0 1 5 0 0 1 4 B 0 1 0 3 0 1 0 1 0 1 0 8 B 0 1 1 5 0 1 1 4 0 1 1 5 C D 1 0 0 9 1 0 0 6 1 0 0 9 F 1 0 1 3 1 0 1 5 1 0 1 3 1 1 0 7 1 1 0 6 1 1 0 7 D E E 1 1 1 2 1 1 1 5 1 1 1 4 9 OR A 0 0 h(n) ≤ v(n) AND 0 1 OR 9 B 0 0 AND 9 0 1 2 4 3 3 F F h(F) = 5 OR C D C D 2 5 0 0 3 5 3 5 0 AND 0 1 4 0 5 1 0 1 0 1 0 4 5 OR E tip nodes E 6 4 8 5 h(D,0) = 4 AND 0 1 0 1 f(T’) = w(A,0) + w(B,1) + w(C,0) + w(D,0) + h(D,0) + h(F) = 12 ≤ f*(T’) slides9 828X 2019

  75. Depth‐First AND/OR Branch‐and‐Bound • Associate each node n with a UB (best solution so far) heuristic lower bound h(n) on v(n) 5 A 0 0 5 0 1 11 Algorithm AOBB: • 5 B 11 B EXPAND (top‐down) 0 0 0 0 – Evaluate f(T’) and prune search if f(T’) 0 1 0 1 ∞ 5 1 1 ≥ UB ∞ C 4 D 2 C 3 D – If not in cache, generate successors ∞ ∞ 1 ∞ ∞ 2 0 2 of the tip node n 0 1 0 1 0 1 0 1 3 4 3 4 3 4 3 4 E E E E f(T’) ≥ UB • PROPAGATE (bottom‐up) ∞ 3 ∞ 4 ∞ 3 ∞ 4 0 1 0 1 0 1 0 1 – Update value of the parent p of n • OR nodes: minimization • AND nodes: summation – Cache value of n based on context only if fully explored slides9 828X 2019

  76. Anytime Performance  OR Branch‐and‐Bound is anytime  But AND/OR breaks anytime behavior of depth‐first scheme: processing  First anytime solution delayed until solved last sub‐problem starts processing optimally  Breadth‐Rotating AOBB:  Take turns processing sub‐problems  Limit number of expansions per visit  Solve each sub‐problem depth‐first  Maintain favorable complexity bounds rotate [Otten and Dechter, 2012] slides9 828X 2019

  77. Summary: AND/OR Branch‐and‐Bound Search (AOBB) • Associate each node n with a heuristic lower bound h(n) on v(n) • EXPAND (top‐down) – Evaluate f(T’) and prune search if f(T’) ≥ UB – Generate successors of the tip node n • PROPAGATE (bottom‐up) – Update value of the parent p of n • OR nodes: minimization • AND nodes: summation [Marinescu and Dechter, 2005; 2009] slides9 828X 2019

  78. Anytime Performance  OR Branch‐and‐Bound is anytime  But AND/OR breaks anytime behavior of depth‐first scheme:  First anytime solution delayed until last sub‐problem starts processing  Breadth‐Rotating AOBB:  Take turns processing sub‐problems  Limit number of expansions per visit  Solve each sub‐problem depth‐first  Maintain favorable complexity bounds rotate [Otten and Dechter, 2012] slides9 828X 2019

  79. DFS Algorithm (#CSP Example) A A F B B C solution E C E D D F OR 11 A OR node: Marginalization operator (summation ) AND 5 6 0 1 OR 5 B B 6 AND node: Combination operator (product) AND 4 1 0 0 4 2 1 1 OR 2 2 1 E C 1 E C 4 2 E C 1 E 1 C AND 2 0 0 0 1 0 1 1 0 1 0 1 2 1 0 1 0 1 2 0 1 0 1 1 1 1 1 0 1 0 0 1 OR 2 1 2 0 1 1 1 D F D F 0 D 2 F 1 D 2 F 1 1 1 D F D F 1 D F D F 1 AND 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 0 1 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 Value of node = number of solutions below it slides9 828X 2019

  80. AND/OR Tree Search for Optimization A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 A 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 C A F 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 B     9 C E Goal : min D B E f X X i 5 1 i D F OR A 0 0 5 AND 7 0 1 OR 5 7 B B 2 0 1 4 6 5 6 4 AND 0 1 0 1 3 4 C 4 4 C C 3 C OR 1 2 E E E 0 E 3 1 3 5 5 4 1 3 0 2 5 2 2 5 3 0 5 2 0 2 2 0 0 1 0 2 5 2 1 0 2 0 0 1 1 0 AND 0 1 0 1 0 1 0 1 0 1 0 1 5 2 0 2 2 0 0 2 5 2 1 0 2 0 1 0 D D D D D D OR F F D D F F F F F F AND 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 5 6 4 2 3 0 2 2 2 4 1 0 3 0 2 2 5 6 4 2 1 2 0 4 2 4 1 0 1 2 0 4 AND node = Combination operator (summation) OR node = Marginalization operator (minimization) slides9 828X 2019

  81. AND/OR Tree Search for Optimization A B f 1 A C f 2 A E f 3 A F f 4 B C f 5 B D f 6 B E f 7 C D f 8 E F f 9 0 0 2 0 0 3 0 0 0 0 0 2 0 0 0 0 0 4 0 0 3 0 0 1 0 0 1 0 1 0 0 1 0 0 1 3 0 1 0 0 1 1 0 1 2 0 1 2 0 1 4 0 1 0 A 1 0 1 1 0 0 1 0 2 1 0 0 1 0 2 1 0 1 1 0 1 1 0 0 1 0 0 C A F 1 1 4 1 1 1 1 1 0 1 1 2 1 1 4 1 1 0 1 1 0 1 1 0 1 1 2 B     9 C E Goal : min D B E f X X i 5 1 i D F OR A 0 0 5 AND 7 0 1 OR 5 7 B B 2 0 1 4 6 5 6 4 AND 0 1 0 1 3 4 C 4 4 C C 3 C OR 1 2 E E E 0 E 3 1 3 5 5 4 1 3 0 2 5 2 2 5 3 0 5 2 0 2 2 0 0 1 0 2 5 2 1 0 2 0 0 1 1 0 AND 0 1 0 1 0 1 0 1 0 1 0 1 5 2 0 2 2 0 0 2 5 2 1 0 2 0 1 0 D D D D D D OR F F D D F F F F F F AND 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 5 6 4 2 3 0 2 2 2 4 1 0 3 0 2 2 5 6 4 2 1 2 0 4 2 4 1 0 1 2 0 4 AND node = Combination operator (summation) OR node = Marginalization operator (minimization) slides9 828X 2019

  82. Outline: Search • Review Graphical Modes OR A • AND/OR search spaces, pseudo‐trees AND 0 1 OR B B – AND/OR search trees AND 0 1 0 1 OR C C C C E E E E AND 0 1 0 1 0 1 0 1 – AND/OR search graphs OR D D F F D D F F AND 01 01 – Generating good pseudo‐trees Context minimal AND/OR search graph – Brute‐force search 18 AND nodes • Heuristic search (HS) for AND/OR spaces – Basic Heuristic search (Depth and Best) – AND/OR Depth‐first HS (branch and bound) – AND/OR Best‐first heuristic search – The Guiding MBE heuristic – Marginal Map (max‐sum‐product) A=yellow A=green E D M B=blue B=green B=red B=blue L C A E D M E D M E D M E D M • Hybrids of search and Inference L L L L B K C C C C H F K K K K G J H H H H F F F F • Summary and Class 2 G G G G J J J J slides9 828X 2019

  83. Conditioning versus Elimination Conditioning (search) Elimination (inference) A A D D B B C F C F E E G G The main target In conditioning is to … Trade memory for time. A=1 A=k It is not really possible to do better Then elimination D D D B B B C F C F C F E E E G G G k “sparser” problems 1 “denser” problem slides9 828X 2019

  84. The Idea of Cutset‐Conditioning We observed that when variables are assigned, connectivity reduces. The magnitude of saving is reflected through the “conditioned‐induced graph” • Cutset‐conditioning exploit this in a systematic way: • Select a subset of variables, assign them values, and • Solve the conditioned problem by bucket‐elimination. • Repeat for all assignments to the cutset. Algorithm VEC slides9 828X 2019

  85. Hybrid: (i)‐Cutset‐Conditioning Condition Until Tree‐ness Algorithm VEC(i) • Cycle‐cutset • i‐cutset • C(i)‐size of i‐cutset Space: exp(i), Time: O(exp(i+c(i))) slides9 828X 2019

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend