<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>From Multi-Agent Pathfinding to 3D Pipe Routing</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>2020</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10179946</idno>
					<idno type="doi"></idno>
					<title level='j'>Symposium on Combinatorial Search (SoCS)</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>G. Belov</author><author>W. Du</author><author>M. Garcia de al Banda</author><author>D. Harabor</author><author>S. Koenig</author><author>X. and Wei</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[The 2D Multi-Agent Path Finding (MAPF) problem aims at finding collision-free paths for a number of agents, from a set of start locations to a set of goal locations in a known 2D environment. MAPF has been studied in theoretical computer science, robotics, and artificial intelligence over several decades, due to its importance for robot navigation. It is currently experiencing significant scientific progress due to its relevance for automated warehouses (such as those operated by Amazon) and other important application areas. In this paper, we demonstrate that some recently developed MAPF algorithms apply more broadly than currently believed in the MAPF research community. In particular, we describe the 3D Pipe Routing (PR) problem, which aims at placing collision-free pipes from given start locations to given goal locations in a known 3D environment. The MAPF and PR problems are similar: a solution to a MAPF instance is a set of blocked cells in x-y-t space, while a solution to the corresponding PR instance is a set of blocked cells in x-y-z space. We show how to use this similarity to apply several recently developed MAPF algorithms to the PR problem, and discuss their performance on real-world PR instances. This opens up a new direction of industrial relevance for the MAPF research community.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Introduction</head><p>The 3D Pipe Routing (PR) problem is a common industrial problem that appears when designing the layout of industrial plants, such as natural gas processing stations, water treatment facilities, and the power plants used in ships and submarines. Designing the layout of such a plant requires finding 3D coordinates for every piece of equipment in the plant (the equipment allocation problem), and finding a 3D route for every pipe that connects two pieces of equipment (the PR problem). The aim is to minimize the total cost of the plant (which can run into multi-billion dollar budgets), while ensuring safety and correct functionality. Figure <ref type="figure">1</ref> shows a layout for part of a natural gas plant.</p><p>Differences in the quality of the final layout can have a very significant impact on the cost of these plants, including the cost of the pipes and associated support structures, which are known to take the largest share: up to 80% of the purchased equipment cost or 20% of the fixedcapital investment <ref type="bibr">(Peters and Timmerhaus 2004)</ref>. However, finding high-quality plant layouts is remarkably difficult due to the size of these plants and the complexity of the associated constraints. As a result, layouts are still designed manually, taking multiple engineers many months (or even years) to complete. This process is inefficient, costly, and the results may vary in quality, since they largely depend on the experience of the piping and layout engineers.</p><p>In this work, we focus on the PR problem, which shares many similarities with 2D Multi-Agent Path Finding (MAPF). A solution to the 2D MAPF problem is a set of collision-free paths in x-y-t space where t is the time dimension. A solution to the PR problem is a set of collisionfree paths in x-y-z space. We exploit the similarites to apply recently developed priority-based MAPF algorithms to the PR problem, with the goal of finding good solutions quickly. We consider a variety of challenging real-world PR problems provided by our industry partner, which have up to several hundred pipes. Our approach improves convincingly on a currently state-of-the-art PR technique from <ref type="bibr">(Belov et al. 2017)</ref>, both in terms of success rate (we route more pipes) and solution quality (we achieve smaller costs).</p><p>The Real-World Pipe Routing (PR) Problem Current research into automatic plant layout commonly divides it into two phases. The first phase performs equipment allocation, that is, finds 3D positions for all necessary equipment of the plant with respect to a set of operational constraints. In this phase, the cost of the pipes is approximated using rough measures, such as Manhattan distances. The second phase solves the PR problem directly, by finding 3D routes for the pipes that connect the input and output nozzles of the already allocated equipment.</p><p>PR is made challenging by a variety of constraints, each of which is necessary to satisfy operational, maintenance, and safety criteria. In order to satisfy all these different constraints in a reasonable amount of time, most optimisation methods for solving the PR problem route pipes one by one (i.e., sequentially) according to a given order. In this section, we describe the most important features of the PR problem and the various simplifications made by the PlantLayout system <ref type="bibr">(Belov et al. 2018</ref>), a prototype industrial software that provides us with a reference model.</p><p>The Routing Landscape. Obstacles can have any geometric shape. PlantLayout approximates them by cuboids. We distinguish between physical obstacles, such as equipment, and logical ones, such as maintenance access zones.</p><p>Pipe Diameter. Pipes have a certain diameter and require some minimal distance to other objects. PlantLayout accurately models this.</p><p>Circular Bends and Non-Axis-Parallel Segments. Pipes can bend with a certain radius. Moreover, although in practice most pipe segments are parallel to one of the coordinate axes, a few are not. PlantLayout assumes pointed bends and axis-parallel segments. However, to account for the bend radius of (usually) 1.5D, where D is the pipe's diameter, each segment must be at least 3D long (1.5D for nozzle segments).</p><p>Support Costs. A pipe has to be supported either by the ground or by some other equipment. The further it is from the supporting object or the ground, the higher the support costs. Moreover, in practice, several pipes can be supported together when their routes are close. PlantLayout approximates the cost aspect by constraining every bend to be at most 3 meters away from at least one equipment item or the ground, and adding a height penalty for each bend when it is not in a supporting structure, such as a pipe rack.</p><p>Bend Costs and Penalties. Bends are expensive in terms of construction and operation. PlantLayout includes penalty terms in the objective function of the routing method to account for this.</p><p>Stress and Flexibility Analysis. Pipes may contract and expand due to temperature changes in the environment and the materials they transport. This poses stress on the pipe, which needs to be accounted for using a stress and flexibility analysis. There are several methods differing in their complexity and precision (ASME International 2017). While PlantLayout allows for an approximate control of pipe stress during optimization, it was not used in this study.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Existing Methods for the PR Problem</head><p>In practice, the PR problem is solved iteratively under considerations from various domains, including further operational and construction aspects not listed above. In particular, there is a strong emphasis on the cooperative allocation of pipes (e.g., reusing support structures), or pipes and equipment together, going far beyond conflict-free routing only. These aspects have not been studied enough, and we leave them for future work. Below, we review methods known in the research literature.</p><p>Most research into plant layout design focuses on the equipment allocation phase (e.g., <ref type="bibr">Xu and Papageorgiou;</ref><ref type="bibr">Xu and Papageorgiou 2007;</ref><ref type="bibr">2009)</ref>. For small instances of the problem, <ref type="bibr">Sakti et al. (2016)</ref> successfully apply a satisfaction (rather than optimisation) method that simultaneously allocates equipment and routes the pipes. Authors consider 10 equipment pieces and up to 15 pipes (4 segments per pipe on average). However, their method fails to find solutions for instances with as few as 8 pipes. Realistic plants are much larger. For example, <ref type="bibr">Belov et al. (2018)</ref> consider an instance of part of a Liquefied Natural Gas (LNG) plant, with 76 equipment pieces and 85 pipes within a 1250x500x200 grid graph. Instances with all equipment in the plant have hundreds of equipment pieces and pipes.</p><p>A variety of search-based methods focus specifically on PR. Some of these rely on meta-heuristics, such as the antcolony evolutionary algorithms considered by <ref type="bibr">Furuholmen et al. (2010)</ref> and <ref type="bibr">Jiang et al. (2015)</ref>. Another popular approach involves prioritised planning <ref type="bibr">(Cao et al. 2018)</ref>, wherein the pipes are ordered according to some fixed priority and routed in order. Each higher-priority pipe then becomes an obstacle for all lower-priority pipes.</p><p>Another approach to PR, similar to that of PlantLayout, involves the use of combinatorial optimisation. <ref type="bibr">Guirardello and Swaney (2005)</ref> describe a detailed mixed-integer programming (MIP) model for solving phase one of the plant design layout problem, and they give a general overview of a network-flow MIP model that can solve phase two (i.e., PR). Their PR method involves the construction of a reduced connection graph that limits the possible routes of the pipes. The graph is used to route pipes one by one, as the authors suggest that simultaneous routing is too costly. Since this work gives only a high-level overview, some details are omitted, including the construction of the graph. One approach to building connection graphs is considered by de <ref type="bibr">Berg et al. (1992)</ref>, who present a higher-dimensional rectilinear shortest path model that considers bend costs. Another approach is given by <ref type="bibr">Zhu and Latombe (1991)</ref>, using cuboid free space decomposition and is also applied to PR. However, even if these methods are used, it is not clear how <ref type="bibr">Guirardello and Swaney (2005)</ref> resolve situations where pipes can interfere with each other. <ref type="bibr">(Guirardello and Swaney 2005</ref> talk about "some tuning by hand" which might be required for these cases.)</p><p>In this work, we employ a general PR method first considered by <ref type="bibr">Belov et al. (2017)</ref>. This approach relies on a high-level model of the PR problem written in the solverindependent language MiniZinc <ref type="bibr">(Nethercote et al. 2007</ref>). The model can be solved with a variety of optimisation tech-nologies, including MIP, and it allows routing several pipes simultaneously, although this approach becomes quickly intractable. We apply this method as a single-agent solver in the context of <ref type="bibr">Priority-Based Search (Ma et al. 2019</ref>), a recent technique developed for Multi-Agent Path Finding (MAPF). We show that these two approaches (prioritised search at the high-level and realistic single PR at the lowlevel) can find state-of-the-art solutions to industrial problems with up to hundreds of pipes.</p><p>Prioritised Planning Definition 1. We call an assignment of routes to pipes a plan. A complete plan is a plan where all pipes have routes. A maximal plan is either complete, or not allowing further routes under the active priority ordering (because of lack of space). A feasible plan is a conflict-free maximal plan.</p><p>Prioritised planning <ref type="bibr">(Erdmann and Lozano-P&#233;rez 1987</ref>) is a broad family of multi-agent coordination techniques which all share the same basic principles. First, agents are planned for sequentially, each from its start location to its target location. Second, during pathfinding search, each agent is required to avoid all other agents previously planned for.</p><p>Although incomplete in general (see Figure <ref type="figure">2</ref>), prioritised planning algorithms appear widely in the literature and have been used in a variety of different contexts, including PR <ref type="bibr">(Guirardello and Swaney 2005;</ref><ref type="bibr">Belov et al. 2017;</ref><ref type="bibr">Cao et al. 2018)</ref>. One of the main advantages is performance: with k agents to coordinate, a feasible plan can be available after just k single-agent searches. This has allowed practitioners to develop scalable approaches to otherwise intractable problems with hundreds of moving agents <ref type="bibr">(Silver 2005)</ref>. The cost of a plan can depend on the priority ordering, and there are k! possible orders in total. Various ordering heuristics have been considered, including for PR <ref type="bibr">(Belov et al. 2017)</ref>. However, choosing a good set of priorities remains a challenging problem sometimes left to human experts <ref type="bibr">(Cao et al. 2018)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Priority-Based Search (PBS)</head><p>Figure 2: Prioritised planning example. For the same layout, left is the XZ-projection (side-view) and right is the XYprojection (top-view). Blocked cells are marked with &#215; on the left. Assume this obstacle structure is replicated along the Y direction. There are two pipes, red and black, with their start-goal locations in holes 1-3 and 2-4 (counting from the left), respectively. C 1 and C 2 mark conflict points. Prioritised planning always fails in this case, irrespective of the ordering. An optimal plan (made clear on the right) has the two pipes swap priorities at the conflict points.</p><p>computes priority orderings online instead of a priori. We give herein a brief description, since the algorithm is central to our work. Note that in the below descriptions each agent is a pipe and each path is a trajectory in three dimensions: from one distinguished nozzle called the start to another nozzle called the target. While the major difference to <ref type="bibr">(Ma et al. 2019)</ref> is the low-level subproblem, which is the PR problem, we made some other changes highlighted below.</p><p>Search Space. PBS is a branch-and-bound algorithm. It searches a binary Conflict Tree (CT), where each node corresponds to a complete plan. The root of the CT tree corresponds to a plan where every agent ignores all the rest and follows one of its own individually optimal shortest paths. Notice that none of the agents have priorities at this point.</p><p>Conflicts. When PBS expands a CT node, it first checks whether the proposed plan contains any collisions among the agents. Such collisions are called conflicts. If there are conflicts, PBS chooses a conflict according to some policy and then works to resolve the impasse by branching the current plan.</p><p>Branching. To resolve a conflict between agents i and j, PBS generates two new child CT nodes: one with added constraint (i &#8826; j) indicating that agent i has higher priority than agent j, and the other one with added constraint (j &#8826; i), which gives j higher priority. The conflict is resolved at each child node by computing a new individually optimal path for the lower priority agent. The other agents all retain their current paths in both child nodes.</p><p>Pathfinding. To plan a new individually optimal path, we apply the optimisation method from <ref type="bibr">(Belov et al. 2017)</ref>. This method uses a high-level MiniZinc model of the PR problem, which specifies all associated costs and operational constraints. We instantiate the model by adding as obstacles the set of all plant equipment, together with the path of every pipe that corresponds to a higher priority agent. We also introduce a set of additional obstacles, called fake nozzles, which correspond to the shortest possible start and target nozzle segments of the pipes that have yet to be routed. In our setting, fake nozzles occupy a length twice the diameter of the corresponding pipe. We use MIP solver Gurobi (Gurobi Optimization 2020) to solve the model, that is, to plan a path that minimises the overall cost computed using the length and diameter of the pipe, the number of bends, and any associated supports.</p><p>Tree Traversal. PBS explores the CT by performing a depth-first traversal. The algorithm continues down a given branch, as long as the order specified by the set of constraints that appear on the path from the root CT node to the current CT node is consistent, i.e., has no directed cycles. When looking for a new path for a lower priority agent, the pathfinder can fail. This indicates there is no path for the set of specified constraints. In contrast to (Ma et al. 2019), we allow a certain number of failed pipes, limited by parameter maxMissing, and only backtrack if that number is exceeded. PBS also backtracks when the current node is a feasible plan, to try to improve it.</p><p>Termination. The search terminates when a userspecified time limit is reached, or when the search exhausts the tree.</p><p>Differences to the PBS of <ref type="bibr">(Ma et al. 2019)</ref>. Algorithm 1 provides a detailed pseudo-code description of our proposed PBS implementation. While very similar in principle to <ref type="bibr">(Ma et al. 2019)</ref>, it has a number of important differences. First, we consider feasible plans with unrouted/missing pipes. This is because we do not know if all pipes can be successfully routed in a conflict-free way. Parameter maxMissing is the largest allowed number of missing pipes. Correspondthe quality of a plan is measured not only by its total cost, but primarily by the number of successfully routed pipes. Second, we do not terminate after the first conflictfree plan, but try to improve it. In doing this, we store the best feasible plan computed thus far as an incumbent (Line 8). We use the incumbent to bound the quality of the current node and never explore any branch where the quality of the candidate plan is equal to or worse than the incumbent (Line 6); that is, where the number of missing pipes is not smaller and, if equal, the cost is not smaller. And third, we parameterise the algorithm with a conflict policy, that is, a heuristic that helps PBS to decide which conflict it should branch on next.</p><p>We now describe the role of several important PBS functions, which we again adapt for PR. Function GetPath(N, p) looks for an individually optimal route for pipe p that avoids all equipment, fake nozzles, and all locations occupied by pipes with higher priority (as defined by the current tentative plan at node N). When no feasible route exists, GetPath(N,p) returns &#8709; and the current plan has one more missing pipe. Function IndependentRouting() returns a set of independently optimal routes for all pipes/agents. Equipment must still be avoided, as well as fake nozzles.</p><p>Function Quality(S) returns, for a partial or complete plan S, a tuple (num missing, c). Here, num missing is the number of pipes that could not be routed, and c is the total cost of the routed pipes. When comparing two plans, we do so lexicographically using the precedence operators &#8826; and , where S 1 &#8826; S 2 (S 1 S 2 ) means the plan S 1 is better (not worse) than S 2 . We define Quality(&#8709;) &#8801; (&#8734;, &#8734;). Function GetConflictPair(S, conflictPolicy) picks a pair of conflicting pipes from S, using the conflict policy conflict-Policy. We consider two conflict policies implemented as distributions:</p><p>1. Uniform distribution.</p><p>2. Weights proportional to the costs of the two conflicting pipes.</p><p>Thus, both conflict policies are random, and any conflict can be selected, but conflict policy 2 prefers those with 'big' pipes involved.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Sampling the Conflict Tree (CT)</head><p>In addition to PBS, we consider several sampling-based approaches to explore the PBS CT.</p><p>FixOrder is our reference algorithm from <ref type="bibr">(Belov et al. 2017)</ref>. It routes pipes sequentially according to an a priori fixed priority ordering based on non-increasing estimated total costs.</p><p>OneDive is a version of PBS that explores a single branch of the CT. Algorithm 2 gives a pseudo-code description. Given an infeasible plan, OneDive fixes the paths of some agents (deemed higher priority according to the policy) and replans all remaining agents (deemed lower priority) whose paths are in conflict with the higher priority set. It exits prematurely whenever it discovers that it cannot improve the reference plan provided (Line 10). OneDive employs the following additional two functions. Function SelectRouteToFix(C, fixPolicy) uses, for a given conflict C = (i, j), the given fixing policy fixPolicy to return either pipe i or pipe j with some probability. We again consider two distributions: 1. Uniform distribution (both pipes equally preferred).</p><p>2. Weights proportional to the costs of the two pipes.</p><p>Similar to the conflict policies, any pipe can be selected with both fixing policies, but fixing policy 2 prefers larger/costlier pipes.</p><p>Function FindConflictedRoutes(routes, r) returns, for a given route r in routes, all other routes conflicting with r.</p><p>Randomized Restart (RR) performs, similar to <ref type="bibr">(Cohen et al. 2018</ref>), OneDive at least once, with given conflict and pipe selection policies, and returns a best found plan, as shown in Algorithm 3.</p><p>Hill Climbing (HC) accepts an initial feasible plan. Then, a certain portion of the routes are discarded, and the agents are replanned using OneDive, as described in Algorithm 4. We distinguish two versions: HC(OneDive) and HC(FixOrder), where the initial solution is obtained by OneDive or FixOrder, respectively. HC depends on the following function:</p><p>Function SelectUnfixRoutes(routes, destructionPercent) selects routes to be rerouted in the current Hill Climbing iteration. First, any agents without currently assigned paths (i.e., missing pipes) are selected, and then more routes are selected at random until the destructionPercent percentage of routes are selected. The selected pipes are rerouted using OneDive (with the non-selected routes being fixed as obstacles). This procedure is performed iteratively. It shares similarities with Large Neighbourhood Search <ref type="bibr">(Shaw 1998)</ref>, a meta-heuristic approach popularly used for vehicle routing problems. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Experiments</head><p>We test the performance of the algorithms on both industrysize instances with up to 207 pipes, as well as on smaller specially constructed synthetic instances with up to a few dozen pipes. We benchmark the efficiency of the heuristic randomization policies, as well as the overall runtime profiles of the algorithms.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Instances</head><p>Our synthetic instances were constructed to challenge the algorithms due to their small congested spaces with a high density of pipes. The number of pipes ranges from 8 to 36 per instance, while the pipe diameter is 1000mm. We have a Small instance with just 8 pipes, and four Medium instances, three of them with 23 pipes and the last one with 36 pipes.</p><p>We also have two industrial instances from plants intended to extract Liquefied Natural Gas. Instance AGRU (Acid Gas Removal Unit) has 66 pipes, with diameters ranging from 50mm to 750mm. Instance LNG Train includes 207 pipes with diameters ranging from 50mm to 1500mm.</p><p>Details for all instances, including the associated runtime limits used for the experiments, are specified in Table <ref type="table">1</ref>. The 3D layouts of the instances are shown in Figure <ref type="figure">3</ref>. The Medium 1,2 and 3 instances have the same set of equipment and connections but different equipment layout.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithms and Implementation</head><p>We test several high-level PR algorithms with various options. Our reference in all cases is FixOrder, the fixed priority ordering algorithm used in <ref type="bibr">(Belov et al. 2017)</ref>, where pipes are routed sequentially according to their nonincreasing estimated total cost.</p><p>Algorithm RR(c, f ) represents PBS with randomised restarts, where parameters c and f indicate specific conflict and fixing policies. Algorithm HC represents Hill Climbing with conflictPolicy = 2 and destructionPercent = 50%. We distinguish HC(OneDive) and HC(FixOrder), depending on the initial plan provided. We also run the PBS algorithm with maxMissing = 0, which we denote as PBS, and with maxMissing = &#8734;, which we denote as PBS-MP. Recall that the maxMissing variable indicates how many pipes can be left without any route in a tentative plan.  <ref type="table">1</ref><ref type="table">2</ref><ref type="table">3</ref>.9 115 2 43.5 10 0 43.9 17 0 36.6 0 360 2 127 AGRU 66 66 288 2 0.9 268 0 2.1 45 0 0.7 43 0 1.3 0 0.3 58 57 0 0.3 58 57 LNG Train 207 206 3658 0 10.3 3205 0 4.4 7 0 5.3 9 0 5 9 0 2.4 607 172 0 2.4 607 172 further improve the results. Table <ref type="table">3</ref> provides more data on the best final plans, including for the Medium 4 instance.</p><p>Significance. It should be noted that improvements of several percent in cost can mean savings of millions of dollars in practice, due to the high costs of plant construction and operation. The new algorithms achieve these improvements with longer runtimes compared to a reference method. Unlike MAPF, where deliberation time is limited, plant layout is a multi-year problem and runtimes measured on the scale of minutes and even hours are not prohibitive.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Conclusion</head><p>We consider 3D Pipe Routing (PR), an important and challenging industrial problem which appears in the context of designing industrial plant equipment. To solve PR we develop a range of heuristic techniques in the family of Priority-Based Search (PBS): a recent prioritised planning method developed for Multi-Agent Pathfinding (MAPF) <ref type="bibr">(Ma et al. 2019)</ref>.</p><p>Given enough time, we find that PBS can often produce best known solutions to challenging industrial instances with up to hundreds of pipes. To compute solutions faster we also consider a number of local-search variants including randomised restarts, for sampling the PBS conflict tree, and hill climbing, where PBS starts from and attempts to improve a best known candidate plan. Experimental results show that these approaches can improve not only performance vs PBS but also plan quality, routing more pipes faster and at lower cost.</p><p>A variety of directions exist for future work e.g., the inclusion of meta-heuristics which can allow the search to escape local optima and/or guide the search toward more promising plans. In practice, pipes are also often routed together, reusing support structures. Thus, it can be fruitful to combine equipment allocation and pipe routing so as to avoid the issue of unroutable pipes. Although current methods are faster than manual routing there exists substantial scope for improvement.</p></div></body>
		</text>
</TEI>
