CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 4 Jim Martin.

Slides:



Advertisements
Similar presentations
Lights Out Issues Questions? Comment from me.
Advertisements

CMSC 471 Fall 2002 Class #5-6 – Monday, September 16 / Wednesday, September 18.
Review: Search problem formulation
Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
CMSC 671 Fall 2005 Class #5 – Thursday, September 15.
Informed search strategies
Informed search algorithms
An Introduction to Artificial Intelligence
Informed Search Strategies
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Solving Problem by Searching
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2002.
A* Search Introduction to AI. What is an A* Search? A greedy search method minimizes the cost to the goal by using an heuristic function, h(n). It works.
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
Artificial Intelligence
Artificial Intelligence Chapter 3: Solving Problems by Searching
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2004.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
CSCI 5582 Fall 2006 Page 1 CSCI 5582 Artificial Intelligence Lecture 3 Jim Martin.
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
Cooperating Intelligent Systems Informed search Chapter 4, AIMA 2 nd ed Chapter 3, AIMA 3 rd ed.
Uninformed Search (cont.)
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Computer Science CPSC 322 Lecture Heuristic Search (Ch: 3.6, 3.6.1) Slide 1.
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
Problem-Solving by Searching Uninformed (Blind) Search Algorithms.
2013/10/17 Informed search A* algorithm. Outline 2 Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Include specific knowledge to efficiently conduct the search and find the solution.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
1 Solving problems by searching 171, Class 2 Chapter 3.
Informed Search I (Beginning of AIMA Chapter 4.1)
Artificial Intelligence Problem solving by searching.
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
A General Introduction to Artificial Intelligence.
Heuristic Search Foundations of Artificial Intelligence.
Introduction to Artificial Intelligence (G51IAI)
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
Fahiem Bacchus © 2005 University of Toronto 1 CSC384: Intro to Artificial Intelligence Search II ● Announcements.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Search Methodologies Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
For Monday Read chapter 4 exercise 1 No homework.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2008 Lecture #2.
Informed Search Methods
Review: Tree search Initialize the frontier using the starting state
Artificial Intelligence (CS 370D)
Heuristic Search Introduction to Artificial Intelligence
Artificial Intelligence Problem solving by searching CSC 361
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
EA C461 – Artificial Intelligence
COMP 8620 Advanced Topics in AI
Informed search algorithms
Artificial Intelligence
CS 416 Artificial Intelligence
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Artificial Intelligence: Theory and Practice Ch. 3. Search
Presentation transcript:

CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 4 Jim Martin

CSCI 5582 Fall 2006 Today 9/7 Review Depth-limits Administration Uninformed and informed methods A* and Heuristics Beam search IDA*

CSCI 5582 Fall 2006 Review What’s the primary way to specialize the general search function?

CSCI 5582 Fall 2006 Review Note: I’ll probably wind up using the terms agenda and queue (among others) fairly interchangeably to refer to the list of generated but not yet explored states (the nodes variable in the general search code).

CSCI 5582 Fall 2006 Review What’s the difference between the book’s Tree-Search and Graph-Search algorithms.

CSCI 5582 Fall 2006 BFS, Uniform Cost, DFS BFS –Insert new nodes at the end Uniform cost –Sort the agenda by cost DFS –Insert new nodes at the front

CSCI 5582 Fall 2006 BFS and DFS Trade-offs BFS –Complete, memory inefficient, generally not optimal, generally slow Uniform Cost –Complete, optimal, generally memory inefficient, generally slow DFS –Not complete, not optimal, memory efficient, can be fast (or slow)

CSCI 5582 Fall 2006 Iterative Deepening Best of BFS and DFS Depth-limited DFS search with an ever increasing depth limit –Memory behavior of DFS –Completeness of BFS

CSCI 5582 Fall 2006 ID-search, example Limit=0

CSCI 5582 Fall 2006 ID-search, example Limit=1

CSCI 5582 Fall 2006 ID-search, example Limit=2

CSCI 5582 Fall 2006 ID-search, example Limit=3

CSCI 5582 Fall 2006 Administration Homework questions? –import package vs. reload(package) –Current python is 2.4.3; 2.5 is scheduled for release in a couple of weeks; first release candidate is available now –Homework details Lastname-mobiles.py means your last name not “last- name” and not “mobiles.py”. Attach means attach as a file not include text in the message body.

CSCI 5582 Fall 2006 Informed and Uninformed Techniques What do we know with uninformed methods? –What states we can get to from other states –The nodes that have been generated –We know a goal when we see it –We can know the cost of solution thus far

CSCI 5582 Fall 2006 Informed and Uninformed Techniques So what are we uninformed about? –We’re uninformed about how close a given state is to a goal state –More precisely, we’re uninformed about the cost of achieving a goal state from some non-goal state

CSCI 5582 Fall 2006 Informed Searches Review Uniform Cost Best first A* IDA* Recursive Best First Search

CSCI 5582 Fall 2006 Uniform Cost One more time… what’s the basis for the ordering of nodes in uniform cost? –They’re examined in order of their cost so far (we’ll call this the g-cost).

