Planning and Optimization
C5. Delete Relaxation: hmax andhadd
Gabriele R¨oger and Thomas Keller
Universit¨at Basel
October 24, 2018
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Content of this Course
Planning
Classical
Tasks Progression/
Regression Complexity Heuristics
Probabilistic
MDPs Uninformed Search
Heuristic Search Monte-Carlo
Methods
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Content of this Course: Heuristics
Heuristics
Delete Relaxation Relaxed Tasks Relaxed Task Graphs
Relaxation Heuristics Abstraction
Landmarks Potential Heuristics Cost Partitioning
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Introduction
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Delete Relaxation Heuristics
In this chapter, we introduceheuristics based on delete relaxation.
Their basic idea is to propagate information
in relaxed task graphs, similar to the previous chapter.
Unlike the previous chapter, we do not just propagate information aboutwhether a given node is reachable, but estimates how expensiveit is to reach the node.
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reminder: Running Example
We will use the same running example as in the previous chapter:
Π =hV,I,{o1,o2,o3,o4}, γi with V ={a,b,c,d,e,f,g,h}
I ={a7→T,b7→T,c 7→F,d 7→T, e 7→F,f 7→F,g 7→F,h7→F}
o1 =hc ∨(a∧b),c ∧((c∧d)Be),1i o2 =h>,f,2i
o3 =hf,g,1i o4 =hf,h,1i
γ =e∧(g∧h)
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Algorithm for Reachability Analysis (Reminder)
reachability analysis in RTGs = computing all forced true nodes = computing the most conservative assignment Here is an algorithm that achieves this:
Reachability Analysis
Associate areachableattribute with each node.
for allnodes n:
n.reachable:=false whileno fixed point is reached:
Choose a node n.
if n is an AND node:
n.reachable:=V
n0∈succ(n)n0.reachable if n is an OR node:
n.reachable:=W
n0∈succ(n)n0.reachable
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
a
F T
b
F T
c
F T
d
F T
e
F T
f
F T
g
F T
h
F T
I
F T F
T
F
T FT
o1,>
F T
o1,c∧d
F T
F T
o2,>
F T
o3,>
F T
o4,>
F T
F T
γ
F T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
a
F
T b
F
T c
F
T d
F
T e
F
T f
F
T g
F
T h
F
T
I
F
T
F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
a
F
T b
F
T c
F
T d
F
T e
F
T f
F
T g
F
T h
F
T
I F
T F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b
F
T c
F
T d
F
T e
F
T f
F
T g
F
T h
F
T
I F
T F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
c
F
T d
F
T e
F
T f
F
T g
F
T h
F
T
I F
T F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
c
F
T dF
T
e
F
T f
F
T g
F
T h
F
T
I F
T F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
c
F
T dF
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
c
F
T dF
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T F
T o1,>
F
T o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
c
F
T dF
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T F
T o1,F>
T
o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T F
T o1,F>
T
o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,c∧d
F
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
e
F
T f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2,>
F
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f
F
T g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3,>
F
T o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
g
F
T h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
gF
T
h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,>
F
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
gF
T
h
F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,F>
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
gF
T
h F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,F>
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
gF
T
h F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,F>
T
F
T
γ
F
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Reachability Analysis: Example (Reminder)
aF
T
b F
T
Fc
T
d F
T
eF
T
f F
T
gF
T
h F
T
I F
T
F
T
F
T
F
T
o1,F>
T
o1,cF∧d
T
F
T
o2F,>
T
o3F,>
T
o4,F>
T
F
T
γF
T
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h max and h add
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
Associating Costs with RTG Nodes
Basic intuitions for associatingcostswith RTG nodes:
To apply an operator, we must pay itscost.
To make an OR nodetrue, it is sufficient to make oneof its successors true.
Therefore, we estimate the cost of an OR node as theminimumof the costs of its successors.
To make an AND nodetrue,allits successors must be made true first.
We can beoptimisticand estimate the cost as themaximumof the successor node costs.
Or we can bepessimisticand estimate the cost as thesumof the successor node costs.
We will prove later that this is indeed optimistic/pessimistic.
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
maxAlgorithm
(Differences to reachability analysis algorithm highlighted.) Computinghmax Values
Associate acostattribute with each node.
for allnodes n:
n.cost:=∞
whileno fixed point is reached:
Choose a node n.
if n is an AND nodethat is not an effect node:
n.cost:=maxn0∈succ(n)n0.cost if n is aneffect node for operator o:
n.cost:=cost(o) + maxn0∈succ(n)n0.cost if n is an OR node:
n.cost:=minn0∈succ(n)n0.cost
The overall heuristic value is the cost of thegoal node,nγ.cost.
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
a
∞0
b
∞0
c
∞1
d
∞0
e
∞2
f
∞2
g
∞3
h
∞3
I
∞0
∞0
∞0 ∞1
o1,>
∞1
o1,c∧d
∞2
+1 +1
∞0
o2,>
∞2
+2
o3,>
∞3
+1
o4,>
∞3
+1
∞3
γ
∞3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
a
∞
0 b
∞
0 c
∞
1 d
∞
0 e
∞
2 f
∞
2 g
∞
3 h
∞
3
I
∞
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
a
∞
0 b
∞
0 c
∞
1 d
∞
0 e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
b
∞
0 c
∞
1 d
∞
0 e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
c
∞
1 d
∞
0 e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
c
∞
1 ∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
c
∞
1 ∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
c
∞
1 ∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0 ∞
1 o1,>
∞
1 o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
c
∞
1 ∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0 ∞
1 o1∞,>
1
o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
∞c
1
∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0 ∞
1 o1∞,>
1
o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3
Introduction hmaxandhadd Properties ofhmaxandhadd Summary
h
max: Example
∞a
0
∞b
0
∞c
1
∞d
0
e
∞
2 f
∞
2 g
∞
3 h
∞
3
∞I
0
∞
0
∞
0
∞
1
o1∞,>
1
o1,c∧d
∞
2
+1 +1
∞
0 o2,>
∞
2
+2
o3,>
∞
3
+1
o4,>
∞
3
+1
∞
3
γ
∞
3
hmax(I) = 3