find shorter path