• Keine Ergebnisse gefunden

17. State-Space Search: IDA ∗

N/A
N/A
Protected

Academic year: 2022

Aktie "17. State-Space Search: IDA ∗"

Copied!
4
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

17. State-Space Search: IDA

Malte Helmert

University of Basel

March 25, 2019

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

Foundations of Artificial Intelligence

March 25, 2019 — 17. State-Space Search: IDA

17.1 IDA : Idea 17.2 IDA : Algorithm 17.3 IDA : Properties 17.4 Summary

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

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 25, 2019 3 / 15

17. State-Space Search: IDA IDA: Idea

17.1 IDA : Idea

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

(2)

17. State-Space Search: IDA IDA: Idea

IDA

The main drawback of the presented best-first graph search algorithms is their space complexity.

Idea: use the concepts of iterative-deepening DFS

I bounded depth-first search with increasing bounds I instead of depth we bound f

(in this chapter f (n) := g (n) + h(n.state) as in A ) IDA (iterative-deepening A )

I tree search, unlike the previous best-first search algorithms

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

17. State-Space Search: IDA IDA: Algorithm

17.2 IDA : Algorithm

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

17. State-Space Search: IDA IDA: Algorithm

Remarks on the Algorithm (1)

I We describe an IDA implementation with explicit search nodes.

I More efficient implementations leave search nodes implicit, as in the depth-first search algorithm in Chapter 12.

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

17. State-Space Search: IDA IDA: Algorithm

Remarks on the Algorithm (2)

I Our recursive function calls yield two values:

I f limit, the next useful f -bound for the subtree

considered by the call (or none if a solution was found) I solution, the found solution (or none)

I More efficient implementations store these values (in instance variables of a class or in a closure) to save time for passing these values.

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

(3)

17. State-Space Search: IDA IDA: Algorithm

IDA : Pseudo-Code (Main Procedure)

IDA : Main Procedure n

0

:= make root node() f limit := 0

while f limit 6= ∞:

hf limit, solutioni := recursive search(n

0

, f limit) if solution 6= none:

return solution return unsolvable

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

17. State-Space Search: IDA IDA: Algorithm

IDA : Pseudo-Code (Depth-first Search)

function recursive search(n, f limit):

if f (n) > f limit:

return hf (n), nonei if is goal(n.state):

return hnone, extract path(n)i next limit := ∞

for each ha, s

0

i ∈ succ(n.state):

if h(s

0

) < ∞:

n

0

:= make node(n, a, s

0

)

hrec limit, solutioni := recursive search(n

0

, f limit) if solution 6= none:

return hnone, solutioni

next limit := min(next limit, rec limit) return hnext limit, nonei

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

17. State-Space Search: IDA IDA: Properties

17.3 IDA : Properties

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

17. State-Space Search: IDA IDA: Properties

IDA : Properties

Inherits important properties of A and depth-first search:

I semi-complete if h safe and cost(a) > 0 for all actions a I optimal if h admissible

I space complexity O(`b), where

I `: length of longest generated path

(for unit cost problems: bounded by optimal solution cost) I b: branching factor

proofs?

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

(4)

17. State-Space Search: IDA IDA: Properties

IDA : Discussion

I compared to A potentially considerable overhead because no duplicates are detected

exponentially slower in many state spaces often combined with partial duplicate elimination (cycle detection, transposition tables)

I overhead due to iterative increases of f bound often negligible, but not always

I especially problematic if action costs vary a lot:

then it can easily happen that each new f bound only reaches a small number of new search nodes

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

17. State-Space Search: IDA Summary

17.4 Summary

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

17. State-Space Search: IDA Summary

Summary

I IDA is a tree search variant of A

based on iterative deepening depth-first search I main advantage: low space complexity

I disadvantage: repeated work can be significant I most useful when there are few duplicates

M. Helmert (University of Basel) Foundations of Artificial Intelligence March 25, 2019 15 / 15

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

Missionaries and Cannibals people on wrong river

Best-first search is a class of search algorithms that expand the “most promising” node in each iteration?. decision which node is most promising

some practical remarks on implementing A ∗ : common bug: reopening not implemented although heuristic is not consistent common bug: duplicate test “too early”. (upon generation

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