• Keine Ergebnisse gefunden

16. State-Space Search: Greedy BFS, A ∗ , Weighted A ∗

N/A
N/A
Protected

Academic year: 2022

Aktie "16. State-Space Search: Greedy BFS, A ∗ , Weighted A ∗"

Copied!
6
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

16. State-Space Search: Greedy BFS, A , Weighted A

Malte Helmert

University of Basel

March 29, 2021

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 1 / 23

Foundations of Artificial Intelligence

March 29, 2021 — 16. State-Space Search: Greedy BFS, A

, Weighted A

16.1 Introduction

16.2 Greedy Best-first Search 16.3 A

16.4 Weighted A 16.5 Summary

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 2 / 23

State-Space Search: Overview

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

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

I 13. Heuristics

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

I 16. Greedy Best-first Search, A

, Weighted A

I 17. IDA

I 18. Properties of A

, Part I I 19. Properties of A

, Part II

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 3 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Introduction

16.1 Introduction

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 4 / 23

(2)

16. State-Space Search: Greedy BFS, A, Weighted A Introduction

What Is It About?

In this chapter we study last chapter’s algorithms in more detail:

I greedy best-first search I A

I weighted A

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 5 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Greedy Best-first Search

16.2 Greedy Best-first Search

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 6 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Greedy Best-first Search

Greedy Best-first Search

Greedy Best-first Search

only consider the heuristic: f (n) = h(n.state)

Note: usually without reopening (for reasons of efficiency)

16. State-Space Search: Greedy BFS, A, Weighted A Greedy Best-first Search

Example: Greedy Best-first Search for Route Planning

Urziceni Hirsova Neamt

Oradea

Zerind Arad

Timisoara Lugoj

Mehadia

Dobreta

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 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

(3)

16. State-Space Search: Greedy BFS, A, Weighted A Greedy Best-first Search

Example: Greedy Best-first Search for Route Planning

Rimnicu Vilcea

Zerind Arad

Sibiu

Arad Fagaras Oradea

Timisoara

Sibiu Bucharest

329 374

366 380 193

253 0

Rimnicu Vilcea Arad

Sibiu

Arad Fagaras Oradea

Timisoara 329

Zerind 374

366 176 380 193

Zerind Arad

Sibiu Timisoara

253 329 374

Arad 366 (a) The initial state

(b) After expanding Arad

(c) After expanding Sibiu

(d) After expanding Fagaras

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 9 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Greedy Best-first Search

Greedy Best-first Search: Properties

I complete with safe heuristics

(like all variants of best-first graph search) I suboptimal: solutions can be arbitrarily bad

I often very fast: one of the fastest search algorithms in practice I monotonic transformations of h (e.g. scaling, additive

constants) do not affect behaviour (Why is this interesting?)

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 10 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

16.3 A

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 11 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

A

A

combine greedy best-first search with uniform cost search:

f (n) = g (n) + h(n.state)

I trade-off between path cost and proximity to goal I f (n) estimates overall cost of cheapest solution

from initial state via n to the goal

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 12 / 23

(4)

16. State-Space Search: Greedy BFS, A, Weighted A A

A : Citations

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 13 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

Example: A for Route Planning

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

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 14 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

Example: A for Route Planning

(a) The initial state (b) After expanding Arad

(c) After expanding Sibiu

Arad

Sibiu Timisoara

447=118+329

Zerind 449=75+374 393=140+253

Arad 366=0+366

(d) After expanding Rimnicu Vilcea

(e) After expanding Fagaras

(f) After expanding Pitesti

Zerind Arad

Sibiu

Arad

Timisoara

Rimnicu Vilcea Fagaras Oradea

447=118+329 449=75+374

646=280+366415=239+176 671=291+380413=220+193

Zerind Arad

Sibiu Timisoara

447=118+329 449=75+374

Rimnicu Vilcea

Craiova Pitesti Sibiu 526=366+160417=317+100553=300+253

Zerind Arad

Sibiu

Arad

Timisoara

Sibiu Bucharest Fagaras Oradea

Craiova Pitesti Sibiu

447=118+329 449=75+374

646=280+366

