Exact Inference 275b.

Slides:



Advertisements
Similar presentations
Verification/constraints workshop, 2006 From AND/OR Search to AND/OR BDDs Rina Dechter Information and Computer Science, UC-Irvine, and Radcliffe Institue.
Advertisements

Tree Clustering for Constraint Networks 1 Chris Reeson Advanced Constraint Processing Fall 2009 By Rina Dechter & Judea Pearl Artificial Intelligence,
Constraint Satisfaction Problems
Variational Methods for Graphical Models Micheal I. Jordan Zoubin Ghahramani Tommi S. Jaakkola Lawrence K. Saul Presented by: Afsaneh Shirazi.
CS498-EA Reasoning in AI Lecture #15 Instructor: Eyal Amir Fall Semester 2011.
A. Darwiche Bayesian Networks. A. Darwiche Reasoning Systems Diagnostics: Which component failed? Information retrieval: What document to retrieve? On-line.
Anagh Lal Tuesday, April 08, Chapter 9 – Tree Decomposition Methods- Part II Anagh Lal CSCE Advanced Constraint Processing.
Exact Inference in Bayes Nets
Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
MPE, MAP AND APPROXIMATIONS Lecture 10: Statistical Methods in AI/ML Vibhav Gogate The University of Texas at Dallas Readings: AD Chapter 10.
Recursive Conditioning Adnan Darwiche Computer Science Department UCLA.
A. Darwiche Inference in Bayesian Networks. A. Darwiche Query Types Pr: –Evidence: Pr(e) –Posterior marginals: Pr(x|e) for every X MPE: Most probable.
Probabilistic networks Inference and Other Problems Hans L. Bodlaender Utrecht University.
From Variable Elimination to Junction Trees
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Introduction Combining two frameworks
1 Exact Inference Algorithms Bucket-elimination and more COMPSCI 179, Spring 2010 Set 8: Rina Dechter (Reading: chapter 14, Russell and Norvig.
1 Exact Inference Algorithms for Probabilistic Reasoning; COMPSCI 276 Fall 2007.
1 Hybrid of search and inference: time- space tradeoffs chapter 10 ICS-275 Spring 2007.
M. HardojoFriday, February 14, 2003 Directional Consistency Dechter, Chapter 4 1.Section 4.4: Width vs. Local Consistency Width-1 problems: DAC Width-2.
Tutorial #9 by Ma’ayan Fishelson
1 Bayesian Networks Chapter ; 14.4 CS 63 Adapted from slides by Tim Finin and Marie desJardins. Some material borrowed from Lise Getoor.
AND/OR Search for Mixed Networks #CSP Robert Mateescu ICS280 Spring Current Topics in Graphical Models Professor Rina Dechter.
Inference in Gaussian and Hybrid Bayesian Networks ICS 275B.
Context-specific independence Graphical Models – Carlos Guestrin Carnegie Mellon University October 16 th, 2006 Readings: K&F: 4.1, 4.2, 4.3, 4.4,
Binary Decision Diagrams (BDDs)
Introduction to Bayesian Networks
1 Variable Elimination Graphical Models – Carlos Guestrin Carnegie Mellon University October 11 th, 2006 Readings: K&F: 8.1, 8.2, 8.3,
Inference Complexity As Learning Bias Daniel Lowd Dept. of Computer and Information Science University of Oregon Joint work with Pedro Domingos.
Belief Propagation Revisited Adnan Darwiche. Graphical Models Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio LightsEngine.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Probabilistic Networks Chapter 14 of Dechter’s CP textbook Speaker: Daniel Geschwender April 1, 2013 April 1&3, 2013DanielG--Probabilistic Networks1.
1 CMSC 671 Fall 2001 Class #21 – Tuesday, November 13.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Advances in Bayesian Learning Learning and Inference in Bayesian Networks Irina Rish IBM T.J.Watson Research Center
Foundations of Constraint Processing, Spring 2009 Structure-Based Methods: An Introduction 1 Foundations of Constraint Processing CSCE421/821, Spring 2009.
1 CMSC 671 Fall 2001 Class #20 – Thursday, November 8.
1 Tutorial #9 by Ma’ayan Fishelson. 2 Bucket Elimination Algorithm An algorithm for performing inference in a Bayesian network. Similar algorithms can.
Today Graphical Models Representing conditional dependence graphically
1 Variable Elimination Graphical Models – Carlos Guestrin Carnegie Mellon University October 15 th, 2008 Readings: K&F: 8.1, 8.2, 8.3,
Compiling Bayesian Networks Using Variable Elimination
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk
Structure-Based Methods Foundations of Constraint Processing
Constraint Optimization And counting, and enumeration 275 class
Constraint Optimization And counting, and enumeration 275 class
Irina Rish IBM T.J.Watson Research Center
Exact Inference Continued
Types of Algorithms.
Structure-Based Methods Foundations of Constraint Processing
Coping With NP-Completeness
CSCI 5822 Probabilistic Models of Human and Machine Learning
From AND/OR Search to AND/OR BDDs
Readings: K&F: 15.1, 15.2, 15.3, 15.4, 15.5 K&F: 7 (overview of inference) K&F: 8.1, 8.2 (Variable Elimination) Structure Learning in BNs 3: (the good,
Structure-Based Methods Foundations of Constraint Processing
Exact Inference ..
Structure-Based Methods Foundations of Constraint Processing
Backtracking search: look-back
Class #19 – Tuesday, November 3
Exact Inference Continued
Class #16 – Tuesday, October 26
Exploiting Tree-Decomposition in Search: The AND/OR Paradigm
Context-specific independence
Variable Elimination Graphical Models – Carlos Guestrin
Directional consistency Chapter 4
Coping With NP-Completeness
Structure-Based Methods Foundations of Constraint Processing
An Introduction Structure-Based Methods
Structure-Based Methods Foundations of Constraint Processing
Iterative Join Graph Propagation
Presentation transcript:

Exact Inference 275b

What are they good for? Diagnosis: P(cause|symptom)=? Prediction: P(symptom|cause)=? Classification: P(class|data) Decision-making (given a cost function) Medicine Bio-informatics Computer troubleshooting Stock market Text Classification Speech recognition SP2

Probabilistic Inference Tasks Belief updating: Finding most probable explanation (MPE) Finding maximum a-posteriory hypothesis Finding maximum-expected-utility (MEU) decision SP2

Belief Updating P (lung cancer=yes | smoking=no, dyspnoea=yes ) = ? Bronchitis X-ray Dyspnoea P (lung cancer=yes | smoking=no, dyspnoea=yes ) = ? SP2

Belief updating is NP-hard Each sat formula can be mapped to a bayesian network query. Example: (u,~v,w) and (~u,~w,y) sat? SP2

Motivation A B C D Given a chain show how it works How can we compute P(D)? P(D|A=0)? P(A|D=0)? Brute force O(k^4) A B C D SP2

Belief updating: P(X|evidence)=? “Moral” graph A D E C B P(a|e=0) P(a,e=0)= B C P(a)P(b|a)P(c|a)P(d|b,a)P(e|b,c)= D E P(b|a)P(d|b,a)P(e|b,c) P(a) P(c|a) Variable Elimination SP2

Developing the algorithm Go to slides, show two different orderings. SP2

Bucket elimination Algorithm elim-bel (Dechter 1996) Elimination operator bucket B: P(a) P(c|a) P(b|a) P(d|b,a) P(e|b,c) bucket C: bucket D: bucket E: bucket A: e=0 B C D E A W*=4 ”induced width” (max clique size) P(a|e=0) SP2

Complexity of elimination The effect of the ordering: “Moral” graph A D E C B B C D E A E D C B A SP2

Handling evidence Complexity based on adjusted induced-width SP2

Relationship with Pearl’s belief propagation in poly-trees “Diagnostic support” “Causal Pearl’s belief propagation for single-root query elim-bel using topological ordering and super-buckets for families Elim-bel, elim-mpe, and elim-map are linear for poly-trees. SP2

Relationship with join-tree clustering BCE ADB A cluster is a set of buckets (a “super-bucket”) ABC SP2

Finding Algorithm elim-mpe (Dechter 1996) Elimination operator bucket B: P(a) P(c|a) P(b|a) P(d|b,a) P(e|b,c) bucket C: bucket D: bucket E: bucket A: e=0 B C D E A W*=4 ”induced width” (max clique size) MPE SP2

Generating the MPE-tuple C: E: P(b|a) P(d|b,a) P(e|b,c) B: D: A: P(a) P(c|a) e=0 SP2

Other tasks and algorithms MAP and MEU tasks: Similar bucket-elimination algorithms - elim-map, elim-meu (Dechter 1996) Elimination operation: either summation or maximization Restriction on variable ordering: summation must precede maximization (i.e. hypothesis or decision variables are eliminated last) Other inference algorithms: Join-tree clustering Pearl’s poly-tree propagation Conditioning, etc. SP2

Conditioning generates the probability tree Complexity of conditioning: exponential time, linear space SP2

Conditioning+Elimination Idea: conditioning until of a (sub)problem gets small SP2

Super-bucket elimination (Dechter and El Fattah, 1996) Eliminating several variables ‘at once’ Conditioning is done only in super-buckets SP2

The idea of super-buckets Larger super-buckets (cliques) =>more time but less space Complexity: Time: exponential in clique (super-bucket) size Space: exponential in separator size SP2

OR search space Ordering: A B E C D F A F B C E D SP2 A B 1 E C F D B A 1 Defined by a variable ordering, Fixed but may be dynamic 1 1 1 1 SP2

AND/OR search space Primal graph DFS tree A D B C E F A A D B C E F A AND 1 B OR Backbone tree that will determine the structure of the and/or same as ordering determines for OR Captures independence Stop at level 6, independence between problems When full tree is generated, show again the primal graph. We used dfs tree to drive the and/or AND 1 E OR C AND 1 OR D F AND 1 SP2

AND/OR vs. OR AND/OR OR SP2 A D B C E F A D B C E F 1 AND/OR OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 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 Show the dfs tree for the and/or Try to make more clear. Maybe just show the shaded one, skip green and yellow. We capture the ability to skip the shaded trees Only orange nodes are important, the blue are bookkeepping. Overall the size is exponential in the depth of the dfs tree. Show dfs tree E 1 C F D B A E 1 C F D B A E 1 C F D B A OR SP2

OR vs AND/OR AND/OR OR SP2 A D B C E F A D B C E F E C F D B A E C F D 1 AND/OR OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 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 E 1 C F D B A E 1 C F D B A Show the dfs tree for the and/or Try to make more clear. Maybe just show the shaded one, skip green and yellow. We capture the ability to skip the shaded trees Only orange nodes are important, the blue are bookkeepping. Overall the size is exponential in the depth of the dfs tree. Show dfs tree OR 1 1 1 SP2 1

AND/OR vs. OR AND/OR AND/OR size: exp(4), OR size exp(6) OR SP2 A D B C E F A D B C E F AND/OR vs. OR A OR AND 1 AND/OR OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 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/OR size: exp(4), OR size exp(6) Show the dfs tree for the and/or Try to make more clear. Maybe just show the shaded one, skip green and yellow. We capture the ability to skip the shaded trees Only orange nodes are important, the blue are bookkeepping. Overall the size is exponential in the depth of the dfs tree. Show dfs tree E 1 C F D B A E 1 C F D B A E 1 C F D B A OR SP2

AND/OR vs. OR AND/OR OR SP2 No-goods (A=1,B=1) (B=0,C=0) A D B C E F A 1 AND/OR OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 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 Show the dfs tree for the and/or Try to make more clear. Maybe just show the shaded one, skip green and yellow. We capture the ability to skip the shaded trees Only orange nodes are important, the blue are bookkeepping. Overall the size is exponential in the depth of the dfs tree. Show dfs tree E 1 C F D B A E 1 C F D B A E 1 C F D B A OR SP2

AND/OR vs. OR AND/OR OR SP2 (A=1,B=1) (B=0,C=0) A D B C E F A D B C E 1 AND/OR OR B B AND 1 OR E C E C E C AND 1 1 1 1 1 1 OR D F D F D F D F AND 1 1 1 1 1 1 1 1 Show the dfs tree for the and/or Try to make more clear. Maybe just show the shaded one, skip green and yellow. We capture the ability to skip the shaded trees Only orange nodes are important, the blue are bookkeepping. Overall the size is exponential in the depth of the dfs tree. Show dfs tree A A A 1 1 1 OR B B B 1 1 1 E E E 1 1 1 1 1 1 1 1 1 C C C 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 D D D 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 SP2 F F 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

OR space vs. AND/OR space width height OR space AND/OR space time(sec.) nodes backtracks AND nodes OR nodes 5 10 3.154 2,097,150 1,048,575 0.03 10,494 5,247 4 9 3.135 0.01 5,102 2,551 3.124 8,926 4,463 3.125 0.02 7,806 3,903 13 3.104 0.1 36,510 18,255 8,254 4,127 6 6,318 3,159 7,134 3,567 3.114 0.121 37,374 18,687 7,326 3,663 SP2

AND/OR search tree for graphical models The AND/OR search tree of R 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 D B C E F A D B C E F And/or is well known in the literature. Here is our specific def for graphical models Define and/or for graphical models. Make it clear that we have a definition. Add a slide for cost of solution. Different task define different costs Make all specific for graphical models Move this after pseudo-trees. Make title And/or search tree for graphical models. Highlight a solution. For various tasks we associate different value functions, and want to compute the value of the root. Then have a slide about all the tasks. Linear space and w* log n. similar to RC and others A B E OR AND C D 1 F SP2

From DFS trees to pseudo-trees (Freuder 85, Bayardo 95) 1 4 1 6 2 3 2 7 5 3 (a) Graph 4 7 1 1 2 7 3 5 5 3 5 4 2 7 6 6 4 6 (b) DFS tree depth=3 (c) pseudo- tree depth=2 (d) Chain depth=6 SP2

From DFS trees to Pseudo-trees OR 1 AND a b c OR 2 7 AND a b c a b c OR 3 3 3 5 5 5 DFS tree depth = 3 AND a b c a b c a b c a b c a b c a b c 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 a 1 3 4 b c OR AND 2 5 7 6 pseudo- tree depth = 2 SP2

Finding min-depth backbone 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 (Bayardo and Mirankar, 1996, bodlaender and Gilbert, 91): m <= w* log n, SP2

Generating pseudo-trees from Bucket trees ABE A ABC AB BDE AEF bucket-A bucket-E bucket-B bucket-C bucket-D bucket-F B (AB) B C (AC) (BC) C F A C B D E E (AE) (BE) (AE) E D (BD) (DE) D F (AF) (EF) F d: A B C E D F Bucket-tree based on d Induced graph Bucket-tree E A C B D F AND 1 B OR C E D F A Bucket-tree used as pseudo-tree AND/OR search tree SP2

Pseudo Trees vs. DFS Trees Model (DAG) w* Pseudo Tree avg. depth DFS Tree avg. depth (N=50, P=2) 9.54 16.82 36.03 (N=50, P=3) 16.1 23.34 40.6 (N=50, P=4) 20.91 28.31 43.19 (N=100, P=2) 18.3 27.59 72.36 (N=100, P=3) 30.97 41.12 80.47 (N=100, P=4) 40.27 50.53 86.54 N = number of nodes, P = number of parents. MIN-FILL ordering. 100 instances. SP2

AND/OR Search-tree properties (k = domain size, m = pseudo-tree depth AND/OR Search-tree properties (k = domain size, m = pseudo-tree depth. 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)) Related to: (Freuder 85; Dechter 90, Bayardo et. al. 96, Darwiche 1999, Bacchus 2003) When the pseudo-tree is a chain we get an OR space SP2

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)) SP2

