Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Informed Search in Artificial Intelligence, Study notes of Artificial Intelligence

The concept of informed search in artificial intelligence, specifically focusing on A* search. It covers the properties of heuristics, stopping rules, and analysis. The document also explores the tradeoffs of using a complex heuristic function and the termination of A* search. The University of Wisconsin-Madison offers a course on Introduction to Artificial Intelligence, which covers these topics. The document could be useful as study notes or a summary for students taking this course.

Typology: Study notes

2021/2022

Uploaded on 05/11/2023

sureesh
sureesh 🇺🇸

4.8

(9)

12 documents

1 / 41

Toggle sidebar

Related documents


Partial preview of the text

Download Introduction to Informed Search in Artificial Intelligence and more Study notes Artificial Intelligence in PDF only on Docsity! CS 540 Introduction to Artificial Intelligence Search II: Informed Search University of Wisconsin-Madison Fall 2022 Outline • Uninformed vs Informed Search – Review of uninformed strategies, adding heuristics • A* Search – Heuristic properties, stopping rules, analysis • Extensions: Beyond A* – Iterative deepening, beam search Depth-First Search Recall: expand deepest node first • Data structure: stack • Properties: – Incomplete (stuck in infinite tree…) – Suboptimal – Time O(bm) – Space O(bm) Wiki Max Depth Fractalsaco Iterative Deepening DFS Repeated limited DFS • Search like BFS, fringe like DFS • Properties: – Complete – Optimal (if edge cost 1) – Time O(bd) – Space O(bd) A good option! Uninformed vs Informed Search Uninformed search (all of what we saw). Know: • Path cost g(s) from start to node s • Successors. Informed search. Know: • All uninformed search properties, plus • Heuristic h(s) from s to goal (recall game heuristic) start s goal g(s) start s goal g(s) h(s) Attempt 1: Best-First Greedy One approach: just use h(s) alone • Specifically, expand node with smallest h(s) • This isn’t a good idea. Why? • Not optimal! Get A → C → G. Want: A →B → C → G BA GC h=3 h=2 h=1 h=0 1 1 1 999 Attempt 2: A Search Next approach: use both g(s) + h(s) alone • Specifically, expand node with smallest g(s) + h(s) • Again, use a priority queue • Called “A” search • Still not optimal! (Does work for former example). BA GC h=3 h=1000 h=1 h=0 1 1 1 999 Attempt 3: A* Search Same idea, use g(s) + h(s), with one requirement • Demand that h(s) £ h*(s) • If heuristic has this property, “admissible” – Optimistic! Never over-estimates • Still need h(s) ≥ 0 – Negative heuristics can lead to strange behavior • This is A* search V. Batoćanin Break & Quiz Q 1.1: Consider finding the fastest driving route from one US city to another. Measure cost as the number of hours driven when driving at the speed limit. Let h(s) be the number of hours needed to ride a bike from city s to your destination. h(s) is • A. An admissible heuristic • B. Not an admissible heuristic Break & Quiz Q 1.1: Consider finding the fastest driving route from one US city to another. Measure cost as the number of hours driven when driving at the speed limit. Let h(s) be the number of hours needed to ride a bike from city s to your destination. h(s) is • A. An admissible heuristic • B. Not an admissible heuristic Break & Quiz Q 1.1: Consider finding the fastest driving route from one US city to another. Measure cost as the number of hours driven when driving at the speed limit. Let h(s) be the number of hours needed to ride a bike from city s to your destination. h(s) is • A. An admissible heuristic No: riding your bike takes longer. • B. Not an admissible heuristic Break & Quiz Q 1.2: Which of the following are admissible heuristics? (i) h(s) = h*(s) (ii) h(s) = max(2, h*(s)) No: h(s) might be too big (iii) h(s) = min(2, h*(s)) (iv) h(s) = h*(s)-2 No: h(s) might be negative (v) h(s) = sqrt(h*(s)) No: if h*(s) < 1 then h(s) is bigger • A. All of the above • B. (i), (iii), (iv) • C. (i), (iii) • D. (i), (iii), (v) Heuristic Function Tradeoffs Dominance: h2 dominates h1 if for all states s, h1(s) £ h2(s) £ h*(s) • Idea: we want to be as close to h* as possible – But not over! • Tradeoff: being very close might require a very complex heuristic, expensive computation – Might be better off with cheaper heuristic & expand more nodes. A* Termination When should A* stop? • One idea: as soon as we reach goal state? • h admissible, but note that we get A →B → G (cost 1000)! B A G C 9991 1 1 h=2 h=0 h=0 h=1 A* Full Algorithm 1. Put the start node S on the priority queue, called OPEN 2. If OPEN is empty, exit with failure 3. Remove from OPEN and place on CLOSED a node n for which f(n) is minimum (note that f(n)=g(n)+h(n)) 4. If n is a goal node, exit (trace back pointers from n to S) 5. Expand n, generating all successors and attach to pointers back to n. For each successor n' of n 1. If n' is not already on OPEN or CLOSED estimate h(n'), g(n')=g(n)+ c(n,n'), f(n')=g(n')+h(n’), and place it on OPEN. 2. If n' is already on OPEN or CLOSED, then check if g(n') is lower for the new version of n'. If so, then: 1. Redirect pointers backward from n' along path yielding lower g(n'). 2. Put n' on OPEN. 3. If g(n') is not lower for the new version, do nothing. 6. Goto 2. A* Analysis Some properties: • Terminates! • A* can use lots of memory: O(# states). • Will run out on large problems. • Next, we will consider some alternatives to deal with this. Break & Quiz Q 2.1: Consider two heuristics for the 8 puzzle problem. h1 is the number of tiles in wrong position. h2 is the l1/Manhattan distance between the tiles and the goal location. How do h1 and h2 relate? • A. h2 dominates h1 • B. h1 dominates h2 • C. Neither dominates the other Break & Quiz Q 2.2: Consider the state space graph below. Goal states have bold borders. h(s) is show next to each node. What node will be expanded by A* after the initial state I? • A. A • B. B • C. C Break & Quiz Q 2.2: Consider the state space graph below. Goal states have bold borders. h(s) is show next to each node. What node will be expanded by A* after the initial state I? • A. A • B. B • C. C IDA*: Iterative Deepening A* Similar idea to our earlier iterative deepening. • Bound the memory in search. • At each phase, don’t expand any node with g(s) + h(s) > k, – Assuming integer costs, do this for k=0, then k=1, then k=2, and so on • Complete + optimal, might be costly time-wise – Revisit many nodes • Lower memory use than A* Fractalsaco Recap and Examples Example for A*: S A B C D E G 1 5 8 3 7 9 4 5 Goal state Initial stateh=8 h=7 h=4 h=3 h=0h=infh=inf Recap and Examples Example for A*: S A B C D E G 1 5 8 3 7 9 4 5 Goal state Initial stateh=8 h=7 h=4 h=3 h=0h=infh=inf OPEN S(0+8) A(1+7) B(5+4) C(8+3) B(5+4) C(8+3) D(4+inf) E(8+inf) G(10+0) C(8+3) D(4+inf) E(8+inf) G(9+0) C(8+3) D(4+inf) E(8+inf) CLOSED - S(0+8) S(0+8) A(1+7) S(0+8) A(1+7) B(5+4) S(0+8) A(1+7) B(5+4) G(9+0) G → B → S Recap and Examples Example for IDA*: Threshold = 8 S A B C D E G 1 5 8 3 7 9 4 5 Goal state Initial stateh=8 h=7 h=4 h=3 h=0h=infh=4 L 2 h=inf K 3 h=inf J 5 h=inf I 7 h=inf H 1 h=2 F4 h=1 4 OPEN S(0+8) A(1+7) H(2+2) D(4+4) D(4+4) F(6+1) D(4+4) PREFIX - S S A S A H S A H F S A D Summary • Informed search: introduce heuristics – Not all approaches work: best-first greedy is bad • A* algorithm – Properties of A*, idea of admissible heuristics • Beyond A* – IDA*, beam search. Ways to deal with space requirements. Acknowledgements: Adapted from materials by Jerry Zhu (University of Wisconsin).
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved