Introduction

Water shortage is a growing problem that impacts many communities around the world. It can be caused by different factors such as insufficient water infrastructure, institutional failures, and demand that surpass supply. Molden (2020) provides examples from different regions like California, Egypt, Lesotho, and the Himalayas to illustrate how mismanagement exacerbates water scarcity issues, even in areas with adequate water supplies. To minimize water scarcity and energy consumption, Pardo et al. (2020) consider recovering part of the energy by finding an efficient operating strategy for the optimal location of pressure-reducing valves in water distribution systems. The management of water distribution systems (WDSs) can become complex due to issues like leakage and pipe aging, which are commonly associated with water scarcity (Brentan et al. 2022). One of the paramount concerns in water management revolves around addressing the challenges posed by aging and deteriorating water distribution networks (Aşchilean et al. 2017a). Specifically, water pipe corrosion is a critical issue that necessitates a thorough understanding for effective decision-making on solutions and advancements (Amorocho-Daza et al. 2019). This may involve the exploration of novel materials or technologies to prevent or mitigate corrosion. Reliable decision support procedures are essential in navigating this complex process (Abdelbaki et al. 2017).

In this context, Hassan et al. (2018) introduced a model integrating two optimization techniques, the genetic algorithm (GA) and heuristic programming (HP), known as GA-HP, for designing water distribution infrastructure. In an another study, Hassan et al. (2020) utilized a combination of a genetic algorithm and tree growing algorithm (GA-TGA) to determine optimal pipe diameter and slope for the sewer system. Several studies have explored the use of decision support systems (DSSs) such as the multi-criteria decision analysis (MCDA) and Geographic Information Systems (GIS) for effective drinking water network management.

Decision-making in emergencies is complex, requiring the integration of various criteria, models, and data sources (Pagano et al. 2018). Salehi et al. (2018) found that the use of multi-criteria decision models can address the complexity of decision-making for the rehabilitation planning of any town network. Așchilean and Giurca (2018) examined various rehabilitation technologies for water supply systems using multi-criteria analysis and chose pipeline techniques among other alternatives to rehabilitate the distribution networks in Cluj-Napoca. Tanyimboh and Kalungi (2009) applied the analytic hierarchy process (AHP) to determine the optimal solution for designing and improving a water distribution network in Wobulenzi, Uganda. dos Santos Amorim et al. (2020) used the AHP method to compare and prioritize three potential solutions for low-income housing in Brazil and found water-saving equipment to be the most effective alternative. Al-Zahrani et al. (2016) used a fuzzy-based decision support system and fuzzy AHP methods to identify the areas in the water distribution network that are most susceptible to vulnerability in Al-Khobar, Saudi Arabia. (Amorocho-Daza et al. 2019) developed a methodology using MCDA for water supply planning and evaluated alternatives systematically to determine the views of different stakeholders in relation to non-economic factors for alternate water supply infrastructure in the City of Santa Marta, Colombia. Gül and Firat (2021) utilized MCDA techniques like the Elimination and Choice Expressing Reality known by (ELECTRE) to identify the most critical regions in the water distribution systems that need rehabilitation in order to reduce water losses in Maltaya, Turkey.

Another study conducted by Senapati and Das (2022) focuses on assessing groundwater potential in the agriculture-dominated Cooch Behar district of West Bengal, India. GIS-based two MCDM methods have been using, AHP and multi-influencing factor (MIF) to create a perspective mapping of groundwater potential zone for the research region. The research region was categorized into five zones based on the output map: very poor, poor, moderate, good, and excellent. Other studies compared several MCDA methods and analyzed their suitability for use in integrated asset management of water systems. Tscheikner-Gratl et al. (2017) compared five different MCDM methods for use in an integrated rehabilitation management scheme for small and medium-sized municipalities. Yoo et al. (2014) proposed a more reliable way to prioritize rehabilitation in water pipes through the use of a multi-criteria decision-making process that considers the hydraulic significance of the pipes.

Likewise, the application of GIS technology in managing water infrastructure has proven to be effective in determining the condition of the water distribution network spatially and assists in predicting future situations. Abdelbaki et al. (2017) conducted a case study in Chetouane, Algeria where the areas of the water distribution network that require improvement were identified effectively using GIS analysis. Abdessamed et al. (2023) used GIS to study water quality in the Ain Sefra watershed in the Western part of Algeria. Their research revealed that integrating the water quality index (WQI) with GIS is an invaluable tool. By creating maps that display WQI variations throughout the watershed, policymakers can make informed decisions and allocate resources to more effectively manage water resources. In the same context of water supply management, (Kendouci et al. 2019) employed GIS to spatially analyze the WDN and infrastructure in Bechar, an arid Algerian city. Their GIS analysis, combined with a survey of 20% of residents, revealed 74% were unsatisfied with water quality/quantity, and 59% had inadequate pressure requiring pump usage.

