G5BAIM Artificial Intelligence Methods Graham Kendall Blind Searches.

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Uninformed search strategies
Artificial Intelligence Solving problems by searching
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
G5AIAI Introduction to AI
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)
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies Reading: Russell’s Chapter 3 1.
Lets remember about Goal formulation, Problem formulation and Types of Problem. OBJECTIVE OF TODAY’S LECTURE Today we will discus how to find a solution.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence (CS 461D)
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Artificial Intelligence for Games Depth limited search Patrick Olivier
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2002.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
A* Search Introduction to AI. What is an A* Search? A greedy search method minimizes the cost to the goal by using an heuristic function, h(n). It works.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2004.
Introduction to Artificial Intelligence Heuristic Search Ruth Bergman Fall 2002.
Artificial Intelligence Methods Rao Vemuri Searching - 2.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2002.
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
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.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
Artificial Intelligence
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Lecture 3: Uninformed Search
G5BAIM Artificial Intelligence Methods Graham Kendall Searching.
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.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Artificial Intelligence Problem solving by searching.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches.
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;
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
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.
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)
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Problem Solving by Searching
Fahiem Bacchus © 2005 University of Toronto 1 CSC384: Intro to Artificial Intelligence Search II ● Announcements.
Solving problems by searching A I C h a p t e r 3.
Search 3.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2008 Lecture #2.
Artificial Intelligence Solving problems by searching.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Artificial Intelligence (CS 370D)
Problem Solving by Searching
Artificial Intelligence (CS 370D)
Solving problems by searching
A much More useful approach now that computation is fast
Searching for Solutions
Presentation transcript:

G5BAIM Artificial Intelligence Methods Graham Kendall Blind Searches

G5BAIM Blind Searches Blind Searches - Characteristics Simply searches the State Space Can only distinguish between a goal state and a non-goal state Sometimes called an uninformed search as it has no knowledge about its domain

G5BAIM Blind Searches Blind Searches - Characteristics Blind Searches have no preference as to which state (node) that is expanded next The different types of blind searches are characterised by the order in which they expand the nodes. This can have a dramatic effect on how well the search performs when measured against the four criteria we defined in an earlier lecture

G5BAIM Blind Searches Blind Searches - Why Use We may not have any domain knowledge we can give the search We may not want to implement a specific search for a given problem. We may prefer just to use a blind search

G5BAIM Blind Searches Map of Romania (simplified) Bucharest Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Rimnicu Vilcea Sibiu Pitesti Giurgui Urziceni Hirsova Eforie Vaslui Iasi Neamt Odarea Fararas

G5BAIM Blind Searches Breadth First Search - Method Expand Root Node First Expand all nodes at level 1 before expanding level 2 OR Expand all nodes at level d before expanding nodes at level d+1

G5BAIM Blind Searches Breadth First Search - Implementation Use a queueing function that adds nodes to the end of the queue Function BREADTH-FIRST-SEARCH(problem) returns a solution or failure Return GENERAL-SEARCH(problem,ENQUEUE-AT-END)

G5BAIM Blind Searches General Search - A Reminder 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 Blind Searches Evaluating Breadth First Search Observations –Very systematic –If there is a solution breadth first search is guaranteed to find it –If there are several solutions then breadth first search will always find the shallowest goal state first and if the cost of a solution is a non-decreasing function of the depth then it will always find the cheapest solution

G5BAIM Blind Searches Evaluating Breadth First Search Evaluating against four criteria –Complete?:Yes –Optimal?:Yes –Space Complexity:1 + b + b 2 + b b d i.e O(b d ) –Time Complexity:1 + b + b 2 + b b d i.e. O(b d ) –Where b is the branching factor and d is the depth of the search tree –Note : The space/time complexity could be less as the solution could be found anywhere on the d th level.

G5BAIM Blind Searches Exponential Growth Exponential growth quickly makes complete state space searches unrealistic If the branch factor was 10, by level 5 we would need to search 100,000 nodes (i.e )

G5BAIM Blind Searches Exponential Growth Time and memory requirements for breadth-first search, assuming a branching factor of 10, 100 bytes per node and searching 1000 nodes/second

