0% found this document useful (0 votes)
24 views53 pages

Planning in AI

Uploaded by

Arul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views53 pages

Planning in AI

Uploaded by

Arul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

.

R
els
ng
E
Artificial
ls. RIntelligence
R
ge s.
UnitE 4-1 Planning
n
E ngel

. R
els . R
ng
2020-2021 Odd BE CSE VII ls
semester
e
E ng
E
. R Engels. R
els . R
ng els
E ng
E
. R
els . R
ng els
E ng
E 1
Unit 4 – Planning

• Planning and Learning: s. R


el
– Planning with State Space Search:Eng
• Partial Order Planning R
ls.
• Planning Graphs ge . R
E n els
• Examples ng
R E
• Blended/Self learning
ls.
ge . R
E n
– Forms of Learning els
ng
R Learning E
• .
Inductive
ls
ge . R

En
Explanation Based Learning
els
• Statistical Learning ng
R E
ls. • Learning With Complete Data
e
g . R
E n els
g
En 2
Background

• Focus . R
els
– The focus here is deterministic planning n g
E
• Environment is fully observable
. R
• Results of actions is deterministic ls
ge . R
– Relaxing the above requiresEndealing with uncertainty els
ng
R contingency, exploration
• Problem types: sensor-less, E
ls.
• Planning ‘communities’ ge in AI . R
E n els
– Logic-based: Reasoning About Actions & Change ng
R E
s. representations: Classical AI Planning
– Less formal
l
ge . R
En
– Uncertainty (UAI): Graphical Modelsesuch ls as
ng
R E
• Markov Decision Processes (MDP), Partially Observable MDPs, etc.
ls.
g e . R
En els
ng
E 3
Actions, events, and change
. R
l
• Planning requires a representation of time
e s
ng
– E
to express & reason about sequences of actions
. Rthe world
– to express the effects of actions son
l
ge . R
• Propositional Logic E n els
ng
– does not offer a representation
R for time E
.
ls needs to be repeated for eachR step
ge
– Each action description .
E n els
• Situation Calculus ng
R E
. FOL
– Is basedlson
g e . R
– EachEntime step is a ‘situation’ els
ng
E about actions & change
–R Allows to represent plans and reason
ls.
g e . R
En els
ng
E 4
‘Famous’ Problems
• Frame problem . R
els
– Representing all things that stay the same n g from one situation to the next
E
– Inferential and representational R
ls.
– What happens to a gold bar placed ge on a slide? . R
E n els
• Qualification problem ng
R E
s.
– Defining the circumstances
l under which an action is guaranteed to work
ge . R
– Example: what Eifnthe gold is slippery or nailed down, els etc.
ng
• Ramification R problem E
ls.
ge
– Proliferation of implicit consequences of. Ractions as actions may have secondary
E n els
consequences ng
R E
ls.– Examples: How about the dust on the gold?
g e . R
En els
ng
E 5
Planning Languages
. R
els
• Languages must represent.. Eng
– States . R
els R
– Goals ng ls.
E ge
E n
– Actions . R
els R
ng ls.
• Languages must
E be ge
E n
– Expressive
. R for ease of representation
els R
g s.
En
– Flexible for manipulation by l
ng algorithms
e
R E
ls.
e R
E ng els.
ng
E 6
State Representation
. R
• A state is represented with a conjunction e s
l of positive literals
n g
– fluents that are ground, functionless Eatoms
.R
– a fluent is a condition that canlschange over time
ge . R
• Using En els
ng
– Logical Propositions:. RPoor  Unknown E
els R
g
– FOL literals: At(Plane1,SFO)  At(Plane2,JFK) ls.
En ge
• FOL literalsRmust be ground & function-free E n
ls.
ge
– Not allowed: R
At(x,y) [non-ground]or sAt(Father(Fred),Sydney)[Function],
.
E n el
poor (negation, false fluent) ng
R E
.
•elsClosed World Assumption R
ng ls.
E – What are not stated aregeassumed false
En
Action Representation
. R
els
• A set of ground (variable-free) actions
ng can be represented by a
E
single action schema R
ls.
– The schema is a lifted representation
ge . R
E n els
– it lifts the level of reasoning from propositional logic ng to a restricted
R E
subset of first-order
ls. logic
ge . R
En els
ng
R E
ls.
ge . R
En els
ng
R E
ls.
ge . R
En els
ng
E
Action Representation
. R
els
• Action Schema ng At(AI,CJB),Plane(AI),
E Airport(CJB), Airport(MAA)
– Action name
. R
– Preconditions
els Fly(AI,CJB,MAA) R
– Effects ng ls.
E g e
• Example E n
At(AI,MAA),  At(AI,CJB)
. R
Action(Fly(p,from,to),els R
ng ls.
E e
PRECOND: At(p,from)  Plane(p)  Airport(from) gAirport(to)
E n
R
EFFECT:s.At(p,from)  At(p,to))
l
e Effects are split into ADD list and R DELETE list
• Sometimes, g ls.
En ge
RESULT(s, a) = [s − DEL(a)] ∪ n
ADD(a)
E
. R
els s- state, a-action, s’-new state R
g s.
En DEL(a) – actions available el
g at s, ADD(a) – actions available at s’
E n
Applying an Action

