A pipeline layout solution method integrating A* algorithm and particle swarm optimization algorithm
By integrating the A* algorithm and the particle swarm optimization algorithm, the problems of obstacle handling, initial solution quality, and premature convergence in the pipeline layout problem of the particle swarm optimization algorithm are solved, realizing more efficient pipeline layout optimization and improving the quality of solutions and the adaptability of the algorithm.
Patent Information
- Application Number
- CN202510354343.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-03-25
AI Technical Summary
Existing particle swarm optimization algorithms struggle to effectively handle obstacle constraints, poor initial solution quality, premature convergence, and lack of specific problem guidance when dealing with pipeline layout problems, resulting in low efficiency in complex constraint optimization.
This algorithm integrates the A* algorithm and the particle swarm optimization algorithm. The initial path is generated and smoothed using the A* algorithm. Combined with a dynamic guidance mechanism and a linear adjustment strategy, the initialization and iteration process of the particle swarm optimization algorithm is optimized, thereby enhancing global search capability and local convergence.
It significantly improves the solution quality and algorithm efficiency of pipeline layout, and can better adapt to the engineering optimization needs of high-dimensional, dynamic, and multi-constraint, shortening the convergence time and improving the accuracy of the solution.
Smart Images

Figure CN120337458B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline layout technology, specifically to a pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm. Background Technology
[0002] Pipeline layout problems are typical complex optimization problems in engineering design and manufacturing, widely found in petrochemical, nuclear energy, aerospace, and shipbuilding industries. Their core objective is to rationally design the pipeline layout connecting various functional nodes or equipment while satisfying multiple constraints, thereby optimizing pipeline length, reducing material consumption, lowering engineering costs, and improving system reliability and safety. Specifically, pipeline layout problems typically involve complex constraints such as obstacle avoidance constraints, pipeline crossing constraints, and space utilization limitations. It is a high-dimensional nonlinear combinatorial optimization problem with high computational complexity. Traditional manual design methods for pipeline layout problems are no longer sufficient to meet the needs of modern industry in terms of efficiency and effectiveness. This is because such methods usually rely on the experience of engineers, resulting in high labor intensity, long design cycles, and difficulty in modification, especially when facing multiple objectives and multiple constraints.
[0003] In recent years, intelligent optimization algorithms have demonstrated remarkable adaptability and efficiency in solving complex optimization problems. Particle Swarm Optimization (PSO), as a typical example, has been widely applied to various engineering optimization problems due to its powerful global search capabilities, ease of implementation, and computational efficiency. Therefore, existing technologies have begun to explore using PSO to solve pipeline layout problems, overcoming the limitations of traditional manual design methods. For example, patent CN115391920A provides a method for optimizing the layout of pipes attached to the cabin wall, which includes using PSO to generate the optimal path that satisfies the shortest path and is attached to the cabin wall. However, in reality, the Particle Swarm Optimization (PSO) algorithm still faces many challenges when dealing with complex constraint optimization problems such as pipeline layout. Specifically: First, PSO lacks a mechanism to directly handle geometric constraints such as obstacles, making it difficult to adapt to complex constraint scenarios such as obstacle avoidance and path intersections common in pipeline layout. Second, in high-dimensional dynamic optimization environments, the random initialization method of PSO may lead to poor initial solution quality, thus affecting the algorithm's convergence efficiency and the superiority of the solution. Third, the swarm search mechanism of PSO is prone to premature convergence in complex solution spaces, leading to the search getting trapped in local optima. Fourth, the standard PSO algorithm mainly relies on random search and global updates, lacking the ability to guide specific problems, thus performing poorly in layout optimization in complex environments.
[0004] In summary, this invention proposes a pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm. Summary of the Invention
[0005] The purpose of this invention is to provide a pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm, so as to solve the problem mentioned in the background art that there are many limitations in the existing technology when using the particle swarm optimization algorithm to solve the pipeline layout problem.
[0006] This invention is achieved using the following technical solution:
[0007] A pipeline layout solution method integrating A* algorithm and particle swarm optimization algorithm includes the following steps:
[0008] Step S1: Establish a spatial model of the pipeline layout;
[0009] Step S2: Solve for the pipeline layout scheme;
[0010] 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 start and end points 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. This initial path serves as the initial solution for the particle swarm optimization algorithm and is used in subsequent iterations.
[0013] Step S2-3: Initialize the particle swarm based on 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 obtain the preliminary global optimal solution;
[0015] Step S2-5: Update the particle's position and velocity through iterative loops;
[0016] Step S2-6: Check whether the current iteration count has reached the preset maximum iteration count or whether the global optimal solution meets the requirements. If the check result is yes, end the solution process; otherwise, continue the iteration loop.
[0017] The pipeline layout solution method provided by this invention combines the heuristic search characteristics of the A* algorithm with the global search capability of the particle swarm optimization algorithm, which can significantly improve the efficiency and solution quality of the algorithm. Specifically, the A* algorithm combines heuristic search and cost function estimation, enabling it to quickly calculate the shortest path that meets obstacle avoidance requirements, and has significant advantages in path planning and obstacle avoidance. By integrating the A* algorithm with the particle swarm optimization algorithm, the initialization and search performance of the particle swarm optimization 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 scheme, to address the obstacle avoidance and path optimization requirements in pipeline layout, the A* algorithm is used to generate a reference path, thereby improving the quality and search directionality of the initial solution and providing 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 optimal fitness values of all particles and find the particle position corresponding to the global optimal fitness value;
[0022] Step S2-5-3: Iteratively update the velocity and position of each particle according to the update formula of the particle swarm optimization algorithm.
[0023] Furthermore, in step S2-5-3, the update formula for 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) represents the velocity of particle i in generation t; xi (t) represents the current position of particle i; p best and g best These are the individual optimal solution and the global optimal solution for the current particle, respectively; w is the inertia weight, used to balance the global and local searches; 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.
[0027] Furthermore, in step S2-5-3, a dynamic guidance mechanism based on the A* algorithm path is introduced. This dynamic guidance mechanism involves adding path information as a guidance factor to the update formula of the particle swarm optimization algorithm in each generation, as shown in the following formula:
[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,:) represents the position of the i-th particle in the current iteration, w is the inertia weight, and p best and g best These represent the individual optimal solution and the global optimal solution for the current particle, respectively. c1 and c2 are learning factors, r1 and r2 are random numbers, and "initial_path_interp" is the initial path result. λ is the guidance factor, with a large initial value, emphasizing that the initial path guides the particle's direction; it gradually weakens with the number of iterations, guiding the particle to escape path constraints. In this scheme, the guidance intensity is dynamically adjusted based on the specific constraints in the pipeline layout, enabling particles to quickly approach the reference path in the early stages and enhancing global search capabilities in the later stages. Based on this dynamic guidance mechanism, compared with traditional particle swarm optimization algorithms, the particle swarm optimization algorithm in this scheme 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 particle swarm optimization, thereby further improving the particle search efficiency and solution feasibility, especially showing significant advantages in scenarios with complex constraints.
[0030] Furthermore, in step S2-5-3, an adjustment strategy based on linear change is introduced. This adjustment strategy involves dynamically adjusting the learning factors c1 and c2, as shown in the following formula:
[0031]
[0032] In the formula, and These are the initial values for learning factors c1 and c2, respectively. iter represents the current iteration number, and Max_iter represents the total number of iterations of the algorithm.
[0033] In this scheme, for the pipeline layout problem, by dynamically adjusting the learning factors c1 and c2 of the particles, we can adapt to the different requirements of global search and local convergence capabilities at different stages. This adjustment strategy ensures that the global search and local accurate optimization of the pipeline layout can be balanced, so that the particle swarm optimization algorithm can obtain better convergence effect and better solution 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 for λ is as follows:
[0035]
[0036] In the formula, λ max Max_iter represents the maximum value of the path guidance factor, where iter represents the current iteration number and Max_iter represents the total number of iterations of the algorithm.
[0037] Furthermore, in step S1: a pipeline layout space model is established using a grid method, that is, the pipeline layout space is divided into free grids and obstacle grids according to whether there are obstacles, and the obstacle grids are marked as black and the free grids are marked as white.
[0038] The beneficial effects achieved by this invention are:
[0039] Compared with existing technologies that use particle swarm optimization (PSO) to solve pipeline layout problems and have many limitations, this invention provides a pipeline layout solution method that integrates the A* algorithm and PSO. It combines the heuristic search characteristics of the A* algorithm with the global search capability of the PSO. By utilizing the path guidance information provided by the A* algorithm, the population initialization and particle search process of the PSO can be optimized, thereby significantly improving the efficiency and solution quality of the algorithm. This allows it to better adapt to the engineering optimization needs of high-dimensional, dynamic, and multi-constraint problems. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating the solution method described in Embodiment 1 of the present invention;
[0041] Figure 2 This is a schematic diagram of the pipeline layout spatial model in the solution method described in Embodiment 1 of the present invention;
[0042] Figure 3 This diagram illustrates a comparison between the pipeline layout obtained by the solution method described in Embodiment 1 of this invention and the pipeline layout obtained by the existing particle swarm optimization algorithm. Figure I ;
[0043] Figure 4 This diagram illustrates a comparison between the pipeline layout obtained by the solution method described in Embodiment 1 of this invention and the pipeline layout obtained by the existing particle swarm optimization algorithm. Figure II ;
[0044] Figure 5 This diagram illustrates a comparison between the pipeline layout obtained by the solution method described in Embodiment 1 of this invention and the pipeline layout obtained by the existing particle swarm optimization algorithm. Figure III ;
[0045] Figure 6 This diagram illustrates a comparison between the pipeline layout obtained by the solution method described in Embodiment 1 of this invention and the pipeline layout obtained by the existing particle swarm optimization algorithm. Figure IV ;
[0046] Figure 7 This is a two-dimensional equipment layout diagram of the natural gas processing module described in Embodiment 2 of the present invention;
[0047] Figure 8 This is a schematic diagram comparing the pipeline layout obtained by the solution method described in Embodiment 2 of the present invention with the pipeline layout obtained by the existing particle swarm optimization algorithm. Detailed Implementation
[0048] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0049] Example 1
[0050] This embodiment provides a pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm. Please refer to... Figure 1 It includes the following steps:
[0051] Step S1: Establish a spatial model of the pipeline layout. Specifically:
[0052] The establishment of a two-dimensional pipeline layout spatial model affects the efficiency and quality of the final layout design. Commonly used modeling methods include the mesh method, free space method, and octree method. In this embodiment, the mesh method is used to establish the pipeline layout spatial model, which not only meets engineering requirements but also effectively describes the actual spatial environment. When using the mesh method, the pipeline layout space is divided into free meshes and obstacle meshes according to the presence of obstacles. Obstacle meshes are marked in black, and free meshes are marked in white. In addition, to ensure the rationality of the layout, irregular obstacles are expanded, and if an obstacle does not fill a full mesh, it is filled into a full mesh.
[0053] The most common ways to represent grids are using coordinates and indices. To facilitate grid identification, the following conversion formula is obtained by combining both:
[0054]
[0055] In the formula, (x i y i R represents the coordinate position of the i-th grid, where i represents the grid number. x R represents the number of rows in the grid map. y The number of columns in the grid map is given by 'mod()', which is the modulo function, and 'ceil()' is the floor function.
[0056] Step S2: Solve for the piping layout scheme. Specifically, this includes the following sub-steps:
[0057] Step S2-1: Set the basic parameters of the particle swarm optimization algorithm and set the start and end points of the pipeline to be laid out; 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. This initial path serves as the initial solution for the particle swarm optimization algorithm and is used in subsequent iterations.
[0059] Step S2-3: Initialize the particle swarm based on 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 obtain the preliminary global optimal solution; the fitness function is usually defined based on the quality indicators of the pipeline layout (such as length, number of bends, etc.).
[0061] Step S2-5: Update the position and velocity of the particles through iterative loops; in this step, a dynamic guidance mechanism based on the A* algorithm path and an adjustment strategy based on linear changes are introduced to continuously optimize the pipeline layout scheme.
[0062] Step S2-6: Check whether the current iteration count has reached the preset maximum iteration count or whether the global optimal solution meets the requirements. If the check result is yes, end the solution process; otherwise, continue the iteration loop.
[0063] in:
[0064] In step S2-2, to address the obstacle avoidance and path optimization requirements in the pipeline layout, the A* algorithm is used to generate reference paths, thereby improving the quality and search directionality of the initial solution. Specifically:
[0065] Traditional particle swarm optimization algorithms typically use randomized generation of particle positions and velocities during population initialization. While this randomization strategy has some global exploration capability, it can easily lead to overly dispersed particle distribution, causing some particles to be initialized in invalid search regions. Especially under high-dimensional or complex constraints, random initialization often requires many iterations to converge to a high-quality solution, which in turn affects 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. The path planning of the A* algorithm is used to optimize the initial distribution of the particle swarm. Specifically: First, based on the A* algorithm, a reference path from the starting point to the ending point is generated in the search space of the target problem. 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, 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 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 results, the initial positions of the particle swarm can be distributed in the region near the path, rather than randomly distributed throughout the entire search space.
[0067] By optimizing the initial population of the particle swarm, the algorithm can be transformed from a random search mode to a "directional" global search. This approach not only improves the quality of the initial solutions 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 of the comparison.
[0070] 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.
[0071] Step S2-5-3: Iteratively update the velocity and position of each particle according to the update formula of the particle swarm optimization algorithm. Specifically:
[0072] In step S2-5-3, the update formula for 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] In the formula, v i (t) represents the velocity of particle i in generation t; x i (t) represents the current position of particle i; p best and g best These are the individual optimal solution and the global optimal solution for the current particle, respectively; w is the inertia weight, used to balance the global and local searches; 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, updating the position and velocity of particles is the core process of the algorithm's search; traditional particle swarm optimization algorithms rely solely on the historical optimal solutions of individual particles (p... best ) and the global optimal solution (g best This mechanism guides the particle's search direction. Although it can achieve a balance between global and local search to some extent, it may lead to a lack of guidance in the search direction in complex constraint scenarios. For example, in path planning problems, the particle may deviate from the feasible region in the solution space, resulting in a decrease in search efficiency.
[0078] Therefore, to enhance the search directionality of particles and the feasibility of solutions, the solution method provided in this embodiment designs a dynamic guidance mechanism based on the A* algorithm path. This dynamic guidance mechanism is manifested by adding path information as a guidance factor to the update formula of the particle swarm optimization algorithm in each generation, as shown in the following formula:
[0079] V(i,:)=w·V(i,:)+c1·r1·(p best -X(i,:))+c2·r2·(g best -X(i,:))+λ·(initial_path_interp-X(i,:));
[0080] In the formula, V(i,:) represents the velocity of the i-th particle in the current iteration, X(i,:) represents the position of the i-th particle in the current iteration, w is the inertia weight, and p best and gbest , c1 and c2 are the individual optimal solution and the global optimal solution for the current particle, respectively; c1 and c2 are learning factors; 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 particle's position is affected by the guiding path, especially when the particle is far from the guiding path. This factor guides the particle to move closer to the path, thus improving the particle's search efficiency; the initial value of λ is relatively large, emphasizing that the initial path guides the particle's direction; it gradually weakens with the number of iterations, guiding the particle to escape path constraints and enhancing the global search capability of the particle swarm optimization algorithm; the dynamic adjustment formula of λ is as follows:
[0081]
[0082] In the formula, λ max `A*` represents the maximum value of the path guidance 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 stages, while not restricting particles from further searching for the global optimum in the solution space in the later stages. In addition, to balance the free search of particles with path guidance, a guidance probability mechanism is designed. This mechanism means that in each velocity update, there is only a certain probability that the A* path guidance term will be activated, thereby avoiding all particles from becoming overly dependent on path guidance.
[0083] Through the aforementioned dynamic guidance mechanism, the particle swarm optimization algorithm not only inherits the A* algorithm's ability to quickly locate potential optimal solutions in the solution space, but also retains the global search characteristics of particle swarm optimization. Compared to traditional particle swarm optimization algorithms, this guidance mechanism further improves the search efficiency of particles and the feasibility of solutions, especially showing significant advantages in scenarios with complex constraints.
[0084] In step S2-5-3, an adjustment strategy based on linear change is introduced:
[0085] In particle swarm optimization (PSO) algorithms, learning factors c1 and c2 are two key parameters that adjust the flight direction of particles, controlling their trajectory towards their historical optimal solution (i.e., p). best ) and the global optimal solution (i.e., g) bestThe maximum step size of the movement; their influence on the particle trajectory not only reflects the weighting of individual experience and group experience, but also directly reflects the information sharing and interaction patterns among the particle group. In most cases, learning factors c1 and c2 are usually set to equal constant values, for example, c1 = c2 = 1.5; this parameter configuration means that the influence of individual experience and group experience on the particle remains constant and equal throughout the iteration process. However, the complexity of optimization problems often requires the algorithm to have different search capabilities at different stages, that is, a stronger global search capability is needed in the early stage of the algorithm to explore the solution space, while a stronger local convergence capability is needed in the later stage to improve the accuracy of the solution.
[0086] Therefore, to meet this requirement, the solution method provided in this embodiment is designed with an adjustment strategy based on linear variation; this adjustment strategy is manifested in the dynamic adjustment of learning factors c1 and c2, so that the algorithm balances the global search capability and the local search capability at different iteration stages, as shown in the following formula:
[0087]
[0088] In the formula, and Here, c1 and c2 are the initial values of the learning factors, respectively; iter represents the current iteration number; and Max_iter represents the total number of iterations. The main purpose of this linear adjustment strategy is to establish a dynamic balance between global and local search, better adapting to the needs of the algorithm at different iteration stages. Specifically: in the early stages of iteration, because the value of c1 is large, particles are more driven by individual experience, enabling them to explore the solution space globally with larger step sizes, making the algorithm's global search capability dominant. As the number of iterations increases, the value of c1 gradually decreases, while the value of c2 gradually increases, and particles rely more on collective experience for movement, thus significantly improving local convergence capability. This dynamic adjustment mechanism not only effectively improves the adaptability of the algorithm's global search capability and local convergence capability but also significantly enhances the overall performance of the particle swarm optimization algorithm in complex optimization problems.
[0089] Through the aforementioned adjustment strategy, particles can rapidly explore a large area of the solution space in the early stages of the algorithm to avoid getting trapped in local optima. In the later stages, particles can focus on searching the area surrounding the global optimum, thereby improving the accuracy of the solution. This mechanism of balancing global exploration and local exploitation enables the particle swarm optimization algorithm to achieve better convergence and superior 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, a simulation experiment was conducted using the above-described solution method. Specifically, the simulation was performed using MATLAB in a Windows 10 environment. First, a simulation model space for obstacles was established. The device models in the layout space can be considered as obstacles that cannot pass through the pipes. Based on the simplification strategy, the map settings of the layout space are as follows: Figure 2 As shown; here, the length and width of the layout space are both 1, and it is divided equally using a grid method, resulting in a total layout space size of 20×20. For example... Figure 3 , Figure 4 , Figure 5 , Figure 6 As shown, the simulation results of the solution method described in this embodiment (red broken line in the figure) and the existing particle swarm optimization algorithm (blue broken line in the figure) under different scales (20×20, 18×18, 16×16, 30×30) and complexity environments are presented respectively. The comparison shows that the solution method described in this embodiment has improved in terms of computation time, number of bends and optimal path length.
[0092] Example 2
[0093] This embodiment provides a pipeline layout solution method that integrates the A* algorithm and the particle swarm optimization algorithm, applied to the natural gas processing module in an offshore oil production facility. Specifically:
[0094] Among numerous offshore oil production facilities, semi-submersible production platforms have become a widely used and highly representative production mode due to their superior performance and adaptability. A semi-submersible production platform is a complex integrated system, incorporating a vast amount of facilities and equipment, encompassing many key functional modules from oil and gas processing and power supply to personnel living support. Therefore, carefully planning a rational, efficient, reliable, and safe pipeline route within its limited and clearly defined functional platform space is a highly challenging and crucial systems engineering project.
[0095] A semi-submersible production platform mainly comprises an oil and gas processing module, a power module, and a living quarters module. As a distinctive module of the semi-submersible production platform, the oil and gas processing module can be further subdivided into crude oil processing, wastewater treatment, and natural gas processing modules. Typical equipment in the natural gas processing module includes a slug trap, primary separator, secondary separator, low-pressure primary compressor, low-pressure secondary compressor, heat exchanger, main gas compressor (primary), main gas compressor (secondary), and turbine system.
[0096] For the aforementioned natural gas processing module, the solution method provided in this embodiment includes the following steps:
[0097] Step S1: As Figure 7 As shown, a spatial model of the pipeline layout is established.
[0098] Step S2: Solve for the piping layout scheme. Specifically, this includes the following sub-steps:
[0099] Step S2-1: Set the basic parameters of the particle swarm optimization algorithm and set the start and end points of the pipeline to be laid out; 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. This initial path serves as the initial solution for the particle swarm optimization algorithm and is used in subsequent iterations.
[0101] Step S2-3: Initialize the particle swarm based on 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 obtain the preliminary global optimal solution; the fitness function is usually defined based on the quality indicators of the pipeline layout (such as length, number of bends, etc.).
[0103] Step S2-5: Update the position and velocity of the particles through iterative loops; in this step, a dynamic guidance mechanism based on the A* algorithm path and an adjustment strategy based on linear changes are introduced to continuously optimize the pipeline layout scheme.
[0104] Step S2-6: Check whether the current iteration count has reached the preset maximum iteration count or whether the global optimal solution meets the requirements. If the check result is yes, end the solution process; otherwise, continue the iteration loop.
[0105] Through the above steps (the parts not detailed are consistent with the corresponding content in Example 1, and will not be repeated here), a scheme for pipeline layout of the natural gas module can be obtained; after simulation experiments, the simulation results of the solution method described in this embodiment and the existing particle swarm optimization algorithm are as follows: Figure 8 As shown.
[0106] It should be noted that the parts not described in detail or in elaboration in the above solutions are all prior art and do not constitute improvements made by this invention to existing technology, nor are they within the protection scope of this invention's technical solutions. Therefore, they will not be elaborated upon further in this document. Of course, the above content is merely a preferred embodiment of this invention and should not be considered as limiting the scope of the embodiments of this invention. This invention is also not limited to the above examples; equivalent changes and improvements made by those skilled in the art within the substantial scope of this invention should all fall within the patent coverage of this invention.
Claims
1. A pipeline layout solution method integrating A* algorithm and particle swarm optimization algorithm, characterized in that, Includes the following steps: Step S1: Establish a spatial model of the pipeline layout; Step S2: Solve for the pipeline layout scheme; Step S2 specifically includes the following sub-steps: Step S2-1: Set the basic parameters of the particle swarm optimization algorithm and set the start and end points 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. This initial path serves as the initial solution for the particle swarm optimization algorithm and is used in subsequent iterations. Step S2-3: Initialize the particle swarm based on 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 obtain the preliminary global optimal solution; Step S2-5: Update the particle's position and velocity through iterative loops; Step S2-6: Check whether the current iteration count has reached the preset maximum iteration count or whether the global optimal solution meets the requirements. If the check result is yes, end the solution; otherwise, continue the iteration loop. 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 best fitness value, and update the individual best 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; In step S2-5-3, the update formula for the particle swarm optimization algorithm is as follows: ; ; In the formula, Let be the velocity of particle i in generation t; This represents the current position of particle i. and These are the individual optimal solution and the global optimal solution for the current particle, respectively. Inertial weights are used to balance global and local searches; and r1 and r2 are learning factors that control the movement of particles toward the individual optimal solution and the global optimal solution; r1 and r2 are random numbers. In step S2-5-3, a dynamic guidance mechanism based on the A* algorithm path is introduced. This dynamic guidance mechanism involves adding path information as a guidance factor to the update formula of the particle swarm optimization algorithm in each generation, as shown in the following formula: ; In the formula, This represents the velocity of the i-th particle in the current iteration. Let i be the position of the i-th particle in the current iteration. For inertial weights, and These are the individual optimal solution and the global optimal solution for the current particle, respectively. and As a learning factor, and It is a random number. The initial path result is given; λ is the guiding factor, whose initial value emphasizes that the initial path guides the direction of the particle; it gradually weakens with the number of iterations in the later stages, guiding the particle to break free from the path constraints. The dynamic adjustment formula for λ is as follows: ; In the formula, This represents the maximum value of the path guiding factor. Indicates the current iteration number. This represents the total number of iterations of the algorithm; In step S2-5-3, an adjustment strategy based on linear change is introduced, which is manifested in the adjustment of the learning factor. and Dynamic adjustment is performed, using the following formula: In the formula, and Learning factors and initial value, Indicates the current iteration number. This represents the total number of iterations of the algorithm.
2. The pipeline layout solution method integrating A* algorithm and 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 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.
3. The pipeline layout solution method integrating A* algorithm and particle swarm optimization algorithm according to claim 1, characterized in that, In step S1: a pipeline layout space model is established using the grid method, that is, the pipeline layout space is divided into free grids and obstacle grids according to whether there are obstacles, and the obstacle grids are marked as black and the free grids are marked 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