Valves selecting to close algorithm in water distribution system using flow analysis