Presentation is loading. Please wait.

Presentation is loading. Please wait.

Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).

Similar presentations


Presentation on theme: "Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state)."— Presentation transcript:

1

2 Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state). Problem formation Determining actions and states to consider given the goal. Objective: Select the best sequence of actions and states to attain goal.

3 Goal-based Problem Solving Example: The 8 Puzzle Initial State Goal State Goal: Find sequence of actions that lead to the final configuration Actions: move tiles up, down, left, or right when possible. Process of finding sequence of actions: search.

4 Problem Types Deterministic, fully observable: single-state problem Deterministic, partially observable: multiple-state problem Stochastic, partially observable: contingency problem Have to use sensors during execution Agent acts before it has found a guaranteed plan Interleaving of search and execution Unknown state space: exploration problem Review the four problem examples types in book: Section 3.2

5 Defining the problem space State space approach – Problem described as a set of states Initial state, s i, that the agent knows itself to be in at the start. Actions: Possible actions available to agent  Application of operator a i moves agent from current state s j to state s k in the state space. Goal Test: Is the current state is the goal state, s g ? A path in a state space is a set of actions that transition from one state to another.  Path cost: a function that assigns cost to a path  Solution: A path from s i to s g.

6 8-Puzzle Initial State Goal State

7 State Space Definition for 8 Puzzle State description: Operators: Goal Test: Path cost: each move is assigned a cost of 1. position of each of the 8 tiles in one of 9 squares (or 3x3 board). blank position moves up, down, left, or right current state matches goal configuration illustrated on slide 3.

8 Example Problems Toy Problems 8 Puzzle Missionaries and Cannibals 8 Queens Real World Problems Route Finding Traveling Salesperson problem VLSI Layout Robot Navigation Task: Determine the state space representation for the above problems

9 Search Process: Generating Solutions Represented as a tree What is a characteristic of this problem regarding tree size?

10 Evaluate Strategies Completeness Is the strategy guaranteed to find a solution if one exists? Time Complexity How long does the algorithm take to find a solution? Space Complexity How much memory does it take to perform the search? Optimality Does the method find the best (highest quality) solution when there is more than one solution?

11 Uninformed Search Strategies Breadth First Search Uniform Cost Search Depth First Search Iterative Deepening Depth First Search

12 Search Algorithm: Implementation Applied to State Space Representation Function GENERAL-SEARCH (problem, QUEUING-FN) returns a solution or failure nodes  MAKE-QUEUE( MAKE-NODE(INITIALSTATE[problem])) :initialize search tree loop do if nodes is empty then return failure :no candidates to expand node  REMOVE-FRONT (nodes) :remove first node to expand if GOAL-TEST[problem] applied to STATE(node) succeeds then return node :if goal test is satisfied return node as the solution nodes  QUEUING-FN(node, EXPAND(node,OPERATORS[problem])) :otherwise find node’s successors and insert in to queue end

13 Definitions Branching Factor (b) The maximum number of successors to any node. Depth (d) The depth of the shallowest goal node Max Path Length (m) The maximum length of any path in the state space. Time Number of nodes generated during the search. Space The maximum number of nodes stored in memory.

14 Breadth-first Search (BFS) All nodes at a given depth are expanded before any nodes at a lower level are expanded. A B E C D I J K F Start node Level 1 Level 2 L Level 3 G H 1 2 3 4 6 5 7 8 9 Queuing: FIFO Queue : A Queue : B,C Queue : C, D Queue : D, E, F Queue : E, F, G, H Queue : F, G, H, I, J Queue : G, H, I, J, K, L A Queue : I, J, K, L Queue : J, K, L Queue : K, L A Queue : B Queue : C B D Queue : D CC Queue : E, F D Queue : F, G, H EE Queue : G, H, I, J F Queue : H, I, J, K, L F GG HH I I J Added queue Removed queue Expanded

15 Breadth-first Search Will always find solution but may not be the most efficient solution. Is it complete? What is the time complexity? What is the space complexity? Is it optimal?

