Question: Exercise 1 ( 1 0 points ) . Consider the A * algorithm using a perfect heuristic function h , i . e . ,

Exercise 1(10 points). Consider the A* algorithm using a perfect heuristic function h, i.e., for any node (state) n, h(n) equals the minimal cost from n to a goal state. Modify the pseudocode for A^(**)(fig.3.7) so it improves in space and/or time complexity as much as possible. The better the solution the higher the grade. Explain your answer.
PLEASE WRITE THE ANSWER IN THIS PSEUDOCODE FORMAT
Pseudocode:
function BEST-FIRST-SEARCH(problem,f)returns a solution node or failure nodeNODE(STATE=problem.INITIAL)
frontiera priority queue ordered by f ,with node as an element
reacheda lookup table, with one entry with key problem.INITIAL and value node
while not IS-EMPTY(frontier)do
nodePOP(frontier)
if problem.IS-GOAL(node.STATE)then return node
for each child in EXPAND(problem,node)do
schild.STATE
if s is not in reached or child.PATH-COST reached[s].PATH COST then
reached[s]child add
child to frontier
return failure
function EXPAND(problem,node)yields nodes
snode.STATE
for each action in problem.ACTIONS(s)do
s problem.RESULT(s,action)
costnode.PATH-COST +problem.ACTION-COST(s,action,s )
yield NODE(STATE=s ,PARENT=node, ACTION=action, PATH COST=cost)
Exercise 1 ( 1 0 points ) . Consider the A *

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!