The problem of optimal processing control of an inhomogeneous raw-material batch is treated, which involves the task of determining the sequence of processing, defining the time dependence of the output of the equipment, and calculating the optimal volumes of fractions. An algorithm for the numerical solution of the problem is described.