Piecewise-linear programming: The compact (CPLP) algorithm