Network Flow based approaches for the
Pipelines Routing Problem in Naval Design
Abstract.
In this paper we propose a general methodology for the optimal automatic routing of spatial pipelines motivated by a recent collaboration with Ghenova, a leading Naval Engineering company. We provide a minimum cost multicommodity network flow based model for the problem incorporating all the technical requirements for a feasible pipeline routing. A branch-and-cut approach is designed and different matheuristic algorithms are derived for solving efficiently the problem. We report the results of a battery of computational experiments to assess the problem performance as well as a case study of a real-world naval instance provided by our partner company.
Key words and phrases:
Pipeline Routing, Network Design, Branch-and-Cut, Matheuristics, Naval Engineering.1. Introduction
The design and construction of ships is a complex procedure that starts with a concept design phase. In the concept design, all the necessary ship construction requirements are determined, in order to meet the client needs. Next, in the basic design phase of the ship structure, piping and electrical circuits are defined and all the different equipment are adequately selected. In this phase, one of the most difficult tasks is to determine the pipeline route design in which one has to determine the paths of the different services attending to a series of technical requirements. Pipeline routing requires the coordination of different elements of the ship, as the routing of electrical circuits, water pipes and optical fiber, the prevention of traversing forbidden obstacles, the assuredness of the adequate space for handling the machinery, among many others, all of them having to guarantee the compatibility and the manufacturability technical requirements. Although there are some available tools to help the designers on this task, the difficulty of the problem makes that an expert is still necessary to guide the design to a desired final product. Usually, there are some specifications regarding the number of main lines, branches to be connected to the main lines, valves, etcetera that have to be considered (see e.g. [Cuervas et al., 2017]). Once the initial technical requirements are determined, the pipeline routing problem must be solved following these specifications. The main limitations of the pipeline routing problem on a ship can be classified in three types (see [Ando and Kimura, 2011, Park, 2002, Qian et al., 2008]):
- Physical Constraints::
-
The path followed by the pipelines must avoid physical obstacles and connect with the adequate equipment.
- Operational Constraints::
-
The routes must consider accessibility for handling equipment and valves slackness for security. In addition, some zones in the decision space are more desirable than others, as bottom spaces in a cabin that may be used for storing other types of materials.
- Economic Constraints::
-
There is a limited budget both for the material and workforce cost. Thus, it is necessary to reduce the pipe lengths, as well as the use of elbows in the design.
Some of the above mentioned requirements must be imposed to design feasible routes, while others can be quantified and reflected in a cost function in order to evaluate the different feasible alternatives and decide the most favorable. Nevertheless, defining adequately such a function implies including elements of different nature as material and workforce costs, use of elbows, routes passing through preference zones and holes, etc.
There exist a few software tools (as AVEVA, FORAN or SMART3D, among others) that may help industrial designers for the development of this work. However, even those tools that incorporate some automatic routing functionality are still limited to consider all the technical requirements of this real-world problem being them more adequate for industrial plants. Furthermore, the underlying algorithms of these modules do not allow to incorporate the different specificities for the design of a ship, and then, in most cases the solution is not valid for the naval designer. In other cases, the decision aid tools are extremely specialized, not being flexible enough for the design of networks of different characteristics.
The goal of this paper is to derive an efficient mathematical programming based methodology for the automatic design of pipeline routes that take into account the different technical specificities of a naval design, but still flexible enough to be adapted to different situations and constructibility criteria that appear in real-world situations as the one that motivated this study.
Automatic pipeline routing has been already addressed in the literature (see for instance, [Guiradello and Swaney, 2005, Kimura, 2011, Min et al., 2020, Park and Storch, 2002, Singh and Cheng, 2021]). One of the most crucial steps in this problem is the description of the set of feasible routes for the pipes. Although the problem is initially stated in a continuous framework, with routes that are allowed to be traced in a continuous three-dimensional region, the mathematical problem is intractable in this form (one would need to locate a set of complex three-dimensional paths on a continuous space). Thus, a discretization of the whole space into a finite set of feasible routes is needed also because the tractability of the problem and the simplicity of the obtained routes. One of the possible options is to discretize the space by cell decomposition. In [Lee, 1961] the author proposed to subdivide the region into squared cells and those containing obstacles are removed. Several authors have used that scheme to derive algorithms for solving shortest path problems in continuous regions [Hightower, 1969, Mitsuta et al., 1986, Rourke, 1975, Schmidt-Traub et al., 1999]. This approach has been also adapted to solve the pipeline routing problem [Ando and Kimura, 2011, Asmara, 2013, Asmara and Nienhuis, 2006, Kim et al., 2013, Zhu and Latombe, 1991]. However, this method requires a high number of cells in the subdivision to get accurate solutions of the problem. To overcome this situation, one may also discretize the space by means of a graph structure [Guiradello and Swaney, 2005, Newell, 1973, Shing and Hu, 1986]. Both approaches, cell subdivision and graph generation can be also adequately combined to derive efficient approaches in pipeline routing [Park and Storch, 2002].
Once the space is adequately discretized, there are several heuristic approaches that have been proposed to solve the pipeline routing problem. Most of them are genetic algorithms [Ikehira et al., 2005, Ito, 1999, Kimura, 2011] or ant colony algorithms [Xiaoning et al., 2006, Xiaoning et al., 2007].
In this paper we will consider a graph-based discretization of the space that allows us to use Combinatorial Optimization tools for efficiently solving the problem. The graph is generated taking into account the shape of the region and obstacles, the positions of the source and destination points of the pipes, the size of the pipelines, the preferred zones and penetrable zones (holes through which some obstacles can be traversed), and other characteristics of the pipes to route. Firstly, we generate the nodes of the graph using highlighted points (source and destination points, corners, holes, …) and also intermediate points by means of a grid with a desired width. Secondly, we define the edges of the graph by linking the close-enough nodes. Finally, each edge is provided with a set of weights (one for each pipeline to route) representing the different costs of using it in a path.
On the basis of this idea our main contributions are:
-
(1)
We discretize the continuous three-dimensional space by using a graph-based framework that allows searching for pipeline routes taking into account the obstacles and the use of elbows in the routes.
-
(2)
We propose a multicommodity network flow based model for the problem that incorporates the different physical and operational limitations of the routing. In particular, the minimum allowed distances between consecutive elbows and separation between services. We provide a particular branch-and-cut approach for the problem.
-
(3)
We propose a flexible assessment function to evaluate feasible routes that take into account the different specificities that appear in real-world naval design: length of the paths, preference zones, closeness to ceilings/floors, use of elbows, crossing penetrable zones, etc.
-
(4)
We develop different matheuristic algorithms able to solve realistic instances of the problem in reasonable CPU times.
To present our contribution we have organized the paper in six sections. Section 2 describes the main elements involved in the pipeline routing problem and their mathematical representation. Section 3 is devoted to present the mathematical programming model that we propose for solving the pipeline routing problem imposing naval design technical requirements. In Section 3.1 a branch-and-cut method is proposed in order to incorporate complicating constraints as they are required, instead of considering, initially, all of them. Two families of matheuristic algorithms are provided in Section 4 to solve large-sized instances. In Section 5 we report the results of our computational experiments. There, we also include a case study based on real data provided by our industrial partner. Finally, we derive some conclusions and future lines of research is Section 6. We have included an Appendix to gather all the pseudocodes that describe the details of our algorithms.
2. The Pipeline Routing Problem in Naval Design
The goal of this paper is to model and solve the problem of how to route different pipelines on a ship competing for a reduced space taking into account the adequate technical requirements. In what follows we describe the main elements of the problem: input data, feasible actions and assessment of a particular solution.
We assume that the underlined region where the pipelines are to be routed is represented by a bounded polyhedron, , in . In real-world situations, the polyhedron is usually a cuboid in the form , representing a cabin in the ship. We are also given a finite set of regions that represents obstacles that cannot be traversed by a pipeline route. For the sake of simplicity, these regions will be also identified with cuboids. Thus, the three-dimensional region where the pipelines are allowed to be traced is . In addition, we are given a finite set of services (cylindrical pipelines) each of them represented by the coordinates of a source and a destination point (both in ), a radius (of the cylindrical pipeline), and a safety minimum allowed distance with respect to other services. Our approach can be easily adapted to other shapes of pipelines, as parallelepipeds (with rectangular sections).
The main decision to be taken in this problem is to determine the set of (dimensional) paths in that each one of the services must follow. Initially, a feasible path for a service will be a continuous union of segments in starting off from its source point and reaching its destination point. In addition, a minimum required distance must be ensured between two consecutive breakpoints (elbows) by constructibility reasons. Furthermore, once a feasible path for each service is traced, and once a dimensional pipeline is traced around the path, one has to ensure that a minimum required distance between the different services is respected. In particular, the pipelines are not allowed to cross or to overlap in a solution.
The quality of a suitable solution of the problem, given by a set of feasible paths, is evaluated with respect to different criteria. Apart from the length, which is proportional to costs, one also looks for paths with small number of elbows, close to the ceiling of the region or traversing pre-specified preference zones.
In what follows we describe the mathematical representation of the elements involved in the Pipeline Routing Problem in a Ship (PRPS) that we analyze.
In order to discretize the continuous space , first, an orthogonal 3D grid is built on the big parallelepiped , assuring that source and destination points of each service are nodes of the grid and that they are connected with other nodes of the grid. This grid defines a baseline undirected graph to which nodes and edges intersecting regions , for , are removed. In Example 1 we show a simple instace for the problem.
Example 1.
In order to illustrate the procedure described in the paper we include an example of a scenario with an obstacle and three services (see Figure 1 (left)). The scenario is a box with dimensions with an interior obstacle (box) of dimensions located in the center of the box representing a pillar. The discretized space of solutions is given by a three-dimensional orthogonal grid from which the corresponding portion that is within the obstacle has been removed (see Figure 1 (right)).

