applying constraint satisfaction techniques to ai planning problems

66
Applying Constraint Applying Constraint Satisfaction Satisfaction Techniques to AI Techniques to AI Planning Problems Planning Problems Daniel Buettner Daniel Buettner Constraint Systems Laboratory Constraint Systems Laboratory Department of Computer Science and Engineering Department of Computer Science and Engineering University of Nebraska-Lincoln University of Nebraska-Lincoln Under the supervision of Dr. Berthe Y. Choueiry Under the supervision of Dr. Berthe Y. Choueiry

Upload: olesia

Post on 19-Jan-2016

25 views

Category:

Documents


0 download

DESCRIPTION

Applying Constraint Satisfaction Techniques to AI Planning Problems. Daniel Buettner Constraint Systems Laboratory Department of Computer Science and Engineering University of Nebraska-Lincoln Under the supervision of Dr. Berthe Y. Choueiry. Outline. Background The GP-CSP planning system - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Applying Constraint Satisfaction Techniques to AI Planning Problems

Applying Constraint Applying Constraint Satisfaction Satisfaction

Techniques to AI Techniques to AI Planning ProblemsPlanning Problems

Daniel BuettnerDaniel Buettner

Constraint Systems LaboratoryConstraint Systems Laboratory

Department of Computer Science and EngineeringDepartment of Computer Science and Engineering

University of Nebraska-LincolnUniversity of Nebraska-Lincoln

Under the supervision of Dr. Berthe Y. ChoueiryUnder the supervision of Dr. Berthe Y. Choueiry

Page 2: Applying Constraint Satisfaction Techniques to AI Planning Problems

OutlineOutline

BackgroundBackground The GP-CSP planning systemThe GP-CSP planning system Exploiting partial interchangeabilityExploiting partial interchangeability Investigating decompositionInvestigating decomposition Maintaining Arc Consistency (MAC)Maintaining Arc Consistency (MAC) ConclusionConclusion

Page 3: Applying Constraint Satisfaction Techniques to AI Planning Problems

Questions addressedQuestions addressed

Are CSP techniques suitable for Are CSP techniques suitable for solving AI planning problems?solving AI planning problems? Yes!Yes!

Is Dynamic Neighborhood Partial Is Dynamic Neighborhood Partial Interchangeability (DNPI) effective Interchangeability (DNPI) effective in the context of CSP formulations of in the context of CSP formulations of AI planning problems?AI planning problems? Not with the CSP formulation that we Not with the CSP formulation that we

have studied.have studied.

Page 4: Applying Constraint Satisfaction Techniques to AI Planning Problems

Questions addressed…Questions addressed… Is there an effective conjunctive decomposition Is there an effective conjunctive decomposition

for planning problems formulated as CSPs?for planning problems formulated as CSPs? Not with the CSP formulation that we have studied.Not with the CSP formulation that we have studied.

Is Maintaining Arc Consistency (MAC) an Is Maintaining Arc Consistency (MAC) an effective algorithm for finding solutions to CSP effective algorithm for finding solutions to CSP formulations of AI planning problems?formulations of AI planning problems? Yes!Yes!

How does MAC perform with various variable How does MAC perform with various variable orderings?orderings? MAC performs well on a wide range of variable MAC performs well on a wide range of variable

orderings.orderings.

Page 5: Applying Constraint Satisfaction Techniques to AI Planning Problems

ContributionsContributions

We have found a variable pruning We have found a variable pruning method for our CSP representationmethod for our CSP representation

We have shown that DNPI cannot We have shown that DNPI cannot work with our CSP representationwork with our CSP representation

We provide an iterative We provide an iterative implementation of MACimplementation of MAC

We identify some dynamic variable We identify some dynamic variable ordering schemes for MAC that work ordering schemes for MAC that work well on AI planning problemswell on AI planning problems

Page 6: Applying Constraint Satisfaction Techniques to AI Planning Problems

BackgroundBackground

Page 7: Applying Constraint Satisfaction Techniques to AI Planning Problems

BackgroundBackground

Introduction to AI planningIntroduction to AI planning Introduction to Constraint Introduction to Constraint

SatisfactionSatisfaction Introduction to the GP-CSP planning Introduction to the GP-CSP planning

systemsystem

Page 8: Applying Constraint Satisfaction Techniques to AI Planning Problems

AI planningAI planning

A planning problem is one in which an A planning problem is one in which an agent capable of sensing and of agent capable of sensing and of performing some actions finds itself in a performing some actions finds itself in a world, needing to achieve certain goalsworld, needing to achieve certain goals

