Docsity

Informed Search Algorithms: Best-First Search and A* Search, Slides of Artificial Intelligence

Partial preview of the text

Download Informed Search Algorithms: Best-First Search and A* Search and more Slides Artificial Intelligence in PDF only on Docsity!

Informed search algorithms

Chapter 4, Sections 1–

Chapter 4, Sections 1–

1

Outline

Best-first search

A

∗

search

Heuristics

Chapter 4, Sections 1–

2

Best-first search

Idea

: use an

evaluation function

for each node

  • estimate of “desirability”

Expand most desirable unexpanded node

Implementation

fringe

is a queue sorted in decreasing order of desirability

Special cases:

A greedy search

∗

search

Chapter 4, Sections 1–

4

Romania with step costs in km

Zerind Vaslui Urziceni Timisoara Sibiu Rimnicu Vilcea Pitesti Oradea Neamt Mehadia Lugoj Iasi Hirsova Giurgiu Fagaras Eforie Dobreta Craiova Bucharest Arad to Bucharest Straight−line distance

0

161242160 77

329253193 241 151 178 366 80

374199 380234 244226 98

Giurgiu

Urziceni

Hirsova Eforie

Neamt

Oradea

Zerind

Arad

Timisoara

Mehadia^ Lugoj

Dobreta

Craiova

Sibiu

Fagaras

Pitesti

Vaslui

Iasi

Rimnicu Vilcea

Bucharest

71

75

118

111

75 70

120

151

140

99

80

97

101

211

138

146

85

90

98 142 92

87

86

Chapter 4, Sections 1–

5

Greedy search example

366 Arad

Chapter 4, Sections 1–

7

Greedy search example

Zerind

Arad

Sibiu

Timisoara

253

329

374

Chapter 4, Sections 1–

8

Greedy search example

Rimnicu Vilcea

Zerind

Arad

Sibiu

Arad

Fagaras

Oradea

Timisoara

Sibiu

Bucharest

329

374

366

380

193

253

0

Chapter 4, Sections 1–

10

Properties of greedy search

Complete

Chapter 4, Sections 1–

11

Properties of greedy search

Complete

No–can get stuck in loops, e.g.,

Iasi

Neamt

Iasi

Neamt

Time Complete in finite space with repeated-state checking

O

b m

) , but a good heuristic can give dramatic improvement

Space

Chapter 4, Sections 1–

13

Properties of greedy search

Complete

No–can get stuck in loops, e.g.,

Iasi

Neamt

Iasi

Neamt

Time Complete in finite space with repeated-state checking

O

b m

) , but a good heuristic can give dramatic improvement

Space

O

b m

) —keeps all nodes in memory

Optimal

Chapter 4, Sections 1–

14

A

∗

search

Idea

: avoid expanding paths that are already expensive

Evaluation function

f (^) ( n

) =

g

( n

) +

h

( n

)

g

( n

)

= cost so far to reach

n

h

( n

)

= estimated cost to goal from

n

f (^) ( n

)

= estimated total cost of path through

n

to goal

A

∗

search uses an

admissible

heuristic

i.e.,

h ( n ) ≤ h ∗ ( n )

where

h

∗ ( n

)

is the

true

cost from

n

.

(Also require

h ( n ) ≥ 0

, so

h

( G

for any goal

G

E.g.,

h

SLD

n

)

never overestimates the actual road distance

Theorem

: A

∗

search is optimal

Chapter 4, Sections 1–

16

A

∗

search example

Arad

366=0+

Chapter 4, Sections 1–

17

A

∗

search example

Zerind

Arad

Sibiu

Arad

Timisoara

Rimnicu Vilcea

Fagaras

Oradea

447=118+

449=75+

646=280+

413=220+

415=239+

671=291+

Chapter 4, Sections 1–

19

A

∗

search example

Zerind

Arad

Sibiu

Arad

Timisoara

Fagaras

Oradea

447=118+

449=75+

646=280+

415=239+

Rimnicu Vilcea

Craiova

Pitesti

Sibiu

526=366+

553=300+

417=317+

671=291+

Chapter 4, Sections 1–

20