# A Facility Layout Algorithm for Logistics Scenarios Driven by Transport Lines
## 3 Force-Directed Logistics Layout Algorithm
### Path Search Algorithm  
In this paper, we present a multi-metric evaluation path search algorithm to arrange the transport lines within the workshop, as shown in Figure 7. By utilizing the solution as well as facility and line information, the central coordinates of all facilities, the start and end coordinates of the lines, the boundary point coordinates of the envelope box, and the coordinates of the workshop entrances and exits are obtained. These coordinates are then used to generate sets of horizontal and vertical coordinates, and a collection of path points in the grid is generated. Due to the changing positions of the working facilities during iterations, resulting in the grid that cannot be divided into equal units, the neighbor relationship of the path points is established by sorting the values within the coordinate set. The actual coordinates of the path points are mapped to the grid coordinates to determine the starting point, end point, and obstacle point in the equal division grid. The actual coordinate path of the transport line is obtained after a path search. The steps of the multi-indicator evaluation path search Algorithm 1 (MIEA) are as follows.  
Figure 6: Non-overlapping and boundary constraint adjustment.  
```
Input: starting coordinates \((x_{s},y_{s})\), ending coordinate \((x_{e},y_{e})\), grid point set \(M\),  open list \(ol\), close list \(cl\) Output: path point set \(P\)
1\(ol\gets null\), \(cl\gets null\);
2 remove the node in \(M\) inside the facility;
3 add \((x_{s},y_{s})\) to \(ol\);
4 get the node \(i\) with the lowest cost in \(ol\);
5 add \((x_{i},y_{i})\) to \(P\);
6 while\((x_{i},y_{i})\
eq(x_{e},y_{e})\)do
7 get the node \(m\) with the lowest cost in \(ol\);
8 add \((x_{m},y_{m})\) to \(P\);
9 delete \((x_{m},y_{m})\) from \(ol\);
10 add \((x_{m},y_{m})\) to \(cl\);
11 get the neighbor nodes \(i\) of \(m\);
12\(cost(i)\gets G(i)+H(i)+E(i)\);
13 add \((x_{i},y_{i})\) to \(ol\);
14
15 end while
```  
**Algorithm 1**MIEA  
In realistic logistics scenarios, the cost of a turning conveyor is generally higher than that of a linear conveyor. Therefore, when searching for path nodes along a transportation line, the turning point must be considered, given the cost per unit distance of a linear conveyor is \(c_{s}\) and the cost of a single turn conveyor is \(c_{t}\), and assuming that the coordinates of the starting point are \((x_{s},y_{s})\), the coordinates of the ending point are \((x_{e},y_{e})\), the coordinates of point \(i\) are \((x_{i},y_{i})\), the parent point of a given point \(i\) is denoted by \(p\), and the set of turn points is represented as \(T\). In the multi-metric evaluation path search algorithm, the calculation of line cost, denoted as \(cost(i)\), involves three primary metric components, where \(g(i)\) denotes the actual cost of node \(i\) to the starting point, \(h(i)\) denotes the cost of a straight line from point \(i\) to the ending point, and \(e(i)\) denotes the cost of whether point  
Figure 7: Transport lines search process.  
is a turner, and the three part cost calculation formulas are shown in Equations (22)-(24), respectively.  
\[g(i)=g(p)+\left(\left|x_{i}-x_{p}\right|+\left|y_{i}-y_{p}\right|\right)\times c _{s} \tag{22}\]  
\[h(i)=\left(\left|x_{i}-x_{e}\right|+\left|y_{i}-y_{e}\right|\right)\times c_{s} \tag{23}\]  
\[e(i)=\left\{\begin{array}{cc}0&i\
ot\in T\\ c_{t}&i\in T\end{array}\right. \tag{24}\]  
Based on the above path search algorithm, each iteration involves traversing all of the transport lines to extract the coordinate set information of all of the lines in the scene. Where the set of transport line path points is represented as \([(x_{s},y_{s}),\ldots,(x_{i},y_{i}),\ldots,(x_{e},y_{e})]\), the length of each segment of the transport line is determined by calculating the sum of the distances between its front and back coordinates, the MHC objective value is derived by aggregating the cost per unit transport distance of each line, and the TFC objective value is obtained by computing the conveyor cost.