A solution to a planning problem is an A solution to a planning problem is an ordered sequence of actions that, when ordered sequence of actions that, when carried out, will achieve the desired carried out, will achieve the desired goals goals

An example will help illustrate this.An example will help illustrate this.

Page 9: Applying Constraint Satisfaction Techniques to AI Planning Problems

Planning examplePlanning example A simple example of such a problem is one A simple example of such a problem is one

in which two men, Jason and Alex, are in which two men, Jason and Alex, are initially in London with Jason wishing to initially in London with Jason wishing to travel to New York and Alex wishing to travel to New York and Alex wishing to travel to Paris. There are two rockets in travel to Paris. There are two rockets in London, each capable of carrying one or London, each capable of carrying one or more persons and making a single flight. more persons and making a single flight.

The available actions allow one to:The available actions allow one to: load a person into a rocketload a person into a rocket fly a rocket from one city to anotherfly a rocket from one city to another unload a person from a rocket.unload a person from a rocket.

Page 10: Applying Constraint Satisfaction Techniques to AI Planning Problems

Planning example…Planning example…

One solution to this problem is the One solution to this problem is the following sequence of actions:following sequence of actions:

1.1. Load Jason into rocket 1Load Jason into rocket 1

2.2. Load Alex into rocket 2Load Alex into rocket 2

3.3. Fly rocket 1 to New YorkFly rocket 1 to New York

4.4. Fly rocket 2 to ParisFly rocket 2 to Paris

5.5. Unload Jason from rocket 1Unload Jason from rocket 1

6.6. Unload Alex from rocket 2Unload Alex from rocket 2

Page 11: Applying Constraint Satisfaction Techniques to AI Planning Problems

AI planning…AI planning…

A planning problem should specify:A planning problem should specify: A description of the world's initial state (as a A description of the world's initial state (as a

set of facts)set of facts) A description of the agent's goal (as a set of A description of the agent's goal (as a set of

facts)facts) A description of the possible actions that can A description of the possible actions that can

be carried out to affect the state of the worldbe carried out to affect the state of the world Planning systems read domain and Planning systems read domain and

problem descriptions in a standard problem descriptions in a standard language called PDDLlanguage called PDDL

Page 12: Applying Constraint Satisfaction Techniques to AI Planning Problems

Classical AI planningClassical AI planning Several simplifying assumptions are made Several simplifying assumptions are made

in classical AI planning:in classical AI planning: All actions require a single, uniform, unit of All actions require a single, uniform, unit of

time to executetime to execute Actions will be successful and produce their Actions will be successful and produce their

expected resultsexpected results The agent knows the initial state of the world, The agent knows the initial state of the world,

as well as the impact of its own actions on the as well as the impact of its own actions on the state of the worldstate of the world

The only change in the world is the result of The only change in the world is the result of the agent's own actionsthe agent's own actions

Page 13: Applying Constraint Satisfaction Techniques to AI Planning Problems

GraphPlanGraphPlan

Planning system introduced in 1995 Planning system introduced in 1995 by Blum and Furstby Blum and Furst

Today’s fast planning systems use Today’s fast planning systems use stochastic techniques and sacrifice stochastic techniques and sacrifice guarantees of optimality; however, guarantees of optimality; however, planning systems that guarantee planning systems that guarantee optimality in time steps are still optimality in time steps are still based on the ideas of GraphPlanbased on the ideas of GraphPlan

Page 14: Applying Constraint Satisfaction Techniques to AI Planning Problems

GraphPlan…GraphPlan…

GraphPlan finds solutions to GraphPlan finds solutions to planning problems by constructing a planning problems by constructing a planning graphplanning graph level-by-level, and level-by-level, and searching for valid plans within that searching for valid plans within that graphgraph

Planning graphs consist of Planning graphs consist of alternating layers of facts and alternating layers of facts and actionsactions

Page 15: Applying Constraint Satisfaction Techniques to AI Planning Problems

The planning graphThe planning graph

When a planning graph is first created, it simply When a planning graph is first created, it simply contains a fact layer made up of the initial contains a fact layer made up of the initial conditions that specify the conditions that specify the initial stateinitial state of the of the planning problemplanning problem

Page 16: Applying Constraint Satisfaction Techniques to AI Planning Problems

The planning graph…The planning graph…

Planning graphs are extended by finding Planning graphs are extended by finding all actions whose prerequisites are all actions whose prerequisites are satisfied at the most recent fact level and satisfied at the most recent fact level and adding these actions in the next layer of adding these actions in the next layer of the graphthe graph

The effects of these actions form the next The effects of these actions form the next fact layerfact layer