CSCI 5582 Fall 2006 Greedy (Apparently) Best First In this scheme, nodes are expanded on the basis of a guess about the cost of getting from a state to a goal (ignoring g, the cost so far). We’ll call a method for making such a guess a heuristic (call it h).

CSCI 5582 Fall 2006 Greedy Example Cost function is h(n) the guess about the cost of getting from n to the goal In the map domain this could be the straight line distance from a city to Bucharest Greedy search expands the node that is currently closest to the goal

CSCI 5582 Fall 2006 Greedy Example Arad 366 Sibiu 253 Zerind 374 Timisoara 329 Arad 366 Oradea 380 Fagaras 178 Rimniciu 193 Bucharest 0Sibiu 253

CSCI 5582 Fall 2006 Greedy Search Complete? –Nope Optimal? –Nope Time and Space? –It depends

CSCI 5582 Fall 2006 Best of Both In an A* search we combine the best parts of Uniform-Cost and Best-First. We want to use the cost so far to allow optimality and completeness, while at the same time using a heuristic to draw us toward a goal.

CSCI 5582 Fall 2006 A* In an A* search nodes are ordered according to g(n)+h(n). If h(n) does not overestimate the real cost then the search is optimal. An h function that does not overestimate is called admissible

CSCI 5582 Fall 2006 Arad 366 Sibiu 393 Zerind 449 Timisoara 447 Arad 646 Oradea526 Fagaras 417 Rimniciu 413 Bucharest 450 Sibiu 591 Sibiu 553Pitesti 415Craiova 526 Bucharest 418 Craiova 615 Rimniciu 607

CSCI 5582 Fall 2006 Key Points Agenda is based on g+h h must not overestimate to guarantee optimality The location of the goal test in the general search code is critical

CSCI 5582 Fall 2006 Optimality of A* Proof by contradiction: Assume an A* search returned a non-optimal answer. What would that mean? –There’s another solution out there that costs less than the one that was returned as the answer.

CSCI 5582 Fall 2006 A* Optimality What do you know about any node in the agenda that is on the path to this supposedly better solution? –Its cost is ≤ the solution cost. Why? What do you know about the relation between the cost of the solution found and this intermediate node? –Its cost is ≤ the intermediate node. Why?

CSCI 5582 Fall 2006 A* Optimality So…. The cost of the found solution is ≤ the cost of the supposedly better solution. This contradicts the assumption we began with.

CSCI 5582 Fall 2006 A* and Intelligence Where’s the intelligence in an A* search? –In the heuristic

CSCI 5582 Fall 2006 Admissible Heuristics The 8-puzzle (a small version of the 15 puzzle). Sample heuristics Number of misplaced tiles Manhattan distance

CSCI 5582 Fall Puzzle Example H1(S) = 7 H2(S) = = 18 Which heuristic is better?

CSCI 5582 Fall 2006 Sources of Heuristics Ad-hoc, informal, rules of thumb (guesswork) Approximate solutions to problems Exact solutions to different (relaxed) problems

CSCI 5582 Fall 2006 Approximate Solution Example TSP is hard Minimum spanning tree is easy So… use MST to get an approximate solution to TSP

CSCI 5582 Fall 2006 TSP/MST Example a b e h g f c d

CSCI 5582 Fall 2006 TSP/MST Example a b e h g f c d

CSCI 5582 Fall 2006 TSP/MST cont. An MST generated estimate is guaranteed to be no more than twice the optimal tour. How do you use that as an admissible heuristic?

CSCI 5582 Fall 2006 Exact Solutions to Different Problems Transform the problem into a different (easier problem). Easier usually means a problem with some constraints removed or relaxed. The cost of an exact solution to a relaxed problem is an estimate of the cost of the real problem.

CSCI 5582 Fall 2006 Restrictions on Heuristics Why not embed an exhaustive solution to the problem as a heuristic? More realistic issue: the more computationally complex a heuristic is, the less of the search space you’ll be able to examine.

CSCI 5582 Fall 2006 A* and Memory Does A* solve the memory problems with BFS and Uniform Cost? –Well sort of. Solve is a loaded term. A* has better memory performance than BFS or Uniform Cost. –But it might not enough better to make a difference in practical terms.

CSCI 5582 Fall 2006 A* Agenda Management What mechanism does A* use to control the size of its internal agenda? –None So what happens when it gets too big?

CSCI 5582 Fall 2006 Beam Search Simple solution –Chop the end of the agenda when a fixed limit is reached. What’s wrong with this? –Gives up optimality and completeness But this is a practical solution often used in real applications (commercial speech recognizers use beam search)

CSCI 5582 Fall 2006 IDA* Use depth first memory management. But add an iteratively increasing depth bound. And make the bound based on g+h rather than depth in the tree.

CSCI 5582 Fall 2006 IDA* Example Arad 366 Sibiu 393 Zerind 449 Timisoara 447 Arad 646 Oradea526 Fagaras 417 Rimniciu 413 Bucharest 450 Sibiu 591 Sibiu 553Pitesti 415Craiova 526 Bucharest 418 Craiova 615 Rimniciu 607

CSCI 5582 Fall 2006 Next Time Optimization search (sec. 4.3) Constraint sat search (Ch. 5)