Its hard to tell though. The shortest route is not always the fastest (i.e. slowing down around a sharp corner, as opposed to walking slightly wider around it), nor is the fastest necessarily the most energy efficient (climbing rocks or following a paved path). Its clearly recalculating the proper trajectory many many times based upon visual (and to a lesser extent other the other senses') cues. What isn't clear to me is whether or not the brain subconciously is coming up with (near) optimal solutions by some algorithm aside from the obvious "don't run into anything, and go that way" method.