G5BAIM Blind Searches Exponential Growth - Observations Space is more of a factor to breadth first search than time Time is still an issue. Who has 35 years to wait for an answer to a level 12 problem (or even 128 days to a level 10 problem) It could be argued that as technology gets faster then exponential growth will not be a problem. But even if technology is 100 times faster we would still have to wait 35 years for a level 14 problem and what if we hit a level 15 problem!

G5BAIM Blind Searches Uniform Cost Search (vs BFS) BFS will find the optimal (shallowest) solution so long as the cost is a function of the depth Uniform Cost Search can be used when this is not the case and uniform cost search will find the cheapest solution provided that the cost of the path never decreases as we proceed along the path Uniform Cost Search works by expanding the lowest cost node on the fringe.

G5BAIM Blind Searches Uniform Cost Search - Example S B G C A BFS will find the path SAG, with a cost of 11, but SBG is cheaper with a cost of 10 Uniform Cost Search will find the cheaper solution (SBG). It will find SAG but will not see it as it is not at the head of the queue

G5BAIM Blind Searches Depth First Search - Method Expand Root Node First Explore one branch of the tree before exploring another branch

G5BAIM Blind Searches Depth First Search - Implementation Use a queueing function that adds nodes to the front of the queue Function DEPTH-FIRST-SEARCH(problem) returns a solution or failure Return GENERAL-SEARCH(problem,ENQUEUE-AT-FRONT)

G5BAIM Blind Searches Depth First Search - Observations Only needs to store the path from the root to the leaf node as well as the unexpanded nodes. For a state space with a branching factor of b and a maximum depth of m, DFS requires storage of bm nodes Time complexity for DFS is b m in the worst case

G5BAIM Blind Searches Depth First Search - Observations If DFS goes down a infinite branch it will not terminate if it does not find a goal state. If it does find a solution there may be a better solution at a lower level in the tree. Therefore, depth first search is neither complete nor optimal.

G5BAIM Blind Searches Depth Limited Search (vs DFS) DFS may never terminate as it could follow a path that has no solution on it DLS solves this by imposing a depth limit, at which point the search terminates that particular branch

G5BAIM Blind Searches Depth Limited Search - Observations Can be implemented by the general search algorithm using operators which keep track of the depth Choice of depth parameter is important –Too deep is wasteful of time and space –Too shallow and we may never reach a goal state

G5BAIM Blind Searches Depth Limited Search - Observations If the depth parameter, l, is set deep enough then we are guaranteed to find a solution if one exists –Therefore it is complete if l>=d (d=depth of solution) Space requirements are O(bl) Time requirements are O(b l ) DLS is not optimal

G5BAIM Blind Searches Map of Romania Bucharest Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Rimnicu Vilcea Sibiu Pitesti Giurgui Urziceni Hirsova Eforie Vaslui Iasi Neamt Odarea Fararas On the Romania map there are 20 towns so any town is reachable in 19 steps In fact, any town is reachable in 9 steps

G5BAIM Blind Searches Iterative Deepening Search (vs DLS) The problem with DLS is choosing a depth parameter Setting a depth parameter to 19 is obviously wasteful if using DLS IDS overcomes this problem by trying depth limits of 0, 1, 2, …, n. In effect it is combining BFS and DFS

G5BAIM Blind Searches Iterative Deepening Search - Observations IDS may seem wasteful as it is expanding the same nodes many times. In fact, when b=10 only about 11% more nodes are expanded than for a BFS or a DLS down to level d Time Complexity = O(b d ) Space Complexity = O(bd) For large search spaces, where the depth of the solution is not known, IDS is normally the preferred search method

G5BAIM Blind Searches Repeated States - Three Methods Do not generate a node that is the same as the parent node Or Do not return to the state you have just come from Do not create paths with cycles in them. To do this we can check each ancestor node and refuse to create a state that is the same as this set of nodes

G5BAIM Blind Searches Repeated States - Three Methods Do not generate any state that is the same as any state generated before. This requires that every state is kept in memory (meaning a potential space complexity of O(b d )) The three methods are shown in increasing order of computational overhead in order to implement them

G5BAIM Blind Searches Blind Searches – Summary B = Branching factor D = Depth of solution M = Maximum depth of the search tree L = Depth Limit

G5BAIM Artificial Intelligence Methods Graham Kendall End of Blind Searches