Introduction

Water is a scarce resource and must be managed properly to avoid conflicts. Many water authorities, especially in developing countries, are engaging in water rationing as a management tool to easy the pressure on the scarce resource. During droughts, municipal water restrictions focus on residential users rather than letting prices reflect scarcity of the resource during excess demand. Price-based policy would result in allocatable consequences. Rationing is a system that is being used everywhere in the world where there is water shortages. Outdoor watering restrictions were implemented during 1987–1992 drought in California (Dixon et al. 1996). In Australia, \(75\,\%\) of the population live in mandatory water restriction communities (Grafton and Ward 2008). Charging high volumetric prices of water during shortages can put a burden to the poor and larger households (Grafton and Ward 2008). According to the World Health Organisation (WHO), the basic amount of water required per day per person is 50 l (Madden and Carmichael 2007).

According to the study carried out by Mansur and Olmstead (2007), indoor consumption appears to be affected only by income and family size and outdoor use is price elastic during the wet season and price inelastic in the dry season. Substantial gains were available on price-based approach rather than outdoor water rationing. Another study carried by Hensher et al. (2006) on willingness to pay to avoid drought-induced water restrictions concluded that water consumers are unwilling to pay to avoid low-level restrictions at all and higher level of restrictions that are not in place everyday.

On the other hand, water consumers are willing to tolerate high-level restrictions on limited periods in a year as compared with higher water bills. Domestic water consumers tend to keep more water than required in containers if a water-rationing schedule is out. The excess water will be replaced by fresh water if allocation is resumed, and this leads to higher water consumption levels than before rationing. This study seeks to optimise water distribution costs during water-rationing periods, so as to avoid or minimise extra water costs that are induced through water hoarding which results in higher water consumption.

The remainder of the paper is arranged as follows. A review of leading metaheuristic algorithms that are used in this study is carried out in “Review of metaheuristics”. In “Model formulation”, formulation of a mixed-integer nonlinear programming (MINLP) problem is presented. Section “The numerical example” presents implementation and application of the four leading algorithms to the MINLP, and in “Conclusions”, conclusions are drawn.

Review of metaheuristics

Metaheuristics have been used to solve water distribution networks. Metaheuristics were first applied to solve a water distribution system by Dougherty and Marryott (1991). Metaheuristics mimic natural processes and have proved to be relevant in water distribution systems optimisation (Walski 2003; Winston 2004). Brief explanations of the Max–Min Ant System (MMAS), Genetic Algorithm (GA), Tabu Search (TS) and Simulated Annealing (SA) algorithms are presented.

The MMAS algorithm

The algorithm was introduced by Stutzle and Hoos (2000) as an extension of the Ant Colony Optimisation Dorigo (1992) which is an adaptation of the AS algorithm. The algorithm provides dynamically evolving bounds on the pheromone trail intensities. The probability that edge (ij) will be selected at decision i is given by

$$\begin{aligned} p_{ij}^{z}(t)=\frac{\tau _{ij}^{\alpha }(t)\times \lambda _{ij}^{\beta }(t)}{\sum _{k\in N_{i}^{z}}\tau _{ik}^{\alpha }(t)\times \lambda _{ik}^{\beta }(t)},\quad j\in N_{i}^{z}, \end{aligned}$$
(1)

where \(N_{i}^{z}\) is the feasible neighbourhood of the ant z and (ik) are edges from i. Equation (2) represents pheromone updating.

$$\begin{aligned} \tau _{ij}(t+1)=\rho \times \tau _{ij}(t)+\Delta \tau _{ij}(t), \end{aligned}$$
(2)

where \(p_{ij}(t)\) is the probability of choosing edge (ij) at time t, \(\tau _{ij}(t)\) is the concentration of pheromone related to edge (ij) at period time t, and \(\lambda _{ij}\) is the preference of edge (ij). The parameters \(\alpha\) and \(\beta\) control the relative importance of pheromone intensity and preference for every ant’s decision, respectively. The parameter \(\rho\) represents pheromone persistence. The quantity \(\Delta \tau _{ij}(t)\) represents the pheromone addition for edge (ij) and it is a function of solutions found at iteration t. Equation (3) is the pheromone addition on edge (ij) at time t.