DFS algorithm (#CSP example) B C E F A D B C E F solution OR AND B 1 E C D F 2 4 5 6 11 A B 4 OR node: Marginalization operator (summation) E 2 C 2 Value of each node is the number of solutions below it … If we cache, we search the graph, so all the algorithms have these time and space complexities. Add another slide Linear space Full caching + anything in between AND node: Combination operator (product) 1 2 1 1 1 D 2 F 1 D 2 F 1 1 1 1 1 1 1 1 1 Value of node = number of solutions below it SP2

Belief-updating on example C B D E A B E D 1 C SP2

PB|A(0|0) PB|A(1|1) PA(0) PA(1) PB|A(1|0) PB|A(0|1) SP2 A C B D E 1 B B PB|A(0|0) PB|A(1|0) PB|A(0|1) PB|A(1|1) 1 1 E D E D E D E D PE|AB(0|0,0) PE|AB(1|0,0) PE|AB(0|0,1) PE|AB(1|0,1) PE|AB(0|1,0) PE|AB(1|1,0) PE|AB(0|1,1) PE|AB(1|1,1) 1 1 1 1 1 1 1 1 C C C C C C C C PD|BC(0|0,0)× PC|A(0|0) 1 1 1 1 1 1 1 1 SP2

SP2 A C B D E A B E D 1 C P(A=0) P(B=0|A=0) P(B=1|A=0) P(E=0|A=0,B=0) A B E D 1 C 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(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=0)× P(E=1|A=0,B=0) P(E=0|A=0,B=1) P(E=1|A=0,B=1) SP2

(d) SP2 A B E C 1 D P(A=0) P(B=0|A=0) P(B=1|A=0) P(E=0|A=0,B=0) A B E C 1 D 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(D=1|B=1,C=1) 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=0) P(E=1|A=0,B=0) P(E=0|A=0,B=1) P(E=1|A=0,B=1) P(C=0|A=0) P(C=1|A=0) (d) SP2

