DOC PREVIEW
Berkeley COMPSCI 188 - Lecture 3: Search

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 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 37 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 37 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 37 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 37 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 37 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 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 188: Artificial Intelligence Spring 2006AdministriviaTodayExample: RomaniaSingle State ProblemsSearch Gone Wrong?Example: Vacuum WorldExample: 8-PuzzleExample: N-QueensExample: AssemblySlide 11A Search TreeTree SearchSlide 14States vs. NodesA Search GraphDepth First SearchSearch Algorithm PropertiesDFSSlide 20Breadth First SearchBFSComparisonsCosts on ActionsUniform Cost SearchPriority Queue RefresherSlide 27Slide 28Iterative DeepeningExtra Work?Graph SearchSlide 32Uniform Cost IssuesGreedy SearchSlide 35Euclidian HeuristicBest First Greedy SearchCS 188: Artificial IntelligenceSpring 2006Lecture 3: Search1/24/2006Dan Klein – UC BerkeleyMany slides from either Stuart Russell or Andrew MooreAdministriviaFinal Exam IssuesSections: starting 1/30101 (M 10am): B0051 Hildebrand104 (M 4pm): 002 EvansWritten Assignment 1Reminder: can solve in groupsBut: individual write-upsTodayFormulating Search ProblemsUniformed SearchDepth-First SearchBreadth-First SearchUniform-Cost SearchProperties of Search AlgorithmsExample: RomaniaSingle State ProblemsA search problem is defined by four items:Initial state: e.g. AradSuccessor function S(x) = set of action–state pairs:e.g., S(Arad) = {<Arad  Zerind, Zerind>, … }Goal test, can beexplicit, e.g., x = Bucharestimplicit, e.g., Checkmate(x)Path cost (additive)e.g., sum of distances, number of actions executed, etc.c(x, a, y) is the step cost, assumed to be ≥ 0A solution is a sequence of actions leading from the initial state to a goal stateSearch Gone Wrong?Example: Vacuum WorldCan represent problem as a state graphNodes are statesArcs are actionsArc weights are costsExample: 8-PuzzleWhat are the states?What are the actions?What states can I reach from the start state?What should the costs be?Example: N-QueensWhat are the states?What is the start?What is the goal?What are the actions?What should the costs be?Example: AssemblyWhat are the states?What is the goal?What are the actions?What should the costs be?Example: RomaniaA Search TreeSearch trees:Represent the branching paths through a state graph.Usually much larger than the state graph.Can a finite state graph give an infinite search tree?Tree SearchBasic solution method for graph problemsOffline simulated exploration of state spaceSearching a model of the space, not the real worldTree SearchStates 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 nodesA Search GraphHow do we get from S to G? And what’s the smallest possible number of transitions?STARTGOALdbpqcehafrDepth First SearchSabdpacephfrqq cGaqephfrqq cGaSGdbpqcehafrqphfdbacerExpand deepest node first:Fringe is a LIFO stackSearch Algorithm PropertiesComplete? Guaranteed to find a solution if one exists?Optimal? Guaranteed to find the least cost path?Time complexity?Space complexity?Variables:nNumber of states in the problembThe average branching factor B(the average number of successors)C*Cost of least cost solutionsDepth of the shallowest solutionmMax depth of the search treeDFSInfinite paths make DFS incomplete…How can we fix this?Algorithm Complete Optimal Time SpaceDFSDepth First SearchN NO(BLMAX) O(LMAX)STARTGOALabN N Infinite InfiniteDFSWith cycle checking, DFS is complete. When is DFS optimal?Algorithm Complete Optimal Time SpaceDFSw/ Path CheckingY N O(bm+1) O(bm )…b1 nodeb nodesb2 nodesbm nodesm tiersBreadth First SearchSabdpacephfrqq cGaqephfrqq cGaSGdbpqcehafrSearchTiersExpand shallowest node first:Fringe is a FIFO queueBFSWhen is BFS optimal?Algorithm Complete Optimal Time SpaceDFSw/ Path CheckingBFSY N O(bm+1) O(bm )…b1 nodeb nodesb2 nodesbm nodess tiersY N* O(bs+1) O(bs)bs nodesComparisonsWhen will BFS outperform DFS?When will DFS outperform BFS?Costs 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. STARTGOALdbpqcehafr29281823144151322Uniform Cost SearchSabdpacephfrqq cGaqephfrqq cGaExpand cheapest node first:Fringe is a priority queueSGdbpqcehafr39116411571381011171106391128811512Cost contours2Priority Queue Refresherpq.setPriority(key, value)inserts (key, value) into the queue.pq.dequeue()returns the key with the lowest value, and removes it from the queue.A priority queue is a data structure in which you can insert and retrieve (key, value) pairs with the following operations:You can promote or demote keys by resetting their prioritiesUnlike a regular queue, insertions into a priority queue are not constant time, usually O(log n)We’ll need priority queues for most cost-sensitive search methods.Uniform Cost SearchWhat will UCS do for this graph?What does this mean for completeness?STARTGOALab1100Uniform Cost SearchAlgorithm Complete Optimal Time SpaceDFSw/ Path CheckingBFSUCSY N O(bm+1) O(bm )…bC*/ tiersY N O(bs+1) O(bs)Y* Y O(C* bC*/) O(bC*/)We’ll talk more about uniform cost search’s failure cases next class…Iterative DeepeningIterative deepening uses DFS as a subroutine:1. Do a DFS which only searches for paths of length 1 or less. (DFS gives up on any path of length 2)2. If “1” failed, do a DFS which only searches paths of length 2 or less.3. If “2” failed, do a DFS which only searches paths of length 3 or less.….and so on.Algorithm Complete Optimal Time SpaceDFSw/ Path CheckingBFSIDY N O(bm+1) O(bm )Y N* O(bs+1) O(bs)Y N* O(bd+1) O(bd)…bExtra Work?Failure to detect repeated states can cause exponentially more work. Why?Graph SearchIn BFS, for example, we shouldn’t bother expanding the circled nodes (why?)Sabdpacephfrqq cGaqephfrqq cGaGraph SearchVery simple fix: never expand a node twiceUniform Cost IssuesWhere will uniform cost explore?Why?What is wrong here?StartGoalGreedy SearchGreedy SearchExpand the node that seems closest…What can go wrong?Euclidian HeuristicSTARTGOALdbpqcehafr299811235344151252h=12h=11h=8h=8h=5h=4h=6h=9h=0h=4h=6h=11Best First Greedy SearchAlgorithm Complete Optimal Time SpaceGreedy Best-First SearchWhat do we need to do to make it complete?Can we make it


View Full Document

Berkeley COMPSCI 188 - Lecture 3: 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: 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: 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: 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?