An Approach of Path Optimization Algorithm for 3D Concrete Printing Based on Graph Theory

: In this paper, a method of 3D concrete printing is used to ﬁnd the optimal path of the nozzle running path. We propose a path optimization algorithm based on graph theory to solve two key problems in 3D concrete printing. The partitioning algorithm based on graph theory was adopted to improve the forming quality of concrete components, and ant colony algorithm was used to reduce printing time. The method was evaluated with 3D concrete printing experiments after introducing the process of implementing the partition algorithm and ant colony algorithm. The experiment results show a signiﬁcant reduction in the idle strokes and the nozzle head-up times of the running path planned by the method in this paper. This has a direct impact on shortening the printing time and improving the forming quality. Compared with the other three conventional algorithms, the idle strokes of the nozzle planned by the method in this paper are reduced by 18.94%, 37.88%, and 66.67%, and the nozzle head-up times are reduced by 1.59%, 2.15%, and 8.69%. It provides a practical reference for the path optimization of 3D concrete printing.


Introduction
Three-dimensional concrete printing is a kind of additive manufacturing based on the digital model, with special "ink" made of cementitious materials, admixtures, additives, special fibers, and aggregates [1]. The printing process converts the architectural model into a three-dimensional design drawing with computer graphics, moves according to the set printing path, continuously extrudes the concrete slurry, and adds material layer by layer through layered processing and superposition molding to build the building [2]. The molding process is like fused deposition modelling (FDM), which is a linear lamination molding of the slurry extruded through the print head without the aid of a template [3].
In recent research, 3D concrete printing technology has shown great application potential in the construction field because it has higher construction efficiency, lower production cost, and less human resource investment than conventional construction methods [4]. Designers can also design the internal structure of concrete components according to mechanical principles to complete more complex and high-quality architectural designs because of the characteristics of the layered printing mode of 3D concrete printing [5]. However, the current 3D concrete printing technology is not yet mature, and there are still problems, such as the rough surface of concrete components, low forming quality, and long printing time [6]. These problems have seriously affected the development of 3D concrete printing. At present, scholars are solving the problem of long printing time by optimizing the printing path [7]. In the work of Kai-Yin Fok et al. [8], the nozzle path planning problem is formulated as an undirected rural postman problem (URPP), and a computationally efficient heuristic search algorithm is proposed to find fast routes and mitigate overheads in printing processes. Both simulation and experimental results concur that the proposed algorithm can significantly speed up printing processes. Gregory Dreifus et al. [9] presented a graphical model of the three-dimensional (3D) printing process and used the solution to the Chinese postman problem (CPP) to optimize the motion of an extruder on a given mesh. It enables the printer to print arbitrary lattice structures at the optimal time. This method significantly saves printing time, which is essential for better AM. Transitions are movements of the nozzle from a path endpoint to a path start point. These transitions diminish printing quality by causing strings. Liu et al. [10] proposed a method that minimizes the number of transitions based on directional parallel line segments. A genetic algorithm solver was developed by designing a TSP-oriented mutation method. Compared with other algorithms, their algorithm generates paths with fewer transitions. Falliano Devid et al. presents a novel type of foamed concrete [11]. This novel material can keep its shape in the fresh state due to enhanced consistency and viscosity. This peculiarity lends itself to being implemented in automated extrusion production processes and 3D printing applications without the use of formwork. Kenneth Castelino et al. [1] described an algorithm for minimizing the nonproductive time or 'airtime' for milling by optimally connecting different nozzle path segments. This problem is formulated as a generalized traveling salesman problem with precedence constraints and is solved using a heuristic method. This method gives a significant improvement over random solutions and local search methods. The time savings depend on the problem size, and as the size of the problem increases, the benefits of the algorithm become apparent.
In addition, scholars have proposed a variety of path optimization algorithms to solve various problems encountered in 3D concrete printing. Among them, Jiang et al. [12] proposed a support generation method through printing path planning, with the aim of solving 3D concrete printing still suffering from redundant support material usage when printing parts with overhanging features. The new support generation method can significantly save more material. Bashir Hosseini Jafari and Nicholas Gans [13] presented a novel approach to design and carry out trajectories over regular curved surfaces. Their course provides a unified methodology for surface fitting from 3D surface measurements and mapping a curve from 2D onto a 3D surface with minimal distortion. Wu et al. [14] reconstructed CAD models from an original (GATech Buzz) sample with 2D image information. A CAD model for optimization and validation is adopted to sustain manufacturing reproduction based on system simulation feedback. To avoid collision with the produced path from the retraction path, their pick adaptive ring path generation and prediction in each planning iteration may also minimize material removal. Alejandro Vargas-Uscategui et al. [15] focused on understanding how the nozzle path planning strategy and robot kinematics affect the geometry and porosity distribution in a 3D object and found that the nozzle path has an essential impact on the formation of under-built and over-built structures. The knowledge generated from this research can significantly influence the development of nozzle path planning strategies in AM, providing the means to produce improved near-net shapes with controlled porosity formation. Wang et al. [16] proposed a load-dependent 3D printing path planning method for continuous fiber-reinforced plastics, which has been submitted. By using the topological optimization methods, the load transmission paths were reordered and extracted. Then the developed stress vector tracing algorithm was used to generate the continuous load-dependent printing path of CFRPs from the extracted features, which contain geometry and stress vectors. The printing path planned by this method precisely follows the load transfer path of the part, which can provide higher mechanical properties. Jin et al. [17] proposed a level-set-based optimization method to generate contour-parallel deposition paths for material extrusion-based additive manufacturing. The resulting contour path is smoothed using the level set from the input footprint; local optimization is then applied to smooth the points on the path by adaptively adjusting the position of the path. This deposition using the generated paths can effectively improve the manufacturing quality. DAI et al. [18] introduced a methodology to compute advancing fields for material accumulation by always performing material deposition along the surfaces of convex hulls; therefore, the printing process is guaranteed to remain collision-free. The 3D printing path is generated by their algorithm to fully fabricate models with large overhangs and high-genus topologies without any support structures. Asprone Domenico et al.'s method consists in the partition of a RC member into different concrete segments printed separately and assembling them into a unique element along with the steel reinforcement system [19]. The approach is expected to facilitate the production of free-form structurally optimized RC elements with the final aim of saving concrete material and, at the same time, fabricating lighter structures. Prashant Gupta, Bala Krishnamoorthy, and Gregory Dreifus [20] developed a framework that creates a new polygonal mesh representation of the sparse infill domain of a layer-by-layer 3D printing job. It guarantees the existence of a single, continuous nozzle path covering each connected piece of the domain in every layer in this graphical model. Their algorithm produces a nozzle path that avoids material collisions and crossovers and can be printed in a continuous fashion, irrespective of the complex geometry or topology of the domain.
Through multiple experiments, we found two crucial influencing factors of the nozzle running path on 3D concrete printing. They are: (1) When the nozzle runs a longer distance (idle stroke) in the non-printing area, the print time will be longer. (2) The nozzle head-up will produce a local accumulation effect, and when the print size is relatively small, the local cumulative effect is more obvious. This will lead to: (1) The printing efficiency will decrease when the nozzle runs with a longer idle strokes. (2) The forming quality of concrete components will be worse when the nozzle head-up times increase. Therefore, a path planning method is proposed to shorten the idle strokes and the head-up times of the nozzle running path to improve the printing efficiency and the forming quality of the concrete components. First, model the concrete components, and then partition the model based on the principle of graph theory. The algorithm in this paper divides the running path of the nozzle into partitions, and each partition can be printed once without the need for the nozzle head-up. After the partition is completed, the ant colony algorithm is used to find the shortest path between each partition, minimizing the idle strokes of the nozzle running path.
The format of this paper is as follows: We introduce the current problems of 3D concrete printing technology and give the solutions, then use simulation printing experiments and the actual printing experiments to verify the feasibility of the method in this paper. In the experiments, the advantages and feasibility of the algorithm in this paper are compared with three conventional 3D concrete printing path planning algorithms [21,22].