• Find a substitution list  for the variables. R


els
– of all the precondition literals n g
E
– with (a subset of) the literals in the current state description
. R
• Apply the substitution to theepropositions ls in the effect list R
n g ls.
• Add the result to the current E state description to generate ge the new
E n
state . R
els R
g ls.
• Example: En ge
– Current state: At(P1,JFK)  At(P2,SFO)  Plane(P1)n
E  Plane(P2)  Airport(JFK) 
. R
ls
Airport(SFO)
e R
g ls .
En
– It satisfies e
the precondition with ={p/P1,from/JFK,
g to/SFO)
E n
.–R Thus the action Fly(P1,JFK,SFO) is applicable
els – R
ng The new current state is: .
At(P1,SFO)
ls  At(P2,SFO)  Plane(P1)  Plane(P2) 
E Airport(JFK)  Airport(SFO) g e
En
Goal & Action Representation
. R
s
• Goal is a partially specified state ngel
E
• A proposition satisfies a goalR if it contains all the atoms of the
ls.
goal and possibly others..ge . R
n E ls e
– Example: Rich  Famous  Miserable satisfies the goal g
n Rich  Famous
R E
ls.
g e . R
En els
ng
R E
ls.
ge . R
En els
ng
R E
ls.
ge . R
En els
ng
E
Languages for Planning Problems
. R
• STRIPS els
n g
E
– Stanford Research Institute Problem Solver
. R
– Historically important els R
n g ls.
• ADL E ge
E n
R
. Languages
– Action Description els R
ng ls.
• PDDL E ge
E n
R
. Domain Definition Language
– Planning
els R
ng ls .
E
– Describes the four things we need e
g to define a search problem:
E n
R
.– the initial state, the actions that are available in a state, the result of
els R
g s .
En applying an action, and
gel the goal test
E n
Example: Air Cargo
. R
• Initial state, Goal State
els
• Actions: Load, Unload, Fly ng
E
. R
els R
ng sA. PDDL description of
l an air cargo
E ge
n
E transportation
. R
els R planning problem:
ng ls. Loading and unloading
E e
E ng cargo and
. R flying it from place to
els R place
E ng els.
ng
R E
ls.
ge . R
E n els
ng Solution? Start with [Load(C1, P1, SFO)….]
E
Example: Air Cargo
. R
els
ng A PDDL description of
E an air cargo
transportation
. R planning problem:
els R and unloading
ng .
Loading
lscargo and
E e
g flying it from place to
E n
. R
els R
place

ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
Example: Spare Tire Problem
A PDDL description of

. R changing a flat tire

els problem:

ng Goal is to have a good


E spare tire properly
mounted onto the car’s
. R axle,
els R where the initial state has
ng ls. (a) a flat tire on the axle
E ge and (b) a good spare tire
E n
. R in the trunk

els R
ng ls. Four actions:
E ge 1. Removing spare from
E n trunk,
. R 2. Removing flat tire
els R from axle,
ng ls. 3. Putting spare on axle,
E ge and
E n
. R 4. Leaving car

els R
unattended overnight

ng ls. (which will result in


E ge both spare and flat
Solution?
E n tires stolen)
Example: Spare Tire
. R Problem
els
ng
E
A PDDL description of
. R
els R
changing a flat tire

E ng els. problem:

ng Goal is to have a good


R E spare tire properly
ls. mounted onto the car’s
ge . R
E n els axle,

ng where the initial state


R E has (a) a flat tire on the
ls. axle and (b) a good
ge . R
E n els spare tire in the trunk

