Pipeline layout solving method fusing A* algorithm and particle swarm optimization algorithm

By integrating the A* algorithm and the particle swarm optimization algorithm, the obstacle handling, initialization and premature convergence problems of the particle swarm optimization algorithm in the pipeline layout problem are solved, and more efficient pipeline layout optimization is achieved, improving the quality and feasibility of understanding.

CN120337458AActive Publication Date: 2025-07-18CHINA UNIV OF PETROLEUM (EAST CHINA)

Patent Information

Application Number
CN202510354343.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-18
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

The existing particle swarm optimization algorithm has limitations such as difficulty in dealing with obstacle constraints, random initialization leading to poor initial solution quality, premature maturity convergence and lack of specific problem guidance capabilities in pipeline layout problems.

Method used

Fusion of A* algorithm and particle swarm optimization algorithm, using the A* algorithm to generate an initial path for particle swarm initialization, and introduce a dynamic guidance mechanism and linear adjustment strategy. Combining heuristic search and global search capabilities, we optimize the population initialization and search process of particle swarm optimization algorithm.

Benefits of technology

It significantly improves the quality of the efficiency and solution of the algorithm, can better adapt to the high-dimensional, dynamic, and multi-constraint engineering optimization needs, shorten the convergence time, and improve the accuracy and feasibility of the solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337458A_ABST
    Figure CN120337458A_ABST
Patent Text Reader

Abstract

The invention provides a pipeline layout solving method fusing an A * algorithm and a particle swarm optimization algorithm, and relates to the technical field of pipeline layout. Comprising the following steps: S1, establishing a pipeline layout space model; s2, solving a pipeline layout scheme; in the step S2, the heuristic search characteristic of the A * algorithm is combined with the global search capability of the particle swarm optimization algorithm, and a dynamic guide mechanism based on an A * algorithm path and an adjustment strategy based on linear change are introduced. On the basis, the population initialization and particle search process of the particle swarm optimization algorithm can be optimized by utilizing the path guidance information provided by the A * algorithm, and the problem that in the prior art, when the particle swarm optimization algorithm is used for solving the pipeline layout problem, many limitations exist is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipeline layout, and specifically to a pipeline layout solution method that combines the A* algorithm and the particle swarm optimization algorithm. Background Art

[0002] The pipeline layout problem is a typical complex optimization problem in the fields of engineering design and manufacturing, and widely exists in scenarios such as petrochemical industry, nuclear engineering, aerospace, and shipbuilding; its core goal is to reasonably design the pipeline layout connecting various functional nodes or devices on the premise of meeting multiple constraint conditions, so as to optimize the pipeline length, reduce material consumption, lower engineering costs, and improve the reliability and safety of the system. Specifically, the pipeline layout problem usually includes complex constraints such as obstacle avoidance constraints, pipeline crossing constraints, and space utilization limitations, and is a high-dimensional non-linear combinatorial optimization problem with high computational complexity. For the pipeline layout problem, the traditional manual design method can no longer meet the needs of modern industry in terms of efficiency and effect, because this method usually relies on the experience of engineering personnel, has the disadvantages of high labor intensity, long design cycle, and difficult modification, especially when facing multi-objective and multi-constraint conditions, its limitations are particularly prominent.

[0003] In recent years, intelligent optimization algorithms have shown excellent adaptability and efficiency in solving complex optimization problems. As a typical representative of them, the particle swarm optimization algorithm (PSO) has been widely applied to various engineering optimization problems due to its strong global search ability, easy implementation, and high computational efficiency. Therefore, in the prior art, attempts have been made to use the particle swarm optimization algorithm to solve the pipeline layout problem to overcome the limitations of the traditional manual design method; for example, the patent with the publication number CN115391920A provides an optimized layout method for the wall-attached pipeline in the aircraft cabin, which includes using the particle swarm optimization algorithm to generate the optimal path that meets the shortest path and adheres to the inner wall of the cabin. However, in fact, the particle swarm optimization algorithm still faces many challenges when dealing with complex constraint optimization problems such as pipeline layout. Specifically: First, the particle swarm optimization algorithm lacks a mechanism to directly handle geometric constraints such as obstacles, which makes it difficult to adapt to complex constraint scenarios such as obstacle avoidance and path crossing commonly found in pipeline layout; Second, in a high-dimensional dynamic optimization environment, the random initialization method of the particle swarm optimization algorithm may lead to poor quality of the initial solution, thereby affecting the convergence efficiency and superiority of the solution; Third, the population search mechanism of the particle swarm optimization algorithm is prone to premature convergence in a complex solution space, thereby causing the search to fall into a local optimal solution; Fourth, the standard particle swarm optimization algorithm mainly relies on random search and global update, lacking the guiding ability for specific problems, so it performs poorly in the layout optimization of complex environments.

[0004] In summary, the present invention proposes a method for solving pipeline layout by integrating the A* algorithm and the particle swarm optimization algorithm. Summary of the Invention

[0005] The object of the present invention is to provide a method for solving pipeline layout by integrating the A* algorithm and the particle swarm optimization algorithm, so as to solve the problem mentioned in the above background technology that there are many limitations when using the particle swarm optimization algorithm to solve the pipeline layout problem in the prior art.

[0006] The present invention is implemented by the following technical solutions:

[0007] A method for solving pipeline layout by integrating the A* algorithm and the particle swarm optimization algorithm includes the following steps:

[0008] Step S1: Establish a pipeline layout space model;

[0009] Step S2: Solve the pipeline layout scheme;

[0010] Among them, step S2 specifically includes the following sub-steps:

[0011] Step S2-1: Set the basic parameters of the particle swarm optimization algorithm, and set the starting point and ending point of the pipeline to be laid out;

[0012] Step S2-2: Use the A* algorithm to generate an initial path from the starting point to the ending point, and this initial path is used as the initial solution of the particle swarm optimization algorithm for subsequent iterative loops;

[0013] Step S2-3: Initialize the particle swarm according to the initial path generated by the A* algorithm;

[0014] Step S2-4: Calculate the fitness of each particle in the particle swarm, compare the fitness values of different particles, and initially obtain the global optimal solution;

[0015] Step S2-5: Update the positions and velocities of the particles through iterative loops;

[0016] Step S2-6: Check whether the current iteration number reaches the preset maximum iteration number or whether the global optimal solution meets the requirements. If the check result is yes, end the solution; otherwise, continue the iterative loop.

[0017] In the pipeline layout solving method provided by the present invention, by combining the heuristic search characteristics of the A* algorithm with the global search ability of the particle swarm optimization algorithm, the efficiency and solution quality of the algorithm can be significantly improved. Among them, the A* algorithm (A-star Algorithm) combines heuristic search and cost function estimation, and can quickly calculate the shortest path that meets the obstacle avoidance requirements, having significant advantages in path planning and obstacle avoidance; by fusing the A* algorithm with the particle swarm optimization algorithm, the initialization and search performance of the particle swarm algorithm can be effectively enhanced.

[0018] Furthermore, in step S2-2: The initial path generated by the A* algorithm is a discrete set of nodes. Therefore, after generating the initial path, an interpolation method is used to smooth the initial path, converting the discrete path points into a continuous particle distribution range. In this solution, for the obstacle avoidance and path optimization requirements in pipeline layout, the A* algorithm is used to generate a reference path, which can improve the quality of the initial solution and the search directionality, and also provides a better solution space distribution for subsequent iterations, significantly shortening the early convergence time of the algorithm.

[0019] Furthermore, step S2-5 includes the following sub-steps:

[0020] Step S2-5-1: Through continuous iterative loops, compare the current fitness value of each particle with its historical best fitness value, and update the individual best position of each particle;

[0021] Step S2-5-2: Compare the individual best fitness values of all particles to find the particle position corresponding to the global best fitness value;

[0022] Step S2-5-3: According to the update formula of the particle swarm optimization algorithm, iteratively update the velocity and position of each particle.

[0023] Furthermore, in step S2-5-3, the update formula of the particle swarm optimization algorithm is as follows:

[0024] v i (t + 1) = w·v i (t) + c1·r1·(p best -x i (t)) + c2·r2·(g best -x i (t));

[0025] x i (t + 1) = x i (t) + v i (t + 1);

[0026] In the formula, v i (t) is the velocity of particle i in the t-th generation; xi (t) is the current position of particle i; p best and g best are respectively the individual optimal solution and the global optimal solution of the current particle; w is the inertia weight, which is used to balance global and local search; c1 and c2 are learning factors, which control the movement of the particle towards the individual optimal solution and the global optimal solution; r1 and r2 are random numbers.

