Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search

Similar documents
CSCI 446: Artificial Intelligence

CSEP 573 Artificial Intelligence Winter 2016

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence

CS 221: Artificial Intelligence Fall 2011

AI Adjacent Fields. This slide deck courtesy of Dan Klein at UC Berkeley

CSC 2114: Artificial Intelligence Search

Announcements. Project 0: Python Tutorial Due last night

Uninformed Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 31 Jan 2012

CS 188: Ar)ficial Intelligence

CSE 473: Ar+ficial Intelligence

CS 4100 // artificial intelligence

Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. General Tree Search. Uniform Cost. Lecture 3: A* Search 9/4/2007

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem

521495A: Artificial Intelligence

CS 5522: Artificial Intelligence II

PEAS: Medical diagnosis system

CS 188: Artificial Intelligence Fall 2008

Graph Search. Chris Amato Northeastern University. Some images and slides are used from: Rob Platt, CS188 UC Berkeley, AIMA

Uninformed search strategies (Section 3.4) Source: Fotolia

Ma/CS 6b Class 1: Graph Recap

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics,

CS201 Discussion 10 DRAWTREE + TRIES

Warm- up. IteraAve version, not recursive. class TreeNode TreeNode[] children() boolean isgoal() DFS(TreeNode start)

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Ma/CS 6b Class 1: Graph Recap

LING/C SC/PSYC 438/538. Lecture 21 Sandiway Fong

What are suffix trees?

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday

ITEC2620 Introduction to Data Structures

UNIT 11. Query Optimization

Dynamic Programming. Andreas Klappenecker. [partially based on slides by Prof. Welch] Monday, September 24, 2012

Complete Coverage Path Planning of Mobile Robot Based on Dynamic Programming Algorithm Peng Zhou, Zhong-min Wang, Zhen-nan Li, Yang Li

Section 10.4 Hyperbolas

Regular Expression Matching with Multi-Strings and Intervals. Philip Bille Mikkel Thorup

Section 3.1: Sequences and Series

Uninformed search strategies

Lexical Analysis: Constructing a Scanner from Regular Expressions

CS 188: Artificial Intelligence. Recap Search I

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

The Distributed Data Access Schemes in Lambda Grid Networks

Stack. A list whose end points are pointed by top and bottom

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

UNINFORMED SEARCH. What to do if teammates drop? Still have 3 or more? No problem keep going. Have two or fewer and want to be merged?

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

CS 343: Artificial Intelligence

Uninformed Search Strategies

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

ECE 468/573 Midterm 1 September 28, 2012

Uninformed Search Strategies AIMA 3.4

Announcements. CS 188: Artificial Intelligence

Presentation Martin Randers

CSCI 446: Artificial Intelligence

CS 130 : Computer Systems - II. Shankar Balachandran Dept. of Computer Science & Engineering IIT Madras

Improved Fast Replanning for Robot Navigation in Unknown Terrain

Topic: Software Model Checking via Counter-Example Guided Abstraction Refinement. Having a BLAST with SLAM. Combining Strengths. SLAM Overview SLAM

Finite Automata. Lecture 4 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 21, 2015

Some Thoughts on Grad School. Undergraduate Compilers Review and Intro to MJC. Structure of a Typical Compiler. Lexing and Parsing

CS 331: Artificial Intelligence Uninformed Search. Real World Search Problems

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe

CS 331: Artificial Intelligence Uninformed Search. Real World Search Problems

CS 331: Artificial Intelligence Uninformed Search. Leftovers from last time

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

ARTIFICIAL INTELLIGENCE (CSC9YE ) LECTURES 2 AND 3: PROBLEM SOLVING

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Lecture 3. Uninformed Search

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

Dr. D.M. Akbar Hussain

Tree Structured Symmetrical Systems of Linear Equations and their Graphical Solution

Search: Advanced Topics and Conclusion

ARTIFICIAL INTELLIGENCE. Pathfinding and search

A New Learning Algorithm for the MAXQ Hierarchical Reinforcement Learning Method

Integration. September 28, 2017

An introduction to model checking

Intermediate Information Structures

CS 268: IP Multicast Routing

Knowledge States: A Tool in Randomized Online Algorithms

From Indexing Data Structures to de Bruijn Graphs

INTRODUCTION TO SIMPLICIAL COMPLEXES

CS540 Uninformed Search

Uninformed Search. CPSC 322 Lecture 5. September 14, 2007 Textbook 2.4. Graph Search Searching Depth-First Search