$$\begin{aligned} \Delta \tau _{ij}(t)=\sum _{l=1}^{m}\Delta \tau _{ij}^{l}(t), \end{aligned}$$
(3)

where \(\Delta \tau _{ij}^{l}(t)\) is the pheromone addition laid by the lth ant on the edge (ij) at the end of iteration, t, and m is the number of ants. Successful application of MMAS algorithm to water distribution system has been witnessed (Chagwiza et al. 2014; Zecchin et al. 2003; Afshar 2009b).

The GA algorithm

The genetic algorithm is an algorithm that mimics natural processes selection and belong to evolutionary algorithms. It uses processes, such as mutation, inheritance, selection, and crossover. Genetic algorithm refers to the model that was introduced by Holland (1975). The genetic algorithm is usually applied to nonlinear problems, and modifications of the genetic algorithm called BASIC were also introduced (Shopova and Vaklieva-Bancheva 2006). Genetic algorithm has been previously applied to water distribution systems in studies, such as that of Afshar (2009a), Wu et al. (2001), and Tolson et al. (2004).

The TS algorithm

The TS algorithm was first introduced by Glover (1989). The metaheuristic is believed to be the one that guides subordinated heuristics to produce solutions beyond those that are produced by search of local optima (Fanni et al. 2000). The algorithm has been long back applied to nonlinear problems (Glover 1977). It uses local search (neighbourhood) that potential solutions, x, to the problem are directed to an improved solution, \(x^{\prime }\). The algorithm uses three types of memory, that is, short, intermediate, and long term, and they form the tabu list (Glover 1990b). The tabu list contains solutions that can be changed by the process that is involved when moving from one solution to the other. Full explanation of the TS algorithm can be found in Glover and Laguna (1997) and Glover (1990a, 1993, 1994). The TS algorithm has previously been applied to solve water distribution systems problems (Fanni et al. 2000; Cunha and Riberio 2003; Sung et al. 2007).

The SA algorithm

Simulated annealing was introduced by Kirkpatrick et al. (1983). It uses a set of controlled cooling operations. The algorithm has four basic components, that is, configurations which are the possible problem solutions, move set which is a set of allowable moves to reach the feasible configurations, cost function that measures how good each configuration is, and the cooling schedule. The algorithm has been applied to solve water distribution problems (Dougherty and Marryott 1991; Marryott et al. 1993; Cunha 1999; Tospornsampan et al. 2005, 2007).

Model formulation

A MINLP problem of a water distribution system that includes water rationing during shortage period is developed in this section. Definitions of variables (var) and parameters (par) are shown in Table 1.

Table 1 Definitions of model variables

Equations (4)–(8) are a sub-problem that is used to find the optimal cost, \(C_{j,i}\), of implementation measure j during shortage event i. The objective (Eq. (4)) is to minimise costs that are related to implementing a measure to water resource allocation during the times of shortages. Equation (5) ensures that the quantity conserved during shortage should balance with quantities conserved by implementation both short- and long-term measures. Implementation constraints (lower and upper implementation) of each measure, that is, either short or long term are presented by Eqs. (6), (7) and (8) is the sign restriction constraint. The result from this model is implemented in the main model [Eqs. (9)–(15)]

