inner-banner-bg

Journal of Electrical Electronics Engineering(JEEE)

ISSN: 2834-4928 | DOI: 10.33140/JEEE

Impact Factor: 1.2

Research Article - (2026) Volume 5, Issue 4

Application of Linear Programming in the Efficient Management of Water Resources for Urban Supply

Anastacio Pascoal Epandi Canhanga 1,2,3 *, Paulo Baptista De-Oliveira 2 , Meysam Hasan Nezhad 2 and Elsa VasquezAlvarez 2
 
1Department of Engineering and Technological Inovation, nt of Engineering and Technological Inovation, Higher Polytechnic Institute of Bie, Padre Fidalgo, Capito, Bie, Angola
2Department of Mining and Petroleum Engineering, University of Sao Paulo, Av. Prof. Mello Moraes, Butanta, 2373, Sao Paulo, Brazil
3Department of Applied Mathematics, University of Sao Paulo, Matao, Butanta, 1010, Sao Paulo, Brazil
 
*Corresponding Author: Anastacio Pascoal Epandi Canhanga, Department of Engineering and Technological Inovation, Angola

Received Date: Jul 13, 2026 / Accepted Date: Aug 10, 2026 / Published Date: Aug 20, 2026

Copyright: ©2026 Anastacio Pascoal Epandi Canhanga, et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

Citation: Canhanga, A. P. E., De Oliveira, P. B., Nehad, M. H., Vasquez-Alvarez, E. (2026). Application of Linear Programming in the Efficient Management of Water Resources for Urban Supply. J Electrical Electron Eng, 5(4), 01-10.

Abstract

This work presents an application of Mixed-Integer Linear Programming (MILP) in the efficient management of water resources for urban supply. Based on the analysis of recent studies, the model by Korotaj and Vasak was selected, which addresses the predictive control of water distribution systems through sequential linear programming. The study was adapted and formulated as a linear optimization problem with binary variables representing pump activation decisions and continuous variables for flow rates, tank levels, and losses. The implementation was carried out in the GAMS environment using fictitious data to simulate operational conditions of a simplified system composed of one tank and two pumps in parallel. The objective was to minimize the total cost, considering time-varying electricity tariffs and costs associated with water losses. The results showed that the model found operational strategies that prioritize the use of stored volume, activating pumps only when necessary, ensuring adequate tank levels, and minimizing operational costs.

Keywords

Mixed-Integer Linear Programming, Water Resources, Optimization, Urban Water Supply, Mathematical Modeling

Introduction

Efficient management of drinking water distribution in urban areas is one of the greatest challenges faced by modern cities. Population growth, unplanned urban expansion, and environmental pressures have increased the complexity of supply systems, requiring increasingly robust strategies to ensure continuous, safe, and sustainable water supply. In this context, mathematical modeling, especially through Linear Programming (LP) and Integer Linear Programming (ILP), has become an essential tool to support decision-making in water supply systems. Water resources are at the center of environmental discussions worldwide, across all fields of knowledge. This concern grows as the global population increases and, with it, the demand for such an essential and limited resource: water. What is observed is an increasingly intense and often disordered use of this resource by different sectors of society [4].

Modeling with Linear, Integer, and Mixed Programming: Fundamentals and Applications

LP is a classical mathematical optimization technique that aims to find the best value (minimum or maximum) of a linear function subject to a set of linear constraints. It has wide application in modeling operational problems involving resource allocation, production planning, logistics, and, increasingly, in the management of urban water supply systems [6]. The simple algebraic structure and the availability of efficient algorithms, such as the Simplex method have made LP one of the most widely used tools in engineering and applied sciences [2]. However, many real-world problems involve discrete variables, such as decisions to turn equipment on/off, activate routes, select technologies, or allocate indivisible units. In such cases, ILP — where some or all variables are restricted to integer values — becomes necessary. When the model combines continuous and integer variables, we have Mixed-Integer Linear Programming (MILP), which significantly expands the representational power of LP while maintaining the linear structure of constraints and the objective function [1].