SP2 A C B D E R(AB) R(AC) R(ABE) R(BCD) A B E D 1 C R(A=0, B=0) A B E D 1 C R(A=0, B=0) R(A=0,B=1) R(A=0,B=0,E=0) R(B=0,C=0,D=0)× R(A=0,C=0) R(B=1,C=1,D=1)× R(A=0,C=1) R(B=0,C=1,D=0)× R(B=0,C=0,D=1)× R(B=0,C=1,D=1)× R(B=1,C=0,D=0)× R(B=1,C=1,D=0)× R(B=1,C=0,D=1)× R(A=0,B=0,E=1) R(A=0,B=1,E=0) R(A=0,B=1,E=1) SP2

From Search Trees to Search Graphs Any two nodes that root identical subtrees/subgraphs can be merged Minimal AND/OR search graph: closure under merge of the AND/OR search tree Inconsistent subtrees can be pruned too. Some portions can be collapsed or reduced. We may have two nodes that are identical, then we can merge. Highlight: rooting the same tree. Maybe an example of and/or tree, show animation that we merge. Minimal is when we remove all redundancy SP2

AND/OR Tree SP2 A J A F B B C K E C E D D F G G H J H K OR AND OR AND 1 OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 OR D F D F D F D F D F D F D F D F G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K AND OR AND OR AND SP2