a so-called a so-called noopnoop action exists that can action exists that can take any fact as a prerequisite with that take any fact as a prerequisite with that same fact as the action's only effectsame fact as the action's only effect

Page 17: Applying Constraint Satisfaction Techniques to AI Planning Problems

GraphPlan mutexesGraphPlan mutexes

GraphPlan discovers binary mutual GraphPlan discovers binary mutual exclusion (exclusion (mutexmutex) relationships ) relationships between actions and factsbetween actions and facts

Actions are mutex when:Actions are mutex when: The effect of one action is the negation The effect of one action is the negation

of another action's effectof another action's effect One action deletes the precondition of One action deletes the precondition of

anotheranother The actions have preconditions that are The actions have preconditions that are

marked as mutexmarked as mutex

Page 18: Applying Constraint Satisfaction Techniques to AI Planning Problems

GraphPlan mutexes…GraphPlan mutexes…

Facts are mutex when:Facts are mutex when: One fact is the negation of the otherOne fact is the negation of the other All actions supporting the facts are All actions supporting the facts are

pairwise mutex pairwise mutex Mutex relationships are specific to Mutex relationships are specific to

levels in the planning graph; a pair levels in the planning graph; a pair of facts that are mutex in one level of facts that are mutex in one level of the planning graph may not be of the planning graph may not be mutex at later levelsmutex at later levels

Page 19: Applying Constraint Satisfaction Techniques to AI Planning Problems

Plan extractionPlan extraction

Plan extraction is first attempted when Plan extraction is first attempted when all of the goals are present in the all of the goals are present in the highest fact layer and are non-mutexhighest fact layer and are non-mutex

Plans are extracted via a simple Plans are extracted via a simple backtracking search, starting with the backtracking search, starting with the highest fact layerhighest fact layer

If no plan is found, the planning graph If no plan is found, the planning graph is extended and GraphPlan attempts is extended and GraphPlan attempts plan extraction on this new planning plan extraction on this new planning graphgraph

Page 20: Applying Constraint Satisfaction Techniques to AI Planning Problems

Plan extraction…Plan extraction… Graphplan first searches for a solution at the Graphplan first searches for a solution at the

earliest possible point that a plan could existearliest possible point that a plan could exist It incrementally extends the planning graph It incrementally extends the planning graph

if no solution is foundif no solution is found Thus, GraphPlan finds the plan that uses the Thus, GraphPlan finds the plan that uses the

fewest time steps and is therefore optimal in fewest time steps and is therefore optimal in this respectthis respect

However, GraphPlan allows multiple actions However, GraphPlan allows multiple actions to occur at each time step and so it cannot to occur at each time step and so it cannot guarantee optimality in the total number of guarantee optimality in the total number of actions in the planactions in the plan

Page 21: Applying Constraint Satisfaction Techniques to AI Planning Problems

GraphPlan concludedGraphPlan concluded

Our work is based upon the ideas of Our work is based upon the ideas of GraphPlanGraphPlan

We convert the planning graph to a We convert the planning graph to a Constraint Satisfaction Problem Constraint Satisfaction Problem (CSP) and extract solutions by (CSP) and extract solutions by solving the CSPsolving the CSP

Next: introduction to Constraint Next: introduction to Constraint SatisfactionSatisfaction

Page 22: Applying Constraint Satisfaction Techniques to AI Planning Problems

Constraint satisfactionConstraint satisfaction

Constraint satisfaction is a general Constraint satisfaction is a general method of problem formulation in method of problem formulation in which the goal is to find values for which the goal is to find values for variables such that these values do variables such that these values do not violate any constraints that hold not violate any constraints that hold between the variablesbetween the variables

Page 23: Applying Constraint Satisfaction Techniques to AI Planning Problems

DefinitionsDefinitions A Constraint Satisfaction Problem (CSP) A Constraint Satisfaction Problem (CSP)

involves:involves: A set of variables A set of variables {V{V11, V, V22, … , V, … , Vnn}} Each variable Each variable VVii has an associated domain has an associated domain

DDii which specifies the possible which specifies the possible valuesvalues of of the variable the variable

Finally, there exists a set of constraints Finally, there exists a set of constraints between the variables between the variables a constraint is a relation that restricts the a constraint is a relation that restricts the

values that variables involved in the constraint values that variables involved in the constraint may simultaneously holdmay simultaneously hold

Page 24: Applying Constraint Satisfaction Techniques to AI Planning Problems

CSP exampleCSP example

