Least-Squares Methods for Linear Programming Problems: Theory and Applications