The authors estimate the potential for power generation from water resources of small and medium-sized rivers, which are abundant in Latvia. They propose the algorithm for optimal operation of a small-scale hydropower plant (SHPP) at the chosen optimality criterion in view of the plant’s participation in the market. The choice of SHPP optimization algorithm is made based on two mathematical programming methods - dynamic and generalized reduced gradient ones. Approbation of the algorithm is illustrated by an example of optimized SHPP operation.