Computer Science CPSC 322 Lecture 18 Heuristics for Forward Planning.

Slides:



Advertisements
Similar presentations
REVIEW : Planning To make your thinking more concrete, use a real problem to ground your discussion. –Develop a plan for a person who is getting out of.
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Computer Science CPSC 322 Lecture 22 Finish Planning as CSP and Planning Wrap-up (Ch 8.4)
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 11, 2013.
Slide 1 Planning: Representation and Forward Search Jim Little UBC CS 322 October 10, 2014 Textbook §8.1 (Skip )- 8.2)
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 6, 2013.
Planning CSE 473 Chapters 10.3 and 11. © D. Weld, D. Fox 2 Planning Given a logical description of the initial situation, a logical description of the.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Decision Theory: Single Stage Decisions Computer Science cpsc322, Lecture 33 (Textbook Chpt 9.2) March, 30, 2009.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
Search: Representation and General Search Procedure CPSC 322 – Search 1 January 12, 2011 Textbook § 3.0 –
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.6) February, 01, 2010.
CPSC 322, Lecture 30Slide 1 Reasoning Under Uncertainty: Variable elimination Computer Science cpsc322, Lecture 30 (Textbook Chpt 6.4) March, 23, 2009.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.8) February, 02, 2009.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
CPSC 322, Lecture 31Slide 1 Probability and Time: Markov Models Computer Science cpsc322, Lecture 31 (Textbook Chpt 6.5) March, 25, 2009.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CPSC 322, Lecture 32Slide 1 Probability and Time: Hidden Markov Models (HMMs) Computer Science cpsc322, Lecture 32 (Textbook Chpt 6.5) March, 27, 2009.
CPSC 322, Lecture 35Slide 1 Value of Information and Control Computer Science cpsc322, Lecture 35 (Textbook Chpt 9.4) April, 14, 2010.
Classical Planning Chapter 10.
Planning: Wrap up CSP Planning. Logic: Intro CPSC 322 – Planning 3 Textbook §8.4, §5.1 March 2, 2011.
Computer Science CPSC 502 Lecture 5 SLS: wrap-up Planning (Ch 8)
Computer Science CPSC 322 Lecture 3 AI Applications 1.
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
Computer Science CPSC 322 Lecture 4 Search: Intro (textbook Ch: ) 1.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
Department of Computer Science Undergraduate Events More
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Computer Science CPSC 322 Lecture 13 Arc Consistency (4.5, 4.6 ) Slide 1.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 6Slide 1 Planning + Intro Logics Computer Science cpsc322, Lecture 6 (Textbook Chpt , 8.4) May, 23, 2012.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Jim Little UBC CS 322 October 15, 2014 Textbook §8.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
Decision Theory: Single & Sequential Decisions. VE for Decision Networks. CPSC 322 – Decision Theory 2 Textbook §9.2 April 1, 2011.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) Sep, 26, 2010.
Computer Science CPSC 322 Lecture 12 SLS wrap up, Forward Planning, Planning as CSP (Ch 8.2, 8.4) Slide 1.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.
Constraint Satisfaction Problems (CSPs) Introduction
Computer Science cpsc322, Lecture 4
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Forward Planning and CSP Planning
Constraint Satisfaction Problems (CSPs) Introduction
Planning: Representation and Forward Search
Planning + Intro Logics Computer Science cpsc322, Lecture 6
Planning: Heuristics and CSP Planning
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
Probability and Time: Markov Models
Probability and Time: Markov Models
Planning: Heuristics and CSP Planning
Decision Theory: Single Stage Decisions
Probability and Time: Markov Models
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Probability and Time: Markov Models
Domain Splitting CPSC 322 – CSP 4 Textbook §4.6 February 4, 2011.
Planning: Representation and Forward Search
Presentation transcript:

Computer Science CPSC 322 Lecture 18 Heuristics for Forward Planning

Announcements Midterm will be 50’, close textbook, no calculator or other devices - Part short questions similar or even verbatim from the list posted in connect - Part more problem-solving style questions Office hours this week (red is new) – Also posted on Connect Tuesday 12:30 pm Kamyar Wednesday 11 am Mike (new room ICCS X141) Wednesday 4 pm Cristina Thursday 12 pm Samad Thursday 2pm Cristina Friday 9:30 am Lucas Material for midterm available in Connect - Short conceptual questions (already posted) - List of Learning Goals (already posted) - Sample problem-solving questions (will be posted by Monday) Topics Covered - from beginning to Forward Planning included (no heuristics for forward planning)

Recap of Lecture 17 Heuristics for forward planning Intro to planning as CSP Outline

Course Overview Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Logics STRIPS Vars + Constraints Value Iteration Variable Elimination Belief Nets Decision Nets Markov Processes Static Sequential Representation Reasoning Technique Variable Elimination We’ll focus on Planning

