Searching: Where it all begins...

Similar documents
Efficient memory-bounded search methods

Search. CS 3793/5233 Artificial Intelligence Search 1

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

COMP9414: Artificial Intelligence Informed Search

Informed search strategies (Section ) Source: Fotolia

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

University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination

Artificial Intelligence

Downloaded from ioenotes.edu.np

Problem solving as Search (summary)

CIS 192: Artificial Intelligence. Search and Constraint Satisfaction Alex Frias Nov. 30 th

Problem Solving and Search

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

State-Space Search. Computer Science E-22 Harvard Extension School David G. Sullivan, Ph.D. Solving Problems by Searching

Informed Search Methods

Search Algorithms. Uninformed Blind search. Informed Heuristic search. Important concepts:

Problem Solving & Heuristic Search

An Appropriate Search Algorithm for Finding Grid Resources

Artificial Intelligence

Topic 1 Uninformed Search

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

COMP9414: Artificial Intelligence Informed Search

Informed Search Algorithms

Solving Problems by Searching

Uninformed Search Methods

Artificial Intelligence

Chapters 3-5 Problem Solving using Search

Outline. Best-first search

Artificial Intelligence

3 SOLVING PROBLEMS BY SEARCHING

Artificial Intelligence

Uninformed search strategies (Section 3.4) Source: Fotolia

Search : Lecture 2. September 9, 2003

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

Artificial Intelligence (part 4d)

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises

Expert Systems (Graz) Heuristic Search (Klagenfurt) - Search -

Uninformed Search. Problem-solving agents. Tree search algorithms. Single-State Problems

Artificial Intelligence

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

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria

State Space Search. Many problems can be represented as a set of states and a set of rules of how one state is transformed to another.

Downloded from: CSITauthority.blogspot.com

Lecture 3 of 42. Lecture 3 of 42

Search: Advanced Topics and Conclusion

CS 188: Artificial Intelligence. Recap Search I

ARTIFICIAL INTELLIGENCE LECTURE 3. Ph. D. Lect. Horia Popa Andreescu rd year, semester 5

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Dan Klein, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

Games and Adversarial Search II Alpha-Beta Pruning (AIMA 5.3)

Artificial Intelligence (part 4d)

Informed search algorithms Michal Pěchouček, Milan Rollo. Department of Cybernetics Czech Technical University in Prague

Parallel Programming. Parallel algorithms Combinatorial Search

Effective use of memory in linear space best first search

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

Outline. Best-first search

Artificial Intelligence CS 6364

CAP 4630 Artificial Intelligence

Chapter 3. A problem-solving agent is a kind of goal-based agent. It decide what to do by finding sequences of actions that lead to desirable states.

A4B36ZUI - Introduction ARTIFICIAL INTELLIGENCE

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Search: Advanced Topics and Conclusion

Lecture 5 Heuristics. Last Time: A* Search

Informed State Space Search B4B36ZUI, LS 2018

DFS. Depth-limited Search

Informed search algorithms

A.I.: Informed Search Algorithms. Chapter III: Part Deux

Problem Solving and Searching

Search EECS 395/495 Intro to Artificial Intelligence

Review Adversarial (Game) Search ( ) Review Constraint Satisfaction ( ) Please review your quizzes and old CS-271 tests

Probabilistic Belief. Adversarial Search. Heuristic Search. Planning. Probabilistic Reasoning. CSPs. Learning CS121

Searching with Partial Information

Problem Solving and Search in Artificial Intelligence

Search EECS 348 Intro to Artificial Intelligence

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016

3.6.2 Generating admissible heuristics from relaxed problems

State Spaces

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

CS 331: Artificial Intelligence Informed Search. Informed Search

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

Solving Problems by Searching

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

Uninformed Search. Day 1 & 2 of Search. Russel & Norvig Chap. 3. Material in part from

Chapter 4. Uninformed Search Strategies

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY REPRESENTATION OF KNOWLEDGE PART A

Midterm Examination CS 540-2: Introduction to Artificial Intelligence