ng
R
Solution E
ls.
ge . R
E n els
ng
E
Example: Blocks World
. R
• Initial state, Goal
els
• Actions: n g
E
• Move(b,x,y) (b-block, x-from, y – to) R
ls.
• MoveToTable(b,x) ge . R
En pre-condition and effects els
• Describe init, goal and actions(with
ng
R E
• Then give the solutionsplan
l .
g e . R
En els
ng
R E
ls.
g e of the blocks-world problem: . R
ls
A PDDL description
Goal is to E n one or more stacks of blocks, e
build
ng
R E
ls.can fit directly on top of another, or kept on the table
where the blocks can be stacked, but only one block

g e . R
En el s initial state goal state
g
En
Example: Blocks. RWorld
els
• Initial state, Goal n g
E
• Actions: Move(b,x,y), MoveToTable(b,x)
. R
els R A PDDL description of the
n g ls. blocks-world problem:
E e
E ng Goal is to build one or

. R more stacks of blocks,

els R
g ls. where the blocks can be
En ge stacked, but only one
E n block can fit directly on
. R top of another, or kept on
els R the table
g ls .
En ge
E n
. R
e ls R
g s .
En gel Solution?
E n
Example: Blocks. RWorld
els
• Initial state, Goal n g
E A PDDL description of the
• Actions: Move(b,x,y), MoveToTable(b,x)
. R blocks-world problem:

els Goal is to build one or


R stacks of blocks,
g s .
more
En el
g where the blocks can be
n
E stacked, but only one
. R
els R block can fit directly on
g ls.
En ge top of another, or kept on

E n the table

. R
e ls R
g ls. Notice how the solution plan finding
En ge becomes extremely straight forward

E n with the appropriate representation


. R
ls
e One solution is the sequence: R
g s.
En [MoveToTable (C,A), Move(B, Table, C),geMove(A,
l Table,B)]
En
State-Space Search
• We want to see if the planning process can . R be solved using Search
els
Algorithms n g
E
– Problem must be formulated suitableRfor search
ls.
– Define initial, goal, transition model,
ge state space tree and search strategy . R
E n els
• Search the space of states (first chapters) ng
R E
– Initial state, goal test,ls. step cost, etc.
ge . R
– Actions are theEntransitions between state els
ng
• Actions are R
invertible (why?) E
ls.
– Move ge
forward from the initial state: . R
Forward State-Space Search or
E n e ls
Progression Planning ng
R E
.
ls – Move backward from goal state: Backward State-Space Search or Regression
g e . R
E n Planning els
g
En
Forward and Backward State Space Search
. R
els Two approaches to
ng searching for a plan.
E (a) Forward (progression)

. R search, through the space

els of states, starting in the


R
ng ls. initial state and using the
E ge problem’s actions to
E n search forward for a
. R member of the set of goal
els R states
ng ls.
E ge (b) Backward (regression)
E n
. R search through sets of

els R
relevant states, starting at

ng ls. the set of states


E ge representing the goal and
E n using the inverse of the
. R actions to search backward
els R for the initial state
ng ls.
E ge
E n
State-Space Search (3)
.
• Remember that the language has no functions R symbols
els
ng
• Thus number of states is finite E
• And we can use any complete . Rsearch algorithm (e.g., A*)
els g R .
– [Completeness – does the els if one exists]
Enalgorithm always find a solution
ng
– We need an admissible R heuristic E
ls.
. R
– The solution is nagepath, a sequence of actions: total-order planning
E e ls
g
• Problem: SpaceR and time complexity En
ls.
e
– onlyngpositive preconditions andls. R
E ge
–R only one literal effect En
ls.
g•e With the above identified . R we can use any appropriate search
En els
ng
algorithm for planning.
E
STRIPS & State-Space
. R Search
els
g and
• STRIPS : Easy to focus on ‘relevant’ propositions
n
– Work backward from goal (using Effects)E
. R
– Work forward from initial state (using PRECONDITIONS)
els R
– Facilitating bidirectional search g s.
En gel
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
Relevant and Consistent Actions
. R
els
• An action is relevant n g
E
– In Progression planning whenR its preconditions match a subset of
ls.
the current state ge . R
En els
– In Regression planning, when its effects match a subset ng of the
R E
ls
current goal state .
ge . R
n
• The purpose of Eapplying an action is to ‘achieves els a desired literal’
ng
R E
. careful that the action does not undo a desired literal as a
– Shouldlsbe
ge . R
side
Eneffect els
ng
• A. Rconsistent action is an action that E does not undo a desired literal
els R
g s.
En ge l
E n
Backward State-Space Search
. R
• Given els
ng
E
– A goal G description
. R
– An action A that is relevantelsand consistent R
n g ls.
• Generate a predecessor state where E ge
E n
. R
ls
– Positive effects (literals)
e of A in G are deleted R
ng ls.
– PreconditionEliterals of A are added unless ngethey already appear
E
R any variables in A’s effects to match literals in G
ls.
– Substituting
g e . R
En
– Substituting els
any variables in A’sgpreconditions to match substitutions
E n
. R in A’s effects
els R
g .
En • Repeat until predecessor gel description matches initial state
s
E n
Heuristic to Speed up Search
. R
• We can use A*, but we need an admissible e s
l heuristic
n g
– Must not overestimate cost from current s toEgoal g
– Such as the straight line distance (hSLD) we
. R used earlier )
els R
• Such an admissible heuristicngcan be derived with ls.
E e
g heuristic for the
– by defining a relaxed problem whose solution can be used as admissible
E n
. R
given problem
els R
g ls.
• Think of a search Enproblem as a graph ge
– where the nodes are states and the edges are actionsEn
. R
• The problem e s
l is to find a path connecting theRinitial state to a goal state
n g ls.
• ThereEare two ways we can relax this problem ge to make it easier:
n
E it strictly easier to find a path, or
–. R by adding more edges to the graph, making
els– by grouping multiple nodes together, R forming an abstraction of the state space that has
g s .
En ge
fewer states, and thus is easierl to search
E n
26
Heuristic to Speed up Search
. R
Approach els
ng
E
1. Divide-and-conquer: sub-goalR independence assumption
ls.
e
– Problem relaxation isngdone .R
through one of thelsfollowing
E ge
– By removing R En
ls.
e
2. … all preconditions
g . R
En els
ng
3. … all preconditions
. R and negative effects
E
els R
g .
4. …Ennegative effects only: Empty-Delete-List
els
g
E n
. R
els R
ng ls.
E ge
E n
27
1. Subgoal Independence Assumption
. R
ls
• A key idea in defining heuristics is decomposition:
e
ng
E
The cost of solving a conjunction of subgoals is the sum of the
. R
costs of solving each subgoal
els independently R
g s.
• Optimistic En el
ng E
– Assume that there R
.are no subplans that interact negatively when put-
els R
g ls.
together En ge
n
E achieved by an action in
– Example:Rone action in a subplan delete goal
ls.
e subplan
another
g . R
En els
• Pessimistic (not admissible) Eng
. R
els – Redundant actions in subplansR can be replaced by a single action in
g s.
En merged plan gel
E n
28
2. Problem Relaxation: Removing Preconditions
. R
els
g
• Remove preconditions from action descriptions
n
E
– All actions are applicable
R
ls.in every state, and
• Every action becomes applicable
e R
ng
– Every literal in the goal is Eachievable ls.
in one step ge
• Any single goal fluentRcan be achieved in one step E n
ls.
ge
• if there is an applicable R
action—if not, the problem is .impossible
E n els
• Number of steps to achieve the conjunction of literals ng in the goal is equal to the
R E
.
number oflsunsatisfied literals
ge . R
• Alert En e ls
ng (1)
E
– Some actions may achieve several literals
R
ls.– Some action may remove the effect of another action (2)
ge . R
En – For many problems an accurate e s
l heuristic is obtained by considering (1) and ignoring (2)
ng
E 29
3. Remove Preconditions & Negative Effects
. R
• Considers only positive interactions among e s
l actions to achieve multiple
n g
subgoals E
. R
• The minimum number of actions els required is R
g s.
En positive effects that satisfy the
– Sum of the union of the actions’ gel goal
E n
. R
e ls R
g ls.
En ge
E n
. R
e ls R
g ls .
En ge
E n
. R
els R
g s.
En gel
E n
30
4. Removing Negative Effects (Only)
. R
els
n g
E
• Remove all negative effects of actions (no action may destroy the effects
of another) . R
els R
g s.
• Known as the Empty-Delete-List En heuristic gel
E n
• Requires running a simple
. R planning algorithm
els R
g ls.
• Quick & effectiveEn ge
• Usable in progression E n
. R or regression planning
els R
g ls .
En ge
E n
. R
els R
g s.
En ge l
E n
31
. R
els
ng
E
. R
els
ng
E
. R
els
ng
E
. R
PARTIAL
ngel ORDERING
s GRAPHS – PLANNING
E
GRAPHS
R
ls.
ge
En
32
Regression
. R
els
• Regressing a goal, G, thru anng action, A
E
• Yields the weakest precondition
R G’
. ls
– Such that: if G’ is true ge before A is executed . R
En els
– G is guaranteed to be true afterwards ng
R E
ls.
g e . R
En els
g

