DOC PREVIEW
Berkeley COMPSCI 188 - Lecture 3 Queue-Based Search

This preview shows page 1-2-3-20-21-40-41-42 out of 42 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 42 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 188: Artificial IntelligenceSpring 2007Lecture 3: Queue-Based Search1/23/2007SriniNarayanan –UC BerkeleyMany slides over the course adapted from Dan Klein, Stuart Russell or Andrew Moore PDF created with pdfFactory Pro trial version www.pdffactory.comAnnouncements§ Assignment 1 due 1/30 11:59 PM§ You can do most of it after today§ Sections start this week§ Stay tuned for Python LabPDF created with pdfFactory Pro trial version www.pdffactory.comSummary§ Agents interact with environments through actuators and sensors§ The agent function describes what the agent does in all circumstances§ The agent program calculates the agent function§ The performance measure evaluates the environment sequence§ A perfectly rational agent maximizes expected performance § PEAS descriptions define task environments§ Environments are categorized along several dimensions:§ Observable? Deterministic? Episodic? Static? Discrete? Single-agent?§ Problem-solving agents make a plan, then execute it§ State space encodings of problemsPDF created with pdfFactory Pro trial version www.pdffactory.comProblem-Solving Agents§ This offline problem solving!§ Solution is executed “eyes closed.This is the hard part!PDF created with pdfFactory Pro trial version www.pdffactory.comTree Search§ Basic solution method for graph problems§ Offline simulated exploration of state space§ Searching a model of the space, not the real worldPDF created with pdfFactory Pro trial version www.pdffactory.comA Search Tree§ Search:§ Expand out possible plans§ Maintain a fringe of unexpanded plans§ Try to expand as few tree nodes as possiblePDF created with pdfFactory Pro trial version www.pdffactory.comTree SearchPDF created with pdfFactory Pro trial version www.pdffactory.comGeneral Tree Search§ Important ideas:§ Fringe§ Expansion§ Exploration strategy§ Main question: which fringe nodes to explore?PDF created with pdfFactory Pro trial version www.pdffactory.comSearch Nodes vs. States123 45 678123 45 678123 45 678135 681345 67824 72123 45 678PDF created with pdfFactory Pro trial version www.pdffactory.comSearch Nodes vs. States123 45 678123 45 678123 45 678135 681345 67824 72123 45 678If states are allowed to be revisited,the search tree may be infinite evenwhen the state space is finitePDF created with pdfFactory Pro trial version www.pdffactory.comStates vs. Nodes§ Problem graphs have problem states§ Have successors§ Search trees have search nodes§ Have parents, children, depth, path cost, etc.§ Expand uses successor function to create new search tree nodes§ The same problem state may be in multiple search tree nodesPDF created with pdfFactory Pro trial version www.pdffactory.comUninformed search strategies§ (a.k.a. blind search) = use only information available in problem definition.§ When strategies can determine whether one non-goal state is better than another → informed search.§ Categories defined by expansion algorithm:§ Breadth-first search§ Depth-first search§ (Depth-limited search)§ Iterative deepening search § Uniform-cost search§ Bidirectional searchPDF created with pdfFactory Pro trial version www.pdffactory.comState Space Graphs§ There’s some big graph in which§ Each state is a node§ Each successor is an outgoing arc§ Important: For most problems we could never actually build this graph§ How many states in 8-puzzle?SGdbpqcehafrLaughably tiny search graph for a tiny search problemPDF created with pdfFactory Pro trial version www.pdffactory.comExample: RomaniaPDF created with pdfFactory Pro trial version www.pdffactory.comExample: Tree SearchSGdbpqcehafrPDF created with pdfFactory Pro trial version www.pdffactory.comState Graphs vsSearch TreesSabdpacephfrqq cGaqephfrqq cGaSGdbpqcehafrWe almost always construct both on demand –and we construct as little as possible.Each NODE in in the search tree is an entire PATH in the problem graph.PDF created with pdfFactory Pro trial version www.pdffactory.comReview: Depth First SearchSabdpacephfrqq cGaqephfrqq cGaSGdbpqcehafrqphfdbacerStrategy: expand deepest node firstImplementation: Fringe is a LIFO stackPDF created with pdfFactory Pro trial version www.pdffactory.comReview: Breadth First SearchSabdpacephfrqq cGaqephfrqq cGaSGdbpqcehafrSearchTiersStrategy: expand shallowest node firstImplementation: Fringe is a FIFO queuePDF created with pdfFactory Pro trial version www.pdffactory.comSearch Algorithm Properties§ Complete? Guaranteed to find a solution if one exists?§ Optimal? Guaranteed to find the least cost path?§ Time complexity?§ Space complexity?Variables:Depth of the shallowest solutionsCost of least cost solutionC*Max depth of the search treemThe average branching factor B(the average number of successors)bNumber of states in the problemnPDF created with pdfFactory Pro trial version www.pdffactory.comDFS§ Infinite paths make DFS incomplete…§ How can we fix this?SpaceTimeOptimalCompleteAlgorithmO(LMAX)O(BLMAX)NNDepth First SearchDFSSTARTGOALabN N Infinite InfinitePDF created with pdfFactory Pro trial version www.pdffactory.comDFS§ With cycle checking, DFS is complete. § When is DFS optimal?w/ Path CheckingDFSSpaceTimeOptimalCompleteAlgorithmY NO(bm) O(bm)…b1 nodeb nodesb2nodesbmnodesm tiersPDF created with pdfFactory Pro trial version www.pdffactory.comBFS§ When is BFS optimal?w/ Path CheckingDFSBFSSpaceTimeOptimalCompleteAlgorithmY NO(bm) O(bm)…b1 nodeb nodesb2nodesbmnodess tiersY N*O(bs+1) O(bs+1)bsnodesPDF created with pdfFactory Pro trial version www.pdffactory.comComparisons§ When will BFS outperform DFS?§ When will DFS outperform BFS?PDF created with pdfFactory Pro trial version www.pdffactory.comCosts on ActionsNotice that BFS finds the shortest path in terms of number of transitions. It does not find the least-cost path.We will quickly cover an algorithm which does find the least-cost path. STARTGOALdbpqcehafr29281823144151322PDF created with pdfFactory Pro trial version www.pdffactory.comUniform Cost SearchSabdpacephfrqq cGaqephfrqq cGaExpand cheapest node first:Fringe is a priority queueSGdbpqcehafr39116411571381011171106391128811512Cost contours2PDF created with pdfFactory Pro trial version www.pdffactory.comPriority Queue Refresherreturns the key with the lowest value, and removes it from the queue.pq.pop()inserts (key, value) into the queue.pq.push(key, value)§ A priority queue is a data structure in which you can insert and retrieve (key, value) pairs with the following operations:§ You


View Full Document

Berkeley COMPSCI 188 - Lecture 3 Queue-Based Search

Documents in this Course
CSP

CSP

42 pages

Metrics

Metrics

4 pages

HMMs II

HMMs II

19 pages

NLP

NLP

23 pages

Midterm

Midterm

9 pages

Agents

Agents

8 pages

Lecture 4

Lecture 4

53 pages

CSPs

CSPs

16 pages

Midterm

Midterm

6 pages

MDPs

MDPs

20 pages

mdps

mdps

2 pages

Games II

Games II

18 pages

Load more
Download Lecture 3 Queue-Based Search
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 3 Queue-Based Search and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 3 Queue-Based Search 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?