Applications in water systems clearly demonstrate this evolution. In the study by for example, MILP was used to optimize the joint operation of water-energy microgrids, allowing binary decisions such as pump activation and the use of renewable energy sources to be represented [5]. Also based their water allocation model on LP and ILP structures, incorporating operational limits, variable costs, and multiple supply sources in a coastal urban environment [4]. Meanwhile, adopted a sequential approach based on LP for optimized control of water distribution network operations, demonstrating that even in systems with complex topologies, purely linear models can be successfully applied when properly adjusted to the operational context [6]. In the optimization literature, authors such as and emphasize that modeling with MILP allows handling logical, operational, and structural constraints that would be infeasible in purely continuous models [1,3]. Thus, the choice of modeling approach based on LP, ILP, or MILP depends on the nature of the practical problem to be represented, the level of detail required for decisions, and computational limitations. In this work, by selecting and adapting a real case study from recent literature, only these linear and integer techniques will be used as a methodological basis, focusing on their ability to efficiently capture the complexity of urban water supply systems.

Objective of the Work

The main objective of this work is to select, adapt, and model a real case study of urban water distribution based on approaches discussed in recent literature. The modeling will be carried out using LP and ILP, employing the GAMS computational environment. More specifically, the objectives are:

• To choose a relevant case study among the works of [4], [5], and [6];

• To reformulate the original problem in terms of a linear and/or integer model;

• To solve the model computationally in GAMS (General Algebraic Modeling System);

• To evaluate the results, highlighting the practical applicability of the linear approach in the efficient management of urban water supply systems.

Methodology

The methodology adopted in this work is based on the selection, adaptation, and mathematical modeling of a case study extracted from recent literature on urban water resource management using LP and ILP. Initially, a critical review of three relevant articles that apply optimization techniques to the allocation and operation of water supply systems was carried out, considering operational, energy, and environmental aspects. Based on this analysis, one case study was selected, namely that of , which best fits the structure of a linear or integer model and allows accurate representation of the operational decisions involved [6]. Next, the selected case study is translated into a mathematical formulation in LP or ILP format, defining decision variables, the objective function, and system constraints. The resulting model is then implemented in the GAMS environment, which provides robust support for solving linear and integer optimization problems. Fictitious data are used, adapted when necessary to fit the proposed model.

The main focus of the methodology is to demonstrate how complex urban water supply problems can be efficiently solved using linear modeling, highlighting the role of optimization in managing limited resources and supporting strategic decision-making. Finally, the obtained results are analyzed in terms of feasibility, consistency with the original problem, and potential practical application in similar contexts.

Problem Definition

The increasing urbanization and the pressure on urban water supply systems require solutions that combine operational efficiency, sustainability, and economic feasibility. The central problem consists of how to efficiently allocate available water resources, considering multiple sources, urban demands, operational costs, and technical constraints, in order to ensure a continuous and safe supply of drinking water.

In this context, the objective is to mathematically model the operation of an urban water supply system, inspired by a real case study by [6], using Mixed-Integer Linear Programming (MILP). The model aims to capture the key operational decisions in order to minimize total costs, while respecting supply, demand, capacity, and water quality constraints.

Hypothesis

For the construction of the mathematical model based on Linear Programming (LP), the following assumptions are considered:

• System data are known and deterministic, as presented in the selected case study, including demands, capacities, and operational costs.

• The modeled decisions are operational, representing actions such as source activation, allocation of water volumes, and use of existing infrastructure.

• There are no structural modifications to the physical network; the configuration from the original case study is maintained.

• The water has already been captured and treated, and the problem consists of distributing it in an economically optimal way to consumption points, while respecting capacity constraints and maximum availability.

Mathematical Foundation

Adopted Case Study

The case study considered is based on the work of, which proposes a sequential LP optimization model for the operation of water distribution networks, incorporating pumping costs, hydraulic constraints, and mass balances [6].

The water supply system considered in this study consists of a storage tank and two pumps installed in parallel, responsible for sending water to the distribution network. The network is simplified to contain three demand nodes, representing consumption points along the system. The objective of the problem is to determine the optimal pump operation strategy in order to meet demands, maintain the tank level within safety limits, and minimize costs associated with electricity consumption and water losses. Figure 1 schematically illustrates the adopted scenario.

Source: Prepared by the authors.

Figure 1: Simplified system: tank with two pumps in parallel and three demand nodes (aggregated in the model as Dk).

To make the problem well-defined, fictitious data were adopted to simulate real operating conditions. The planning horizon corresponds to 24 hours, discretized into N = 96 intervals of 15 minutes (â??t = 0.25 h). The tank has a cross-sectional area of A = 50 m2, with operating limits Hmin = 18 m and Hmax = 24 m, and initial level h0 = 20 m. Water losses in the network were represented in a simplified manner by a linear relationship with the tank level, with coefficient α = 1.0 × 10−4.