precond
E n
G’ A G

effect
. R
e ls R
ng ls .
E
Represents a set of world g e
E n Represents a set of world
. R states states
els R
g s.
En gel
E n
© Daniel S. Weld 33
Planning Graphs
. R
s
• All of the heuristics can suffer from einaccuracies
l
ng
E
• A special data structure called a Planning Graph can be
. R
– used to give better heuristicelsestimates R
g s.
– applied to any of the search En techniques or another algorithmgel
E n
GRAPHPLAN . R
els R
• A planning problem g .
asks if we can reach eals goal state from the
En g
initial state E n
. R
ls
• A treeEnof ge all possible actions from . R
ls initial state to successor states,
ge
and their successors, and so on n
E to answer
. R
ls
e – Can we reach state G from Rstate S0
g s.
En el
g size and hence impractical
n
– This tree is of exponential
E 34
Planning Graphs
. R
• A planning graph = polynomial size e s
lapproximation to the
ng
exhaustively indexed tree E
– can be constructed quicklyels. R R
g s.
– May not answer definitively En whether G is reachable gfromel S0, but can
E n
estimate the number . R of steps
els R
g .
• The estimate is En always correct when it greports els the goal is not
E n
reachable ls. R
ge . R
• And it Ennever overestimates the e s
lnumber of steps
ng
E
. R it is an admissible heuristic
• lsSo
g e . R
En els
ng
E 35
Planning Graphs - 2
. R
• Planning graph is a directed graphgeorganized ls into levels
E n
– First a level S0 for the initial state, consisting of nodes representing
each fluent (a condition that . R change over time) that holds in S
can
els R 0
n g ls.
– then a level A0, consisting E of nodes for each ground gaction e that might
E n
be applicable in Sls0. R
ge . R
– then alternatingEn levels Si followed by Ai gels
E n
– until we . R
reach a termination condition
els R
g .
• PlanningEn graphs work only forgpropositional els planning problems
E n
.–R The problems with no variables
els R
g s.
En gel
E n
36
Planning Graphs - 3
. R
• Roughly
els
– ng I
Si contains all the literals that could hold atEtime
R
• depending on the actions executed at preceding
.
time steps
ls R in Si
– If it is possible that either P or ¬Pgecould hold, then both will be represented
n ls.
E
– Ai contains all the actions that could have their preconditions satisfied e
g at time I
E n
• Why roughly? . R
els R
g ls.
En only a restricted subset of thegepossible
– Planning graph records negative interactions
among actions; E n
. R
– therefore,
e s
l a literal might show up at level Sj when
R actually it could not be true until a
g if at all
laterEnlevel, ls.
ge
– It is guaranteed thought that A literalEwilln never show up too late
. R
•elsDespite the possible error, the Rlevel j at which a literal first appears is a good
ng ls.
E estimate of how difficult itgeis to achieve the literal from the initial state
En 37
Planning Graphs – Example problem
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
38
Planning Graphs – Example
. R
• The planning graph for the “have cake and eat cake too” problem
e ls
• Up to level S2 ng
• Rectangles indicate actions E
• small squares indicate persistence actions R
l
• Straight lines indicate preconditions and effectss.
g e . R
• Mutex links are shown as curved gray lines
E n els
• (not all mutex links are shown)
ng
R the persistence actions for those literals
• If two literals are mutex at Si, then E
ls .
will be mutex at Ai e
g link . R
• need not draw thatnmutex
E e ls
g
R En
ls.
ge . R
E n els
ng
R E
ls.
ge . R
E n els
ng
E 39
Planning Graphs – Example
R. its effects at
ls
• Each action at level Ai is connected to its preconditions at Si and
e
Si+1 n g
• So a literal appears because an action caused it AND a E literal can persist if no
action negates it
• Known as persistence action or no-op ls.
R
ge . R
• For every literal C, add to the problem anpersistence
E
action with precondition C
els
and effect C
ng
R
• Level A0 in figure shows one “real” action, Eat (Cake) E
ls. actions drawn as small square boxes
e
• along with two persistence
g . R
E n els
g
R En
ls.
ge . R
E n els
ng
R E
ls.
ge . R
E n els
ng
E 40
Planning Graphs – Example

