Water distribution networks with dynamic topology