Solving problems by searching

Slides:



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

INTRODUÇÃO AOS SISTEMAS INTELIGENTES
Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Artificial Intelligence Solving problems by searching
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
Blind Search1 Solving problems by searching Chapter 3.
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.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
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.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
CS 380: Artificial Intelligence Lecture #3 William Regli.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving problems by searching
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving problems by searching This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
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.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
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 Agents
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.
Pengantar Kecerdasan Buatan
Problem Solving by Searching
G5AIAI Introduction to AI
1 Solving problems by searching Chapter 3. 2 Outline Problem types Example problems Assumptions in Basic Search State Implementation Tree search Example.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
WEEK 5 LECTURE -A- 23/02/2012 lec 5a CSC 102 by Asma Tabouk Introduction 1 CSC AI Basic Search Strategies.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Solving problems by searching
State Space Representations and Search Algorithms
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Lecture 2: Problem Solving using State Space Representations
ECE 448 Lecture 4: Search Intro
Artificial Intelligence Lecture No. 6
Problem Solving by Searching
Problem Solving as Search
Problem solving and search
Artificial Intelligence
Solving problems by searching
Artificial Intelligence
Solving problems by searching
Solving problems by searching
Solving problems by searching
Solving Problems by Searching
Solving Problems by Searching
CS440/ECE 448 Lecture 4: Search Intro
Solving problems by searching
Presentation transcript:

Solving problems by searching First Lecture Today (Thu 30 Jun) Read Chapters 18.6.1-2, 20.3.1 Second Lecture Today (Thu 30 Jun) Read Chapter 3.1-3.4 Next Lecture (Tue 5 Jul) Chapters 3.5-3.7, 4.1-4.2 (Please read lecture topic material before and after each lecture on that topic)

You will be expected to know State-space search Definitions of a problem and of a solution State-space graph Tree-search (don’t remember visited nodes) vs. Graph-search (do remember them) States vs. nodes; node implementation Search strategy evaluation: Complete? Time/space complexity? Optimal? Parameters: b, d, m

Complete architectures for intelligence? Search? Solve the problem of what to do. Logic and inference? Reason about what to do. Encoded knowledge/”expert” systems? Know what to do. Learning? Learn what to do. Modern view: It’s complex & multi-faceted.

Search? Solve the problem of what to do. Formulate “What to do?” as a search problem. Solution to the problem tells agent what to do. If no solution in the current search space? Formulate and solve the problem of finding a search space that does contain a solution. Solve original problem in the new search space. Many powerful extensions to these ideas. Constraint satisfaction; means-ends analysis; planning; game playing; etc. Human problem-solving often looks like search.

Why Search? We are engaged in a bigger more important problem, and we hit a search sub-problem we need to solve. We need to search in order to solve it and then get back quickly to what we really wanted to do in the first place. To predict the result of our actions in the future. There are many sequences of actions, each with its utility; we wish to maximize our performance measure. We wish only to achieve a goal; by any means at all. We wish to find the best (optimal) way to achieve it.

Example: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: be in Bucharest Formulate problem: states: various cities actions: drive between cities or choose next city Find solution: sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest

Example: Romania

Environments Types Static / Dynamic Previous problem was static: no attention to changes in environment Observable / Partially Observable / Unobservable Previous problem was observable: it knew initial state. Deterministic / Stochastic Previous problem was deterministic: no new percepts were necessary, we can predict the future perfectly given our actions Discrete / continuous Previous problem was discrete: we can enumerate all possibilities

Why not Dijkstra’s Algorithm? Dijkstra’s algorithm inputs the entire graph. We want to search in unknown spaces. Essentially, we want to combine search with exploration. E.g., an autonomous rover on Mars must search an unknown space. D’s algorithm takes connections as given. We want to search based on agent’s actions, with unknown connections. E.g., a Web-crawler may not know what further connections are available on an unexplored URL before visiting it. E.g., the agent may not know the result of an action before trying it. D’s algorithm won’t work on infinite spaces. We want to search in infinite spaces. E.g., the logical reasoning space is infinite. E.g., the real world is essentially infinite to a human-size agent.

