-1

How do we know the optimal solution cost before finishing the search?

The textbook says A* expands all nodes with f(n) less than C * but how do we know C* before actually finishing the search? Maybe I'm not understanding the concept of the optimal solution path

I get the concept in Does A* need to know the optimal solution cost while utilizing an admissible heuristic?

but then how do we do the concept of pruning? I feel like we should be able to write off some nodes so we don't have to keep track of them in case they become the lowest cost.

Peter Luo
  • 51
  • 6

1 Answers1

1

First of all you should stop reading a book which says A* expands all nodes because this is not the case.

Suppose you get a cost of 4 from source to goal and you have a extra node in queue with cost > 4 then A* will not evalute that node because it has a goal node with less cost and hence that node will not be evaluated.

If heuristic is admissible then the first path you find from source to goal is always the best path also every node is reached through the best path. Heuristic is estimated cost not exact cost. You have to compute it in some way.

If heuristic is not admissible then it is possible that there is some path with cost less then current cost , in that case A* will later update the current path with new path.

No idea what you mean by pruning.

Luai Ghunim
  • 976
  • 7
  • 14