DD11={R, G, B},={R, G, B}, DD22={R, G},={R, G}, and and DD33={R, G, B}={R, G, B} The constraints all require that certain variables The constraints all require that certain variables

not assume the same valuenot assume the same value A CSP is solved when a value is found for each A CSP is solved when a value is found for each

variable such that no constraints are violatedvariable such that no constraints are violated VV11 := R, V := R, V22 := G, V := G, V33 := B := B

Page 25: Applying Constraint Satisfaction Techniques to AI Planning Problems

Solution extractionSolution extraction

While looking for solutions, the While looking for solutions, the variables are considered in some variables are considered in some orderorder

As a partial solution is constructed, As a partial solution is constructed, past variablespast variables are those that have are those that have been instantiated, while been instantiated, while future future variablesvariables are those that have not yet are those that have not yet had a value assigned to themhad a value assigned to them

Page 26: Applying Constraint Satisfaction Techniques to AI Planning Problems

Solution extraction…Solution extraction… One of the simplest systematic methods of One of the simplest systematic methods of

finding a solution to a CSP is a depth first finding a solution to a CSP is a depth first backtracking searchbacktracking search

This search proceeds by starting with the first This search proceeds by starting with the first variable and assigning it the first value in that variable and assigning it the first value in that variable's domainvariable's domain

It then moves to the next variable and checks It then moves to the next variable and checks the first value in that variable's domain the first value in that variable's domain against the previously assigned variable; if against the previously assigned variable; if there is no problem it moves on to the next there is no problem it moves on to the next variable, otherwise it tries the next value in variable, otherwise it tries the next value in the current variable's domainthe current variable's domain

Page 27: Applying Constraint Satisfaction Techniques to AI Planning Problems

Forward checkingForward checking Forward checking (FC) is a more intelligent Forward checking (FC) is a more intelligent

method for finding a solution to a CSPmethod for finding a solution to a CSP A A look-aheadlook-ahead scheme in which consistency scheme in which consistency

with future variables is ensured, removing the with future variables is ensured, removing the need to check against previously assigned need to check against previously assigned variablesvariables

When a variable is assigned a value, that value When a variable is assigned a value, that value is used to filter the domains of future is used to filter the domains of future variablesvariables

By always checking forward, we eliminate the By always checking forward, we eliminate the need to reconsider past variablesneed to reconsider past variables

Next: GP-CSPNext: GP-CSP

Page 28: Applying Constraint Satisfaction Techniques to AI Planning Problems

The GP-CSP The GP-CSP planning systemplanning system

Page 29: Applying Constraint Satisfaction Techniques to AI Planning Problems

GP-CSPGP-CSP

Our work extends a planning system Our work extends a planning system called GP-CSP (Do and Kambhampati called GP-CSP (Do and Kambhampati 2001)2001)

GP-CSP unifies the traditional GP-CSP unifies the traditional GraphPlan method for planning with GraphPlan method for planning with CSP methods for solution extractionCSP methods for solution extraction

GraphPlan's plan extension is GraphPlan's plan extension is unchanged while the normal unchanged while the normal backtracking search is replaced with backtracking search is replaced with a CSP solvera CSP solver

Page 30: Applying Constraint Satisfaction Techniques to AI Planning Problems

GP-CSP…GP-CSP…

The architecture of the GP-CSP systemThe architecture of the GP-CSP system

Page 31: Applying Constraint Satisfaction Techniques to AI Planning Problems

CSP formulationCSP formulation CSP variables represent factsCSP variables represent facts The variable domains are the actions The variable domains are the actions

supporting these factssupporting these facts Each variable has an extra value called Each variable has an extra value called NOTHINGNOTHING

added to it, which allows a fact to be left with no added to it, which allows a fact to be left with no supportsupport

The constraints between variables enforce The constraints between variables enforce action and fact mutexes, as well as activity action and fact mutexes, as well as activity constraintsconstraints

The transformation from GraphPlan’s planning The transformation from GraphPlan’s planning graph to a CSP of this type is straight forward graph to a CSP of this type is straight forward and is carried out automatically by GP-CSPand is carried out automatically by GP-CSP

Page 32: Applying Constraint Satisfaction Techniques to AI Planning Problems

Our changes to GP-CSPOur changes to GP-CSP We have replaced their general GAC We have replaced their general GAC

solver with a strictly binary solver which solver with a strictly binary solver which is extended to perform:is extended to perform: Dynamic symmetry detectionDynamic symmetry detection DecompositionDecomposition Maintaining Arc Consistency (MAC)Maintaining Arc Consistency (MAC)