An AND/OR graph SP2 A J A F B B C K E C E D D F G G H J H K 1 OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 OR D F D F D F D F D F D F D F D F =============================================================== More information without talking about it? Do it on the original graph. Reason by looking at the induced graph and talk about independency. Context is dependent on separator set, which is bounded by w*, which yields the theorem We don’t need to generate the tree and then merge, but can do it while we search. We can generate minimal graph in time linear in its size (linear in the output) Context notion provides an algorithm which is linear in the size of the output. AND 1 1 OR G G J J AND 1 1 1 1 OR H H H H K K K K AND SP2 1 1 1 1 1 1 1 1

Context based caching Caching is possible when context is the same context = parent-separator set in induced pseudo-graph = current variable + parents connected to subtree below A D B C E F G H J K context(B) = {A, B} context(c) = {A,B,C} context(D) = {D} context(F) = {F} SP2

The induced-width of a pseudo tree The induced-width of a pseudo-tree is its induced-width along a dfs ordering that includes pseudo arcs. When the pseudo tree is a chain its induced-width equals its path-width Contexts are bounded by the induced-width of the pseudo tree. SP2

Induced-width of pseudo-trees The induced-width of a pseudo-tree is its induced-width along a dfs order that includes pseudo arcs. For pseudo-chains induced-width is path-width (yielding path-decomposition) Contexts are bounded by the induced-width of the pseudo tree. Min induced-pseudo-width=tree-width E A C B D F E A C B D F E A C B D F F A C B D E Good pseudo-tree Bad pseudo-tree A graph DFS order of both pseudo trees: d = A B C E D F SP2