[0027] Furthermore, in the step S2-5-3, a dynamic guidance mechanism based on the A* algorithm path is introduced. This dynamic guidance mechanism is manifested as adding path information as a guidance factor to the update formula of the particle swarm optimization algorithm in each generation. The formula is as follows:

[0028] V(i,:) = w·V(i,:) + c1·r1·(p best - X(i,:)) + c2·r2·(g best - X(i,:)) + λ·(initial_path_interp - X(i,:));

[0029] In the formula, V(i,:) represents the velocity of the i-th particle in the current iteration, X(i,:) is the position of the i-th particle in the current iteration, w is the inertia weight, p best and g best are respectively the individual optimal solution and the global optimal solution of the current particle, c1 and c2 are learning factors, r1 and r2 are random numbers, "initial_path_interp" is the initial path result; λ is the guidance factor, whose initial value is relatively large, emphasizing that the initial path guides the direction of the particle; it will gradually weaken with the number of iterations in the later stage to guide the particle to get rid of the path constraint. In this solution, the guidance strength is dynamically adjusted in combination with the specific constraints in the pipeline layout, so that the particle can quickly approach the reference path in the early stage and enhance the global search ability in the later stage; based on this dynamic guidance mechanism, compared with the traditional particle swarm optimization algorithm, the particle swarm optimization algorithm in this solution not only inherits the ability of the A* algorithm to quickly locate potential optimal solutions in the solution space, but also retains the global search characteristics of the particle swarm optimization, thus further improving the search efficiency and solution feasibility of the particle, especially showing significant advantages in scenarios with complex constraints.

[0030] Furthermore, in the step S2-5-3, an adjustment strategy based on linear change is introduced. This adjustment strategy is manifested as dynamically adjusting the learning factors c1 and c2. The formula is as follows:

[0031]

[0032] In the formula, and They are respectively the initial values of learning factors c1 and c2. iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm.

[0033] In this solution, for the pipeline layout problem, by dynamically adjusting the learning factors c1 and c2 of the particles, different requirements for global search and local convergence capabilities in different stages can be met. This adjustment strategy ensures the balance between the global search and local precise optimization of the pipeline layout, enabling the particle swarm optimization algorithm to obtain better convergence effects and better solutions when solving high-dimensional and complex optimization problems, thereby improving the accuracy and feasibility of the final layout solution.

[0034] Furthermore, the dynamic adjustment formula of λ is as follows:

[0035]

[0036] In the formula, λ max is the maximum value of the path guiding factor. iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm.

[0037] Furthermore, in step S1: A grid method is used to establish a pipeline layout space model, that is, the pipeline layout space is divided into free grids and obstacle grids according to the presence of obstacles, and the obstacle grids are marked black and the free grids are marked white.

[0038] The beneficial effects achieved by the present invention are:

[0039] Compared with the prior art that has many limitations when using the particle swarm optimization algorithm to solve the pipeline layout problem, the present invention provides a pipeline layout solving method that combines the A* algorithm and the particle swarm optimization algorithm. By combining the heuristic search characteristics of the A* algorithm with the global search ability of the particle swarm optimization algorithm, the population initialization and particle search process of the particle swarm optimization algorithm can be optimized by using the path guidance information provided by the A* algorithm, and thus the efficiency and quality of the algorithm can be significantly improved, so as to better meet the engineering optimization requirements of high-dimensional, dynamic, and multi-constrained. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a schematic flow chart of the solving method described in Embodiment 1 of the present invention;

[0041] Figure 2 is a schematic diagram of the pipeline layout space model in the solving method described in Embodiment 1 of the present invention;

[0042] Figure 3 is a schematic diagram of the comparison result between the pipeline layout obtained by the solving method described in Embodiment 1 of the present invention and the pipeline layout obtained by the existing particle swarm optimization algorithm Figure Ⅰ ;

[0043] Figure 4 Schematic diagram of the comparison result between the pipeline layout obtained by the solution method described in Embodiment 1 of the present invention and the pipeline layout obtained by the existing particle swarm optimization algorithm Figure Ⅱ ;

