The optimal function of a water distribution network is reached when the consumer demands are satisfied using the lowest quantity of energy, maintaining the minimal pressure required at the same time. One way to achieve this is through optimization of flow rate injection based on the use of the setpoint curve concept. In order to obtain that, a methodology is proposed. It allows for the assessment of the flow rate and pressure head that each pumping station has to provide for the proper functioning of the network while the minimum power consumption is kept. The methodology can be addressed in two ways: the discrete method and the continuous method. In the first method, a finite set of combinations is evaluated between pumping stations. In the continuous method, the search for the optimal solution is performed using optimization algorithms. In this paper, Hooke-Jeeves and Nelder-Mead algorithms are used. Both the hydraulics and the objective function used by the optimization are solved through EPANET and its Toolkit. Two case studies are evaluated, and the results of the application of the different methods are discussed.