GIS is needed in order to effectively arrange and analyze a vast array of spatial information for use in decision-making models. The combination of GIS and the AHP method has been applied in various studies to assess and predict urban water demands, prioritize rehabilitation plans in water distribution networks, and rank water mains for maintenance, rehabilitation, or replacement. Panagopoulos et al. (2012) used the AHP method in conjunction with GIS to assess and predict current and future urban water demands in the Greek city of Mytilene. Tabesh and Saber (2012) developed a decision support tool for prioritizing rehabilitation plans in the water distribution network by utilizing GIS in the city of Mashhad, located in the Northeast of Iran. Mesalie et al. (2021) conducted a risk assessment of the drinking water distribution system at Bahir Dar Institute of Technology in Ethiopia. To evaluate and prioritize risks across the network, they developed an approach that combined GIS and AHP. The combination allowed to assess both structural and customer point risks across the distribution system. The findings revealed that the components of the campus water supply distribution system should be replaced before they become obsolete and suitable preventive measures should be taken.

Kabir et al. (2015) have developed a model that can rank water mains within a distribution network and identify sensitive and fragile pipes to support the need for maintenance, rehabilitation, or replacement combined with a GIS model. The integration of MCDA and GIS forms a powerful tool for making effective decisions by being able to display the result of a multi-criteria decision on a spatial map for better visualization and understanding. It allows spatial data and analysts’ criteria to be combined to solve spatial problems (Rajabi et al. 2011). In studies conducted in Batu Pahat, Malaysia (Ali Ahmad et al. 2015), and the city of Malatya, Turkey (Kilinç et al. 2018), MCDA using AHP was applied to identify suitable sites for constructing reservoirs and evaluate options for inadequate pipeline functionality, respectively.

The use of GIS technology in analyzing spatial data and criteria can aid in solving spatial problems and making informed decisions. There are various decision-making systems and models that have been created for different purposes. For instance, Curry et al. (2020) developed a scientific approach to aid in the decision making process regarding the renovation or removal of significant dams. Kessili and Benmamar (2016) proposed a methodology for prioritizing sewer rehabilitation networks in Algeria’s capital city by ranking different criteria using AHP. Lima et al. (2021) conducted a multifaceted multi-criteria evaluation that incorporated the perspectives of both local stakeholders and decision makers to identify priority watersheds for implementing groundwater management strategies. The authors emphasized that the model should be utilized as a supplementary tool in the decision-making process and not solely relied upon as the decisive approach. In another related study, Zolfaghary et al. (2021) utilized GIS and a MCDA to assess the feasibility of using treated wastewater from urban areas for irrigation purposes in Golestan province located in Northern Iran.

Although many programmers have worked on developing such a tool, only a few have implemented it in the water sector, especially on renovation and rehabilitation of water distribution networks. Initially, decision application tools were developed in ArcGIS for land use assessment. Marinoni (2004) described the implementation of an analytical hierarchy process in ArcGIS using the visual basic programming language to facilitate land use assessment. Boroushaki and Malczewski (2008) further extended the work of Marinoni and concentrated on incorporating GIS with an expanded version of the analytical hierarchy process for spatial MCDA. However, the method used a combination of weighted summation GIS procedures in the evaluation process to calculate the weights of each alternative. The output was presented in a raster format. Elhaj (2018) improved upon the previous work by creating a Python tool to integrate the analytical hierarchy process into ArcGIS.

Although the Python programing language is actively used, both in industry and academia, for a wide variety of purposes, no previous work developed the tool for network rehabilitation using AHP methods scripted in GIS using Python in the urban environment, which holds significant importance for efficient utilization and management of urban water resources. One tool already integrated in ArcGIS that can be combined with the AHP method is overlay analysis, which identifies the best or most preferred locations by applying weights to several layers and combining them into a single output. However, the overlay analysis only accepts raster data as an input, which can result in a piece of lost information by converting vector data into raster data. Therefore, a tool that uses vector inputs such as the pipeline layer to identify the sections that must be rehabilitated or renewed by weighting all the alternatives using the AHP method is highly needed.

Some methodologies and strategies have been proposed to rehabilitate intermittently supplied networks using multi-criteria procedures. These methods address complex planning issues such as identifying the inefficiencies within the water distribution network system. Brentan et al. (2022) developed a multistage optimization procedure for rehabilitating a water distribution network, consisting of three different operations: pipe replacements, leakage fixing, and pump optimization, however, their study is limited because the pipe replacements are based only on aging pipes factor, and other criteria such as different materials of pipes were not considered. Juan et al. (2022) proposed a comprehensive methodology that consists of three stages aimed at rehabilitating deteriorated water systems. The first stage, termed Initial system assessment, involves identifying vulnerable areas and critical supply hours. The second stage, known as sectorization, entails defining optimal district metered areas to reduce water losses and increase the supplied water through improved control of flows and pressure. Finally, the third stage determines the optimum investments for asset rehabilitation, including upgrading storage tanks, replacing pipes, repairing leaks, and replacing pumps. They used EPANET through a Python integrated development environment and the NSGA-II algorithm (Non-dominated Sorting Genetic Algorithm) to optimize the rehabilitation of a water distribution system with intermittent service, including replacing pipes and repairing leaks. This approach prioritizes pipe replacements based on performance and cost, within budget constraints, to improve system performance. It is important to mention, though, that their detection of vulnerable regions depended solely on the supply ration (SR), which is the supplied water over the expected water demand. Brentan et al. (2022) utilized graph theory in their methodology to identify the most important pipes in the WDN. This enables targeted repair or rehabilitation of these pipes to improve the performance of the WDN in providing intermittent water supply (IWS).