[0044] Figure 5 Schematic diagram of the comparison result between the pipeline layout obtained by the solution method described in Embodiment 1 of the present invention and the pipeline layout obtained by the existing particle swarm optimization algorithm Figure Ⅲ ;

[0045] Figure 6 Schematic diagram of the comparison result between the pipeline layout obtained by the solution method described in Embodiment 1 of the present invention and the pipeline layout obtained by the existing particle swarm optimization algorithm Figure Ⅳ ;

[0046] Figure 7 Schematic diagram of the two-dimensional equipment layout of the natural gas treatment module described in Embodiment 2 of the present invention;

[0047] Figure 8 Schematic diagram of the comparison result between the pipeline layout obtained by the solution method described in Embodiment 2 of the present invention and the pipeline layout obtained by the existing particle swarm optimization algorithm. Detailed implementation manners

[0048] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.

[0049] Embodiment 1

[0050] This embodiment provides a pipeline layout solution method that combines the A* algorithm and the particle swarm optimization algorithm. Please refer to Figure 1 , and includes the following steps:

[0051] Step S1: Establish a pipeline layout space model. Specifically:

[0052] The establishment of a two-dimensional pipeline layout space model affects the efficiency and quality of the final layout design. Commonly used modeling methods include the grid method, the free space method, and the octree method, etc. In this embodiment, the grid method is used to establish the pipeline layout space model, which can not only meet the engineering requirements but also effectively describe the actual space environment; when using the grid method for modeling, the pipeline layout space is divided into free grids and obstacle grids according to the presence or absence of obstacles, and the obstacle grids are marked black and the free grids are marked white. In addition, to ensure the rationality of the layout, the irregular obstacles are inflated, and if the obstacle does not fill one grid, it is filled to one grid.

[0053] The most common ways to represent grids are coordinates and serial numbers. To facilitate the identification of the network, the following conversion formula is obtained by combining the two:

[0054]

[0055] In the formula, (x i , y i ) represents the coordinate position of the i-th grid, i represents the grid serial number, R x is the number of rows of the grid map, R y is the number of columns of the grid map, mod() is the remainder function, and ceil() is the floor function.

[0056] Step S2: Solve the pipeline layout scheme. Specifically, it includes the following sub-steps:

[0057] Step S2-1: Set the basic parameters of the particle swarm optimization algorithm, and set the starting point and ending point of the pipeline to be laid out; among them, the basic parameters include population size, maximum number of iterations, inertia weight, etc.

[0058] Step S2-2: Use the A* algorithm to generate an initial path from the starting point to the ending point, and this initial path is used as the initial solution of the particle swarm optimization algorithm for subsequent iterative loops.

[0059] Step S2-3: Initialize the particle swarm according to the initial path generated by the A* algorithm.

[0060] Step S2-4: Calculate the fitness of each particle in the particle swarm, compare the fitness values of different particles, and initially obtain the global optimal solution; among them, the fitness function is usually defined according to the quality indicators of the pipeline layout (such as length, number of elbows, etc.).

[0061] Step S2-5: Update the positions and velocities of the particles through iterative loops; among them, in this step, a dynamic guidance mechanism based on the A* algorithm path and an adjustment strategy based on linear change are introduced to continuously optimize the pipeline layout scheme.

[0062] Step S2-6: Check whether the current number of iterations reaches the preset maximum number of iterations or whether the global optimal solution meets the requirements. If the check result is yes, end the solution; otherwise, continue the iterative loop.

[0063] Wherein:

[0064] In Step S2-2, for the requirements of obstacle avoidance and path optimization in the pipeline layout, use the A* algorithm to generate a reference path, thereby improving the quality and search directionality of the initial solution. Specifically:

[0065] In the traditional particle swarm optimization algorithm, when initializing the population, the positions and velocities of particles are usually randomly generated. Although this randomization strategy has a certain global exploration ability, it easily leads to overly scattered particle distribution, and as a result, some particles may be initialized in invalid search regions. Especially under high-dimensional or complex constraint conditions, random initialization often requires more iterations to converge to a high-quality solution, which will affect the efficiency of the algorithm.

