0% found this document useful (0 votes)
26 views4 pages

Intro To AI

The document discusses heuristic search methods in artificial intelligence, detailing search problems, uninformed search techniques like BFS and DFS, and informed search methods such as Best First Search and A* Search. It explains the concepts of goal states, action mapping, and the importance of cost in finding the least cost path. Additionally, it introduces admissible and consistent heuristics to optimize search efficiency.

Uploaded by

daniel.widjaja18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

Intro To AI

The document discusses heuristic search methods in artificial intelligence, detailing search problems, uninformed search techniques like BFS and DFS, and informed search methods such as Best First Search and A* Search. It explains the concepts of goal states, action mapping, and the importance of cost in finding the least cost path. Additionally, it introduces admissible and consistent heuristics to optimize search efficiency.

Uploaded by

daniel.widjaja18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Week 9

Heuristic Search
Method for AI to reach goal from current state

Search Problem:

Space S : All possible states


Start state: S 0 ∈ S

Goal state: G ⊆ S (Goal state can be multiple)


Action: A (mapping current state to successor)
cost
objective
Least cost path

Uninformed Search
Explore blindly one of the next state

BFS
Guaranteed to find the shallowest path (not global optimal)
Time and space complexity: O(b ), where b is branching factor and d is depth
d

Pseudo-code:

Initialise a queue by inserting the initial state


Repeat
If queue is empty, return failure
Dequeue a state
If state is goal state, return the path from start state
Otherwise expand the state and add resulting states to the queue (smallest first)
Only if neighboring state not in queue or explored before
Store a link to parent state

Step Queue Deque Add

DFS
More efficient than BFS with multiple paths to a solution (not global optimal)
Space complexity: O(bd)
Pseudo-code:

Initialise a stack by inserting the initial state


Repeat
If stack is empty, return failure
Pop a state
If state is goal state, return the path from start state
Otherwise expand the state and add resulting states to the queue (smallest first)
Only if neighbouring state not in stack or explored before
Store a link to parent state

Step Stack Pop Add

BFS-Optimal
Consider cost from the start; use priority queue instead of queue
Reorder the queue in ascending order (smallest cost in the front)
Step Priority Queue Deque Add

Informed Search
Use estimated cost to goal to decide which state to explore
Estimate the cost to goal through some heuristic

Admissible Heuristic
Heuristic value of a state is ≤ minimum cost to reach the goal from the current state

Best First Search


Not optimal but is a greedy method
initialise priority queue ordered by heuristic estimate

A* Search
Provides global optimal given that heuristic is consistent
Let g(n) and h(n) be cost-so-far and cost-to-goal respectively
f (n) = g(n) + h(n)

initialise priority queue ordered by f (n)


New addtion:
Assuming admissible heuristic:
let n be the added node

′ ′ ′ ′ ′
h(n ) = g(n ) + h(n ) = g(n) + c(n, n ) + h(n )

If n is in the open list or closed list, compare the f (n ) with the old f (n ). Replace the old node if the cost is lower and reopen the node.
′ ′ ′

Consistent Heuristic
For every node n and its successor n',

′ ′
h(n) ≤ c(n, n ) + h(n )

Also determines that heuristic is admissible

You might also like