Next Article in Journal
Resource Scheduling Algorithm for Edge Computing Networks Based on Multi-Objective Optimization
Previous Article in Journal
Exploring Patterns in Quality Alerts via Random Forest and Multiple Correspondence Analysis
Previous Article in Special Issue
Algorithms and Methods for Designing and Scheduling Smart Manufacturing Systems Volume II
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimization Study of Gas Supply Pipeline Systems Based on Swarm Intelligence Optimization Algorithms

by
Li Dai
1,
Chao Xu
2,
Yiqun Liu
3 and
Liang Zeng
3,4,*
1
Utility Design Office, WISDRI Engineering& Research Incorporation Limited, Wuhan 430223, China
2
Technology Center, CCCC Second Harbor Engineering Co., Ltd., Wuhan 430040, China
3
School of Electrical and Electronic Engineering, Hubei University of Technology, Wuhan 430068, China
4
Hubei Key Laboratory for High-Efficiency Utilization of Solar Energy and Operation Control of Energy Storage System, Hubei University of Technology, Wuhan 430068, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(19), 10838; https://doi.org/10.3390/app151910838
Submission received: 1 September 2025 / Revised: 29 September 2025 / Accepted: 1 October 2025 / Published: 9 October 2025

Abstract

With rapid urbanization and industrialization in China, existing gas supply networks urgently require renewal and optimization. This paper proposes a Gray Wolf Optimizer (GWO)-based method for reducing calculation errors and a Zebra Optimization Algorithm (ZOA)-based approach for gas supply pressure distribution. For error correction, the pipe friction coefficient is adjusted to minimize the deviation between calculated and actual flows. The GWO reduces average relative error to 0.01% with satisfactory iteration speed and efficiency. For pressure distribution, supply-end pressures are optimized to reduce energy consumption and enhance system performance. The ZOA shows strong convergence and global search capabilities. These methods provide valuable theoretical and practical insights for optimizing gas supply networks, supporting green transformation and sustainable development.

1. Introduction

With the steady improvement of China’s socio-economic development and the continuous expansion of urban and industrial scales, the existing pipeline systems in China have gradually become insufficient to meet the demands of future development. The General Office of the State Council has clearly outlined in the “Implementation Plan for the Renovation and Upgrading of Aging Urban Gas Pipelines (2022–2025)” [1] that urban gas, water supply, drainage, heating, and other aging pipelines and facilities that have outdated materials, long service lives, safety hazards in operational environments, or fail to meet relevant standards and regulations should be included as targets for renovation and upgrading. At the same time, to implement the “Energy Saving and Carbon Reduction Action Plan” [2] proposed by the State Council, reasonable optimization and regulation of the daily use of pipeline systems can effectively reduce system power consumption, improve operational efficiency, and promote the comprehensive green transformation of economic and social development.
In the design of gas supply pipeline systems, complex hydraulic modeling calculations are often required [3]. Due to errors in the measurement data of various component parameters of the model compared to real values, as well as potential issues such as wear and deformation at interface points during field installation, coupled with simplified measures used in some calculation processes, the final calculation accuracy often cannot meet the required standards and requires subsequent adjustments. At the same time, under the premise of meeting the user’s gas demand, rationally configuring the pressure and flow of gas supply ends can effectively reduce power consumption, save costs.
Correcting errors in pipeline system calculations and configuring gas parameters at supply ends are critical optimization problems in engineering. Swarm intelligence optimization algorithms, inspired by the collective behavior of biological populations, leverage information exchange and cooperation within groups to identify optimal solutions. Ant Colony Optimization (ACO) [4], inspired by the foraging behavior of ants depositing pheromones to guide optimal paths, efficiently solves combinatorial optimization problems through iterative path improvement. Particle Swarm Optimization (PSO) [5], drawing from the social behavior of bird flocks or fish schools, excels in continuous optimization problems tuning by iteratively updating particle positions for efficient convergence. Genetic Algorithm (GA) [6], based on natural selection and genetics, uses selection, crossover, and mutation to evolve solutions, making it effective for complex, multi-dimensional problems. Simulated Annealing (SA) [7], inspired by the metallurgical annealing process, explores solution spaces by accepting worse solutions with decreasing probability to escape local optima. Coyote Optimization Algorithm (COA) [8] mimics the social and hunting behaviors of coyotes, balancing exploration and exploitation for high-dimensional problems. Teaching–Learning-Based Optimization (TLBO) [9], inspired by classroom learning, uses teacher and learner phases to iteratively improve solutions, offering simplicity and effectiveness. Gray Wolf Optimizer (GWO) [10], inspired by the leadership hierarchy and hunting strategies of gray wolves, is highly effective for high-dimensional and multimodal problems, ensuring stable and accurate convergence through balanced exploration and exploitation. Zebra Optimization Algorithm (ZOA) [11], inspired by zebras’ social and survival behaviors, efficiently navigates complex solution spaces, offering robust performance for dynamic systems. By integrating the unique attributes of these biological populations, these algorithms significantly enhance solution accuracy and stability, opening broader and more efficient avenues for optimization research and applications.
Recent advancements in intelligent optimization algorithms have significantly enhanced the performance of gas pipeline systems by addressing challenges in error correction, fault diagnosis, and network design. For instance, Wei et al. [12] developed a stochastic optimization algorithm integrating PSO with high-fidelity simulation to optimize large-scale natural gas pipeline networks, reducing energy consumption by up to 21.23% and correcting simulation errors in pressure and flow for a network with 43 pipeline sections and four compressor stations. Similarly, Ramos et al. [13] proposed a multi-criteria optimization approach using metaheuristic algorithms, such as simulated annealing and ACO, to design natural gas pipeline network expansions under load-evolution uncertainty, achieving robust performance through Monte-Carlo simulation and dominance analysis, outperforming conventional design methods. Furthermore, Yao et al. [14] introduced a cross-domain generative diagnosis method combining deep learning and genetic algorithms to enhance oil and gas pipeline defect diagnosis under limited field data, improving diagnostic accuracy by 7.21–12.79% through optimized feature distribution and noise constraint strategies. These studies demonstrate the transformative potential of intelligent optimization algorithms in improving the accuracy, efficiency, and reliability of gas pipeline systems.
This paper employs a Gray Wolf Optimizer (GWO)-based method to reduce calculation errors and a Zebra Optimization Algorithm (ZOA)-based approach for optimizing gas supply pressure distribution. Section 2 introduces the conventional solution process for looped pipeline network systems. Section 3 describes the principles of the GWO and ZOAs. Section 4 presents the experimental design, results, and analysis. Section 5 provides a summary and future outlook.