One of the main innovations of our work is the development of a tool that allows integration of the AHP method with GIS for vector data. This integration enables the use of spatial data to aid in the decision-making process for rehabilitating water distribution networks, which can be particularly useful for identifying priority areas for intervention. The tool also generates tables containing the criteria and indicators used in the decision-making process. Additionally, the tool calculates weights for each criterion and indicator by comparing them pairwise. This allows for prioritization of the network sections that need rehabilitation or renewal.

The tool is user-friendly, catering to scientists, engineers, and water management officers. It serves as a guide for decision-makers and planners in urban water management and holds the potential for replication in diverse global contexts. The integration of AHP with GIS offers an innovative approach to support decision-making in water distribution network rehabilitation, with broad applicability in similar contexts.

Materials and methods

Study area

The developed tool was applied to the water distribution network of the Southern part of the urban agglomeration of Tlemcen in Algeria, which encompasses the towns of Tlemcen, Chetouane, and Mansourah. This region, located in the Western part of Algeria, covers around 112 Km2 forming the Tlemcen inner basin. The boundaries of this basin are defined by Lalla Setti cliff to the South, Ain El Houtz hills to the North, Oum El Allou to the East, and the small volcanic cone mountains of Beni Mester to the West (Abdelbaki et al. 2019). The research site located in the Southern region of the urban aggregation of Tlemcen encompasses an area of 3.4 Km2 as depicted in Fig. 1. The topography of the study area is rough and the soil is of a semi-rocky nature, with the presence of a significant horst formation. This horst’s surface is primarily composed of karstic limestones originating from the Upper Jurassic and Lower Cretaceous periods. These carbonate formations constitute a notable karst landscape, overlaid by substantial Neogene sedimentation layers. Groundwater within this karst region is extensively extracted via boreholes, serving as a crucial source of potable water (Bensaoula 2007; Fellah et al. 2016).The elevation is characterized by steep inclines with elevation drops ranging from 800 to 1100 m (Berrezel et al. 2022).

Fig. 1
figure 1

a Algeria’s location within the African continent; b Tlemcen city’s position within Algeria; c Tlemcen town’s placement within Tlemcen city; d The study area’s location within Tlemcen town; e The water distribution network of the study area; f The digital elevation model (DEM) representing the study area; g Topographic profiles of the main directions

The WDN of the study area is characterized by a tremendous rate of water loss that exceeds 50% due to aging pipes, inadequate construction or repair of pipes, and a failure to adequately maintain and replace the pipelines. The water supply system is poorly structured as a result of extensions made without basic design (Abdelbaki et al. 2012). There are several deficiencies in the network, including frequent interruptions in the water supply, high levels of water loss due to leaks (60%), and a lack of attention to the aging and outdated piping infrastructure. (Abdelbaki et al. 2014). So far, the water networks are facing serious management issues.

Data used

The database of the WDN used in this research was obtained from various sources (Abdelbaki 2014; Berrezel et al. 2022). The main data were water pipes network. The length of the analyzed network (main pipes) spans 65 km, featuring pipes with a diameter that ranges from 40 to 600 mm, and made of different materials such as steel, galvanized steel, and high-density polyethylene (PEHD). The water distribution system relied on gravity and using 11 tanks with capacities ranging from 1500 to 2000 cubic meters, located at altitudes between 800 and 1000 m. The study area’s background map was obtained from Google Earth Pro and calibrated using the georeferencing tool of ArcGIS. This process involved importing the Google Earth Pro image into ArcGIS and identifying common features shared between the image and other georeferenced data layers. Control points were strategically placed on these common features within both datasets.

Methodology

The research methodology of this paper consists of three phases: algorithm development, AHP tool development, and tool application (Fig. 2). The main goal of this tool is to extract the attribute data from the water network layer in ArcGIS and prioritize pipes based on their laying date, diameter, material, etc. The weight calculation of the pipes is carried out using the AHP method, allowing the user to determine their emergency level in the WDN. The algorithm development phase outlines the main instructions and operations utilized to run the tool. The AHP tool development phase illustrates how to combine the tool with the AHP method using Python modules and packages within ArcGIS, also demonstrating the script or the code of the program. The final phase involves applying the AHP tool in the study area to validate the generated findings. A testing process was undertaken to accomplish this. The system was designed to work with a vector layer as vector files are used when descriptive information needs to be stored. Vector data are preferred in this case because it allows to represent the geographical features of water distribution network in a more precise and accurate way. Vector data consists of points, lines, and polygons, each with its attribute data, including information about the laying date, diameter, and material of the pipes. This information is critical for calculating the pipe’s emergency level using the AHP method.

Fig. 2
figure 2

Phases in the development and application of a multi-criteria decision-making tool