Modeling
To build the 3D concrete components model, it is necessary to collect various geometric data (length, width, height, etc.) of the concrete components. These data must be as accurate as possible because they affect the size of the nozzle and the number of slices when the concrete components are finally printed. After collecting the data, they are imported into Sketch Up to build the corresponding model ( Figure 1). Sketch Up is software that can create, share, and display 3D models. Unlike 3Dmax, it uses plane modeling. Through an easy-to-use and precise color, line, and text prompt guidance system, people do not have to type in coordinates to help them track their positions and complete related modeling operations.
Export the model as an STL file after modeling. The STL file is imported into Cura for slicing operations, and the slicing model ( Figure 2) is obtained. Cura is 3D printing software designed by Ultimaker. It was developed using Python and integrates the Cura Engine developed by C++ as the slicing engine. It is characterized by fast slicing speed, good user experience, and allows users to adjust the print quality and materials used. However, because Cura can only recognize model files in STL format, it is necessary to convert the built model into STL file format when using it. Export the model as an STL file after modeling. The STL file is imported into Cura for slicing operations, and the slicing model ( Figure 2) is obtained. Cura is 3D printing software designed by Ultimaker. It was developed using Python and integrates the Cura Engine developed by C++ as the slicing engine. It is characterized by fast slicing speed, good user experience, and allows users to adjust the print quality and materials used. However, because Cura can only recognize model files in STL format, it is necessary to convert the built model into STL file format when using it.

