Solution for SMA* Algorithm issues with understanding the basic concept

is Given Below:

I’m trying to implement SMA* algorithm to solve N-Puzzle problem.

I’m having difficulties with understanding and implementing the following issues:

- Here’s a quote from AIMA book:

*“SMA∗ always drops the worst leaf node—the one with the highest f-value. Like RBFS, SMA∗*

then backs up the value of the forgotten node to its parent. In this way, the ancestor of a

forgotten subtree knows the quality of the best path in that subtree.”

When node memory is full, the worst leaf in memory should be dropped and its value should be remembered in parent’s node. I guess the memorized value does not overwrite f_cost in parent node, it’s another variable? Also I don’t understand why if we remove the**worst**leaf from the queue, how does the ancestor know the quality of the**BEST**path in the subtree? (As stated in the quote from the book). - Algorithm expands best nodes and removes worst nodes.

We can determine the best node by finding the lowest**f**value in the queue, and for this**f**value find node with highest**g**value.

The worst node can be found by searching the highest**f**value in the queue and then by finding a node with found**f**and the lowest**g**.

Are these statements correct, or did I misunderstand something? - When node memory is full, the worst node in queue is removed and it’s f cost is remembered in parent node. But why do we save the f cost of removed node? Where in the algorithm we make use of it and how?