In this study, the water distribution network and its attribute data were primarily represented using raster data. However, it is important to note that raster data, being composed of pixels, lacks the capability to store different attributes directly. As a result, using vector data would be a more suitable approach for accurately representing the water distribution network and extracting the necessary attribute data for prioritizing the pipes. Despite the limitations of raster data, the study proceeded with some tests using raster data. The approach involved converting the network layer into raster layers for conducting overlay analysis and classifying the network. Nonetheless, this process led to the loss of valuable information due to the inherent nature of raster data representation. To enhance decision-making accuracy and align more closely with reality, the program incorporates binary comparisons, initially employed by the AHP method to establish the relative importance or priority of different criteria. This functionality enables researchers to refine analyses by making necessary adjustments or redoing certain evaluations. When assessing attributes of the water distribution network such as pipe material or diameter, binary comparisons are instrumental in identifying critical factors and prioritizing them over others. However, while binary comparisons significantly contribute to the analysis by incorporating vector data and uncertainty modeling, assessments can be greatly enhanced, particularly through sensitivity analysis. This type of analysis determines how alterations to input variables affect the model’s output, enabling identification of the sensitivity of decision outcomes to changes in physical patterns or hydraulic parameters. Such analysis can pinpoint the key drivers of system performance and evaluate the viability of proposed interventions, ultimately leading to more informed and effective decision-making in the management of drinking water networks.

Algorithm development

Prior to scripting the program, the proposed algorithm was utilized to define a step-by-step set of instructions. The main goal of this tool was to use data from the pipe layer and calculate the emergency level by employing the Analytic Hierarchy Process (AHP) method. The AHP method relies on pairwise comparisons of criteria, which are presented as weight matrices represented as tables within the ArcGIS environment and accessible via the table of contents. The algorithm illustrated in Fig. 3 outlines the main instructions used to run the tool.

Fig. 3
figure 3

The algorithm utilized to run the AHP tool in ArcGIS

The initial steps involve importing the file containing the pipe network layer as an input (Step 1), and specifying which attribute fields from the pipe layer will be used as criteria for the AHP analysis, such as the diameter and material of the pipes (Step 2). The program then creates a table containing the user-defined criteria to facilitate pairwise comparisons between them based on the Saaty scale (Saaty 1980), which allows the user to indicate the relative importance of one criterion over another (Step 3).

To ensure the consistency of the judgments made during the pairwise comparisons, the program performs a consistency check (Step 4). If the inconsistency exceeds a certain threshold, the user may need to revise their comparisons. Once the pairwise comparisons are completed, the program automatically calculates the weight or priority of each criterion by generating a pairwise comparison matrix and performing the necessary computations (Step 5). The same method is used to calculate the weights of any sub-criteria, if applicable, by creating additional pairwise comparison tables.

The program then generates fields or columns in the main pipe layer to store the calculated weights for each criterion and sub-criterion (Step 6). As part of the summation process, separate fields or columns are created to store the weighted values for each individual criterion or sub-criterion (Step 7). The calculated weights for each criterion and sub-criterion are assigned to their respective fields or columns in the pipe layer’s attribute table (Step 8).

Finally, to obtain the overall emergency level or priority score for each pipe section, the program calculates the sum of the weighted values for all criteria and sub-criteria. This summation is performed by dividing the sum of the weighted values by the maximum value of the sum, resulting in the absolute weight or emergency level for each pipe section. The calculated emergency levels can then be used for decision-making purposes, such as identifying high-priority areas for maintenance or emergency response within the pipe network.

AHP tool development

Analytic hierarchy process (AHP): Saaty (1980) proposed the AHP method in the 1980s; it is a way for comparing, weighting, and ranking the options and criteria. In order to make a decision in an instructed manner, Saaty has developed 4 steps (Saaty 1988, 2001, 2008): (i) identifying and clarifying the problem’s context; (ii) dividing the decision-making problem into levels, starting at the top with the decision’s objective, moving down to specify criteria and options, and ending with a collection of alternatives; (iii) making pairwise comparison matrices and determining the relative weights; (iv) assessing the accuracy of the pairwise comparisons can be done by computing the consistency index (CI) and the consistency ratio (CR).

To compare criteria, Saaty (1980) proposed a scale that can be used to identify which one is more important than the other (refer to Table 1). In this particular case study, the Saaty scale was used to compare different attributes of pipes in the water network, such as laying date, diameter, material, etc. By assigning a numerical value to the relative importance of each attributes, we can use the AHP method to calculate the weights of each pipe and prioritize them according to their emergency level in the water distribution network.

Table 1 Saaty numerical scale (Saaty 1980)

A square matrix was constructed to arrange the pairwise comparisons of the different criteria according to Eq. 1.

$$ A = \left[ {a_{ij} } \right] = \left[ {\begin{array}{*{20}c} 1 & {a_{12} } & \cdots & {a_{1n} } \\ {1/a_{12} } & 1 & \cdots & {a_{2n} } \\ \vdots & \vdots & \ddots & \vdots \\ {1/a_{1n} } & {1/a_{2n} } & \cdots & 1 \\ \end{array} } \right] $$
(1)

where A is the decision matrix, aij are comparisons between elements I and j for all i, j ∈ {1, 2,,, n}.

