Prev Up Next
Go backward to Solution to Question 2, part 3
Go up to Question 2
Go forward to Solution to Question 2, part 5

Solution to Question 2, part 4

It seems as though A* and dynamic programming are best for this problem. A* would be best if you were solving it once. If you wanted to solve it multiple times for the same goal dynamic programming would be good.

Depth-first search looks pretty stupid here. If you had searched in the order: left, up, right, down, it would have looked much more sensible.


Prev Up Next