The set of pumps is given by P = {1,2}, each with a maximum capacity of Qmax = 0.05 m3/s. Demands occur at three nodes of the network and were aggregated in the model as a total demand Dk, varying over time to reflect different daily consumption profiles. The cost of electricity is time-dependent, being higher during peak periods, and the cost associated with water loss is set to aw = 2 EUR/m3. Finally, the energy consumption of the pumps is calculated proportionally to the pumped flow rate, with coefficient κ = 2.5 kWh per (m3/s)·h.

Mathematical Model

The described system can be represented by a linear programming (LP) model, in which the objective is to minimize the total cost associated with electricity consumption and water losses. The horizon is discretized into k = 0,...,N − 1.


The formulated model represents the operation of a water supply system with a tank, two pumps in parallel, and losses proportional to the tank level. The main parameters of the model are summarized in Table 2.

The objective function (1) minimizes the total cost Z, composed of the electricity cost, dependent on the tariff ae k, the flow–energy conversion κ, and the pumped flows qp,k , and the cost of losses weighted by aw                                                                       

  

The evolution of the tank level is described by Equation (2), which enforces the mass balance between inflow (pumps), outflows (demand Dk ), and losses Qloss . Losses are modeled by Equations (3)–(4) as a linear function of the level hk , resulting in the lost volume  Wk in each period.

The operational constraints ensure feasibility: Equation (5) limits the tank level between Hmin and Hmax, while Equation (6) restricts pump flows to their maximum capacity.

Results and Discussion

Model Results

This section presents the main results obtained from solving the water distribution model in GAMS. The values include total costs, reservoir levels, pump flows, energy consumption, water losses, and unmet demands.

Table 3 shows the value of the objective function obtained after solving the model using the solver CPLEX. It is observed that the total operating cost reached approximately e318.98, representing the sum of electricity cost and the penalty associated with water losses.

Indicator

Value

Total cost Z (EUR)

318.98

                                                                                         Table 3: Total Operating Cost

The evolution of reservoir levels (h(t)) over the simulated periods is presented in Table 4. It is observed that the initial level is 20 m, reaches the minimum allowed value of 18 m during several periods, and returns to 20 m at the end, satisfying the periodicity constraint.

Period

Level

[m]

t0

20.00

t12

18.93

t24

18.00

t48

18.00

t72

18.00

20.00

                                                                             Table 4: Reservoir Levels Over the Horizon

Table 5 summarizes the pump flow values (q(p,t)). It is noted that both pumps operate at different periods, with pump b1 being more intensively used toward the end of the horizon

Period

b1

b2

t22

0.002

0.000

t36

0.008

0.005

t48

0.005

0.005

t72

0.008

0.008

t95

0.050

0.050

                                                                             Table 5: Pump Flows in Selected Periods [m3/s]

Table 6 presents the energy consumption per period (E(t)). The values are low per period due to the small flow rates but accumulate over the horizon, contributing to the final cost.

Table 7 shows the water losses (W(t)). They are directly related to the reservoir level, being higher at the beginning and end of the simulation when the level is 20 m.

Period

Energy

[kWh]

t22

0.001

t36

0.003

t48

0.003

t72

0.005

t95

0.062

                                                                Table 6: Energy Consumption in Selected Periods [kWh]

t0

t12

t24

t48

t96

1.800

1.704

1.620

1.620

1.800

                                                                      Table 7: Water Losses in Selected Periods [m3]

Table 8 confirms that there was no unmet demand volume (unmet(n,t)), indicating system feasibility within pump capacity and reservoir levels.

Description

Value [m3]

Unmet volume

0.000

                                                                              Table 8: Total Unmet Demand

Discussion of Results

This section analyzes the results obtained from the water distribution model, relating variable values to the expected system behavior.

The presented results highlight the expected behavior of the modeled system. First, Table 3 shows that the total operating cost Z was approximately e318.98, reflecting the combined contribution of electricity costs and water loss penalties, as described in the objective function.

Table 4 shows that the reservoir level varied between 18 m (minimum allowed) and 20 m (initial level). The tank was gradually depleted until reaching the lower limit, remaining at this level for long periods. This strategy confirms that the reservoir was used as a buffer, supplying water during high-demand periods and reducing the need for continuous pumping.

