• Keine Ergebnisse gefunden

11. State-Space Search: Uniform Cost Search

N/A
N/A
Protected

Academic year: 2022

Aktie "11. State-Space Search: Uniform Cost Search"

Copied!
4
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

11. State-Space Search: Uniform Cost Search

Malte Helmert

University of Basel

March 17, 2021

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

Foundations of Artificial Intelligence

March 17, 2021 — 11. State-Space Search: Uniform Cost Search

11.1 Introduction 11.2 Algorithm 11.3 Properties 11.4 Summary

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

State-Space Search: Overview

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

I 8.–12. Basic Algorithms

I 8. Data Structures for Search Algorithms I 9. Tree Search and Graph Search I 10. Breadth-first Search

I 11. Uniform Cost Search

I 12. Depth-first Search and Iterative Deepening I 13.–19. Heuristic Algorithms

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

11. State-Space Search: Uniform Cost Search Introduction

11.1 Introduction

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

(2)

11. State-Space Search: Uniform Cost Search Introduction

Uniform Cost Search

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

remedy: uniform cost search

I always expand a node with minimal path cost (n.path cost a.k.a. g(n))

I implementation: priority queue (min-heap) for open list

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

11. State-Space Search: Uniform Cost Search Algorithm

11.2 Algorithm

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

11. State-Space Search: Uniform Cost Search Algorithm

Reminder: Generic Graph Search Algorithm

reminder from Chapter 9:

Generic Graph Search open := new OpenList open.insert(make root node()) closed := new ClosedList while not open.is empty():

n := open.pop()

if closed.lookup(n.state) = none:

closed.insert(n) if is goal(n.state):

return extract path(n) for each ha, s

0

i ∈ succ(n.state):

n

0

:= make node(n, a, s

0

) open.insert(n

0

)

return unsolvable

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

11. State-Space Search: Uniform Cost Search Algorithm

Uniform Cost Search

Uniform Cost Search

open := new MinHeap ordered by g open.insert(make root node()) closed := new HashSet while not open.is empty():

n := open.pop min() if n.state ∈ / closed:

closed.insert(n.state) if is goal(n.state):

return extract path(n) for each ha, s

0

i ∈ succ(n.state):

n

0

:= make node(n, a, s

0

) open.insert(n

0

)

return unsolvable

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

(3)

11. State-Space Search: Uniform Cost Search Algorithm

Uniform Cost Search: Discussion

Adapting generic graph search to uniform cost search:

I here, early goal tests/early updates of the closed list not a good idea. (Why not?)

I as in BFS-Graph, a set is sufficient for the closed list I a tree search variant is possible, but rare:

has the same disadvantages as BFS-Tree

and in general not even semi-complete (Why not?) Remarks:

I identical to Dijkstra’s algorithm for shortest paths

I for both: variants with/without delayed duplicate elimination

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

11. State-Space Search: Uniform Cost Search Algorithm

Uniform Cost Search: Improvements

possible improvements:

I if action costs are small integers, bucket heaps often more efficient

I additional early duplicate tests for generated nodes can reduce memory requirements

I can be beneficial or detrimental for runtime

I must be careful to keep shorter path to duplicate state

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

11. State-Space Search: Uniform Cost Search Properties

11.3 Properties

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

11. State-Space Search: Uniform Cost Search Properties

Completeness and Optimality

properties of uniform cost search:

I uniform cost search is complete (Why?) I uniform cost search is optimal (Why?)

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

(4)

11. State-Space Search: Uniform Cost Search Properties

Time and Space Complexity

properties of uniform cost search:

I Time complexity depends on distribution of action costs (no simple and accurate bounds).

I Let ε := min

a∈A

cost(a) and consider the case ε > 0.

I Let c

be the optimal solution cost.

I Let b be the branching factor and consider the case b ≥ 2.

I Then the time complexity is at most O(b

bc/εc+1

). (Why?) I often a very weak upper bound

I space complexity = time complexity

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

11. State-Space Search: Uniform Cost Search Summary

11.4 Summary

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

11. State-Space Search: Uniform Cost Search Summary

Summary

uniform cost search: expand nodes in order of ascending path costs

I usually as a graph search

I then corresponds to Dijkstra’s algorithm I complete and optimal

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

Referenzen

ÄHNLICHE DOKUMENTE

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

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

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

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

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 (

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

Theorem (time complextive of iterative deepening DFS) Let b be the branching factor and d be the minimal solution length of the given state space. State-Space Search: Depth-first

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