We have our own representation of the We have our own representation of the CSP formulation just described which CSP formulation just described which takes advantage of the object orientation takes advantage of the object orientation of C++of C++

Page 33: Applying Constraint Satisfaction Techniques to AI Planning Problems

PreprocessingPreprocessing We have discovered a preprocessing step that We have discovered a preprocessing step that

can reduce certain variables to a single valuecan reduce certain variables to a single value These variables have only the actions These variables have only the actions noopnoop

and and NOTHINGNOTHING in their domains, and they are in their domains, and they are only constrained to act as prerequisites for only constrained to act as prerequisites for other actionsother actions

Such variables correspond to facts that Such variables correspond to facts that encode typing informationencode typing information This typing information is necessary during This typing information is necessary during

creation of the planning graph, but is no longer creation of the planning graph, but is no longer needed during solution extraction and can then be needed during solution extraction and can then be ignoredignored

Page 34: Applying Constraint Satisfaction Techniques to AI Planning Problems

Preprocessing resultsPreprocessing results

CSPCSP #var#var #prune#prunedd

%remove%removedd

rocket problemrocket problem 3737 1313 35.135.1

3 disc tower of 3 disc tower of hanoihanoi

164164 8181 49.449.4

4 disc tower of 4 disc tower of hanoihanoi

566566 291291 51.451.4

Mystery problem Mystery problem 22

435435 188188 43.243.2

Gripper problem Gripper problem 22

116116 3737 31.931.9

Logistics rocket-aLogistics rocket-a 280280 99 3.23.2

Bulldozer Bulldozer problem 1problem 1

269269 164164 60.960.9

Bw-large-aBw-large-a 720720 1414 1.91.9

Page 35: Applying Constraint Satisfaction Techniques to AI Planning Problems

GP-CSP concludedGP-CSP concluded

We tried several static variable We tried several static variable orderings in conjunction with orderings in conjunction with Forward CheckingForward Checking The default ordering obtained by The default ordering obtained by

moving backwards in the planning moving backwards in the planning graph from highest layer to lowest was graph from highest layer to lowest was the only effective orderingthe only effective ordering

Next: Partial interchangeabilityNext: Partial interchangeability

Page 36: Applying Constraint Satisfaction Techniques to AI Planning Problems

Exploiting partial Exploiting partial interchangeabilitinterchangeabilit

yy

Page 37: Applying Constraint Satisfaction Techniques to AI Planning Problems

Exploiting partial Exploiting partial interchangeabilityinterchangeability

InterchangeabilityInterchangeability amongst the values of amongst the values of a variable in a CSP is a term used to a variable in a CSP is a term used to describe an equivalence that exists describe an equivalence that exists between these values between these values

The idea is that if values The idea is that if values dd11 and and dd22 for for variable variable VVii are found to be are found to be interchangeable, then any solution to the interchangeable, then any solution to the CSP with CSP with VVii taking the value taking the value dd11 will will remain a solution if the value is changed remain a solution if the value is changed to to dd22

Page 38: Applying Constraint Satisfaction Techniques to AI Planning Problems

Interchangeability is Interchangeability is goodgood

Interchangeable values:Interchangeable values: help to create more help to create more robust robust solutions solutions

since failures can potentially be since failures can potentially be repaired by simply substituting values repaired by simply substituting values instead of resolvinginstead of resolving

can help to reduce the search space, by can help to reduce the search space, by allowing us to replace the allowing us to replace the interchangeable (or bundled) values interchangeable (or bundled) values with a single meta-valuewith a single meta-value

Page 39: Applying Constraint Satisfaction Techniques to AI Planning Problems

DNPIDNPI

Full interchangeability is expensive Full interchangeability is expensive to computeto compute

Partial interchangeability finds a Partial interchangeability finds a subset of interchangeable values subset of interchangeable values with lower overheadwith lower overhead

Dynamic neighborhood partial Dynamic neighborhood partial interchangeability (DNPI) requires interchangeability (DNPI) requires the same computations as FC with the same computations as FC with some additional bookkeepingsome additional bookkeeping

Page 40: Applying Constraint Satisfaction Techniques to AI Planning Problems

DNPI…DNPI…

How does it work?How does it work? When a variable is first considered, forward When a variable is first considered, forward

checking is performed with each of that checking is performed with each of that variable’s valuesvariable’s values

A structure called the Joint Discrimination A structure called the Joint Discrimination Tree captures this information and bundles Tree captures this information and bundles values that have the exact same impact on values that have the exact same impact on future variablesfuture variables

Sets of bundled values are replaced in the Sets of bundled values are replaced in the variable's domain with a single meta-value, variable's domain with a single meta-value, thus reducing the search spacethus reducing the search space

