introduction combining two frameworks and/or search spaces multi-valued decision diagrams (mdds)...

34
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. 1

Post on 19-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

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.

1

Page 2: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Introduction

2

)(

)(

)(

)(

)(

)(

ABCF

CDF

BDF

BCF

ABEF

ACFF A

D

B C

E

F

Compiled structure

OFFLINE

ONLINE

Evaluate answer

Polytime? Constant time?

ONCE

MANY

Query

Page 3: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Ordered Binary Decision Diagram

3

A B C f(ABC)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

B = {0,1} f : B3 → B

Table

B

A

C

0 0

C

0 1

B

C

0 1

C

0 1

SimplifyMerge terminal nodes

B

A

C C

0 1

B

C C

1) Merge nodes with identical children

B

A

C

0 1

B

C

2) Remove redundant nodes

B

A

0 1

B

C

B

A

0 1

C

OBDD[Bryant86]

Ordering enables efficient operations

B

A

C

0 0

C

0 1

B

C

0 1

C

0 1

Decision tree

A

B

C

Page 4: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Decision Diagrams

4

f = (A ∨ E) ∧ (B ∨ F)

g = (C ∨ G) ∧ (D ∨ H)

B

A

F

10

E

B

E f ∧ g = ?

f ∧ g =

OBDD

OBDD

D

C

H

10

G

D

G

ANDD

C

H

10

G

D

G

B

A

F

10

E

B

E

01

B

A

C

D D

C

B

D D

C

D D

C

D D

E E E E E E E E

F F

H

GG

F F

Page 5: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

AOMDDs

5

Point dead-ends to terminal node “0”

Point goods to terminal node “1”

0

A

0 1

B

0 1

1

C

0 1

B

0 1

Decision Diagram

A

B

C

A B C f(ABC)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

A

0 1

B

1

C

1

B

0 1

Minimal AND/OR graph

Page 6: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Removing Redundancy

6

0

A

0 1

B

0 1

1

C

0 1

B

0 1

redundant

Group OR node together with its AND children into a meta-node

0

A

0 1

B

0 1

1

C

0 1

B

0 1

0

A

0 1

B

0 1

1

C

0 1

OBDD(pseudo tree is a chain)

A

B

C

A B C f(ABC)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

0

A

0 1

B

0 1

1

C

0 1

Page 7: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

AOBDD

7

A

B

C

A B C f(ABC)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

0

A

0 1

B

0 1

1

C

0 1

*

A

B

D

A

B

DC

=

A B D g(ABD)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 0

0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

0 1

B

0 1

0

C

0 1

D

0 1

1

B

0 1

D

0 1

Page 8: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Apply Operator

8

0

A

0 1

B

0 1

1

C

0 1

* =0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

B

DC

A1

A2

A3

A4

A5

B1

B2

B3

B4

B5

B6

B7

A1B

1

A

0 1A1B1

A2B

2

A4B

6

B

0 1A2B2

A3B

3

A4B

4

0

Page 9: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Apply Operator

9

0

A

0 1

B

0 1

1

C

0 1

* =0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

B

DC

A1

A2

A3

A4

A5

B1

B2

B3

B4

B5

B6

B7

A

0 1A1B1

A4B

6

B

0 1A2B2

A4B

4

0

A4

B4

Page 10: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Apply Operator

10

0

A

0 1

B

0 1

1

C

0 1

* =0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

B

DC

A1

A2

A3

A4

A5

B1

B2

B3

B4

B5

B6

B7

A

0 1A1B1

A4B

6

B

0 1A2B2

0

A4

B4

C

0 1A4

D

0 1B4

1

Page 11: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Apply Operator

11

0

A

0 1

B

0 1

1

C

0 1

* =0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

B

DC

A1

A2

A3

A4

A5

B1

B2

B3

B4

B5

B6

B7

A

0 1A1B1

A4B

6

B

0 1A2B2

0

C

0 1A4

D

0 1B4

1

B

0 1A4B6

A4B

4

A4B

7

Page 12: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Apply Operator

12

0

A

0 1

B

0 1

1

C

0 1

* =0

A

0 1

B

0 1

1

D

0 1

D

0 1

B

0 1

A

B

DC

A1

A2

A3

A4

A5

B1

B2

B3

B4

B5

B6

B7

A

0 1A1B1

B

0 1A2B2

0

C

0 1A4

D

0 1B4

1

B