Induced-width of pseudo-trees The induced-width of a pseudo-tree is its induced-width along a dfs order that includes pseudo arcs. For pseudo-chains induced-width is path-width (yielding path-decomposition) Contexts are bounded by the induced-width of the pseudo tr. Min induced-pseudo-width=tree-width E A C B D F E A C B D F E A C B D F F A C B D E Good pseudo-tree Bad pseudo-tree A graph DFS order of both pseudo trees: d = A B C E D F SP2

Caching context(D)={D} context(F)={F} SP2 A J A F B B C K E C E D D F OR A H K context(D)={D} context(F)={F} AND 1 OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 OR D F D F D F D F D F D F D F D F G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K G H 1 1 G H J K 1 1 J K AND OR AND OR AND SP2

Caching context(D)={D} context(F)={F} SP2 A J A F B B C K E C E D D F OR A H K AND 1 OR B B AND 1 1 OR E C E C E C E C AND 1 1 1 1 1 1 1 1 OR D F D F D F D F D F D F D F D F =============================================================== More information without talking about it? Do it on the original graph. Reason by looking at the induced graph and talk about independency. Context is dependent on separator set, which is bounded by w*, which yields the theorem We don’t need to generate the tree and then merge, but can do it while we search. We can generate minimal graph in time linear in its size (linear in the output) Context notion provides an algorithm which is linear in the size of the output. AND 1 1 OR G G J J AND 1 1 1 1 OR H H H H K K K K AND SP2 1 1 1 1 1 1 1 1