591=338+253 450=450+0 526=366+160417=317+100553=300+253 671=291+380

Arad Rimnicu Vilcea

Arad Fagaras Oradea

646=280+366 415=239+176 671=291+380

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 15 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

Example: A for Route Planning

(a) The initial state (b) After expanding Arad

(c) After expanding Sibiu

Arad

Sibiu Timisoara

447=118+329

Zerind 449=75+374 393=140+253

Arad 366=0+366

(d) After expanding Rimnicu Vilcea

(e) After expanding Fagaras

(f) After expanding Pitesti

Zerind Arad

Sibiu

Arad

Timisoara

Rimnicu Vilcea Fagaras Oradea

447=118+329 449=75+374

646=280+366415=239+176 671=291+380413=220+193

Zerind Arad

Sibiu Timisoara

447=118+329 449=75+374

Rimnicu Vilcea

Craiova Pitesti Sibiu 526=366+160417=317+100553=300+253

Zerind Arad

Sibiu

Arad

Timisoara

Sibiu Bucharest Fagaras Oradea

Craiova Pitesti Sibiu

447=118+329 449=75+374

646=280+366

591=338+253 450=450+0 526=366+160417=317+100553=300+253 671=291+380

Zerind Arad

Sibiu

Arad

Timisoara

Sibiu Bucharest Oradea

Craiova Pitesti Sibiu

Bucharest Craiova Rimnicu Vilcea 418=418+0

447=118+329 449=75+374

646=280+366

591=338+253 450=450+0 526=366+160 553=300+253

615=455+160 607=414+193 671=291+380

Rimnicu Vilcea

Fagaras Rimnicu Vilcea

Arad Fagaras Oradea

646=280+366 415=239+176 671=291+380

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 16 / 23

(5)

16. State-Space Search: Greedy BFS, A, Weighted A A

A : Properties

I complete with safe heuristics

(like all variants of best-first graph search)

I with reopening: optimal with admissible heuristics I without reopening: optimal with heuristics

that are admissible and consistent proofs: Chapters 18 and 19

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 17 / 23

16. State-Space Search: Greedy BFS, A, Weighted A A

A : Implementation Aspects

some practical remarks on implementing A : I common bug: reopening not implemented

although heuristic is not consistent I common bug: duplicate test “too early”

(upon generation of search nodes) I common bug: goal test “too early”

(upon generation of search nodes) I all these bugs lead to loss of optimality

and can remain undetected for a long time

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 18 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Weighted A

16.4 Weighted A

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 19 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Weighted A

Weighted A

Weighted A

A with more heavily weighted heuristic:

f (n) = g (n) + w · h(n.state),

where weight w ∈ R + 0 with w ≥ 1 is a freely choosable parameter Note: w < 1 is conceivable, but usually not a good idea

(Why not?)

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 20 / 23

(6)

16. State-Space Search: Greedy BFS, A, Weighted A Weighted A

Weighted A : Properties

weight parameter controls “greediness” of search:

I w = 0: like uniform cost search I w = 1: like A

I w → ∞: like greedy best-first search with w ≥ 1 properties analogous to A :

I h admissible:

found solution guaranteed to be at most w times as expensive as optimum when reopening is used I h admissible and consistent:

found solution guaranteed to be at most w times as expensive as optimum; no reopening needed (without proof)

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 21 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Summary

16.5 Summary

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 29, 2021 22 / 23

16. State-Space Search: Greedy BFS, A, Weighted A Summary

Summary

best-first graph search with evaluation function f : I f = h: greedy best-first search

suboptimal, often very fast I f = g + h: A

optimal if h admissible and consistent or if h admissible and reopening is used I f = g + w · h: weighted A

for w ≥ 1 suboptimality factor at most w

under same conditions as for optimality of A

Referenzen

ÄHNLICHE DOKUMENTE

State-Space Search: Data Structures for Search Algorithms Open Lists. 8.3

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

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

uniform cost search: expand nodes in order of ascending path costs. I usually as a

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

I In IDDFS, we grow the limit from the smallest limit that gives a non-empty search tree (0) by 1 at a time. I 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

I 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 solution cost. Helmert (University of Basel) Foundations