Computer Science cpsc322, Lecture 10

Slides:



Advertisements
Similar presentations
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 14, 2012.
Advertisements

CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 11, 2013.
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
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) January, 28, 2008.
Slide 1 Finish Search Jim Little UBC CS 322 – Search 7 September 24, 2014 Textbook §3.6.
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, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) January, 25, 2010.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 22, 2010.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
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.
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Computer Science CPSC 322 Lecture 4 Search: Intro (textbook Ch: ) 1.
Branch & Bound, CSP: Intro CPSC 322 – CSP 1 Textbook § & January 28, 2011.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
CPSC 322, Lecture 2Slide 1 Representational Dimensions Computer Science cpsc322, Lecture 2 (Textbook Chpt1) Sept, 7, 2012.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) Sep, 26, 2010.
Computer Science CPSC 322 Lecture 7 Search Wrap Up, Intro to Constraint Satisfaction Problems 1.
Lecture 3: Uninformed Search
Adversarial Search and Game-Playing
Computer Science cpsc322, Lecture 7
Constraint Satisfaction Problems (CSPs) Introduction
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Computer Science cpsc322, Lecture 4
Announcements Homework 1 Full assignment posted..
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
Constraint Satisfaction Problems (CSPs) Introduction
Planning: Representation and Forward Search
Artificial Intelligence (CS 370D)
Search: Advanced Topics Computer Science cpsc322, Lecture 9
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Planning: Heuristics and CSP Planning
Planning: Heuristics and CSP Planning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Planning: Representation and Forward Search
Computer Science cpsc322, Lecture 13
Computer Science cpsc322, Lecture 2
Lecture 1B: Search.
Problem Solving and Searching
Problem Solving and Searching
Instructor: Vincent Conitzer
The Alpha-Beta Procedure
Search: Advanced Topics Computer Science cpsc322, Lecture 9
Problem Spaces & Search
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Iterative Deepening CPSC 322 – Search 6 Textbook § 3.7.3
Minimax strategies, alpha beta pruning
Problem Spaces & Search
Iterative Deepening and Branch & Bound
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
Search.
Search.
Minimax strategies, alpha beta pruning
Planning: Representation and Forward Search
Presentation transcript:

Computer Science cpsc322, Lecture 10 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) May, 25, 2017 Lecture 10 CPSC 322, Lecture 10

Pruning Cycles and Repeated states Examples Dynamic Programming Lecture Overview Finish MBA* Pruning Cycles and Repeated states Examples Dynamic Programming Search Recap CPSC 322, Lecture 10

Heuristic value by look ahead What is the most accurate admissible heuristic value for n, given only this info ? 7 5 2 8 The oldest if they all have the same f-value h(p)=min( (cost(pi) – cost(p)) + h(pi) ) underestimate! CPSC 322, Lecture 9

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 (with …………………………..) ``back them up'' to a common ancestor p The oldest if they all have the same f-value h(p)=min( (cost(pi) – cost(p)) + h(pi) ) underestimate! p1 pn CPSC 322, Lecture 9

MBA*: Compute New h(p) p p1 pn CPSC 322, Lecture 9 The oldest if they all have the same f-value h(p)=min( (cost(pi) – cost(p)) + h(pi) ) underestimate! CPSC 322, Lecture 9

Pruning Cycles and Repeated states Examples Dynamic Programming Lecture Overview Finish MBA* Pruning Cycles and Repeated states Examples Dynamic Programming Search Recap CPSC 322, Lecture 10

Cycle Checking You can prune a path that ends in a node already on the path. This pruning cannot remove an optimal solution. The time for checking is ………………… in path length. Using depth-first methods, with the graph explicitly stored, this can be done in constant time.?? CPSC 322, Lecture 10

Repeated States / Multiple Paths Failure to detect repeated states can turn a linear problem into an exponential one! CPSC 322, Lecture 10

Multiple-Path Pruning You can prune a path to node n that you have already found a path to (if the new path is longer – more costly). This entails storing all nodes you have found paths to. Multiple-path pruning subsumes cycle check. CPSC 322, Lecture 10

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) You’ll have to regenerated them CPSC 322, Lecture 10

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. Can be computationally costly CPSC 322, Lecture 10

Example Pruning Cycles Repeated States CPSC 322, Lecture 10

Pruning Cycles and Repeated states Examples Dynamic Programming Lecture Overview Finish MBA* Pruning Cycles and Repeated states Examples Dynamic Programming Search Recap CPSC 322, Lecture 10

  Dynamic Programming How could we implement that? k c b h g z 6 7 6 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 k c b h g z 2 3 1 4 6 7  6 7 