Size of minimal AND/OR context graphs Theorem: Minimal AND/OR context graph is bounded exponentially by its pseudo-tree induced-width. The tree-width of a pseudo-chain is path-width (pw)  Minimal OR search graph is O(exp(pw*)).  Minimal AND/OR graph is O(exp(w*)) Always, w* ≤ pw*, but pw*<= w* log n SP2

Semantics tree-width Given a pseudo-tree for graph-model R, semantic width of R relative to T is the min w* along all equivalent representation to R w.r.t. T. SP2

OR tree vs. OR graph OR tree OR graph SP2 E C F D B A E C F D B A E C 1 C F D B A OR tree E 1 C F D B A 1 E C F D B A E 1 C F D B A E 1 C F D B A E 1 C F D B A E 1 C F D B A E 1 C F D B A OR graph SP2

AND/OR tree vs. AND/OR graph AND 1 B E C D F AND/OR tree A OR AND 1 B E C D F A OR AND 1 B E C D F A OR AND 1 B E C D F A OR AND 1 B E C D F AND/OR graph SP2

All four search spaces SP2 A A B B E E C C D D F F Full OR search tree 1 1 E C F D B A Full OR search tree Context minimal OR search graph AND 1 B OR E C D F A OR AND 1 B E C D F SP2 Full AND/OR search tree Context minimal AND/OR search graph

All four search spaces SP2 A A B B E E C C D D F F Full OR search tree 1 1 E C F D B A Full OR search tree Context minimal OR search graph Time-space AND 1 B OR E C D F A OR AND 1 B E C D F SP2 Full AND/OR search tree Context minimal AND/OR search graph

