1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Review: Search problem formulation
Announcements Course TA: Danny Kumar
Uninformed search strategies
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
Lecture 3: Uninformed Search
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Uninformed (also called blind) search algorithms) This Lecture Chapter Next Lecture Chapter (Please read lecture topic material before.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies Reading: Russell’s Chapter 3 1.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
1 Blind (Uninformed) Search (Where we systematically explore alternatives) R&N: Chap. 3, Sect. 3.3–5.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence (CS 461D)
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
CS 188: Artificial Intelligence Spring 2006 Lecture 2: Queue-Based Search 8/31/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either.
Solving problems by searching
1 Lecture 3 Uninformed Search
PROBLEM SOLVING BY SEARCHING (1)
Lecture 3 Uninformed Search.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #3 Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam.
Artificial Intelligence
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Vilalta&Eick:Uninformed Search Problem Solving By Searching Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States/Looping.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Prof. Carla P. Gomes Module: Search I (Reading R&N: Chapter.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 3 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Problem Solving by Searching
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Problem Solving Agents
Problem Solving by Searching
Solving problems by searching
CS 188: Artificial Intelligence Spring 2007
Problem Solving and Searching
Problem Solving and Searching
Presentation transcript:

1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material

2 Problem Solving Agent Function

3 Problem Solving Agent Agent finds an action sequence to achieve a goal Requires problem formulation Determine goal Formulate problem based on goal Searches for an action sequence that solves the problem Actions are then carried out, ignoring percepts during that period

4 Problem Initial state Possible actions / Successor function Goal test Path cost function * State space can be derived from the initial state and the successor function

5 Example: Vacuum World Environment consists of two squares, A (left) and B (right) Each square may or may not be dirty An agent may be in A or B An agent can perceive whether a square is dirty or not An agent may move left, move right, suck dirt (or do nothing) Question: is this a complete PEAS description?

6 PEAS revisited Performance Measure: captures agent’s aspiration Environment: context, restrictions Actuators: indicates what the agent can carry out Sensors: indicates what the agent can perceive

7 Vacuum World Problem Initial state: configuration describing location of agent dirt status of A and B Successor function R, L, or S, causes a different configuration Goal test Check whether A and B are both not dirty Path cost Number of actions

8 State Space 2 possible locations x 2 x 2 combinations ( A is clean/dirty, B is clean/dirty ) = 8 states

9 Sample Problem and Solution Initial State: 2 Action Sequence: Suck, Left, Suck (brings us to which state?)

10 States and Successors

11 Example: 8-Puzzle Initial state: as shown Actions? successor function? Goal test? Path cost?

12 Example: 8-Queens Problem Position 8 queens on a chessboard so that no queen attacks any other queen Initial state? Successor function? Goal test? Path cost?

13 Example: Route-finding Given a set of locations, links (with values) between locations, an initial location and a destination, find the best route Initial state? Successor function? Goal test? Path cost?

14 Some Considerations Environment ought to be be static, deterministic, and observable Why? If some of the above properties are relaxed, what happens? Toy problems versus real-world problems

15 Searching for Solutions Searching through the state space Search tree rooted at initial state A node in the tree is expanded by applying successor function for each valid action Children nodes are generated with a different path cost and depth Return solution once node with goal state is reached

16 Tree-Search Algorithm

17 fringe: initially-empty container What is returned?

18 Search Strategy Strategy: specifies the order of node expansion Uninformed search strategies: no additional information beyond states and successors Informed or heuristic search: expands “more promising” states

19 Evaluating Strategies Completeness does it always find a solution if one exists? Time complexity number of nodes generated Space complexity maximum number of nodes in memory Optimality does it always find a least-cost solution?

20 Time and space complexity Expressed in terms of: b: branching factor depends on possible actions max number of successors of a node d: depth of shallowest goal node m: maximum path-length in state space

21 Uninformed Search Strategies Breadth-First Search Uniform-Cost Search Depth-First Search Depth-Limited Search Iterative Deepening Search

22 Breadth-First Search fringe is a regular first-in-first-out queue Start with initial state; then process the successors of initial state, followed by their successors, and so on… Shallow nodes first before deeper nodes Complete Optimal (if path-cost = node depth) Time Complexity: O(b + b 2 + b 3 + … + b d+1 ) Space Complexity: same

23 Uniform-Cost Search Prioritize nodes that have least path-cost (fringe is a priority queue) If path-cost = number of steps, this degenerates to BFS Complete and optimal As long as zero step costs are handled properly The route-finding problem, for example, have varying step costs Dijkstra’s shortest-path algorithm UCS Time and space complexity?

24 Depth-First Search fringe is a stack (last-in-first-out container) Go as deep as possible and then backtrack Often implemented using recursion Not complete and might not terminate Time Complexity: O(b m ) Space complexity: O(bm)

25 Depth-Limited Search DFS with a pre-determined depth-limit l Guaranteed to terminate Still incomplete Worse, we might choose l < m (shallowest goal node) Depth-limit l can be based on problem definition e.g., graph diameter in route-finding problem Time and space complexity depend on l

26 Iterative Deepening Search Depth-Limited Search for l = 0, 1, 2, … Stops when goal is found (when l becomes d) Complete and optimal (if path-cost = node-depth) Time and space complexity?

27 Comparing Search Strategies

28 Bi-directional Search Run two simultaneous searches One forward from initial state One backward from goal state Stops when node in one search is in fringe of the other search Rationale: two “half-searches” quicker than a full search Caveat: not always easy to search backwards

29 Caution: Repeated States Can occur specially in environments where actions are reversible Introduces the possibility of infinite search trees Time complexity blows up even with fixed depth limits Solution: detect repeated states by storing node history

30 Summary A problem is defined by its initial state, a successor function, a goal test, and a path cost function Problem’s environment state space Different strategies drive different tree- search algorithms that return a solution (action sequence) to the problem Coming up: informed search strategies