0 1A4B6

A4B

7

D

0 1B7

Page 13: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

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

13

Page 14: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

14

Example:

HG

ED

CF

B

A

F0 1

H0 1

0 1C1

A0 1

H0 1

0 1C2

A0 1

B0 1

G0 1

G0 1

B0 1

0 1C3

F0 1

G0 1

0 1C4

A0 1

E0 1

0 1C6

C0 1

E0 1

0 1C7

C0 1

D0 1

D0 1

0 1C8

B0 1

C0 1

0 1C9

B0 1

F0 1

0 1C5

m1

m3

m7

m6

m4 m 2m 5

A0 1

F0 1

H0 1

F0 1

H0 1

0 1m1

A0 1

B0 1

G0 1

F0 1

B0 1

G0 1

0 1m2

A0 1

E0 1

C0 1

0 1m4

C0 1

D0 1

D0 1

0 1m5

A0 1

B0 1

F0 1

G0 1

H0 1

F0 1

G0 1

B0 1

F0 1

F0 1

H0 1

0 1m3

A0 1

B0 1

C0 1

C0 1

D0 1

E0 1

D0 1

B0 1

C0 1

C0 1

0 1m6

m7

A

F

H

D

C B F

AE

G

H

primal graph

A

B

C F

D E G H

pseudo tree

A

B

F

G H

C

D

A

B

C

D E

A

B

C F

D E G H

A

B

F

G

C

E

A