Page 41: Applying Constraint Satisfaction Techniques to AI Planning Problems

Application to planningApplication to planning

There are many situations in which There are many situations in which planning problems exhibit what seem to planning problems exhibit what seem to be symmetric actionsbe symmetric actions In the In the gripper domaingripper domain a robot with a right and a robot with a right and

left arm needs to move a set of balls from one left arm needs to move a set of balls from one room to anotherroom to another

It does not matter whether the left arm or It does not matter whether the left arm or right arm moves a ballright arm moves a ball

Each robot arm cares little about the Each robot arm cares little about the distinction between the different ballsdistinction between the different balls

Page 42: Applying Constraint Satisfaction Techniques to AI Planning Problems

Application to planning…Application to planning…

Unfortunately, DNPI is unable to take Unfortunately, DNPI is unable to take advantage of this symmetryadvantage of this symmetry

Recall that values are interchangeable only Recall that values are interchangeable only when they have the same impact on future when they have the same impact on future variablesvariables

However, in our CSP formulation, different However, in our CSP formulation, different values do not share the same neighborhoodvalues do not share the same neighborhood Each value represents an action, and actions do Each value represents an action, and actions do

not share the same preconditions, effects, and not share the same preconditions, effects, and mutexes unless they are identical actionsmutexes unless they are identical actions

Page 43: Applying Constraint Satisfaction Techniques to AI Planning Problems

DNPI concludedDNPI concluded

The explicit naming of objects in The explicit naming of objects in PDDL prevents DNPI from bundling PDDL prevents DNPI from bundling values in our CSP representationvalues in our CSP representation An instantiation of an action must refer An instantiation of an action must refer

to particular facts as preconditions and to particular facts as preconditions and effects, so no two actions refer to the effects, so no two actions refer to the same set of facts unless the actions are same set of facts unless the actions are identicalidentical

Next: DecompositionNext: Decomposition

Page 44: Applying Constraint Satisfaction Techniques to AI Planning Problems

Investigating Investigating decompositiondecomposition

Page 45: Applying Constraint Satisfaction Techniques to AI Planning Problems

Investigating Investigating decompositiondecomposition

It is sometimes possible to more It is sometimes possible to more efficiently solve a problem by efficiently solve a problem by decomposing that problem into a set decomposing that problem into a set of independent subproblemsof independent subproblems

Each subproblem can be Each subproblem can be independently solved, and those independently solved, and those solutions can be combined to form a solutions can be combined to form a solution to the original problemsolution to the original problem

Page 46: Applying Constraint Satisfaction Techniques to AI Planning Problems

Tree clusteringTree clustering

We investigated the tree clustering We investigated the tree clustering algorithm of Dechter and Pearlalgorithm of Dechter and Pearl

This is a method of restructuring a CSP This is a method of restructuring a CSP to make solution extraction less costlyto make solution extraction less costly

The constraint graphs that are created The constraint graphs that are created by converting a planning problem to by converting a planning problem to our CSP representation exhibit our CSP representation exhibit structure that makes decomposition structure that makes decomposition quite simplequite simple

Page 47: Applying Constraint Satisfaction Techniques to AI Planning Problems

Tree clustering…Tree clustering…

Page 48: Applying Constraint Satisfaction Techniques to AI Planning Problems

DecompositionDecomposition We can start at the highest level in the We can start at the highest level in the

planning graph and form a new CSP with planning graph and form a new CSP with the variables one layer lowerthe variables one layer lower

Only the constraints between this subset Only the constraints between this subset of variables are keptof variables are kept

We can again form a new CSP, this time We can again form a new CSP, this time using the next lowest layerusing the next lowest layer

We continue in this way until we reach We continue in this way until we reach the layer of initial conditionsthe layer of initial conditions

An An nn layer planning graph will be layer planning graph will be decomposed into decomposed into n-1n-1 CSPs CSPs

Page 49: Applying Constraint Satisfaction Techniques to AI Planning Problems

ResultsResults Ideally, each CSP can now be solved Ideally, each CSP can now be solved

separately, and their individual solutions separately, and their individual solutions will be combined to form a solution to the will be combined to form a solution to the original problemoriginal problem

However, this decomposition makes However, this decomposition makes things worsethings worse A planning graph is a compact representation A planning graph is a compact representation

of of manymany planning problems planning problems The lower subproblems do not have access to The lower subproblems do not have access to

goal information and will have, as solutions, goal information and will have, as solutions, parts of valid plans that have nothing to do parts of valid plans that have nothing to do with the problem we are solvingwith the problem we are solving

