Solving the detour problem in navigation: a model of