Artificial Intelligence Informed Search

CS 188: Artificial Intelligence Fall Search Gone Wrong?

COMP 423 lecture 11 Jan. 28, 2008

Artificial Intelligence: Search Part 1: Uninformed graph search

521495A: Artificial Intelligence

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

From Dependencies to Evaluation Strategies

COMBINATORIAL PATTERN MATCHING

PAC-MAN is one of the most popular game

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

CS 188: Artificial Intelligence

Artificial Intelligence

Lecture Overview. Knowledge-based systems in Bioinformatics, 1MB602. Procedural abstraction. The sum procedure. Integration as a procedure

Uninformed Search Strategies AIMA

Chapter 4. Uninformed Search Strategies

Transcription:

Uninformed Serch [These slides were creted by Dn Klein nd Pieter Abbeel for CS188 Intro to AI t UC Berkeley. All CS188 mterils re vilble t http://i.berkeley.edu.]

Tody Serch Problems Uninformed Serch Methods Depth-First Serch Bredth-First Serch Uniform-Cost Serch

Serch Problems A serch problem consists of: A stte spce A successor function (with ctions, costs) A strt stte nd gol test N, 1.0 E, 1.0 A solution is sequence of ctions ( pln) which trnsforms the strt stte to gol stte

Serch Problems Are Models

Exmple: Trveling in Romni Stte spce: Cities Successor function: Rods: Go to djcent city with cost = distnce Strt stte: Ard Gol test: Is stte == Buchrest? Solution?

Wht s in Stte Spce? The world stte includes every lst detil of the environment A serch stte keeps only the detils needed for plnning (bstrction) Problem: Pthing Sttes: (x,y) loction Actions: NSEW Successor: updte loction only Gol test: is (x,y)=end Problem: Et-All-Dots Sttes: {(x,y), dot boolens} Actions: NSEW Successor: updte loction nd possibly dot boolen Gol test: dots ll flse

Stte Spce Sizes? World stte: Agent positions: 120 Food count: 30 Ghost positions: 12 Agent fcing: NSEW How mny World sttes? 120x(2 30 )x(12 2 )x4 Sttes for pthing? 120 Sttes for et-ll-dots? 120x(2 30 )

Stte Spce Grphs nd Serch Trees G b c S d h e f p q r

Stte Spce Grphs Stte spce grph: A mthemticl representtion of serch problem Nodes re (bstrcted) world configurtions Arcs represent successors (ction results) The gol test is set of gol nodes (mybe only one) In stte spce grph, ech stte occurs only once! We cn rrely build this full grph in memory (it s too big), but it s useful ide

Stte Spce Grphs Stte spce grph: A mthemticl representtion of serch problem Nodes re (bstrcted) world configurtions b c G Arcs represent successors (ction results) The gol test is set of gol nodes (mybe only one) d e f S h In serch grph, ech stte occurs only once! p q r We cn rrely build this full grph in memory (it s too big), but it s useful ide Tiny serch grph for tiny serch problem

Serch Trees This is now / strt N, 1.0 E, 1.0 Possible futures A serch tree: A wht if tree of plns nd their outcomes The strt stte is the root node Children correspond to successors Nodes show sttes, but correspond to PLANS tht chieve those sttes For most problems, we cn never ctully build the whole tree

Stte Spce Grphs vs. Serch Trees S Stte Spce Grph b c e d f h p q r G Ech NODE in in the serch tree is n entire PATH in the stte spce grph. We construct both on demnd nd we construct s little s possible. b d c Serch Tree S e e h r h r p q f p q f q c G q c G p q

Quiz: Stte Spce Grphs vs. Serch Trees Consider this 4-stte grph: How big is its serch tree (from S)? S G b Importnt: Lots of repeted structure in the serch tree!

Tree Serch

Serch Exmple: Romni

Serching with Serch Tree Serch: Expnd out potentil plns (tree nodes) Mintin fringe of prtil plns under considertion Try to expnd s few tree nodes s possible

Generl Tree Serch Importnt ides: Fringe Expnsion Explortion strtegy Min question: which fringe nodes to explore?

Exmple: Tree Serch b c G S d h e f p q r

Depth-First Serch

Depth-First Serch S b d p c e p h f r q q c G q e p h f r q q c G S G d b p q c e h f r q p h f d b c e r Strtegy: expnd deepest node first Implementtion: Fringe is LIFO stck

Serch Algorithm Properties

Serch Algorithm Properties Complete: Gurnteed to find solution if one exists? Optiml: Gurnteed to find the lest cost pth? Time complexity? Spce complexity? b 1 node b nodes Crtoon of serch tree: b is the brnching fctor m is the mximum depth solutions t vrious depths Number of nodes in entire tree? 1 + b + b 2 +. b m = O(b m ) m tiers b 2 nodes b m nodes

Depth-First Serch (DFS) Properties Wht nodes DFS expnd? Some left prefix of the tree. Could process the whole tree! b 1 node b nodes If m is finite, tkes time O(b m ) b 2 nodes How much spce does the fringe tke? Only hs siblings on pth to root, so O(bm) m tiers Is it complete? m could be infinite, so only if we prevent cycles (more lter) b m nodes Is it optiml? No, it finds the leftmost solution, regrdless of depth or cost

Bredth-First Serch

Bredth-First Serch Strtegy: expnd shllowest node first Implementtion: Fringe is FIFO queue S b p d q c h e r f G S Serch Tiers b d c h e r p h q e r f p q p q f q c G q c G

Bredth-First Serch (BFS) Properties Wht nodes does BFS expnd? Processes ll nodes bove shllowest solution Let depth of shllowest solution be s Serch tkes time O(b s ) s tiers b 1 node b nodes b 2 nodes How much spce does the fringe tke? b s nodes Hs roughly the lst tier, so O(b s ) Is it complete? b m nodes s must be finite if solution exists, so yes! Is it optiml? Only if costs re ll 1 (more on costs lter)

Quiz: DFS vs BFS When will BFS outperform DFS? When will DFS outperform BFS?

Wht serch strtegy is this? Bredth-First Serch (BFS)

Wht serch strtegy is this? Depth-First Serch (DFS)

Wht serch strtegy is this? Depth-First Serch (DFS)

Wht serch strtegy is this? Bredth-First Serch (BFS)

Itertive Deepening Ide: get DFS s spce dvntge with BFS s time / shllow-solution dvntges Run DFS with depth limit 1. If no solution Run DFS with depth limit 2. If no solution Run DFS with depth limit 3... b Isn t tht wstefully redundnt? Generlly most work hppens in the lowest level serched, so not so bd!

Cost-Sensitive Serch b 2 3 1 d 2 c 3 8 2 e 9 8 2 GOAL 2 f START 1 p 4 15 q 4 h r 2 BFS finds the shortest pth in terms of number of ctions. It does not find the lest-cost pth. We will now cover similr lgorithm which does find the lest-cost pth.

Uniform Cost Serch

Uniform Cost Serch Strtegy: expnd chepest node first: Fringe is priority queue (priority: cumultive cost) 2 b 1 3 S 1 p d 15 8 9 q 2 c h e 8 2 r G 2 f 1 S 0 d 3 e 9 p 1 b 4 c 11 e 5 h 17 r 11 q 16 Cost contours 6 h 13 r 7 p q f p q f 8 q c G q 11 c G 10

Uniform Cost Serch (UCS) Properties Wht nodes does UCS expnd? Processes ll nodes with cost less thn chepest solution! If tht solution costs C* nd rcs cost t lest, then the effective depth is roughly C*/ Tkes time O(b C*/ ) (exponentil in effective depth) C*/ tiers b c 1 c 2 c 3 How much spce does the fringe tke? Hs roughly the lst tier, so O(b C*/ ) Is it complete? Assuming best solution hs finite cost nd minimum rc cost is positive, yes! Is it optiml? Yes! (Proof next lecture vi A*)

Uniform Cost Issues Remember: UCS explores incresing cost contours The good: UCS is complete nd optiml! c 1 c 2 c 3 The bd: Explores options in every direction No informtion bout gol loction Strt Gol We ll fix tht soon!

Wht serch strtegy is this? Bredth-First Serch (BFS)

Wht serch strtegy is this? Uniform Cost Serch (UCS)

The One Queue All these serch lgorithms re the sme except for fringe strtegies Conceptully, ll fringes re priority queues (i.e. collections of nodes with ttched priorities) Prcticlly, for DFS nd BFS, you cn void the log(n) overhed from n ctul priority queue, by using stcks nd queues Cn even code one implementtion tht tkes vrible queuing object

Serch Gone Wrong?

Old Greece Assignment

Serch nd Models Serch opertes over models of the world The gent doesn t ctully try ll the plns out in the rel world! Plnning is ll in simultion Your serch is only s good s your models