Uniformed Search (cont.) Computer Science cpsc322, Lecture 6

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Notes Dijstra’s Algorithm Corrected syllabus.
Uninformed search strategies
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 14, 2012.
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.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Slide 1 Search: Advanced Topics Jim Little UBC CS 322 – Search 5 September 22, 2014 Textbook § 3.6.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 22, 2010.
Review: Search problem formulation
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.3 [P]: Searching Fall 2009 Marco Valtorta.
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.5) January, 21, 2009.
Uninformed Search (cont.)
Multiple Path Pruning, Iterative Deepening CPSC 322 – Search 7 Textbook § January 26, 2011.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
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
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Computer Science CPSC 322 Lecture 6 Analysis of A*, Search Refinements (Ch ) Slide 1.
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
Computer Science cpsc322, Lecture 7
Review: Tree search Initialize the frontier using the starting state
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Search: Advanced Topics Computer Science cpsc322, Lecture 9
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Branch & Bound, Summary of Advanced Topics
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSCE 580 Artificial Intelligence Ch.3 [P]: Searching
Uninformed Search Chapter 3.4.
Problem Solving by Searching
Artificial Intelligence (CS 370D)
Search: Advanced Topics Computer Science cpsc322, Lecture 9
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.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CS Fall 2016 (Shavlik©), Lecture 8, Week 5
CS 188: Artificial Intelligence Spring 2007
Computer Science cpsc322, Lecture 2
CS 188: Artificial Intelligence Fall 2008
Problem Solving and Searching
What to do when you don’t know anything know nothing
CSE 4705 Artificial Intelligence
EA C461 – Artificial Intelligence
Artificial Intelligence
Searching for Solutions
Problem Solving and Searching
Principles of Computing – UFCFA3-30-1
Computer Science cpsc322, Lecture 10
Search: Advanced Topics Computer Science cpsc322, Lecture 9
Iterative Deepening CPSC 322 – Search 6 Textbook § 3.7.3
CSE 473 University of Washington
More advanced aspects of search
Iterative Deepening and Branch & Bound
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Search Strategies CMPT 420 / CMPG 720.
Presentation transcript:

Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 16, 2013 Lecture 6 CPSC 322, Lecture 6

Uninformed Iterative Deepening (IDS) Search with Costs Lecture Overview Recap DFS vs BFS Uninformed Iterative Deepening (IDS) Search with Costs CPSC 322, Lecture 6

Search Strategies are different with respect to how they: Check what node on a path is the goal Initialize the frontier Add/remove paths from the frontier Check if a state is a goal Show AI space: Depth-first search isn't guaranteed to halt on graphs with cycles. Space complexity is linear CPSC 322, Lecture 5

Recap: Graph Search Algorithm Input: a graph, a start node, Boolean procedure goal(n) that tests if n is a goal node frontier:= [<s>: s is a start node]; While frontier is not empty: select and remove path <no,….,nk> from frontier; If goal(nk) return <no,….,nk>; For every neighbor n of nk add <no,….,nk, n> to frontier; end In what aspects DFS and BFS differ when we look at the generic graph search algorithm? CPSC 322, Lecture 6

When to use BFS vs. DFS? BFS DFS BFS DFS BFS DFS BFS DFS BFS DFS The search graph has cycles or is infinite We need the shortest path to a solution There are only solutions at great depth There are some solutions at shallow depth Memory is limited BFS DFS BFS DFS BFS DFS BFS DFS BFS DFS

Uninformed Iterative Deepening (IDS) Search with Costs Lecture Overview Recap DFS vs BFS Uninformed Iterative Deepening (IDS) Search with Costs CPSC 322, Lecture 6

Iterative Deepening (sec 3.6.3) How can we achieve an acceptable (linear) space complexity maintaining completeness and optimality? Complete Optimal Time Space DFS BFS Why not 0 2 4? So far all search strategies that are guaranteed to halt use exponential space. Increase the depth-bound when the search fails unnaturally (depth-bound was reached). Key Idea: let’s re-compute elements of the frontier rather than saving them. CPSC 322, Lecture 6

Iterative Deepening in Essence Look with DFS for solutions at depth 1, then 2, then 3, etc. If a solution cannot be found at depth D, look for a solution at depth D + 1. You need a depth-bounded depth-first searcher. Given a bound B you simply assume that paths of length B cannot be expanded…. Why not 0 2 4? So far all search strategies that are guaranteed to halt use exponential space. Increase the depth-bound when the search fails unnaturally (depth-bound was reached). CPSC 322, Lecture 6

