1 / 34

William Lam CS 275 Project

An Overview of Compiling Constraint Networks into AND/OR Multi-valued Decision Diagrams ( AOMDDs ). William Lam CS 275 Project. Papers: Mateescu R., Dechter R. Compiling Constraint Networks into AND/OR Multi-valued Decision Diagrams ( AOMDDs ). (CP 2006)

lora
Download Presentation

William Lam CS 275 Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Overview of Compiling Constraint Networks into AND/OR Multi-valued Decision Diagrams (AOMDDs) William Lam CS 275 Project • Papers: • Mateescu R., Dechter R. Compiling Constraint Networks into AND/OR Multi-valued Decision Diagrams (AOMDDs). (CP 2006) • Mateescu R., Dechter R., and Marinescu, R. AND/OR Multi-valued Decision Diagrams (AOMDDs) for Graphical Models. (JAIR 2008) The slides on AND/OR search and decision diagrams were provided by RinaDechter.

  2. Outline • Introduction • AND/OR Search Spaces (Quick Review) • Decision Diagrams – Binary and Multi-valued (BDD/MDD) • AND/OR MDDs (AOMDDs) • Experiments • Conclusion

  3. Introduction • Combining two frameworks • AND/OR Search Spaces • Multi-valued Decision Diagrams (MDDs) • Both are more compact ways to represent problems. • Their combination yields an even more compact representation. • Decision Diagrams are known to allow online speed queries.

  4. OFFLINE A F B C E D ONLINE Evaluate answer Polytime? Constant time? Introduction Query Compiled structure ONCE MANY

  5. A F B C E D A B E C D F Classic OR Search Space Ordering: A B E C D 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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

  6. A A F F B B C C E E D D A B OR A E C AND 0 1 D F OR B B AND 0 0 1 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 AND/OR Search Space A F B C E D Primal graph DFS tree

  7. A F B C E D A B A 0 1 E C B 0 1 0 1 D F A E 0 1 0 1 0 1 0 1 0 1 B C 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 E 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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 C 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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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 0 1 0 1 0 1 0 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 AND/OR vs. OR OR A AND 0 1 AND/OR OR B B AND 0 0 1 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 AND/OR size: exp(4), OR size exp(6) 0 OR 1 1 1 0 1

  8. 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 J J J J G G J J G G J J J J G G J J G G G G J J G G J J G G G G 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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 J From AND/OR Tree A 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 0 1 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 OR AND OR AND

  9. A J To an AND/ORGraph A 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 0 1 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 OR J J G G 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

  10. AND/OR Search Graphs • Any two nodes that root identical subtrees/subgraphs (are unifiable) can be merged • Minimal AND/OR search graph:of R relative to tree T is theclosure under merge of the AND/OR search tree of R relative to T, where inconsistent subtrees are pruned. • Canonicity: The minimal AND/OR graph relative to T is unique for all constraints equivalent to R.

  11. A 0 1 B 0 1 0 1 C C A F 0 1 0 1 0 1 0 1 D 0 1 0 1 0 1 0 1 D B E E 0 1 0 1 F 0 1 OR OR A A A AND AND 0 1 0 1 0 1 B OR OR 0 1 0 1 B B B B C AND AND 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 0 D OR C C C C OR E 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 E C E E C C C E E E E E AND 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 F OR D D D D OR 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 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 F F F D D D D D D D D F F F F F F F F AND 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 All Four Search Spaces Full OR search tree 126 nodes Context minimal OR search graph 28 nodes Context minimal AND/OR search graph 18 AND nodes Full AND/OR search tree 54 AND nodes

  12. A A A A A A A B B B B B B B B B B B B C C C C C C C C C C C C C C C C C 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 1 0 0 0 1 0 1 0 1 Decision tree OBDD [Bryant86] Ordered Binary Decision Diagram B = {0,1} f : B3→ B Table 1) Merge nodes with identical children Merge terminal nodes Simplify 2) Remove redundant nodes Ordering enables efficient operations

  13. A B B A C C A C C C C B D D B B B D D D D D D D D D D G G E E E G G E E E E E E E E E H F H F F F F F 0 0 0 0 1 1 1 1 G G H 0 1 AND Decision Diagrams f = (A ∨ E) ∧ (B ∨ F) ? f ∧ g = OBDD g = (C ∨G) ∧ (D ∨ H) f ∧ g = OBDD

  14. A 0 1 A B B 0 1 0 1 0 1 B B C 1 0 1 0 1 C 0 1 1 Minimal AND/OR graph Decision Diagram AOMDDs A Point dead-ends to terminal node “0” Point goods to terminal node “1” B C

  15. A A redundant A A 0 1 0 1 0 0 1 1 B B B B B B 0 1 0 1 0 1 0 0 1 1 0 1 C C C C 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 OBDD (pseudo tree is a chain) Removing Redundancy A Group OR node together with its AND children into a meta-node B C

  16. A D B B D D D A B 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 C C 0 0 1 1 0 1 0 1 0 1 AOBDD A A A B B B C D D C = *

  17. B D D A B A 0 0 0 0 0 0 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 A C B 0 1 D C Apply Operator A1B1 A1 B1 A1B1 = * A2B2 A4B6 A2B2 A2 B2 B6 A4B4 A4 B4 B7 0 1 0 1 A3B3 0 A3 A5 B3 B5

  18. B D D A B A 0 0 0 0 0 0 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 A C B 0 1 D C Apply Operator A1 B1 A1B1 = * A4B6 A2B2 A2 B2 B6 A4 A4B4 B4 A4 B4 B7 0 1 0 1 0 A3 A5 B3 B5

  19. A B D D B A D 0 0 0 0 0 0 0 1 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 A C C B 0 0 1 1 D C Apply Operator A1 B1 A1B1 = * A4B6 A2B2 A2 B2 B6 A4 B4 A4 B4 A4 B4 B7 0 1 0 1 0 1 A3 A5 B3 B5

  20. D B D D B A B A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 A C C B 0 0 1 1 D C Apply Operator A1 B1 A1B1 = * A4B6 A2B2 A4B6 A2 B2 B6 A4B4 A4B7 A4 B4 A4 B4 B7 0 1 0 1 0 1 A3 A5 B3 B5

  21. B B D D D B A D A 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 A 0 1 B B 0 0 1 1 A C C B 0 0 1 1 D C Apply Operator A1 B1 A1B1 = * A2B2 A4B6 A2 B2 B6 A4B7 A4 B4 A4 B4 B7 B7 0 1 0 1 0 1 A3 A5 B3 B5

  22. And/Or Multi-Valued Decision Diagrams • AOMDDs are: • AND/OR search graphs • canonical representations, given a pseudo tree • Defined by two rules: • All isomorphic subgraphs are merged • There are no redundant (meta) nodes

  23. A A D G B C B F C F A m7 E A H D E G H B primal graph pseudo tree B C F 0 1 m6 m6 m3 0 1 m3 D E G H A A B F 0 1 0 1 B C F C9 C5 0 1 0 1 0 1 m2 C m4 m1 m5 0 1 m1 m5 m4 G H m2 D E A A A C C B A B C C D D C B C F H E A C B C F F E C H B B F A H D G G G A D B G F H F B A D D A B C E F E H A A F B G H C G F B G F 0 1 0 1 0 1 0 1 0 1 0 1 F E H D 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 1 1 1 1 1 1 1 1 1 1 1 1 C8 E G D C1 C4 C6 C7 C2 F C3 0 1 H G (f ∨ h) ∧ (a∨!h) ∧ (a#b#g) ∧ (f ∨ g) ∧ (b ∨ f) ∧ (a ∨ e) ∧ (c ∨ e) ∧ (c#d) ∧ (b ∨ c) Example: m7

  24. A m7 B C F 0 1 m6 A 0 1 m3 D E G H 0 1 m7 B G B C C C H A F C B F F G H B A F B D C F C C D E F B A H B D F F E D C H G G 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Example (continued)

  25. D G C B F A E A H B primal graph C F D E G H 0 1 C G F F C B G F H A B D C E H F D C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 AOBDD vs. OBDD A B B C C C C D D D D D D E E E F F F F G G G G G A H H B C 1 0 D AOBDD 18 nonterminals 47 arcs OBDD 27 nonterminals 54 arcs E F G H

  26. Complexity of Compilation • The size of the AOMDD is O(n kw*) • The compilation time is also bounded by O(n kw*) • k = domain size • n = number of variables • w*= treewidth

  27. Semantic Treewidth • Given a network, there may exist a sparser equivalent network. • Challenges the idea of using induced width to measure the difficulty of the problem • AOMDD sizes are much smaller than the bound

  28. Semantic Treewidth • With respect to a pseudo tree, this is the smallest treewidth over all equivalent networks that can have that pseudo tree • With respect to the network, this is the smallest semantic treewidth over all pseudo trees that can express the set of solutions • Instead of the induced width bounding AOMDD size, we can use semantic treewidth.

  29. Experimental Results Langford(2,k) problem as a CSP

  30. Experimental Results Langford(2,k) problem as a SAT problem

  31. Experimental Results Uniform Random 3-SAT instances

  32. Experimental Results Equality constraint network results

  33. Conclusion • AOMDDs allow us to encode the same information about a problem in an exponentially more compact form • Canonicity aids in revealing whether the induced width is overestimating the difficulty of a problem • It may be interesting to perform more experiments on real-world CSPs.

  34. Acknowledgements • RinaDechter • Pointing me to additional literature • Providing me many of these slides • RaduMarinescu • Providing me the code to compile AOMDDs

More Related