The values in the resulting pairwise comparison matrix represent the relative importance of each criterion, and the matrix should be normalized by dividing each value by the sum of the values in its corresponding row. The weight is derived by determining the mean of every row (Boukhari et al. 2018).

To assess the accuracy of the pairwise comparisons and to determine the level of consistency in the judgments, the Consistency Index (CI), Consistency Ratio (CR) and Random Index (RI) can be used. These are calculated using Eq. (2):

$$ {\text{CR}} = {\text{CI}}/{\text{RI}} $$
(2)

where:

RI: Random Consistency Index, (RI) can be determined from Table 2

$$ {\text{CI}} = (\lambda \_\max - n)/\left( {n - 1} \right) $$
(3)

where:

Table 2 Saaty (Saaty 1980) values of random index

λ_max: the dominant eigenvalue of the pairwise comparison matrix.

n: the order of the matrix.

The consistency ratio (CR) determines the validity of pairwise comparisons. If the CR exceeds 10%, the evaluation criteria must be reevaluated. The final weight is determined by multiplying the weights assigned to individual indicators at the lowest level by the weights assigned to higher levels of criteria and dimensions.

The AHP tool for ArcGIS was implemented using the Python programming language and leveraged ArcGIS modules for various stages of the process. The tool calculates the emergency level using data from a pipe layer through four steps: data input, matrix creation, calculation, and output.

To add a script tool in ArcGIS, the first step is to create a tool by entering its name, label, and optionally a description. The tool is used to perform a specific task and requires certain input parameters to be set in order to function correctly. These parameters are defined in the wizard panel and can be accessed and used in the source code as input. Each parameter has a unique name, a data type that specifies whether it is a table, layer, field, or something else, and certain properties such as whether it is required or optional. Some parameters may also have a filter to restrict the values that can be entered or may allow for the input of multiple values instead of just one.

The Python program for ArcGIS consists of four phases: in the first phase, the program prompts the user to input the name of a network layer and select fields to use as criteria. A table is created with the same columns and rows as the selected fields, with a domain for ranking criteria in a scale proposed by (Saaty 1980). This allows the user to compare the importance of each criterion in the table. In the second phase, the program calculates the weight of each criterion in the table. In the third phase, the program adds the fields of indicators to the main layer and updates the rows by adding the weights of each criterion and sub-criteria. In the fourth and final phase, the program calculates the sum of all fields added by the user and divides it by the maximum value of the sum to obtain the absolute weight of the indicators.

Application of the tool

To apply this tool in the study area, there are two main steps. The first step is to define the hierarchical structure and characteristics of the area’s pipe network, while the second step involves the application of the AHP tool. Defining the hierarchical structure & characteristics of the area’s pipe network involves dividing pipe networks into specific sections based on their specific characteristics such as material, diameter, and year of construction (Tscheikner-Gratl et al. 2017). These characteristics are the influencing criteria which represent different elements of the rehabilitation decision (Tscheikner-Gratl et al. 2015). In the present study, two main criteria were taken into consideration: the physical characteristics and the hydraulic performance of the network. The physical structure of the network criterion is divided into three sub-criteria, which are materials used, laying date, and diameter of pipe (D). The hydraulic behavior of the network criterion was divided into two sub-criteria which are water pressure (P), and water velocity (V). The user can define additional criteria based on data availability to increase the reliability of the decision-making. Figure 4 illustrates the hierarchical structure to define which part of the network should be rehabilitated by classifying the sections in emergency levels; each criterion is subdivided into sub-criteria with 3 indicators. The ratings approach is used when there are many alternatives to be evaluated. Instead of comparing the options pairwise, the appraisal is carried out using indicators (categories) to evaluate or assess the performance or effectiveness of an alternative as following: (1) materials: comparison between the least desirable and the most desirable; (2) pipe laying date: the laying date of each section will be taken into account, with older sections being given higher priority; (3) the diameter, pressure, and velocity sub-criteria may be evaluated based on the size of the pipe, the pressure level at which it is situated, and the water velocity within it, respectively.

Fig. 4
figure 4

The hierarchical structure and characteristics of the area pipe network

Overall, the process of defining the hierarchical structure and characteristics of the area’s pipe network is important because it allows the user to identify the main structure of the network in an organized way, and to determine which sections of the network should be rehabilitated or renewed. This information is then used in the second step of the process, which involves applying the AHP tool to analyze and prioritize the different elements of the pipe network.

To illustrate the calculation process for the comparison of various criteria through pairwise comparisons, the following steps exemplify the assessment of sub-criteria (material, diameter of the pipe, and laying date). The elements are arranged in matrix A.

$$A\hspace{0.17em}=\left[\begin{array}{ccc}1& 1/4& 1/3\\ 4& 1& 2\\ 3& 1/2& 1\end{array}\right]$$

The importance of these elements is assessed by totaling the values in the columns of matrix A, and then dividing each value by the sum of the column. The importance is derived by computing the average of each row. The sum of each column: [8, 1.75, 3.33].

Dividing each value in the column by the total of the column:

