In this paper it is presented an algorithm and computer program for optimization of operating regimes of power regeneration plant that supplies technological consumers. It is described the optimization algorithm standing out steps that are examined for solving of optimization problem. The minimization of fuel consumption for producing of thermal and electrical energy is considered the success state. Based on this algorithm, it is established a computer program that contains a main program and under-programs that are called by it. The general structure of main program and under-programs established arc presented in this paper.