Optimal regularization of the inverse heat-conduction problem