4. Solving Problems by Searching

Announcements. Today s Menu

Topic 1 Uninformed Search (Updates: Jan. 30, 2017)

CPS 170: Artificial Intelligence Search

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

COMP3702/7702 Artificial Intelligence Week2: Search (Russell & Norvig ch. 3)" Hanna Kurniawati"

Route planning / Search Movement Group behavior Decision making

Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013

mywbut.com Informed Search Strategies-II

Distributed Tree Searc and its Application to Alpha-Beta Pruning*

Blind (Uninformed) Search (Where we systematically explore alternatives)

CS 520: Introduction to Artificial Intelligence. Lectures on Search

Informed Search CS457 David Kauchak Fall 2011

Lecture 4: Informed/Heuristic Search

Transcription:

Searching: Where it all begins... CPSC 433 Christian Jacob Dept. of Computer Science Dept. of Biochemistry & Molecular Biology University of Calgary

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

Problem Solving by Searching 1. Introductory Concepts and Examples a. Problem space b. State space graphs

Problem Spaces A problem space is a complete set of possible states, generated by exploring a! possible steps, which may or may not lead from a given start state to a goal state.

Blocks Rearrangement Problem [Bratko, 2001]

State Space Graph

Components of a State Space Graph Start: description with which to label the start node Operators: functions that transform from one state to another, within the constraints of the search problem Goal condition: state description(s) that correspond(s) to goal state(s)

State Space Graph Start: Goal:

State Space Graph Start: Goal:

State Space Graph Start: Goal:

State Space Graph Start: Goal:

Eight Puzzle Problem Start Goal Start 1: 4 steps Start 2: 5 steps Start 3: 18 steps

Eight Puzzle Problem Start Goal

Rubik s Cube

Chess [Newborn 1997]

What it boils down to: Searching in Graphs

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

Basic Search Techniques a. Depth-first or backtracking search b. Iterative deepening search c. Breadth-first search

Depth-First Search

Depth First Search: Eight Puzzle Terminal depth = 5

Depth-First Search in Cyclic Graphs Add cycle detection!

Depth-First Search Evaluation Good: Since we don t expand all nodes at a level, space complexity is modest. For branching factor b and depth m, we require b" number of nodes to be stored in memory. However, the worst case is still O(b^m). That is when we are forced to search through the whole tree.

Depth-First Search Evaluation Bad: If you have deep search trees (or infinite!), DFS may end up running off to infinity and not be able to recover. DFS is neither optimal nor complete. - Complete: If there is a solution, it will find it. - Optimal: The best solution is found.

Depth-Limited Search DLS is a modified DFS to avoid its pitfalls: Impose a limit, l, on the maximum depth level. Little changes from DFS, but not optimal. DLS is complete if the limit l we impose is greater than or equal to the depth of our solution space. Time: O(b^l), Space: bl.

Basic Search Techniques a. Depth-first or backtracking search b. Iterative deepening search c. Breadth-first search

Iterative Deepening Search: A Variant of DLS 1 2 3 4 Depth bound

Basic Search Techniques a. Depth-first or backtracking search b. Iterative deepening search c. Breadth-first search

Breadth-First Search

Eight Puzzle: BFS

BFS: Complexity BFS expands from the root, where it expands a fixed number of nodes, say b. On level d = 2 we expand b^2 nodes. On level d = 3 we expand b^3 nodes. Therefore: O(b^d) time complexity All leaf nodes need to be stored in memory. Hence, space complexity = time complexity.

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

Heuristic Search a. Greedy Search b. Best-First Heuristic Search A*

Greedy Search on a Graph Start 75 A 118 C B 111 140 D E 80 G 99 97 F H 211 101 I Goal State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I 0 h(n) = straight-line distance heuristic

Greedy Search 75 B State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I 0 A E C B h=253 329 374 A 118 C 140 E 80 G 99 F 211 111 D 97 H 101 I

Greedy Search B State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I 0 Total distance = 253 + 178 = 431 h=253 A E C B A F G 75 h = 366 h = 178 h = 193 A 118 C 111 140 D E 80 G 99 97 F H 211 101 I A E F h = 253 h = 178