2. Materials and Methods

2.1. Solution Process

In the static model of compressed gas transportation and distribution systems, solving ring-type pipeline networks is typically performed using the node equation method. The node equation method is based on the continuity equations at the nodes. It starts by setting initial flow values for the pipeline segments, calculating the resistance coefficients for each pipeline, and then determining the system’s node pressure drops, flow rates, and other parameters based on the node flow and pipeline network topology. The flow is then adjusted, and after several iterations, the unknown variables are solved. This method is highly flexible, suitable for handling complex networks with multiple gas sources, and well-suited for computer-based solutions [15,16,17]. The process is shown in Figure 1.
The computation commences with an initial assumption of the flow rate, Q , for each pipe segment. This initial value is then utilized to calculate a series of hydraulic parameters, including the gas density ρ , Reynolds number R e , Darcy-Weisbach friction factor λ , and the pipe resistance coefficient R . Subsequently, the algorithm enters a core iterative loop, where a system of network equations describing the flow balance at each node is first established and solved to obtain the nodal pressures, p . Based on these pressures, the pressure drop P across each segment is calculated, which is in turn used to update the segment flow rate Q. Convergence is then assessed by comparing the relative change between the flow rates from the current and previous iterations. If the maximum relative change falls below a predefined tolerance (e.g., 5%), the iteration terminates, and the final results for flow rates ( Q ), pressure drops ( P ), and nodal pressures ( p ) are outputted. Otherwise, the newly computed flow rates are used as the input for the subsequent iteration, and the loop repeats until the convergence criterion is satisfied.

2.2. Connectivity Matrix

The actual pipeline network system can be simplified as a directed linear graph composed of several nodes and pipelines. The full connectivity matrix of the graph is an n × b matrix, where n represents the number of nodes, and b represents the number of pipeline segments. The rows correspond to node indices i , and the columns correspond to branch indices j . The values in the matrix are arranged as −1, 1, or 0:0 indicates that node i is not on branch j , 1 indicates that node i is at the end of branch j , and −1 indicates that node i is at the start of branch j In the n node equations, any equation can be obtained by summing the other n 1 equations. Therefore, only an ( n 1 ) × b matrix is needed to describe the connectivity of a pipeline network. This ( n 1 ) × b matrix is referred to as the connectivity matrix A of the network.

2.3. Matrix Representation of the Basic Equations

The mathematical expression of the current pipeline network calculation formula can generally be summarized as P = S Q n , where P represents the pressure drop across the pipeline segment, S is the pipeline segment’s resistance, and Q is the flow rate through the pipeline segment. Since n 1 , the relationship between pressure drop and flow rate is nonlinear. If we rewrite P = S Q n as P = S Q Q n 1 , and let S Q n 1 be represented as S , we get P = S Q , which transforms the original nonlinear relationship between pressure drop and flow rate into a linear one.
The pipeline segment flow rate and node flow rate satisfy Equation (1), while the pipeline segment pressure drop and node pressure drop satisfy Equation (2). Moreover, based on the formulas P = S Q and G = 1 / S , Equation (3) can be derived.
A Q = q
A T p = P
Q = G P
For the convenience of calculation, the above equation is simplified by letting Y = A G A T , which results in Equation (4). Here, the matrix G is the conductance matrix, Y is the coefficient matrix.
Y p = q

2.4. Multi-Gas Source Node Solution