(f h) (a∨ ∧ ∨ !h) (a#b#g) (f g) ∧ ∧ ∨ ∧(b f) (a e) (c e) (c#d) (b c)∨ ∧ ∨ ∧ ∨ ∧ ∧ ∨

Page 15: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Example (continued)

15

B

A

m7

A0 1

B0 1

F0 1

G0 1

H0 1

F0 1

G0 1

B0 1

F0 1

F0 1

H0 1

0 1m3

A0 1

B0 1

C0 1

C0 1

D0 1

E0 1

D0 1

B0 1

C0 1

C0 1

0 1m6

A

B

C F

D E G H

m7

A0 1

B0 1

C0 1

0

D0 1

1

F0 1

G0 1

H0 1

C0 1

D0 1

E0 1

F0 1

G0 1

B0 1

C0 1

F0 1

C0 1

F0 1

H0 1

Page 16: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

AOBDD vs. OBDD

16

D

C

B

F

A

E

G

H

1 0

B

CC C

D D D D D

E E

F F F

G G G G

H

AOBDD

18 nonterminals

47 arcs

OBDD

27 nonterminals

54 arcs

A0 1

B0 1

C0 1

0

D0 1

1

F0 1

G0 1

H0 1

C0 1

D0 1

E0 1

F0 1

G0 1

B0 1

C0 1

F0 1

C0 1

F0 1

H0 1

A

B

C F

D E G H

A

B

C

F

D

E

G

H

D

C B F

AE

G

H

primal graph

Page 17: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

17

Constraint Optimization - AND/OR Tree

A B C f1(ABC)

0 0 0 8

0 0 1 8

0 1 0 8

0 1 1 2

1 0 0 8

1 0 1 2

1 1 0 8

1 1 1 2

A B D f2(ABD)

0 0 0 1

0 0 1 8

0 1 0 0

0 1 1 2

1 0 0 6

1 0 1 5

1 1 0 6

1 1 1 5

B D E f3(BDE)

0 0 0 8

0 0 1 3

0 1 0 8

0 1 1 4

1 0 0 8

1 0 1 3

1 1 0 8

1 1 1 4

A

E

B D

C

f2(ABD)f1(ABC)

f3(BDE)

A

E

B

DC

[ ]

[A]

[AB]

[BD]

[AB]

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

E

10

8 3E

10

8 4

C

10

8 2D

106 5

E

10

8 3E

10

8 4

Page 18: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

18

AND/OR Context Minimal Graph

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

C

10

8 2D

106 5

A B C f1(ABC)

0 0 0 8

0 0 1 8

0 1 0 8

0 1 1 2

1 0 0 8

1 0 1 2

1 1 0 8

1 1 1 2

A B D f2(ABD)

0 0 0 1

0 0 1 8

0 1 0 0

0 1 1 2

1 0 0 6

1 0 1 5

1 1 0 6

1 1 1 5

B D E f3(BDE)

0 0 0 8

0 0 1 3

0 1 0 8

0 1 1 4

1 0 0 8

1 0 1 3

1 1 0 8

1 1 1 4

A

E

B D

C

f2(ABD)f1(ABC)

f3(BDE)

A

E

B

DC

[ ]

[A]

[AB]

[BD]

[AB]

Page 19: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

19

AOMDD – Compilation by Search

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

C

10

8 2D

106 5

A

10

B

10

C

10

8 8

0

C

10

8 2D

100 2

E

10

8 3

A

E

B

DC

E

10

8 4

redundant

1

Page 20: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

20

AOMDD – Compilation by Search

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

C

10

8 2D

106 5

A

10

B

10

10

C

10

8 2D

100 2

E

10

8 3

A

E

B

DC

E

10

8 4

B

10

C

10

8 2D

106 5

E

10

8 3

isomorphic

isomorphic

E

10

8 4 isomorphic

Page 21: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

21

AOMDD – Compilation by Search

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

C

10

8 2D

106 5

A

10

B

10

10

C

10

8 2D

100 2

E

10

8 3

A

E

B

DC

E

10

8 4

B

10

D

106 5

C

10

8 2isomorphic

D

106 5 isomorphi

c

Page 22: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

22

AOMDD – Compilation by Search

B

10

A

10

C

10

8 8

D

101 8

E

10

8 3E

10

8 4

C

10

8 2D

100 2

E

10

8 3E

10

8 4

B

10

C

10

8 2D

106 5

C

10

8 2D

106 5

A

10

B

10

10

C

10

8 2D

100 2

E

10

8 3

A

E

B

DC

E

10

8 4

B

10

D

106 5

redundant

Page 23: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

23

AOMDD for Constraint Optimization

A

10

B

10

10

C

10

8 2D

100 2

E

10

8 3E

10

8 4

D

106 5

A=0

E=1

B=1

D=0C=12

3

A=0

E=1

B=1

D=1C=12 2

4

A=1

E=1

B=0

D=0C=12 6

3

A=1

E=1

B=0

D=1C=12 5

4

A=1

E=1

B=1

D=0C=12 6

3

A=1

E=1

B=1

D=1C=12 5

4

cost = 5 cost = 8 cost = 11 cost = 11 cost = 11 cost = 11

AOMDD for all solutions

A

10

B

10

10

C

10

8 2D

100 2

E

10

8 3E

10

8 4

AOMDD for two best solutions

Page 24: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Complexity of Compilation The size of the AOMDD is O(n kw*)

The compilation time is also bounded by O(n kw*)

24

k = domain sizen = number of variablesw*= treewidth

Page 25: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

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

25

Page 26: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

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.

26

Page 27: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Semantic Treewidth

27

Equality constraint network results

Page 28: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Constraint Propagation We can also prune the search space during

compilation without removing possible solutions.

In Bayesian networks, prune a subtree if the weight of the assignment is 0.

28

Page 29: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Experiments What about the pseudo-tree height

parameter? Problems: WCSP instances

ISCAS 89 Circuits SPOT5 Satellites Mastermind CELAR6 Radio Frequencies

Time bound for compilation: 3 hours

29

Page 30: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Experiments Compilation was for finding the optimal

solution Used AOBB with static mini-bucket

heuristics (i-bound = 10) Tried different implementations of MinFill

Existing implementation in the compiler daoopt (gets lower h because it considers it

too) CVO

30

Page 31: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Experiments BnB pruning makes the size unpredictable

as a function of the parameters Need to modify the routine for solution

counting so the entire AOMDD is actually compiled

31

Page 32: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Experiments (BN) Reproduce and extend BN results in JAIR

2008 paper UAI 2006 Bayesian network benchmarks

Domain sizes of 2 Evidence on 30 random variables (to simplify

the networks slightly) Many elements with “0” support

Compile with constraint propagation

32

Page 33: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

To do Perform experiments to compare

optimization vs. full compilation Need to extend code for WCSPs

Another way to deal with unpredictability of w/h vs. size in optimization? Compute many orderings with equal w/h and

average the search space/AOMDD sizes.

33

Page 34: Introduction Combining two frameworks AND/OR Search Spaces Multi-valued Decision Diagrams (MDDs) Both are more compact ways to represent problems. Their

Future Work? Try regressing curves that depend on w, h,

or both Evaluation of bottom-up version of

compilation (Robert’s algorithm in CP 2006)

34