Dynamic Programming This can be built backwards from the goal: all the neighbors m g b c a Dynamic programming is a general algorithm that will be used as a dual to search algorithms in other parts of the book. The specific algorithm presented here was invented by Dijkstra [1959]. See Cormen, Leiserson, Rivest, and Stein [2001] for more details on the general class of dynamic programming algorithms. The idea of using dynamic programming as a source of heuristics for A search was proposed by Culberson and Schaeffer [1998] and further developed by Felner, Korf, and Hanan [2004]. 2 d 2 b 2 g 1 1 a c 3 3 CPSC 322, Lecture 9

Dynamic Programming This can be used locally to determine what to do. From each node n go to its neighbor which minimizes 4 d 2 2 b 2 2 g 1 3 1 a c 3 3 3 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 CPSC 322, Lecture 9

Pruning Cycles and Repeated states Examples Dynamic Programming Lecture Overview Finish MBA* Pruning Cycles and Repeated states Examples Dynamic Programming Search Recap CPSC 322, Lecture 10

Recap Search Selection Complete Optimal Time Space DFS N O(bm) O(mb) LIFO N O(bm) O(mb) BFS FIFO Y IDS(C) LCFS min cost min h A* min f B&B LIFO + pruning IDA* MBA* Many of these are qualified Eg. LCFS optimal if costs are > 0 Eg. A* complete if h is admissible E.G B&B optimal if there are no infinite path E.G BDS complete if both searches are BFS (or A*) CPSC 322, Lecture 10

Recap Search (some qualifications) Complete Optimal Time Space DFS N O(bm) O(mb) BFS Y IDS(C) LCFS Y ? A* B&B IDA* MBA* Many of these are qualified Eg. LCFS optimal if costs are > 0 Eg. A* complete if h is admissible E.G B&B optimal if there are no infinite path E.G BDS complete if both searches are BFS (or A*) CPSC 322, Lecture 10

Search in Practice Complete Optimal Time Space DFS N O(bm) O(mb) BFS Y IDS(C) LCFS A* B&B IDA* MBA* BDS O(bm/2) CPSC 322, Lecture 10

Search in Practice (cont’) Informed? Many paths to solution, no ∞ paths? Uninformed: IDS (many deep solutions – do not care about optimality) Informed: Infinite path (in practice paths so long that cannot be kept in memory) Large branching factor? CPSC 322, Lecture 10

(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 Winning machine was a parallel computer (30 CPUs) + 480 VLSI chess processors Searched 126.000.000 nodes per sec Generated 30 billion positions per move, reaching depth 14 routinely Standard iterative deepening alpha beta search (with transposition table) But key to success seems to be its ability to go deeper for sufficiently interesting lines of forced/forcing moves Evaluation functions had over 8000 features + opening book with 4000 positions + solved positions with 5 pieces and many with 6 (to extend the effective depth of the search) Deep Blue's evaluation function looks at four basic chess values: material, position, King safety and tempo. Material is based on the "worth" of particular chess pieces. For example, if a pawn is valued at 1, then the rook is worth 5 and the Queen is valued at 9. The King, of course, is beyond value because his loss means the loss of the game. The simplest way to understand position is by looking at your pieces and counting the number of safe squares they can attack. King safety is a defensive aspect of position. It is determined by assigning a value to the safety of the King's position in order to know how to make a purely defensive move. Tempo is related to position but focuses on the race to develop control of the board. A player is said to "lose a tempo" if he dillydallies while the opponent is making more productive advances. 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) CPSC 322, Lecture 10

Modules we'll cover in this course: R&Rsys Environment Stochastic Deterministic Problem Arc Consistency Constraint Satisfaction Vars + Constraints Search Static Belief Nets Logics Query Var. Elimination Search R&R Sys Representation and reasoning Systems Each cell is a R&R system STRIPS actions preconditions and effects Sequential Decision Nets STRIPS Var. Elimination Planning Search Markov Processes Representation Value Iteration Reasoning Technique CPSC 322, Lecture 2

Standard Search vs. Specific R&R systems Constraint Satisfaction (Problems): State Successor function Goal test Solution Heuristic function Planning : Inference Allows useful general-purpose algorithms with more power than standard search algorithms CPSC 322, Lecture 11

Next class Start Constraint Satisfaction Problems (CSPs) Textbook 4.1-4.3 CPSC 322, Lecture 10