Page 50: Applying Constraint Satisfaction Techniques to AI Planning Problems

Results…Results… The only way tree clustering can be made to The only way tree clustering can be made to

perform well is to consider the subproblems perform well is to consider the subproblems from the top down, propagating goal from the top down, propagating goal information backwardsinformation backwards

This corresponds to using forward checking This corresponds to using forward checking with the default GraphPlan variable orderingwith the default GraphPlan variable ordering

Thus tree clustering did not improve our Thus tree clustering did not improve our ability to find a solution, but it does explain ability to find a solution, but it does explain why we had such good results with forward why we had such good results with forward checking and GraphPlan’s default orderingchecking and GraphPlan’s default ordering

Next: MACNext: MAC

Page 51: Applying Constraint Satisfaction Techniques to AI Planning Problems

Maintaining Arc Maintaining Arc Consistency Consistency

(MAC)(MAC)

Page 52: Applying Constraint Satisfaction Techniques to AI Planning Problems

MACMAC Maintaining Arc Consistency (MAC) is a Maintaining Arc Consistency (MAC) is a

technique used to solve CSPs by enforcing technique used to solve CSPs by enforcing Arc Consistency (AC) at each step in a Arc Consistency (AC) at each step in a backtracking searchbacktracking search

AC is a property of a CSP whereby for any AC is a property of a CSP whereby for any variable variable VVii, each element in its domain has a , each element in its domain has a supportsupport in the domain of any variable with in the domain of any variable with which which VVii is constrained is constrained That is, for each value That is, for each value ddi i in the domain of in the domain of VVii, and , and

for each variable for each variable VVjj constrained with constrained with VVii there exists there exists a value a value ddjj in the domain of in the domain of VVjj such that the such that the constraint between constraint between VVii and and VVjj is not violatedis not violated

Page 53: Applying Constraint Satisfaction Techniques to AI Planning Problems

Arc consistencyArc consistency

Obviously, we do not expect to Obviously, we do not expect to frequently find CSPs that are already frequently find CSPs that are already in an AC state, and so we must use in an AC state, and so we must use AC algorithms to propagate AC algorithms to propagate constraint information and prune constraint information and prune values from variable domains until values from variable domains until the CSP is ACthe CSP is AC

AC is often enforced on a CSP as a AC is often enforced on a CSP as a preprocessing step to reduce the preprocessing step to reduce the size of variable domainssize of variable domains

Page 54: Applying Constraint Satisfaction Techniques to AI Planning Problems

MAC reduxMAC redux

MAC takes a more active approach MAC takes a more active approach and continually enforces AC and continually enforces AC throughout the process of finding a throughout the process of finding a consistent variable assignment for consistent variable assignment for the CSPthe CSP

This can be thought of as a This can be thought of as a backtracking search, but one where backtracking search, but one where an AC algorithm is called each time an AC algorithm is called each time a variable is assigned a valuea variable is assigned a value

Page 55: Applying Constraint Satisfaction Techniques to AI Planning Problems

ExperimentsExperiments

Our experiments with MAC were Our experiments with MAC were concerned with the effects of various concerned with the effects of various variable orderings on the variable orderings on the performance of MACperformance of MAC Static variable orderingsStatic variable orderings Dynamic variable orderingsDynamic variable orderings

Page 56: Applying Constraint Satisfaction Techniques to AI Planning Problems

Static variable orderingStatic variable ordering Forward checking only performed well with Forward checking only performed well with

the default GraphPlan variable ordering; in the default GraphPlan variable ordering; in particular, only the most trivial problems particular, only the most trivial problems could be solved using any other orderingcould be solved using any other ordering

In seven of the eight benchmark problems, In seven of the eight benchmark problems, when a problem is solvable by MAC using when a problem is solvable by MAC using one static ordering, it is solvable using any one static ordering, it is solvable using any other tested orderingother tested ordering

In two of the eight benchmark problems, a In two of the eight benchmark problems, a static ordering other than the default static ordering other than the default resulted in the fastest solution extractionresulted in the fastest solution extraction

Page 57: Applying Constraint Satisfaction Techniques to AI Planning Problems

Dynamic variable Dynamic variable orderingordering

FC performed very poorly with dynamic FC performed very poorly with dynamic variable ordering, since goal information was variable ordering, since goal information was not propagated quickly enoughnot propagated quickly enough

MAC performs very well with dynamic variable MAC performs very well with dynamic variable orderingordering Four of the eight benchmark problems were solved Four of the eight benchmark problems were solved