The pumps (Table 5) operated at different periods, with simultaneous activation only at t95, when demand required greater replenishment of the tank. The strategy was economical, avoiding unnecessary pump operation and concentrating activation at specific times.

Energy consumption (Table 6) per period was low but accumulated throughout the day, representing the largest share of total cost. The highest consumption (0.062 kWh) occurred at the same period as the highest flow, confirming consistency between results.

Losses (Table 7) were proportional to the tank level—higher at the beginning and end of the simulation. If the cost of water loss (2 EUR/ m3) is sufficiently high, the model tends to keep the level low to reduce losses, consistent with the observed behavior. Unmet demand (Table 8) was zero, indicating that the model is feasible and met all demand within capacity constraints.

The results confirm that the MILP formulation adequately reproduces system dynamics. The optimal operation used the tank as a buffer, reducing pump activation during high tariff periods, resulting in a total cost of 318.98 e.

Algorithms, Program Codes

In addition to the mathematical formulation presented in the previous sections, the proposed optimization model was implemented using the General Algebraic Modeling System (GAMS). This environment allows for a compact and structured representation of linear programming problems, facilitating the definition of sets, parameters, decision variables, and constraints in a form that closely resembles their algebraic expressions.

The GAMS implementation provides an executable version of the model, enabling the computation of optimal solutions under the specified operational and economic conditions. It also ensures reproducibility of the results and allows for straightforward modifications, such as changes in demand patterns, tariff structures, or system parameters.

For completeness and transparency, the full GAMS code is presented below using the listings package, which preserves the original formatting of the program and improves readability within the document.


The optimization model described above was implemented in the GAMS environment, which provides a convenient algebraic framework for defining sets, parameters, variables, and constraints, as well as for solving large-scale linear programming problems. While the GAMS code offers a precise and executable representation of the model, it is inherently tied to a specific modeling language.

To enhance clarity and improve readability for a broader audience, the core logic of the implementation is also presented in the form of structured pseudocode (Algorithm 1). This abstraction highlights the sequential structure of the model, including the temporal evolution of the system, the computation of energy consumption and water losses, and the enforcement of operational constraints.

The pseudocode representation is not intended for execution, but rather to provide a transparent and language-independent description of the optimization procedure. In particular, it emphasizes the dynamic update of the tank level, the interaction between inflows, demand, and losses, and the formulation of the objective function to be minimized.

This dual representation—GAMS implementation and pseudocode—facilitates both reproducibility and conceptual understanding of the proposed approach.


Conclusion

The results confirm the viability of the MILP approach for modeling water distribution systems. The model adequately represented mass balance, operational constraints, and costs, providing solutions that minimize total system cost. The optimal strategy prioritized the use of stored water, reducing pump usage during high electricity tariff periods while ensuring demand satisfaction.

In addition, the model proved to be sufficiently flexible to incorporate different demand scenarios, energy costs, and operational parameters, and can serve as a decision-support tool for managers of urban water supply systems. As future work, it is suggested to extend the model to include multiple tanks and supply sources, as well as to consider uncertainties in demand and energy tariffs.

Data Availability Statement

In this work, no external datasets were used, as the data employed for simulation were fictitious.

AI

AI-assisted improvements in texts generated by humans to enhance readability and style, and to ensure that texts are free from errors in grammar, spelling, punctuation, and tone.

References

  1. Bertsimas, D., & Tsitsiklis, J. N. (1997). Introduction to linear optimization (Vol. 6, pp. 479-530). Belmont, MA: Athena scientific.
  2. Dantzig, G. B. (1963). Linear Programming and Extensions. Princeton University Press.
  3. Hillier, F. S., Lieberman, G. J. (2001). Introduction to Operations Research. 8th ed. McGraw-Hill.
  4. Li, X. (2022). An interval two-stage fuzzy fractional programming model for planning water resources management in the coastal region – A case study of Shenzhen, China. Environmental Pollution, v. 306, p. 119343.
  5. Moazeni, F., Khazaei, J. (2020). Optimal operation of water-energy microgrids; a mixed integer linear programming formulation.Journal of Cleaner Production, v. 275, p. 122776.
  6. Korotaj, B., Vasak, M. (2025). Predictive control of a general water distribution system by using sequential linear programming.Control Engineering Practice, v.156, p. 106232.