[0066] Therefore, in the solution method provided in this embodiment, the A* algorithm is introduced in the initial stage of the particle swarm optimization algorithm, and the path planning of the A* algorithm is used to optimize the initial distribution of the particle swarm. Specifically: First, a reference path from the starting point to the ending point is generated in the search space of the target problem based on the A* algorithm. This provides a preliminary approximation of the global optimal solution for the entire particle swarm. This path comprehensively considers constraints such as the starting point, the ending point, obstacles, and the number of turns, providing a clear search direction for the particle swarm optimization algorithm. Second, since the initial path generated by the A* algorithm is a discrete set of nodes, after generating the initial path, in order to integrate it into the continuous search framework of the particle swarm optimization, an interpolation method is used to smooth the initial path, converting the discrete path points into a continuous particle distribution range. Through the interpolation result, the initial positions of the particle swarm can be distributed in the area near the path instead of being randomly distributed in the entire search space.

[0067] Through the above optimization of the initial population of the particle swarm, the algorithm can be transformed from a random search mode to a "directional" global search. This method not only improves the quality of the initial solution of the population but also provides a better solution space distribution for subsequent iterations, significantly shortening the early convergence time of the algorithm.

[0068] Step S2-5 includes the following sub-steps:

[0069] Step S2-5-1: Through continuous iterative loops, compare the current fitness value of each particle with its historical best fitness value, and update the individual best position of each particle with the better result obtained from the comparison.

[0070] Step S2-5-2: Compare the individual best fitness values of all particles to find the particle position corresponding to the global best fitness value.

[0071] Step S2-5-3: According to the update formula of the particle swarm optimization algorithm, iteratively update the velocity and position of each particle. Specifically:

[0072] In Step S2-5-3, the update formula of the particle swarm optimization algorithm is as follows:

[0073] v i (t + 1) = w·v i(t) + c1·r1·(p best - x i (t)) + c2·r2·(g best - x i (t));

[0074] x i (t + 1) = x i (t) + v i (t + 1);

[0075] Wherein, v i (t) is the velocity of particle i in the t-th generation; x i (t) is the current position of particle i; p best and g best are respectively the individual optimal solution and the global optimal solution of the current particle; w is the inertia weight, used to balance global and local search; c1 and c2 are learning factors, controlling the movement of the particle towards the individual optimal solution and the global optimal solution; r1 and r2 are random numbers.

[0076] In step S2 - 5 - 3, a dynamic guidance mechanism based on the A* algorithm path is introduced:

[0077] In the main optimization loop of the particle swarm optimization algorithm, the update of the position and velocity of the particle is the core process of the algorithm search; the traditional particle swarm optimization algorithm only relies on the individual historical optimal solution (p best ) and the global optimal solution (g best ) to guide the search direction of the particle. Although this mechanism can achieve a balance between global and local search to a certain extent, there may be a problem of lack of guidance for the search direction in complex constraint scenarios; for example, in the path planning problem, the particle may deviate from the feasible region in the solution space, resulting in a decrease in search efficiency.

[0078] Therefore, in order to enhance the search directivity of the particle and the feasibility of the solution, a dynamic guidance mechanism based on the A* algorithm path is designed in the solution method provided in this embodiment; this dynamic guidance mechanism is manifested as adding path information as a guidance factor in the update formula of the particle swarm optimization algorithm in each generation, and the formula is as follows:

[0079] V(i, :) = w·V(i, :) + c1·r1·(p best - X(i, :)) + c2·r2·(g best - X(i, :)) + λ·(initial_path_interp - X(i, :));

[0080] Wherein, V(i, :) represents the velocity of the i-th particle in the current iteration, X(i, :) is the position of the i-th particle in the current iteration, w is the inertia weight, p best and gbest They are the individual best solution and the global best solution of the current particle respectively. c1 and c2 are learning factors, and r1 and r2 are random numbers. λ is the guiding factor, and initial_path_interp is the initial path result; λ·(initial_path_interp - X(i,:)) indicates that the position of the particle will be affected by the guiding path. Especially when the particle is far from the guiding path, this term will guide the particle to move in a direction closer to the path, thereby improving the search efficiency of the particle; the initial value of λ is relatively large, emphasizing that the initial path guides the direction of the particle; in the later stage, it will gradually weaken with the number of iterations, guiding the particle to get rid of the path constraint and enhancing the global search ability of the particle swarm optimization algorithm; the dynamic adjustment formula of λ is as follows:

[0081]