R
Level A0 contains all the actions that could occur in state S0 ls.
ge from occurring together


Also records conflicts between actions that would prevent
E n them
Grey links indicate mutual exclusion (or mutex) links
• For example, Eat (Cake) is mutually exclusive withRthe persistence of either Have(Cake) or ¬ Eaten(Cake)
• Also Have(Cake) and Eaten(Cake) are mutex ls .
g estates . R
• n
S1 represents a belief state: a set of possible
E els

n
Continue alternating between state level Si and action level Ai until two consecutiveglevels are identical
• Graph has leveled off R E
ls. choosing among actions

e
Planning graph does not require
g . R
E n
• which would entail combinatorial search
els
• ng
It just records the impossibility of certain choices using mutex links
E
. R
els R
E ng els.
ng
R E
ls.
ge . R
E n els
ng
E 41
Mutex Relation
. R if any of the following three
e ls
• Mutex relation holds between two actions at a given level
conditions holds: ng
• Inconsistent effects:
E
– One action negates an effect of the other . R
e ls have inconsistent effects because theyRdisagree on the
ng
– Ex: Eat (Cake) and the persistence of Have(Cake)
ls.
effect Have(Cake) E ge
• Interference: R En
.
ls is the negation of a precondition of the other
e
– one of the effects of one action
g . R
En with the persistence of Have(Cake) by negating
– Ex: Eat (Cake) interferes e ls its precondition
n g
• Competing needs:
R E
s .
– One of the lpreconditions of one action is mutually exclusive with a precondition of the other
ge . R
En
– Ex: Bake(Cake) and Eat (Cake) are mutex because they
els compete on the value of the Have(Cake) precondition
• Inconsistent support ng
R E
ls.– A mutex relation holds between two literals at the same level if one is the negation of the other
g . R achieve the two literals is mutually exclusive
e – or if each possible pair of actions that could
En els
ng
E 42
Planning Graph complexity
. R
e ls
ngthe planning problem
• A planning graph is polynomial in the size Eof
• For a planning problem with l literalsRand a actions
.
elsl2 mutex links, and
– each Si has no more than l nodes and
g . R
En (including the no-ops), (a + l)2 mutex
– each Ai has no more than a + l nodes e s
llinks, and
ng
R
2(al + l) precondition and effect links E
ls.
• Thus, an entire graph gewith n levels has a size of O(n(a +. R
l) 2
)
E n els
• The time to build the graph has the same complexity ng
R E
ls.
g e . R
En e ls
ng
R E
ls.
ge . R
En els
ng
E 43
The GRAPHPLAN algorithm
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
e ls R
g .
algorithm repeatedly adds a level toelasplanning graph with EXPAND-GRAPH
En
• The GRAPHPLAN
g GRAPHPLAN calls EXTRACT-SOLUTION to search for a
• Once all the goals show up as nonmutex in the graph,E n
R
. that solves the problem
lsplan
R again, terminating with failure when there is no reason to go on
e• If that fails, it expands another level and tries
g s.
En g el
E n
44
Planning Graphs – Spare tire example
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
45
Planning Graphs – Spare tire example
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
46
Planning Graphs – Spare tire example
. R
• GRAPHPLAN initializes the planning graph to a one-level e s
l (S0) graph representing the initial state
n g the problem description’s initial state are
E
– The positive fluents and the relevant negative fluents from
shown
. R (such as Tire(Spare)) and the irrelevant negative literals
ls
– Not shown are the unchanging positive literals
e R
ng in S0, so we need not call EXTRACT-SOLUTION
• The goal At(Spare, Axle) is not present ls.
E ge
– There is no solution yet
R En
.
• EXPAND-GRAPH adds into Als0 the three actions whose preconditions exist at S 0
ge . R
n
– all the actions exceptEPutOn(Spare, Axle) els
ng
– along with persistence actions for all the literals in S
R 0 E
• The effects of ls . actions are added at level S
the
ge 1
. R
En
• EXPAND-GRAPH then looks for mutex relations els adds them to the graph
and
n g
R
• At(Spare, Axle) is still not present in S E
ls . 1

