Today’s Topics Exam Thursday Oct 22. 5:30-7:3-pm, same room as lecture Makeup Thursday Oct 29? Or that Monday or Wednesday? Exam Covers Material through.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Informed search algorithms
Solving Problem by Searching
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture– 4, 5, 6: A* properties 9 th,10 th and 12 th January,
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Using Search in Problem Solving
Problem Solving and Search in AI Heuristic Search
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Class of 28 th August. Announcements Lisp assignment deadline extended (will take it until 6 th September (Thursday). In class. Rao away on 11 th and.
Informed Search Idea: be smart about what paths to try.
CMU Snake Robot
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
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 Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Cost-based & Informed Search Chapter 4. Review §We’ve seen that one way of viewing search is generating a tree given a state-space graph (explicitly or.
Cost-based & Informed Search Chapter 4. Review §We’ve seen that one way of viewing search is as a graph with nodes & arcs §We’ve begun exploring various.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
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.
Lecture 3: Uninformed Search
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Advanced Artificial Intelligence Lecture 2: Search.
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Informed Search I (Beginning of AIMA Chapter 4.1)
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
Informed Search CSE 473 University of Washington.
Heuristic Search Foundations of Artificial Intelligence.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 2 - Search.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
CE 473: Artificial Intelligence Autumn 2011 A* Search Luke Zettlemoyer Based on slides from Dan Klein Multiple slides from Stuart Russell or Andrew Moore.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17– Theorems in A* (admissibility, Better performance.
Solving problems by searching Uninformed search algorithms Discussion Class CS 171 Friday, October, 2nd (Please read lecture topic material before and.
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
CS Fall 2016 (Shavlik©), Lecture 8, Week 5
CS 4100 Artificial Intelligence
CS Fall 2016 (Shavlik©), Lecture 9, Week 5
Informed search algorithms
Informed search algorithms
CS Fall 2016 (Shavlik©), Lecture 10, Week 6
Artificial Intelligence
CS621: Artificial Intelligence
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
HW 1: Warmup Missionaries and Cannibals
CS621: Artificial Intelligence
Artificial Intelligence
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Informed Search Idea: be smart about what paths to try.
Presentation transcript:

Today’s Topics Exam Thursday Oct 22. 5:30-7:3-pm, same room as lecture Makeup Thursday Oct 29? Or that Monday or Wednesday? Exam Covers Material through End of Lecture 14 Part of Oct 20 class will be Exam Review –Bring (worked!) copy of my Fall 2014 cs540 midterm I will Arrange for TA to come to Epic Oct 21, 5:30-7:30pm What if Arcs have Costs? –Finding Least-Cost Solutions (eg, GPS, Google Maps) –Uniform-cost search, A* search –Heuristic functions Search Wrapup (except genetic and games) 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 51

What if Arcs Have Costs? Might want CHEAPEST solutions –and be willing to spend more cpu cycles We’ll put (non-negative) costs on arcs –If costs negative, infinite loops would be great! 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 52 S B G

Uniform Cost Search (UC) Sort OPEN by g(node), which is the cost from a/the startNode to node by the path taken to reach node Need to store ‘parent pointers’ in nodes (so can ‘back trace’ to startNode) Sometimes we will need to change these pointers if a CHEAPER path to node found 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 3

Addition to Our Generic Search Code If a child of X is ALREADY IN OPEN OR CLOSED, see if current path is better If so, remove old item from OPEN/CLOSED and insert new item in OPEN Otherwise discard child –In some cases non-optimal paths will never reach CLOSED, but safer to always check 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 4

New and Improved, Now with Arc Costs - assume LOWER scores are better 10/6/15 CS Fall 2015 (Shavlik©), Lecture 11, Week 5 5 Start score = 9 B score = 11 C score = 8 D score = 4 E score = 3 Goal score = 0 Step# OPEN CLOSED X CHILDREN RemainingCHILDREN (this part done on doc camera for UNIFORM and, later, A*)

UC - not shown, but you should use a SUPERSCRIPT to show parent Step# OPEN CLOSED X CHILDREN RemCHILDREN 1 { S 0 } { } S { S 5, B 1, C 6 } { B 1, C 6 } 2 { B 1, C 6 } { S 0 } B { D 8 } { D 8 } 3 { C 6, D 8 } { S 0, B 1 } C { G 15 } { G 15 } 4 { D 8, G 15 } { S 0, B 1, C 6 } D { E 10, C 16 } { E 10 } 5 { E 10, G 15 } { S 0, B 1, C 6, D 8 } E { G 14 } { G 14 } 6 { G 14 } { S 0, B 1, C 6, D 8, E 10 } G DONE A* - subscript is g+h Step# OPEN CLOSED X CHILDREN RemCHILDREN 1 { S 0+9 } { } S 0+9 { S 5+9, B 1+11, C 6+8 } { B 1+11, C 6+8 } 2 { B 1+11, C 6+8 } { S 0+9 } B 1+11 { D 8+4 } { D 8+4 } 3 { D 8+4, C 6+8 } { S 0+9, B 1+11 } D 8+4 { E 10+3, C 16+8 } { E 10+3 } 4 { E 10+3, C 6+8 } {S 0+9, B 1+11, D 8+4 } E 10+3 { G 14+0 } { G 14 } 5 { C 6+8, G 14+0 } {… E 10+3 } C 6+8 { G 15+0 } { } 6 { G 14+0 } {… E 10+3, C 6+8 } G 14+0 DONE 9/29/15CS Fall 2015 (Shavlik©), Lecture 9, Week 4 Lecture 1, Slide 6

Theorem Uniform-cost search will produce a lowest-cost solution PROOF Assume we have found solution path S that costs C If cheaper soln exists, the beginning of it would be in OPEN (we keep ALL partial solns) Since all arc costs are non-negative, this partial soln would cost less than C (total costs never get smaller) But by construction, we POP OPEN and lowest-cost always at front Hence cannot have something something still in OPEN that costs less than C 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 7

UC Doesn’t Use Domain K (K = knowledge) Under certain conditions (later), sorting by this will get a shortest path f(node) = g(node) + h(node) while possible ‘expanding’ many fewer nodes h(node) is our heuristic estimate of ‘distance’ to goal 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 8 S n G g(n) h(n)

Practice with f(n) Go back to Slide 5 and use f(n) An example where using h(n) greatly helps 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 9 h=94 SA D F E C B G Z h=89...

Graph Where One Needs to Remove Item from CLOSED (also shows why we check for GOAL when REMOVING from OPEN, rather than when ADDING) 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 10 S h=3 B h=20 C h= G h=0 99

Admissibility Defn: if a search algo always produces shortest paths (assuming one exists), then the algo is called admissible If h(n) never over estimates the actual distance to a goal, then using f(n)=g(n)+h(n) will lead to best-first search being admissible (and we also call h(n) admissible) BEST with an admissible h(n) is called A* (pronounced “A star” – some AI humor!) Note that A* can have large OPEN and CLOSED since all promising partial paths kept 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 11

What Happens if h(n) Overestimates? Best solution might get pushed deep into OPEN and never checked 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 12 S h=3 B h=999 C h= G h=0 99

What Happens if h(n) Underestimates? Might waste time on a non-optimal path 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 13 S h=3 B h=1 C h= G h=0 99 D h=1...

Creating Good h Functions Mainly a task-specific ‘art’ h(n) should be a fast algorithm (would not be good if h(n) implemented DFS!) Often ‘simplifying assumptions’ or ‘relaxations’ of the task create good h’s Note that user focuses on creating h using domain K and A* ‘works out the details’ 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 14

Some Properties of A* 1.“Informedness” If h 1 (n) and h 2 (n) are both admissible, and  n h 1 (n)  h 2 (n) then the nodes A* expands using h 1 (n) are a subset of those it expands using h 2 (n) Visually 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 15 h True distance h1h1 h2h2 error So the better h(n) is, the faster A* runs

Some Properties of A* 2.“Robustness” If h ‘rarely’ overestimates by more than , then A* will rarely find a sol’n whose cost is  more than optimal 2.“Completeness” A* will terminate with a optimal soln even in infinite space, provided a soln exists and all arc costs are greater than some positive number  10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 16

THINK Before You Search! Naïve Algo ACTIONS: Fill ‘top-left most’ empty cell with legal moves in {1, 2, …, 9 } LARGE search tree! Smarter Algo (usually NEVER need to search!) 1)Mark each empty cell with candidates that do not violate game’s rules, eg, top cell in this image can be filled with {3, 5, 8, or 9} 2)IF NO cells with only one possible filler Let k be the smaller set of fillers, pick ‘top-left most’ cell with k fillers and put the k next board states in OPEN 3)ELSE For all those cells with only ONE possible filler, choose that filer If game solved EXIT else update “possible fillers’” for all empty cells and go to 2 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 17 Only 2 legal here

Search Wrap Up Lots of Variations and Tradeoffs We’ve Explored a Wide Range but not All Powerful, General-Purpose, Problem-Solving Method –Watch for Places it can be Employed –Especially when cpu cycles abundant OPEN a Key Data Structure –CLOSED Prevents Repeated Work Our General Search Algo Inefficient for Some Methods, but Provides a Unifying View –Needs Modification for Some Methods to Work Correctly Heuristic Functions a Good Way to Use Domain K in Intuitive Way Next: Search with an Adversary (game playing) Then: Genetic Search (based on evolution) 10/6/15CS Fall 2015 (Shavlik©), Lecture 11, Week 5 18