Searching for Solutions Artificial Intelligence CMSC 25000 January 15, 2008.

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
Solving problems by searching Chapter 3 Artificial Intelligent Team Teaching AI (created by Dewi Liliana) PTIIK 2012.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Problem Solving and Search Andrea Danyluk September 9, 2013.
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.
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.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence Chapter 3: Solving Problems by Searching
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Searching for Solutions Artificial Intelligence CSPP January 14, 2004.
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.
Search: Heuristic &Optimal Artificial Intelligence CMSC January 16, 2003.
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.
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.
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.
Advanced Artificial Intelligence Lecture 2: Search.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Problem Solving Agents
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.
Pengantar Kecerdasan Buatan
Searching for Solutions
Solving problems by searching A I C h a p t e r 3.
1 Solving problems by searching Chapter 3. 2 Outline Problem types Example problems Assumptions in Basic Search State Implementation Tree search Example.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
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
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
ECE 448 Lecture 4: Search Intro
Problem Solving by Searching
Problem Solving as Search
Artificial Intelligence
Solving problems by searching
Solving problems by searching
Lecture 1B: Search.
Artificial Intelligence
Solving problems by searching
Solving problems by searching
Solving problems by searching
Solving problems by searching
Presentation transcript:

Searching for Solutions Artificial Intelligence CMSC January 15, 2008

Agenda Search – Motivation –Problem-solving agents –Rigorous problem definitions Blind exhaustive search: –Breadth-first search –Uniform search –Depth-first search –Iterative deepening search Search analysis –Computational cost, limitations

Problem-Solving Agents Goal-based agents –Identify goal, sequence of actions that satisfy Goal: set of satisfying world states –Precise specification of what to achieve Problem formulation: –Identify states and actions to consider in achieving goal –Given a set of actions, consider sequence of actions leading to a state with some value Search: Process of looking for sequence –Problem -> action sequence solution

Agent Environment Specification ● Dimensions – Fully observable vs partially observable: Fully – Deterministic vs stochastic: Deterministic – Static vs dynamic: Static – Discrete vs continuous: Discrete ● Issues?

Closer to Reality Sensorless agents (conformant problems) –Replace state with “belief state” Multiple physical states, successors:sets of successors Partial observability (contigency problems) –Solution is tree, branch chosen based on percepts

Example: vacuum world Single-state, start in #5. Solution?

Example: vacuum world Single-state, start in #5. Solution? [Right, Vacuum] Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution?

Example: vacuum world Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution? [Right,Vacuum,Left,Vacuum] Contingency –Nondeterministic: Vacuum may dirty a clean carpet –Partially observable: location, dirt at current location. –Percept: [L, Clean], i.e., start in #5 or #7 Solution?

Example: vacuum world Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution? [Right,Vacuum,Left,Vacuum] Contingency –Nondeterministic: Vacuum may dirty a clean carpet –Partially observable: location, dirt at current location. –Percept: [L, Clean], i.e., start in #5 or #7 Solution? [Right, if dirt then Vacuum]

Formal Problem Definitions Key components: –Initial state: E.g. First location –Available actions: Successor function: reachable states –Goal test: Conditions for goal satisfaction –Path cost: Cost of sequence from initial state to reachable state Solution: Path from initial state to goal –Optimal if lowest cost

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

Why Search? Not just city route search –Many AI problems can be posed as search Planning: –Vertices: World states; Edges: Actions Game-playing: –Vertices: Board configurations; Edges: Moves Speech Recognition: –Vertices: Phonemes; Edges: Phone transitions

Vacuum world state space graph states? actions? goal test? path cost?

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

Example: The 8-puzzle states? actions? goal test? path cost?

Example: The 8-puzzle states? locations of tiles 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]

Example: robotic assembly states?: real-valued coordinates of robot joint angles, parts of the object to be assembled actions?: continuous motions of robot joints goal test?: complete assembly path cost?: time to execute

Basic Search Algorithm Form a 1-element queue of 0 cost=root node Until first path in queue ends at goal or no paths –Remove 1st path from queue; extend path one step –Reject all paths with loops –Add new paths to queue If goal found=>success; else, failure Paths to extend Order of paths added Position new paths added

Basic Search Problem Vertices: Cities; Edges: Steps to next, distance Find route from S(tart) to G(oal) SDAEBCFG

Formal Statement Initial State: in(S) Successor function: –Go to all neighboring nodes Goal state: in(G) Path cost: –Sum of edge costs

Blind Search Need SOME route from S to G –Assume no information known –Depth-first search, breadth-first search, uniform-cost search, iterative deepening search Convert search problem to search tree –Root=Zero length path at Start –Node=Path: label by terminal node Child one-step extension of parent path

