Download presentation
Presentation is loading. Please wait.
Published byFelix Mills Modified over 6 years ago
1
A New Algorithm for Computing Upper Bounds for Functional EmajSAT
Knot Pipatsrisawat and Adnan Darwiche Computer Science Department, UCLA IJCAI-09
2
Outline Functional EmajSAT
Existing bound computation using knowledge compilation New bound computation algorithm Using the new algorithm in a BnB solver Experimental results I’ll first explain the problem, then I’ll describe an existing algorithm for computing bounds which is based on knowledge compilation. Next, I’ll go over our new algorithm which is a simple yet very effective for this problem. Then, I’ll show how our contribution can be efficiently utilized in a branch & bound solver for functional emajsat.
3
Functional EmajSAT (F-EmajSAT)
(a b x) (a b y) (b c x y) (b c x y) (c y) (x) (true) (x y) (true) Model Weight x, y 0.3*0.8=0.24 x,y 0.3*0.2=0.06 Total 0.3 a=f,b=f,c=f Choice: M = {a,b,c} Chance: R = {x,y} Every femajsat consists of a boolean formula in cnf which is defined over choice & chance. Moreover, each literal of the chance vars has a weight. The score of a complete instantiation of the choice vars is the weighted model count of the conditioned formula, where the weight of a model is simply the product of the literals’ weights. (x) = 0.7 (x) = 0.3 (y) = 0.8 (y) = 0.2 The score of m = weighted model count of |m Weight of model r = product of literal weights
4
Functional EmajSAT (F-EmajSAT)
(a b x) (a b y) (b c x y) (b c x y) (c y) (true) (x y) (y) Model Weight x, y 0.7*0.8=0.56 x,y 0.3*0.8=0.24 Total 0.8 a=t,b=f,c=t Choice: M = {a,b,c} Chance: R = {x,y} (x) = 0.7 (x) = 0.3 (y) = 0.8 (y) = 0.2
5
Functional EmajSAT Problem
Given a CNF formula ∆ on M and R Find a complete assignment m of M so that the weighted model count of ∆|m is maximal The goal of femajsat is to find a complete assignment of M that has the largest score. As you can see, the problem requires searching for the best assignment while evaluating each assignment requires you to essentially count models.
6
Applications of F-EmajSAT
Probabilistic Conformant Planning Planning with uncertainty Maximum a Posteriori Hypothesis (MAP) A Bayesian network query
7
Our Approach for Computing Bounds
Other info. (e.g., weights, variable types) CNF F-EmajSAT Knowledge compilation dDNNF Unfortunately, both searching & counting are very difficult when the problem is described in CNF. So our approach for dealing with this problem is to compile the formula into a different form known as dDNNF, which I’ll explain in a moment. Our bound computation algorithm then use the dDNNF and other information of the problem to compute the bounds. So, given a partial assignment of the choice, our algorithm will compute an upper bound of the score of any complete assignment that extends the given one. Bound algorithm A (partial) assignment m Upper bound
8
Deterministic Decomposable Negation Normal Form (dDNNF)
Is a subset of NNF which satisfies Decomposability Determinism One key to our approach is the use of blah blah (dDNNF) for bcomputation. This is because, under certain conditions, searching & counting becomes easy once you have the formula in this form. So what is dDNNF?
9
Negation Normal Form A B B A C D D C and or
NNF or neg…is a DAG whose leaves are literals or truth constants and each internal node is either AND or OR. rooted DAG (Circuit)
10
Decomposability or and and or or or or and and and and and and and and
No two children of AND share a variable or and and A,B C,D or or or or Decomposability only applies to AND nodes. An AND node is decomp. If its children do not mention the same variable. An NNF is decomposable if every AND node in the graph is decomposable. and and and and and and and and A B B A C D D C
11
Determinism or and and or or or or and and and and and and and and A
No two children of OR share a model or and and or or or or Determinism on the other hand is a property of OR nodes. An OR node is deterministic if its children do not share a model and we say that an NNF is deterministic if every OR node in the graph is deterministic. and and and and and and and and A B B A C D D C
12
Decision Nodes α β or and and A A
In this work, the dDNNF that we’ll use actually satisfies a special type of determinism called Decision. Every OR node that satisfies the Decision property has exactly two children which disagree on the value of a variable called the decision variable. A is called the decision variable of the OR node. If it is a choice variable, the OR node is a choice OR node. If it is a chance variable, the OR node is a chance OR node.
13
Using dDNNF for Bound Computation
Use the dDNNF as a circuit to compute the solution 1 bottom-up traversal required Linear in the size of the circuit Given an assignment m’, we compute an upper bound of the score of any m that extends m’ To compute an upper bound, we will evaluate the dDNNF like a circuit. Starting at the leaves at each node we will compute a value.
14
Evaluating dDNNF (existing algorithm)
value = 0, L is falsified weight(L), o/w L and value = value(α) * value(β) α β or value = value(α) + value(β) (chance) The value of a leaf node is simply the weight of the literal unless it is set to false by the input assignment. The value of an AND node is the products of its children’s values. The value of a chance OR node is the sum of its children’s values. Finally, the value of a a choice OR node is the max of values of its children. α β or (choice) value = max(value(α),value(β)) α β
15
Computing F-EmajSAT Bounds with dDNNF
z or and and x y x y z or or or or ¬z Now let’s take a look at an example. This graph shows the top part of a dDNNF. Each OR node of this graph is labeled with its decision variable. In this example, we have x, y as the choice variables and z as the only chance variable. x ¬x y ¬y x ¬x y ¬y M = {x,y}, R = {z}
16
Computing F-EmajSAT Bounds with dDNNF
0.23 z + (or) 0.15 0.08 * * (and) (and) 0.5 0.6 0.2 0.8 x y x y z max max max max ¬z (or) (or) (or) (or) Now, I’ve labeled every internal node with the operation that we need to perform when we evaluate this circuit. Now let’s assume that the value of the nodes at bottom are as follows. And we can propagate the values up this graph by evaluating each node. For example, at this node here, we take the max of its children’s values which is 0.5. The same goes for other nodes at this level. The value of this node is the product of these three numbers. Eventually, we obtain the value of the root which is the upperbound produced by this algorithm. 0.5 x ¬x y ¬y x ¬x y ¬y 0.5 0.5 0.3 0.6 0.2 0.1 0.2 0.3 0.8 M = {x,y}, R = {z}
17
Cause of Bound Looseness
0.23 z + (or) 0.15 0.08 * * (and) (and) 0.5 0.6 0.2 0.8 x y x y z max max max max ¬z (or) (or) (or) (or) This value is an overestimation of the solution because the value of this AND node 0.15 actually comes from assuming the positive values for both x and y. however, the value of this node, comes from choosing the negative values for x and y. now, at the root, the algorithm simply adds these two local solutions together even though their assignments are incompatible. So, the value 0.23 doesn’t really correspond to any legal assignment to the choice variables. 0.5 x ¬x y ¬y x ¬x y ¬y 0.5 0.5 0.3 0.6 0.2 0.1 0.2 0.3 0.8 M = {x,y}, R = {z}
18
A New Bound Computation Algorithm
Instead of computing one value at each node Compute pairs of options Option pair (on variable x) contains Upper bound of the node’s value if x = true Upper bound of the node’s value if x = false One pair for each choice variable appearing below the node The problem with the existing algorithm is that at each node, we only have a number. We have no idea what the underlying assignment is. So, as we propagate the values up the graph, it’s very likely that we’ll eventually add numbers obtained from incompatible assignments together without knowing it. Therefore, the result is a number which is too optimistic. So in this work, we deal with this problem by propagating a bit more information up the circuit. Instead of computing a value at each node, we will now compute pairs of options. One pair per choice variable. An option pair is simply a pair of numbers which represent the maximum values of the node, under each assignment of the choice variable.
19
A New Bound Computation Algorithm: Example
upper bound = the smallest best option upper bound = 0.18 [x,0.19,0.17] [x,0.19, ] z [y,0.18,0.13] + 0.23 (or) [x,0.04,0.08] [x,0.15, ] [x,0.15,0.09] [y,0.03,0.08] [y,0.15,0.05] * * 0.15 0.08 (and) (and) [x,0.1,0.2] [y,0.3,0.8] [x,0.5,0.3] [y,0.6,0.2] x y x y z max max max max ¬z In this example, we have exactly the same circuit. Before, at this node, we compute just one number 0.5. but now, since x is a choice variable that appears under this node, we ask what would the node’s value be if we set x to true. In this case, the node’s value would be 0.5. but when is is false, the value is at most 0.3. We store this information. We do the same thing for y at this node. And the rest of the node at this level. Now to compute the value of this and node, which mentions both x, y., we first ask what’s the maximum value of this node if we set x to true? That would be the product of these three numbers. However, if x is set to false, we know the value of this node here is at most 0.3, so the value of this AND node when x is false is at most And we do the same thing for y and for this other AND node. Now, for the root, in the case of x, if it is set to true, then the maximum value we can get is the sum of these two #s. But when x is set to false, it’s the sum of these two numbers. And the same thing for y. Now, that we finished. The final upperbound is simply the smallest value of the max of each pair. This is because in any complete assignment, every choice variable has to be set to either true or false. In this case, the upper bound is 0.18, which is tighter that 0.23 that we got before. 0.5 0.6 (or) (or) 0.2 (or) 0.8 (or) 0.5 x ¬x y ¬y x ¬x y ¬y 0.5 0.5 0.3 0.6 0.2 0.1 0.2 0.3 0.8 M = {x,y}, R = {z}
20
Branch-and-Bound Search
Best score: t f M = {A,B,C} B B t f t f C C C C In order to evaluate the benefits of this new algorithm we are going to utilize it in a branch and bound search to see if the gain is worth the additional computation. So, a brief review of branch-n-bound. For functional emajsat, we search over the space of assignments to the choice variables. At any time we keep track of the best solution seen so far. And at each node, we compute an upper bound for the current partial assignment. The algorithm can prune as soon as the bound is worse than the best solution. t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
21
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B B t f t f C C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
22
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
23
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C 0.09 C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
24
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C 0.09 C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
25
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C 0.09 C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
26
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C C 0.12 C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
27
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C C 0.12 C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
28
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B 0.13 B t f t f C C 0.12 C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
29
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B B 0.1 t f t f C C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
30
Branch-and-Bound Search
0.15 Best score: t f M = {A,B,C} B B 0.1 t f t f C C C C t f t f t f t f 0.009 0.079 0.117 0.053 0.023 0.051 0.031 0.055
31
Using Option Pairs for Value Pruning
An additional pruning technique Take advantage of information stored in option pairs When we integrate the new bound algorithm into branch n bound search we actually have an opportunity to do some extra pruning since we have much more information at the root of the circuit.
32
Using Option Pairs for Value Pruning
[x,0.82,0.7] x = true y = false z = true w = true Best score = 0.8 [y,0.6,0.85] [z,0.9,0.77] or [w,0.83,0.7] and and For example, imagine that we have the following option pairs at the root node. In this case, the upper bound value is now let’s assume further that the best score seen by the search Is 0.8. since the upper bound is still larger than the best score, we cannot prune yet. However, based on the information in the option pairs, we know that if x is set to false the bound will actually drop below the best score. So in this case we can actually infer the value of x and other variables just by analyzing the option pairs. or or or or
33
Experimental Results Application domains
Probabilistic conformant planning Probabilistic reasoning (MAP computation) So, now we will show some experimental results. We considered two different problems which can be reduced to functional emajsat.
34
Experimental Results: Planning
Probabilistic conformant planning Planning problem with uncertainty in Initial state Outcomes of actions Given the length of plan Find a plan with the highest success probability Compared with ComPlan [Huang’06] A planner based on dDNNF
35
Experimental Results: Planning
Sand-castle The first set of planning problems we used is called sand-castle. This plot shows the running time that complan and our planner complan+ used to solve problems with different plan lengths. we can see that the new algorithm significantly outperform the existing one one these problems. Here is the result under log scale. This plot shows that both planners runs exponentially in the problem size but complan+ has a smaller base of exponent.
36
Experimental Results: Planning
Slippery-gripper A similar result is also observed on the set of problems called slippery-gripper. But the gain is a bit more modest in this case.
37
Experimental Results: MAP
Maximum a Posteriori Hypothesis (MAP) Given a Bayesian network, a set of evidence, and set of MAP variables Find a most likely instantiation of the MAP variables For each Bayesian network, we generate 10 random MAP queries and report the average running time Compared with Acemap [Huang et al’06] A MAP solver based on dDNNF In the next experiment, we evaluated the new algorithm on the problem of computing maximum a posteriori hypothesis or MAP.
38
Expanded Nodes Grid 50-12-2 Grid 75-1-2 Number of MAP variables
Here we show the performance of both solvers on two different bayesian networks with grid structure. In both cases, we varied the number of MAP variables to generate problems with different degrees of difficulty. These plots show the number of nodes expanded by acemap and our solver acemap+. In both networks, the number of nodes expanded by our algorithm is several orders of magnitude fewer. Number of MAP variables Number of MAP variables Acemap Acemap+
39
Running time Grid 50-12-2 Grid 75-1-2 Number of MAP variables
In terms of running time, the gap between acemap and acemap+ becomes smaller, because the new algorithm requires more work to compute a bound. Nevertheless, acemap+ is still 1-2 orders of magnitude faster on these problems. Number of MAP variables Number of MAP variables Acemap Acemap+
40
Conclusions A new algorithm for computing upper bounds for the functional EmajSAT problem A value pruning technique for branch-and-bound functional EmajSAT solvers Improvement in performance on many families of problems that are difficult for previous algorithms Planning MAP
41
Thank you
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.