G5BAIM Artificial Intelligence Methods

Slides:



Advertisements
Similar presentations
Solving problems by searching
Advertisements

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.
G5AIAI Introduction to AI
G5BAIM Artificial Intelligence Methods Graham Kendall Blind Searches.
Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence for Games Uninformed search Patrick Olivier
CSC 423 ARTIFICIAL INTELLIGENCE
Artificial Intelligence (CS 461D)
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
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?
Artificial Intelligence Methods Rao Vemuri Searching - 2.
Solving problems by searching
Problem-solving agents
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Informed Search Idea: be smart about what paths to try.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Do you drive? Have you thought about how the route plan is created for you in the GPS system? How would you implement a cross-and- nought computer program?
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.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
G5BAIM Artificial Intelligence Methods Graham Kendall Searching.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Solving problems by searching A I C h a p t e r 3.
G5AIAI Introduction to AI
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.
Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
ARTIFICIAL INTELLIGENCE
Recall: breadth-first search, step by step
Last time: Problem-Solving
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Introduction to Artificial Intelligence
Artificial Intelligence Lecture No. 6
Problem Solving by Searching
Problem solving and search
Artificial Intelligence (CS 370D)
Breadth-First Searches
Artificial Intelligence Problem solving by searching CSC 361
Artificial Intelligence
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
SOLVING PROBLEMS BY SEARCHING
Problem Solving and Searching
Searching for Solutions
Breadth-First Searches
Artificial Intelligence
Problem Solving and Searching
Depth-First Searches Introduction to AI.
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
A General Backtracking Algorithm
Artificial Intelligence
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
Supplemental slides for CSE 327 Prof. Jeff Heflin
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
ARTIFICIAL INTELLIGENCE
Heuristic Search Generate and Test Hill Climbing Best First Search
HW 1: Warmup Missionaries and Cannibals
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Informed Search Idea: be smart about what paths to try.
Solving Problems by Searching
Supplemental slides for CSE 327 Prof. Jeff Heflin
Depth-First Searches.
Presentation transcript:

G5BAIM Artificial Intelligence Methods Graham Kendall Searching

Initial State Operator Problem Definition - 1 Initial State The initial state of the problem, defined in some suitable manner Operator A set of actions that moves the problem from one state to another

Neighbourhood (Successor Function) Problem Definition - 1 Neighbourhood (Successor Function) The set of all possible states reachable from a given state State Space The set of all states reachable from the initial state

Problem Definition - 2 Goal Test A test applied to a state which returns if we have reached a state that solves the problem Path Cost How much it costs to take a particular path

Problem Definition - Example 5 4 6 1 8 7 3 2 1 4 7 2 5 8 3 6 1 2 3 4 5 6 7 8 1 2 3 8 4 7 6 5 Initial State Goal State

Problem Definition - Example States A description of each of the eight tiles in each location that it can occupy. It is also useful to include the blank Operators The blank moves left, right, up or down

Problem Definition - Example Goal Test The current state matches a certain state (e.g. one of the ones shown on previous slide) Path Cost Each move of the blank costs 1

Problem Definition - Datatype Datatype PROBLEM Components INITIAL-STATE, OPERATORS, GOAL-TEST, PATH-COST-FUNCTION

Does our search method actually find a solution? How Good is a Solution? Does our search method actually find a solution? Is it a good solution? Path Cost Search Cost (Time and Memory) Does it find the optimal solution? But what is optimal?

Completeness Time Complexity Evaluating a Search Completeness Is the strategy guaranteed to find a solution? Time Complexity How long does it take to find a solution?

Space Complexity Optimality Evaluating a Search Space Complexity How much memory does it take to perform the search? Optimality Does the strategy find the optimal solution where there are several solutions?

Search Trees x o ………..

ISSUES Search trees grow very quickly The size of the search tree is governed by the branching factor Even this simple game has a complete search tree of 984,410 potential nodes The search tree for chess has a branching factor of about 35

Implementing a Search - What we need to store State This represents the state in the state space to which this node corresponds Parent-Node This points to the node that generated this node. In a data structure representing a tree it is usual to call this the parent node

Implementing a Search - What we need to store Operator The operator that was applied to generate this node Depth The number of nodes from the root (i.e. the depth) Path-Cost The path cost from the initial state to this node

Implementing a Search - Datatype Datatype node Components: STATE, PARENT-NODE, OPERATOR, DEPTH, PATH-COST

Using a Tree – The Obvious Solution? Advantages It’s intuitive Parent’s are automatically catered for

Using a Tree – The Obvious Solution? But It can be wasteful on space It can be difficult the implement, particularly if there are varying number of children (as in tic-tac-toe) It is not always obvious which node to expand next. We may have to search the tree looking for the best leaf node (sometimes called the fringe or frontier nodes). This can obviously be computationally expensive

Using a Tree – Maybe not so obvious Therefore It would be nice to have a “simpler” data structure to represent our tree And it would be nice if the next node to be expanded was an O(1) operation

Basic Queue Operations Make-Queue(Elements) Create a queue with the given elements Empty?(Queue) Returns true if the queue is empty Remove-Front(Queue) Removes the element at the head of the queue and returns it

Queue Operations - Adding Elements Queuing-FN(Elements,Queue) Inserts a set of elements into the queue. Different queuing functions produce different search algorithms.

End Function General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

General Search Loop do End Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

If nodes is empty then return failure General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

node = REMOVE-FRONT(nodes) General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

If GOAL-TEST[problem] applied to STATE(node) succeeds then return node General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) General Search Function GENERAL-SEARCH(problem, QUEUING-FN) returns a solution or failure nodes = MAKE-QUEUE(MAKE-NODE(INITIAL-STATE[problem])) Loop do If nodes is empty then return failure node = REMOVE-FRONT(nodes) If GOAL-TEST[problem] applied to STATE(node) succeeds then return node nodes = QUEUING-FN(nodes,EXPAND(node,OPERATORS[problem])) End End Function

G5BAIM Artificial Intelligence Methods Graham Kendall End of Searching