# Optimization of the One-Size-Fits-All Layout Problem Based on Preparing Material for Steel Bridges
## 2 Mathematical Model of Rectangular Layout Problem  
The layout problem can be divided into two categories according to the motherboard type. The first is the boxing layout, in which the layout is determined after determining the shape and size of the motherboard. If the parts exceed the boundary of the motherboard,they are placed on the next one. Another type of layout problem is the band layout, where the width of the motherboard is predetermined but its height is unlimited. The final height (after all the parts are arranged) is the height of the motherboard. In the following, we use the band layout as an example to establish a mathematical model for the rectangular layout problem.  
The two-dimensional rectangular layout can be described as follows: \(n\) rectangles of different sizes, denoted as \(\{\pi_{1},\pi_{2},\cdots,\pi_{n}\}\), are placed onto a rectangular sheet \(S\) without overlapping, where \(\pi\) represents the parts. The width of the sheet is \(W\), and the height is unlimited. Under the constraint conditions, the height \(H\) of the sheet that is used is minimized to maximize the utilization rate of the sheet.  
The following constraints must be met during the placement of rectangular parts onto the motherboard:  
1. Different rectangular parts \(\pi_{i}\) and \(\pi_{j}\) must not overlap each other;
2. The rectangular piece \(\pi_{i}\) must be inside the motherboard \(S\);
3. The rectangular piece \(\pi_{i}\) can be rotated \(90^{\circ}\).  
This can be explained more in depth as follows: Assume that the width of the rectangular mother plate \(S\) is the \(x\)-axis, the height is the \(y\)-axis, and the plate's lower left corner is the origin of the \(x\), \(y\) coordinate system. Suppose that \(\{\pi_{1},\pi_{2},\cdots,\pi_{n}\}\) is a set of \(n\) rectangular pieces, and \(\pi_{i}=\{x_{i},y_{i},w_{i},h_{i},\theta_{i}\}\), \(i\in\{1,2,\cdots,n\}\), where \(x_{i}\) represents the horizontal coordinate of the bottom left corner of the part, \(y_{i}\) represents the vertical coordinate of the bottom left corner of the part, \(w_{i}\) represents the width of the part, and \(h_{i}\) represents the height of the part. \(\theta_{i}\) denotes the rotation angle of the part, and \(\pi_{i}\) is the rotation angle. To minimize gaps and overlaps between parts and maximize material utilization, rotation angles of \(0^{\circ}\) and \(90^{\circ}\) were selected, and \(\theta_{i}=\{0,2/\pi\}\). Therefore, the mathematical model of the two-dimensional rectangular layout problem can be established as follows:  
\[f=\max\frac{\sum_{i=1}^{n}\left(w_{i}\times h_{i}\right)}{W\times H} \tag{1}\]  
\[x_{i}+w_{i}\leqslant W,i=1,2,\cdots,n \tag{2}\]  
\[s.t\begin{cases}x_{i}\geqslant 0,y_{i}\geqslant 0\\ x_{i}+w_{i}\leqslant x_{j}\text{ \ or }x_{j}+w_{j}\leqslant x_{i}\\ y_{i}+h_{i}\leqslant y_{j}\text{ \ or }y_{j}+h_{i}\leqslant y_{i}\\ i\
eq j,and\ i,j=1,2,\cdots,n\end{cases} \tag{3}\]  
\[\theta_{i}=\{0,\pi/2\},i=1,2,\cdots,n \tag{4}\]  
Equation (1) represents the optimization objective function for a rectangular layout, which is the ratio of the area occupied by the parts on the master plate after placement. Equation (2) indicates that the parts should not exceed the boundary range of the master plate when placed. Equation (3) represents that there should be no overlapping between the placed parts. Equation (4) indicates that the parts can be rotated by \(90^{\circ}\).