$$\begin{aligned} {\text {Min}}\ C_{j,i}&= \sum _{\hat{j}\in j, i\in M}C_{\hat{j},i}(U_{\hat{j},i}+L_{\hat{j},i})Y_{\hat{j},i}+\sum _{\tilde{j}\in j, i\in M}C_{\tilde{j},i}(U_{\tilde{j},i}+L_{\tilde{j},i})Y_{\tilde{j},i}\end{aligned}$$
(4)
$$\begin{aligned} &\text {subject \,to}\nonumber \\&Y_{j,i}\ge Y_{\hat{j},i}+Y_{\tilde{j},i},\quad \forall \hat{j} \in j,\ \forall \tilde{j} \in j\end{aligned}$$
(5)
$$\begin{aligned}&U_{j,i}\ge U_{\hat{j},i}+U_{\tilde{j},i},\quad \forall \hat{j} \in j,\ \forall \tilde{j} \in j\end{aligned}$$
(6)
$$\begin{aligned}&L_{j,i} \ge L_{\hat{j},i}+L_{\tilde{j},i},\quad \forall \hat{j} \in j,\ \forall \tilde{j} \in j\end{aligned}$$
(7)
$$\begin{aligned}&Y_{j,i}\ge 0,\ Y_{\hat{j},i}\ge 0,\quad Y_{\tilde{j},i}\ge 0. \end{aligned}$$
(8)

The model is an MINLP problem and the objective is to minimise water distribution costs that are incurred during water-rationing periods. The costs include penalties associated with failure to meet demand, \(H_{i,t}\), operational and maintenance, \(B_{i,t}\), and costs. Equation (11) shows that the full-service demand minus quantity of water available during shortage should be greater than zero, so as to ensure that there is, indeed, a shortage that requires water rationing. Quantity balance constraint is represented by Eq. (12). Ration amount of water is less than the available quantity of water. Equation (13) represents the implementation of a measure j to the water allocation problem and it is binary: 0 when there is no measure implemented and 1 if a measure is implemented. Equation (15) restricts full-service demand, and available quantity and quantity lost due to water hoarding to be positive

$$\begin{aligned} \text {Min}\ Z&= P_{i}\sum _{i\in M, t\in T}E_{i,t}(Q_{i,t}+F_{i,t})+\sum _{i\in M, t\in T}H_{i,t}(D_{i,t}-F_{i,t})\nonumber \\&\quad +\sum _{j\in N,i\in M}C_{j,i}X_{j,i}Y_{j,i}+\sum _{i\in N,t\in T}B_{i,t}F_{i,t}\end{aligned}$$
(9)
$$\begin{aligned} &\text {subject \,to}\nonumber \\&Y_{j,i}\ge Y_{\hat{j},i}+Y_{\tilde{j},i}, \quad \forall \hat{j} \in j,\ \forall \tilde{j} \in j\end{aligned}$$
(10)
$$\begin{aligned}&D_{i,t}- F_{i,t} \ge 0, \quad \forall i\in M,\ \forall t\in T\end{aligned}$$
(11)
$$\begin{aligned}&F_{i,t}\ge R_{i,t},\quad \forall i\in M,\ \forall t\in T\end{aligned}$$
(12)
$$\begin{aligned}&X_{j,i}\ge 0,\quad \forall j\in N,\ \forall i\in M\end{aligned}$$
(13)
$$\begin{aligned}&X_{j,i}\in [0,1]\end{aligned}$$
(14)
$$\begin{aligned}&D_{i,t}\ge 0,\quad F_{i,t} \ge 0,\quad Q_{i,t}\ge 0 \end{aligned}$$
(15)

The numerical example

The city of Bulawayo in Zimbabwe is the second largest in the country and has been affected by water shortages for a long time. The city is supplied by three dams, has seven distribution reservoirs with a capacity of 407,750 m\(^{3}\), and a daily demand of 178,000 m\(^{3}\). The city is hit by successive droughts and characterised by massive water-rationing periods that can lasts up to 4 days in a week in some areas without receiving water supplies. Even if the water catchment areas receive good or adequate rains, there is less to talk about in terms of improvements in uninterrupted water supplies to the water consumers. The city publishes a water-rationing schedule to the residents, but in most cases, it does not stick to it. Residents of the city use large plastic and metal containers to hoard water during water-rationing periods. Water consumers experience massive water rationing during the dry period and the early days into the rainy season (May–November). Computations were executed in the MATLAB environment on a PC with AMD E-300 APU with \(\text {Radeon}^{\text {TM}}\) @1.30 GHz and 4.00 GB RAM using the city of Bulawayo water data summarised in Table 2.

