Example Search Problem A genetics professor – Wants to name her new baby boy – Using only the letters D,N & A Search through possible strings (states)

Slides:



Advertisements
Similar presentations
Artificial Intelligence 3. Search in Problem Solving
Advertisements

Review: Search problem formulation
Informed search algorithms
An Introduction to Artificial Intelligence
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Solving Problem by Searching
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
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.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
CMSC 471 Spring 2014 Class #4 Thu 2/6/14 Uninformed Search Professor Marie desJardins,
Search Strategies Reading: Russell’s Chapter 3 1.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
Chapter 4 Search Methodologies.
Artificial Intelligence (CS 461D)
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
1 Chapter 4 Search Methodologies. 2 Chapter 4 Contents l Brute force search l Depth-first search l Breadth-first search l Properties of search methods.
Artificial Intelligence Chapter 3: Solving Problems by Searching
Using Search in Problem Solving
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
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.
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Problem-solving agents
State-Space Searches.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
How are things going? Core AI Problem Mobile robot path planning: identifying a trajectory that, when executed, will enable the robot to reach the goal.
CS 416 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)
Chapter 3. Problem Solving Agents Looking to satisfy some goal Wants environment to be in particular state Have a number of possible actions An action.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Informed search algorithms
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Artificial Intelligence 3. Search in Problem Solving Course V231 Department of Computing Imperial College, London © Simon Colton.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
Advanced Artificial Intelligence Lecture 2: Search.
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
CSC3203: AI for Games Informed search (1) Patrick Olivier
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Informed Search CSE 473 University of Washington.
Artificial Intelligence Search Problem (2). Uninformed and informed searches Since we know what the goal state is like, is it possible get there faster?
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
EA C461 – Artificial Intelligence
Artificial Intelligence 3. Search in Problem Solving
Presentation transcript:

Example Search Problem A genetics professor – Wants to name her new baby boy – Using only the letters D,N & A Search through possible strings (states) – D,DN,DNNA,NA,AND,DNAN, etc. – 3 operators: add D, N or A onto end of string – Initial state is an empty string Goal test – Look up state in a book of boys’ names, e.g. DAN

Uninformed(غير معلوم) Search Strategies Breadth-first search Depth-first search Iterative deepening search Bidirectional search Uniform-cost search Also known as blind search

Breadth-First Search Every time a new state is reached – New states put on the bottom of the agenda When state “NA” is reached – New states “NAD”, “NAN”, “NAA” added to bottom – These get explored later (possibly much later) Graph analogy – Each node of depth d is fully expanded before any node of depth d+1 is looked at

Breadth-First Search Branching rate – Average number of edges coming from a node (3 above) Uniform Search – Every node has same number of branches (as above)

Depth-First Search Same as breadth-first search – But new states are put at the top of agenda Graph analogy – Expand deepest and leftmost node next But search can go on indefinitely down one path – D, DD, DDD, DDDD, DDDDD, … One solution to impose a depth limit on the search – Sometimes the limit is not required Branches end naturally (i.e. cannot be expanded)

Depth-First Search (Depth Limit 4)

State- or Action-Based Definition? Alternative ways to define strategies Agenda stores (state, action) rather than state – Records “actions to perform” – Not “nodes expanded” Only performs necessary actions Changes node order Textbook is state-oriented – Online notes action-oriented

Depth- v. Breadth-First Search Suppose branching rate b Breadth-first – Complete (guaranteed to find solution) – Requires a lot of memory At depth d needs to remember up to b d-1 states Depth-first – Not complete because of indefinite paths or depth limit – But is memory efficient Only needs to remember up to b*d states

Iterative Deepening Search Idea: do repeated depth first searches – Increasing the depth limit by one every time – DFS to depth 1, DFS to depth 2, etc. – Completely re-do the previous search each time Most DFS effort is in expanding last line of the tree Combines best of BFS and DFS – Complete and memory efficient – But slower than either

Bidirectional Search If you know the solution state – Work forwards and backwards – Look to meet in middle Only need to go to half depth Difficulties – Do you really know solution? Unique? – Must be able to reverse operators – Record all paths to check they meet Memory intensive Liverpool London Nottingham Leeds Birmingham Manchester Peterborough

Action and Path Costs Action cost – Particular value associated with an action Examples – Distance in route planning – Power consumption in circuit board construction Path cost – Sum of all the action costs in the path – If action cost = 1 (always), then path cost = path length

Uniform (منظمة)-Cost Search Breadth-first search – Guaranteed to find the shortest path to a solution – Not necessarily the least costly path Uniform path cost search – Choose to expand node with the least path cost Guaranteed to find a solution with least cost – If we know that path cost increases with path length This method is optimal and complete – But can be very slow

Informed (معروفه مسبقا) Search Strategies Greedy search A* search IDA* search Hill climbing Simulated annealing Also known as heuristic search – require heuristic function

Best-First Search Evaluation function f gives cost for each state – Choose state with smallest f(state) (‘the best’) – Agenda: f decides where new states are put – Graph: f decides which node to expand next Many different strategies depending on f – For uniform-cost search f = path cost – Informed search strategies defines f based on heuristic function

Heuristic Functions Estimate of path cost h – From state to nearest solution – h(state) >= 0 – h(solution) = 0 Strategies can use this information Example: straight line distance – As the crow flies in route finding Where does h come from? – maths, introspection, inspection or programs (e.g. ABSOLVER) Liverpool Nottingham Leeds Peterborough London

Greedy Search Always take the biggest bite f(state) = h(state) – Choose smallest estimated cost to solution Ignores the path cost Blind alley effect: early estimates very misleading – One solution: delay the use of greedy search Not guaranteed to find optimal solution – Remember we are estimating the path cost to solution

A* Search Path cost is g and heuristic function is h – f(state) = g(state) + h(state) – Choose smallest overall path cost (known + estimate) Combines uniform-cost and greedy search Can prove that A* is complete and optimal – But only if h is admissible, i.e. underestimates the true path cost from state to solution – See Russell and Norvig for proof

A* Example: Route Finding First states to try: – Birmingham, Peterborough f(n) = distance from London + crow flies distance from state – i.e., solid + dotted line distances – f(Peterborough) = = 275 – f(Birmingham) = = 280 Hence expand Peterborough – But must go through Leeds from Notts – So later Birmingham is better Liverpool Nottingham Leeds Peterborough London Birmingham

IDA* Search Problem with A* search – You have to record all the nodes – In case you have to back up from a dead-end A* searches often run out of memory, not time Use the same iterative deepening trick as IDS – But iterate over f(state) rather than depth – Define contours: f < 100, f < 200, f < 300 etc. Complete & optimal as A*, but less memory

IDA* Search: Contours Find all nodes – Where f(n) < 100 – Ignore f(n) >= 100 Find all nodes – Where f(n) < 200 – Ignore f(n) >= 200 And so on…