A computer-implemented method for determining a configuration (1*) of a water distribution network that supplies water from at least one water source to a plurality of customers (3, 31-39), wherein the configuration (1*) keeps a given leak in the water distribution network isolated from all water sources while at the same time reducing interruption of supply to customers, the method comprising the steps of: • providing a hydraulic model of the water distribution network in a base configuration where the given leak is isolated; • providing an inventory of available bypass components, wherein installation and/or usage of each bypass component is associated with a penalty value; • providing, for each customer of the water distribution network, a penalty value that is associated with supply interruption of this customer during isolation of the leak; • determining, based on the inventory of available bypass components, ∘ pairs (i,j) of junctions i and j in the water distribution network that are connectable with bypass connections (4#) using bypass components without reconnecting the leak to a water source, ∘ additive penalty contributions (5+) for installation and/or usage of such bypass connections (4#), and ∘ subtractive penalty contributions (5-) for reconnection of customers to a water source by virtue of the bypass connections (4#); • setting up, for each such pair ( i, j), at least one equation, said at least one equation in at least the flow q ij through the bypass connection (4#) and the switching state s ij of the bypass connection (4#) stipulating that, of the conditions: ∘ the difference h i - h j between the head h i at junction i and the head h j at junction j shall be dependent on the flow q ij through the bypass connection according to a given continuity function Δ h ij ( q ij), and ∘ the flow q ij shall vanish, at least one condition is satisfied; • optimizing for a set of flows q ij and switching states s ij that fulfils the system of equations while carrying a low overall penalty; and • determining the obtained set of flows q ij ∗ and switching states s ij ∗ as the sought configuration (1*) of the water distribution network. • providing a hydraulic model of the water distribution network in a base configuration where the given leak is isolated; • providing an inventory of available bypass components, wherein installation and/or usage of each bypass component is associated with a penalty value; • providing, for each customer of the water distribution network, a penalty value that is associated with supply interruption of this customer during isolation of the leak; • determining, based on the inventory of available bypass components, ∘ pairs (i,j) of junctions i and j in the water distribution network that are connectable with bypass connections (4#) using bypass components without reconnecting the leak to a water source, ∘ additive penalty contributions (5+) for installation and/or usage of such bypass connections (4#), and ∘ subtractive penalty contributions (5-) for reconnection of customers to a water source by virtue of the bypass connections (4#); ∘ pairs (i,j) of junctions i and j in the water distribution network that are connectable with bypass connections (4#) using bypass components without reconnecting the leak to a water source, ∘ additive penalty contributions (5+) for installation and/or usage of such bypass connections (4#), and ∘ subtractive penalty contributions (5-) for reconnection of customers to a water source by virtue of the bypass connections (4#); • setting up, for each such pair ( i, j), at least one equation, said at least one equation in at least the flow q ij through the bypass connection (4#) and the switching state s ij of the bypass connection (4#) stipulating that, of the conditions: ∘ the difference h i - h j between the head h i at junction i and the head h j at junction j shall be dependent on the flow q ij through the bypass connection according to a given continuity function Δ h ij ( q ij), and ∘ the flow q ij shall vanish, at least one condition is satisfied; ∘ the difference h i - h j between the head h i at junction i and the head h j at junction j shall be dependent on the flow q ij through the bypass connection according to a given continuity function Δ h ij ( q ij), and ∘ the flow q ij shall vanish, • optimizing for a set of flows q ij and switching states s ij that fulfils the system of equations while carrying a low overall penalty; and • determining the obtained set of flows q ij ∗ and switching states s ij ∗ as the sought configuration (1*) of the water distribution network.