[0082] In the formula, λ max is the maximum value of the path guiding factor, iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm. This dynamic adjustment mechanism ensures that the algorithm can quickly converge to the vicinity of a high-quality solution in the early stage, and at the same time does not limit the particle to further search for the global best solution in the solution space in the later stage. In addition, in order to balance the free search of the particle and the path guidance, a guiding probability mechanism is also designed. This guiding probability mechanism is manifested as that in each velocity update, only a certain probability will activate the A* path guiding term, thereby avoiding all particles relying too much on the path guidance.

[0083] Through the above dynamic guiding mechanism, the particle swarm optimization algorithm not only inherits the ability of the A* algorithm to quickly locate potential best solutions in the solution space, but also retains the global search characteristics of the particle swarm optimization. Compared with the traditional particle swarm optimization algorithm, this guiding mechanism further improves the search efficiency of the particle and the feasibility of the solution, especially showing significant advantages in scenarios with complex constraints.

[0084] In step S2-5-3, a tuning strategy based on linear variation is introduced:

[0085] In the particle swarm optimization algorithm, the learning factors c1 and c2 are two key parameters that adjust the flight direction of the particle, respectively controlling the particle to move towards its own historical best solution (i.e., p best ) and the global best solution (i.e., g best) The maximum step size of movement; their influence on the particle movement trajectory not only reflects the weight distribution of individual experience and group experience, but also directly reflects the information sharing and interaction mode among particle groups. In most cases, the learning factors c1 and c2 are usually set to equal constant values, for example, c1 = c2 = 1.5; this parameter configuration means that during the entire iteration process, the influence of individual experience and group experience on the particle remains constant and equal. However, the complexity of the optimization problem often requires the algorithm to have different search capabilities at different stages, that is, stronger global search capabilities are needed at the initial stage of the algorithm to explore the solution space, while stronger local convergence capabilities are needed in the later stage to improve the accuracy of the solution.

[0086] Therefore, to meet this requirement, a linear-variation-based adjustment strategy is designed in the solution method provided in this embodiment; this adjustment strategy is manifested as dynamically adjusting the learning factors c1 and c2 to balance the global search ability and local search ability of the algorithm at different iteration stages. The formula is as follows:

[0087]

[0088] In the formula, and are the initial values of the learning factors c1 and c2 respectively, iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm. The main purpose of this linear adjustment strategy is to establish a dynamic balance relationship between global search and local search to better meet the requirements of the algorithm at different iteration stages. Specifically: at the initial stage of iteration, because the value of c1 is larger, the particles are more strongly driven by individual experience, so they can globally explore the solution space with a larger step size, which makes the global search ability of the algorithm dominant; as the number of iterations increases, the value of c1 gradually decreases, the value of c2 gradually increases, and the particles rely more on group experience for movement, thus significantly improving the local convergence ability. This dynamic adjustment mechanism not only effectively improves the adaptability of the global search ability and local convergence ability of the algorithm, but also significantly enhances the overall performance of the particle swarm optimization algorithm in complex optimization problems.

[0089] Through the above adjustment strategy, the particles can quickly explore a large range of areas in the solution space at the early stage of the algorithm to avoid falling into local optima; while in the later stage, the particles can concentrate on searching the area around the global optimal solution, thereby improving the accuracy of the solution. This mechanism that balances global exploration and local exploitation enables the particle swarm optimization algorithm to obtain better convergence effects and better solutions when solving high-dimensional and complex optimization problems.

[0090] In summary, the pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm provided in this embodiment combines the heuristic search characteristics of the A* algorithm with the global search capability of the particle swarm optimization algorithm. By utilizing the path guidance information provided by the A* algorithm, the population initialization and particle search process of the particle swarm optimization algorithm can be optimized, thereby significantly improving the efficiency of the algorithm and the quality of the solution.

[0091] In addition, in this embodiment, the above-mentioned solution method is used to conduct simulation experiments. Specifically, the simulation is compiled in MATLAB language under Windows 10 environment. First, the simulation model space of the obstacle is established. The equipment model in the layout space can be regarded as an obstacle that cannot pass through the pipeline. According to the simplification strategy, the map setting of the layout space is as follows: Figure 2 As shown in the figure, here the length and width of the layout space are both 1, and the grid method is used to divide it equally, so the size of the entire layout space is 20×20. Figure 3 , Figure 4 , Figure 5 , Figure 6 As shown, the simulation results of the solution method described in this embodiment (the red line in the figure) and the existing particle swarm optimization algorithm (the blue line in the figure) in different scales (20×20, 18×18, 16×16, 30×30) and complex environments are respectively shown; after comparison, it can be seen that the solution method described in this embodiment has improved in calculation time, number of elbows and optimal path length.

