Im having trouble understanding which node/state should be expanded next in an A* search tree when the evaluation function (f(n) = g(n) + h(n)) evaluates the same for two nodes.
Example 1

Tree1

my understanding is that the frontier is stored as a priority queue ordered by f and therefore as the nodes on the frontier have the same value the the node added to the queue first will be evaluated.

Example 2

Tree2

In this example the evaluation function of B was less than C and therefore expanded but generated a node D with the same f as C, in this case what node would be chosen for expansion next?

(I realise this question should probably have been posted on cstheory.stackexchange but I don't have enough reputation to post images, apologies)
Thanks in advance

有帮助吗?

解决方案

Doesn't matter which one will be chosen, depends on priority queue implementation, but more often it will be C, because newly created node D won't went before C which is already in queue. If we continue with C and later on we realize that h(C) was underestimated, than the f value of current node (accessor of C) becames greater than f(D) than the algorithm will go back and expand D as it become top of queue. This will work since heuristic h should always gave smaller or equal values than the real cost.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top