However, when tracing a path in such a graph, one is not able to detect or penalize the use of elbows. Elbows in a pipeline must be adequately identified in its route both because constructibility and also because routes with a smaller number of elbows are preferred. The goal is to obtain a mathematical programming model for the problem that avoids non-linearities. In order to consider elbows in a linear objective function in our model, we modify the initial graph by exploiting the nodes of the graph as follows:
-
(1)
Each physical node in the initial graph is replaced by an exploited node, i.e., a set of three virtual nodes, with the same 3D coordinates than , one for each direction of the canonical basis of (X, Y and Z).
-
(2)
Virtual nodes associated to the same physical node are linked through the so-called virtual edges. Their lengths are zero (since they link nodes with the same coordinates), but they will have a positive cost representing the usage of an elbow in the route.
-
(3)
Each physical edge in the initial graph is replaced by another edge with the same length as the physical one, where instead of joining two physical nodes, it connects two virtual nodes (associated to the same physical end nodes of the original edge). Specifically, each edge is linked to the virtual nodes identified with its direction. In this way, edges parallel to the X-axis link -virtual nodes, edges parallel to the Y-axis link -virtual nodes, and edges parallel to the Z-axis link -virtual nodes.
In Figure 2 we show an illustration of this explosion of nodes. In the left picture we show a crossing node, , which is linked in the graph to other six nodes. In the right picture we show the three exploited nodes, , and , of node . Node (resp. , ) is linked only to the two adjacent nodes which are linked with edges parallel to the -axis (resp. -axis, -axis) and with the others two virtual nodes associated with the same physical node. As we can see, the three virtual edges linking with , with and with are drawn with dashed lines in this picture.
In Figure 3 we illustrate the use of this graph to model different types of turns in a path. In the left picture, to go from to no elbows are used and a single exploited node () is used. On the other hand, in the center (resp. right) picture, turning from an edge parallel to -axis towards an edge parallel to -axis (resp. -axis) requires traversing the virtual edge (resp. ) incurring in a cost for using that elbow. The result is a graph representing the feasible space where routing the pipelines.
We denote by the graph constructed as described above where is the set of (virtual) nodes and the set of edges. Set includes the set of virtual edges, denoted by , and the replicas of the physical initial edges. Since is embedded in , each node is also identified with its coordinates, . We denote by the Euclidean distance between nodes and by the Euclidean distance between the edges (representing either, a point in if or a segment in if ).
We assume that we are given a finite set of commodities, , each of them requiring its own pipeline to determine the design of its route. Each commodity is defined by a pair where is the source of the commodity and is the destination of the commodity. Depending on the commodity , a cost structure, for each , is defined over the edges of the graph. These costs depend on many factors as for instance, the length of the edges, the elbow costs, the preferences of the designer when routing the pipelines, etc. A detailed cost structure will be described in Section 5.2 for the case study we deal with in this work.
3. A multicommodity network flow based model
In this section we describe the mathematical programming model that we propose for solving the PRPS imposing naval design technical requirements. In a first approximation, one can model the problem as a minimum cost multicommodity network flow problem (MCMNFP, for short). Let us denote by (where is the arc set) the directed version of the graph described in the previous section. Similar to the non-directed version, we assume that set includes the set of virtual arcs, denoted by , and the replicas of the physical arcs. We also denote by the Euclidean distance between the arcs (notice that if and are the arcs corresponding to the two opposite directions of the same edge). In addition, we assume that, for each commodity , the cost of each arc is , where .
The goal of MCMNFP is to route jointly all the commodities in from their respective sources, , to their destinations, , through the network at minimum cost. This model has been widely studied in the literature (the interested reader is referred to [Salimifard and Bigharaz, 2020] and the references therein for further details on the MCMNFP).
In order to describe the mathematical programming model for the MCMNFP, we use the following set of binary decision variables:
With this set of variables, the overall cost of routing the commodities through the network can be expressed as:
The following set of linear constraints ensures the correct representation of the problem:
() | ||||
() | ||||
() | ||||
() | ||||
() |
where () assures that only one commodity is routed through a node and in particular, through an arc, ()-() are the flow conservation constraints and () is the domain of the variables.

