Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 DCP 1172 Introduction to Artificial Intelligence Chang-Sheng Chen Topics Covered: Introduction to Planning (generalized state-space search) Means-Ends.

Similar presentations


Presentation on theme: "1 DCP 1172 Introduction to Artificial Intelligence Chang-Sheng Chen Topics Covered: Introduction to Planning (generalized state-space search) Means-Ends."— Presentation transcript:

1 1 DCP 1172 Introduction to Artificial Intelligence Chang-Sheng Chen Topics Covered: Introduction to Planning (generalized state-space search) Means-Ends Analysis (back-chaining)

2 DCP 1172, Ch. 6 2 Outline What is planning? Formal definitions of planning problems Basic planning algorithms Recent development Appendix Tower of Hanoi Missionaries & Cannibals

3 DCP 1172, Ch. 6 3 Planning as a Real-World Problem What is Planning? Planning is a search problem that requires to find an efficient sequence of actions that transform a system from a given starting state to the goal state Planning problem has a wide range of applications in the real world planning in daily life game world workflow management

4 DCP 1172, Ch. 6 4 Planning a Trip Begin PreparationAirline Reservation Hotel ReservationRental Car Reservation Confirm ReservationsEnd

5 DCP 1172, Ch. 6 5 Towers of Hanoi

6 DCP 1172, Ch. 6 6 Sliding-Tile Puzzle

7 DCP 1172, Ch. 6 7 Planning in Workflow Management Start Assembly Examine Order Gather Components Install Motherboard Test Install Internal Disk Install Network Card Assembly Box and Motherboard Plug in CD Insert Modem Plug in Battery Install Video Card End Assembly

8 DCP 1172, Ch. 6 8 Partial-Order Plan versus Total-Order Plan Partial-order plan consists partially ordered set of actions sequence constraints exist on these actions plan generation algorithm can be applied to transform partial-order plan to total-order plan Total-order plan consists totally ordered set of actions

9 DCP 1172, Ch. 6 9 Partial-Order Plan Start Get brush Get ladder Paint ceilingFinish

10 DCP 1172, Ch. 6 10 Total-Order Plan StartGet brushGet ladderPaint ceilingFinish StartGet brushGet ladderPaint ceilingFinish

11 DCP 1172, Ch. 6 11 Features of Planning Problems Large search space Action is associated with system states Restrictions on the action sequence Valid solution may not exist Optimization requirement

12 DCP 1172, Ch. 6 12 The Problem Space Formal way to specify the details of a specific problem; captures critical features that influence problem solving Problem Space: Includes the initial, intermediate and goal states of the problem. Also includes the problem solver ’ s knowledge at each of these steps.

13 DCP 1172, Ch. 6 13 Planning - Information Processing Approach Elements in the Representation of a Problem: The givens (or start state) The goal (or end state) The operators The constraints Example: Tower of Hanoi Problem Concept of the problem solving process Heuristics for moving through the problem space Means-ends analysis 2

14 DCP 1172, Ch. 6 14 Problem Space: Operators and Goals Operators: The set of legal moves that can be performed during problem solving. Goal: Ultimate solution to the problem. Well-defined problems explicitly specify the final goal. Tower of Hanoi -- all disks moved to target peg Algebra equation -- x = ?? Ill-defined problems only vaguely specify the goal state, the operators or both. Write a coherent essay about ………. Become a millionaire!

15 DCP 1172, Ch. 6 15 What ’ s Given? Initial state of the problem Goal state of the problem A finite set of actions: pre-conditions: a finite set of conditions for the action to be performed post-conditions: a finite set of conditions that will be changed after the action is performed cost

16 DCP 1172, Ch. 6 16 What ’ s Output? A sequence of actions that meet the following criteria every action matches the current system state can transform system from initial state to goal state the total cost of the actions is below a specified value

17 DCP 1172, Ch. 6 17 The Problem Space, Illustrated

18 DCP 1172, Ch. 6 18 Tower of Hanoi Operators: Moving disks from peg to peg Constraints: Can only move one disk at a time A larger disk can’t be stacked on a smaller disk A disk can’t be moved if there is another disk on top of it Start State Goal State 3

19 DCP 1172, Ch. 6 19 Idea of a Problem Space.. At each state: Number of possible “next moves” Can be thought of as a “space of all possible moves” 4

