Algorithms for the Least Distance Problem