Model Partition
Convert the slicing model created in the previous section into computer-processed geometry ( Figure 3) to use the partitioning algorithm in this section. The intersection of multiple line segments in the geometric figure is marked as a geometric point ( Figure 4) and assigned numbers as , , …… . Then, each geometric point is assigned a Cartesian coordinate value as , , , , , …… , according to the geometric data measured in the 3D concrete printing component model. For each line segment in the geometric figure, a matrix describes their length and the number of intersections, and the elements in the matrix as weights. In this paper, the number of elements in represents the intersection point of the nozzle running path, and the number of line segments in the geometric figure represents the connection path between these intersection points. Therefore, there is a linear relationship between the number of line  Export the model as an STL file after modeling. The STL file is imported into Cura for slicing operations, and the slicing model ( Figure 2) is obtained. Cura is 3D printing software designed by Ultimaker. It was developed using Python and integrates the Cura Engine developed by C++ as the slicing engine. It is characterized by fast slicing speed, good user experience, and allows users to adjust the print quality and materials used. However, because Cura can only recognize model files in STL format, it is necessary to convert the built model into STL file format when using it.

Model Partition
Convert the slicing model created in the previous section into computer-processed geometry ( Figure 3

Model Partition
Convert the slicing model created in the previous section into computer-processed geometry ( Figure 3) to use the partitioning algorithm in this section. The intersection of multiple line segments in the geometric figure is marked as a geometric point ( Figure 4) and assigned numbers as S 1 , S 2 , S 3 . . . . . . S n . Then, each geometric point is assigned a Cartesian coordinate value as (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ) . . . . . . (x n , y n ) according to the geometric data measured in the 3D concrete printing component model. For each line segment in the geometric figure, a matrix T describes their length and the number of intersections, and the elements in the matrix as weights. In this paper, the number of elements in T represents the intersection point of the nozzle running path, and the number of line segments in the geometric figure represents the connection path between these intersection points. Therefore, there is a linear relationship between the number of line segments in the geometric figure and the number of elements in T, and the length of the line segments and the size of elements in T are also linear.
Create a matrix T 1 to describe whether each geometric point in the geometric figure is connected. Among them, the elements in T 1 of the row vector are the numbers of the marked geometric points, and the elements in T 1 of the column vector represent their connection relationship. To obtain the elements in T 1 , it is needed to traverse the elements in T and find the geometric points that meet the following four rules: These rules do not need to be satisfied for all elements in T. When rule (1) is satisfied, the corresponding geometric point is put into T 1 . When rule (1) and rule (2) are satisfied simultaneously, the priority of putting the geometric point is lower than the first one, and so on.     Create a matrix to describe whether each geometric point in the geometric figure is connected. Among them, the elements in of the row vector are the numbers of the marked geometric points, and the elements in of the column vector represent their connection relationship. To obtain the elements in , it is needed to traverse the elements in and find the geometric points that meet the following four rules: The first-row element in B is the number of the marked geometric point; the second-row element in B is the number of connections between each geometric point and the rest of the geometric point; and the initial value is 0. Select a starting point S i in the first row of an element in T 1 to connect to the point S j in the next row, set the element in T to inf, and add 1 to the element in B 2i . After finding column S j in T 1 , repeat the above operation to find the partition that can traverse at once. The following are the connection rules: When S i is reconnected, it indicates that a partition has been searched. Next, use S i as the center of the circle and increase the radius gradually to find the unconnected point. Repeat the above operation to find a new partition and filter out the partition with the longest connection path. Repeat the above operation until the entire graph is traversed ( Figure 5). Because the geometry divided by the partitioning algorithm is closed, any geometric point in the partition can be traversed at once.
Start the first partition search phrase as creation is completed. At this time, matrix is created to record the connection times of each geometric point in the geometric figure.
The first-row element in is the number of the marked geometric point; the second-row element in is the number of connections between each geometric point and the rest of the geometric point; and the initial value is 0. Select a starting point in the first row of an element in to connect to the point in the next row, set the element in to inf, and add 1 to the element in . After finding column in , repeat the above operation to find the partition that can traverse at once. The following are the connection rules: (1) Connect , , make , 1; (2) Find , , if && , connect , ; When is reconnected, it indicates that a partition has been searched. Next, use as the center of the circle and increase the radius gradually to find the unconnected point. Repeat the above operation to find a new partition and filter out the partition with the longest connection path. Repeat the above operation until the entire graph is traversed ( Figure 5). Because the geometry divided by the partitioning algorithm is closed, any geometric point in the partition can be traversed at once.

Optimal Path
The geometry is divided into n areas after the partition is completed. Create n arrays to store the geometric points in each partition geometry; each array is denoted as R n . The geometric point in each array is denoted as S ti , and mark its Cartesian seat as x S ti , y S ti . Extract a geometric point from each array and apply the ant colony algorithm to get the shortest path between them. This process needs to be repeated several times until the geometric points in each array are traversed to find the final optimal path. However, such a process is complicated and time-consuming. Therefore, constraints are introduced in this paper (the constraints are as follows: Equations (1)-(3)). Use the ant colony algorithm to find the shortest path, as the judgment result is F = 1. On the contrary, discard the extracted geometry point combination if the judgment result is F = 0.

of 12
The following are the critical steps of the ant colony algorithm used in this section: Step (1): Initialize the various parameters, such as the number of ants µ, the influence of pheromone concentration on the direction of ant transfer α, the relative importance of visibility β, the number of volatiles ρ, and the maximum number of iterations.
Step (2): Construct a solution space, place each ant randomly at a different starting point, and calculate the next printing point to be visited for each ant k (k = 1, 2, 3 . . . n) until all ants have visited all the printing points.
Step (3): Update the pheromone, calculate the path length d k of each ant (k = 1, 2, 3 . . . n), and record the optimal solution (shortest path) in the current iteration times. At the same time, the pheromone concentration on the connecting path of each printing point is updated.
Step (4): Determine whether to terminate; if iterations < max(iterations), set iterations = iterations + 1, clear the record table of the path that the ant passes, and return to step (2); otherwise, terminate the calculation and output the optimal solution ( Figure 6).
The following are the critical steps of the ant colony algorithm used in this section: Step (1): Initialize the various parameters, such as the number of ants , the influence of pheromone concentration on the direction of ant transfer , the relative importance of visibility , the number of volatiles , and the maximum number of iterations.
Step (2): Construct a solution space, place each ant randomly at a different starting point, and calculate the next printing point to be visited for each ant k (k = 1, 2, 3 … n) until all ants have visited all the printing points.
Step (3): Update the pheromone, calculate the path length of each ant (k = 1, 2, 3 … n), and record the optimal solution (shortest path) in the current iteration times. At the same time, the pheromone concentration on the connecting path of each printing point is updated.
Step (4): Determine whether to terminate; if iterations < max(iterations), set iterations = iterations + 1, clear the record table of the path that the ant passes, and return to step (2); otherwise, terminate the calculation and output the optimal solution ( Figure 6).

Results
This section divides the experimental part into simulation printing experiments and actual printing experiments. Simulation printing experiments, including the algorithm of this paper and three other conventional path planning algorithms, will be performed under the same conditions. These conventional algorithms are the parallel straight-line scanning algorithm, zigzag scanning algorithm, and offset contour scanning algorithm. Due to the complexity of the concrete components in this paper, the parallel straight-line scanning algorithm and the zigzag scanning algorithm require the nozzle to rise frequently, which cannot be applied to the actual printing experiment. The actual printing experiments will use the proposed and offset contour scanning algorithms because their printing paths have fewer inflection points.
In the experiments, concrete components of the same size (1300 mm, 1300 mm) and the same number of layers (4 layers) were selected for printing under the same conditions. Record the running distance and the nozzle head-up times of the nozzle running path in the experiments, as they will significantly affect the forming quality and printing time of concrete components. The forming quality of the concrete components will be poor because every time the nozzle is raised, the cohesion of the material will lead to excessive concrete accumulation. The printing time of the concrete components will be longer because it has a linearly increasing relationship with the travel distance of the nozzle.

Simulation Printing Experiment
The algorithm is run on the MATLAB R2018 platform. However, it is unintuitive and complicated to record the running distance and the head-up times of the nozzle running path in the simulated printing experiments on MATLAB R2018. Therefore, it is necessary to perform the simulation printing experiments on CIMCO Edit 8.
CIMCO Edit 8 is a famous CNC program editing and simulation tool. It can store and retrieve NC programs, NC program optimization, post-processing, and fast NC program simulation. The following figure (Figure 7) shows the simulation interface running in CIMCO Edit 8.
concrete components. The forming quality of the concrete components will be poor because every time the nozzle is raised, the cohesion of the material will lead to excessive concrete accumulation. The printing time of the concrete components will be longer because it has a linearly increasing relationship with the travel distance of the nozzle.

Simulation Printing Experiment
The algorithm is run on the MATLAB R2018 platform. However, it is unintuitive and complicated to record the running distance and the head-up times of the nozzle running path in the simulated printing experiments on MATLAB R2018. Therefore, it is necessary to perform the simulation printing experiments on CIMCO Edit 8.
CIMCO Edit 8 is a famous CNC program editing and simulation tool. It can store and retrieve NC programs, NC program optimization, post-processing, and fast NC program simulation. The following figure (Figure 7) shows the simulation interface running in CIMCO Edit 8. In the simulation experiments, it is necessary to import the concrete components model generated in Section 2.1 Sketch Up into CIMCO Edit 8 to determine the size of the concrete components and the starting point of printing. Then the nozzle running path is planned by several conventional algorithms. The algorithm in this paper is compiled into G code. Finally, the G code is imported into CIMCO Edit 8 to start the experiments. During In the simulation experiments, it is necessary to import the concrete components model generated in Section 2.1 Sketch Up into CIMCO Edit 8 to determine the size of the concrete components and the starting point of printing. Then the nozzle running path is planned by several conventional algorithms. The algorithm in this paper is compiled into G code. Finally, the G code is imported into CIMCO Edit 8 to start the experiments. During the experiments, the experimental distance and the head-up times of the nozzle (Table 1) running path are recorded.

Print Experiment
The feasibility and effectiveness of the algorithm in this paper can be verified more intuitively and better by the actual experiments carried out on the nozzle running path planned by the algorithm in this paper and the offset contour scanning algorithm.
It is necessary to import G-code into a 3D concrete printer in the actual experiments. The printer used for the test has a print range of 3 m × 3 m × 1.2 m (Figure 8). The nozzle size was 40 mm, the preset height of the single layer was 18 mm, the moving speed of the nozzle was 120 mm/s, while the extrusion speed was 200 r/min [23]. In the experiments, the running distance, printing time, and head-up times of the nozzle (Table 2) were recorded.
intuitively and better by the actual experiments carried out on the nozzle running path planned by the algorithm in this paper and the offset contour scanning algorithm.
It is necessary to import G-code into a 3D concrete printer in the actual experiments. The printer used for the test has a print range of 3 m × 3 m × 1.2 m (Figure 8). The nozzle size was 40 mm, the preset height of the single layer was 18 mm, the moving speed of the nozzle was 120 mm/s, while the extrusion speed was 200 r/min [23]. In the experiments, the running distance, printing time, and head-up times of the nozzle (Table 2) were recorded.

Experimental Validation
Idle strokes: During the experiment, we cannot directly measure the idle strokes of the nozzle. Therefore, the effect of this method on the idle stroke is judged by the total distance in which the nozzle operates, because for the same concrete member, the effective running distance of the nozzle (the distance required for the nozzle to extrude the material) is the same. It can be seen from Table 1 that the running path of the nozzle

Experimental Validation
Idle strokes: During the experiment, we cannot directly measure the idle strokes of the nozzle. Therefore, the effect of this method on the idle stroke is judged by the total distance in which the nozzle operates, because for the same concrete member, the effective running distance of the nozzle (the distance required for the nozzle to extrude the material) is the same. It can be seen from Table 1 that the running path of the nozzle planned by the parallel line scanning algorithm is the longest, which leads to its algorithm difficulty being the simplest compared to other algorithms, but it is rarely used. Although the nozzle running distance of the zigzag scanning algorithm is about 50% of the previous method, it still does not meet our expectations. The offset profile scanning algorithm has the shortest running distance of the nozzle among the three conventional algorithms, so it is currently the most widely used. The running distances of the nozzle planned by the method in this paper are 18.94%, 37.88%, and 66.67% of the other three algorithms.
Printing time: By combining Tables 1 and 2, it can be concluded that the running distance of the nozzle will greatly affect the printing time. The printing time of the method in this paper is 49.95% of the offset contour scanning algorithm, which is of great significance for 3D concrete printing.
The head-up times: It can be found from Table 1 that the method in this paper can greatly reduce the head-up times of the nozzle, which is 1.59%, 2.15%, and 8.69% of the previous algorithms. The influence of nozzle head-up on the forming quality of concrete components is huge because it will produce a local accumulation effect. At the same time, too many head-up times of the nozzle will cause the printing time to be too long.
Forming quality of concrete components: It can be seen from Figures 9 and 10 that the concrete components printed by the method in this paper are significantly better than the conventional methods in terms of forming quality. The head-up times of the nozzle does have a huge impact on the forming quality of the concrete components. We can see that there are many fractures in the concrete components printed by conventional methods. This is caused by the phenomenon of uneven extrusion material caused by the head-up of the nozzle in a short time.
Forming quality of concrete components: It can be seen from Figures 9 and 10 that the concrete components printed by the method in this paper are significantly better than the conventional methods in terms of forming quality. The head-up times of the nozzle does have a huge impact on the forming quality of the concrete components. We can see that there are many fractures in the concrete components printed by conventional methods. This is caused by the phenomenon of uneven extrusion material caused by the head-up of the nozzle in a short time.   too many head-up times of the nozzle will cause the printing time to be too long.
Forming quality of concrete components: It can be seen from Figures 9 and 10 that the concrete components printed by the method in this paper are significantly better than the conventional methods in terms of forming quality. The head-up times of the nozzle does have a huge impact on the forming quality of the concrete components. We can see that there are many fractures in the concrete components printed by conventional methods. This is caused by the phenomenon of uneven extrusion material caused by the head-up of the nozzle in a short time.

Discussion
Changing the running speed of the nozzle can also affect the printing time, but we did not do that. The reason is that the running speed of the nozzle can only be changed in a small range during the actual printing process; otherwise, a fracture surface will be generated inside the 3D concrete components. The consequence of this result is extremely serious and will change the interfacial force transmission path of the components. At the same time, the volume and shape of the final 3D concrete component are fixed no matter what method is used to print. This means that the required material and the path that the nozzle must run are the same during the printing process. Therefore, we focused our attention on shortening the unnecessary path of the nozzle run, also known as reducing the idle strokes; this will not change the shape and volume of the concrete components, but it can shorten the printing time.
The flowability of the material is an important factor that affects the forming quality of the concrete components. The means of influence is that when the nozzle needs to stop feeding, the concrete component will cause local accumulation or local surface fracture due to the fluidity of the material. For this problem, we choose to reduce the number of the nozzle needs to stop feeding (reduce the head-up times of the nozzle) to solve it. The benefit is obvious because no matter how strong or weak the material flowability is, the impact on the forming quality of concrete components during the continuous printing process is always relatively small. Reducing the number of nozzle head-ups ensures the continuity of the printing process. Of course, in actual printing, there are many factors that can affect the forming quality of concrete components; what we do is maximize the forming quality by changing the running path of the nozzle.
In the 3D concrete printing process, the formation of a complete concrete component requires the accumulation of materials layer by layer. This means that the time reduction and the local accumulation reduction of each layer will eventually accumulate when printing, and these reductions can be considered when printing large-scale components. In fact, many large concrete components cannot be printed due to the long printing time and large local accumulation. The method in this paper can provide a feasible printing path.

Conclusions
A path planning algorithm is proposed in this paper to optimize the problems of excessive printing time and poor forming quality in 3D concrete printing. In the algorithm, the commonly used concrete components in 3D concrete printing are taken as the research object. Shortening the printing time and improving the forming quality are the research goals; combined with the partitioning algorithm based on graph theory and the ant colony algorithm, the 3D concrete printing path is optimized, and the following conclusions are drawn: (1) Compared with the conventional path planning algorithm, the algorithm in this paper has more advantages. The idle strokes and the head-up times of the nozzle running path are significantly reduced when using the algorithm in this paper to plan the printing path. This effectively saves the printing time and significantly improves the forming quality of concrete components. (2) The algorithm in this paper is feasible and has specific practical significance. The final output results will be an array of coordinates when planning the nozzle running path according to the algorithm in this paper. Therefore, a corresponding printing program can be quickly written to perform actual printing.
However, the algorithm in this paper still has many limitations. Compared with the reinforcement learning algorithm, the algorithm in this paper has no significant advantages in planning the nozzle running path for the irregular concrete components. Therefore, how to use the principle of graph theory to split irregular concrete components into regular components will be our next research direction.

Patents
The work of this paper has published an invention patent.