Search Tree SADBDCEDFGEFBGCEABDEFGBFACG

Breadth-first Search Explore all paths to a given depth SADBDAECEEBBFDFBFDEACG

Breadth-first Search Algorithm Form a 1-element queue of 0 cost=root node Until first path in queue ends at goal or no paths –Remove 1st path from queue; extend path one step –Reject all paths with loops –Add new paths to BACK of queue If goal found=>success; else, failure

Analyzing Search Algorithms Criteria: –Completeness: Finds a solution if one exists –Optimal: Find the best (least cost) solution –Time complexity: Order of growth of running time –Space complexity: Order of growth of space needs BFS: –Complete: yes; Optimal: only if # steps= cost –Time complexity: O(b^d+1); Space: O(b^d+1)

Uniform-cost Search BFS: –Extends path with fewest steps UCS: –Extends path with least cost Analysis: –Complete?: Yes; Optimal?: Yes –Time: O(b^(C*/e)); Space: O(b^(C*/e))

Uniform-cost Search Algorithm Form a 1-element queue of 0 cost=root node Until first path in queue ends at goal or no paths –Remove 1st path from queue; extend path one step –Reject all paths with loops –Add new paths to queue –Sort paths in order of increasing length If goal found=>success; else, failure

Depth-first Search Pick a child of each node visited, go forward –Ignore alternatives until exhaust path w/o goal SABCEDFG

Depth-first Search Algorithm Form a 1-element queue of 0 cost=root node Until first path in queue ends at goal or no paths –Remove 1st path from queue; extend path one step –Reject all paths with loops –Add new paths to FRONT of queue If goal found=>success; else, failure

Search Issues Breadth-first search: –Good if many (effectively) infinite paths, b<< –Bad if many end at same short depth, b>> Uniform-cost search: –Tries paths with many short steps first –Identical to BFS if all steps same cost Depth-first search: –Good if: most partial=>complete, not too long –Bad if many (effectively) infinite paths

Iterative Deepening Problem: –DFS good space behavior Could go down blind path, or sub-optimal Solution: –Search at progressively greater depths: 1,2,3,4,5…..

Progressive Deepening Question: Aren’t we wasting a lot of work? –E.g. cost of intermediate depths Answer: (surprisingly) No! –Most nodes at fringe –Fringe (depth d): Cost = b^d –Preceding depths: b^0 + b^1+…b^(d-1) (b^d - 1)/(b -1) –Ratio of last ply cost/all preceding ~ b - 1 –For large branching factors, prior work small relative to maximum depth

Heuristic Search A little knowledge is a powerful thing –Order choices to explore better options first –More knowledge => less search –Better search alg?? Better search space Measure of remaining cost to goal-heuristic –E.g. actual distance => straight-line distance S D A E BC F G

Hill-climbing Search Select child to expand that is closest to goal S A 10.4 D 8.9 A 10.4 E 6.9 B 6.7 F 3.0 G

Hill-climbing Search Algorithm Form a 1-element queue of 0 cost=root node Until first path in queue ends at goal or no paths –Remove 1st path from queue; extend path one step –Reject all paths with loops –Sort new paths by estimated distance to goal –Add new paths to FRONT of queue If goal found=>success; else, failure

Beam Search Breadth-first search of fixed width - top w –Guarantees limited branching factor, E.g. w=2 S A D BD AE CE BF ACG

Beam Search Algorithm –Form a 1-element queue of 0 cost=root node –Until first path in queue ends at goal or no paths Extend all paths one step Reject all paths with loops Sort all paths in queue by estimated distance to goal –Put top w in queue –If goal found=>success; else, failure

Best-first Search Expand best open node ANYWHERE in tree –Form a 1-element queue of 0 cost=root node –Until first path in queue ends at goal or no paths Remove 1st path from queue; extend path one step Reject all paths with loops Put in queue Sort all paths by estimated distance to goal –If goal found=>success; else, failure

Heuristic Search Issues Parameter-oriented hill climbing –Make one step adjustments to all parameters E.g. tuning brightness, contrast, r, g, b on TV –Test effect on performance measure Problems: –Foothill problem: aka local maximum All one-step changes - worse!, but not global max –Plateau problem: one-step changes, no FOM + –Ridge problem: all one-steps down, but not even local max Solution (local max): Randomize!!

Summary Blind search: –Find some path to goal –Depth-first, Breadth-first –Iterative Deepening Analyzing search algorithms –Completeness, Optimality, Time, Space Next time: –A little knowledge is a useful thing...

Search Costs