Uniqueness of minimal AND/OR graph Theorem: Given a pseudo-tree, the minimal AND/OR search graph is unique for all graph-models that are consistent with that pseudo tree. Related to compilation schemes: Minimal OR – related to OBDDs (McMillan) Minimal AND/OR – related to tree-OBDDs (McMillan 94), AND/OR graphs related to d-DNNF (Darwiche et. Al. 2002) SP2

Searching AND/OR Graphs AO-DF: a depth first search of the AND/OR graph that caches nodes by their context Space complexity of AO is exp(w*) Time complexity of AO is exp(w*) AO(i), cach nodes whose context is less than I, only Mixed nets, can be a CNF When talk about query: probability of a query, or a query expressed as a cnf Blue bullet SP2

AND/OR w-cutset 3-cutset 2-cutset 1-cutset SP2 A C B K G L D F H M J E

AND/OR w-cutset grahpical model pseudo tree 1-cutset tree SP2 A C B K 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 grahpical model pseudo tree 1-cutset tree SP2

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 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 ) SP2

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 backbone 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 SP2

Recursive Conditioning (Darwiche, 1999) Algorithms that explore the AND/OR search tree and graph. SP2

Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start SP2

Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start SP2

Decomposition Battery Age Alternator Fan Belt Leak Charge Delivered Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start SP2

Decomposition LP * RP SP2 Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start LP * RP SP2

Decomposition LP * RP SP2 Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start LP * RP SP2

Causal Network Battery Age Alternator Fan Belt Leak Charge Delivered Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start SP2

Causal Network Battery Age Alternator Fan Belt Leak Charge Delivered Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start SP2

Case Analysis Case I Case II SP2 Battery Age Alternator Fan Belt Leak Leak Charge Delivered Battery Charge Delivered Fuel Line Battery Fuel Line Starter Gas Distributor Starter Gas Distributor Battery Power Battery Power Spark Plugs Gas Gauge Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start Radio Lights Engine Turn Over Engine Start Case I Case II SP2

Case Analysis LP * RP Case I Case II SP2 Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Battery Charge Delivered Fuel Line Battery Fuel Line Starter Gas Distributor Starter Gas Distributor Battery Power Battery Power Spark Plugs Gas Gauge Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start Radio Lights Engine Turn Over Engine Start Case I Case II LP * RP SP2

Case Analysis LP * RP + LP * RP Case I Case II SP2 Battery Age Alternator Fan Belt Battery Age Alternator Fan Belt Leak Leak Charge Delivered Battery Charge Delivered Fuel Line Battery Fuel Line Starter Gas Distributor Starter Gas Distributor Battery Power Battery Power Spark Plugs Gas Gauge Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start Radio Lights Engine Turn Over Engine Start Case I Case II LP * RP + LP * RP SP2

Case Analysis LP * RP + LP * RP SP2 Battery Age Alternator Fan Belt Leak Charge Delivered Battery Fuel Line Starter Gas Distributor Battery Power Spark Plugs Gas Gauge Radio Lights Engine Turn Over Engine Start LP * RP + LP * RP SP2

Decomposition and Case Analysis can answer any query Non-Deterministic! Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start Battery Age Alternator Fan Belt Battery Charge Delivered Battery Power Starter Radio Lights Engine Turn Over Gas Gauge Gas Leak Fuel Line Distributor Spark Plugs Engine Start SP2

RC1 RC1(T,e) if T is a leaf node return Lookup(T,e) else p := 0 for each instantiation c of cutset(T)-E do p := p + RC1(Tl,ec) RC1(Tr,ec) return p SP2

Lookup(T,e) QX|U : CPT associated with leaf T If X is instantiated in e, then x: value of X in e u: value of U in e Return qx|u Else return 1 = Sx qx|u SP2

Computational Complexity Given DAG with n nodes elimination order of width w Can construct a dtree in O(n log n) time: Height O(log n) cutset width <= w+1 a-cutset width O(w log n) Time complexity: O(n cw log n) Cutset Conditioning: O(n cs) SP2