intending to cross a river by the shortest path