In this case, the number of the reference gas source node is arranged after the other nodes (with the pressure reference point having the highest number). If there are W known pressure gas sources, aside from the “reference point,” since the node flow rates are all unknown and the pressure drops relative to the “reference point” are known, it is only necessary to solve n W equations when solving the node equation system (where n is the total number of nodes). The coefficient matrix is divided into four blocks: K (where K = n W rows and W rows, K columns and W columns. The column vectors p and q are also divided into two parts. The system of equations is as follows:
Y 11 Y 12 Y 21 Y 22 p 1 p k       p k + 1 p n = q 1 q k       q k + 1 q n
According to the matrix block multiplication rule, matrix Equation (6) can be obtained. It can be seen that by appropriately modifying the node flow rates of the nodes adjacent to nodes k + 1 to n , the node linear equation system can be solved.
Y 11 p 1 p k + Y 12 p k + 1 p n = q 1 q k

2.5. Pipeline Resistance Coefficient Calculation

In a compressed air system, common components include straight pipes, elbows, reducers, tee joints, valves, etc. Since the calculation of the resistance coefficient for tee joints is relatively complex, it is omitted in this process. To calculate the pipeline segment resistance coefficient R , it is necessary to first sequentially determine the gas density ρ , flow velocity u , Reynolds number R e , and friction loss coefficient λ along the pipe. The formulas for density, flow velocity, Reynolds number, and friction loss coefficient are as follows:
ρ = 273.15 · μ · P P a · T
u = 4 · m π · D 2 · ρ
R e = u · D · ρ μ
λ = 1.14 2 · l o g ε D + 9.35 R e / λ 2
The meanings and units of the various symbols are shown in Table 1. Among them, the friction coefficient can be obtained from tables. In practical use, due to installation errors and material aging, the friction coefficient values often need to be appropriately adjusted to meet actual requirements.
The resistance coefficient for straight pipeline segments is calculated using Equation (11). For elbows, Equation (12) is used, where the elbow angle θ is 90° and δ = 14 D . When θ is not 90°, δ is determined by Equation (13). The resistance coefficient for reducers is calculated using Equation (14). When the mainstream direction changes from smaller to larger, K is obtained using Equation (15); when the mainstream direction changes from larger to smaller, K is obtained using Equation (16). S 1 and S 0 represent the cross-sectional areas of the outlet and inlet, α is the half apex angle of the variable diameter. The resistance coefficient for valves is calculated using Equation (17). For gate valves, ξ = 0.2 ; for globe valves, ξ = 3.4 ; the value for ball valves can be found in the table.
R = λ · 8 π 2 · L D 5 · 1 ρ
R = λ · 8 π 2 · δ D 5 · 1 ρ
δ = θ 90 90 · 3 · π · λ 8 + 7 · D + 14 · D
R = λ · 8 π 2 · 1 D 4 · ρ · K R e
K = 20 · ( S 1 / S 0 ) 0.33 tan α 0.75
K = 19 ( S 1 / S 0 ) 0.5 · tan α 0.75
R = λ · 8 π 2 · 1 D 4 · ρ · ξ

3. Overview of Algorithm Theory

3.1. ZOA

The zebra is a social herbivore, and its instinctive reaction when threatened by predators is to flee. However, it sometimes gathers in groups to confuse or intimidate predators. The basic inspiration behind the Zebra Optimization Algorithm comes from the zebra’s foraging behavior and defense strategies against predators. First, the population is randomly initialized, and fitness is calculated. During the iteration process, zebras move towards better positions through foraging behavior, while vigilance behavior helps escape local optima, enhancing global search capability. By continuously updating positions and balancing global exploration with local exploitation, the algorithm eventually converges to the optimal solution.

3.1.1. Population Initialization

From a mathematical perspective, each individual in the population is located at a different position in the problem’s search space, and this position determines the values of its decision variables. The zebra population is mathematically modeled using a matrix. The algorithm’s population matrix is as follows:
X = X 1 , 1 X 1 , m X N , 1 X N , m
In this context, X represents the zebra population, X i denotes the position of the i -th zebra in the solution space, and X i , j indicates the value of the j -th decision variable for the i -th zebra. N is the number of population members, and m is the number of decision variables. The initial positions of the zebras in the search space are initialized using the good point set method, which makes the population distribution more uniform, enhances the algorithm’s robustness, and improves the fitness of the initial population [17,18]. The good point set initialization is shown in Equation (19). In this formula, l b j and u b j represent the upper and lower bounds of the j -th decision variable, respectively, and r is a random number within the interval [0, 1].
x i , j = l b j + r · ( u b j l b j )
Each zebra represents a candidate solution to the optimization problem, and therefore, the objective function can be evaluated based on the value of each decision variable for each zebra. The objective function value is designated as a vector using Equation (20). In this formula, F is the obtained objective function vector, and F i is the objective function value obtained based on the i -th zebra.
F = F 1 F N = F ( X 1 ) F ( X N )

3.1.2. Foraging Phase

In nature, zebra populations tend to move towards individuals that have found more food. In the algorithm, all individuals in the population move towards the position of the best member, and this behavior is described using Equations (21) and (22).
x i , j n e w , P 1 = x i , j + r · ( P Z j I · x i , j )
X i = X i n e w , P 1 , F i n e w , P 1 < F i X i , e l s e
In the formulas, x i n e w , P 1 represents the updated state of the i -th zebra individual in the P 1 phase (foraging phase), x i , j n e w , P 1 represents the value of the j -th decision variable, and F i n e w , P 1 is the objective function value of that individual. P Z denotes the position of the best member. r is a random number within the interval [0, 1], and I = r o u n d ( 1 + r ) . When the individual’s position is about to be updated, the objective function values before and after the update are compared to determine whether the update operation should be executed.

3.1.3. Defense Phase

When large carnivores attack zebras, they move rapidly in random directions; when small carnivores attack, the population moves towards the attacked zebra. Assuming that the probabilities of both defense behaviors occurring are the same, the modeling formulas are as follows:
x i , j n e w , P 2 = x i , j + R · ( 2 r 1 ) · ( 1 t T ) · x i , j , P s < 0.5 x i , j + r · A Z j I · x i , j , else
X i = X i n e w , P 2 , F i n e w , P 2 < F i X i , else
In the formula, x i n e w , P 2 represents the updated state of the i -th zebra individual in the P 2 phase (defense phase), x i , j n e w , P 2 represents the value of the j -th decision variable, and F i n e w , P 2 is the objective function value of that individual. A Z denotes the position of the attacked member, t is the current iteration number, T is the maximum number of iterations, and R is a constant, which is set to 0.01 in the algorithm. P s is a random number within the interval [0, 1] and is used to adjust the probabilities of defense behaviors S 1 and S 2 occurring. Similarly, after executing the defense strategy, it is necessary to determine whether the update operation should be performed.

3.2. GWO

The Gray Wolf Optimizer (GWO) is a swarm intelligence optimization algorithm that simulates the predation behavior of gray wolves in nature. Referring to the wolf pack hierarchy, the GWO divides the population into four categories of individuals: the Alpha position represents the current best solution of the algorithm, the Beta position is the second-best solution, the Delta position is the third-best solution, and the Omega position follows the instructions of other levels. The core process includes first randomly initializing the positions of the gray wolf population, calculating the fitness of each wolf, and selecting the top three wolves. During the iteration process, the positions of the other wolves are updated based on the positions of these three wolves, simulating the behavior of the wolf pack moving towards the prey. As the iterations proceed, the gray wolves gradually approach the optimal solution, and the position of the Alpha wolf is output as the optimal solution. The population initialization process of this algorithm is similar to that of the Zebra Optimization Algorithm and will not be repeated here.

3.2.1. Encircling the Prey

In this step, the gray wolves move around the best solution obtained so far in the search space. This process is achieved through the following equation:
D = C · X p ( t ) X ( t )
X t + 1 = X p t A · D
A = 2 α · r 1 α
C = 2 · r 2
In the equation, t represents the current iteration number, D denotes the distance between the gray wolf’s current position and the prey, X p ( t ) is the position of the prey in the solution space, and X ( t ) is the current position of the gray wolf. Both A and C are coefficient vectors determined by α , r 1 , r 2 . During the iteration process, α decreases linearly from 2 to 0, and both r 1 and r 2 are random vectors within the interval [0, 1]. The gray wolf at position X ( t ) will update its position based on the location of the X p ( x ) .

3.2.2. Hunting

After the gray wolf population encircles the prey, they will identify the prey’s position within the encirclement, and the attack is usually initiated by the Alpha wolf, although Beta and Delta wolves may occasionally participate in the hunt. In the algorithm, the three individuals with the highest fitness values are selected as the Alpha, Beta, and Delta individuals, respectively. Within the circle defined by their positions as the center, other individuals will search for the prey within this range and update the prey’s position. This process is achieved through the following equation:
D α = C 1 · X α X D β = C 2 · X β X D δ = C 3 · X δ X
X 1 = X α A 1 · D α X 2 = X β A 2 · D β X 3 = X δ A 3 · D δ
X t + 1 = X 1 + X 2 + X 3 / 3
In the equation, X α , X β , X δ represent the positions of the Alpha, Beta, and Delta individuals, respectively. A and C are coefficient vectors, X t + 1 represents the updated position of the individual.

3.2.3. Attack and Search for Prey

When the prey stops moving, the gray wolf population will launch an attack. In the algorithm, the process of the gray wolves approaching the prey is simulated by decreasing the value of α . According to Equation (27), the process of α decreasing linearly from 2 to 0 is divided into two parts. When α makes A < 1 , the distance between X p x and X t + 1 will gradually decrease, which indicates the attack process. Conversely, the distance will increase, which represents the search process.

4. Experiment and Analysis

4.1. Introduction to the Experimental Model

This study utilizes a network model illustrated in Figure 2, which is established based on an actual compressed air transmission and distribution system from an industrial park in Northern China. The model consists of 3 supply nodes, 14 user end nodes, and 43 composite pipelines. Detailed parameters for the system are provided in Appendix A.
The gas transported within the pipelines is assumed to be compressed air at 20 °C with a dynamic viscosity of 17.9 × 10 6   P a · s . Given a set of pressure values for the supply nodes (AS1, AS2, AS3), the iteration process is carried out based on the method described in Section 2. After each iteration, the pipeline flow rates are compared with the results from the previous iteration. The iteration is stopped when the largest change in the flow rate of any pipeline is less than 0.5%. To prevent numerical divergence toward zero during the iteration, a maximum iteration limit of 30 rounds is set. After the iteration is completed, the calculation results are checked. If the pressure at any user-end node or the flow rate in any pipeline exceeds the design limits, the pressure combination of the supply nodes for that case is considered an invalid solution.
All development and performance evaluations were conducted on a workstation with the following specifications. The software stack comprised Microsoft Windows 11 Pro (64-bit), the .NET 8.0 framework, and Microsoft Visual Studio Community 2022 (Version 17.14.9) as the IDE. The hardware platform was equipped with an Intel Core i5-13600KF processor and 32 GB of RAM (Intel, Santa Clara, CA, USA).

4.2. Evaluation Metrics and Parameter Settings

In the pipeline network system error correction experiment, the Error between the calculated pipeline flow values and the true values is used as the evaluation metric for the algorithm. The calculation formula is as follows:
E r r o r = 1 N · i = 0 n Q i Q i Q i
In Equation (32), N represents the number of pipelines, and Q i and Q i represent the true flow and the calculated flow of the i -th pipeline, respectively. In the gas supply end pressure distribution experiment, three indicators—gas supply end pressure, system power, and energy efficiency—are considered comprehensively. The formula is as follows:
P = i = 0 S a i · P r e s i + b i · F l o w i + c i
E = i = 0 U P r e s i · F l o w i · l n ( P r e s i / P a ) i = 0 S P r e s i · F l o w i · l n ( P r e s i / P a )
I = 0.7 · P 10,000 + 0.15 10,000 · i = 0 S P r e s i P r e s l o w 0.15 · E
In Equations (32)–(35), P represents the system power, S is the number of gas supply end nodes, and P r e s i and F l o w i represent the pressure and flow at the i -th node, respectively. a i , b i and c i are constants related to the performance of the compressor equipment at the gas supply end, and they are known in this experiment. E represents the system energy efficiency, and U is the number of user end nodes. P a denotes atmospheric pressure. I is a comprehensive evaluation metric, where P r e s l o w represents the minimum achievable pressure at the gas supply end. This metric aims to minimize both the system power and the gas supply end pressure, while maximizing the system’s energy efficiency.
To validate the superiority of the algorithm used in this experiment, several classic optimization algorithms were selected for the comparison experiment. The main parameter settings for each algorithm are shown in Table 2. In this study, to eliminate the confounding effects of initial randomness on algorithm performance evaluation and to ensure a fair comparison among different optimization algorithms, we rigorously controlled for stochasticity in our experimental process. Specifically, before the commencement of each independent run, a global random seed was set to generate the initial solution set for the algorithm. This procedure ensures that all evaluated optimizers start from the identical set of initial solutions, and consequently, the final performance differences can be directly attributed to the intrinsic characteristics of the algorithms themselves.

4.3. Error Correction Based on GWO

In the operation of gas supply pipeline networks, there is often a deviation between on-site measured parameters and model calculation results. The causes of this deviation are complex, and it is difficult to fully identify and precisely correct the related parameters manually, which may affect operational efficiency and safety. Therefore, there is an urgent need to introduce intelligent optimization algorithms to dynamically adjust and optimize system parameters. Since the pipeline length and diameter are fixed values, the friction coefficient ε of each pipeline is chosen as the random variable to be adjusted, with a value range of [0.1, 0.5]. Since the node pressure values are relatively high and the calculation results show small deviations, the absolute sum of the differences between the real flow values and the measured values of seven random pipelines in the system (as shown in Figure 2), namely P1, P2, P3, P41, P43, P45, and P53, is used as the fitness value. This value is then substituted into the fitness function to drive the model to approach actual operating conditions. The specific process is shown in Figure 3.
The experimental results (see Table 3 and the fitness curve in Figure 4a) show that most swarm intelligence algorithms can effectively reduce model errors, but there are significant performance differences. It is noteworthy that although Particle Swarm Optimization (PSO) and Genetic Algorithm (GA) exhibited fast convergence in the early stages, with a rapid decrease in fitness values, they soon entered a stagnation phase, and their final accuracies (0.56% and 0.35%, respectively) were not optimal. This strongly suggests that they may have fallen into local optima, which is attributed to the complex coupling relationships that may exist between multiple friction coefficient variables in the error correction problem and the resulting rugged fitness landscape.
Specifically, PSO simulates the social behavior of particles, each exploring the solution space to find the optimal solution. While PSO converges rapidly towards the global optimum, it is prone to premature convergence, especially in complex, multi-modal optimization problems such as error correction in supply networks. The balance between exploration and exploitation is primarily determined by the position of the best particle, which may restrict the exploration of alternative solution regions, thereby increasing the risk of stagnation. Additionally, PSO lacks a diversity-preserving mechanism, which often leads to a loss of search diversity in the later stages of optimization.
Similarly, GA employs genetic operators (selection, crossover, and mutation) to evolve the population towards an optimal solution. Although GA is theoretically capable of exploring a large search space, its convergence can be slow and susceptible to local optima, particularly in high-dimensional problems. The randomness introduced by mutation and crossover is beneficial for global search in the early stages; however, as the population converges, the algorithm may struggle to generate meaningful new candidates, leading to stagnation.
In contrast, the Gray Wolf Optimizer performed excellently in this task, achieving the lowest average relative error (0.15%) among all algorithms, while its computational efficiency (6.16 s) is comparable to faster algorithms such as PSO (5.89 s) and ACO (4.15 s), demonstrating a good balance between accuracy and efficiency. The superiority of GWO can be attributed to its unique biomimetic mechanism: first, it simulates the social hierarchy of wolf packs, where the Alpha, Beta, and Delta leaders collectively guide the population search. This provides richer and more diverse exploration directions compared to single global optimal guidance (such as PSO) or probabilistic selection (such as GA), which helps in conducting a comprehensive search in a multidimensional solution space; second, it uses a control parameter α that linearly decreases from 2 to 0, achieving an adaptive and smooth transition from global exploration to local exploitation, ensuring a broad search in the early stages.
Therefore, GWO has significant advantages in handling error correction problems with potential local optimum traps, due to its intrinsic mechanism. Even if the Alpha wolf temporarily falls into a local optimum, the presence of the Beta and Delta wolves provides alternative directions, guiding the population to continue exploring. This effectively explains why the GWO curve in Figure 4a steadily declines in the middle and later stages and ultimately outperforms other algorithms. In conclusion, GWO, with its hierarchical guiding strategy and dynamic balance between exploration and exploitation, efficiently addresses the challenges of multi-variable, highly coupled, and local optimum-prone parameter correction in supply network models.

4.4. Pressure Distribution Based on ZOA

In this experiment, the fitness value and algorithm evaluation metric are both denoted as I , with the pressure values of the three gas supply end nodes in Figure 2 used as the adjustable random variables. The experimental process is shown in Figure 5. In engineering practice, different combinations of gas supply end pressures correspond to different flow combinations. The calculated flow must be less than the maximum output limit of the gas supply nodes, while the pressure at the user end usually has a lower limit (set to 700 kPa in this experiment). Therefore, when applying the optimization algorithm, it is necessary to check whether the output results meet the above constraints. If the results do not meet the constraints, recalculation is required until a feasible solution is obtained. Compared to the error correction problem, this problem places higher demands on the global search ability and computational efficiency of the algorithm.
The experimental results of gas supply end pressure distribution are shown in Figure 4b and Table 4. In this problem, the performance differentiation of the algorithms is more pronounced. The Zebra Optimization Algorithm (ZOA) stands out, with its fitness curve (Figure 5) not only starting with a lower initial value but also declining the most rapidly, ultimately achieving the best evaluation value (10,105.47) among all the algorithms. This indicates that ZOA possesses strong global search capability and efficient convergence characteristics for this problem.
ZOA’s success likely stems from its unique integration of foraging and defense strategies. The foraging phase (moving toward the optimal solution) ensures rapid convergence to high-quality areas, explaining the steep fitness curve decline in Figure 5. Crucially, its defense strategy—particularly the random rapid movement simulating predator evasion—provides powerful local optimum escape capability. The pressure distribution problem optimizes a comprehensive Indicator (including system power consumption, energy efficiency, and pressure levels) under constraints like minimum user pressure and station flow limits, creating a complex, constrained optimization space. ZOA’s defense mechanism helps populations escape constraint boundaries or local optima for renewed exploration. Its good point set initialization may also offer a more favorable starting point.
In contrast, while GA (4.20 s), PSO (6.24 s), and GWO (6.25 s) ran faster, their higher final evaluation values indicate insufficient robustness. This suggests their search mechanisms are less effective than ZOA’s at handling the problem’s complex constraints or multi-objective optimization (energy consumption, efficiency, pressure). They more readily converge to constraint-satisfying but suboptimal solutions, lacking ZOA’s explicit deadlock-breaking defense strategy. Although Coyote Optimization Algorithm (COA) showed strong global search capability, its results still trailed ZOA. Thus, for gas supply pressure distribution with complex constraints and multiple objectives, ZOA demonstrates superior applicability.

5. Conclusions and Outlook

This paper addresses the error correction and gas supply-end pressure distribution problems in gas supply pipeline systems, applying the Gray Wolf Optimization Algorithm and Zebra Optimization Algorithm to solve these problems, and comparing them with other optimization algorithms. The research results show that, in the error correction problem, GWO demonstrates excellent performance with an average relative error of only 0.15%, achieving the highest accuracy among all the compared algorithms, and significantly high computational efficiency (only 6.16 s for 100 iterations). In the gas supply-end pressure distribution problem, ZOA exhibits the fastest convergence speed and the highest fitness value, ultimately achieving the optimal evaluation value of 10,105.47, significantly outperforming other algorithms.
There are still many areas worth exploring for optimizing gas supply pipeline systems: in algorithm integration and improvement, multiple optimization algorithms can be combined to further enhance the global search ability and computational efficiency; in dynamic optimization and real-time regulation, dynamic optimization algorithms combined with real-time data monitoring can be explored to realize real-time regulation and operation of pipeline systems. In the future, further efforts are needed to address the engineering challenges of these algorithms, improve their stability, scalability, and user-friendliness, and provide strong support for the efficient operation and sustainable development of pipeline systems.
Looking forward, further research can focus on integrating these algorithms into hybrid approaches, combining the strengths of multiple optimization techniques to enhance global search capabilities and computational efficiency. Additionally, real-time optimization and dynamic regulation could be achieved by integrating these algorithms with SCADA (Supervisory Control and Data Acquisition) systems, enabling live monitoring and adjustment of pipeline parameters. This integration could lead to significant improvements in operational efficiency, safety, and sustainability, providing valuable support for the future of smart energy systems.

Author Contributions

The authors confirm contribution to the paper as follows: Conceptualization, methodology, and validation, L.D.; investigation and data curation, C.X.; writing—original draft preparation, Y.L.; supervision, project administration, and funding acquisition, L.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work was in part supported by the key Project of Hubei Province (No. 2023BAB094), and the Open Foundation of Hubei Key Laboratory for High-efficiency Utilization of Solar Energy and Operation Control of Energy Storage System (No. HBSEES202309 & HBSEES202416).

Data Availability Statement

The data that support the findings of this study are available from the Corresponding Author.

Acknowledgments

The authors appreciate the support of the key Project of Hubei Province and Open Foundation of Hubei Key Laboratory for High-efficiency Utilization of Solar Energy and Operation Control of Energy Storage System. Additionally, we would like to thank Wang Shanshan for her valuable contributions to the review and revision of this manuscript.

Conflicts of Interest

Author Li Dai was employed by the company WISDRI Engineering& Research Incorporation Limited. Author Chao Xu was employed by the company CCCC Second Harbor Engineering Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Appendix A

The system in Figure 2 consists of 3 supply nodes, 14 user end nodes, 43 composite pipelines, 1 valve node, 5 reducer nodes, and 19 tee joint nodes. Since the resistance coefficients of the tee joint nodes are neglected, only the detailed parameters for the other components are presented.
Table A1. Detailed parameters of the user end nodes.
Table A1. Detailed parameters of the user end nodes.
LabelQ (m3/min)Minimal Pressure (kPa)
US198700
US2184700
US3130700
US442700
US5136700
US6193700
US7110700
US86700
US91700
US1095700
US11196700
US12118700
US1320700
US1463700
Table A2. Detailed parameters of the reducer nodes.
Table A2. Detailed parameters of the reducer nodes.
LabelInlet Diameter (mm)Outlet Diameter (mm) Half   Apex   Angle   α (°)
RD135920745
RD230935945
RD346035945
RD425915045
RD535925945
Table A3. Detailed parameters of the valve node.
Table A3. Detailed parameters of the valve node.
LabelTypeDiameter (mm)Opening Degree (%)
RD5gate valve359100
Table A4. Detailed parameters of the composite pipelines.
Table A4. Detailed parameters of the composite pipelines.
LabelStraight Pipeline SegmentsElbow Segments
Length (m)Diameter (mm)QuantityAngle (°)
P125309\\
P26004084090
600408\\
P31004603090
485460\\
P433460\\
P56164602090
P628259\\
P710259\\
P8100359\\
P9112259\\
P104001502045
P1176359\\
P12130259\\
P1340359\\
P14144359\\
P15110359\\
P162359\\
P1734207\\
P1871359
P19169150\\
P20645150\\
P2114750\\
P22350359\\
P23165207\\
P24150359\\
P25150309\\
P262001251030
P27120309\\
P28123309190
10309\\
P2959408\\
P3011309\\
P31200408\\
P3210460\\
P331980460\\
P3415460\\
P3550460\\
P3620359\\
P37300309\\
P3816843595090
3663591045
P39120408\\
P4010408\\
P4125460\\
P4273460\\
P4350460\\

References

  1. General Office of the State Council. Notice of the General Office of the State Council on Issuing the Implementation Plan for the Renovation and Renewal of Aging Urban Gas Pipelines (2022–2025) [EB/OL]; General Office of the State Council: Beijing, China, 2022.
  2. State Council. Notice of the State Council on Issuing the “2024–2025 Action Plan for Energy Conservation and Carbon Reduction” [EB/OL]; State Council: Beijing, China, 2024.
  3. Tingting, L. Optimizing the Design of Urban Gas Distribution Networks. Master’s Dissertation, Chongqing University, Chongqing, China, 2004. [Google Scholar]
  4. Colorni, A.; Dorigo, M.; Maniezzo, V. Distributed optimization by ant colonies. In Proceedings of the 1st European Conference on Artificial Life, Paris, France, 11–13 December 1991; Elsevier: Amsterdam, The Netherlands, 1991; pp. 134–142. [Google Scholar]
  5. Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the IEEE International Conference on Neural Networks, Perth, Australia, 27 November–1 December 1995; IEEE: Piscataway, NJ, USA, 1995; pp. 1942–1948. [Google Scholar]
  6. Holland, J.H. Adaptation in Natural and Artificial Systems; University of Michigan Press: Ann Arbor, MI, USA, 1975. [Google Scholar]
  7. Kirkpatrick, S.; Gelatt, C.D.; Vecchi, M.P. Optimization by simulated annealing. Science 1983, 220, 671–680. [Google Scholar] [CrossRef] [PubMed]
  8. Dehghani, M.; Montazeri, Z.; Trojovská, E.; Trojovský, P. Coati Optimization Algorithm: A new bio-inspired metaheuristic algorithm for solving optimization problems. Knowl.-Based Syst. 2023, 259, 110011. [Google Scholar] [CrossRef]
  9. Rao, R.V.; Savsani, V.J.; Vakharia, V.J. Teaching–learning-based optimization: A novel method for constrained mechanical design optimization problems. Comput.-Aided Des. 2011, 43, 303–315. [Google Scholar] [CrossRef]
  10. Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey Wolf Optimizer. Adv. Eng. Softw. 2014, 69, 46–61. [Google Scholar] [CrossRef]
  11. Trojovska, E.; Dehghani, M.; Trojovsky, P. Zebra Optimization Algorithm: A New Bio-Inspired Optimization Algorithm for Solving Optimization Algorithm. IEEE Access 2022, 10, 49445–49473. [Google Scholar] [CrossRef]
  12. Wei, X.; Qiu, R.; Zhang, B.; Liu, C.; Wang, G.; Wang, B.; Liang, Y. Operation optimization of large-scale natural gas pipeline networks based on intelligent algorithm. Energy 2024, 310, 133258. [Google Scholar] [CrossRef]
  13. Ramos, E.S.; Batista, L.S. Natural gas pipeline network expansion under load-evolution uncertainty based on multi-criteria analysis. Appl. Soft Comput. 2020, 96, 106697. [Google Scholar] [CrossRef]
  14. Yao, J.; Liang, W.; Xiao, Z. Research on cross-domain generative diagnosis for oil and gas pipeline defect based on limited field data. Energy 2025, 319, 13086. [Google Scholar] [CrossRef]
  15. Zhu, H. Design and Implementation of Hydraulic Calculation System of Ring-Shaped Heating Network; Dalian University of Technology: Dalian, China, 2016. [Google Scholar]
  16. Zhang, Y. Analyzing and Operation Optimization for Industrial Steam Heating Networks; Harbin Institute of Technology: Harbin, China, 2015.
  17. Hou, Y. Optimal Design of Water Supply Network Using Hybrid EDA-DE Algorithm; Kunming University: Kunming, China, 2022. [Google Scholar]
  18. Zhang, L.; Wang, Q. Optimization of urban water supply network based on improved algorithm. Water Supply Drain. 2022, 48, 1011–1018. [Google Scholar]
Figure 1. Flowchart of the Node Equation Method.
Figure 1. Flowchart of the Node Equation Method.
Applsci 15 10838 g001
Figure 2. Test model.
Figure 2. Test model.
Applsci 15 10838 g002
Figure 3. Flowchart of error correction.
Figure 3. Flowchart of error correction.
Applsci 15 10838 g003
Figure 4. Fitness Curves of Different Algorithms: (a) Error Correction; (b) Pressure Distribution.
Figure 4. Fitness Curves of Different Algorithms: (a) Error Correction; (b) Pressure Distribution.
Applsci 15 10838 g004
Figure 5. Flowchart of Pressure Distribution.
Figure 5. Flowchart of Pressure Distribution.
Applsci 15 10838 g005
Table 1. Symbols, Units, and Meanings.
Table 1. Symbols, Units, and Meanings.
SymbolsMeaningsUnitsSymbolsMeaningsUnits
p Pressure DropPa ρ Fluid DensityKg/m3
λ Friction Loss Coefficient\ u Flow Velocitym/s
L Pipeline Lengthm m Mass Flow RateKg/s
D Internal Diameterm ε Friction Coefficientmm
μ Kinematic Viscosity P a · s P a Standard Atmospheric PressurePa
P PressurePa T TemperatureK
Table 2. Main Parameter Settings.
Table 2. Main Parameter Settings.
AlgorithmParameterAlgorithmParameter
GAPopulation Size: 50;
Crossover Probability: 0.8
SAInitial Temperature: 100;
Cooling Rate: 0.99;
Termination Temperature: 1
ACOPopulation Size: 20;
Information Factor: 1.0;
Heuristic Factor: 2.0;
Volatility Coefficient: 0.5
Initial Pheromone Value: 100
PSOPopulation Size: 30;
Inertia Weight: 0.5;
Contraction Factor: 2;
Global Factor: 2
COAPopulation Size: 30TLBONumber of Students: 4
GWOPopulation Size: 30ZOAPopulation Size: 40
Table 3. Average Relative Error and Computation Time of Each Algorithm Based on the Average Results of Ten Repeated Experiments.
Table 3. Average Relative Error and Computation Time of Each Algorithm Based on the Average Results of Ten Repeated Experiments.
AlgorithmAverage Relative ErrorTime (s)AlgorithmAverage Relative ErrorTime (s)
GA0.35%9.44SA7.48%20.86
ACO1.31%4.15PSO0.56%5.89
COA0.68%88.14TLBO5.96%62.68
GWO0.15%6.16
Table 4. Average Evaluation Metrics and Computation Time of Each Algorithm Based on the Average Results of Ten Repeated Experiments.
Table 4. Average Evaluation Metrics and Computation Time of Each Algorithm Based on the Average Results of Ten Repeated Experiments.
Algorithm I Time (s)Algorithm I Time (s)
GA11,685.474.20SA10,498.2943.82
GWO10,492.356.25PSO11,401.836.24
COA10,164.2819.40TLBO12,408.6928.90
ZOA10,105.4715.82
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Dai, L.; Xu, C.; Liu, Y.; Zeng, L. Optimization Study of Gas Supply Pipeline Systems Based on Swarm Intelligence Optimization Algorithms. Appl. Sci. 2025, 15, 10838. https://doi.org/10.3390/app151910838

AMA Style

Dai L, Xu C, Liu Y, Zeng L. Optimization Study of Gas Supply Pipeline Systems Based on Swarm Intelligence Optimization Algorithms. Applied Sciences. 2025; 15(19):10838. https://doi.org/10.3390/app151910838

Chicago/Turabian Style

Dai, Li, Chao Xu, Yiqun Liu, and Liang Zeng. 2025. "Optimization Study of Gas Supply Pipeline Systems Based on Swarm Intelligence Optimization Algorithms" Applied Sciences 15, no. 19: 10838. https://doi.org/10.3390/app151910838

APA Style

Dai, L., Xu, C., Liu, Y., & Zeng, L. (2025). Optimization Study of Gas Supply Pipeline Systems Based on Swarm Intelligence Optimization Algorithms. Applied Sciences, 15(19), 10838. https://doi.org/10.3390/app151910838

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop