Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Announcements Course TA: Danny Kumar
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
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.
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)
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.
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.
Artificial Intelligence for Games Uninformed search Patrick Olivier
CSC 423 ARTIFICIAL INTELLIGENCE
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.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
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]
Problem Solving and Search in AI Heuristic Search
Using Search in Problem Solving
Solving problems by searching
Solving Problems by Searching
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Problem Solving and Search Andrea Danyluk September 11, 2013.
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.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
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.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
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
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.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
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.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
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.
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
For Monday Read chapter 4 exercise 1 No homework.
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.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
Problem Solving Agents
Last time: Problem-Solving
Problem Solving by Searching
Artificial Intelligence Problem solving by searching CSC 361
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.
Solving problems by searching
Searching for Solutions
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Presentation transcript:

Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search

Comp 307 Motivation Intelligence as problem solving Examples of problems: – The Monkey and Bananas Problem – The Missionaries and Cannibals Problem – The 8-puzzle – The Tower of Hanoi – Route finding – Water jug – Wolf, Goat and Cabbage – Chess – Bridge – Go

Comp 307 Problem definition Problem solving as State Space Search State: a state of the world. State space: Collection of all possible states Initial state: where the search starts Goal state: where the search stops Operators: Links between pairs of states, that is, what actions can be taken in any state to get to a new state. A path in the state space is a sequence of operators leading from one state to another Solve problem by searching for path from initial state to goal state through legal states. Each operator has an associated cost. Path cost: the sum of the costs of operators along the path.

Comp puzzle States: location of the 8 tiles Operators: blank moves left, right, up, or down Path cost: length of path Initial StateGoal State

Comp 307 Route finding State: current location on map – Initial state: city A – Goal state: city B Operators: move along a road to another location Path cost: sum on lengths of road A simplified road map of Romania

Comp 307 Search Strategies Uninformed (blind) search – Breadth first – Uniform cost – Depth first – Depth limited – Iterative deepening – Bidirectional Heuristic search – A * – Greedy Best first – Hill climbing – Beam search – …

Comp 307 Search Tree left down up leftdown

Comp 307 General search algorithm We collect the nodes in a queue loop If the queue is empty then return failure Take the first node from the front of the queue If the node represents the goal state then return success Else expand the node and put the children notes on the queue (reorder the queue) end loop

Comp 307 Criteria for search strategies Completeness : is the strategy guaranteed to find a solution when one exists? Optimality : does the strategy find the highest-quality solution (lowest cost) when there are several solutions? Time complexity : how long does it take to find a solution? Space complexity : how much memory does it need to perform the search?

Comp 307 Breadth first search Start at the initial state; Find all states reachable from the initial state; Find all states reachable from the states available at the previous step; Repeat the previous step until the final state is reached; Implement with General-Search and Enqueue-at-End One must be careful not to repeatedly visit states that have been seen before.

Comp 307 Issues for Breadth-first Search Breadth-first search is guaranteed to find the shortest path – Complete – Optimal if all operators have same cost (so shallowest solution is cheapest solution) In practice, breadth-first search is very expensive – Time complexity O(b d ) – Space complexity O(b d ) b: the branching factor of nodes (ie, average number of children a node has) d: the depth of the desired solution

Comp 307 Uniform cost search Expand lowest cost nodes first Implement with General-Search and Enqueue-By-Cost SG A B C

Comp 307 Issues for Uniform Cost Search Same as breadth-first search if all operators have the same cost Complete Optimal if all operators have positive cost Time Complexity O(b d ) Space Complexity O(b d )

Comp 307 Depth-first search Ô Make the initial state the current state; Ô If current state is a final state then succeed – else make the current state a state reachable from the current state; Ô Repeat previous step until success, backtracking if necessary; Implement with General-Search and Enqueue-at-Start

Comp 307 Depth-first search in Prolog :- use_module(library(lists)). solve(InitialState, GoalState) :- search(InitialState, GoalState, [], Plan), displayPlan(Plan). search(State, State, _, []). search(Init, Goal, StatesSoFar, [Step|Rest]) :- transform(Init,Step,NewState), \+member(NewState, StatesSoFar), search(NewState, Goal, [NewState|StatesSoFar], Rest). displayPlan([]) :- format("~nDone", []), nl. displayPlan([Step|Rest]) :- format("~n do ~w", [Step]), displayPlan(Rest).

Comp 307 Issues for Depth-first Search Depth-first search is prone to being lost – Complete only if search tree is finite – Not optimal In practice, depth-first search is efficient – Time Complexity O(b m ) – Space Complexity O(bm) (m=max depth of search tree) Good when many solutions in deep (but finite) trees

Comp 307 Depth limited search: Like depth-first, but with depth cut off Complete only if solution is at – depth <= c where c is the depth limit Not optimal Time complexity O(b c) Space complexity O(bc)

Comp 307 Iterative deepening search Iterative depth limited search Limit= 0, Limit=1, Limit=2, Limit=3, … a b c d efg hi j kl n mo

Comp 307 Iterative deepening search Optimal and Complete (if operators all have same cost) Time complexity O(b d ) Space complexity O(bd) Expands some nodes multiple times – But “wasted” effort is actually quite small and goes down as the branching factor goes up In general, iterative deepening is the preferred search method when there is a large search space and the depth of the solution is not known.

Comp 307 Bidirectional Search Two breadth-first search Complete and optimal Time complexity O(b d/2 ) Space complexity O(b d/2 ) Not applicable for some problems