[0092] Example 2

[0093] This embodiment provides a pipeline layout solution method integrating the A* algorithm and the particle swarm optimization algorithm, which is applied to the natural gas processing module in the offshore oil production facility. Specifically:

[0094] Among many offshore oil production facilities, semi-submersible production platforms have become a widely used and representative production model due to their excellent performance and adaptability. Semi-submersible production platforms are complex integrated systems that integrate a large number of facilities and equipment, covering many key functional modules from oil and gas processing, power supply to personnel life support. Therefore, in its limited platform space with clear functional divisions, carefully planning a reasonable, efficient, reliable and safe pipeline path is a very challenging and crucial system engineering.

[0095] The semi-submersible production platform mainly includes an oil and gas processing module, a power module, and a living module; as a characteristic module of the semi-submersible production platform, the oil and gas processing module can be further subdivided into a crude oil processing module, a sewage treatment module, and a natural gas processing module. In the natural gas processing module, typical equipment includes a slug catcher, a primary separator, a secondary separator, a low-pressure primary compressor, a low-pressure secondary compressor, a heat exchanger, a main gas primary compressor, a main gas secondary compressor, a turbine system, etc.

[0096] For the above-mentioned natural gas processing module, the solution method provided in this embodiment includes the following steps:

[0097] Step S1: As Figure 7 shown, establish a pipeline layout space model.

[0098] Step S2: Solve the pipeline layout scheme. Specifically, it includes the following sub-steps:

[0099] Step S2-1: Set the basic parameters of the particle swarm optimization algorithm and set the starting point and ending point of the pipeline to be laid out; among them, the basic parameters include population size, maximum number of iterations, inertia weight, etc.

[0100] Step S2-2: Use the A* algorithm to generate an initial path from the starting point to the ending point, and this initial path serves as the initial solution of the particle swarm optimization algorithm for subsequent iterative loops.

[0101] Step S2-3: Initialize the particle swarm according to the initial path generated by the A* algorithm.

[0102] Step S2-4: Calculate the fitness of each particle in the particle swarm, compare the fitness values of different particles, and initially obtain the global optimal solution; among them, the fitness function is usually defined according to the quality indicators of the pipeline layout (such as length, number of elbows, etc.).

[0103] Step S2-5: Update the position and velocity of the particles through iterative loops; among them, in this step, a dynamic guiding mechanism based on the A* algorithm path and an adjustment strategy based on linear change are introduced to continuously optimize the pipeline layout scheme.

[0104] Step S2-6: Check whether the current number of iterations reaches the preset maximum number of iterations or whether the global optimal solution meets the requirements. If the check result is yes, end the solution; otherwise, continue the iterative loop.

[0105] Through the above steps (the parts not detailed are the same as the corresponding content in Embodiment 1 and will not be elaborated here), a pipeline layout scheme for the natural gas module can be obtained; through simulation experiments, the simulation results of the solution method described in this embodiment and the existing particle swarm optimization algorithm are as Figure 8 shown.

[0106] It should be specifically noted that the parts not described in detail or expanded in the above solutions are all prior arts, which do not belong to the improvements made by the present invention to the prior arts, nor do they belong to the protection scope of the technical solutions of the present invention. Therefore, they will not be elaborated herein. Of course, the above content is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of the embodiments of the present invention. The present invention is not limited to the above examples either. Equal changes and improvements made by those of ordinary skill in the art within the essence of the present invention shall fall within the patent coverage of the present invention.

Claims

