Combined optimization of pipes and control valves in water distribution networks