ge – so again EXTRACT-SOLUTION is not called . R


En• EXPAND-GRAPH is called again, gadding s
el A1 and S2 resulting in the planning graph shown
En 47
Planning Graphs – Spare tire example – Mutex examples
. R
• Inconsistent effects: els
ng
E
– Remove(Spare, Trunk ) is mutex with LeaveOvernight because one has the effect At(Spare,
Ground) and the other has its negation
. R
• Interference: els R
– Remove(Flat, Axle) is mutex withEn
g ls.
ge
LeaveOvernight because one has the precondition At(Flat,
Axle) and the other has its negation as an effect. E n
. R
• Competing needs: els R
g .
ls one has At(Flat, Axle) as a
– PutOn(Spare, Axle)En is mutex with Remove(Flat, Axle) because e
ng
precondition and the other has its negation
R E
• Inconsistent ls.
support:
ge . R
En Axle) is mutex with At(Flat, Axle) gineSls2
– At(Spare,
– Rbecause the only way of achieving At(Spare,En Axle) is by PutOn(Spare, Axle)
ls.
ge – and that is mutex with the persistence
. R action that is the only way of achieving At(Flat, Axle)
En• Thus, the mutex relations detect e ls
ng the immediate conflict
E two objects in the same place at the same time
– that arises from trying to put 48
Planning Graphs – Spare tire example
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
ng ls.
E ge
E n
. R
e ls R
g .
En from the goal are present in S , and nonegeoflsthem is mutex with any other
• All the literals 2

E
• Hence a solution might exist, and EXTRACT-SOLUTIONn will try to find it
• Can. Rformulate EXTRACT-SOLUTION as a Boolean constraint satisfaction problem (CSP)
ls as a as a backward search problem, whereR
•geOr
n ls. to a level in the planning graph and a set of unsatisfied goals
E • each state in the search contains a
g e
pointer
En 49
Planning Graphs – Spare tire example
. R
els
ng
E
. R
els R
ng ls.
E ge
E n
. R
els R
• Start at S ng
with the goalEAt(Spare, Axle) els.
• The only choice for achieving the goal set is PutOn(Spare, Axle) Eng
2

s
• Can only take to. aRsearch state at S with goals At(Spare, Ground) and ¬ At(Flat, Axle)
e l Ground) can be achieved only by Remove(Spare,
1
R Trunk ), and
g
• At(Spare, .
• ¬ At(Flat, els
En Axle) can be achieved only by eithergRemove(Flat , Axle) or LeaveOvernight
E n
• But LeaveOvernight is mutex with Remove(Spare, Trunk )
R
. • So the only solution is to choose Remove(Spare, Trunk ) and Remove(Flat, Axle)
ls R At(Spare, Trunk ) and At(Flat, Axle)
e• Brings us to a search state at S with the goals
g s.
En • Both of these are present in the state, e lso we have a solution
0

ng
• The actions Remove(Spare, TrunkE ) and Remove(Flat, Axle) in level A , followed by PutOn(Spare, Axle) in A
0 1 50
Planning Graphs – Summary
. R
• Planning is a search problem els
n g
E
– Possible to apply search heuristics to improve the process
. R
• One approach is to construct els a “graph” of the searchR space
n g ls.
– and use this to guide searchE ge
E n
. R
ls
• This leads to thegeconcept of a planning graph R
ls.
En ge
E n
. R
els R
g ls .
En ge
E n
. R
els R
g s .
En gel
E n
51
Unit 4 – Planning - Summary

• Planning and Learning: s. R


el
– Planning with State Space Search:Eng
• Partial Order Planning R
ls.
• Planning Graphs ge . R
E n els
• Examples ng
R E
• Blended/Self learning
ls.
ge . R
E n
– Forms of Learning els
ng
R Learning E
• .
Inductive
ls
ge . R

En
Explanation Based Learning
els
• Statistical Learning ng
R E
ls. • Learning With Complete Data
e
g . R
E n els
g
En 52
References
. R
els
• AI n g
E
– Artificial Intelligence – ElaineR Rich, Kevin Knight, B. Nair 3rd Edition
ls.
• AIMA ge . R
En els
ng
– Artificial IntelligenceR - A Modern Approach 3rd Edition E - RUSSELL &
ls.
NORVIG ge . R
En els
ng
R E
ls.
ge . R
En els
ng
R E
ls.
ge . R
En e ls
ng
E 53

You might also like