20 DCP 1172, Ch. 6 20 Problem Space Legal moves between two states Problem solving = search in problem space 5

21 DCP 1172, Ch. 6 21 Towers of Hanoi Optimal solution: 7 moves (shortest route from start state to goal state) 6

22 DCP 1172, Ch. 6 22 Towers of Hanoi Less than optimal solution: 19 moves 7

23 DCP 1172, Ch. 6 23 Algorithms vs. Heuristics Algorithms guarantee a solution to a problem e.g., algebra: 3x + 4 = 2x Usually problem specific Heuristics don't guarantee a solution to a problem, cut down search can be used on a lot of problems 9

24 DCP 1172, Ch. 6 24 Heuristics: Subgoaling Break the problem down into subgoals and solve these one at a time E.g. Tower of Hanoi First concentrate on getting the large disk to the third peg 12

25 DCP 1172, Ch. 6 25 Heuristics: Means-Ends Analysis I want to go to the mall. What’s the difference between what I have and what I want? One of distance. What changes distance? My car. My car won’t work. What is needed to make it work? A new battery. What has new batteries? An auto repair shop. I want the auto repair shop to put in a new battery; but the shop doesn’t know I need one. What is the difficulty? One of communication. What allows communication? A telephone...and so on. 14

26 DCP 1172, Ch. 6 26 Means-End Analysis Simon (1972) Solving problems by repeatedly determining the difference between the current state and the goal or subgoal state, then finding an operator that reduces this difference. Used the Tower of Hanoi Problem to study means-end analysis.

27 DCP 1172, Ch. 6 27 Heuristics: Means-Ends Analysis Identify a difference between current state and goal state Set a subgoal to reduce the difference. Apply an operator to reduce the difference (If operator can ’ t be applied, new subgoal = remove obstacle that prevents applying the operator) 13

28 DCP 1172, Ch. 6 28 The Recursive Structure of Means-Ends Analysis Transform Reduce Apply

29 DCP 1172, Ch. 6 29 Algorithms vs Heuristics Algorithmic Search Start Choose Operators Randomly Apply Operator Start Choose Operator Feasible? Favored by Means Ends? Apply Operator yes no Heuristic Search

30 DCP 1172, Ch. 6 30 Heuristics: Means-Ends Analysis I want to solve the Tower of Hanoi S1: Set a subgoal to move the largest disk to the right S1: I can ’ t move it because the middle disk is on top S2: Set a subgoal to move the middle disk S2: I can;t move it because the small disk is on top S3: Set a subgoal to move the small disk S3 Move the small disk S2: Move the middle disk S1:Move the large disk. S1: I can ’ t move it because there is no free disk 14

31 DCP 1172, Ch. 6 31 STRIPS Planning System A tuple T = (P, O, I, G), where P is a finite set of ground literals, the conditions O is a finite set of operators I is the initial state, a subset of P G is the goal state, a subset of P

32 DCP 1172, Ch. 6 32 STRIPS Operators Each operator O has the following attributes PC, a set of ground literals, defines the precondition of the operator D, a set of ground literals, defines the conditions that will be removed after the operation is executed A, a set of ground literals, defines the conditions that will be added after the operation is executed C, the cost of the operation

33 DCP 1172, Ch. 6 33 A Simple Example - Blocks World BA C C B A Initial State Goal State On(C, A) Clear(Fl) On(A, Fl) Clear(B) On(B, Fl) Clear(C) On(A, B) On(B, C) On(C, Fl) Clear(A) Clear(Fl)

34 DCP 1172, Ch. 6 34 Graphical Representation of Initial State Start T Clear(Fl)On(A, Fl)On(B, Fl)On(C, A)Clear(B)Clear(C)

35 DCP 1172, Ch. 6 35 Graphical Representation of Goal State Nil finish On(A, B)On(B, C)On(C, Fl)Clear(A)Clear(Fl)

36 DCP 1172, Ch. 6 36 Block World - Operator Move(x, y, z) Move block x that is above y to above z PC: On(x,y), Clear(x), Clear(z) D: Clear(z), On(x, y) A: On(x,z), Clear(y), Clear(Fl)

37 DCP 1172, Ch. 6 37 Graphical Representation of Operator A Clear(y)On(x, z) Move(x, y, z) On(x, y)Clear(x)Clear(z) Operator PC Clear(Fl)