Goal Description of states of the world Description of available actions => when each action can be applied and what its effects are Planning: build a sequence of actions that, if executed, takes the agent from the current state to a state that achieves the goal Planning Problem

Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State: assignments of values to a subset of the variables Successor function: assign values to a “free” variable Goal test: all variables assigned a value and all constraints satisfied? Solution: possible world that satisfies the constraints Heuristic function: none (all solutions at the same distance from start) Planning : State Successor function Goal test Solution Heuristic function Inference State Successor function Goal test Solution Heuristic function

“Open-up” the representation of states, goals and actions –States and goals as set of features –STRIPS representation for actions: two parts: 1. Preconditions: a set of assignments to features that must be satisfied in order for the action to be applicable in a state 2. Effects: a set of assignments to features that are caused by the action Key Idea of Planning

Delivery Robot Example: features RLoc - Rob's location Domain: {coffee shop, Sam's office, mail room, laboratory} short {cs, off, mr, lab} RHC – Rob has coffee Domain: {true, false}. Alternatively notation: rhc indicate that Rob has coffee, and by that Rob doesn’t have coffee SWC – Sam wants coffee {true, false} MW – Mail is waiting {true, false} RHM – Rob has mail {true, false} An example state is 64 possible states in total

Delivery Robot Example: Actions The robot’s actions are: Move - Rob's move action move clockwise (mc ), move anti-clockwise (mac ) PUC - Rob picks up coffee must be at the coffee shop and not have coffee DelC - Rob delivers coffee must be at the office, and must have coffee PUM - Rob picks up mail must be in the mail room, and mail must be waiting DelM - Rob delivers mail must be at the office and have mail Preconditions for action application

STRIPS actions: Example STRIPS representation of the action pick up coffee, PUC: preconditions Loc = cs and RHC = F effects RHC = T STRIPS representation of the action deliver coffee, Del : preconditions Loc = off and RHC = T effects RHC = F and SWC = F STRIPS representation of the action move clockwise from coffee shop, mc-cs preconditions: Loc = cs effects: Loc = off

STRIPS Actions (cont’) The STRIPS assumption: all features not explicitly changed by an action stay unchanged So if the feature V has value v i in state S i, after action a has been performed, what can we conclude about a and/or the state of the world S i-1 immediately preceding the execution of a? S i-1 V = v i SiSi a C. At least one of A and B A. V = v i was TRUE in S i-1 B.One of the effects of a is to set V = v i

STRIPS lends itself to solve planning problems either As pure search problems As CSP problems We will look at one technique for each approach Solving planning problems

Forward planning To find a plan, a solution : search in the state-space graph The states are the possible worlds full assignments of values to features The arcs from a state s represent all the actions that are possible in state s A plan is a path from the state representing the initial state to a state that satisfies the goal Which actions a are possible in a state s? B. Those where a’s preconditions are satisfied in s

Example for state space graph Goal: D (puc, mc, dc) a sequence of actions that gets us from the start to a goal Solution:

Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State: assignments of values to a subset of the variables Successor function: assign values to a “free” variable Goal test: set of constraints Solution: possible world that satisfies the constraints Heuristic function: none (all solutions at the same distance from start) Planning : State: full assignment of values to features Successor function: states reachable by applying valid actions Goal test: partial assignment of values to features Solution: a sequence of actions Heuristic function Inference State Successor function Goal test Solution Heuristic function

Forward Planning Any of the search algorithms we have seen can be used in Forward Planning Problem? Complexity is defined by the branching factor, e.g.…

Forward Planning Any of the search algorithms we have seen can be used in Forward Planning Problem? Complexity is defined by the branching factor, e.g.… Number of applicable actions to a state Can be very large Solution?

Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State: assignments of values to a subset of the variables Successor function: assign values to a “free” variable Goal test: set of constraints Solution: possible world that satisfies the constraints Heuristic function: none (all solutions at the same distance from start) Planning : State: full assignment of values to features Successor function: states reachable by applying valid actions Goal test: partial assignment of values to features Solution: a sequence of actions Heuristic function Inference State Successor function Goal test Solution Heuristic function

Recap of Lecture 17 Heuristics for forward planning Intro to planning as CSP Outline

Heuristics for Forward Planning Not in textbook, but you can see details in Russel&Norvig, Heuristic function: estimate of the distance from a state to the goal In planning this distance is the………………. B. # of actions needed to get from s to the goal C. # of legal actions in s A. # of goal features not true in s

Heuristics for Forward Planning Not in textbook, but you can see details in Russel&Norvig, Heuristic function: estimate of the distance from a state to the goal In planning this distance is the………………. Finding a good heuristics is what makes forward planning feasible in practice Factored representation of states and actions allows for definition of domain-independent heuristics We will look at one example of such domain-independent heuristic that has proven to be quite successful in practice B.# of actions needed to get from s to the goal

Heuristics for Forward Planning: We make two simplifications in the STRIPS representation All features are binary: T / F Goals and preconditions can only be assignments to T e.g. positive assertions Definition: a subgoal is the specific assignment for one of the features in the goal e.g., if the goal is then…. S1 A = T B = F C = F Goal A = T B = T C = T

Heuristics for Forward Planning: ignore delete-list One strategy to find an admissible heuristics is to relax the original problem One way : remove all the effects that make a variable = F. Name of this heuristic derives from complete STRIPS representation Action effects are divided into those that add elements to the new state (add list) and those that remove elements (delete list) If we find the path from the initial state to the goal using this relaxed version of the actions: the length of the solution is an underestimate of the actual solution length Why? Action a effects (B=F, C=T)

Heuristics for Forward Planning: ignore delete-list One strategy to find an admissible heuristics is to relax the original problem One way : remove all the effects that make a variable = F. If we find the path from the initial state to the goal using this relaxed version of the actions: the length of the solution is an underestimate of the actual solution length Why? In the original problem, one action (e.g. a above) might undo an already achieved goal (e.g. by a1 below) Action a effects (B=F, C=T) S1 A = T B = F C = F Goal A = T B = T C = T

Heuristics for Forward Planning: ignore delete-list One strategy to find an admissible heuristics is to relax the original problem One way : remove all the effects that make a variable = F. If we find the path from the initial state to the goal using this relaxed version of the actions: the length of the solution is an underestimate of the actual solution length Why? In the original problem, one action (e.g. a above) might undo an already achieved goal (e.g. by a1 below) Action a effects (B=F, C=T) S1 A = T B = F C = F Goal A = T B = T C = T a1 B = T a C = T B = F

Example for ignore-delete-list Let’s stay in the robot domain But say our robot has to bring coffee to Bob, Sue, and Steve: G = {bob_has_coffee, sue_has_coffee, steve_has_coffee} They all sit in different offices Original actions “pick-up coffee” achieves rhc = T “deliver coffee” achieves rhc = F “Ignore delete lists”  remove rhc = F from “deliver coffee” once you have coffee you keep it Problem gets easier: only need to pick up coffee once, navigate to the right locations, and deliver

Can you think of another way of deriving a domain-independent admissible heuristic for planning? Let’s stay in the robot domain But say our robot has to bring coffee to Bob, Sue, and Steve: G = {bob_has_coffee, sue_has_coffee, steve_has_coffee} They all sit in different offices B. Count Number of unsatisfied sub-goals C. Plan by ignoring action preconditions A. Count Number of satisfied sub-goals D. None of the above

Can you think of another way of deriving a domain- independent admissible heuristic for planning? Let’s stay in the robot domain But say our robot has to bring coffee to Bob, Sue, and Steve: G = {bob_has_coffee, sue_has_coffee, steve_has_coffee} They all sit in different offices BOTH (in this domain, and for this goal, since one cannot achieve more than one subgoal with a single action) In general, only C. B might be an overestimate of the actual cost when actions can achieve multiple subgoals B. Count Number of unsatisfied sub-goals C. Plan by ignoring action preconditions

Example Let’s stay in the robot domain But say our robot has to bring coffee to Bob, Sue, and Steve: G = {bob_has_coffee, sue_has_coffee, steve_has_coffee} They all sit in different offices Admissible heuristic: ignore preconditions: Can simply apply “DeliverCoffee(person)” action for each person Is ignore-preconditions better or worse than ignore- delete-list?

Ignore-delete-list provides a tighter estimate of the actual solution length (number of actions needed to achieve the goal), because it is more constrained Keep some of the action preconditions as opposed to removing them all

Heuristics for Forward Planning: ignore delete-list But how do we compute the actual heuristics values for ignore delete-list?

Heuristics for Forward Planning: ignore delete-list But how do we compute the actual heuristics values for ignore delete-list? To compute h(s i ), run forward planner with s i as start state Same goal as original problem Actions without “delete list” Often fast enough to be worthwhile Planning is PSPACE-hard (that’s really hard, includes NP-hard) Without delete lists: often very fast

Example Planner FF or Fast Forward Jörg Hoffmann: Where 'Ignoring Delete Lists' Works: Local Search Topology in Planning Benchmarks. J. Artif. Intell. Res. (JAIR) 24: (2005)J. Artif. Intell. Res. (JAIR) 24 Winner of the 2001 AIPS Planning CompetitionAIPS Planning Competition Estimates the heuristics by solving the relaxed planning problem with a planning graph method (next class) Uses Best First search with this heuristic to find a solution When it hits a plateau or local minimum Uses IDS to get away (i..e, to reach a state that is better)

Final Comment You should view Forward Planning as one of the basic planning techniques (we’ll see another one next week) By itself, it cannot go far, but it can work very well in combination with other techniques, for specific domains See, for instance, descriptions of competing planners in the presentation of results for the 2002 and 2008 planning competition (posted in the class schedule)

Learning Goals Included in midterm Represent a planning problem with the STRIPS representation Explain the STRIPS assumption Solve a planning problem by search (forward planning). Specify states, successor function, goal test and solution. Not Included in midterm Construct and justify a heuristic function for forward planning