• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 11. State-Space Search: Uniform Cost Search Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 11. State-Space Search: Uniform Cost Search Malte Helmert"

Copied!
15
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

11. State-Space Search: Uniform Cost Search

Malte Helmert

University of Basel

March 17, 2021

(2)

State-Space Search: Overview

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

8.–12. Basic Algorithms

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

11. Uniform Cost Search

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

(3)

Introduction

(4)

Uniform Cost Search

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

remedy: uniform cost search

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

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

(5)

Uniform Cost Search

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

remedy: uniform cost search

always expand a node withminimal path cost (n.path cost a.k.a.g(n))

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

(6)

Algorithm

(7)

Reminder: Generic Graph Search Algorithm

reminder from Chapter 9:

Generic Graph Search open:=newOpenList open.insert(make root node()) closed:=newClosedList while notopen.is empty():

n:=open.pop()

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

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

returnextract path(n) for eachha,s0i ∈succ(n.state):

n0 := make node(n,a,s0) open.insert(n0)

returnunsolvable

(8)

Uniform Cost Search

Uniform Cost Search

open:=newMinHeap ordered byg open.insert(make root node()) closed:=new HashSet while notopen.is empty():

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

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

returnextract path(n) for eachha,s0i ∈succ(n.state):

n0 := make node(n,a,s0) open.insert(n0)

returnunsolvable

(9)

Uniform Cost Search: Discussion

Adapting generic graph search to uniform cost search:

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

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

has the same disadvantages as BFS-Tree

and in generalnot even semi-complete (Why not?)

Remarks:

identical to Dijkstra’s algorithmfor shortest paths

for both: variants with/without delayed duplicate elimination

(10)

Uniform Cost Search: Improvements

possible improvements:

if action costs are small integers, bucket heapsoften more efficient

additional early duplicate tests for generated nodes can reduce memory requirements

can be beneficial or detrimental for runtime

must be careful to keep shorter path to duplicate state

(11)

Properties

(12)

Completeness and Optimality

properties of uniform cost search:

uniform cost search iscomplete (Why?) uniform cost search isoptimal (Why?)

(13)

Time and Space Complexity

properties of uniform cost search:

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

Letε:= mina∈Acost(a) and consider the caseε >0.

Letc be the optimal solution cost.

Letbbe the branching factor and consider the caseb2.

Then the time complexity is at mostO(bbc/εc+1). (Why?) often a very weak upper bound

space complexity = time complexity

(14)

Summary

(15)

Summary

uniform cost search: expand nodes in order ofascending path costs

usually as a graph search

then corresponds to Dijkstra’s algorithm complete andoptimal

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

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

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

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

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

in every clause, choose the variables randomly literals positive or negative with equal probability critical parameter: #clauses divided by #variables phase transition at ratio ≈