$$\left[\begin{array}{ccc}1/8& (1/4)/1.75& (1/3)/3.33\\ 4/8& 1/1.75& 2/3.33\\ 3/8& \left(1/2\right)/1.75& 1/3.33\end{array}\right]=\left[\begin{array}{ccc}0.13& 0.14& 0.10\\ 0.50& 0.57& 0.60\\ 0.38& 0.29& 0.30\end{array}\right]$$

The weight is determined by finding the mean of each row:

$$\left[\begin{array}{c}0.122\\ 0.558\\ 0.320\end{array}\right]$$
$$ {\text{Det }}\left| {A \, {-} \, \lambda I} \right| \, = 0 $$

This allows to find the eigenvalues of the matrix A.Where I: the identity matrix. λ: the eigenvalues of the Matrix.

$$\mathrm{Det }\left|\left[\begin{array}{ccc}1& 1/4& 1/3\\ 4& 1& 2\\ 3& 1/2& 1\end{array}\right] - \lambda .\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right]\right|=0$$

λ is calculated as 3.018, n: the order of the matrix, n = 3, RI: Random Consistency Index, RI = 0.52, λ_max: the principal eigenvalue of the matrix, λ_max = 3.018, Consistency Index: CI = (λ_max−n)/(n  −  1) = (3.018–3)/(3–1) = 0.009, Consistency ratio: CR = CI/RI = 0.009/0.52 = 1.73%

CR is less than 10%. Thus, the comparison matrix is consistent.

To use the AHP tool in the process of analyzing and prioritizing elements of a pipe network, the user must first specify the criteria and options for each level of the hierarchy. The tool will then create tables with the same column and row names for binary comparison and calculation of the weights of the criteria and indicators. The user must run 5 scripts to get the result. The steps below demonstrate how to use the AHP tool to get the best results.

The first script involves creating a table that combines the criteria to be weighted, with the selected criteria belonging to the same group (e.g., main criteria) as shown in Fig. 5. For example, the laying date, materials and the diameter of the pipe are three sub-criteria that belong to the main criterion named hydraulic structure. The user then determines the level of importance of elements in the matrix according to the Saaty scale (Table 1) and the weight of each criterion is calculated automatically using the weighting tool in the second script.

Fig. 5
figure 5

Weight of each criterion obtained by the AHP Tool

The third script is used to create a table of indicators that can be used to evaluate the different alternatives (elements) of the pipe network. To use this script, the user must input the table of criteria calculated in the previous step and specifies the indicators that will be compared and weighted. The resulting table of indicators is then used in the next step of the process which involves creating fields in the main layer and using a summing tool to calculate the final weight of each alternative. In the fourth script, fields are created in the main layer, each field representing the weight of one sub-criterion. In our case, we have 5 sub-criteria and 15 indicators (Fig. 5).

The summing tool is used in the fifth script to calculate the final weight of each pipe section by adding the values in the fields created in the previous step. After calculating the final weights of each pipe section, the user can classify them by order and prioritize the maintenance actions or other decision-making processes related to the pipe network.

In this study, three classes were proposed to categorize the sections by their weights, with green indicating low priority (level 3), yellow indicating medium priority (level 2), and red indicating high priority (level 1). This classification system allows for the identification of the priority portions of the maintenance action and the classification of pipelines into immediate, intermediate, and long-range plan-repair categories in the water distribution network.

Validation of the tool

This study builds up on the works of previous researchers (Abdelbaki et al. 2012, 2014, 2019), who have examined various aspects of the drinking water network operations, including conducting surveys and diagnosing issues arise from water supply disruptions. By incorporating the insights and findings from these studies, a more comprehensive and nuanced understanding of the emergency levels within the study area was developed. The methodology used in this study relied on the Analytic Hierarchy Process (AHP), which enabled us to classify the area into low, medium, and high emergency levels based on a detailed assessment of multiple factors. The use of field surveys conducted by (Abdelbaki 2014; Abdelbaki et al. 2014) allowed us to validate the obtained results and ensured their alignment with the actual ground conditions, thereby enhancing the credibility and robustness of the present study. The survey was designed to evaluate the quality of service provided to subscribers, including the quality of repair work and customer complaints. Both customer and manager surveys were conducted to evaluate the satisfaction levels of customers with the current water supply service and to identify areas of improvement. Following the survey, various technical indicators were assessed as shown in Table 3, such as network yield, linear losses index (LLI), linear index of repair, annual average rate of network renewal, and operating pressure. These technical indicators were used to evaluate the efficiency and effectiveness of the water supply network, with the aim of identifying any issues or weaknesses in the technical aspects of the network and recommending corrective measures to improve the overall performance of the water supply system. The combination of customer surveys and technical assessments provided a comprehensive evaluation of the water supply network, enabling the identification of areas for improvement and development of a plan to ensure the continuous and sustainable operation of the water supply system.

Table 3 Technical indicators for the Tlemcen urban group

Results and discussion

Criteria weighting and influence on emergency classification