1. A method for solving pipeline layout by integrating the A* algorithm and the particle swarm optimization algorithm, characterized in that It includes the following steps: Step S1: Establish a pipeline layout space model; Step S2: Solve the pipeline layout scheme; Among them, step S2 specifically includes the following sub-steps: Step S2-1: Set the basic parameters of the particle swarm optimization algorithm and set the starting point and ending point of the pipeline to be laid out; Step S2-2: Use the A* algorithm to generate an initial path from the starting point to the ending point, and this initial path is used as the initial solution of the particle swarm optimization algorithm for subsequent iterative loops; Step S2-3: Initialize the particle swarm according to the initial path generated by the A* algorithm; Step S2-4: Calculate the fitness of each particle in the particle swarm, compare the fitness values of different particles, and initially obtain the global optimal solution; Step S2-5: Update the position and velocity of the particles through iterative loops; Step S2-6: Check whether the current iteration number reaches the preset maximum iteration number or whether the global optimal solution meets the requirements. If the check result is yes, end the solution; otherwise, continue with the iterative loop.

2. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 1, characterized in that, In step S2-2: The initial path generated by the A* algorithm is a set of discrete nodes. Therefore, after generating the initial path, use the interpolation method to smooth the initial path and convert the discrete path points into a continuous particle distribution range.

3. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 1, characterized in that, Step S2-5 includes the following sub-steps: Step S2-5-1: Through continuous iterative loops, compare the current fitness value of each particle with its historical optimal fitness value, and update the individual optimal position of each particle; Step S2-5-2: Compare the individual optimal fitness values of all particles and find the particle position corresponding to the global optimal fitness value; Step S2-5-3: Iteratively update the velocity and position of each particle according to the update formula of the particle swarm optimization algorithm.

4. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 3, characterized in that, In step S2-5-3, the update formula of the particle swarm optimization algorithm is as follows: v i (t + 1) = w·v i (t) + c1·r1·(p best -x i (t)) + c2·r2·(g best -x i (t)); x i (t + 1)=x i (t)+v i (t + 1); where, v i (t) is the velocity of particle i at the t-th generation; x i (t) is the current position of particle i; p best and g best are the individual best solution and the global best solution of the current particle, respectively; w is the inertia weight, which is used to balance global and local search; c1 and c2 are learning factors, which control the movement of the particle towards the individual best solution and the global best solution; r1 and r2 are random numbers.

5. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 4, wherein In step S2-5-3, introduce a dynamic guiding mechanism based on the A* algorithm path. This dynamic guiding mechanism is manifested as adding path information as a guiding factor to the update formula of the particle swarm optimization algorithm in each generation. The formula is as follows: V(i,:) = w·V(i,:) + c1·r1·(p best - X(i,:)) + c2·r2·(g best - Xi,: + λ·(initial_path_interp - X(i,:)); Where, V(i, :) represents the velocity of the i-th particle in the current iteration, X(i, :) is the position of the i-th particle in the current iteration, w is the inertia weight, p best and g best are respectively the individual optimal solution and the global optimal solution of the current particle, c1 and c2 are learning factors, R1 and r2 are random numbers, and initial_path_interp is the initial path result; λ is the guiding factor, whose initial value emphasizes that the initial path is the direction guidance for the particle; it will gradually weaken with the number of iterations in the later stage to guide the particle to get rid of the path constraint.

6. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 4, characterized in that, In step S2-5-3, introduce an adjustment strategy based on linear change. This adjustment strategy is manifested as dynamically adjusting the learning factors c1 and c2. The formula is as follows: In the formula, and are the initial values of the learning factors c1 and c2 respectively, iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm.

7. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 5, characterized in that, The dynamic adjustment formula of λ is as follows: where λ max is the maximum value of the path guiding factor, iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm.

8. The pipeline layout solving method integrating the A* algorithm and the particle swarm optimization algorithm according to claim 1, characterized in that, In step S1: Use the grid method to establish a pipeline layout space model, that is, divide the pipeline layout space into free grids and obstacle grids according to the presence or absence of obstacles, mark the obstacle grids as black, and mark the free grids as white.

Citation Information

Patent Citations

  • Branched pipeline layout method based on collaborative optimization

    CN115130255A

  • Optimized layout method for wall-attached pipelines in aircraft cabin

    CN115391920A

  • Pipeline layout method, equipment, storage medium, computer program product and device

    CN118797853A

Cited By

  • Complex FLNG cabin three-dimensional pipeline layout method

    CN121189200A

  • Pipeline multi-target optimization method and device based on crown porcupine-A star nesting

    CN121256965A

  • Pipeline multi-objective optimization method and device based on crown-hedgehog-A star nesting

    CN121256965B

  • Single-pipeline layout method based on intelligent optimization hybrid algorithm

    CN121580565A