The solution of MCMNFP is a set of paths (one for each commodity) connecting sources with destinations that do not overlap on the graph . The reader may observe that in the graph each physical node has been replaced by three virtual nodes on the same coordinates. This explains that in Figure 4 (left) some paths occupy the same space although they do not actually overlap on .
This problem is known to be -hard, even for the case of two commodities (see [Even et al., 1975]). Additionally, in pipeline routing there are two main technical requirement that must be considered in order to construct feasible designs: a minimum distance between the pipelines and a minimum distance between consecutive elbows in a single pipeline. The first requirement allows to adequately separate the different services to be used by the pipelines (and such that, when they are enlarged to represent dimensional pipes, they fit on the space) as well as to keep space for the manipulation of machinery in the ship cabins. The second one, is a physical limitation of pipeline routing since there is not enough space for a pipe to turn twice in case consecutive elbows are positioned too close. Note that solutions consists of segments in with no dimensionality and therefore, these considerations are not taken into account in the MCMNFP. Thus, to impose those technical requirements the following constraints must be added to the problem in order to adequately model the PRPS:
-
(1)
Distance between Services:
Given an (non-virtual) active edge for a service , a minimum distance with respect to other services is required. Let be the radius of the cylinder of pipeline and let be the minimum security distance from to any other element. Then, the minimum distance allowed between services and is .
This requirement is assured imposing the following set of constraints:
() that is, if is an active arc in the path of service , then, no arc in the path of any other service can be activated at a distance smaller than the minimum required. Here, fixed and , is a big enough constant (greater than times the number of the grid edges contained in the cuboid centered at midpoint of arc and with edge length ).
-
(2)
Elbow Test:
A feasible path for a service, , is required to verify a minimum distance between consecutive elbows, , of this single service. Since elbows are identified in the non-directed graph with virtual edges and then, with virtual arcs in the directed graph, this requirement can be incorporated to the model as follows:
() that is, if two different virtual arcs (elbows) of the same service are at a distance smaller than or equal to , then only one of them is allowed to be active.
Example 2 shows the effects of considering constraints () and ().
Example 2 (Example 1 - continuation).
Let be the grid depicted in Figure 1 (right). Grid is a simplification of the actual graph used to solve the problem because in the final graph a directed version is considered and each of the nodes in the grid is replaced by its explosion as explained in Section 2.
We have solved the Example 1 scenario with the multicommodity model with and without the additional modelling constraints () and (). Observe that the paths without additional modelling constraints do not respect the conditions about distances and thus a much shorter solution is provided (see Figure 4 (left)) than in the case in which the technical requirements imposed by means of constraints () and () have to be fulfilled (see Figure 4 (right)).
Figure 5 shows the final solution with dimensional pipelines of the given pre-specified radii.
Figure 5. A graphical display of the solution of Example 1 with the final pipelines of the three services and their actual radii Note that constraints () can be reinforced as follows. Given a virtual arc , we denote by , namely the set of arcs linking virtual nodes associated to the same physical node as the one linked by . Clearly, if , all the arcs in and are incompatible and then cannot take simultaneously a value of . Thus,
()
With the above considerations, the PRPS can be formulated as:
() | ||||
s.t. | ||||
Problem () is a minimum cost multicommodity network flow problem with additional constraints that enforce the fulfillment of the technical requirements for the pipelines in the solution. Although the problem is modeled as an Integer Linear Programming Problem, in real-world situations it has a large number of variables () and a large number of constraints. In particular, the technical constraints () and () place a considerable load on the model ().
3.1. An exact solution method for ()
The large dimensions of our model makes the straightforward approach of putting it into a MIP solver not possible even for small-sized instances. We overcome this drawback using a branch-and-cut method that incorporates the constraints as they are required, instead of considering initially all of them. This strategy allows an efficient exact solution approach of the problem by means of solving an incomplete (relaxed) formulation with only some of the constraints in the model, while the remaining constraints, required to assure the feasibility of the solutions, are incorporated on-the-fly as needed. Although in the worst case situation, the procedure may need all the constraints not initially included, in practice, only a small number of them are added, reducing considerably the size of the problem.
Specifically, we consider, in the beginning, the relaxed master problem (1):
() | ||||
s.t. |
The above problem is nothing but the multicommodity network flow model that does not consider the two families of technical constraints that are required for a feasible solution of our problem. Thus, when solving (), one may obtain solutions which do not satisfy constraints () and/or (). Therefore, each obtained solution must be checked for feasibility. To separate the violated constraints, we apply an enumerative procedure and those which are violated are added to the pool so that the problem is solved again (cutting off the previously obtained solution).
More specifically, for a given solution of the relaxed master problem, we check whether it violates () and/or () as follows:
-
•
To check the violation of any of the constraints in () we proceed by measuring the distance between two arcs from different commodities in the solution or the distance between an arc from a commodity in the solution and obstacles’ edges. If the distance measured is smaller than the sum of the radius of both commodities plus the security distance between them, the constraint is violated. In case it is violated for a service and , the constraint is added to the constraint pool of the master problem.
-
•
The violation of the constraints () is tested by first ordering virtual arcs within each commodity in the path given by the current solution and then measuring the distance between two consecutive virtual arcs in the path. If the distance measured is smaller than the minimum required distance between elbows for this commodity then the constraint is violated. In this case, this particular constraint (in its reinforced version) is introduced as a feasibility cut to the set of constraints of the problem.
For a more efficient implementation of the procedure, it is embedded in the branch-and-bound tree by means of lazy cuts, resulting in a branch-and-cut strategy for solving the problem.
4. Two matheuristic algorithms for the
In order to solve the pipeline routing model presented in Section 3 one has to solve a MILP problem. However, in most cases of real-world situations, due to their large number of variables and constraints, the corresponding problem cannot be solved by a commercial solver (and in many cases it cannot be even loaded). For this reason, we provide in this section two families of matheuristic algorithms for the problem based on two different paradigms: reducing the dimension of the MILP model and decomposing the problem into simpler problems. The pseudocode of both algorithms is included in A.
4.1. Dimensionality Reduction
Recall that we assume that the underlined region where the pipelines are to be routed is represented by a bounded polyhedron in , and that in real-world situations, the polyhedron is usually a cuboid representing a cabin in the ship where some other smaller cuboids (obstacles) have been removed. In addition, there are zones of such a region that are rarely used by the paths in the solutions (by all or some of the services). We exploit this fact in order to reduce the number of variables of our model.

We propose an iterative procedure that starts by considering some tentative areas as candidate zones for searching for the solution (called in the pseudocode Init-Sol) and then solving the multicommodity flow problem with additional () constraints for each single commodity to determine the best solution for each service independently of the remainder services. Then, for each commodity we consider a parallelepiped of a given initial dimension around the obtained path and instead of solving () in the whole graph, we solve the problem in the union of these parallelepipeds together with the initial candidate zones (see Figure 6 (right)). We do this by fixing to zero the variables indicating arcs outside the above mentioned regions. In case the problem is feasible, it provides a solution of (). Otherwise, the dimension of the parallelepipeds is increased and the procedure is repeated until feasibility is obtained. Although in the worst case situation the algorithm requires solving the original instance of the problem (the whole graph), in practice, it allows to solve the problem with a considerably smaller number of variables. Algorithm 1 in A.1 provides a pseudocode for this procedure.
4.2. Decomposition-based algorithms
Note that when removing the capacity constraints, (), from MCMNFP, the problem can be decomposed in single-commodity network flow problems with unitary demands which are equivalent to solve shortest path problems on the undirected graph , and then, solvable in time by the classical Dijkstra algorithm [Dijkstra, 1959]. Based on this idea, we propose an algorithm that exploits the use of this decomposition for solving fast and accurately the PRPS. Algorithm 2 in A.2 shows the pseudocode of this algorithm.
First, the algorithm considers a sorted list of all the commodities (pipelines to route), , and a maximum number of iterations to perform, maxit. The iterations are grouped in three different classes: parallel iterations (I_par), sequential iterations (I_seq) and cluster iterations (I_cluster), such that the three sets define a partition of .
The main scheme for all the iterations is similar. At each iteration , a shortest path is built for each commodity included in the sorted list trying to pass the elbow test, i.e., the minimum required distance between consecutive elbows in the paths (constraints ()). This path is constructed using the procedure SPP_Pipe_Elbow_Test (Algorithm 3 in A.2). In this procedure, for each commodity , a shortest path from the source node to the destination node is initially built on the undirected graph using Dijkstra algorithm (). In case the elbow test is passed, SPP_Pipe_Elbow_Test returns that path. Otherwise, the part of the path that passes the test is kept, the cost of the first elbow that does not pass the test is increased and Dijkstra algorithm is run again (with the new costs) from the last elbow passing the test to the destination node (updating the source node for ). The process is repeated every time we find an elbow that does not pass the test. If we identify the process is cycling we initialize it maintaining the increased costs and taking the source node of the commodity as destination node and viceversa. This last step is repeated until the elbow test is passed or until a maximum number of iterations (of the elbow test) is reached and then, the elbow test has not been passed.
The second step consists of avoiding overlapping of paths in the solution. This phase is different for each of the types of iterations that we consider. In the sequential iterations paths for commodities are solved one by one in the sorted order and therefore, the sorting of the commodities affects the solution. In these iterations, once the path for commodity is solved, this path is kept, commodity is removed from the list of sorted commodities and overlapping is avoided by increasing for the remaining services in the list, the cost of the edges in conflict, that is, the edges at a distance lower or equal than from the edges used in the path of service . They can be tested using Algorithm 4 described in A.2.
In the parallel iterations the paths for commodities are solved independently and the overlapping phase is addressed once all the paths are constructed by increasing the cost of the edges in conflict. In the cluster iterations, paths for all the commodities are solved initially in parallel. The commodities that do not overlap with any other are removed from the set of commodities and their paths are kept. The remainder commodities are organized in clusters of services with edges in conflict and they are sorted by some prefixed measure, as for instance, increasing length of their paths. The first sorted commodity of each cluster is removed for the set of commodities and their path is kept. The cost of the edges in conflict with the paths that are kept is increased for the commodities remaining in and these commodities are solved in parallel. The process is repeated until or until the maximum number of iterations is reached.
Note that, for all types of iterations, each iteration is performed with a new set of costs for the edges, trying to avoid the use of conflicting edges in the solutions for the next iteration.
5. Computational experience
Next, we report on the results of some computational experiments that we have run, in order to compare empirically the proposed exact and heuristic approaches.
5.1. Random instances
The set of random instances are generated as follows. We choose as a cube of edge length equal to 128 units. An orthogonal 3D grid of physical nodes, with is built on this cube, being the distance between adjacent nodes fixed to units. This means a spacing of 8 and 4 units for and , respectively. We will call the density of the grid.
Five different groups of 15 obstacles each are generated with cube shape and edge length units. Each coordinate of the center of an obstacle is placed in where stands for the width of an obstacles-free layer along the facets of that ensures some feasible origin-destination paths in case too many obstacles are placed. This grid defines a baseline for the undirected graph described in Section 2 and the directed version described in Section 3.
Five different groups of services are generated with equal radius of 4 units and establishing a safety minimum allowed distance of 1 unit with respect to other services. For each service, a source and a destination have been randomly generated belonging to planes (for the source) and (for the destination) assuring that both points are nodes of the grid for and therefore, for .
Several details on real-life cost functions for our problem are given in Section 5.2. However, for this preliminary study on random instances, we choose the cost function coefficients for an edge as:
where:
-
•
takes random integer values in .
-
•
is the physical distance between the two end-nodes and of the edge (length of the edge).
-
•
takes value 1 if edge represents an elbow and otherwise.
-
•
takes value 1 if edge is a vertical edge (in the -axis) and otherwise.
Observe that the cost function considers the distance of the paths, the number of elbows introduced as well as changes in height. This cost system is a simplified version of the general cost function described in Section 5.2 for our case study.
We denote by the instance of density , services with , obstacles with and creating five instances, , for each combination of services and obstacles. Therefore 90 different benchmark instances are generated.
All instances were solved with the Gurobi 7.7 optimizer, under a Windows 10 environment in an Intel(R) Core(TM)i7 CPU 2.93 GHz processor and 16 GB RAM. Default values were initially used for all parameters of Gurobi solver and a CPU time limit of 7200 seconds was set. We have also tested different combinations of parameters for the solver cut strategy and dimensionality reduction heuristic but, unless it is specified, the best results were obtained with the parameters of the solver set to the default values. An initial solution was given to the problem by solving the multicommodity flow problem with additional () constraints for each service independently of the remainder services.
For the decomposition based heuristic, we fix the maximum number of iterations to , the first of them of type I_par, the next of type I_cluster and the last of type I_seq. In case a feasible solution is not found with the maximum number of iterations (which only happens for some of the instances), we generate the solution for the same instance by reducing the density to , which is indeed, a feasible solution of the instance.
In Table 1 we report the average results of our computational experiments. The first three columns indicate the parameters identifying the instances, (density), (number of services) and (number of obstacles). For each of the combinations of these parameters we report the average results of the five generated instances. Column Vars indicates the number of variables of the (MCMNFP) problem and column Cons the number of constraints. Column Solved reports the number of instances out of five solved to optimality by the Exact method (Ex). In the block of columns denoted by GAP we report the gap obtained with the three proposed procedures, the Exact (Ex) model, the dimensionality reduction algorithm (H1), based on trimming down instances, and the one based on decomposing the problem (H2). The GAP reported for the exact approach indicates the MIP gap obtained at the end of the time limit in case the problem has not been optimally solved, while the gap for the heuristic procedures gives the percent deviation of the heuristic solution with respect to the best solution obtained with the exact approach. Finally, in the block of columns Time we report the CPU time required by each one of the approaches.
A first analysis of the results shows that the exact algorithm solves all instances with and any number of services and obstacles, whereas for we could solve to optimality almost all the instances for number of services and but not for services. Actually, for services none of the instances could be solved to optimality within the time limit although the final MIP gap is always very small and less than or equal to .
On the other hand, the results reported for the heuristic algorithms are rather good. For all the instances our two heuristic approaches (H1) and (H2) always find feasible solutions and the gaps with respect to the best solution found by the exact method (Ex) are less than or equal to . Actually, heuristic (H2) reports even better gaps being always less than or equal to .
Concerning running times, as expected, the methods based on solving mathematical programming models, i.e., the exact method (Ex) and the matheuristic (H1), require more time to get to their solutions. Clearly, (H1) is less time consuming than (Ex) since it solves trimmed instances which results in programs with much less variables and constraints so that the computing time is also smaller. On the other hand, the decomposition heuristic (H2) which is based on iteratively solving shortest path problems with modified weights is much lighter and the running times are considerably smaller.
GAP Time d s o Vars Cons Solved Ex H1 H2 Ex H1 H2 17 5 5 228,232 73,572 5 0.00 0.10 0.00 11.15 6.26 1.28 10 227,421 73,386 5 0.00 0.32 0.00 11.51 7.80 1.48 15 226,736 73,230 5 0.00 2.01 0.00 12.21 9.73 1.40 8 5 399,406 117,761 5 0.00 0.31 0.64 400.17 396.38 2.24 10 397,986 117,463 5 0.00 1.96 0.22 339.85 240.53 4.37 15 396,788 117,214 5 0.00 5.73 0.34 347.41 482.09 4.59 12 5 627,638 176,735 5 0.00 0.61 1.59 4216.11 1824.99 3.78 10 625,407 176,289 5 0.00 2.64 1.17 3367.94 2159.86 7.20 15 623,524 175,914 5 0.00 4.93 1.26 2596.96 2215.58 7.55 17 417,015 122,396 45 0.00 2.07 0.58 1225.45 1149.25 3.77 33 5 5 1,694,166 537,852 5 0.00 0.10 0.00 163.20 3.31 98.08 10 1,689,282 536,568 5 0.00 0.16 0.00 152.31 5.43 90.72 15 1,684,880 535,407 5 0.00 0.69 0.00 176.34 9.82 98.66 8 5 2,964,791 860,609 3 0.06 0.24 0.64 5100.74 62.58 183.93 10 2,956,243 858,554 4 0.16 1.26 0.15 4393.18 247.27 181.27 15 2,948,540 856,697 4 0.16 3.07 0.32 3484.85 1546.39 184.73 12 5 4,658,958 1,291,007 0 1.26 0.45 1.59 7200.05 236.02 315.66 10 4,645,524 1,287,926 0 1.48 1.32 1.17 7200.05 1214.57 311.04 15 4,633,420 1,285,139 0 1.38 3.68 1.26 7200.05 4278.22 308.63 33 3,097,312 894,418 26 0.50 1.22 0.57 3896.75 844.85 196.97 Total 1,757,163 508,407 71 0.25 1.64 0.57 2576.11 997.05 100.37
5.2. Case study
This section is devoted to present the application of the proposed methodology to one of the realistic instances provided by our partner Ghenova in order to show the actual applicability of our solution methods to solve scenarios that appear in naval design.

In what follows we describe the elements involved in the instance analyzed in this section, which is drawn in Figure 7:
-
•
The space to design the pipelines systems consists of the three-dimensional parallelepiped with widths and units (in the , and axis, respectively) which represent a ship cabin.
-
•
A grid was generated for the cabin by subdividing each axis in segments of width , producing an initial grid of nodes. The graph is generated by introducing virtual nodes and edges, with and .
-
•
Ten services are to be routed in such a cabin, each of then identified with a number from to . The sources and destinations of the services are located as needed by the designer through the whole cabin (red and blue numbers/services in the figure, respectively).
-
•
Five obstacles (walls) obstructing the routes are given (light blue shapes in the figure). They consist of metal slices of 10 units width and can be traversed through holes/windows (light orange squares in the figure).
-
•
The minimum distance between consecutive elbows is assumed to be units, as required by the designer.
-
•
The radii of the cylindrical pipes are , and units and the minimal security distance among two pipelines is units.
As already mentioned, each edge in the generated grid for the instance, has an associated cost that allows to evaluate the feasible routes to be traced in the network. The cost system incorporates the preferences of the designer when routing the pipelines. We consider an additive cost structure for the objective function to model the use of edges and elbows in the route of each commodity with the following shape:
for each edge and each service . In this function there are some -parameters affected by the characteristics of the edge. The criteria and parameters that define the cost system are detailed in Table 2. This cost structure is flexible enough to reflect most the preferences of naval designers, and was determined in view of the criteria exposed by our partner company for the selection of implementable solutions.
Criteria | Description |
---|---|
physical distance between end-nodes and of edge (length of the edge). | |
1 if edge represents an elbow and otherwise. | |
being the maximum height of the ship cabin and the height of edge in case it is in a plane parallel to the -plane and otherwise. | |
1 if edge is a vertical edge (in the -axis) and otherwise. | |
1 if edge belongs to a preference zone and otherwise. | |
1 if edge crosses a penetrable zone and otherwise. | |
1 if edge represents an elbow and it is close to a source or a destination point and otherwise. | |
Parameters | Description |
Cost per unit length. | |
Cost of an elbow. | |
Cost of moving away from the ceiling. | |
Cost of changing in z-coordinates (height). Therefore, moving to a different height is penalized. | |
Bonus per routing the pipeline in a preference zone (; ). | |
Cost of crossing a penetrable zone. | |
Cost of locating an elbow close to the source or destination point of a pipeline. |
Example 3.
In order to illustrate the above cost function, we use the part of the graph drawn in Figure 8.
In this graph, is the plane while and then, plane is closer to the ceiling than plane . We denote by and the nodes which are virtualized in the figure (for each of the hyperplanes). We assume that there is a preference zone using but there are no preference zones using . Furthermore, is assumed to be close to the source or destination point of some service and also that the black edge in crosses a penetrable zone for the service. In this situation, we have:
-
•
The criteria and coincide for all the edges that belong to the planes and , being the part of their costs affected by parameters and , the same.
-
•
The height of the edges in is larger than height of the edges in , being the term smaller for the edges in .
-
•
The criterion affects the edges in but not those in .
-
•
The criteria and affect some of the edges in but none of those in .
-
•
The edges linking nodes in with nodes in (parallel to the -axis) are only affected by criteria and .
In Table 3 we summarize the cost function for edges in the different planes depicted in Figure 8.
Virtual Arcs (Elbows) | Non Virtual Arcs (Straight Pipes) | |
---|---|---|
(penetrable edges) | ||
e parallel to -axis |
In the actual instance considered in the case study, each edge in the graph has the same cost for all services, i.e., , for all , as required by our partner company. The parameters provided for this instance were:
1 | 2800 | 700 | 200 | -0.7 | 4000 | 3000 |
and the preference zones were defined as the following parallelepipeds:
We run our model for this instance with the exact and the different heuristic approaches. A time limit of 12 hours was fixed for all the procedures. The exact branch-and-cut approach was not able to find a feasible solution of the problem within the time limit. Note that the number of variables for this problem is and the (initial) number of constraints is (constraints () and () that are added as lazy constraints in the branch-and-cut approach are not counted here). The number of explored nodes after 12 hours was , which gives an idea of the high computational load required to solve the problem at each node of the branch-and-bound tree.
For the dimensionality reduction matheuristic (H1), we first solve, independently, the multicommodity flow problem with additional () constraints for each single service, and restrict the search region of our problem to the region induced by these paths enlarged by a parallelepiped of dimension around the paths. The value of is sequentially enlarged by units until a feasible solution is obtained. This procedure obtains a solution in seconds, and the last problem explored nodes in the branch-and-bound tree. The number of variables of this problem was ( of the variables of the exact approach) and the initial number of constraints was ( of the number of constraints required in the exact approach). The number of lazy constraints added in the branch-and-cut approach was ( of them of type ()). The objective value of the solution was .
For the decomposition based heuristic (H2) we fix to 10 the maximum number of iterations with the first of them of type I_par, the next of type I_cluster and the last of type I_seq. This configuration was adequately tuned using a simplified instance for the problem as a training sample. This heuristic computed a solution in seconds after iterations and the obtained objective value was . Observe that the deviation between the solutions obtained with the two heuristics was .
We draw in Figure 9 the obtained solution (with heuristic H1) as paths in the graph. In the picture we represent the obtained paths without (left) and with obstacles and holes (right). The obtained solution as actual pipelines is drawn in Figure 10. One can observe from the picture that real-world instances require routing intricate pipelines avoiding obstacles and respecting the space between the pipes what really makes difficult to locate them in the cabin. The heuristic approaches produce, in view of the results obtained with the synthetic instances, good quality solutions in reasonable CPU times, providing the naval designer with a powerful decision-aid tool for this task.




6. Conclusions
This paper develops a general methodology for the optimal automatic network design of different commodities incorporating real-world constructability conditions. This methodology was originated by an actual problem consisting of the design of spatial pipelines with ships cabins motivated by a recent collaboration with the company Ghenova, a leading naval engineering company. Our proposal is to adapt an ‘ad hoc’ minimum cost multicommodity network flow model to the problem that includes all the technical requirements of feasible pipelines routing. The large number of variables and constraints of real-sized instances makes it inappropriate (impossible in real-world instances) to load into the solver the complete model so that we implemented a branch-and-cut algorithm, where, initially only the standard multicommodity flow model is considered and additional technical constraints are separated within the branch-and-bound tree as lazy constraints. On top of that, we also develop two heuristic algorithms that provide rather good feasible solutions. The first one is a matheuristic based on solving trimmed instances and the second one is a decomposition heuristic that iteratively solves shortest path problems with modified edges weights. Our computational results on randomly generated instances are rather promising showing that we can solve to optimality medium-sized instances. We also report a case study based on a realistic naval instance of a ship cabin provided by our partner company to our research group to test the methodology.
Future work on this topic includes the consideration of more general underline networks including non-orthogonal designs which are conceptually easy to handle once the admissible solutions graphs are generated whereas the generation of these graphs is still a challenging question that will be the focus of a follow up paper.
We will also explore the use of Machine Learning tools to determine, in advance, the parameters of the cost function, that are assumed in this paper to be given by the designer. The study of the subregions of -parameters inducing the same routes will allow us to provide the designers different options of reasonable parameters to explore in the decision making process.
Acknowledgements
The authors of this research acknowledge financial support by the Spanish Ministerio de Ciencia y Tecnologia, Agencia Estatal de Investigacion and Fondos Europeos de Desarrollo Regional (FEDER) via project PID2020-114594GB-C21. The authors also acknowledge partial support from projects FEDER-US-1256951, Junta de Andalucía P18-FR-422, CEI-3-FQM331, NetmeetData: Ayudas Fundación BBVA a equipos de investigación científica 2019, and Contratación de Personal Investigador Doctor (Convocatoria 2019) 43 Contratos Capital Humano Línea 2. Paidi 2020, supported by the European Social Fund and Junta de Andalucía.
References
- [Ando and Kimura, 2011] Ando, Y. and Kimura, H. (2011). An automatic piping algorithm including elbows and bends. In International Conference on Computer Applications in Shipbuilding (ICCAS), pages 153–158, Triestre, Italy.
- [Asmara, 2013] Asmara, A. (2013). Pipe routing framework for detailed ship design. PhD thesis, Delft University of Technology, Netherlands.
- [Asmara and Nienhuis, 2006] Asmara, A. and Nienhuis, U. (2006). Automatic piping system in ship. In International Conference on Computer and IT Applications (COMPIT), Delft, Netherlands.
- [Cuervas et al., 2017] Cuervas, F., Tordera, A., Fontán, A., Brenes, P., Alejo, C., Tovar, A., Puerto, J., Conde, E., Ortega, F., and Hinojosa, Y. (2017). Ariadna: sistema automático de trazado de tuberías y canalizaciones en ingeniería. Ingeniería Naval, 963:75–84.
- [Dijkstra, 1959] Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische mathematik, 1(1):269–271.
- [Even et al., 1975] Even, S., Itai, A., and Shamir, A. (1975). On the complexity of time table and multi-commodity flow problems. In 16th Annual Symposium on Foundations of Computer Science (sfcs 1975), pages 184–193. IEEE.
- [Guiradello and Swaney, 2005] Guiradello, R. and Swaney, R. S. (2005). Optimization of process plant layout with pipe routing. Computers and Chemical Engineering, 30:99–114.
- [Hightower, 1969] Hightower, D. (1969). A solution to line routing problems on the continuous plane. In Proceedings of Sixth Annual Design Automation Conference. IEEE, pages 1–24.
- [Ikehira et al., 2005] Ikehira, S., Kimura, H., and Kajiwara, H. (2005). Automatic design for pipe arrangement using multi-objective genetic algorithms. In International Conference on Computer Applications in Shipbuilding (ICCAS), pages 97–110, Busan, Korea, 23-26 August.
- [Ito, 1999] Ito, T. (1999). A genetic algorithm approach to piping route planning. Journal of Intelligence Manufacturing, pages 103–114.
- [Kim et al., 2013] Kim, S. H., Ruy, W. S., and Jang, B. S. (2013). The development of a practical pipe auto-routing system in a shipbuilding cad environment using network optimization. Int. J. Naval Archit. Ocean Eng., 5:468–477.
- [Kimura, 2011] Kimura, H. (2011). Automatic designing system for piping and instruments arrangement including branches of pipes. In International Conference on Computer Applications in Shipbuilding (ICCAS2011), volume 3, pages 93–99.
- [Lee, 1961] Lee, C. Y. (1961). An algorithm for path connections and its applications. IEEE Transactions on Electronic Computers, 10(3):346–365.
- [Min et al., 2020] Min, J., Ruy, W., and Park, C. (2020). Faster pipe auto-routing using improved jump point search. International Journal of Naval Architecture and Ocean Engineering, pages 596–604.
- [Mitsuta et al., 1986] Mitsuta, T., Kobayashi, Y., Wada, Y.and Kiguchi, T., and Yoshinaga, T. (1986). A knowledge-based approach to routing problems in industrial plant design. In Proceedings of the Sixth International Workshop Expert System and Their Applications, pages 237–256, Avignon, France, March.
- [Newell, 1973] Newell, R. G. (1973). Algorithms for the design of chemical plant layouut and pipe routing. PhD thesis, Imperial College, London, England.
- [Park, 2002] Park, J. (2002). Pipe-routing algorithm development for a ship engine room design. In Ph.D. Washington University.
- [Park and Storch, 2002] Park, J. H. and Storch, R. L. (2002). Pipe-routing algorithm development: case study of a ship engine room design. Expert Systems with Applications, 23:299–309.
- [Qian et al., 2008] Qian, X., Ren, T., and Wang, C. (2008). A survey of pipe routing design. In Control and Decision Conference, Chinese IEEE, pages 3994–3998, Yantai, Shandong, China, 2-4 July.
- [Rourke, 1975] Rourke, P. W. (1975). Development of a three-dimensional pipe routing algorithm. PhD thesis, Lehigh University.
- [Salimifard and Bigharaz, 2020] Salimifard, K. and Bigharaz, S. (2020). The multicommodity network flow problem: state of the art classification, applications, and solution methods. Operational Research.
- [Schmidt-Traub et al., 1999] Schmidt-Traub, H., Holtkötter, T., Lederhose, M., and Leuders, P. (1999). An approach to plant layout optimization. Chemical Engineering Technology, 22(2):105–109.
- [Shing and Hu, 1986] Shing, M. T. and Hu, T. C. (1986). Computational complexity of layout problems. In Layout design and verification, pages 267–294. Elsevier Science Publishers B.V., North Holland.
- [Singh and Cheng, 2021] Singh, J. and Cheng, J. (2021). Automating the generation of 3d multiple pipe layout design using bim and heuristic search methods. In 18th International Conference on Computing in Civil and Building Engineering. ICCCBE 2020, volume 98, pages 54–72.
- [Xiaoning et al., 2006] Xiaoning, F., Yan, L., and Zhuoshang, J. (2006). The ant colony optimization for ship pipe route design in 3d space. In World Congress on Intelligent Control and Automation (WCICA), pages 3103–3108, Dalian, China, 21-23 June.
- [Xiaoning et al., 2007] Xiaoning, F., Yan, L., and Zhuoshang, J. (2007). Ship pipe routing design using the aco with iterative pheromone updating. Journal of Ship Production, 23(1):36–45.
- [Zhu and Latombe, 1991] Zhu, D. and Latombe, J. (1991). Pipe routing-path planning (with many constraints). In IEEE International Conference on Robotics and Automation (ICCAS), pages 1940–1947, Sacramento, California.
Appendix A Pseudocode of the algorithms described in Section4
We gather in this section the pseudocode of the different algorithms described in Section 4 devoted to our matheuristic algorithms.
A.1. Pseudocode for the dimensionality reduction algorithm in Section 4.1
Next, we include the pseudocode of the dimensionality reduction algorithm.
A.2. Pseudocode for the decomposition-based algorithm described in Section 4.2
In the following we describe the different modules of the decomposition-based matheuristic.