In order to classify and group WDN maintenance into three levels of emergency, the AHP tool was used to determine the weight of each section based on pairwise comparisons of criteria and indicators. The results indicate that the criteria “Material” and “Laying Date” have more influence than the other criteria as they were given more importance by the user (Fig. 5). Figure 6 displays the weights of the indicators, with “Cast Iron” and the laying date “20 years” having the highest weight compared to the other indicators. This implies that pipes made of cast iron and with the laying date of 20 years are the most likely to undergo renewal or rehabilitation. Tscheikner-Gratl et al. (2017) found that the majority of pipeline failures in the water distribution network occur in cast iron and steel pipes. These materials are no longer used in modern water networks due to their tendency to fail and cause disruptions. Aşchilean et al. (2017b) stated that sections of steel pipes experienced significant water losses when compared to polyethylene pipes, which have fewer failures in the water distribution network. The pressure criteria and the indicator “4 < P < 7 bar” can also impact the results because it is widely accepted that water pressure for domestic use should not exceed 4 bars, water leaks can appeared if this value is exceeded (Abdelbaki et al. 2014). In other words, it is critical to consider the user’s judgment while selecting the criteria and indicators.

Fig. 6
figure 6

Weight of each indicator obtained by the AHP Tool

The tool displayed the calculation results on the map, making it easier to detect deficient parts of the network which are highlighted in red color (Fig. 7). The sections of the network that are characterized by indicators with a high weight will typically tend to be in the red zone. During the pairwise comparison of the indicators that have influenced the state of the network, such as the laying date (26%), the pressure (20%), or network materials (26%), it was found that these indicators had higher weights based on the user’s judgment of their importance (72% of the overall weight). Results are displayed on the map.

Fig. 7
figure 7

The emergency level of the network

Figure 7) aids in easy identification of various parts and to prioritize them. The length of the primary pipeline being examined is 65 km, with a diameter ranges from 40 to 600 mm, made of various materials such as cast iron, PEHD, and steel. The classification of these pipes (which refers to grouping the pipes based on their weights) has allowed the prioritization of the parts of the network based on their level of emergency, determined by order, category, and color assigned to each pipe. For instance, pipes with higher weights (and therefore, higher levels of emergency) are assigned a higher order, a more urgent category, and a more distinctive color (such as red) to clearly indicate their higher priority status. Similarly, pipes with lower weights and lower levels of emergency are assigned lower orders, less urgent categories, and less distinctive colors (such as green) to reflect their lower priority status. Figure 8 shows that 25% of the network is in the critical phase (level 1) and should be rehabilitated with first priority, 62% is in medium emergency (level 2), and the rest 13% covers the low level of emergency (level 3). Several researchers classified the network in 3 level (low—medium—high) in terms of rehabilitation zones such as (Kabir et al. 2015; Tscheikner-Gratl et al. 2016). (Salehi et al. 2018) classified the network into 4 zones; each zone has a specific characteristic, so the prioritization of the pipes has been done separately. Prioritizing various pipes with high weights leads to renewal measures. The link between prioritizing and renewing is used in many results in similar research topics. (Boutebba et al. 2014), classified sections according to their weight, and proposed the chronological order of the renewal interventions.

Fig. 8
figure 8

Weights of each emergency level obtained by the AHP Tool

Spatial indicator analysis for WDN prioritization

One way to analyze the relative weight and location of specific indicators on the network is to use ArcGIS to display their distribution on the map. For example, the “material” criterion and its sub-criterion, the “PEHD” indicator, can be examined to understand their contribution to the overall prioritization of the pipes. By displaying the distribution of this material on the network, it’s clear that its presence in areas of high priority such as the red zone, with 3.5 km of PEHD pipes is 3.5 km is low, as shown in Fig. 9. This information can help decision-makers to make informed decisions about rehabilitation and maintenance actions based on the specific indicator’s relative weight and location on the network.

Fig. 9
figure 9

Linear network of PEHD pipes

This analysis method enables the decision maker to follow each indicator and observe its influence on the network, then take action for rehabilitation. (Salehi et al. 2018) classified network zones by selecting the pipes with higher rehabilitation priorities considering technical and non-technical criteria such as the climate and any special criteria. It’s essential to choose the effective criteria when sufficient network information is available.

There are many criteria to consider for WDS rehabilitation. Mesalie et al. (2021) used multiple criteria, such as pipe age, pipe material, water quality parameters, water availability from supply sources, adequacy of water pressure and flow rate for customers, and the condition of storage facilities and pumps. (Tscheikner-Gratl et al. 2016) found that significant factors such as pipe age, pipe length, pipe diameter, pipe slope, and pipe shape, as well as low network material heterogeneity and vulnerability, greatly influenced the priority model’s result for pipe deterioration. However, the importance of certain indicators, such as the “Diameter” criterion, may be perceived differently by different users.

In this particular study, the “Diameter” criterion had a low weight, but other researchers like (Blindu 2004) found that it is directly related to the importance of the pipe. This highlights the subjectivity of prioritization and the importance of carefully considering the relative weights of different indicators. Structural deterioration of water mains is affected by physical factors (Kabir et al. 2015). (Brentan et al. 2022) cited that replacing old pipes that are prone to deterioration and leakages, may improve the reliability and efficiency of the WDS and better meet the needs of users, yet their analysis did not consider other important factors such as the type of materials used for the pipes, pressure levels, or pipe diameters, which can also significantly influence the performance and longevity of the WDS. Although the age of installation criterion is stated as the most important parameter in many literatures (Rajani and Tesfamariam 2007; Kabir et al. 2015), still Kabir et al. (2015) showed that these factors’ relationships are not linear, thus calculating the pipe failure weights requires a complex representation of the relationships.