Greedy Search 75 A 118 C B 111 140 D State E 80 h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I 0 G 99 97 F Total distance =253 + 178 + 0 =431 H 211 101 I A h = 253 E h =366 h=178 h=193 h = 253 E F h = 0 A E F I I A C G h = 253 h = 178 h = 0 B

Greedy Search: Optimal? State h(n) B A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I 0 Cost(A E F I )= 431 Cost(A E G H I) = 418 75 A 118 C 140 E 80 G 99 F 211 111 D 97 H 101 I

Greedy Search: Complete? Straight-line distance A B h(n) 6 5 A Greedy search is incomplete. C D 7 0 B Starting node Worst-case time complexity: O(b^m) Target node D C

Heuristic Search a. Greedy Search b. Best-First Heuristic Search A*

A* Best-First Heuristic Search f(n) = g(n) + h(n) g(n): cost so far up to node & h: heuristic estimator from node n to the goal '

A* Example start g h

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

A* Example start Activate-deactivate Process 1 Process 2

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

AND/OR Graphs OR AND AND

AND/OR Solution Tree(s) Solution Tree T: OR AND The original problem P is the root node of T. If P is an OR node then exactly one of its successors (in the AND/OR graph), together with its own solution tree, is in T. If P is an AND node, then all of its successors (in the AND/OR graph), together with their solution trees, are in T.

Solution Tree: Example Solution Tree 1

Solution Tree: Example Solution Tree 2

Route Problem

Route Problem

Route Problem

Route Problem............

Problem Solving by Searching 1. Introductory Concepts and Examples 2. Basic Search Techniques 3. Heuristic Search 4. Problem Decomposition and AND/OR Graphs 5. Searching in Games

Chess Us to move Opponent to move Us to move

Two-Person Game AND/OR Graph OR AND

Searching in Games a. Minimax Strategy b. Pruning c. Chance

Minimax Strategy Our possible configurations 3 12 8 2 4 6 14 5 2... Opponent s possible configurations Evaluations of configurations

Minimax Strategy 3 2 2 Our possible configurations 3 12 8 2 4 6 14 5 2 Opponent s possible configurations

Minimax Strategy 3 3 2 2 Our possible configurations 3 12 8 2 4 6 14 5 2 Opponent s possible configurations

Chess Search Tree Structure

Searching in Games a. Minimax Strategy b. Pruning c. Chance

Speedup through Pruning 3... 3 2 2 3 12 8 2 4 6 14 5 2

Speedup through Pruning 3... 3 2 2 3 12 8 2 4 6 14 5 2

Speedup through Pruning 3... A2 is worth at most 2 to MAX 3 2 2 3 12 8 2 4 6 14 5 2

Speedup through Pruning 3 2 2 3... A2 is worth at most 2 to MAX 3 12 8 2 4 6 14 5 2

Alpha-Beta Pruning A sophisticated pruning algorithm Introduced and explained in this week s lab!

Searching in Games a. Minimax Strategy b. Pruning c. Chance

Give Chance a Chance

Weighted Minimax Max Chance 3.56.6.4 Weights Min Chance Max 3.0 4.4 3.6 3.0 5.8 4.4 = 6 * 0.6 + 2 * 0.4.6.4.6.4.6.4.6.4 4 3 3 3 5 7 6 2 2 4 3 2 3 1 2 3 5 2 1 7 5 61 2

References Bratko, I. (2001). PROLOG Programming for Artificial Inte!igence. New York, Addison-Wesley. Kurzweil, R. (1990). The Age of Inte!igent Machines. Cambridge, MA, MIT Press. Newborn, M. (1997). Kasparov versus Deep Blue. Berlin, Springer-Verlag. Nilsson, N. (1998). Artificial Inte!igence A New Synthesis. San Francisco, CA, Morgan Kaufmann. Russel, S., and Norvig, P. (1995). Artificial Inte!igence A Modern Approach. Upper Saddle River, NJ, Prentice Hall.