Table 2 Summary of the city of Bulawayo water data

The water allocation problem has a total of 9 variables and 27 constraints. A total of 100 runs are performed for each optimisation algorithm. Parameters that are used in the problem are adjusted to direct the solution after every ten instances. The average values of each parameter that produced optimal solution are summarised in Table 3. The results show that the city of Bulawayo can incur costs amounting to $1842 per day if the model is implemented. This is against the cost of $5000 per day, the city is incurring at the time of this study. The city can save a total of $3158 per day if the model is implemented. The costs the city incurs, at the time of the study, are largely due to water that is lost through water hoarding. Water users tend to hoard water when they know that they will have longer water-rationing periods. In most cases, water users tend to replace ‘stale’ water with fresh water when it is available. The city does not follow the published water-rationing schedule and sometimes supply water earlier than the scheduled water-rationing period, and residents replace stored water with fresh water anticipating longer water-rationing periods.

Table 3 Summary of parameter values and results of various optimisation algorithms

Analysis of the performance of optimisation algorithms

To produce better results of the water supply problem, a total of four leading optimisation heuristics in literature are used and these are the MMAS, GA, TS, and SA algorithms. The heuristic parameters that produced best results are shown in Table 3. The minimum and maximum optimal costs and corresponding run times are also shown in Table 3. The results show that the MMAS algorithm produced the best average optimal cost of $1842 at an average run time of 3.86 min compared with $2273, $2378, and $2052.4 achieved by GA, TS, and SA, respectively. The minimum optimal cost obtained by the MMAS algorithm is $1792 after 3.61 min of run time, $2198 for GA after 3.05 min, $2303 for TS after 1.39 min, and $1992.4 for SA after 2.03 min. The MMAS algorithm performed better, maybe because of better exploration property of the algorithm as compared with GA, TS, and SA which are inflexible. The TS algorithm produced the worst solution result at 2.69 min of run time. Although the TS algorithm produced worst results, the least run time is achieved by implementing this algorithm. Shorter run time achieved by the TS algorithm might be as a result of simplicity of the algorithm, that is, the use of fewer parameters, whereas MMAS, GA, and SA use many parameters which may contribute to more execution time required to implement each parameter into the algorithm.

To have a clear picture of the performance comparison of the algorithms, statistical tests are carried out.

Table 4 Analysis of variance results of the algorithms implemented

Table 4 shows the results of the analysis of variance performed on optimal costs and run times that are obtained for each run performed. The independent variable is taken as the algorithm and the dependent variables are the optimal costs and run times. In general, it is shown that there is a significant (\(p=0.000\)) difference between both optimal costs and run times obtained by the different algorithms. A comparison to test the statistical difference within the algorithms is done. Tables 5 and 6 show the results of comparisons of optimal costs and run times within the algorithms, respectively. The average mean optimal costs ($2136.35) and run time (3.24 min) are used to find the mean differences. The results in Table 5 show that there is a significant difference on optimal costs obtained by each algorithm as compared with the other algorithms. The run times are significantly different for all the algorithms except those required by SA and TS (\(p=0.86\)).

Table 5 Statistical comparison of optimal cost
Table 6 Statistical comparison of run time

Conclusions

A water distribution problem that incorporates water rationing has been presented as a mixed-integer nonlinear programming problem. The objective of the model is to minimise water distribution costs while incorporating water-rationing-related costs. Four main leading optimisation algorithms, that is, MMAS, GA, SA, and TS, were implemented to solve the problem. The results show that the city of Bulawayo, which is used as an example in this research, can save a significant amount of money if the model is implemented. On the other hand, the MMAS algorithm produced the least optimal cost as compared with the other algorithms. The least run time is achieved by implementing the TS algorithm. It is, therefore, recommended that a hybrid algorithm to solve water distribution problems of the same nature as the one presented in this research be formulated to get best optimal solution.