Example: vacuum world Observable, start in #5. Solution?

Example: vacuum world Observable, start in #5. Solution? [Right, Suck]

Vacuum world state space graph 5

Example: vacuum world Unobservable, start in {1,2,3,4,5,6,7,8} e.g., Solution?

Example: vacuum world Unobservable, start in {1,2,3,4,5,6,7,8} e.g., Solution? [Right,Suck,Left,Suck]

Problem Formulation A problem is defined by five items: initial state e.g., "at Arad“ actions Actions(s) = set of actions available in state s transition model Result(s,a) = state that results from action a in state s (alternative: successor function) S(s) = set of action–state pairs e.g., S(Arad) = {<Arad  Zerind, Sibiu, Timisoara>, … } goal test, e.g., s = "at Bucharest”, Checkmate(s) path cost (additive) e.g., sum of distances, number of actions executed, etc. c(x,a,y) is the step cost, assumed to be ≥ 0, summed to yield path cost A solution = sequence of actions leading from initial state to a goal state

Selecting a state space Real world is absurdly complex state space must be abstracted for problem solving (Abstract) state  set of real states (Abstract) action  complex combination of real actions e.g., "Arad  Zerind" represents a complex set of possible routes, detours, rest stops, etc. For guaranteed realizability, any real state "in Arad” must get to some real state "in Zerind” (Abstract) solution  set of real paths that are solutions in the real world Each abstract action should be "easier" than the original problem

Vacuum world state space graph states? discrete: dirt and robot location initial state? any actions? Left, Right, Suck goal test? no dirt at all locations path cost? 1 per action

Example: 8-Queens states? -any arrangement of n<=8 queens -or arrangements of n<=8 queens in leftmost n columns, 1 per column, such that no queen attacks any other (BETTER!!). initial state? no queens on the board actions? -add queen to any empty square -or add queen to leftmost empty square, such that it is not attacked by other queens (BETTER!!). goal test? 8 queens on the board, none attacked. path cost? 1 per move (not really relevant)

Example: robotic assembly states?: real-valued coordinates of robot joint angles parts of the object to be assembled initial state?: rest configuration actions?: continuous motions of robot joints goal test?: complete assembly path cost?: time to execute+energy used

Example: The 8-puzzle states? initial state? actions? goal test? path cost? Try yourselves

Example: The 8-puzzle states? locations of tiles initial state? given actions? move blank left, right, up, down goal test? goal state (given) path cost? 1 per move [Note: optimal solution of n-Puzzle family is NP-hard]

Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states). Every generated state is evaluated: is it a goal state?

Tree search example

Tree search example

Tree search example Note that we come back to Arad often, wasting time&work We will visit the same node often, wasting time&work

Repeated states Failure to detect repeated states can turn a linear problem into an exponential one! Test is often implemented as a hash table.

Solutions to Repeated States B S B C C C S B S State Space Example of a Search Tree Graph search never generate a state generated before must keep track of all possible states (uses a lot of memory) e.g., 8-puzzle problem, we have 9! = 362,880 states approximation for DFS/DLS: only avoid states in its (limited) memory: avoid infinite loops by checking path back to root. “visited?” test usually implemented as a hash table faster, but memory inefficient

Implementation: states vs. nodes A state is a (representation of) a physical configuration A node is a data structure constituting part of a search tree contains info such as: state, parent node, action, path cost g(x), depth The Expand function creates new nodes, filling in the various fields and using the SuccessorFn of the problem to create the corresponding states.

Search strategies A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: 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? Time and space complexity are measured in terms of b: maximum branching factor of the search tree d: depth of the least-cost solution m: maximum depth of the state space (may be ∞)

Summary Generate the search space by applying actions to the initial state and all further resulting states. Problem: initial state, actions, transition model, goal test, step/path cost Solution: sequence of actions to goal Tree-search (don’t remember visited nodes) vs. Graph-search (do remember them) Search strategy evaluation: b, d, m Complete? Time? Space? Optimal?