38 DCP 1172, Ch. 6 38 Forward Chaining Search from the initial state Expand the search tree by finding the set of all applicable operators from the current state applicable means the precondition of the operator is a subset of current state Update current state For every state that is reached, record the shortest path (or path with lowest cost) from the initial state to this state If the goal state is reached, stop the algorithm

39 DCP 1172, Ch. 6 39 Forward Chaining On(C, A) Clear(Fl) On(A, Fl) Clear(B) On(B, Fl) Clear(C) On(C, Fl) Clear(Fl) On(A, Fl) Clear(B) On(B, Fl) Clear(C) Clear(A) Move(C, A, Fl) Move(B, Fl, C) On(B, C) Clear(Fl) On(C, A) Clear(B) On(A, Fl)

40 DCP 1172, Ch. 6 40 Backward Chaining Search backward from the goal state Expand the search tree by finding the set of all applicable operators that can reach the current state applicable means set A of the operator is a subset of current state Update the state If the initial state is reached, stop the algorithm The solution is a partial-ordered plan Constraints in action ordering may be violated

41 DCP 1172, Ch. 6 41 Backward Chaining On(A, B) On(B, C) On(C, Fl) Clear(A) Clear(Fl) Move(A, Fl, B) On(B, C) On(C, Fl) Clear(A) Clear(Fl) On(A, Fl) Clear(B)

42 DCP 1172, Ch. 6 42 Missionaries & Cannibals Three missionaries and three cannibals on one bank of a river -- need to get to other bank Boat holds 2 Move them across Constraint: the number of cannibals can never be larger than the number of missionaries on any bank of the river Reminder: someone must row boat back Let ’ s play: http://www.learn4good.com/games/puzzle/boat.htmLet ’ s play:

43 DCP 1172, Ch. 6 43 Heuristics - Missionaries & Cannibals Missionaries & Cannibals Problem 3 Missionaries and 3 Cannibals goal: get all 6 across river boat can carry 2 at a time Cannibals can never outnumber Missionaries MMM CCC 15

44 DCP 1172, Ch. 6 44 MMM CCC (b) MM CC MMM CC (b) MMM MMM C (b) M C CC CCC (b) C M C (b) MM CC (b) CC (b) C CCC (b) CC MM CC (b) MMM CCC (b) MMM C (b) MMM MMM CC (b) MMM C M C Missionaries & Cannibals Solution increasing difference between initial and goal state 1 2 3 4 5 6 7 8 9 10 11 12

45 DCP 1172, Ch. 6 45 Recent Developments Plan Reuse Graphplan Problem-specific planning Evolutionary computation approach

46 DCP 1172, Ch. 6 46 Plan Reuse Reuse old plans for new planning problems Consists of two steps plan matching plan modification Research findings generally, plan reuse is even harder than plan from scratch do better only when two problems are close enough plan matching could be the bottleneck

47 DCP 1172, Ch. 6 47 Graphplan Partial-order general planner Constructing a planning graph before search plan graph contains all possible actions that can be taken in each time step actions that interfere with one another can coexist in the graph More efficient than other general planners in some problems

48 DCP 1172, Ch. 6 48 Problem-specific Planning Heuristics combined during search heuristics is problem dependent cannot apply to other problems Usually outperforms general planners in specific problems Example in sliding-tile puzzle, accurate estimation of the distance between current state and goal state can speed up the search for a plan

49 DCP 1172, Ch. 6 49 Evolutionary Computation Approach Non-deterministic algorithm Starts from a set of randomized plan Plans are evolved during generations In each generation evaluate the performance of the plan select the plans to next generation, based on performance crossover, mutation to create new plans

50 DCP 1172, Ch. 6 50 Experimental Results Towers of Hanoi can solve the 5 and 6-disk case with high probability state-aware crossover does not perform well Sliding-tile puzzle can solve 3*3 problem case with high probability state-aware crossover perform much better since a looser definition of matching state is used Performance scalability is not good Heuristics may be helpful to improve the performance


Download ppt "1 DCP 1172 Introduction to Artificial Intelligence Chang-Sheng Chen Topics Covered: Introduction to Planning (generalized state-space search) Means-Ends."

Similar presentations


Ads by Google