Yapay Zeka - 4
Yapay Zeka - 4
Yapay Zeka - 4
• Basic idea:
– offline, simulated exploration of state space by generating
successors of already-explored states (a.k.a.~expanding states)
Example: Romania
Tree search example
Tree search example
Tree search example
Implementation: Components of a node
• For each frontier node, save the total cost of the path
from the initial state to that node
• Expand the frontier node with the lowest path cost
• Implementation: frontier is a priority queue ordered by
path cost
• Equivalent to breadth-first if step costs all equal
• Equivalent to Dijkstra’s algorithm in general
Uniform-cost search
Uniform-cost search
Already expended
Uniform-cost search
Already expended
Uniform-cost search
Already expended
Uniform-cost search
Uniform-cost search
Properties of uniform-cost search
• Complete?
Yes, if step cost is greater than some positive constant ε (we
don’t want infinite sequences of steps that have a finite total
cost)
• Optimal?
Yes
Uniform-cost search
• Recursive implementation:
Properties of Depth-limited search
• Time?
• Space?
• Space?
For m=20
The number of graph state= 800
The number of tree nodes=1099511627776
Repeated states
Repeated states
Handling repeated states
Handling repeated states