300 likes | 498 Views
Finish Search Jim Little UBC CS 322 – Search 7 September 24, 2014 Textbook §3.6. Lecture Overview. Finish MBA* Pruning Cycles and Repeated states Examples Dynamic Programming Search Recap. H euristic value by look ahead. Memory-bounded A *.
E N D
Finish Search • Jim Little • UBC CS 322 – Search 7 September 24, 2014 Textbook §3.6
Lecture Overview • Finish MBA* • Pruning Cycles and Repeated states Examples • Dynamic Programming • Search Recap
Memory-bounded A* • Iterative deepening A* and B & B use a tiny amount of memory • what if we've got more memory to use? • keep as much of the fringe in memory as we can • if we have to delete something: • delete the worst paths ( ) • ``back them up'' to a common ancestor highest f p p1 pn
Lecture Overview • Finish MBA* • Interlude: State Space/Search Graphs • Pruning Cycles and Repeated states Examples • Dynamic Programming • Search Recap
Clarification: state space graph vs search tree k a d kb kc kch b kbz z 4 5 k c h kchfy 6 7 8 f kbza kbzd State space graph. If there are no cycles, the two look the same Search tree. Nodes in this tree correspond to paths in the state space graph
Clarification: state space graph vs search tree k a d The numbers in the search tree’s nodes mean? kb kc kch b kbz z 4 5 k c h kchf 6 7 8 f kbza kbzd State space graph. Search tree. Order in which a search algo. (here: BFS) expands nodes Node’s name 8
Clarification: state space graph vs search tree k a d • If there are cycles, the two look very different kb kc kch b kbk kbz kck z k c h kchf kbkb kbkc f kbza kbzd kckb kckc State space graph. Search tree. (only first 3 levels, of BFS)
Clarification: state space graph vs search tree k a d kb kc kch b kbk kbz kck z k c h kchf kbkb kbkc f kbza kbzd kckb kckc State space graph. Search tree. (only first 3 levels, of BFS)
Clarification: state space graph vs search tree k a d kb kc kch b kbk kbz kck z k c h kchf kbkb kbkc f kbza kbzd kckb kckc State space graph. Search tree. (only first 3 levels, of BFS)
Clarification: state space graph vs search tree k a d kb kc kch b kbk kbz kck z k c h kchz kbkb kbkc z kbza kbzd kckb kckc State space graph. May contain cycles! Search tree. Nodes in this tree correspond to paths in the state space graph (if multiple start nodes: forest) Cannot contain cycles!
Clarification: state space graph vs search tree k a d kb kc kch b kbk kbz kck z k c h kchz kbkb kbkc z State space graph. Why don’t we just eliminate cycles? Sometimes (but not always) we want multiple solution paths kbza kbzd kckb kckc Search tree. Nodes in this tree correspond to paths in the state space graph
Lecture Overview • Finish MBA* • Pruning Cycles and Repeated states Examples • Dynamic Programming • Search Recap
Multiple-Path Pruning & Optimal Solutions • Problem: what if a subsequent path to n is shorter than the first path to n ? • You can remove all paths from the frontier that use the longer path. (as these can’t be optimal)
Multiple-Path Pruning & Optimal Solutions • Problem: what if a subsequent path to n is shorter than the first path to n ? • You can change the initial segment of the paths on the frontier to use the shorter path.
Example Pruning Cycles Repeated States
Lecture Overview • Finish MBA* • Pruning Cycles and Repeated states Examples • Dynamic Programming • Search Recap
Dynamic Programming • Idea: for statically stored graphs, build a table of dist(n): • The actual distance of the shortest path from node n to a goal g • This is the perfect • dist(g) = 0 • dist(z) = 1 • dist(c) = 3 • dist(b) = 4 • dist(k) = ? • dist(h) = ? • How could we implement that? cost f function heuristic 2 b h 2 1 3 k c g 4 6 7 1 z 6 7
Dynamic Programming • This can be built backwards from the goal: m 0 g b c a 2 d 2 2 b g 1 1 a c 3 3
Dynamic Programming This can be used locally to determine what to do. From each nodengo to its neighbor which minimizes • But there are at least two main problems: • You need enough space to store the graph. • The dist function needs to be recomputed for each goal 4 d 2 2 b 2 2 g 1 3 1 a c 3 3 3
Lecture Overview • Finish MBA* • Pruning Cycles and Repeated states Examples • Dynamic Programming • Search Recap
Recap Search (some qualifications) C>0 h admiss. no inf path
approve robuddies-seminars.admin \ subscribe robuddies-seminars \Justin Hart <justin.hart@mech.ubc.ca> Search in Practice (cont’) approve robuddies-seminars.admin \ subscribe robuddies-seminars \Justin Hart <justin.hart@mech.ubc.ca> F IDS B&B Informed? T T IDA* Many paths to solution, no ∞paths? T F Large branching factor? F MBA*
(Adversarial) Search: Chess • Deep Blue’s Results in the second tournament: • second tournament: won 3 games, lost 2, tied 1 • 30 CPUs + 480 chess processors • Searched 126.000.000 nodes per sec • Generated 30 billion positions per move reaching depth 14 routinely • Iterative Deepening with evaluation function (similar to a heuristic) based on 8000 features (e.g., sum of worth of pieces: pawn 1, rook 5, queen 10)
Modules we'll cover in this course: R&Rsys Stochastic Deterministic • Environment Problem Arc Consistency Constraint Satisfaction Vars + Constraints Search Static Belief Nets Logics Query Var. Elimination Search Sequential Decision Nets STRIPS Var. Elimination Planning Search Markov Processes Representation Value Iteration Reasoning Technique
Standard Search vs. Specific R&R systems • Constraint Satisfaction (Problems): • State • Successor function • Goal test • Solution • Heuristic function • Planning : • State • Successor function • Goal test • Solution • Heuristic function • Inference • State • Successor function • Goal test • Solution • Heuristic function
Next class Start Constraint Satisfaction Problems (CSPs) Textbook 4.1-4.3