def hill_climbing(problem):
current = Node(problem.initial)<EOL>while True:<EOL><INDENT>neighbors = current.expand(problem)<EOL>if not neighbors:<EOL><INDENT>break<EOL><DEDENT>neighbor = argmax_random_tie(neighbors,<EOL>lambda node: problem.value(node.state))<EOL>if problem.value(neighbor.state) <= problem.value(current.state):<EOL><INDENT>break<EOL><DEDENT>current = neighbor<EOL><DEDENT>return current.state<EOL>
From the initial node, keep choosing the neighbor with highest value,
    stopping when no neighbor is better. [Fig. 4.2]