more rapidly by a dynamic variable ordering than by more rapidly by a dynamic variable ordering than by the default static orderingthe default static ordering

One problem was only solved using a dynamic One problem was only solved using a dynamic variable orderingvariable ordering

There is experimental evidence that indicates There is experimental evidence that indicates MAC performs well in general on problems MAC performs well in general on problems with low density and high tightnesswith low density and high tightness

Page 58: Applying Constraint Satisfaction Techniques to AI Planning Problems

Improvement to MACImprovement to MAC Although widely known and used, the Although widely known and used, the

MAC algorithm itself does not seem to be MAC algorithm itself does not seem to be well described in the literaturewell described in the literature

There is a recursive implementation given There is a recursive implementation given by Sabin and Freuder and other papers by Sabin and Freuder and other papers which discuss MAC assume the reader is which discuss MAC assume the reader is familiar with how to implement itfamiliar with how to implement it

However, our problems consist of several However, our problems consist of several hundred variables and are not well suited hundred variables and are not well suited to recursionto recursion

Page 59: Applying Constraint Satisfaction Techniques to AI Planning Problems

Iterative MACIterative MAC

We present an iterative We present an iterative implementation of MAC which implementation of MAC which includes a simple improvementincludes a simple improvement We avoid enforcing AC when the next We avoid enforcing AC when the next

variable has a domain of size onevariable has a domain of size one Because AC is enforced at each step of Because AC is enforced at each step of

solution extraction in MAC, we know solution extraction in MAC, we know that any variable with a domain size of that any variable with a domain size of one must be consistent with all of its one must be consistent with all of its neighbors when that value is selectedneighbors when that value is selected

Page 60: Applying Constraint Satisfaction Techniques to AI Planning Problems

Improvement testedImprovement tested This improvement does not seem to This improvement does not seem to

appear in the CSP literatureappear in the CSP literature In our tests, the improvement always In our tests, the improvement always

reduced constraint checks and calls to AC reduced constraint checks and calls to AC by at least a factor of 2by at least a factor of 2

The improvement does not take advantage The improvement does not take advantage of anything special about planning of anything special about planning problems, so it seems likely that it would problems, so it seems likely that it would be effective in solving general CSPsbe effective in solving general CSPs

Page 61: Applying Constraint Satisfaction Techniques to AI Planning Problems

ResultsResults

MAC seems to be an effective tool for MAC seems to be an effective tool for use in solving planning problems use in solving planning problems formulated as CSPsformulated as CSPs

Given the extremely low overhead of Given the extremely low overhead of the improvement to MAC and its the improvement to MAC and its potential for reducing effort, we potential for reducing effort, we strongly believe that this strongly believe that this improvement would carry over to improvement would carry over to solving general CSPssolving general CSPs

Next: ConclusionsNext: Conclusions

Page 62: Applying Constraint Satisfaction Techniques to AI Planning Problems

ConclusionConclusion

Page 63: Applying Constraint Satisfaction Techniques to AI Planning Problems

ConclusionConclusion

We have considered a method of We have considered a method of converting an AI Planning Problem converting an AI Planning Problem to a Constraint Satisfaction Problemto a Constraint Satisfaction Problem

We have then turned our attention to We have then turned our attention to the application of various CSP the application of various CSP techniques to solving these planning techniques to solving these planning problemsproblems

Page 64: Applying Constraint Satisfaction Techniques to AI Planning Problems

ContributionsContributions

We have found a variable pruning We have found a variable pruning method for our CSP representationmethod for our CSP representation

We have shown that DNPI cannot We have shown that DNPI cannot work with our CSP representationwork with our CSP representation

We provide a justification for the We provide a justification for the good performance of FC with the good performance of FC with the default GraphPlan variable orderingdefault GraphPlan variable ordering

We provide an improved iterative We provide an improved iterative implementation of MACimplementation of MAC

Page 65: Applying Constraint Satisfaction Techniques to AI Planning Problems

Future workFuture work Can our pruning technique be used to Can our pruning technique be used to

derive type information?derive type information? Is our improvement to MAC equally Is our improvement to MAC equally

effective in solving general CSPs?effective in solving general CSPs? How can we take advantage of the kind of How can we take advantage of the kind of

symmetry we see in solutions to planning symmetry we see in solutions to planning problems?problems?

Can we find other ways to model planning Can we find other ways to model planning problems as a CSP that might allow problems as a CSP that might allow techniques such as DNPI to produce techniques such as DNPI to produce better results?better results?

Page 66: Applying Constraint Satisfaction Techniques to AI Planning Problems

The endThe end