Foundations of Artificial Intelligence
36. Automated Planning: Delete Relaxation Heuristics
Malte Helmert
University of Basel
May 5, 2021
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Automated Planning: Overview
Chapter overview: automated planning 33. Introduction
34. Planning Formalisms
35.–36. Planning Heuristics: Delete Relaxation 35. Delete Relaxation
36. Delete Relaxation Heuristics 37. Planning Heuristics: Abstraction 38.–39. Planning Heuristics: Landmarks
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Relaxed Planning Graphs
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Relaxed Planning Graphs
relaxed planning graphs: representwhich variables in Π+ can be reached and how
graphs withvariable layers Vi andaction layersAi
variable layerV0 contains thevariable vertexv0 for allv∈I action layerAi+1 contains theaction vertexai+1 for actiona ifVi contains the vertexvi for allv∈pre(a)
variable layerVi+1 contains the variable vertexvi+1 if previous variable layer containsvi,
or previous action layer containsai+1 withv ∈add(a) German: relaxierter Planungsgraph, Variablenknoten, Aktionsknoten
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Relaxed Planning Graphs (Continued)
goal verticesGi ifvi ∈Vi for all v ∈G
graph can be constructed for arbitrary many layers but stabilizes after a bounded number of layers
Vi+1=Vi andAi+1=Ai (Why?) directed edges:
fromvi toai+1 ifv∈pre(a) (precondition edges) fromai tovi if v∈add(a) (effect edges)
fromvi toGi ifv ∈G (goal edges) fromvi tovi+1 (no-op edges)
German: Zielknoten, Vorbedingungskanten, Effektkanten, Zielkanten, No-Op-Kanten
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example
We will write actionsa with pre(a) ={p1, . . . ,pk}, add(a) ={a1, . . . ,al},del(a) =∅andcost(a) =c asp1, . . . ,pk −→c a1, . . . ,al
V ={a,b,c,d,e,f,g,h}
I ={a}
G ={c,d,e,f,g}
A={a1,a2,a3,a4,a5,a6} a1 =a−→3 b,c
a2 =a,c −→1 d a3 =b,c −→1 e a4 =b −→1 f a5 =d −→1 e,f a6 =d −→1 g
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
a2 b2 c2 d2 e2 f2 g2 h2
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
a2 b2 c2 d2 e2 f2 g2 h2
a1 a2 a3
a4
a5
a6
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
a2 b2 c2 d2 e2 f2 g2 h2
a1 a2 a3
a4
a5
a6
a3 b3 c3 d3 e3 f3 g3 h3
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
a2 b2 c2 d2 e2 f2 g2 h2
a1 a2 a3
a4
a5
a6
a3 b3 c3 d3 e3 f3 g3 h3 c3 d3 e3 f3 g3
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: Relaxed Planning Graph
a0 b0 c0 d0 e0 f0 g0 h0
a1
a1 b1 c1 d1 e1 f1 g1 h1
a1 a2 a3
a4
a2 b2 c2 d2 e2 f2 g2 h2
a1 a2 a3
a4
a5
a6
a3 b3 c3 d3 e3 f3 g3 h3
G
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Generic Relaxed Planning Graph Heuristic
Heuristic Values from Relaxed Planning Graph functiongeneric-rpg-heuristic(hV,I,G,Ai,s):
Π+:=hV,s,G,A+i for k ∈ {0,1,2, . . .}:
rpg:=RPGk(Π+) [relaxed planning graph to layer k]
if rpg contains a goal node:
Annotate nodes ofrpg.
if termination criterion is true:
returnheuristic value from annotations else if graph has stabilized:
return∞
general templatefor RPG heuristics
to obtain concrete heuristic: instantiate highlighted elements
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Concrete Examples for Generic RPG Heuristic
Many planning heuristics fit this general template.
In this course:
maximum heuristic hmax (Bonet & Geffner, 1999) additive heuristic hadd (Bonet, Loerincs & Geffner, 1997) Keyder & Geffner’s (2008) variant of the FF heuristic hFF (Hoffmann & Nebel, 2001)
German: Maximum-Heuristik, additive Heuristik, FF-Heuristik remark:
The most efficient implementations of these heuristics do not use explicit planning graphs,
but rather alternative (equivalent) definitions.
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Maximum and Additive Heuristics
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Maximum and Additive Heuristics
hmax andhadd are the simplest RPG heuristics.
Vertex annotations arenumerical values.
The vertex values estimate the costs to make a given variable true to reach and apply a given action to reach the goal
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Maximum and Additive Heuristics: Filled-in Template
hmax andhadd
computation of annotations:
costs of variable vertices:
0 in layer 0;
otherwise minimumof the costs of predecessor vertices costs of action and goal vertices:
maximum(hmax) or sum(hadd) of predecessor vertex costs;
for action vertices ai, also addcost(a) termination criterion:
stability: terminate ifVi =Vi−1 and costs of all vertices in Vi equal corresponding vertex costs in Vi−1
heuristic value:
value of goal vertex in the last layer
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Maximum and Additive Heuristics: Intuition
intuition:
variable vertices:
choosecheapestway of reaching the variable action/goal vertices:
hmax isoptimistic: assumption:
when reaching themost expensiveprecondition variable, we can reach the other precondition variables in parallel (hence maximization of costs)
hadd ispessimistic: assumption:
all precondition variables must be reached completely independently of each other (hence summation of costs)
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 4 4
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 4 4
0 3 3 4 4 4
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 4 4
0 3 3 4 4 4
3 4 4 4 5 5
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 4 4
0 3 3 4 4 4
3 4 4 4 5 5
0 3 3 4 4 4 5
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
maxa0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 4 4
0 3 3 4 4 4
3 4 4 4 5 5
0 3 3 4 4 4 5
5
hmax({a}) = 5
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 7 4
hadd({a}) = 21
Relaxed Planning Graphs Maximum and Additive Heuristics FF Heuristic Summary
Illustrative Example: h
adda0 b0 c0 d0 e0 f0 g0 h0
a1 +3 a1 b1 c1 d1 e1 f1 g1 h1
a1 +3 a2 +1 a3 +1 a4 +1
a2 b2 c2 d2 e2 f2 g2 h2
a1 +3 a2 +1 a3 +1 a4 +1 a5 +1 a6 +1
a3 b3 c3 d3 e3 f3 g3 h3
G 0
3
0 3 3
3 4 7 4
0 3 3 4 7 4
hadd({a}) = 21