Before revision: */ void computeShortestPath() { while ((queue.getTopKey() < calculateKey(goal)) || (goal.rhs != goal.g)) { node = queue.pop(); if ( ( node.g > node.rhs) { node.g = node.rhs; for (successor : node.getSuccessors()) updateNode(successor); } else { node.g = INFINITY; updateNode(node); for (successor : node.getSuccessors()) updateNode(successor); } } } /** Recalculates rhs for a node and removes it from the queue.
After revision: */ void computeShortestPath) { while ((queue.getTopKey() < calculateKey(goal)) || (goal.rhs != goal.g)) { node = queue.pop(); if ( ( node.g > node.rhs) { node.g = node.rhs; for (successor : node.getSuccessors()) updateNode(successor); } else { node.g = INFINITY; updateNode(node); for (successor : node.getSuccessors()) updateNode(successor); } } } /** Recalculates rhs for a node and removes it from the queue.