176 1/3/2017 7:56:03 AM


:

currentNode = startNode;

loop do L = NEIGHBORS(currentNode);

nextEval = -INF;

nextNode = NULL;

for all x in L

if (EVAL(x) > nextEval)

nextNode = x;

nextEval = EVAL(x);

end if

end for

if nextEval <= EVAL(currentNode)

//Return current node since no better neighbors exist

return currentNode;

end if

currentNode = nextNode;

end do