Abstract
We solve a linear optimal control problem with state and control restrictions by the method of region analysis, where the state equations describe the flow in a directed graph without a circuit. The results are used for the optimal control of a system of hydroelectric power plants.