Constraint Based Reasoning
over Mutex Relations in
Graphplan Algorithm
Pavel Surynek
Charles University, Prague
Czech Republic
Outline of the presentation






Brief introduction to AI planning
World states reachability analysis
(Planning graphs and Graphplan)
Graphplan and constraints
Singleton arc-consistency in Graphplan
Revised algorithm for state reachability
Conclusions
CSCLP 2006
Pavel Surynek
AI Planning Problem

a set of actions of the form
(name; preconditions; effects)
example: action that moves robot from A to B
(move-robot-AB; prec={at(robot, A)};
effects={at(robot, B), at(robot,A})


an initial world state is a set of atoms
example: {at(robot_1,A); at(robot_2,C), ...}

a goal is a set of literals
example: {at(robot_1,B); at(robot_2,C), ...}
CSCLP 2006
Pavel Surynek
Solving of the planning problem

solution = sequence of actions transforming
the initial state into a state satisfying the goal
example: <move-robot_1-AB, move-robot_2-CB, ...>

forward/backward search algorithms


evolve the initial/goal world state using actions
systematically try alternative actions (backtracking)

real life problem  high branching factor
Extremely large search space !

techniques for search space reductions

CSCLP 2006
state reachability analysis using planning graphs
Pavel Surynek
State reachability: planning tree
Action applicable to
initial state
Initial world state
Resulting state after
application of the action
s0
s11
a1i
a12
a11
s12
...
a21
s1i
a2j
...
...
...
...
...
...
...
s21
States
reachable by
one step
s2j
Search tree
States
reachable by
two steps
 expand the tree until a goal state satisfying goal is reached
Unmanageable size  cannot be stored in memory
CSCLP 2006
Pavel Surynek
State reachability: planning graph
Initial proposition layer = set of atoms in the initial state
Action layer = a set of
actions applicable to previous
proposition layer
s0
a12  . . .  a1i
a11 
s11
a21
s21

s12
...
 ... 
s1i
 . . .  a2j

...

s2j
Proposition layer = set
of all the positive effects
of actions in the previous
action layer
...
...
...


build an approximation of the search tree

CSCLP 2006
lot of information is lost (several sets are
represented by their union)
Pavel Surynek
State reachability: planning graph
Preconditions of
a given action
Initial proposition layer = set of atoms in the initial state
Action layer = a set of
actions applicable to previous
proposition layer
p01 p02 ... p0l
a11
p11
a21
p21
a12
... a1i
p12
...
a22
p22
p1i
...
...
a2j
p1j
...

this structure fits into memory


CSCLP 2006
Proposition layer = set
of all the positive effects
of actions in the previous
action layer
What actions produces a
given proposition (atom)
every proposition knows its origin in the previous action layer
every action knows its precondition in the previous proposition layer
Pavel Surynek
State reachability: mutex relations

associate a set of mutexes with each layer



forbids pairs of actions or atoms to be used at the
same time (action is not applicable over mutex)
make the planning graph more accurate
two types of mutexes: action and propositional

a pair of actions {a1,a2} is mutex (action mutex) iff



a pair of atoms {p1,p2} is mutex (propositional) iff

CSCLP 2006
a1 and a2 are dependent = a1 destroys preconditions or
positive effects of a2 or vice versa or
preconditions of a1 and a2 are mutex in the previous layer
every pair of actions producing p1 and p2 are mutex in the
previous proposition layer
Pavel Surynek
Graphplan and constraints

Graphplan algorithm works in two alternating
phases



expands (add layers) the planning graph until the
last proposition layer satisfies the goal condition
tries to extract a valid plan (backtracking) from the
planning graph, if unsuccessful continues with the
former phase (planning graph is expanded again)
Planning graph can be modeled using
constraints

CSCLP 2006
consistency techniques  more accurate
approximation of the state reachability
Pavel Surynek
State variable representation

instead of saying that something is true or false
say:
a certain property takes a certain value
example: location(robot)=A


change actions and goals according to the
above scheme:
example of an action with state variables:
(move-robot-AB; prec={location(robot)=A)};
effects={location(robot)=B})
example of a goal with state variables:
{location(robot_1)=B; location(robot_2)≠C}
CSCLP 2006
Pavel Surynek
Constraint model for plan-graph


construct the model layer by layer
introduce a variable for every property and its
value


the domain contains all the actions that has
assignment property=value as its positive effect
example: a(location(robot)=B){move-robot-AB,
move-robot-CB,...}
forbid every pair of assignments that are
mutex

CSCLP 2006
mark them as incompatible within a binary constraint
between corresponding variables
Pavel Surynek
Consistency in the model
a(X=x1)
Variable representing
assignment Z=z3
a11
a(Z=z3)
a21
No mutex between
any of X=x1; Y=y2
and Z=z3
Consider an action
with preconditions
X=x1; Y=y2; Z=z3

a13
a23
a(Y=y2)
Domain of
variable a(Z=z3)
a12
a22
Assignment a(Y=y2)=a22 &
& a(Z=z3)=a13 is not allowed
maintain singleton arc-consistency in the model

CSCLP 2006
deduces more information than the standard
Graphplan  more accurate reach. approximation
Pavel Surynek
Revised plan-graph expansion
ExpandModel(M,m) {M is the constraint model of size m}
1
let Gm=(Vm,Em)
2
VmØ, EmØ
3
for each action b=(precond(b),effect(b)) do
4
let precond(b)=((Fj1=dk1);...;(Fjl=dkl)
5
c=(a(Fj1,dk1)≠) &...& a(Fjl,dkl)≠)
6
if M{c} is singleton arc-consistent then
7
add a vertex (b,Fj,dk) to Vm for
8
every (Fj,dk)effect(b)
9
for each pair of vertexes (ai1,Fj1,dkl);(ai2,Fj2,dk2)Vm
10
where ai1 and ai2 are dependent do
11
add an edge {(ai1,Fj1,dkl);(ai2,Fj2,dk2)} to Em
12 extend the model M according to the graph Gm=(Vm,Em)
13 perform the mutex propagation in the model
Consistency check is done before an
action is included into the planning graph
CSCLP 2006
Pavel Surynek
Conclusions and future works

our contribution

revised planning graph expansion



singleton arc-consitency is maintained within the
planning graph CSP model
more accurate reachability approximation


planning graph expressed as a CSP
reduces number of plan extraction phases which is the
major time consumer
future works

CSCLP 2006
implementation, experimental evaluation and
improvements
Pavel Surynek