order, and we only cache the first result it find. Why BFS ? With BFS you can stop as soon as you reach the goal. With DFS you might reach the goal (or memoize any result) via a sub-optimal path. To ...