25 th feb ebl example gp-csp other compilation schemes setting up encodings
Post on 21-Dec-2015
216 views
TRANSCRIPT
25th Feb
EBL exampleGP-CSP
Other compilation schemesSetting up encodings
The Story Behind Memos…
• Memos essentially tell us that a particular set S of conditions cannot be achieved at a particular level k in the PG. – We may as well remember this information—so in case we wind up
subgoaling on any set S’ of conditions, where S’ is a superset of S, at that level, you can immediately declare failure
• “Nogood” learning—Storage/matching cost vs. benefit of reduced search.. Generally in our favor
• But, just because a set S={C1….C100} cannot be achieved together doesn’t necessarily mean that the reason for the failure has got to do with ALL those 100 conditions. Some of them may be innocent bystanders.– Suppose we can “explain” the failure as being caused by the set U which
is a subset of S (say U={C45,C97})—then U is more powerful in pruning later failures
– Idea called “Explanation based Learning”• Improves Graphplan performance significantly….
[Rao, IJCAI-99; JAIR 2000]
Explaining Failures with Conflict Sets
Conflict set for P4 = P4
Whenever P can’t be given a value v because it conflicts with the assignment of Q, add Q to P’s conflict set
X
XX
P1
P2
P3
P4
P5
P6
A5
A6
A7
A8
A9
A10
A11
P2 P1
X
XX
P1
P2
P3
P4
P5
P6
A5
A6
A7
A8
A9
A10
A11
DDB & Memoization (EBL) with Conflict SetsWhen we reach a variable V with conflict set C
during backtracking --Skip other values of V if V is not in C (DDB) --Absorb C into conflict set of V if V is in C --Store C as a memo if V is the first variable at this level
Conflict set for P3 = P3 P2
P3
--Skip over P3 when backtracking from P4
Conflict set for P4 = P4 P2 P1
Conflict set for P1 = P4 P2 P1 P3
Conflict set for P2 = P4 P2 P1
Absorb conflict set being passed up
P1
P2
P3
P4
Store P1 P2 P3P4 as a memo
Regressing Conflict Sets
P1
P2
P3
P4
P1
P2
P3
P4
P5
P6
G1
G2
G3
G4
A1
A2
A3
A4
P6
P1
P1 P2 P3P4 regresses to G1 G2
-P1 could have been regressed to G4 but G1 was assigned earlier
--We can skip over G4 & G3 (DDB)
Regression: What is the minimum set of goals at the previous level, whose chosen action supports generate a sub-goal set that covers the memo --Minimal set --When there is a choice, choose a goal that has been assigned earlier --Supports more DDB
Using EBL Memos
If any stored memo is a subset of the current goal set, backtrack immediately
• Return the memo as the conflict set
Smaller memos are more general andthus prune more failing branches
Costlier memo-matching strategy --Clever indexing techniques available Set Enumeration Trees [Rymon, KRR92] UBTrees [Hoffman & Koehler, IJCAI-99]
Allows generation of more effectivememos at higher levels… Not possible with normal memoization
P1
P2
P3
P4
P1
P2
P3
P4
P5
P6
G1
G2
G3
G4
A1
A2
A3
A4
P6
P1
Speedups are correlated with memo-length reduction
Problem Length GP+EBL Graphplan Speedup
Huge-fct 18/18 9.5 11.3 1.7xBW-large-B 18/18 10.2 11.83 1.8xRocket-ext-a 7/36 8.5 23.9 24xRocket-ext-b 7/36 7.5 23.8 17xAtt-log-a 11/79 8.21 32 >1215xGripper-8 15/23 9 17.8 90xGripper-10 19/29 11 - >10xTower-5 31/31 .6.7 20.9 42x
Tower-6 63/63 7.9 22.3 >40x
TSP-10 10/10 6.9 13 >25x
TSP-12 12/12 7.9 - >58x
Ferry-5 31/31 8.8 25 37x
Ferry-6 39/39 10.9 - >25x
Compiling Planning Graph into CSP
onT-A
onT-B
cl-A
cl-B
he
Pick-A
Pick-B
onT-A
onT-B
cl-A
cl-B
he
h-A
h-B
~cl-A
~cl-B
~he
St-A-B
St-B-A
Ptdn-A
Ptdn-B
Pick-A
onT-A
onT-B
cl-A
cl-B
he
h-Ah-B
~cl-A
~cl-B
~he
on-A-B
on-B-A
Pick-B
Variables/Domains:~cl-B-2: { #, St-A-B-2, Pick-B-2,~cl-B-1}he-2: {#, St-A-B-2, St-B-A-2,Ptdn-A-2,Ptdn-B-2,he-1}h-A-1: {#, Pick-A-1,h-A-0}h-B-1: {#,Pick-B-1,h-B-0 }….
Constraints: he-2 = St-A-B-2 => h-A-1 !=# {activation}
On-A-B-2 = St-A-B-2 => On-B-A-2 != St-B-A-2 {mutex constraints} Goals:~cl-B-2 != # he-2 !=#
Conversion to CSP
-- This search can also be cast as a CSP Variables: literals in proposition lists Values: actions supporting them Constraints: Mutex and Activation constraints
CSP Encodings can be faster than Graphplan Backward Search
Graphplan Satz Relsat GP-CSP
Problem time (s) mem time(s) mem time (s) mem time (s) mem
bw-12steps 0.42 1 M 8.17 64 M 3.06 70 M 1.96 3M
bw-large-a 1.39 3 M 47.63 88 M 29.87 87 M 1.2 11M
rocket-a 68 61 M 8.88 70 M 8.98 73 M 4.01 3M
rocket-b 130 95 M 11.74 70 M 17.86 71 M 6.19 4 M
log-a 1771 177 M 7.05 72 M 4.40 76 M 3.34 4M
log-b 787 80 M 16.13 79 M 46.24 80 M 110 4.5M
hsp-bw-02 0.86 1 M 7.15 68 M 2.47 66 M .89 4.5 M
hsp-bw-03 5.06 24 M > 8 hs - 194 121 M 4.47 13 M
hsp-bw-04 19.26 83 M > 8 hs - 1682 154 M 39.57 64 M
Do & Kambhampati, 2000
But but WHY? --We are taking the cost of converting PG into CSP (and also tend to lose the ability to use previous level search) --there is NO reason why the search for finding the valid subgraph has to go level-by-level and back to front. --CSP won’t be hobbled by level-by-level and back-to-front
2/27
GP-CSP—more
Other compilation schemes
Setting up encodings
Mini-Project1Observations..
• Paction can cause incompleteness– Gripper 20
• Why is Hlev giving longer solutions?– Use of parallel rather than sequential graphs in
AltAlt ??– Weighted evaluation f=g+5*h
• Should have tables (even if no traces)• Need access to better machines?
Another way of thinking of the CSP compilation….
DDB & EBL in CSP
N1 : {x=A}
N2 : {x=A & y =B }
N3 : {x=A & y =B & v = D }
N4 : {x=A & y =B & v = D & u = C }
N5 : {x=A & y = B & v = D & u = C & w= E }
N6 : {x=A & y = B & v = D & u = C & w= D }
x A
yB
vD
wEwD
uC
E6: y = B & w = D
E5: x=A & w=E
E4: y = B & x=Ay=B
x=A
y = B & x=A
y = B & x=A
x=A Resume Search
regression
Interior nodeexplanation
DDB: Skip a level if the regressed Explanation remains the same
EBL: Store interior node failure Explanations
x,y,u,v: {A,B,C,D,E}w: {D,E} l : {A,B}x=A wEy=B uDY=b=> w!= Du=C lAv=D lB
It is no good to have too many nogoods..
• Keeping no goods around can be a mixed blessing..– Depth first search takes linear space to solve CSP.
• With nogoods, it can take exponential space– With n variables of size D, we might—in the worst case, keep
O(nD ) nogoods!
– Utility problem up the wazzoo..
» Exponential space
» Exponential matching cost..
– Yes, Virginia—There is such a thing called too much of a good thing.
Ideas to reduce the number of stored nogoods
• Size-based pruning– The smaller the nogood is the more powerful it is. So, limit the size of the
nogoods stored to k or less (k<<n; usually about 5)• Only O( kD) nogoods stored• Normal EBL corresponds to k=n
• Relevance-based pruning– Prune a nogood when it differs in more than k places from the current
assignment• Anytime we backtrack over a node, we are likely to prune some of the nogoods• Normal EBL corresponds to k=n
• Utility-based pruning– Keep track of the usage of the nogoods. Keep only nogoods which are
being used…• Costly maintenance.
Sort of like page replacement strategies…