Calculation of Tolerances Based On Minimum Cost