16 Uniform-cost Search Expand node with least path cost first Means must insert nodes into queue by increasing path cost (PC). A B E C D I J F G H 1 2 3 4 5 J Queue : A Queue : C, B Queue : B, E, F Queue : D, E, F Queue : E, G, F, H Queue : J, G, F, I, H 10 5 1 7 PC: 10 + 1 = 11 PC: 5 + 7 = 12 10 PC: 5 + 10 = 15 3 PC: 11 + 3 = 14 NOTE: Node F is never expanded, therefore, nodes K & L from our BFS tree are never seen in this tree. 9 PC: 11 + 9 = 20 4 PC: 12 + 4 = 16 1 PC: 12 + 1 = 13 Queue : G, F, I, H Added queue Removed queue Expanded A Queue :Queue : B A C C Queue : E, F BB D D Queue : G, F, H EE

17 Uniform-cost Search Only concerned about the total path cost. Can it get into an infinite loop? Is it complete? How does the worst case time and space complexity compare to breadth-first search? Is it optimal?

18 Depth-first Search (DFS) Follows each path to the greatest depth before moving to the next path. A B E C D I J F Start node Level 1 Level 2 Level 3 G H 1 2 3 4 6 5 7 8 J Queuing: LIFO Queue : A Queue : B,C Queue : D, C Queue : G, H, C Queue : C Queue : E, F Queue : I, J, F Queue : J, F Queue : F 11 Added queue Removed queue Expanded Queue : AA Queue : C BB DD Queue : H, C GG H Queue : H C Queue : F C E E II

19 Depth-first Search What is a problem with this method? What are the space requirements? What is the worst case? What about the processing requirements? What is the worst case?

20 Depth-Limited Search Depth-first search with depth limit l i.e., cut off search at preset depth l Start node Level 1 Level 2 Level 3 Is this result the same as DFS? Let l = 3 What changes if l = 2? Added queue Removed queue Expanded A B E C D I J F G H 1 2 3 4 5 J Queue : A Queue : B,C Queue : D, C Queue : G, H, C Queue : C Queue : E, F Queue : I, J, F Queue : J, F Queue : F Queue : AA Queue : C BB DD Queue : H, C G H Queue : C Queue : F C E E I

21 Depth-limited Search Does this algorithm solve the infinite path problem? What happens if the goal is at a node below the depth limit? What does this mean for completeness? What happens if l is larger than d, the depth of the goal node? What is the diameter? How does it affect the depth limit?

22 Iterative deepening search Depth-first search that gradually increases the depth limit until the goal is found. Again combines DFS and BFS. A B E C D I J F G H J Limit = 0 Limit = 1 Queue : A Queue : B, C Queue : C Limit = 2 Queue : D, CQueue : E, F Queue : F Limit = 3 Queue : G, H, C Queue : H, C Queue : I, J, F Queue : J, F Added queue Removed queue Expanded Queue : A B C D E F G I H A B D E C 12 3 4 5 6 7 8 9

23 Iterative Deepening Search Combines the best of breadth-first and depth-first searches. What is this factor for breadth-first search? For depth-first search? What is the time complexity? Is iterative deepening faster than breadth- first? When is it best to apply this algorithm?

24 Some Conceptual Questions What is common between BFS and Uniform cost search? Not much; Uniform cost search is more like DFS. True or False What is a definite advantage of DFS over BFS? (choose 1) DFS is always faster than BFS. DFS will always find the optimal solution. DFS requires much less memory than BFS. None of the above

25 Some Conceptual Questions IDS is truly wasteful, because you keep generating the same nodes again and again. True – at the k th iteration, the root node will already have been generated k times. False: it does not have a significant effect on complexity of the search.

26 Uninformed Search Each of the algorithms discussed are considered uninformed search algorithms. Why? Is it possible to improve the search process if it was more intelligent?


Download ppt "Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state)."

Similar presentations


Ads by Google