SMA*


SMA* or Simplified Memory Bounded A* is a shortest path algorithm based on the A* algorithm. The main advantage of SMA* is that it uses a bounded memory, while the A* algorithm might need exponential memory. All other characteristics of SMA* are inherited from A*.

Process

Like A*, it expands the most promising branches according to the heuristic. What sets SMA* apart is that it prunes nodes whose expansion has revealed less promising than expected. The approach allows the algorithm to explore branches and backtrack to explore other branches.
Expansion and pruning of nodes is driven by keeping two values of for every node. Node stores a value which estimates the cost of reaching the goal by taking a path through that node. The lower the value, the higher the priority. As in A* this value is initialized to, but will then be updated to reflect changes to this estimate when its children are expanded. A fully expanded node will have an value at least as high as that of its successors. In addition, the node stores the value of the best forgotten successor. This value is restored if the forgotten successor is revealed to be the most promising successor.
Starting with the first node, it maintains OPEN, ordered lexicographically by and depth. When choosing a node to expand, it chooses the best according to that order. When selecting a node to prune, it chooses the worst.

Properties

SMA* has the following properties
The implementation of SMA* is very similar to the one of A*, the only difference is that when there isn't any space left, nodes with the highest f-cost are pruned from the queue. Because those nodes are deleted, the SMA* also has to remember the f-cost of the best forgotten child with the parent node. When it seems that all explored paths are worse than such a forgotten path, the path is re-generated.
Pseudo code:

function SMA-star: path
queue: set of nodes, ordered by f-cost;
begin
queue.insert;
while True do begin
if queue.empty then return failure; //there is no solution that fits in the given memory
node := queue.begin; // min-f-cost-node
if problem.is-goal then return success;

s := next-successor
if !problem.is-goal && depth max_depth then
f := inf;
// there is no memory left to go past s, so the entire path is useless
else
f := max, g + h);
// f-value of the successor is the maximum of
// f-value of the parent and
// heuristic of the successor + path length to the successor
endif
if no more successors then
update f-cost of node and those of its ancestors if needed

if node.successors ⊆ queue then queue.remove;
// all children have already been added to the queue via a shorter way
if memory is full then begin
badNode := shallowest node with highest f-cost;
for parent in badNode.parents do begin
parent.successors.remove;
if needed then queue.insert;
endfor
endif
queue.insert;
endwhile
end