. . . depth = 1 depth = 2 depth = 3 CPSC 322, Lecture 6 For b= 10, k = 5. BSF 111,111 and ID = 123,456 (only 11% more nodes) The larges b the better, but even with b = 2 the search ID will take only ~4 times as much as BFS Problem. When the branching factor is 1 at depth K, iterative deepening will Have searched k + (k-1) + (k-2) +….1 =k(k+1)/2 Iterative deepening is good when there is a large search space and the depth of the solution is not known. CPSC 322, Lecture 6

(Time) Complexity of Iterative Deepening Complexity of solution at depth m with branching factor b Total # of paths at that level #times created by BFS (or DFS) #times created by IDS If IDS returns a solution of length k why there cannot be a solution of length k-2?

(Time) Complexity of Iterative Deepening Complexity of solution at depth m with branching factor b Total # of paths generated bm + 2 bm-1 + 3 bm-2 + ..+ mb = bm (1+ 2 b-1 + 3 b-2 + ..+m b1-m )≤ How many times you create the nodes at that level For b= 10 and d = 5. BSF 111,111 and ID = 123,456 (only 11% more nodes) Iterative deepening is good when there is a large search space and the depth of the solution is not known. CPSC 322, Lecture 6

Uninformed Iterative Deepening (IDS) Search with Costs Lecture Overview Recap DFS vs BFS Uninformed Iterative Deepening (IDS) Search with Costs CPSC 322, Lecture 6

Example: Romania CPSC 322, Lecture 6

Search with Costs Sometimes there are costs associated with arcs. Definition (cost of a path) The cost of a path is the sum of the costs of its arcs: Definition (optimal algorithm) A search algorithm is optimal if, when it returns a solution, it is the one with minimal. In this setting we often don't just want to find just any solution we usually want to find the solution that minimizes cost Cost can be negative! CPSC 322, Lecture 6

Lowest-Cost-First Search At each stage, lowest-cost-first search selects a path on the frontier with lowest cost. The frontier is a priority queue ordered by path cost We say ``a path'' because there may be ties Example of one step for LCFS: the frontier is [p2, 5, p3, 7 , p1, 11, ] p2 is the lowest-cost node in the frontier “neighbors” of p2 are {p9, 10, p10, 15} What happens? p2 is selected, and tested for being a goal. Neighbors of p2 are inserted into the frontier Thus, the frontier is now [p3, 7 , p9, 10, p1, 11,  p10, 15]. ? ? is selected next. Etc. etc. Example with vancouver neighborhoods (simplified) Show that CPSC 322, Lecture 6

When arc costs are equal LCFS is equivalent to.. DFS BFS IDS None of the Above

Analysis of Lowest-Cost Search (1) Is LCFS complete? not in general: a cycle with zero or negative arc costs could be followed forever. yes, as long as arc costs are strictly positive Is LCFS optimal? Not in general. Why not? Arc costs could be negative: a path that initially looks high-cost could end up getting a ``refund''. However, LCFS is optimal if arc costs are guaranteed to be non-negative. CPSC 322, Lecture 6

Analysis of Lowest-Cost Search What is the time complexity, if the maximum path length is m and the maximum branching factor is b? The time complexity is O(bm): must examine every node in the tree. Knowing costs doesn't help here. What is the space complexity? Space complexity is O(bm): we must store the whole frontier in memory. The goal can be at the end of the longest path CPSC 322, Lecture 6

Learning Goals for Search (up to today) Apply basic properties of search algorithms: completeness, optimality, time and space complexity of search algorithms. Complete Optimal Time Space DFS BFS CPSC 322, Lecture 5

Learning Goals for Search (cont’) (up to today) Select the most appropriate search algorithms for specific problems. BFS vs DFS vs IDS vs BidirS- LCFS vs. BFS – A* vs. B&B vs IDA* vs MBA* Define/read/write/trace/debug different search algorithms With / Without cost Informed / Uninformed CPSC 322, Lecture 5

Beyond uninformed search…. What information we could use to better select paths from the frontier an estimate of the distance from the last node on the path to the goal an estimate of the distance from the start state to the goal an estimate of the cost of the path None of the above Not looking inside state at the end of the path Asking: How close is this to the goal? CPSC 322, Lecture 6

Next Class Start Heuristic Search (textbook.: start 3.6) CPSC 322, Lecture 6