• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 13. State-Space Search: Heuristics Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 13. State-Space Search: Heuristics Malte Helmert"

Copied!
17
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

13. State-Space Search: Heuristics

Malte Helmert

University of Basel

March 22, 2021

(2)

Introduction Heuristics Examples Summary

State-Space Search: Overview

Chapter overview: state-space search 5.–7. Foundations

8.–12. Basic Algorithms 13.–19. Heuristic Algorithms

13. Heuristics

14. Analysis of Heuristics 15. Best-first Graph Search

16. Greedy Best-first Search, A, Weighted A 17. IDA

18. Properties of A, Part I 19. Properties of A, Part II

(3)

Introduction Heuristics Examples Summary

Introduction

(4)

Introduction Heuristics Examples Summary

Informed Search Algorithms

search algorithms considered so far: blind

because they do not use any aspects of the problem to solve other than its formal definition (state space)

problem: scalability

prohibitive time and space requirements already for seeminglysimpleproblems idea: try to find (problem-specific) criteria to distinguishgood andbad states

prefer good states

informed (“heuristic”) search algorithms

(5)

Introduction Heuristics Examples Summary

Heuristics

(6)

Introduction Heuristics Examples Summary

Heuristics

Definition (heuristic)

LetS be a state space with statesS.

Aheuristic functionor heuristic for S is a function

h:S →R+0 ∪ {∞},

mapping each state to a non-negative number (or∞).

(7)

Introduction Heuristics Examples Summary

Heuristics: Intuition

idea: h(s) estimates distance (= cost of cheapest path)

idea:

froms to closest goal state

heuristics can be arbitrary functions

intuition: the closerh is to true goal distance, the more efficient the search using h

Heuristics are sometimes defined forsearch nodesinstead of states, but this increased generality is rarely useful. (Why?)

(8)

Introduction Heuristics Examples Summary

Why “Heuristic”?

What does “heuristic” mean?

heuristic: from ancient Greekἑυρισκω (= I find) compare: ἑυρηκα!

popularized by George P´olya: How to Solve It (1945) in computer science often used for:

rule of thumb, inexact algorithm

in state-space searchtechnical termforgoal distance estimator

(9)

Introduction Heuristics Examples Summary

Representation of Heuristics

In our black box model, heuristics are an additional element of the state space interface:

State Spaces as Black Boxes (Extended) init()

is goal(s) succ(s) cost(a)

h(s): heuristic value for states result: non-negative integer or ∞

(10)

Introduction Heuristics Examples Summary

Examples

(11)

Introduction Heuristics Examples Summary

Example: Blocks World

possible heuristic:

count blocksx that currently lie on y and must lie on z 6=y in the goal (including case wherey orz is the table)

How accurate is this heuristic?

(12)

Introduction Heuristics Examples Summary

Example: Blocks World

possible heuristic:

count blocksx that currently lie on y and must lie on z 6=y in the goal (including case wherey orz is the table) How accurate is this heuristic?

(13)

Introduction Heuristics Examples Summary

Example: Route Planning in Romania

possible heuristic: straight-line distance to Bucharest

Giurgiu

Urziceni Hirsova

Eforie Neamt

Oradea

Zerind Arad

Timisoara Lugoj

Mehadia

Dobreta

Craiova Sibiu Fagaras

Pitesti

Vaslui Iasi

Rimnicu Vilcea

Bucharest 71

75

118

111 70

75 120 151

140

99 80

97

101 211

138

146 85

90

98 142 92 87

86

Arad 366

Bucharest 0

Craiova 160

Drobeta 242

Eforie 161

Fagaras 176

Giurgiu 77

Hirsova 151

Iasi 226

Lugoj 244

Mehadia 241

Neamt 234

Oradea 380

Pitesti 100

Rimnicu Vilcea 193

Sibiu 253

Timisoara 329

Urziceni 80

Vaslui 199

Zerind 374

(14)

Introduction Heuristics Examples Summary

Example: Missionaries and Cannibals

Setting: Missionaries and Cannibals Six people must cross a river.

Their rowing boat can carry one or two people across the river at a time (it is too small for three).

Three people are missionaries, three are cannibals.

Missionaries may never stay with a majority of cannibals.

possible heuristic: number of people on the wrong river bank with our formulation of states as tripleshm,c,bi:

h(hm,c,bi) =m+c

(15)

Introduction Heuristics Examples Summary

Example: Missionaries and Cannibals

Setting: Missionaries and Cannibals Six people must cross a river.

Their rowing boat can carry one or two people across the river at a time (it is too small for three).

Three people are missionaries, three are cannibals.

Missionaries may never stay with a majority of cannibals.

possible heuristic: number of people on the wrong river bank with our formulation of states as tripleshm,c,bi:

h(hm,c,bi) =m+c

(16)

Introduction Heuristics Examples Summary

Summary

(17)

Introduction Heuristics Examples Summary

Summary

heuristics estimate distance of a state to the goal can be used tofocussearch on promising states soon: search algorithms that use heuristics

Referenzen

ÄHNLICHE DOKUMENTE

recognize duplicates: when a state is reached on multiple paths, only keep one search node search nodes correspond 1:1 to reachable states search tree bounded, as number of states

breadth-first search ( this chapter) uniform cost search ( Chapter 11) depth-first search ( Chapter 12) depth-limited search ( Chapter 12) iterative deepening search ( Chapter

breadth-first search optimal if all action costs equal otherwise no optimality guarantee example:.. remedy: uniform

space complexity O(bm) if m maximal search depth reached low memory complexity main reason why depth-first search interesting despite its disadvantages.. Depth-first

Helmert (University of Basel) Foundations of Artificial Intelligence March 24, 2021 2 / 16.. State-Space

In IDDFS, we grow the limit from the smallest limit that gives a non-empty search tree (0) by 1 at a time. This usually leads to exponential growth of

f -bound lemma: The minimum f value in the open list at the beginning of each A ∗ iteration is a lower bound on the optimal

f values never decrease along paths considered by A ∗ sequence of f values of expanded nodes is non-decreasing time complexity depends on heuristic and shape of state space.