Minimum-cost maximum flow
Deliver as much water as the pipes can carry. If several routes can deliver that amount, choose the cheapest combination. Each pipe has a capacity and a price per unit of water.
First maximize the flow. Then find negative-cost cycles in the residual network and reroute flow around them. Each cancellation lowers the cost without changing delivery.
With integer prices each cancellation lowers total cost by at least one. The result contains flow and cost.