A general algorithm for short-term scheduling of batch operations—I. MILP formulation