Abstract
In wire arc additive manufacturing (WAAM)—classified as a wire-based directed energy deposition (DED-Arc or WA-DED) process under ISO/ASTM 52900:2021—the welding torch must follow a layer-wise deposition trajectory that connects hundreds to thousands of discretized nodes while limiting arc start/stop events and minimizing non-productive travel. Trajectory optimization therefore directly affects build time, thermal history, and overall bead quality. This paper formulates each layer as an open shortest Hamiltonian path problem over nodes extracted from the sliced geometry and applies the Dhouib-Matrix-4 (DM4) metaheuristic, which combines a constructive initialization stage (DM-TSP1) with an iterative Far-to-Near (FtN) neighborhood improvement stage to generate high-quality routes efficiently as the problem size scales. Three benchmark case studies from the literature validate the approach: (i) a prismatic layer with 303 nodes at 6 mm spacing, (ii) a denser geometry with 383 nodes at 3.03 mm spacing over six layers, and (iii) a topologically complex layer with two internal holes and 1072 nodes. DM4 achieves a per-layer length of 1785.57 mm in Case 1 (improving two baselines: 1817.72 mm and 1819.61 mm), 1094 mm in Case 2 (a 12.7% reduction over the Pixel strategy at 1253 mm), and 3072.62 mm in Case 3 (marginally above the continuous Pixel strategy at 3038.70 mm). The results confirm that DM4 is an effective and scalable option for WAAM toolpath generation on simply connected geometries, while the Case 3 outcome motivates topology-aware extensions for multi-region layers as immediate future work.
Keywords
Introduction
Wire arc additive manufacturing (WAAM)—known in the ISO/ASTM 52900:2021 standard as wire-based directed energy deposition (DED-Arc, also abbreviated WA-DED)—deposits near-net-shape metal components layer by layer using an electric arc and wire feedstock at high deposition rates and comparatively low equipment cost (Dehghan et al., 2025; Fourati et al., 2026; Kawalkar et al., 2022; Somonov et al., 2023; ISO/ASTM 52900:2021). These attributes make WAAM particularly attractive for large-to-medium-scale structural components, near-net-shape preforms, and repair applications where material efficiency and build-rate economics are priorities (Arefin et al., 2021; Donghua Zhao and Weizhong Guo, n.d; Schmitz et al., 2021). Despite its industrial promise, achieving repeatable geometry and stable mechanical properties at scale requires careful control not only of arc parameters but also of robot motion at the layer level—a combinatorial planning challenge that grows with geometric complexity (Kim et al., 2026; Sameh et al., 2025).
From a process-systems perspective, the WAAM robot must execute a deposition trajectory that visits hundreds to thousands of discretized nodes per layer while managing two coupled sources of inefficiency: non-productive arc-off travel between deposition points and arc start/stop events (Ge and Jin, 2023; Jafari et al., 2021). Both sources increase cycle time and energy consumption; more critically, speed changes, sharp direction changes, dwelling, and interruptions alter local heat accumulation and melt-pool behavior, influencing bead geometry, surface waviness, and start/stop defects (Efa and Ifa, 2025; Rayhan et al., 2025; Sarparast et al., 2025; Siddiqui et al., 2025; Uyen et al., 2023). Trajectory optimization in WAAM is therefore a productivity–quality lever rather than a purely geometric exercise.
A key insight from the process literature is that a shorter deposition path does not automatically imply a better-quality trajectory in WAAM (Sideris et al., 2024). Process quality is strongly governed by thermal history, deposition strategy, and local material accumulation (Nagallapati et al., 2023; Uyen et al., 2023; Wu et al., 2020). For thermally sensitive alloys such as aluminium, path strategy has been shown to significantly affect microstructure, residual stresses, and mechanical properties (Köhler et al., 2021; Seidler et al., 2026). Sharp direction changes in robot motion, specifically, are documented to cause over- or under-deposition due to torch velocity dynamics (Ding et al., 2021). The present work explicitly frames trajectory optimization as a first-step minimization of non-productive arc-off travel distance, acknowledging that full process-quality optimization requires multi-objective extensions that incorporate thermal and continuity constraints.
Within this context, combinatorial toolpath planning has been formulated as variants of the Travelling Salesman Problem (TSP) and addressed with metaheuristics including simulated annealing, ant colony optimization, clustering-assisted routing, and hybrid heuristics (Enriconi et al., 2025; Li et al., 2022; Liu and To, 2017). WAAM-specific strategies—pixel-based raster deposition, continuous scan patterns, region-based traversal, and contour-following paths—have been developed to reduce idle travel, exposing sensitivities to topology (particularly internal cavities) and intersection handling (Aremu et al., 2026; Malathi et al., 2025; S Wang et al., 2025). Thermal management research further confirms that deposition sequencing, interpass temperature control, and active cooling are inseparable from trajectory planning decisions (Bauer et al., 2022; Cervera et al., 2025; Kozamernik et al., 2020; Lin et al., 2026; W Wang et al., 2025; Wengang Zhai et al., n.d; Williams et al., 2016). The research gap addressed in this paper is the absence of a dedicated constructive-and-improvement metaheuristic for open-path WAAM routing that scales efficiently to large node sets while remaining straightforward to implement on sliced point clouds.
This paper applies the Dhouib-Matrix-4 (DM4) metaheuristic to WAAM layer-wise trajectory optimization and validates it on three benchmark geometries of increasing complexity (303, 383, and 1072 nodes per layer). The layer-wise routing task is formulated as an open Hamiltonian path problem, and DM4 combines a constructive initialization stage with an iterative Far-to-Near (FtN) neighborhood improvement stage. Comparisons with nearest-neighbor and random-contour heuristics (Case 1), the Pixel strategy (Cases 2 and 3), and a qualitative discussion of zig-zag and contour-based strategies across all cases are provided. The paper is organized as follows: Section 2 details the DM4 algorithm and its adaptation to WAAM; Section 3 presents the experimental setup and results for the three case studies; Section 4 provides a critical discussion of performance, limitations, and WAAM-specific process implications; Section 5 concludes with directions for future research.
The dhouib-matrix-4 metaheuristic
Background and prior applications
This study applies the Dhouib-Matrix-4 (DM4) metaheuristic to layer-wise trajectory planning in wire arc additive manufacturing. DM4 was originally developed to solve the Hamiltonian cycle problem for the symmetric Travelling Salesman Problem (TSP) using multiple instances from the OR-Library (Dhouib, 2024c). It was subsequently adapted to minimize non-productive movements of a Computer Numerical Control (CNC) hole-drilling machine (Dhouib, 2025b; Dhouib and Pezer, 2023), to generate Pareto non-dominated solutions for the multi-objective TSP (Dhouib, 2024d; Dhouib et al., 2024a), and to plan the trajectory of a mobile robot repairing a wireless sensor network (Dhouib, 2023). DM4 is part of the broader Dhouib-Matrix (DM) family, which also includes the DM-SPP shortest-path planner for autonomous mobile robots (Dhouib, 2024b, 2025a; Dhouib et al., 2026) and the DM-MSTP minimum spanning tree optimizer (Dhouib, 2024a; Dhouib et al., 2024b). Its adaptation to WAAM is motivated by the structural similarity between layer-wise deposition-node routing (an open Hamiltonian path over a dense planar point set) and the discrete combinatorial problems for which DM4 has demonstrated competitive performance.
Algorithm structure
DM4 is a multi-start metaheuristic. Each start consists of two successive stages: (i) an initial solution is constructed by the Dhouib-Matrix-TSP1 (DM-TSP1) greedy heuristic, which builds a tour in exactly n iterations (where n is the number of nodes) by selecting the next node according to a statistical metric computed over the remaining unvisited nodes; (ii) the constructed solution is then improved by the Far-to-Near (FtN) local search operator, which iteratively relocates the node farthest from its current neighbors to a lower-cost insertion position. Across multi-starts, a different statistical metric (e.g., mean, median, variance, range, coefficient of variation) is used at Stage (i) for each start, enabling diversified exploration of the solution space. The overall best solution found across all starts is returned as the output and is referred to herein as the ‘best-found path,’ without claiming global optimality—a distinction that is appropriate for any metaheuristic framework.
This formulation explicitly models the open-path nature of WAAM deposition: the torch starts at one node and ends at another without returning to the start, which distinguishes it from the classic closed-tour TSP. The complete algorithmic structure—including input data, DM-TSP1 construction stage, FtN local search stage, objective evaluation, termination criterion, and output—is illustrated in Figure 1. The general structure of DM4 metaheuristic.
Illustrative 100-node example
Figure 2 presents an illustrative example of DM4 on a synthetic 100-node instance (coordinates in arbitrary units) to clarify the algorithm’s route-construction and improvement behavior before the full-scale WAAM benchmarks. Figure 2(a) shows the input node distribution, and Figure 2(b) shows the best-found open path generated by DM4: the green circle marks the start node and the red circle marks the end node. The path length for this illustrative example is reported in arbitrary units consistent with the coordinate system used. This example is not a WAAM validation case; its role is pedagogical. The open loop trajectory (a) the 100 nodes shape (b) the shortest path generated by DM4.
Computational results
In this section, the DM4 metaheuristic is simulated on several case studies (see Figure 4) in order to test its performance to generate the shortest trajectory for Wire Arc Additive Manufacturing. These simulations are executed on DELL Laptop Intel® Core™ i7-1255U 1.70 GHz with a RAM of 16.0 Gb. Besides, DM4 is implemented using Python programming language (version 3.9) with Matplotlib library.
Three complicated case studies are considered. Each benchmark is subdivided into layers, and each layer is optimized as an open travelling salesman problem (shortest Hamiltonian path): the torch must visit all deposition nodes once while minimizing the total travel distance between successive nodes. This distance is a proxy for non-productive motion (arc-off travel) and thus directly impacts build time. The first case study contains 303 nodes per layer, the second uses 383 nodes per layer, and the third is the most complex with 1072 nodes per layer. Across all case studies, DM4 generates high-quality solutions with a limited amount of no-deposition travel.
Case study 1
Case study 1 is the prismatic layer discretized into 303 deposition nodes at a uniform 6 mm spacing, as proposed by (Ferreira and Scotti, 2021). We note that each node might be thought of as an arc-on deposition point (or a symbol of a short bead segment) which needs to be visited just once to fill the layer. In this paper, the planning problem is represented as the layer-wise shortest Hamiltonian path problem (open TSP); we must order 303 nodes that minimizes the cumulative travel distance between nodes, which translates to the non-productive phase (arc-off travel) and further accelerations/decelerations. Since the number of feasible sequences increases factorially with the number of nodes, simple constructive rules quickly get stuck on locally good but globally inefficient tours. Figure 3(a) shows the prismatic shape and Figure 3(b) presents the shortest path obtained by DM4 with distance of (1785.57 mm) on a layer. By a similar point of comparison (Ferreira and Scotti, 2021) gives an estimate of (1817.72 mm) by the random contour heuristic, and (1819.61 mm) by the nearest-neighbor heuristic. In order to assess DM4 at a realistic slicing condition, the layer is first discretized into a finite set of nodes indicating the realistic deposition locations along the contour and interior. The trajectory planning problem proceeds with finding an ordering which makes it to the node once and then minimizes the total in-plane travel distance between the nodes (the traveling-salesman-problem) to realize that the torch motion in a layer is as much continuous and efficient as possible (Ferreira and Scotti, 2021). This benchmark has moderate size (303 nodes) and a somewhat simple outer topology, presenting advantages in comparing how fast each solution converges to a good tour. The 6 mm node spacing results in a coarse but representative discretization for WAAM, where unnecessary detours translate into unnecessary arc-off moves, longer cycle time, and increased risk for heat accumulation at local re-starts. The first case study (a) the 303 nodes shape by layer (b) the shortest path generated by DM4.
Case study 2
Case study 2 considers a larger and denser discretization with 383 nodes per layer over six layers. The benchmark geometry, originally designed in (Ferreira and Scotti, 2021), has overall dimensions of 300 × 180 × 12 mm2 and uses a fixed node spacing of 3.03 mm, which increases the number of short-range alternatives and intensifies the combinatorial routing problem. From a WAAM perspective, the objective remains to visit all deposition nodes while minimizing arc-off travel, since excessive non-deposition motion increases build time and can introduce thermal discontinuities between adjacent beads. Figure 4(a) illustrates the prismatic shape, and Figure 4(b) shows the shortest trajectory generated by DM4 with a total distance of (1094 mm) per layer. As a baseline, the Pixel strategy of (Ferreira and Scotti, 2021) produces a longer trajectory of (1253 mm) per layer on the same discretization. The second case study (a) the 383 nodes shape by layer (b) the shortest path generated by DM4.
Case study 2 increases both the number of nodes and the spatial density of the discretization. The resulting search space is substantially larger than in Case study 1 because small changes in the visit sequence can create many short crossings and back-and-forth moves over the 300 × 180 mm footprint (Ferreira and Scotti, 2021).
In addition, the benchmark is defined over six layers, so a practical solution must be repeatable from layer to layer and should avoid long repositioning moves between layers. Minimizing the per-layer tour length is therefore a first proxy for reducing overall build time and for limiting the cumulative thermal load induced by repeated torch traversals over the same region.
Case study 3
Case study 3 is by far the tougher benchmark because the layer has two internal holes in addition to the external boundary which gives multiple contour areas to be connected by arc-off travel. The model has 6 layers and each layer is made up of 1072 nodes, which greatly increases the problem size and the probability of long non-productive jumps between sub-regions if the visit order is poor (Ferreira and Scotti, 2021). Such jumps correspond to torch movement inside the part or between internal and outer contours, and in practice they are unwanted because they prolong cycle time and may necessitate frequent start/stop events. The goal of the optimization is to sequence the outer boundary and the two hole contours in such a way that limits transitions between regions while still visiting each node once. Figure 5(a) depicts a prismatic shape and Figure 5(b) illustrates DM4 trajectory for a distance of (3072.61 mm) per layer. For comparison (Ferreira and Scotti, 2021) reported a Pixel strategy of (3038.70 mm) per layer which signifies that topology-aware continuous strategies are beneficial on highly complex layers. The third case study features a non-convex topology having two interior holes. The 1072 nodes per layer results in a huge combinatorial instance, in which the tour must be able to cover multiple boundary segments and also respect the void regions that must be negotiated (i.e., avoiding shortcuts that would cut through the holes) (Ferreira and Scotti, 2021). From a WAAM standpoint, these internal features are challenging as they tend to require sharp turns and frequent changes of direction (to the point of magnifying a bead’s start/end defects or local heat concentration). This benchmark is, therefore, indicative of the industrial environments that the toolpath can be used in each segment in the interest of geometric feasibility, continuity, and reduction of travel-distance on a large scale. The third case study (a) the 1072 nodes shape by layer (b) the shortest path generated by DM4.
Discussion
Performance pattern across case studies
The three benchmark cases reveal a clear and interpretable performance pattern for DM4. In Cases 1 and 2—both simply connected geometries with spatially uniform node distributions—DM4 generates the shortest total path among all compared methods, improving by approximately 1.8% over two baseline heuristics (Case 1) and by 12.7% over the Pixel raster strategy (Case 2). In Case 3, a multi-region topology with two internal holes, DM4 yields a total path length 1.1% longer than the Pixel strategy. This outcome is consistent with DM4’s algorithmic design: the multi-start constructive-and-improvement approach is well suited to routing over simply connected, uniformly distributed node sets, where statistical diversification across starts effectively avoids local optima. In multi-region topologies, however, the routing problem contains additional structure in the form of mandatory inter-region arc-off transitions that DM4’s current formulation does not explicitly exploit.
Why DM4 underperforms in case 3
The fundamental reason for DM4’s relative underperformance in Case 3 is the presence of two internal holes that partition the layer into three disconnected feasible regions: the outer boundary region and two inner hole contours. Any open Hamiltonian path must cross between these regions at least twice, and each crossing corresponds to a mandatory arc-off segment. DM4, as a general-purpose combinatorial optimizer, treats all inter-node distances equally and therefore does not distinguish between intra-region and inter-region transitions. The Pixel strategy, in contrast, is designed to cover each region continuously using raster sweeps before switching to the next region, which minimizes the number and length of inter-region jumps. This analysis identifies a concrete architectural extension for DM4: a topology-aware region-sequencing pre-processing step that first determines the ‘best-found path’ order in which to visit the distinct contour regions, and then applies DM4 (or an equivalent intra-region optimizer) within each region. This extension is directly motivated by strategies developed for multi-region intersection handling in aluminium WAAM (Kelly et al., 2025).
Process implications: Beyond distance minimization
A critical consideration in WAAM trajectory optimization is that minimizing arc-off travel distance is a necessary but not sufficient condition for trajectory quality (Sideris et al., 2024). Process quality is strongly governed by thermal history, bead continuity, and local material deposition patterns (Nagallapati et al., 2023; Uyen et al., 2023; Wang et al., 2025). Shorter non-productive travel reduces build time and limits cumulative heat input from repeated torch traversals, which supports thermal management objectives (Reis and Da Silva, 2025). However, the shape and directional characteristics of the productive path also influence local heat distribution, residual stresses, and distortion (Mauthner et al., 2025; Zhao et al., 2024).
Sharp direction changes in the trajectories generated by DM4—particularly at boundary transitions and near internal features—are a documented source of over- or under-deposition in WAAM, arising from torch velocity dynamics and arc behavior at corners (Ding et al., 2021). This effect is more pronounced in the multi-hole topology of Case 3, where direction reversals are frequent. For thermally sensitive materials such as aluminium and magnesium WAAM alloys, trajectory choices have been shown to significantly affect microstructure, residual stresses, and mechanical properties (Köhler et al., 2021; Seidler et al., 2026); such materials impose stricter smoothness requirements on the deposition path than steel alloys. Future DM4 formulations should incorporate a smoothness penalty (e.g., weighting path segments by direction-change angle) and an arc start/stop penalty to produce trajectories that are both distance-efficient and process-quality-aware.
Furthermore, the relationship between path length minimization and thermal management merits explicit discussion. While shorter arc-off travel reduces the time the torch spends traversing non-deposition regions, the productive path sequence determines the spatial distribution of heat input. A path that revisits the same region repeatedly in a short time interval can cause local overheating, whereas a path that distributes deposition more uniformly allows passive cooling between visits. Integrating a fast temperature prediction model—such as the dexel-based approach of (Mauthner et al., 2025) or the data-driven predictors of (Reis and Da Silva, 2025)—directly within the DM4 optimization loop would enable thermally constrained trajectory generation, making the approach genuinely process-aware.
Comparison with zig-zag and contour-based strategies
Zig-zag (raster) scanning is the simplest and most widely used WAAM deposition strategy: the torch traverses the layer in alternating parallel passes with fixed direction reversals at the boundaries. While straightforward to program, raster strategies generate systematic boundary reversals that accumulate arc-off travel and are unable to exploit the spatial distribution of deposition nodes to reduce total path length. Contour-based strategies follow the geometric boundaries of the deposited layer in closed loops, offering excellent continuity for perimeter beads but requiring complementary infill strategies for interior fill regions. DM4 occupies a complementary niche: it is a global combinatorial optimizer that directly minimizes arc-off travel over the full node set, making it most naturally suited to interior fill routing after boundary contours have been pre-planned—a role where its advantages over raster scanning are most pronounced (as demonstrated in Case 2).
Robotic feasibility and node spacing sensitivity
The trajectories generated by DM4 consist of straight-line segments between successive deposition nodes, which are directly executable in Cartesian space by a standard WAAM robot controller. However, sharp angular direction changes at certain nodes—particularly at boundary transitions and internal hole contours—may require velocity reduction to maintain bead geometry, potentially increasing effective cycle time beyond what the distance metric alone suggests. Kinematic feasibility assessment (incorporating acceleration limits and minimum cornering radius) is an important practical extension for future work.
Regarding node spacing sensitivity, the comparison between Case 1 (6 mm, 303 nodes) and Case 2 (3.03 mm, 383 nodes) illustrates that finer discretization increases both the combinatorial search space and the density of short-range improvement opportunities available to FtN. DM4’s computational complexity per start scales as O(n2) for the FtN local search stage, rendering it tractable for the node counts tested. Observed runtimes—under 5 s for Case 1, approximately 12 s for Case 2, and approximately 45 s for Case 3—confirm practical scalability for typical WAAM layer discretizations. Sensitivity analyses at intermediate node spacings (e.g., 4 mm, 5 mm) are reserved for future work to more precisely characterize the trade-off between discretization resolution and computational cost.
Limitations and future research directions
The current formulation of DM4 for WAAM has three primary limitations. First, the single-objective formulation (minimize total arc-off travel distance) does not account for thermal constraints, path smoothness, or arc start/stop frequency—all of which are critical for WAAM process quality. A multi-objective extension incorporating these criteria is the most impactful next step. Second, the absence of topology-aware region sequencing causes underperformance on multi-region geometries (Case 3); addressing this requires a hierarchical pre-processing stage as discussed in Section 4.2. Third, the benchmarks used are computational rather than experimental; validation against physical WAAM builds with bead quality and distortion measurements would strengthen the practical claims of the method.
Future research will therefore focus on: (i) multi-objective DM4 for WAAM, jointly minimizing arc-off travel, direction-change penalties, and arc start/stop frequency; (ii) topology-aware region sequencing as a pre-processing layer; (iii) integration of fast temperature prediction models within the toolpath optimization loop (Mauthner et al., 2025; Reis and Da Silva, 2025); (iv) adaptive, feedback-driven process frameworks that couple DM4 with real-time thermal sensing (Khrais et al., 2023); and (v) data-driven learning from process outcomes to refine path-quality objectives (Efa and Ifa, 2025). These extensions will be validated on geometries with experimentally characterized bead quality, residual stress, and distortion to connect combinatorial trajectory optimization with measurable WAAM process outcomes.
Conclusions
This paper demonstrated that the Dhouib-Matrix-4 (DM4) metaheuristic is an effective and scalable approach for minimizing non-productive arc-off travel in WAAM layer-wise trajectory planning, particularly for simply connected geometries. DM4 combines a constructive initialization stage (DM-TSP1) using multiple statistical metrics for start diversification with a Far-to-Near (FtN) local search improvement stage, formulating WAAM layer routing as an open Hamiltonian path problem. Three benchmark case studies confirmed its performance: • Case 1 (303 nodes, prismatic layer): DM4 achieved 1785.57 mm/layer, improving over the nearest-neighbor heuristic (1819.61 mm) and the random contour heuristic (1817.72 mm) by approximately 1.8%. • Case 2 (383 nodes, dense layer, 6 layers): DM4 achieved 1094 mm/layer, a 12.7% reduction over the Pixel raster strategy (1253 mm/layer). • Case 3 (1072 nodes, two internal holes, 6 layers): DM4 yielded 3072.62 mm/layer, marginally above the Pixel strategy (3038.70 mm/layer, −1.1%), with the performance gap attributed to mandatory inter-region arc-off transitions in the multi-hole topology.
The results also established that minimizing arc-off travel distance is a necessary but not sufficient condition for WAAM trajectory quality: thermal history, arc start/stop frequency, and path smoothness must also be addressed in a complete planning framework. Future research will extend DM4 toward multi-objective WAAM trajectory optimization incorporating thermal constraints (via fast temperature prediction models or adaptive feedback-driven frameworks), topology-aware region sequencing for multi-hole geometries, smoothness and arc start/stop penalties, and data-driven refinement of path-quality objectives. Physical validation against WAAM builds with measured bead quality and distortion data will further anchor these computational results in real process outcomes.
Footnotes
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Author biographies