While previous studies have primarily focused on the prioritization of pipes and the classification of network zones by selecting pipes with higher rehabilitation priorities, our study extends beyond this by implementing a novel tool to facilitate prioritization and conduct a more comprehensive assessment. Additionally, our approach enables the prioritization process to be more dynamic and adaptable, allowing for multiple prioritization scenarios to be explored and compared.

It is important to acknowledge that despite the advantages of our implemented tool, there are certain limitations that need to be addressed. One such limitation is the subjective nature of weighting criteria and indicators, which can introduce bias into the decision-making process. To overcome this limitation, it is necessary to explore and integrate other MCDA methods that offer more robust mechanisms for handling subjectivity in weighting. Future research endeavors in this regard will aim to compare different MCDA methods to better understand their strengths and limitations to improve decision-making processes in water distribution network rehabilitation. This will contribute to a better understanding of the feasibility and effectiveness of different MCDA methods in handling subjectivity in weighting to achieve more accurate and reliable prioritization results.

Field surveys and technical indicators for WDN emergency level validation

Abdelbaki (2014), conducted field surveys to investigate the status of WDN in Tlemcen area, the surveyed regions are shown in Fig. 10. This allowed us to compare and validate our findings. The study conducted included a total of 100 respondents, comprising of 30 employees of the Algérienne Des Eaux (ADE), the water company, and 70 subscribers in the urban area of Tlemcen. The satisfaction levels reported by respondents in the surveyed areas vary across the four regions: Birouana, Boudghene, El Kalaa Inferieure, and Sidi Tahar. The satisfaction levels are divided into three categories: Good, Moderate, and Poor. The satisfaction levels with network management vary significantly as illustrated in Fig. 11. Birouana has a majority of respondents reporting moderate satisfaction (50%), followed by good satisfaction (27%) and poor satisfaction (23%). Boudghene, on the other hand, has a higher percentage of moderate satisfaction (45%) with good satisfaction (25%) and poor satisfaction (30%). El Kalaa Inferieure experiences a majority of poor satisfaction (61%), lower levels of good satisfaction (24%), and moderate satisfaction (15%). Sidi Tahar stands out with the highest percentage of good satisfaction (40%), followed by moderate satisfaction (45%), and the lowest percentage of poor satisfaction (15%). Interestingly, the AHP rankings closely mirror the survey satisfaction levels in most cases, indicating a consistent prioritization pattern. The AHP values for each satisfaction level further support this alignment.

Fig. 10
figure 10

Spatial distribution of surveyed regions

Fig. 11
figure 11

Comparison between the satisfaction levels of the surveys and the AHP raking

Our classification of emergency levels was consistent with 90% of the findings from the survey, confirming the validity of our results.

Furthermore, the technical indicators presented in Abdelbaki et al.’s study were instrumental in validating our findings. For instance, the non-revenue water indicator in the survey indicated a high percentage of water losses, which aligned with our high emergency level category areas. Similarly, the customer complaints indicator revealed a high number of complaints in certain areas, which was also consistent with our classification of high emergency level areas (Abdelbaki et al. 2014).

Conclusions

A new tool has been developed to aid in managing the water distribution network system in Tlemcen. This tool utilizes ArcGIS and multiple criteria to identify and prioritize the maintenance of faulty network components based on their level of emergency. The study’s results revealed that 25% of the network is in a critical state and should be rehabilitated first, while 62% is in a medium state of emergency, and 13% is in a low state. The main criteria influencing the prioritization of pipes are material (26% of total weight), laying date (26% of total weight), and pressure (20% of total weight). Among the indicators, cast iron pipes (26% of total weight) and pipes with a laying date of 20 years (26% of total weight) had the highest weights.

Additionally, the validation phase of the study was crucial in ensuring the accuracy and reliability of the obtained results. Field surveys confirmed that the GIS-based approach is effective in identifying potential water infrastructure failures in the study area, thereby strengthening the credibility of this study and reinforcing the tool’s potential to guide water management decision-making processes in Tlemcen and other regions. The user-friendly nature of the tool allows scientists, engineers, and water management officers to utilize it as a guide for urban water management in Tlemcen and potentially other regions.

This study represents a novel approach to the management of water distribution networks, combining GIS with multi-criteria decision analysis to prioritize rehabilitation and maintenance actions. The integration of these tools allows for a more efficient and informed decision-making process, leading to improved water management and reduced water losses. Furthermore, the tool’s applicability extends beyond Tlemcen, making it suitable for implementation in various parts of the world.

Moving forward, to improve the management of water distribution networks, it is recommended to enhance and customize the developed tool. This could involve including other criteria or indicators, such as environmental and social factors related to water distribution management. Additionally, integrating real-time monitoring abilities into the tool could provide ongoing observations into network performance, allowing for proactive maintenance and response to changes in the system. This would ultimately improve operational efficiency and resilience.